Skip to content

Commit

Permalink
#20616 : Adding required code changes to dotCMS 5.3.8.6.1 LTS release.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcastro-dotcms committed Oct 13, 2021
1 parent f3f77ee commit c62ddfb
Show file tree
Hide file tree
Showing 12 changed files with 3,578 additions and 4,813 deletions.
6 changes: 2 additions & 4 deletions dotCMS/src/main/webapp/WEB-INF/velocity/VM_global_library.vm
Expand Up @@ -108,9 +108,7 @@

#macro(orderMenu)
#if ($EDIT_MODE && $PUBLISH_HTMLPAGE_PERMISSION)
#set($_formId="dot_form_menu_$date.date.time")
#set ($folder = $folderAPI.findCurrentFolder($startFromPath, $host))
#set ($menuId = $folder.inode)
#set($menuLevel = $VTLSERVLET_URI.split('/').size() - 1)

<a href="#" onclick="openReorderDialog(event)" class="btn btn-primary btn-xs normaltip" data-original-title="Reorder Menu">
<i class="fa fa-arrow-up"></i>
Expand All @@ -119,7 +117,7 @@
<script>
function openReorderDialog(event) {
event.preventDefault();
var reorderUrl = "${directorURL}&startLevel=1&depth=2&pagePath=${VTLSERVLET_URI}&hostId=${host.identifier}";
var reorderUrl = "${directorURL}&startLevel=${menuLevel}&depth=2&pagePath=${VTLSERVLET_URI}&hostId=${host.identifier}";
var customEvent = window.top.document.createEvent("CustomEvent");
customEvent.initCustomEvent("ng-event", false, false, {
name: "reorder-menu",
Expand Down
53 changes: 29 additions & 24 deletions dotCMS/src/main/webapp/html/js/scriptaculous/builder.js
@@ -1,6 +1,6 @@
// script.aculo.us builder.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
// script.aculo.us builder.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010

// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
Expand All @@ -26,29 +26,30 @@ var Builder = {
// due to a Firefox bug
node: function(elementName) {
elementName = elementName.toUpperCase();

// try innerHTML approach
var parentTag = this.NODEMAP[elementName] || 'div';
var parentElement = document.createElement(parentTag);
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
} catch(e) {}
var element = parentElement.firstChild || null;

// see if browser added wrapping tags
if(element && (element.tagName.toUpperCase() != elementName))
element = element.getElementsByTagName(elementName)[0];

// fallback to createElement approach
if(!element) element = document.createElement(elementName);

// abort if nothing could be created
if(!element) return;

// attributes (or text)
if(arguments[1])
if(this._isStringOrNumber(arguments[1]) ||
(arguments[1] instanceof Array)) {
(arguments[1] instanceof Array) ||
arguments[1].tagName) {
this._children(element, arguments[1]);
} else {
var attrs = this._attributes(arguments[1]);
Expand All @@ -61,19 +62,19 @@ var Builder = {
// workaround firefox 1.0.X bug
if(!element) {
element = document.createElement(elementName);
for(attr in arguments[1])
for(attr in arguments[1])
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
}
if(element.tagName.toUpperCase() != elementName)
element = parentElement.getElementsByTagName(elementName)[0];
}
}
}
}

// text, or array of children
if(arguments[2])
this._children(element, arguments[2]);

return element;
return $(element);
},
_text: function(text) {
return document.createTextNode(text);
Expand All @@ -88,21 +89,25 @@ var Builder = {
var attrs = [];
for(attribute in attributes)
attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
'="' + attributes[attribute].toString().escapeHTML() + '"');
'="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'&quot;') + '"');
return attrs.join(" ");
},
_children: function(element, children) {
if(children.tagName) {
element.appendChild(children);
return;
}
if(typeof children=='object') { // array can hold nodes and text
children.flatten().each( function(e) {
if(typeof e=='object')
element.appendChild(e)
element.appendChild(e);
else
if(Builder._isStringOrNumber(e))
element.appendChild(Builder._text(e));
});
} else
if(Builder._isStringOrNumber(children))
element.appendChild(Builder._text(children));
if(Builder._isStringOrNumber(children))
element.appendChild(Builder._text(children));
},
_isStringOrNumber: function(param) {
return(typeof param=='string' || typeof param=='number');
Expand All @@ -112,20 +117,20 @@ var Builder = {
$(element).update(html.strip());
return element.down();
},
dump: function(scope) {
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
dump: function(scope) {
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope

var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
tags.each( function(tag){
scope[tag] = function() {
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
}

tags.each( function(tag){
scope[tag] = function() {
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
};
});
}
}
};

0 comments on commit c62ddfb

Please sign in to comment.