Skip to content

Commit 0bbe7e5

Browse files
committed
32853: Upgraded legacy-build.min.js to the latest version
1 parent c9f8af4 commit 0bbe7e5

File tree

5 files changed

+45
-112
lines changed

5 files changed

+45
-112
lines changed

lib/web/legacy-build.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/web/mage/adminhtml/tools.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,6 @@ var Cookie = {
290290
var Fieldset = {
291291
cookiePrefix: 'fh-',
292292
applyCollapse: function (containerId) {
293-
//var collapsed = Cookie.read(this.cookiePrefix + containerId);
294-
//if (collapsed !== null) {
295-
// Cookie.clear(this.cookiePrefix + containerId);
296-
//}
297293
if ($(containerId + '-state')) {
298294
collapsed = $(containerId + '-state').value == 1 ? 0 : 1;
299295
} else {

lib/web/mage/adminhtml/varienLoader.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,6 @@ Ajax.Request.addMethods({
9595
});
9696

9797
Ajax.Updater.respondToReadyState = Ajax.Request.respondToReadyState;
98-
//Ajax.Updater = Object.extend(Ajax.Updater, {
99-
// initialize: function($super, container, url, options) {
100-
// this.container = {
101-
// success: (container.success || container),
102-
// failure: (container.failure || (container.success ? null : container))
103-
// };
104-
//
105-
// options = Object.clone(options);
106-
// var onComplete = options.onComplete;
107-
// options.onComplete = (function(response, json) {
108-
// this.updateContent(response.responseText);
109-
// if (Object.isFunction(onComplete)) onComplete(response, json);
110-
// }).bind(this);
111-
//
112-
// $super((url.match(new RegExp('\\?',"g")) ? url + '&isAjax=1' : url + '?isAjax=1'), options);
113-
// }
114-
//});
11598

11699
var varienLoader = new Class.create();
117100

@@ -212,14 +195,6 @@ function setLoaderPosition() {
212195
}
213196
}
214197

215-
/*function getRealHeight() {
216-
var body = document.body;
217-
if (window.innerHeight && window.scrollMaxY) {
218-
return window.innerHeight + window.scrollMaxY;
219-
}
220-
return Math.max(body.scrollHeight, body.offsetHeight);
221-
}*/
222-
223198
function toggleSelectsUnderBlock(block, flag) {
224199
if (Prototype.Browser.IE) {
225200
var selects = document.getElementsByTagName('select');

lib/web/prototype/window.js

Lines changed: 43 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2020
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
//
22-
// VERSION 1.3
22+
// VERSION 1.4b
2323

2424
var Window = Class.create();
2525

@@ -56,7 +56,6 @@ Window.prototype = {
5656

5757
this.options = Object.extend({
5858
className: "dialog",
59-
windowClassName: null,
6059
blurClassName: null,
6160
minWidth: 100,
6261
minHeight: 20,
@@ -80,7 +79,6 @@ Window.prototype = {
8079
opacity: 1,
8180
recenterAuto: true,
8281
wiredDrag: false,
83-
closeOnEsc: true,
8482
closeCallback: null,
8583
destroyOnClose: false,
8684
gridX: 1,
@@ -123,8 +121,6 @@ Window.prototype = {
123121
this.eventOnLoad = this._getWindowBorderSize.bindAsEventListener(this);
124122
this.eventMouseDownContent = this.toFront.bindAsEventListener(this);
125123
this.eventResize = this._recenter.bindAsEventListener(this);
126-
this.eventKeyUp = this._keyUp.bindAsEventListener(this);
127-
128124
this.topbar = $(this.element.id + "_top");
129125
this.bottombar = $(this.element.id + "_bottom");
130126
this.content = $(this.element.id + "_content");
@@ -135,7 +131,6 @@ Window.prototype = {
135131
Event.observe(window, "load", this.eventOnLoad);
136132
Event.observe(window, "resize", this.eventResize);
137133
Event.observe(window, "scroll", this.eventResize);
138-
Event.observe(document, "keyup", this.eventKeyUp);
139134
Event.observe(this.options.parent, "scroll", this.eventResize);
140135

141136
if (this.options.draggable) {
@@ -179,11 +174,8 @@ Window.prototype = {
179174
this.storedLocation = null;
180175

181176
this.setOpacity(this.options.opacity);
182-
if (this.options.zIndex) {
177+
if (this.options.zIndex)
183178
this.setZIndex(this.options.zIndex)
184-
} else {
185-
this.setZIndex(this.getMaxZIndex());
186-
}
187179

188180
if (this.options.destroyOnClose)
189181
this.setDestroyOnClose(true);
@@ -201,20 +193,6 @@ Window.prototype = {
201193
this.setTitle(this.options.title)
202194
Windows.register(this);
203195
},
204-
205-
getMaxZIndex: function() {
206-
var max = 0, i;
207-
var cn = document.body.childNodes;
208-
for (i = 0; i < cn.length; i++) {
209-
var el = cn[i];
210-
var zIndex = el.nodeType == 1 ? parseInt(el.style.zIndex, 10) || 0 : 0;
211-
if (zIndex < 10000) {
212-
max = Math.max(max, zIndex);
213-
}
214-
}
215-
return max + 10;
216-
},
217-
218196
// Destructor
219197
destroy: function() {
220198
this._notify("onDestroy");
@@ -225,9 +203,9 @@ Window.prototype = {
225203
Event.stopObserving(window, "load", this.eventOnLoad);
226204
Event.stopObserving(window, "resize", this.eventResize);
227205
Event.stopObserving(window, "scroll", this.eventResize);
206+
Event.stopObserving(this.options.parent, "scroll", this.eventResize);
228207

229208
Event.stopObserving(this.content, "load", this.options.onload);
230-
Event.stopObserving(document, "keyup", this.eventKeyUp);
231209

232210
if (this._oldParent) {
233211
var content = this.getContent();
@@ -248,7 +226,8 @@ Window.prototype = {
248226

249227
if (this.options.url)
250228
this.content.src = null
251-
229+
if (this.wiredElement)
230+
this.wiredElement.remove();
252231
if(this.iefix)
253232
Element.remove(this.iefix);
254233

@@ -304,8 +283,8 @@ Window.prototype = {
304283

305284
this.content = $(this.element.id + "_content");
306285
}
307-
308-
this.getContent().innerHTML = html;
286+
this.getContent().update(html);
287+
return this;
309288
},
310289

311290
setAjaxContent: function(url, options, showCentered, showModal) {
@@ -610,9 +589,6 @@ Window.prototype = {
610589
var win = document.createElement("div");
611590
win.setAttribute('id', id);
612591
win.className = "dialog";
613-
if (this.options.windowClassName) {
614-
win.className += ' ' + this.options.windowClassName;
615-
}
616592

617593
var content;
618594
if (this.options.url)
@@ -627,7 +603,6 @@ Window.prototype = {
627603
var blank = "../themes/default/blank.gif";
628604

629605
win.innerHTML = closeDiv + minDiv + maxDiv + "\
630-
<a href='#' id='"+ id +"_focus_anchor'><!-- --></a>\
631606
<table id='"+ id +"_row1' class=\"top table_window\">\
632607
<tr>\
633608
<td class='"+ className +"_nw'></td>\
@@ -660,10 +635,12 @@ Window.prototype = {
660635
changeClassName: function(newClassName) {
661636
var className = this.options.className;
662637
var id = this.getId();
663-
$A(["_close", "_minimize", "_maximize", "_sizer", "_content"]).each(function(value) { this._toggleClassName($(id + value), className + value, newClassName + value) }.bind(this));
638+
$A(["_close", "_minimize", "_maximize", "_content"]).each(function(value) { this._toggleClassName($(id + value), className + value, newClassName + value) }.bind(this));
664639
this._toggleClassName($(id + "_top"), className + "_title", newClassName + "_title");
665640
$$("#" + id + " td").each(function(td) {td.className = td.className.sub(className,newClassName); });
666641
this.options.className = newClassName;
642+
this._getWindowBorderSize();
643+
this.setSize(this.width, this.height)
667644
},
668645

669646
_toggleClassName: function(element, oldClassName, newClassName) {
@@ -822,7 +799,6 @@ Window.prototype = {
822799
this._checkIEOverlapping();
823800
WindowUtilities.focusedWindow = this
824801
this._notify("onShow");
825-
$(this.element.id + '_focus_anchor').focus();
826802
},
827803

828804
// Displays window modal state or not at the center of the page
@@ -917,12 +893,15 @@ Window.prototype = {
917893
},
918894

919895
minimize: function() {
920-
if (this.resizing)
896+
if (this.isMaximized() || this.resizing)
921897
return;
922898

899+
// Backward compatibility
900+
if (this.minimized) {
901+
this.restore();
902+
return;
903+
}
923904
var r2 = $(this.getId() + "_row2");
924-
925-
if (!this.minimized) {
926905
this.minimized = true;
927906

928907
var dh = r2.getDimensions().height;
@@ -936,13 +915,21 @@ Window.prototype = {
936915
this.element.setStyle({height: h + "px"});
937916
r2.hide();
938917
}
939-
940918
if (! this.useTop) {
941919
var bottom = parseFloat(this.element.getStyle('bottom'));
942920
this.element.setStyle({bottom: (bottom + dh) + 'px'});
943921
}
944-
}
945-
else {
922+
this._notify("onMinimize");
923+
924+
// Store new location/size if need be
925+
this._saveCookie()
926+
},
927+
928+
restore: function() {
929+
if (!this.minimized || this.resizing)
930+
return;
931+
932+
var r2 = $(this.getId() + "_row2");
946933
this.minimized = false;
947934

948935
var dh = this.r2Height;
@@ -961,11 +948,9 @@ Window.prototype = {
961948
this.element.setStyle({bottom: (bottom - dh) + 'px'});
962949
}
963950
this.toFront();
964-
}
965-
this._notify("onMinimize");
966951

967952
// Store new location/size if need be
968-
this._saveCookie()
953+
this._saveCookie();
969954
},
970955

971956
maximize: function() {
@@ -1013,8 +998,8 @@ Window.prototype = {
1013998
}
1014999
else {
10151000
this.setSize(width, height);
1016-
this.element.setStyle(this.useLeft ? {left: left} : {right: left});
1017-
this.element.setStyle(this.useTop ? {top: top} : {bottom: top});
1001+
this.element.setStyle(this.useLeft ? {left: left + "px"} : {right: left + "px"});
1002+
this.element.setStyle(this.useTop ? {top: top + "px"} : {bottom: top + "px"});
10181003
}
10191004

10201005
this.toFront();
@@ -1084,12 +1069,6 @@ Window.prototype = {
10841069
this.iefix.show();
10851070
},
10861071

1087-
_keyUp: function(event) {
1088-
if (27 == event.keyCode && this.options.closeOnEsc) {
1089-
this.close();
1090-
}
1091-
},
1092-
10931072
_getWindowBorderSize: function(event) {
10941073
// Hack to get real window border size!!
10951074
var div = this._createHiddenDiv(this.options.className + "_n")
@@ -1291,11 +1270,6 @@ var Windows = {
12911270
this.focusedWindow = this.windows.length >=2 ? this.windows[this.windows.length-2] : null;
12921271
},
12931272

1294-
// Registers a new window (called by Windows constructor)
1295-
register: function(win) {
1296-
this.windows.push(win);
1297-
},
1298-
12991273
// Add a modal window in the stack
13001274
addModalWindow: function(win) {
13011275
// Disable screen if first modal window
@@ -1449,14 +1423,13 @@ var Dialog = {
14491423

14501424
parameters.className = parameters.className || "alert";
14511425

1452-
var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'";
1453-
var cancelButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " cancel_button'";
1454-
1426+
var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'"
1427+
var cancelButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " cancel_button'"
14551428
var content = "\
14561429
<div class='" + parameters.className + "_message'>" + content + "</div>\
14571430
<div class='" + parameters.className + "_buttons'>\
1458-
<button type='button' title='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "><span><span><span>" + okLabel + "</span></span></span></button>\
1459-
<button type='button' title='" + cancelLabel + "' onclick='Dialog.cancelCallback()' " + cancelButtonClass + "><span><span><span>" + cancelLabel + "</span></span></span></button>\
1431+
<input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
1432+
<input type='button' value='" + cancelLabel + "' onclick='Dialog.cancelCallback()' " + cancelButtonClass + "/>\
14601433
</div>\
14611434
";
14621435
return this._openDialog(content, parameters)
@@ -1479,11 +1452,11 @@ var Dialog = {
14791452

14801453
parameters.className = parameters.className || "alert";
14811454

1482-
var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'";
1455+
var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'"
14831456
var content = "\
14841457
<div class='" + parameters.className + "_message'>" + content + "</div>\
14851458
<div class='" + parameters.className + "_buttons'>\
1486-
<button type='button' title='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "><span><span><span>" + okLabel + "</span></span></span></button>\
1459+
<input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
14871460
</div>";
14881461
return this._openDialog(content, parameters)
14891462
},
@@ -1525,7 +1498,7 @@ var Dialog = {
15251498
var className = parameters.className;
15261499

15271500
if (! parameters.height && ! parameters.width) {
1528-
parameters.width = WindowUtilities.getPageSize(parameters.options.parent || document.body).pageWidth / 2;
1501+
parameters.width = WindowUtilities.getPageSize((parameters.options && parameters.options.parent) || document.body).pageWidth / 2;
15291502
}
15301503
if (parameters.id)
15311504
this.dialogId = parameters.id;
@@ -1551,8 +1524,9 @@ var Dialog = {
15511524
parameters.closable = parameters.closable || false;
15521525

15531526
var win = new Window(parameters);
1554-
win.getContent().innerHTML = content;
1555-
1527+
if (!parameters.url) {
1528+
win.setHTMLContent(content);
1529+
}
15561530
win.showCenter(true, parameters.top, parameters.left);
15571531
win.setDestroyOnClose();
15581532

@@ -1678,7 +1652,7 @@ var WindowUtilities = {
16781652

16791653

16801654
if (self.innerHeight) { // all except Explorer
1681-
windowWidth = document.documentElement.clientWidth;//self.innerWidth;
1655+
windowWidth = self.innerWidth;
16821656
windowHeight = self.innerHeight;
16831657
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
16841658
windowWidth = document.documentElement.clientWidth;
@@ -1822,7 +1796,7 @@ var WindowUtilities = {
18221796

18231797
setCookie: function(value, parameters) {
18241798
document.cookie= parameters[0] + "=" + escape(value) +
1825-
((parameters[1]) ? "; expires=" + parameters[1].toUTCString() : "") +
1799+
((parameters[1]) ? "; expires=" + parameters[1].toGMTString() : "") +
18261800
((parameters[2]) ? "; path=" + parameters[2] : "") +
18271801
((parameters[3]) ? "; domain=" + parameters[3] : "") +
18281802
((parameters[4]) ? "; secure" : "");
@@ -1861,7 +1835,7 @@ var WindowUtilities = {
18611835
tmpObj.style.left = '0';
18621836
tmpObj.style.display = 'none';
18631837

1864-
tmpObj.innerHTML = content;
1838+
tmpObj.innerHTML = content.stripScripts();
18651839
objBody.insertBefore(tmpObj, objBody.firstChild);
18661840

18671841
var size;

lib/web/varien/js.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -586,18 +586,6 @@ Element.addMethods({
586586
}
587587
});
588588

589-
/*
590-
if (!("console" in window) || !("firebug" in console))
591-
{
592-
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
593-
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
594-
595-
window.console = {};
596-
for (var i = 0; i < names.length; ++i)
597-
window.console[names[i]] = function() {}
598-
}
599-
*/
600-
601589
/**
602590
* Executes event handler on the element. Works with event handlers attached by Prototype,
603591
* in a browser-agnostic fashion.

0 commit comments

Comments
 (0)