Skip to content

Commit

Permalink
Revert framework.pack.js scripts to version: richfaces-impl-3.2.1.GA_…
Browse files Browse the repository at this point in the history
…fix201907
  • Loading branch information
ViktarPatsiaichuk committed Jul 19, 2023
1 parent a725bda commit 5f36de2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ Sarissa._SARISSA_IS_SAFARI = navigator.userAgent.toLowerCase().indexOf("safari")
/** @private */
Sarissa._SARISSA_IS_SAFARI_OLD = Sarissa._SARISSA_IS_SAFARI && (parseInt((navigator.userAgent.match(/AppleWebKit\/(\d+)/)||{})[1], 10) < 420);
/** @private */
Sarissa._SARISSA_IS_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
Sarissa._SARISSA_IS_IE = (window.ActiveXObject && document.all && (navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1)) || (navigator.userAgent.toLowerCase().indexOf("trident") > -1);
/** @private */
Sarissa._SARISSA_IS_IE9 = Sarissa._SARISSA_IS_IE;
/** @private */
Sarissa._SARISSA_IS_OPERA = navigator.userAgent.toLowerCase().indexOf("opera") != -1;
if(!window.Node || !Node.ELEMENT_NODE){
Expand Down Expand Up @@ -458,7 +460,7 @@ if(Sarissa._SARISSA_IS_IE){
//==========================================
// Common stuff
//==========================================
if(!window.DOMParser){
if(!window.DOMParser || Sarissa._SARISSA_IS_IE9){
if(Sarissa._SARISSA_IS_SAFARI){
/*
* DOMParser is a utility class, used to construct DOMDocuments from XML strings
Expand Down Expand Up @@ -487,7 +489,7 @@ if(!window.DOMParser){
}
}

if((typeof(document.importNode) == "undefined") && Sarissa._SARISSA_IS_IE){
if(((typeof(document.importNode) == "undefined") && Sarissa._SARISSA_IS_IE) || Sarissa._SARISSA_IS_IE9){
try{
/**
* Implementation of importNode for the context window document in IE.
Expand Down Expand Up @@ -580,7 +582,7 @@ Sarissa.getText = function(oNode, deep){
}
return s;
};
if(!window.XMLSerializer && Sarissa.getDomDocument && Sarissa.getDomDocument("","foo", null).xml){
if((!window.XMLSerializer || Sarissa._SARISSA_IS_IE9) && Sarissa.getDomDocument && Sarissa.getDomDocument("","foo", null).xml){
/**
* Utility class to serialize DOM Node objects to XML strings
* @constructor
Expand Down Expand Up @@ -1330,7 +1332,8 @@ A4J.AJAX.XMLHttpRequest.prototype = {
LOG.error("Error to clear node content by innerHTML "+e.message);
Sarissa.clearChildNodes(oldnode);
}
oldnode.outerHTML = new XMLSerializer().serializeToString(newnode);
//oldnode.outerHTML = new XMLSerializer().serializeToString(newnode);
oldnode.outerHTML = (Sarissa._SARISSA_IS_IE && typeof newnode.xml != "undefined") ? newnode.xml : new XMLSerializer().serializeToString(newnode);
} else {
var importednode ;
// need to check for firstChild due to opera 8 bug with hasChildNodes
Expand Down Expand Up @@ -1819,7 +1822,7 @@ A4J.AJAX.processResponse = function(req) {
}
// Replace client-side hidden inputs for JSF View state.
var idsSpan = req.getElementById("ajax-view-state");
LOG.debug("Hidden JSF state fields: "+idsSpan);
// LOG.debug("Hidden JSF state fields: "+idsSpan);
if(idsSpan != null){
// For a portal case, replace content in the current window only.
var namespace = options.parameters['org.ajax4jsf.portlet.NAMESPACE'];
Expand Down Expand Up @@ -1867,7 +1870,7 @@ A4J.AJAX.processResponse = function(req) {
focusElement = document.getElementById(focusId);
}
if(focusElement){
LOG.debug("Set focus to control ");
// LOG.debug("Set focus to control ");
focusElement.focus();
if (focusElement.select) focusElement.select();
} else {
Expand Down Expand Up @@ -2369,7 +2372,12 @@ if (!document.all || window.opera){
// Simulate same calls as on XmlHttp
var oDomDoc = Sarissa.getDomDocument();
var _span = document.createElement("span");
document.documentElement.appendChild(_span);
//document.documentElement.appendChild(_span);
if (Prototype.Browser.WebKit || Prototype.Browser.Gecko) {
document.body.appendChild(_span);
} else {
document.documentElement.appendChild(_span);
}
// If script evaluated with used replace method, variable will be set to true
var xmlString = "<html xmlns='http://www.w3.org/1999/xhtml'><sc"+"ript>A4J.AJAX._scriptEvaluated=true;</scr"+"ipt></html>";
oDomDoc = (new DOMParser()).parseFromString(xmlString, "text/xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1317,8 +1317,8 @@ Ajax.Request = Class.create(Ajax.Base, {

var contentType = response.getHeader('Content-type');
if (this.options.evalJS == 'force'
|| (this.options.evalJS && this.isSameOrigin() && contentType
&& contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
|| (this.options.evalJS && contentType
&& contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
this.evalResponse();
}

Expand All @@ -1335,15 +1335,6 @@ Ajax.Request = Class.create(Ajax.Base, {
}
},

isSameOrigin: function() {
var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
protocol: location.protocol,
domain: document.domain,
port: location.port ? ':' + location.port : ''
}));
},

getHeader: function(name) {
try {
return this.transport.getResponseHeader(name);
Expand Down Expand Up @@ -1419,8 +1410,7 @@ Ajax.Response = Class.create({
if (!json) return null;
json = decodeURIComponent(escape(json));
try {
return json.evalJSON(this.request.options.sanitizeJSON ||
!this.request.isSameOrigin());
return json.evalJSON(this.request.options.sanitizeJSON);
} catch (e) {
this.request.dispatchException(e);
}
Expand All @@ -1432,8 +1422,7 @@ Ajax.Response = Class.create({
!(this.getHeader('Content-type') || '').include('application/json')))
return null;
try {
return this.transport.responseText.evalJSON(options.sanitizeJSON ||
!this.request.isSameOrigin());
return this.transport.responseText.evalJSON(options.sanitizeJSON);
} catch (e) {
this.request.dispatchException(e);
}
Expand Down Expand Up @@ -3729,7 +3718,13 @@ Event.Methods = (function() {
if (Prototype.Browser.IE) {
var buttonMap = { 0: 1, 1: 4, 2: 2 };
isButton = function(event, code) {
return event.button == buttonMap[code];
if (event.which) {
// var buttonMap_IE9 = { 0: 1, 1: 2, 2: 3};
// return event.which == buttonMap_IE9[code];
return event.which == { 0: 1, 1: 2, 2: 3}[code];
} else {
return event.button == buttonMap[code];
}
};

} else if (Prototype.Browser.WebKit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ Richfaces.SYNTHETIC_EVENT = "Richfaces.SYNTHETIC_EVENT";
Richfaces.createEvent = function (type, component, baseEvent, props) {
var eventObj;

if (document.createEventObject) {
if (baseEvent) {
eventObj = document.createEventObject(baseEvent);
} else {
eventObj = document.createEventObject();
}
} else {
if (document.createEvent) {
var bubbles = baseEvent && baseEvent.bubbles || false;
var cancelable = baseEvent && baseEvent.cancelable || true;

Expand Down Expand Up @@ -107,6 +101,12 @@ Richfaces.createEvent = function (type, component, baseEvent, props) {
eventObj = document.createEvent('Events');
eventObj.initEvent(type, bubbles, cancelable);
}
} else if (document.createEventObject) {
if (baseEvent) {
eventObj = document.createEventObject(baseEvent)
} else {
eventObj = document.createEventObject()
}
}

if (props) {
Expand All @@ -118,10 +118,10 @@ Richfaces.createEvent = function (type, component, baseEvent, props) {
return {
event: eventObj,
fire: function() {
if (component.fireEvent) {
if (component.dispatchEvent) {
component.dispatchEvent(this.event)
} else if (component.fireEvent) {
component.fireEvent("on" + type, this.event);
} else {
component.dispatchEvent(this.event);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ window.$ = jQuery;

// A simple way to check for HTML strings or ID strings
// Strict HTML recognition (#11290: must start with <)
var quickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/;
var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;

// Is it a simple selector
var isSimple = /^.[^:#\[\.]*$/;
Expand Down Expand Up @@ -595,7 +595,8 @@ jQuery.extend = jQuery.fn.extend = function() {

// Prevent Object.prototype pollution
// Prevent never-ending loop
if ( name === "__proto__" || target === options[ name ] )
//if ( name === "__proto__" || target === options[ name ] )
if ( target === options[ name ] )
continue;

// Recurse if we're merging object values
Expand Down Expand Up @@ -2555,14 +2556,6 @@ jQuery.extend({
_default: "*/*"
}
},

// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
ajaxPrefilter: function( s ) {
if ( s.crossDomain ) {
s.contents.script = false;
}
},

// Last-Modified header cache for next request
lastModified: {},

Expand Down

0 comments on commit 5f36de2

Please sign in to comment.