diff --git a/src/main/webapp/WEB-INF/hibernate.cfg.xml b/src/main/webapp/WEB-INF/hibernate.cfg.xml index ecd2191f0..63c030bb0 100644 --- a/src/main/webapp/WEB-INF/hibernate.cfg.xml +++ b/src/main/webapp/WEB-INF/hibernate.cfg.xml @@ -4,15 +4,10 @@ - - - + diff --git a/src/main/webapp/WEB-INF/struts-config.xml b/src/main/webapp/WEB-INF/struts-config.xml index a8c3b93b5..93baadb36 100644 --- a/src/main/webapp/WEB-INF/struts-config.xml +++ b/src/main/webapp/WEB-INF/struts-config.xml @@ -7,23 +7,9 @@ - - - - + + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 2a6ab7c45..f1fe395bc 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -29,8 +29,7 @@ - + that enables cross-origin requests. TODO [CELDEV-1169] instead use Spring MVC @CrossOrigin when struts is replaced --> CorsFilter org.apache.catalina.filters.CorsFilter @@ -174,9 +173,9 @@ redirectHomeServlet com.xpn.xwiki.web.HomePageRedirectServlet - - + The address to redirect to when the client hits the root of the application. homePage @@ -230,23 +229,6 @@ /api/* - - - js - text/javascript - - - - mjs - text/javascript - - - - css - text/css - - htc @@ -258,6 +240,13 @@ image/bmp + + + redirect + + 404 /DocumentDoesNotExist diff --git a/src/main/webapp/docs/celements2web/Panels/ClassEditorWelcome.xml b/src/main/webapp/docs/celements2web/Panels/ClassEditorWelcome.xml index f9978efbc..539ef67f9 100644 --- a/src/main/webapp/docs/celements2web/Panels/ClassEditorWelcome.xml +++ b/src/main/webapp/docs/celements2web/Panels/ClassEditorWelcome.xml @@ -104,44 +104,8 @@ Information -#largepanelheader($msg.get("classEditorIntro")) -##$xwiki.jsx.use('Panels.ClassSwitcher')## -<p>$msg.get("xe.panels.classedit.youare") <strong>${doc.fullName}</strong>. $msg.get("xe.panels.classedit.chooseproperty")</p> -<div> -<form id="changeclass" method="post" action="$doc.getURL("redirect")"> -<div> -<select id="classname" name="xredirect" size="1"> -<option value="-">Edit another class</option> -## -## Existing classes are enumerated, grouped by space name. -## The list is already sorted alphabetically -## -#set($prevSpace = "") -#set($optGroupOpen = false) -#foreach ($classname in $xwiki.classList) - #if($!xwiki.hasAccessLevel("edit", $classname)) - #set($classdoc = $xwiki.getDocument($classname)) - #if($classdoc.space != $prevSpace) - #if($optGroupOpen) - </optgroup> - #else - #set($optGroupOpen = true) - #end - <optgroup label="$classdoc.space"> - #set($prevSpace = $classdoc.space) - #end - <option value="$classdoc.getURL("edit", "editor=class")">$classdoc.name</option> - #end -#end -#if($optGroupOpen) - </optgroup> -#end -</select> -<span class="buttonwrapper"><input class="button" type="submit" value="$msg.get("changeclass")"/></span></div> -#warning($msg.get('xe.panels.classedit.unsavedchanges')) -</form> -</div> -#panelfooter() +#largepanelheader($msg.get("classEditorIntro"))

$msg.get("xe.panels.classedit.youare") +${doc.fullName}. $msg.get("xe.panels.classedit.chooseproperty")

#panelfooter()
Class Editor welcome and brief information message. @@ -153,4 +117,5 @@ edit -#includeForm("Panels.PanelSheet") +#includeForm("Panels.PanelSheet") + diff --git a/src/main/webapp/docs/celements2web/Panels/ClassSwitcher.xml b/src/main/webapp/docs/celements2web/Panels/ClassSwitcher.xml index 7ce7d06f8..9a4eb20f0 100644 --- a/src/main/webapp/docs/celements2web/Panels/ClassSwitcher.xml +++ b/src/main/webapp/docs/celements2web/Panels/ClassSwitcher.xml @@ -105,7 +105,6 @@ #largepanelheader('Class Switcher') -##$xwiki.jsx.use('Panels.ClassSwitcher')## <div> <form id="changeclass" method="post" action="$doc.getURL("redirect")"> <div> @@ -118,25 +117,26 @@ #set($prevSpace = "") #set($optGroupOpen = false) #foreach ($classname in $xwiki.classList) - #if($!xwiki.hasAccessLevel("edit", $classname)) - #set($classdoc = $xwiki.getDocument($classname)) - #if($classdoc.space != $prevSpace) - #if($optGroupOpen) - </optgroup> - #else - #set($optGroupOpen = true) - #end - <optgroup label="$classdoc.space"> - #set($prevSpace = $classdoc.space) - #end - <option value="$classdoc.getURL("edit", "editor=class")">$classdoc.name</option> - #end +#if($!xwiki.hasAccessLevel("edit", $classname)) +#set($classdoc = $xwiki.getDocument($classname)) +#if($classdoc.space != $prevSpace) +#if($optGroupOpen) +</optgroup> +#else +#set($optGroupOpen = true) +#end +<optgroup label="$classdoc.space"> +#set($prevSpace = $classdoc.space) +#end +<option value="$classdoc.getURL("edit", "editor=class")">$classdoc.name</option> +#end #end #if($optGroupOpen) - </optgroup> +</optgroup> #end </select> -<span class="buttonwrapper"><input class="button" type="submit" value="$msg.get("changeclass")"/></span></div> +<span class="buttonwrapper"><input class="button" type="submit" +value="$msg.get("changeclass")"/></span></div> #warning($msg.get('xe.panels.classedit.unsavedchanges')) </form> </div> @@ -152,108 +152,5 @@ edit - - -XWiki.JavaScriptExtension - - - - - - - - -0 -0 -select -0 -cache -5 -Caching policy -0 - - ,| -1 -0 -long|short|default|forbid -com.xpn.xwiki.objects.classes.StaticListClass - - -0 -code -2 -Code -20 -50 -0 -com.xpn.xwiki.objects.classes.TextAreaClass - - -0 -name -1 -Name -30 -0 -com.xpn.xwiki.objects.classes.StringClass - - -0 -select -yesno -parse -4 -Parse content -0 -com.xpn.xwiki.objects.classes.BooleanClass - - -0 -0 -select -0 -use -3 -Use this extension -0 - - ,| -1 -0 -onDemand=On demand|always=Always -com.xpn.xwiki.objects.classes.StaticListClass - - -Panels.ClassSwitcher -0 -XWiki.JavaScriptExtension -951b5864-df3e-46d0-bdbe-bac923e58dc8 - -long - - -document.observe('dom:loaded', function() { - var switcher = $('classname'); - if(typeof (switcher) != 'undefined') { - switcher.observe('change', function() { - var value = this.options[this.selectedIndex].value; - if (value != '-') { - window.self.location = value; - } - }.bindAsEventListener(switcher)); - switcher.up('form').down("input[type='submit']").hide(); - } -}); - - - -Instant class switcher - - -0 - - -onDemand - - -#includeForm("Panels.PanelSheet") +#includeForm("Panels.PanelSheet") + diff --git a/src/main/webapp/docs/xwiki/XWiki/XWikiGroupSheet.xml b/src/main/webapp/docs/xwiki/XWiki/XWikiGroupSheet.xml index de4e78be1..614fd370e 100644 --- a/src/main/webapp/docs/xwiki/XWiki/XWikiGroupSheet.xml +++ b/src/main/webapp/docs/xwiki/XWiki/XWikiGroupSheet.xml @@ -58,13 +58,13 @@ $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/table/livetable.js $services.css.includeCSSPage(':js/xwiki/table/livetable.css')## #set($groupDoc = $doc) #if($doc.fullName == 'Main.UserDirectory') - #set($groupDoc = $xwiki.getDocument('XWiki.XWikiAllGroup')) +#set($groupDoc = $xwiki.getDocument('XWiki.XWikiAllGroup')) #end #macro(hasEditGroupRight) - #set($hasEditGroupRight = false) - #if($hasAdmin && $doc.getObject('XWiki.XWikiGroups', false)) - #set($hasEditGroupRight = true) - #end +#set($hasEditGroupRight = false) +#if($hasAdmin && $doc.getObject('XWiki.XWikiGroups', false)) +#set($hasEditGroupRight = true) +#end #end #hasEditGroupRight() ## @@ -74,148 +74,134 @@ $services.css.includeCSSPage(':js/xwiki/table/livetable.css')## {{velocity}} #if($xcontext.action == 'inline' && $hasEditGroupRight) {{html}} - <div id="addNewMember"> - <table> - <tr> - <td class="addlabel">$msg.get('xe.admin.groups.addUser') - #if(!$mainwk) - </td> - <td><select name="wiki" onchange="changeWiki(this);"> - <option value="local" selected="selected">$msg.get('xe.admin.local')</option> - <option value="global">$msg.get('xe.admin.global')</option> - </select> - </td> - #else - <input type="hidden" name="wiki" value="local" /></td> - #end - <td> - <input id="userSuggest" type="text" size="30" name="newMember" autocomplete="off" /> - </td> - <td> - <input type="button" id="addNewUser" class="button" value="$msg.get('xe.admin.groups.addUser.submit')" /> - </td> - </tr> - <tr> - <td class="addlabel">$msg.get('xe.admin.groups.addGroup') - #if(!$mainwk) - </td> - <td><select name="wiki" onchange="changeWiki(this);"> - <option value="local" selected="selected">$msg.get('xe.admin.local')</option> - <option value="global">$msg.get('xe.admin.global')</option> - </select> - </td> - #else - <input type="hidden" name="wiki" value="local" /></td> - #end - <td> - <input id="groupSuggest" type="text" size="30" name="newMember" autocomplete="off" /> - </td> - <td> - <input type="button" id="addNewGroup" class="button" value="$msg.get('xe.admin.groups.addGroup.submit')" /> - </td> - </tr> - <tr><td colspan="3" id="errMsg"></td></tr> - </table> - </div> - ## - ## - <script type="text/javascript"> - // <![CDATA[ - if (typeof XWiki == "undefined") { - var XWiki = {}; - } - Object.extend(XWiki, { - groupmanager : { - /* - ** Initialize Group Manager javascript widgets (called on document load). - */ - userSuggest: null, - - groupSuggest: null, +<div id="addNewMember"> +<table> +<tr> +<td class="addlabel">$msg.get('xe.admin.groups.addUser') +#if(!$mainwk) +</td> +<td><select name="wiki" onchange="changeWiki(this);"> +<option value="local" selected="selected">$msg.get('xe.admin.local')</option> +<option value="global">$msg.get('xe.admin.global')</option> +</select> +</td> +#else +<input type="hidden" name="wiki" value="local" /></td> +#end +<td> +<input id="userSuggest" type="text" size="30" name="newMember" autocomplete="off" /> +</td> +<td> +<input type="button" id="addNewUser" class="button" value="$msg.get('xe.admin.groups.addUser.submit')" /> +</td> +</tr> +<tr> +<td class="addlabel">$msg.get('xe.admin.groups.addGroup') +#if(!$mainwk) +</td> +<td><select name="wiki" onchange="changeWiki(this);"> +<option value="local" selected="selected">$msg.get('xe.admin.local')</option> +<option value="global">$msg.get('xe.admin.global')</option> +</select> +</td> +#else +<input type="hidden" name="wiki" value="local" /></td> +#end +<td> +<input id="groupSuggest" type="text" size="30" name="newMember" autocomplete="off" /> +</td> +<td> +<input type="button" id="addNewGroup" class="button" value="$msg.get('xe.admin.groups.addGroup.submit')" /> +</td> +</tr> +<tr><td colspan="3" id="errMsg"></td></tr> +</table> +</div> +## +## +<script type="text/javascript"> +// <![CDATA[ +if (typeof XWiki == "undefined") { +var XWiki = {}; +} +Object.extend(XWiki, { +groupmanager : { +/* +** Initialize Group Manager javascript widgets (called on document load). +*/ +userSuggest: null, - init: function() { - if (XWiki.contextaction != 'view') { - this.initSuggestWidget(); - this.initAddNewMemberWidget(); - } - }, - initSuggestWidget: function() { - if ($('userSuggest')) { - $('userSuggest').observe('focus', this.createSuggest.bind(this, $('userSuggest'), 'user', true)); - } - if ($('groupSuggest')) { - $('groupSuggest').observe('focus', this.createSuggest.bind(this, $('groupSuggest'), 'group', false)); - } - }, - initAddNewMemberWidget: function() { - if ($('addNewUser')) { - $('addNewUser').observe('click', this.addNewMember.bind(this, 'user', $('userSuggest'))); - } - if ($('addNewGroup')) { - $('addNewGroup').observe('click', this.addNewMember.bind(this, 'group', $('groupSuggest'))); - } - }, - createSuggest: function(input, uorg, suggestObj) { - // Clear the errors - $('errMsg').innerHTML = ""; - suggesturl = "${doc.getURL('view', 'xpage=uorgsuggest&classname=XWiki.XWikiUsers&wiki=local')}"; +groupSuggest: null, - if (uorg == "user") { - suggesturl += "&uorg=user&"; - icon = "$xwiki.getSkinFile('icons/silk/user.gif')"; - } else { - suggesturl += "&uorg=group&"; - icon = "$xwiki.getSkinFile('icons/silk/group.gif')"; - } - return new XWiki.widgets.Suggest(input, { script: suggesturl, varname:'input', icon:icon }); - }, - addNewMember: function(uorg, input) { - if (input) { - var url = "${doc.getURL()}?xpage=adduorg&uorg=" + uorg + "&name=" + input.value; - new Ajax.Request(url, { - method: 'get', - onSuccess: function(transport) { - $('userSuggest').value = ""; - $('groupSuggest').value = ""; - var nr = parseInt(transport.responseText); - if (nr == 0) { - if (uorg == "user") { - $('errMsg').innerHTML = "$msg.get('xe.admin.groups.addUser.duplicate')"; - } else { - $('errMsg').innerHTML = "$msg.get('xe.admin.groups.addGroup.duplicate')"; - } - } else { - var end = editgrouptable.limit; - var start = editgrouptable.lastOffset; - editgrouptable.clearCache(); - if (start < 1) { - start = 1; - } - editgrouptable.getRows(start, end, start, end); - } - } - }); - } - } - } - }); - XWiki.groupmanager.init(); - // ]]> - </script> +init: function() { +if (XWiki.contextaction != 'view') { +this.initSuggestWidget(); +this.initAddNewMemberWidget(); +} +}, +initSuggestWidget: function() { +if ($('userSuggest')) { +$('userSuggest').observe('focus', this.createSuggest.bind(this, $('userSuggest'), 'user', true)); +} +if ($('groupSuggest')) { +$('groupSuggest').observe('focus', this.createSuggest.bind(this, $('groupSuggest'), 'group', false)); +} +}, +initAddNewMemberWidget: function() { +if ($('addNewUser')) { +$('addNewUser').observe('click', this.addNewMember.bind(this, 'user', $('userSuggest'))); +} +if ($('addNewGroup')) { +$('addNewGroup').observe('click', this.addNewMember.bind(this, 'group', $('groupSuggest'))); +} +}, +addNewMember: function(uorg, input) { +if (input) { +var url = "${doc.getURL()}?xpage=adduorg&uorg=" + uorg + "&name=" + input.value; +new Ajax.Request(url, { +method: 'get', +onSuccess: function(transport) { +$('userSuggest').value = ""; +$('groupSuggest').value = ""; +var nr = parseInt(transport.responseText); +if (nr == 0) { +if (uorg == "user") { +$('errMsg').innerHTML = "$msg.get('xe.admin.groups.addUser.duplicate')"; +} else { +$('errMsg').innerHTML = "$msg.get('xe.admin.groups.addGroup.duplicate')"; +} +} else { +var end = editgrouptable.limit; +var start = editgrouptable.lastOffset; +editgrouptable.clearCache(); +if (start < 1) { +start = 1; +} +editgrouptable.getRows(start, end, start, end); +} +} +}); +} +} +} +}); +XWiki.groupmanager.init(); +// ]]> +</script> {{/html}}#end #set($columnOptions = { - "member" : {'link': 'auto', 'type': 'text'}, - '_avatar' : { 'type' : 'none', 'link' : 'field', 'html' : 'true', 'sortable' : false }, - "_actions" : { - 'actions': ['delete'], - 'actionCallbacks': {'delete': 'table.deleteRow(i);'}, - 'ajaxActions': {'delete': true} - } +"member" : {'link': 'auto', 'type': 'text'}, +'_avatar' : { 'type' : 'none', 'link' : 'field', 'html' : 'true', 'sortable' : false }, +"_actions" : { +'actions': ['delete'], +'actionCallbacks': {'delete': 'table.deleteRow(i);'}, +'ajaxActions': {'delete': true} +} }) #if($hasAdmin && $xcontext.action == 'inline' && $hasEditGroupRight) - #set($columns = ['_avatar', 'member', '_actions']) +#set($columns = ['_avatar', 'member', '_actions']) #else - #set($columns = ['_avatar', 'member']) +#set($columns = ['_avatar', 'member']) #end #livetable('groupusers', $columns, $columnOptions, {'url' : "${groupDoc.getURL('view', 'xpage=getgroupmembers')}", 'translationPrefix' : 'xe.admin.groups.', 'javascriptName' : 'editgrouptable'}) {{/velocity}} diff --git a/src/main/webapp/resources/celJS/bootstrap/bootstrap-multiselect.css b/src/main/webapp/resources/celJS/bootstrap/bootstrap-multiselect.css index 6d821ac22..fd60dd02a 100644 --- a/src/main/webapp/resources/celJS/bootstrap/bootstrap-multiselect.css +++ b/src/main/webapp/resources/celJS/bootstrap/bootstrap-multiselect.css @@ -28,41 +28,33 @@ .open > .multiselect-container.dropdown-menu { display: block; } - .multiselect-container { position: absolute; list-style-type: none; margin: 0; padding: 0; } - .multiselect-container .input-group { margin: 5px; } - .multiselect-container > li { padding: 0; } - .multiselect-container > li > a.multiselect-all label { font-weight: 700; } - .multiselect-container > li.multiselect-group label { margin: 0; padding: 3px 20px 3px 20px; height: 100%; font-weight: 700; } - .multiselect-container > li.multiselect-group-clickable label { cursor: pointer; } - .multiselect-container > li > a { padding: 0; } - .multiselect-container > li > a > label { margin: 0; height: 100%; @@ -70,28 +62,23 @@ font-weight: 400; padding: 3px; } - .multiselect-container > li > a > label.radio, .multiselect-container > li > a > label.checkbox { margin: 0; } - .multiselect-container > li > a > label > input[type=checkbox] { margin-bottom: 5px; } - .btn-group > .btn-group:nth-child(2) > .multiselect.btn { border-top-left-radius: 4px; border-bottom-left-radius: 4px; } - .form-inline .multiselect-container label.checkbox, .form-inline .multiselect-container label.radio { padding: 3px 20px 3px 40px; } - .form-inline .multiselect-container li a label.checkbox input[type=checkbox], .form-inline .multiselect-container li a label.radio input[type=radio] { margin-left: -20px; margin-right: 0; -} \ No newline at end of file +} diff --git a/src/main/webapp/resources/celJS/initCelements.min.js b/src/main/webapp/resources/celJS/initCelements.min.js index 950a42f9e..8796d2ff7 100644 --- a/src/main/webapp/resources/celJS/initCelements.min.js +++ b/src/main/webapp/resources/celJS/initCelements.min.js @@ -1 +1 @@ -(function (window, undefined) { "use strict"; if (typeof window.console === "undefined") { window.console = {} } if (typeof window.console.error === "undefined") { window.console.error = Prototype.emptyFunction } if (typeof window.console.warn === "undefined") { window.console.warn = window.console.error } if (typeof window.console.info === "undefined") { window.console.info = window.console.warn } if (typeof window.console.log === "undefined") { window.console.log = window.console.info } if (typeof window.console.debug === "undefined") { window.console.debug = window.console.log } if (typeof window.CELEMENTS === "undefined") { window.CELEMENTS = {} } if (typeof window.CELEMENTS.mixins === "undefined") { window.CELEMENTS.mixins = {} } if (typeof window.CELEMENTS.mixins.Event === "undefined") { window.CELEMENTS.mixins.Event = Class.create({ memo: undefined, stopped: undefined, eventName: undefined, type: undefined, detail: undefined, cancelable: undefined, defaultPrevented: undefined, target: undefined, initialize: function (eventName, memo, target) { this.memo = memo; this.eventName = eventName; this.stopped = false; this.type = eventName; this.detail = memo; this.cancelable = true; this.defaultPrevented = false; this.target = target || (memo ? memo.target : null) }, stop: function () { if (this.cancelable) { this.stopped = true; this.defaultPrevented = true } }, preventDefault: function () { this.stop() }, findElement: function () { return this.target } }) } if (typeof window.CELEMENTS.mixins.Observable === "undefined") { window.CELEMENTS.mixins.Observable = { _celEventMap: null, _getCelEventMap: function (eventKey) { if (!this._celEventMap) { this._celEventMap = new Map } if (eventKey) { if (!this._celEventMap.has(eventKey)) { this._celEventMap.set(eventKey, []) } return this._celEventMap.get(eventKey) } return this._celEventMap }, celObserve: function (eventKey, callbackFN) { console.debug("cel celObserve:", eventKey, callbackFN); if (!eventKey) { throw "undefined eventKey in celObserve call" } this._getCelEventMap(eventKey).push(callbackFN) }, celStopObserving: function (eventKey, callbackFN) { console.debug("cel celStopObserving:", eventKey, callbackFN); if (!eventKey) { throw "undefined eventKey in celStopObserving call" } this._getCelEventMap().set(eventKey, this._getCelEventMap(eventKey).filter(function (fn) { return fn !== callbackFN })) }, celFire: function (eventKey, memo) { if (!eventKey) { throw "undefined eventKey in celFire call" } const event = new CELEMENTS.mixins.Event(eventKey, memo, this); const listeners = this._getCelEventMap(eventKey); console.debug("cel celFire:", event, "on", listeners); listeners.forEach(function (callbackFN) { try { callbackFN(event) } catch (exp) { console.error("listener in celFire failed for event", eventKey, callbackFN, exp) } }); return event } } } let celOnBeforeLoadListenerArray = []; window.celAddOnBeforeLoadListener = function (listenerFunc) { console.warn("celAddOnBeforeLoad is deprecated since open-celements 5.4 / January 2022." + ' Instead register a listener on "DOMContentLoaded"', listenerFunc); celOnBeforeLoadListenerArray.push(listenerFunc) }; document.addEventListener("DOMContentLoaded", function () { celOnBeforeLoadListenerArray.forEach(function (listener) { try { listener() } catch (e) { console.error("Listener for celOnBeforeLoad failed: ", e) } }); $(document.body).fire("celements:beforeOnLoad") }); let celOnFinishHeaderListenerArray = []; window.celAddOnFinishHeaderListener = function (listenerFunc) { celOnFinishHeaderListenerArray.push(listenerFunc) }; window.celFinishHeaderHandler = function () { celOnFinishHeaderListenerArray.forEach(function (listener) { try { listener() } catch (exp) { console.error("Failed to execute celOnFinishHeader listener. ", exp) } }) }; if (typeof window.getCelDomain === "undefined") { window.getCelDomain = function () { const hostName = window.location.host; return hostName.replace(/^www\./, "") } } if (typeof window.CELEMENTS.LoadingIndicator === "undefined") { window.CELEMENTS.LoadingIndicator = Class.create({ _loadingImg: undefined, initialize: function () { const _me = this; _me._loadingImg = new Hash }, getLoadingIndicator: function (isSmallOrPxSize) { const _me = this; let loaderType = "ajax-loader-32px"; if (typeof isSmallOrPxSize === "boolean") { if (isSmallOrPxSize) { loaderType = "ajax-loader-16px" } } else if (typeof isSmallOrPxSize === "number") { loaderType = "ajax-loader-" + isSmallOrPxSize + "px" } if (!_me._loadingImg.get(loaderType)) { _me._loadingImg.set(loaderType, new Element("img", { src: CELEMENTS.getUtils().getPathPrefix() + "/file/resources/celRes/spinner/" + loaderType + ".png", class: "editorLoading", alt: "loading..." })) } return _me._loadingImg.get(loaderType).clone() } }) } if (typeof window.CELEMENTS.Utils === "undefined") { window.CELEMENTS.Utils = Class.create({ _srcOriginHost: undefined, getPathPrefix: function () { const _me = this; if (!_me._srcOriginHost) { let srcOriginHost = null; const scripts = document.getElementsByTagName("script"); let len = scripts.length; const re = new RegExp("(https?://[^/]*)/(([^/]*/)*)resources/celJS/initCelements(.min)?\\.js(\\?.*)?$"); let src; while (len--) { src = scripts[len].src; const srcMatches = src.match(re); if (src && srcMatches) { srcOriginHost = srcMatches[1]; const prefixPath = srcMatches[2]; const prefixPathSplit = prefixPath.split("/"); const prefixStr = prefixPathSplit.splice(0, prefixPathSplit.length - 2).join("/"); if (prefixStr != "") { srcOriginHost += "/" + prefixStr } break } } console.log("getPathPrefix computed prefixPath: ", srcOriginHost); _me._srcOriginHost = srcOriginHost } return _me._srcOriginHost }, convertFullNameToViewURL: function (fullName) { const _me = this; return _me.getPathPrefix() + ("/" + fullName.replace(/\./, "/")).replace(/\/Content\//, "/") } }); const globalUtilsInstance = new window.CELEMENTS.Utils; window.CELEMENTS.getUtils = function () { return globalUtilsInstance } } if (typeof window.CELEMENTS.getPathPrefix === "undefined") { window.CELEMENTS.getPathPrefix = function () { console.warn("deprecated call of window.CELEMENTS.getPathPrefix." + " Instead use window.CELEMENTS.getUtils().getPathPrefix()"); return window.CELEMENTS.getUtils().getPathPrefix() } } if (typeof window.getCelHost === "undefined") { window.getCelHost = function () { let celHost = document.location + "?"; if (document.location.pathname.indexOf("/skin/resources/") > -1) { celHost = celHost.substring(0, celHost.indexOf("/skin/resources/")) } else if (document.location.pathname.indexOf("/file/resources/") > -1) { celHost = celHost.substring(0, celHost.indexOf("/file/resources/")) } else { celHost = celHost.substring(0, celHost.indexOf("?")) } return celHost } } if (typeof window.CELEMENTS.Ajax === "undefined") { window.CELEMENTS.Ajax = {} } if (typeof window.CELEMENTS.Ajax.Reconnector === "undefined") { window.CELEMENTS.Ajax.Reconnector = Class.create({ _htmlElem: undefined, _callbackOnSuccess: undefined, _reconnectWait: undefined, _reconnectorHandlerBind: undefined, _cancelAjaxOnTimeoutBind: undefined, _reconnectorExecuter: undefined, _reconnectWaitStart: undefined, _minReconnectWait: undefined, _maxReconnectWait: undefined, _url: undefined, _configObj: undefined, initialize: function (htmlElemId, callbackOnSuccess, configObj) { const _me = this; _me._htmlElem = $(htmlElemId); _me._configObj = configObj || {}; _me._url = _me._configObj.url || window.getCelHost(); _me._callbackOnSuccess = callbackOnSuccess; _me._reconnectorHandlerBind = _me._reconnectorHandler.bind(_me); _me._cancelAjaxOnTimeoutBind = _me._cancelAjaxOnTimeout.bind(_me); _me._minReconnectWait = _me._configObj.minReconnectWait || 10; _me._maxReconnectWait = _me._configObj.maxReconnectWait || 30; _me._reset() }, _reset: function () { const _me = this; _me._reconnectWaitStart = _me._minReconnectWait }, setMinRecconectWait: function (minReconnectWait) { const _me = this; _me._minReconnectWait = minReconnectWait }, setMaxRecconectWait: function (maxReconnectWait) { const _me = this; _me._maxReconnectWait = maxReconnectWait }, _fireAjaxRecconectTrying: function () { const _me = this; return _me._htmlElem.fire("celements:AjaxReconnectTrying", _me._reconnectWait) }, _reconnectorHandler: function () { const _me = this; _me._reconnectWait--; if (_me._reconnectWait == 0) { _me._reconnectorExecuter.stop(); if (!_me._fireAjaxRecconectTrying().stopped && !_me._configObj.skipRetryMsg) { let mesg = "Trying..."; if (window.celMessages && window.celMessages.Reconnector) { mesg = window.celMessages.Reconnector.retryNotice } _me._htmlElem.update(mesg) } _me._connectionTester() } else { if (!_me._fireAjaxRecconectTrying().stopped && !_me._configObj.skipRetryMsg) { let mesg = "Retrying in {} seconds."; if (window.celMessages && window.celMessages.Reconnector) { mesg = window.celMessages.Reconnector.retryDelayNotice } mesg = mesg.replace("{}", _me._reconnectWait); _me._htmlElem.update(mesg); _me._htmlElem.fire("celements:AjaxReconnectFailed") } } }, start: function () { const _me = this; _me._reconnectWait = _me._reconnectWaitStart; _me._reconnectorExecuter = new PeriodicalExecuter(_me._reconnectorHandlerBind, 1) }, _cancelAjaxOnTimeout: function (ajaxCall) { if (!ajaxCall._complete) { ajaxCall.transport.abort() } }, _connectionTester: function () { const _me = this; const connectionTestAjax = new Ajax.Request(_me._url, { parameters: { ajax: 1, xpage: "celements_ajax", ajax_mode: "pageTypeWithLayout", overwriteLayout: "SimpleLayout" }, onSuccess: function () { _me._reset(); _me._reconnectorExecuter = null; _me._callbackOnSuccess(); _me._htmlElem.fire("celements:AjaxReconnectSuccess") }, onFailure: function () { _me._reconnectWaitStart = Math.min(_me._reconnectWaitStart * 2, _me._maxReconnectWait); _me.start() } }); _me._cancelAjaxOnTimeoutBind.delay(10, connectionTestAjax) } }) } window.CELEMENTS.UrlUtils = Class.create({ getParams: function (search) { const _me = this; search = search || window.location.search; const paramSplit = search.split(new RegExp("[?&]")); paramSplit.unshift(new Hash); return paramSplit.reduce(_me._splitUriSearch.bind(_me)) || new Hash }, joinParams: function (hash) { let paramsArray = []; $H(hash).each(function (pair) { const pairMapped = pair.value.map(function (elem) { return pair.key + "=" + encodeURI(elem) }); paramsArray = paramsArray.concat(pairMapped) }); return paramsArray.join("&") }, _splitUriSearch: function (paramHash, elem) { let key = elem.split("=", 1); if (key.length > 0 && key[0].length > 0) { key = key[0]; const val = decodeURI(elem.substring(key.length + 1)); if (!paramHash.get(key)) { paramHash.set(key, [val]) } else { paramHash.get(key).push(val) } } return paramHash } }); window.celMessages = {}; window.celMessages.isLoaded = false; try { new Ajax.Request(window.getCelHost(), { method: "post", parameters: { xpage: "celements_ajax", ajax_mode: "Messages" }, onSuccess: function (transport) { if (transport.responseText.isJSON()) { const newMessages = transport.responseText.evalJSON(); console.log("initCelements.js: finished getting dictionary messages."); newMessages.isLoaded = true; window.celMessages = newMessages; celMessagesCbFnArray.each(function (callbackFn) { try { callbackFn(newMessages) } catch (exp) { console.error("Failed to execute callbackFn!", exp) } }); $(document.body).fire("cel:messagesLoaded", newMessages) } else { console.error("noJSON!!! ", transport.responseText) } } }) } catch (exp) { console.error("Failed to get Cel-Messages async!", exp) } const celMessagesCbFnArray = []; window.celExecOnceAfterMessagesLoaded = function (callbackFn) { if (!celMessagesCbFnArray.includes(callbackFn)) { celMessagesCbFnArray.push(callbackFn); if (window.celMessages.isLoaded) { callbackFn(window.celMessages) } } }; if (typeof window.CELEMENTS.CssClassEventHandler === "undefined") { window.CELEMENTS.CssClassEventHandler = Class.create({ _htmlElement: undefined, _eventName: undefined, _cssSelector: undefined, _className: undefined, _actionFunction: undefined, _conditionFunction: undefined, _actionHandlerBind: undefined, initialize: function (htmlElement, eventName, cssSelector, className, actionFunction, condition) { const _me = this; _me._htmlElement = $(htmlElement); _me._eventName = eventName; _me._cssSelector = cssSelector; _me._className = className; _me._actionFunction = actionFunction; if (condition && !/\s|;/.test(condition)) { _me._conditionFunction = new Function("me", "origin", "return " + condition + ";") } _me._actionHandlerBind = _me._actionHandler.bind(_me); _me._registerActionHandler() }, _registerActionHandler: function () { const _me = this; Event.stopObserving(_me._htmlElement, _me._eventName, _me._actionHandlerBind); Event.observe(_me._htmlElement, _me._eventName, _me._actionHandlerBind); console.debug("EventHandler - register: ", _me._eventName, _me._cssSelector, _me._className, _me._actionFunction.name, _me._htmlElement) }, _actionHandler: function (event) { const _me = this; _me._getTargetElements().each(function (targetElement) { if (!_me._conditionFunction || _me._conditionFunction(targetElement, _me._htmlElement)) { _me._actionFunction(targetElement, _me._className); console.debug("EventHandler - upon", _me._eventName, "action [", _me._actionFunction.name, _me._className, "] executed on", targetElement) } else { console.debug("EventHandler - action skipped for failed condition [", _me._conditionFunction, "] on ", targetElement) } }) }, _getTargetElements: function () { const _me = this; if (_me._cssSelector.startsWith("^")) { parent = _me._htmlElement.up(_me._cssSelector.substring(1)); return parent ? [parent] : [] } else { return $$(_me._cssSelector) } }, unregister: function () { const _me = this; Event.stopObserving(_me._htmlElement, _me._eventName, _me._actionHandlerBind); console.debug("EventHandler - unregister: ", _me._eventName, _me._cssSelector, _me._className, _me._actionFunction.name, _me._htmlElement) } }) } if (typeof window.CELEMENTS.EventManager === "undefined") { window.CELEMENTS.EventManager = Class.create({ _instructionRegex: new RegExp(/([\w:]+)([%+-])([\w-]+):([^?]+)\??(.+)?/), _actionFunctionMap: { "+": Element.addClassName, "-": Element.removeClassName, "%": Element.toggleClassName }, _eventElements: undefined, _eventElemCounter: undefined, _interpretDataCelEventBind: undefined, _contentChangedHandlerBind: undefined, _intersectionObserver: undefined, _intersectionValues: [], initialize: function () { const _me = this; _me._eventElements = new Array; _me._eventElemCounter = 0; _me._interpretDataCelEventBind = _me._interpretDataCelEvent.bind(_me); _me._contentChangedHandlerBind = _me._contentChangedHandler.bind(_me); try { _me._intersectionObserver = new IntersectionObserver(function (entries) { entries.forEach(_me._handleIntersection.bind(_me)) }, { threshold: [0, .5, 1] }) } catch (exp) { console.warn("EventManager - initialize: IntersectionObserver not available", exp) } }, _splitDataCelEventList: function (dataValue) { let ret = new Array; if (dataValue) { ret = dataValue.replace(/([^&])&([^&])/g, "$1#SPLIT#$2").split("#SPLIT#") } return ret }, _parseEventInstruction: function (instruction) { const _me = this; const parts = instruction.match(_me._instructionRegex) || []; const data = { eventName: parts[1], action: parts[2], className: parts[3], cssSelector: parts[4], condition: parts[5] }; if (data.eventName && data.action && data.className && data.cssSelector) { return data } else { throw "parseEventInstruction: unable to parse event instruction '" + instruction + "'" } }, _createEventHandler: function (htmlElem, instruction) { const _me = this; const data = _me._parseEventInstruction(instruction); const actionFunction = _me._actionFunctionMap[data.action]; if (actionFunction) { if (_me._intersectionObserver && (data.eventName.startsWith("cel:enter") || data.eventName.startsWith("cel:leave"))) { _me._intersectionObserver.observe(htmlElem); console.debug("EventManager - observing intersection", htmlElem.dataset.celEventNb, data) } return new window.CELEMENTS.CssClassEventHandler(htmlElem, data.eventName, data.cssSelector, data.className, actionFunction, data.condition) } else { throw "createEventHandler: unknown action '" + data.action + '"' } }, _createEventElement: function (htmlElem) { const _me = this; const dataValue = htmlElem.dataset.celEvent; return { htmlElem: htmlElem, dataValue: dataValue, eventHandlers: _me._splitDataCelEventList(dataValue).map(function (instruction) { try { return _me._createEventHandler(htmlElem, instruction) } catch (exp) { console.error("EventManager - interpretData: invalid instruction ", exp, htmlElem) } }).filter(Boolean) } }, _interpretDataCelEvent: function (htmlElem) { const _me = this; const logPref = "EventManager - interpretData: "; if (htmlElem.classList.contains("celOnEventInit")) { console.debug(logPref, "skip already initialized: ", htmlElem) } else if (htmlElem.up(".cel_template")) { console.debug(logPref, "skip template element: ", htmlElem) } else { htmlElem.dataset.celEventNb = ++_me._eventElemCounter; const newElem = _me._createEventElement(htmlElem); if (newElem.eventHandlers.length > 0) { _me._eventElements.push(newElem) } else { console.warn(logPref, "no valid instructions found on ", htmlElem) } htmlElem.classList.add("celOnEventInit"); $(htmlElem).fire("celEM:init") } }, _handleIntersection: function (entry) { const _me = this; const htmlElem = entry.target; const eventNb = htmlElem.dataset.celEventNb; const previous = _me._intersectionValues[eventNb] || Object.freeze({ y: Number.MAX_SAFE_INTEGER, ratio: 0 }); const current = Object.freeze({ y: entry.boundingClientRect.y, ratio: entry.intersectionRatio }); const direction = current.y > previous.y ? "up" : "down"; const type = entry.isIntersecting && current.ratio >= previous.ratio ? "enter" : "leave"; const ratioA = type === "enter" ? current.ratio : previous.ratio; const ratioB = type === "leave" ? current.ratio : previous.ratio; const steps = []; if (ratioA >= 1 && ratioB < 1) steps.push(":full"); if (ratioA >= .5 && ratioB < .5) steps.push(":half"); if (ratioA > 0 && ratioB <= 0) steps.push(""); steps.forEach(function (step) { ["cel:" + type + step, "cel:" + type + step + ":" + direction].forEach(function (eventName) { console.debug("EventManager - intersect", eventName, "on", eventNb, previous, "->", current); htmlElem.fire(eventName) }) }); _me._intersectionValues[eventNb] = current }, _contentChangedHandler: function (event) { const _me = this; console.debug("EventManager - contentChanged ", event); if (event.memo && event.memo.htmlElem) { _me.updateCelEventHandlers(event.memo.htmlElem) } else { _me.updateCelEventHandlers() } }, updateCelEventHandlers: function (htmlContainer) { const _me = this; const rootElem = htmlContainer || document.body; Event.stopObserving($(document.body), "celements:contentChanged", _me._contentChangedHandlerBind); Event.observe($(document.body), "celements:contentChanged", _me._contentChangedHandlerBind); _me._removeDisappearedElems(); rootElem.querySelectorAll(".celOnEvent").forEach(_me._interpretDataCelEventBind) }, _removeDisappearedElems: function () { const _me = this; for (let i = _me._eventElements.length - 1; i >= 0; i--) { const elem = _me._eventElements[i]; const isInBody = $(document.body).contains(elem.htmlElem); const changedDataValue = elem.htmlElem.dataset.celEvent !== elem.dataValue; if (!isInBody || changedDataValue || !elem.htmlElem.classList.contains("celOnEventInit")) { elem.eventHandlers.forEach(function (handler) { handler.unregister() }); _me._eventElements.splice(i, 1); elem.htmlElem.classList.remove("celOnEventInit"); console.debug("EventManager - removeDisappearedElem: ", elem) } } } }); window.CELEMENTS.globalEventManager = new window.CELEMENTS.EventManager; document.addEventListener("DOMContentLoaded", window.CELEMENTS.globalEventManager._contentChangedHandlerBind) } const formValidations = new Hash; const registerValidation = function (formElem) { if (formElem && formElem.id) { const valid = new Validation(formElem, { immediate: true, useTitles: true, stopOnFirst: false }); formValidations.set(formElem.id, valid) } else { console.error("failed to register validation on form with no id. ", formElem) } }; document.addEventListener("DOMContentLoaded", function () { $$("form.cel_form_validation").each(registerValidation); $(document.body).observe("cel_yuiOverlay:contentChanged", function (event) { const containerElem = event.findElement(); if (containerElem) { containerElem.select("form.cel_form_validation").each(registerValidation) } }) }); window.celAddOnFinishHeaderListener(function () { const metas = $$('meta[name="cel-GAA-Num"]'); if (metas.size() > 0 && metas[0].content != "") { const gaaNum = metas[0].content; if (gaaNum.startsWith("UA-")) { (function (i, s, o, g, r, a, m) { i["GoogleAnalyticsObject"] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date; a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, "script", "//www.google-analytics.com/analytics.js", "ga"); ga("create", gaaNum, window.getCelDomain()); ga("set", "anonymizeIp", true); ga("send", "pageview"); console.log("finish initalizing google universal analytics.", gaaNum) } else { (function (d, o, g, s, m) { s = d.createElement(o); m = d.getElementsByTagName(o)[0]; s.async = 1; s.src = g; m.parentNode.insertBefore(s, m) })(document, "script", "https://www.googletagmanager.com/gtag/js?id=" + gaaNum); window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments) } gtag("js", new Date); gtag("config", gaaNum); console.log("finish initalizing google analytics v4.", gaaNum) } } }); document.addEventListener("DOMContentLoaded", function () { if (typeof $j("img[usemap]").rwdImageMaps !== "undefined") { $j("img[usemap]").rwdImageMaps() } }); document.addEventListener("DOMContentLoaded", function () { if (CELEMENTS && CELEMENTS.presentation && CELEMENTS.presentation.getOverlayObj && CELEMENTS.presentation.getOverlayObj()) { CELEMENTS.presentation.getOverlayObj({ overlayLayout: "SimpleLayout" }).registerOpenHandler() } }); let mobileDim = null; const cel_updateOrientationCSSclasses = function () { const innerWidth = mobileDim.getInnerWidth(); const innerHeight = mobileDim.getInnerHeight(); if (innerWidth > innerHeight) { $(document.body).removeClassName("cel_orientation_portrait"); $(document.body).addClassName("cel_orientation_landscape") } else { $(document.body).removeClassName("cel_orientation_landscape"); $(document.body).addClassName("cel_orientation_portrait") } }; document.addEventListener("DOMContentLoaded", function () { if (CELEMENTS && CELEMENTS.mobile && CELEMENTS.mobile.Dimensions) { mobileDim = new CELEMENTS.mobile.Dimensions; Event.stopObserving(window, "orientationchange", cel_updateOrientationCSSclasses); Event.observe(window, "orientationchange", cel_updateOrientationCSSclasses) } }); const cel_initAllMultiselect = function (event) { console.debug("initAllMultiselect"); if ($j().multiselect != undefined) { $j(".celBootstrap,.celMultiselect").filter(":visible,.celForceMultiselect").each(function (index, element) { if (!$(element).up(".cel_template")) { console.debug("initAllMultiselect: ", element); cel_initAllMultiselect_element(element) } }) } else { console.debug("initAllMultiselect: bootstrap multiselect undefined") } }; const cel_initAllMultiselect_element = function (element) { let params = { numberDisplayed: 3, onDropdownHidden: cel_initAllMultiselect_onDropdownHidden, onChange: cel_initAllMultiselect_onChange }; let bootstrapCfg = element.getAttribute("data-bootstrapConfig"); if (!bootstrapCfg && element.getAttribute("data-multiselectAttr")) { bootstrapCfg = element.getAttribute("data-multiselectAttr"); console.warn("initAllMultiselect: deprecated data-multiselectAttr in use", element) } if (bootstrapCfg) { params = $j.extend(params, JSON.parse(bootstrapCfg)) } const multiselect = $j(element).multiselect(params); $(document.body).fire("cel:multiselectInitialized", { multiselect: multiselect }) }; const cel_initAllMultiselect_onDropdownHidden = function (event) { $j(event.target).css("display", ""); event.target.fire("cel:multiselectOnDropdownHidden") }; const cel_initAllMultiselect_onChange = function (option, checked, select) { const multiselectElement = this; console.debug("fire cel:multiselectOnChange on: ", multiselectElement); $(option[0]).fire("cel:multiselectOnChange", { multiselect: multiselectElement, checked: checked, select: select }) }; const cel_initAllMultiselect_tabMenuPanel = function (event) { $("tabMenuPanel").select(".celBootstrap,.celMultiselect").each(function (element) { if (element.visible()) { element.addClassName("celForceMultiselect") } }); cel_initAllMultiselect(event) }; document.addEventListener("DOMContentLoaded", function () { $(document.body).stopObserving("cel:initMultiselect", cel_initAllMultiselect); $(document.body).stopObserving("celements:contentChanged", cel_initAllMultiselect); $(document.body).observe("cel:initMultiselect", cel_initAllMultiselect); $(document.body).observe("celements:contentChanged", cel_initAllMultiselect); if ($("tabMenuPanel")) { $("tabMenuPanel").stopObserving("tabedit:tabLoadingFinished", cel_initAllMultiselect_tabMenuPanel); $("tabMenuPanel").observe("tabedit:tabLoadingFinished", cel_initAllMultiselect_tabMenuPanel) } $(document.body).fire("cel:initMultiselect") }); const cel_addMaxDimToFluidImg = function (event) { $$("img.cel_fluidresizeWidth").each(function (imgElem) { imgElem.setStyle({ maxWidth: imgElem.readAttribute("width") + "px" }) }); $$("img.cel_fluidresizeHeight").each(function (imgElem) { imgElem.setStyle({ maxHeight: imgElem.readAttribute("height") + "px" }) }) }; document.addEventListener("DOMContentLoaded", function () { $(document.body).stopObserving("cel:initFluidImage", cel_addMaxDimToFluidImg); $(document.body).stopObserving("celements:contentChanged", cel_addMaxDimToFluidImg); $(document.body).observe("cel:initFluidImage", cel_addMaxDimToFluidImg); $(document.body).observe("celements:contentChanged", cel_addMaxDimToFluidImg) }); document.addEventListener("DOMContentLoaded", function () { $$(".generalOverlayWrapper .generalOverlay .exitOnClose").each(function (elem) { elem.stopObserving("click", cel_closeOverlayWindow); elem.observe("click", cel_closeOverlayWindow) }) }); const cel_closeOverlayWindow = function (event) { event.stop(); window.close() }; const updateCelMessages = function () { if (typeof $j.format !== "undefined") { $j.format.locale({ date: celMessages.jqueryFormater }) } }; document.addEventListener("DOMContentLoaded", function () { if (window.celMessages.isLoaded && typeof celMessages.jqueryFormater === "object") { updateCelMessages() } else { $(document.body).observe("cel:messagesLoaded", updateCelMessages) } }) })(window); +!function(s,t){"use strict";void 0===s.console&&(s.console={}),void 0===s.console.error&&(s.console.error=Prototype.emptyFunction),void 0===s.console.warn&&(s.console.warn=s.console.error),void 0===s.console.info&&(s.console.info=s.console.warn),void 0===s.console.log&&(s.console.log=s.console.info),void 0===s.console.debug&&(s.console.debug=s.console.log),void 0===s.CELEMENTS&&(s.CELEMENTS={}),void 0===s.CELEMENTS.mixins&&(s.CELEMENTS.mixins={}),void 0===s.CELEMENTS.mixins.Event&&(s.CELEMENTS.mixins.Event=Class.create({memo:t,stopped:t,eventName:t,type:t,detail:t,cancelable:t,defaultPrevented:t,target:t,initialize:function(e,t,n){this.memo=t,this.eventName=e,this.stopped=!1,this.type=e,this.detail=t,this.cancelable=!0,this.defaultPrevented=!1,this.target=n||(t?t.target:null)},stop:function(){this.cancelable&&(this.stopped=!0,this.defaultPrevented=!0)},preventDefault:function(){this.stop()},findElement:function(){return this.target}})),void 0===s.CELEMENTS.mixins.Observable&&(s.CELEMENTS.mixins.Observable={_celEventMap:null,_getCelEventMap:function(e){return this._celEventMap||(this._celEventMap=new Map),e?(this._celEventMap.has(e)||this._celEventMap.set(e,[]),this._celEventMap.get(e)):this._celEventMap},celObserve:function(e,t){if(console.debug("cel celObserve:",e,t),!e)throw"undefined eventKey in celObserve call";this._getCelEventMap(e).push(t)},celStopObserving:function(e,t){if(console.debug("cel celStopObserving:",e,t),!e)throw"undefined eventKey in celStopObserving call";this._getCelEventMap().set(e,this._getCelEventMap(e).filter(function(e){return e!==t}))},celFire:function(n,e){if(!n)throw"undefined eventKey in celFire call";const i=new CELEMENTS.mixins.Event(n,e,this);e=this._getCelEventMap(n);return console.debug("cel celFire:",i,"on",e),e.forEach(function(t){try{t(i)}catch(e){console.error("listener in celFire failed for event",n,t,e)}}),i}});let n=[],i=(s.celAddOnBeforeLoadListener=function(e){console.warn('celAddOnBeforeLoad is deprecated since open-celements 5.4 / January 2022. Instead register a listener on "DOMContentLoaded"',e),n.push(e)},document.addEventListener("DOMContentLoaded",function(){n.forEach(function(e){try{e()}catch(e){console.error("Listener for celOnBeforeLoad failed: ",e)}}),$(document.body).fire("celements:beforeOnLoad")}),[]);if(s.celAddOnFinishHeaderListener=function(e){i.push(e)},s.celFinishHeaderHandler=function(){i.forEach(function(e){try{e()}catch(e){console.error("Failed to execute celOnFinishHeader listener. ",e)}})},void 0===s.getCelDomain&&(s.getCelDomain=function(){return s.location.host.replace(/^www\./,"")}),void 0===s.CELEMENTS.LoadingIndicator&&(s.CELEMENTS.LoadingIndicator=Class.create({_loadingImg:t,initialize:function(){this._loadingImg=new Hash},getLoadingIndicator:function(e){var t=this;let n="ajax-loader-32px";return"boolean"==typeof e?e&&(n="ajax-loader-16px"):"number"==typeof e&&(n="ajax-loader-"+e+"px"),t._loadingImg.get(n)||t._loadingImg.set(n,new Element("img",{src:CELEMENTS.getUtils().getPathPrefix()+"/file/resources/celRes/spinner/"+n+".png",class:"editorLoading",alt:"loading..."})),t._loadingImg.get(n).clone()}})),void 0===s.CELEMENTS.Utils){s.CELEMENTS.Utils=Class.create({_srcOriginHost:t,getPathPrefix:function(){var n=this;if(!n._srcOriginHost){let e=null;var i=document.getElementsByTagName("script");let t=i.length;for(var o=new RegExp("(https?://[^/]*)/(([^/]*/)*)resources/celJS/initCelements(.min)?\\.js(\\?.*)?$");t--;){var a=(c=i[t].src).match(o);if(c&&a){e=a[1];var c=a[2].split("/"),a=c.splice(0,c.length-2).join("/");""!=a&&(e+="/"+a);break}}console.log("getPathPrefix computed prefixPath: ",e),n._srcOriginHost=e}return n._srcOriginHost},convertFullNameToViewURL:function(e){return this.getPathPrefix()+("/"+e.replace(/\./,"/")).replace(/\/Content\//,"/")}});const h=new s.CELEMENTS.Utils;s.CELEMENTS.getUtils=function(){return h}}void 0===s.CELEMENTS.getPathPrefix&&(s.CELEMENTS.getPathPrefix=function(){return console.warn("deprecated call of window.CELEMENTS.getPathPrefix. Instead use window.CELEMENTS.getUtils().getPathPrefix()"),s.CELEMENTS.getUtils().getPathPrefix()}),void 0===s.getCelHost&&(s.getCelHost=function(){let e=document.location+"?";return e=-1i.y?"up":"down",c=e.isIntersecting&&o.ratio>=i.ratio?"enter":"leave";var e=("enter"==c?o:i).ratio,s=("leave"==c?o:i).ratio,r=[];1<=e&&s<1&&r.push(":full"),.5<=e&&s<.5&&r.push(":half"),0",o),t.fire(e)})}),this._intersectionValues[n]=o},_contentChangedHandler:function(e){console.debug("EventManager - contentChanged ",e),e.memo&&e.memo.htmlElem?this.updateCelEventHandlers(e.memo.htmlElem):this.updateCelEventHandlers()},updateCelEventHandlers:function(e){e=e||document.body;Event.stopObserving($(document.body),"celements:contentChanged",this._contentChangedHandlerBind),Event.observe($(document.body),"celements:contentChanged",this._contentChangedHandlerBind),this._removeDisappearedElems(),e.querySelectorAll(".celOnEvent").forEach(this._interpretDataCelEventBind)},_removeDisappearedElems:function(){for(let e=this._eventElements.length-1;0<=e;e--){var t=this._eventElements[e],n=$(document.body).contains(t.htmlElem),i=t.htmlElem.dataset.celEvent!==t.dataValue;n&&!i&&t.htmlElem.classList.contains("celOnEventInit")||(t.eventHandlers.forEach(function(e){e.unregister()}),this._eventElements.splice(e,1),t.htmlElem.classList.remove("celOnEventInit"),console.debug("EventManager - removeDisappearedElem: ",t))}}}),s.CELEMENTS.globalEventManager=new s.CELEMENTS.EventManager,document.addEventListener("DOMContentLoaded",s.CELEMENTS.globalEventManager._contentChangedHandlerBind)),new Hash);document.addEventListener("DOMContentLoaded",function(){$$("form.cel_form_validation").each(o),$(document.body).observe("cel_yuiOverlay:contentChanged",function(e){e=e.findElement();e&&e.select("form.cel_form_validation").each(o)})}),s.celAddOnFinishHeaderListener(function(){var e,t,n,i,o,a=$$('meta[name="cel-GAA-Num"]');function c(){dataLayer.push(arguments)}0 div#celements2_menu_bar { text-decoration: none !important; white-space: nowrap; } - /* Context Menu Classes */ .contextMenu { position: absolute; @@ -337,7 +333,6 @@ body > div#celements2_menu_bar { .cel_outline { z-index: 99; } - /* Form Validation Classes */ .validation-advice { width: 152px; @@ -356,7 +351,6 @@ body > div#celements2_menu_bar { color: #ff0000; margin-bottom: 10px; } - table.celements2_table, .celements3_tabMenu .tabMenuPanel .bd .menuTab table { width: 100%; @@ -485,21 +479,17 @@ table.celements2_table td, .celements2_line { border-bottom: 1px solid #000000; } - div.menuTab .editblock ul.column_config_options { text-transform: none; } - div.menuTab .editblock ul.column_config_options li { display: inline; padding-left: 30px; } - div.menuTab .editblock.cel_cal_overview_column_config input, div.menuTab .editblock.cel_cal_event_column_config input { width: 400px; } - .UserAdminInfos table.block td { position: relative; } @@ -520,7 +510,6 @@ div.mask { left: 0px; z-index: 99; } - .cel_newsletterImport h1 { color: black; font-size: 16px; @@ -531,13 +520,11 @@ div.mask { padding-left: auto; padding-top: auto; } - .cel_newsletterImport h2 { color: black; font-size: 12px; font-weight: auto; } - .cel_newsletterImport th { color: black; background-color: auto; @@ -549,7 +536,6 @@ div.mask { .cel_cm_blog_article .future { background-color: #ff9999; } - .celements3_tabMenu .cel_rightsTab table.cel_rightsTable { table-layout: fixed; border-collapse: collapse; @@ -600,11 +586,9 @@ div#celements2_menu_bar div#celements2_logo span.websuffix { .celdocpath_Celements2\.FileBaseTags { background-color: white !important; } - .cel_whatsnew_table { width: 100%; } - /********************************** Editor blocker ***********************************/ @@ -615,27 +599,22 @@ div#celements2_menu_bar div#celements2_logo span.websuffix { line-height: 13px; font-weight: 400; } - .celements3_tabMenu #tabMenuPanel .celementsEditorBlocker fieldset { margin: 0px; padding: 6px; } - .celements3_tabMenu #tabMenuPanel .celementsEditorBlocker p.xwikimessage { margin-top: 10px; margin-bottom: 20px; } - .celements3_tabMenu #tabMenuPanel .celementsEditorBlocker { background: white; background-color: white; padding: 10px; } - .celements3_tabMenu #tabMenuPanel .celementsEditorBlocker .celButtons { margin-top: 15px; } - .celements3_tabMenu #tabMenuPanel .celementsEditorBlocker .celButtons .celbutton { padding: 6px; padding-left: 10px; @@ -653,11 +632,9 @@ div#celements2_menu_bar div#celements2_logo span.websuffix { font-weight: 400; display: inline-block; } - .celements3_tabMenu #tabMenuPanel .celementsEditorBlocker .celButtons .cancel { float: right; } - /* CSS for Sitemap */ .generalOverlay #cel_overlaybody .sitemapOutsideStructure ul, .generalOverlay #cel_overlaybody ul.cel_presentation_reorder, @@ -670,7 +647,6 @@ div#celements2_menu_bar div#celements2_logo span.websuffix { width: auto; padding-left: 18px; } - .generalOverlay #cel_overlaybody .sitemapOutsideStructure ul li, .generalOverlay #cel_overlaybody ul.cel_presentation_reorder li, .yui-panel-container .cel_contentTab ul.cel_presentation_reorder li, @@ -703,7 +679,6 @@ body > .cel_reorderNodes_proxy { .yui-panel-container .cel_contentTab .reorderMode ul.cel_presentation_reorder li.cel_nav_odd { background-color: transparent; } - .generalOverlay #cel_overlaybody .sitemapOutsideStructure ul .docLangs, .generalOverlay #cel_overlaybody ul.cel_presentation_reorder .docLangs, .yui-panel-container .cel_contentTab ul.cel_presentation_reorder .docLangs, @@ -722,7 +697,6 @@ body > .cel_reorderNodes_proxy .docLangs, .yui-panel-container .cel_contentTab ul.cel_presentation_reorder li.cel_reorderNodes_placeholder .docLangs { display: none; } - .generalOverlay #cel_overlaybody .sitemapOutsideStructure ul .docLangs a, .generalOverlay #cel_overlaybody ul.cel_presentation_reorder .docLangs a, .yui-panel-container .cel_contentTab ul.cel_presentation_reorder .docLangs a, @@ -745,7 +719,6 @@ body > .cel_reorderNodes_proxy .docLangs, .celements3_tabMenu #con_langBar .docLangs span + span { margin-left: 1px; } - .generalOverlay #cel_overlaybody .sitemapOutsideStructure ul .docLangs a.defaultLanguage, .generalOverlay #cel_overlaybody ul.cel_presentation_reorder .docLangs a.defaultLanguage, .yui-panel-container .cel_contentTab ul.cel_presentation_reorder .docLangs a.defaultLanguage, @@ -753,7 +726,6 @@ body > .cel_reorderNodes_proxy .docLangs, .celements3_tabMenu #con_langBar .docLangs span.defaultLanguage { font-weight: bold; } - .generalOverlay #cel_overlaybody .sitemapOutsideStructure ul .docLangs a.transNotExists, .generalOverlay #cel_overlaybody ul.cel_presentation_reorder .docLangs a.transNotExists, .yui-panel-container .cel_contentTab ul.cel_presentation_reorder .docLangs a.transNotExists, @@ -762,25 +734,21 @@ body > .cel_reorderNodes_proxy .docLangs, background-color: white; color: black; } - .generalOverlay #cel_overlaybody .sitemapOutsideStructure ul .docLangs a:hover, .generalOverlay #cel_overlaybody ul.cel_presentation_reorder .docLangs a:hover, .yui-panel-container .cel_contentTab ul.cel_presentation_reorder .docLangs a:hover, .celements3_tabMenu #con_langBar .docLangs a:hover { background-color: #ccc; } - .generalOverlay #cel_overlaybody .cel_presentation_addslide a, .yui-panel-container .cel_contentTab .cel_presentation_addslide a { display: flex; width: fit-content; gap: 5px; } - body div.mask { z-index: 100 !important; } - /** CSS for .cel_content_part **/ body #sitecontainer .cel_content_part { background: white; @@ -806,7 +774,6 @@ body #sitecontainer .cel_content_part table th, body #sitecontainer .cel_content_part table td { text-align: left; } - /* Import Manager */ .cel_contentTab .editGallery_box input[type='submit'], #cel_overlaybody #check_none, @@ -814,7 +781,6 @@ body #sitecontainer .cel_content_part table td { #cel_overlaybody #c3_import_button { cursor: pointer; } - /* Search results */ #sitecontainer #websearch .results ul { list-style-type: none; @@ -860,7 +826,6 @@ body #sitecontainer .cel_content_part table td { #sitecontainer #websearch .clearright { clear: right; } - /** Ask Toolbar for google chrome leads to problems. Thus we hide it generally by default. **/ @@ -869,19 +834,15 @@ html[lang] { padding-top: 0px !important; border-top: none; } - iframe.apn-toolbar { display: none !important; } - iframe.apn-toolbar + body #celements2_menu_bar { top: 0px !important; } - [data-apn-myc3-v7c-toolbar_set='bottom'] { bottom: 0px !important; } - /** * Fluid design auto resize images **/ @@ -889,12 +850,10 @@ img.cel_fluidresizeWidth { width: 100%; height: auto; } - img.cel_fluidresizeHeight { width: auto; height: 100%; } - /** * Box layouting / Flex support **/ @@ -936,9 +895,8 @@ div.presentationList > div.navigation-clear { } #sitecontainer li.cel_nav_restricted_rights > div { opacity: 0.75; - filter: alpha(opacity = 75); + filter: alpha(opacity=75); } - .cel_template { display: none; } diff --git a/src/main/webapp/resources/celRes/imagePicker.css b/src/main/webapp/resources/celRes/imagePicker.css index 84c73a138..e20671d8a 100644 --- a/src/main/webapp/resources/celRes/imagePicker.css +++ b/src/main/webapp/resources/celRes/imagePicker.css @@ -1,7 +1,7 @@ body { background-color: #ffffff !important; background-image: none; - font-familiy: 'Terminal Dosis', Tahoma, Geneva, Helvetica, Arial, sans-serif; + font-family: 'Terminal Dosis', Tahoma, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 500; letter-spacing: 1px; diff --git a/src/main/webapp/resources/celRes/theme/defaultColors.css b/src/main/webapp/resources/celRes/theme/defaultColors.css new file mode 100644 index 000000000..6fdb94844 --- /dev/null +++ b/src/main/webapp/resources/celRes/theme/defaultColors.css @@ -0,0 +1,27 @@ +:root { + --pageBackgroundColor: #dddddd; + --pageHeaderBackgroundColor: #ffffff; + --pageContentBackgroundColor: #ffffff; + --textColor: #000000; + --textPrimaryColor: #888888; + --textSecondaryColor: #b3b3b3; + --titleColor: #888888; + --borderColor: #cccccc; + --linkColor: #0089dc; + --highlightColor: #ffffdd; + --menuBackgroundColor: #cccccc; + --menuLinkColor: #ffffff; + --menuSelectedEntryBackgroundColor: #efefef; + --menuSelectedEntryLinkColor: #888888; + --panelBackgroundColor: #ffffff; + --panelHeaderBackgroundColor: #ffffff; + --panelHeaderTextColor: #888888; + --panelTextColor: #000000; + --panelCollapsedBackgroundColor: #cccccc; + --panelCollapsedTextColor: #ffffff; + --buttonPrimaryBackgroundColor: #0089dc; + --buttonPrimaryTextColor: #ffffff; + --buttonSecondaryBackgroundColor: #ffffff; + --buttonSecondaryTextColor: #0089dc; + --backgroundSecondaryColor: #efefef; +} diff --git a/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.css b/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.css index 13f69c659..5f167dff8 100644 --- a/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.css +++ b/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.css @@ -1,5 +1,6 @@ -#template('colorThemeInit.vm') .meta-versionSummary label { - color: $theme.textSecondaryColor; +@import '/file/resources/celRes/theme/defaultColors.css'; +.meta-versionSummary label { + color: var(--textSecondaryColor); display: block; font-size: 0.85em; font-weight: 700; diff --git a/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.js b/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.js index 81a4b177e..2d248f660 100644 --- a/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.js +++ b/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.js @@ -3,209 +3,220 @@ // To be completed. // Make sure the XWiki 'namespace' exists. -if (typeof(XWiki) == 'undefined') { +if (typeof XWiki == 'undefined') { XWiki = new Object(); } // Make sure the actionButtons 'namespace' exists. -if (typeof(XWiki.actionButtons) == 'undefined') { +if (typeof XWiki.actionButtons == 'undefined') { XWiki.actionButtons = new Object(); } XWiki.actionButtons.EditActions = Class.create({ - initialize : function() { + translations: {}, + + initialize: function () { + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded( + (celMessages) => (this.translations = celMessages.actionButtons), + ); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } this.addListeners(); this.addShortcuts(); this.addValidators(); }, - addListeners : function() { - $$('input[name=action_cancel]').each(function(item) { - item.observe('click', this.onCancel.bindAsEventListener(this)); - }.bind(this)); - $$('input[name=action_preview]').each(function(item) { - item.observe('click', this.onPreview.bindAsEventListener(this)); - }.bind(this)); - $$('input[name=action_save]').each(function(item) { - item.observe('click', this.onSaveAndView.bindAsEventListener(this)); - }.bind(this)); - $$('input[name=action_saveandcontinue]').each(function(item) { - item.observe('click', this.onSaveAndContinue.bindAsEventListener(this)); - }.bind(this)); - }, - addShortcuts : function() { + addListeners: function () { + $$('input[name=action_cancel]').each( + function (item) { + item.observe('click', this.onCancel.bindAsEventListener(this)); + }.bind(this), + ); + $$('input[name=action_preview]').each( + function (item) { + item.observe('click', this.onPreview.bindAsEventListener(this)); + }.bind(this), + ); + $$('input[name=action_save]').each( + function (item) { + item.observe('click', this.onSaveAndView.bindAsEventListener(this)); + }.bind(this), + ); + $$('input[name=action_saveandcontinue]').each( + function (item) { + item.observe('click', this.onSaveAndContinue.bindAsEventListener(this)); + }.bind(this), + ); + }, + addShortcuts: function () { var shortcuts = { - 'action_cancel' : "$msg.get('core.shortcuts.edit.cancel')", - 'action_preview' : "$msg.get('core.shortcuts.edit.preview')", + action_cancel: this.translations.cancel, + action_preview: this.translations.preview, // The following 2 are both "Back to edit" in the preview mode, depending on the used editor - 'action_edit' : "$msg.get('core.shortcuts.edit.backtoedit')", - 'action_inline' : "$msg.get('core.shortcuts.edit.backtoedit')", - 'action_save' : "$msg.get('core.shortcuts.edit.saveandview')", - 'action_propupdate' : "$msg.get('core.shortcuts.edit.saveandview')", - 'action_saveandcontinue' : "$msg.get('core.shortcuts.edit.saveandcontinue')" - } + action_edit: this.translations.backtoedit, + action_inline: this.translations.backtoedit, + action_save: this.translations.saveandview, + action_propupdate: this.translations.saveAndView, + action_saveandcontinue: this.translations.saveandcontinue, + }; for (var key in shortcuts) { - var targetButtons = $$("input[name=" + key + "]"); + var targetButtons = $$('input[name=' + key + ']'); if (targetButtons.size() > 0) { - shortcut.add(shortcuts[key], function() { - this.click(); - }.bind(targetButtons.first()), {'propagate' : false} ); + shortcut.add( + shortcuts[key], + function () { + this.click(); + }.bind(targetButtons.first()), + { propagate: false }, + ); } } }, - validators : new Array(), - addValidators : function() { + validators: new Array(), + addValidators: function () { // Add live presence validation for inputs with classname 'required'. - var inputs = $(document.body).select("input.required"); + var inputs = $(document.body).select('input.required'); for (var i = 0; i < inputs.length; i++) { var input = inputs[i]; - var validator = new LiveValidation(input, { validMessage: "" }); + var validator = new LiveValidation(input, { validMessage: '' }); validator.add(Validate.Presence, { - failureMessage: "$msg.get('core.editors.validation.mandatoryField')" + failureMessage: this.translations.mandatoryField, }); validator.validate(); this.validators.push(validator); } }, - validateForm : function(form) { + validateForm: function (form) { for (var i = 0; i < this.validators.length; i++) { if (!this.validators[i].validate()) { return false; } } - #if($xwiki.isEditCommentMandatory()) - var commentField = form.comment - while (commentField.value == "") { - var response = prompt("${msg.get('core.comment.prompt')}"); - if (response === null) { - return false; - } - commentField.value = response; - } - #elseif($xwiki.isEditCommentSuggested()) - var commentField = form.comment - if (commentField.value == "") { - var response = prompt("${msg.get('core.comment.prompt')}"); - if (response === null) { - return false; - } - commentField.value = response; - } - #end return true; }, - onCancel : function(event) { + onCancel: function (event) { event.stop(); // Notify others we are going to cancel - this.notify(event, "cancel"); + this.notify(event, 'cancel'); var location = event.element().form.action; - if (typeof location != "string") { - location = event.element().form.attributes.getNamedItem("action"); - if (location) { - location = location.nodeValue; - } else { - location = window.self.location.href; - } + if (typeof location != 'string') { + location = event.element().form.attributes.getNamedItem('action'); + if (location) { + location = location.nodeValue; + } else { + location = window.self.location.href; + } } var parts = location.split('#', 2); - var fragmentId = (parts.length == 2) ? parts[1] : ''; + var fragmentId = parts.length == 2 ? parts[1] : ''; location = parts[0]; if (location.indexOf('?') == -1) { location += '?'; } window.location = location + '&action_cancel=true' + fragmentId; }, - onPreview : function(event) { + onPreview: function (event) { if (!this.validateForm(event.element().form)) { event.stop(); } else { // Notify others - this.notify(event, "preview"); + this.notify(event, 'preview'); } }, - onSaveAndView : function(event) { + onSaveAndView: function (event) { if (!this.validateForm(event.element().form)) { event.stop(); } else { - this.notify(event, "save", {"continue" : false}); + this.notify(event, 'save', { continue: false }); } }, - onSaveAndContinue : function(event) { + onSaveAndContinue: function (event) { if (!this.validateForm(event.element().form)) { event.stop(); } else { - this.notify(event, "save", {"continue" : true}); + this.notify(event, 'save', { continue: true }); } }, - notify : function(event, action, params) { - document.fire("xwiki:actions:" + action, Object.extend({originalEvent : event, form: event.element().form}, params || { })); + notify: function (event, action, params) { + document.fire( + 'xwiki:actions:' + action, + Object.extend({ originalEvent: event, form: event.element().form }, params || {}), + ); // In IE, events can't be stopped from another event's handler, so we must call stop() again here if (event.stopped) { event.stop(); } - } + }, }); // ====================================== // Save and continue button: Ajax improvements XWiki.actionButtons.AjaxSaveAndContinue = Class.create({ - initialize : function() { + initialize: function () { this.createMessages(); this.addListeners(); }, - createMessages : function() { - this.savingBox = new XWiki.widgets.Notification("Saving...", "inprogress", {inactive: true}); - this.savedBox = new XWiki.widgets.Notification("Saved", "done", {inactive: true}); - this.failedBox = new XWiki.widgets.Notification("Failed to save the document. Reason: ", "error", {inactive: true}); - }, - addListeners : function() { - document.observe("xwiki:actions:save", this.onSave.bindAsEventListener(this)); - }, - onSave : function(event) { - if (event.memo["continue"]) { - if (typeof (event.memo.originalEvent) != 'undefined') { + createMessages: function () { + this.savingBox = new XWiki.widgets.Notification('Saving...', 'inprogress', { inactive: true }); + this.savedBox = new XWiki.widgets.Notification('Saved', 'done', { inactive: true }); + this.failedBox = new XWiki.widgets.Notification( + 'Failed to save the document. Reason: ', + 'error', + { inactive: true }, + ); + }, + addListeners: function () { + document.observe('xwiki:actions:save', this.onSave.bindAsEventListener(this)); + }, + onSave: function (event) { + if (event.memo['continue']) { + if (typeof event.memo.originalEvent != 'undefined') { event.memo.originalEvent.stop(); } this.form = $(event.memo.form); this.savedBox.hide(); this.failedBox.hide(); this.savingBox.show(); - var formData = new Hash(this.form.serialize({hash: true, submit: 'action_saveandcontinue'})); + var formData = new Hash( + this.form.serialize({ hash: true, submit: 'action_saveandcontinue' }), + ); formData.set('minorEdit', '1'); if (!Prototype.Browser.Opera) { // Opera can't handle properly 204 responses. formData.set('ajax', 'true'); } new Ajax.Request(this.form.action, { - method : 'post', - parameters : formData.toQueryString(), - onSuccess : this.onSuccess.bindAsEventListener(this), - on1223 : this.on1223.bindAsEventListener(this), - on0 : this.on0.bindAsEventListener(this), - onFailure : this.onFailure.bind(this) + method: 'post', + parameters: formData.toQueryString(), + onSuccess: this.onSuccess.bindAsEventListener(this), + on1223: this.on1223.bindAsEventListener(this), + on0: this.on0.bindAsEventListener(this), + onFailure: this.onFailure.bind(this), }); } }, // IE converts 204 status code into 1223... - on1223 : function(response) { + on1223: function (response) { response.request.options.onSuccess(response); }, // 0 is returned for network failures, except on IE where a strange large number (12031) is returned. - on0 : function(response) { + on0: function (response) { response.request.options.onFailure(response); }, - onSuccess : function(response) { + onSuccess: function (response) { // If there was a 'template' field in the form, disable it to avoid 'This document already exists' errors. if (this.form && this.form.template) { this.form.template.disabled = true; - this.form.template.value = ""; + this.form.template.value = ''; } this.savingBox.replace(this.savedBox); // Announce that the document has been saved // TODO: We should send the new version as a memo field - document.fire("xwiki:document:saved"); + document.fire('xwiki:document:saved'); }, - onFailure : function(response) { + onFailure: function (response) { this.savingBox.replace(this.failedBox); if (response.statusText == '' /* No response */ || response.status == 12031 /* In IE */) { $('ajaxRequestFailureReason').update('Server not responding'); @@ -213,13 +224,13 @@ XWiki.actionButtons.AjaxSaveAndContinue = Class.create({ $('ajaxRequestFailureReason').update(response.statusText); } // Announce that a document save attempt has failed - document.fire("xwiki:document:saveFailed", {'response' : response}); - } + document.fire('xwiki:document:saveFailed', { response: response }); + }, }); -document.observe('dom:loaded', function() { +document.observe('dom:loaded', function () { new XWiki.actionButtons.EditActions(); // In preview mode, the &continue part of the save&continue should lead back to the edit action. - if (!$(document.body).hasClassName("previewbody")) { + if (!$(document.body).hasClassName('previewbody')) { new XWiki.actionButtons.AjaxSaveAndContinue(); } }); diff --git a/src/main/webapp/resources/js/xwiki/compatibility.js b/src/main/webapp/resources/js/xwiki/compatibility.js index 1fd5726dd..46fb4f975 100644 --- a/src/main/webapp/resources/js/xwiki/compatibility.js +++ b/src/main/webapp/resources/js/xwiki/compatibility.js @@ -20,48 +20,6 @@ } } - /** - * Deprecated since 2.6RC2 - */ - if (typeof XWiki.widgets == 'object' && typeof XWiki.widgets.FullScreen == 'function') { - XWiki.editors = XWiki.editors || {}; - XWiki.editors.FullScreenEditing = Class.create(XWiki.widgets.FullScreen, { - initialize: function ($super) { - warn( - 'XWiki.editors.FullScreenEditing is deprecated since XWiki 2.6RC2. Use XWiki.widgets.FullScreen instead.', - ); - $super(); - }, - }); - } - - /** - * _xwk is an old namespace for XWiki code that was optional - * Deprecated since 2.6RC1 - */ - if (window.useXWKns) { - warn('_xwk namespace is deprecated since XWiki 2.6RC1. Use the XWiki namespace instead.'); - if (typeof _xwk == 'undefined') { - _xwk = new Object(); - } - } else { - _xwk = window; - } - - /** - * Deprecated since 2.6RC1 - */ - if (typeof XWiki.widgets.Suggest !== 'undefined') { - _xwk.ajaxSuggest = Class.create(XWiki.widgets.Suggest, { - initialize: function ($super) { - warn('ajaxSuggest is deprecated since XWiki 2.6RC1. Use XWiki.widgets.Suggest instead.'); - var args = $A(arguments); - args.shift(); - $super.apply(_xwk, args); - }, - }); - } - /** * Deprecated since 1.9M2 */ diff --git a/src/main/webapp/resources/js/xwiki/editors/autosave.css b/src/main/webapp/resources/js/xwiki/editors/autosave.css index d289fbd0b..0d88aaceb 100644 --- a/src/main/webapp/resources/js/xwiki/editors/autosave.css +++ b/src/main/webapp/resources/js/xwiki/editors/autosave.css @@ -1,4 +1,5 @@ -#template('colorThemeInit.vm') #autosaveControl { +@import '/file/resources/celRes/theme/defaultColors.css'; +#autosaveControl { display: inline; } #autosaveControl * { diff --git a/src/main/webapp/resources/js/xwiki/editors/dataeditors.css b/src/main/webapp/resources/js/xwiki/editors/dataeditors.css index 9c0cdd9fa..20da3492b 100644 --- a/src/main/webapp/resources/js/xwiki/editors/dataeditors.css +++ b/src/main/webapp/resources/js/xwiki/editors/dataeditors.css @@ -1,26 +1,33 @@ -#template('colorThemeInit.vm') #xwikiobjects, +@import '/file/resources/celRes/theme/defaultColors.css'; + +#xwikiobjects, #xwikiclassproperties { padding: 0 8px; overflow: auto; border: none !important; + padding: 0 8px; + overflow: auto; + border: none !important; } #body #xwikiobjects label, #body #xwikiclassproperties label { display: inline; text-transform: none; font-variant: normal; - color: $theme.textPrimaryColor; + color: var(--textPrimaryColor); } #xwikiobjects input, #xwikiobjects textarea, #xwikiclassproperties input, #xwikiclassproperties textarea { - border: 1px solid $theme.borderColor; + border: 1px solid var(--borderColor); width: 90%; } .boolean-property input { width: auto !important; border: none !important; + width: auto !important; + border: none !important; } #xwikiobjects input:hover, #xwikiobjects textarea:hover, @@ -30,24 +37,26 @@ #xwikiclassproperties textarea:hover, #xwikiclassproperties input:focus, #xwikiclassproperties textarea:focus { - border: 1px solid $theme.textPrimaryColor; + border: 1px solid var(--textPrimaryColor); } #xwikiobjects input:focus, #xwikiobjects textarea:focus, #xwikiclassproperties input:focus, #xwikiclassproperties textarea:focus { - background-color: $theme.highlightColor; + background-color: var(--highlightColor); } .more-actions { padding: 8px 2px; + padding: 8px 2px; } .more-actions .edit-all { display: block; padding: 2px 18px; - background: transparent url($xwiki.getSkinFile('icons/silk/pencil.gif', true)) left top no-repeat; + background: transparent url(/file/resources/icons/silk/pencil.gif) left top no-repeat; } .xclass-title { margin: 16px 0 2px; + margin: 16px 0 2px; } .xclass-title h2, xproperty-title h2 { @@ -56,21 +65,32 @@ xproperty-title h2 { font-size: 100%; margin: 0; padding: 0; + border: none; + font-weight: bold; + font-size: 100%; + margin: 0; + padding: 0; } .xclass-content { padding: 0 0 0 16px; margin: 0 0 10px 0; + padding: 0 0 0 16px; + margin: 0 0 10px 0; } .xobject-title { position: relative; border: none; cursor: default; background: transparent; + position: relative; + border: none; + cursor: default; + background: transparent; } .xobject:hover .xobject-title, .xproperty:hover .xproperty-title { - background-color: $theme.highlightColor; - color: $theme.textPrimaryColor; + background-color: var(--highlightColor); + color: var(--textPrimaryColor); } .xobject-title h3 { border: none; @@ -79,29 +99,43 @@ xproperty-title h2 { margin: 0; padding: 4px 4px 4px 10px; border: none; + border: none; + font-size: 100%; + font-weight: 100; + margin: 0; + padding: 4px 4px 4px 10px; + border: none; } .xobject-content { padding: 4px 14px 8px; border: none; margin-bottom: 2px; + padding: 4px 14px 8px; + border: none; + margin-bottom: 2px; } .xobject dl, .xproperty dl { margin: 0; + margin: 0; } .xobject-content dt, .xproperty-content dt { font-size: 75%; font-weight: bold; + font-size: 75%; + font-weight: bold; } #body .xobject-title h3, #body .xclass-title { padding-left: 14px; + padding-left: 14px; } .xobject-title:hover, .xclass-title:hover, .xproperty-title:hover { cursor: default; + cursor: default; } .xobject-action { display: block; @@ -113,37 +147,57 @@ xproperty-title h2 { text-indent: 30px; line-height: 30px; background: transparent left top no-repeat; + display: block; + overflow: hidden; + position: absolute; + top: 2px; + width: 16px; + height: 16px; + text-indent: 30px; + line-height: 30px; + background: transparent left top no-repeat; } .xobject-title .delete { right: 0; - background-image: url($xwiki.getSkinFile('icons/silk/cross.gif', true)); + background-image: url('/file/resources/icons/silk/cross.gif'); } .xobject-title .edit { right: 16px; - background-image: url($xwiki.getSkinFile('icons/silk/pencil.gif', true)); + background-image: url('/file/resources/icons/silk/pencil.gif'); } .xproperty { border: none; + border: none; } .xproperty-content { padding: 4px 16px 8px 16px; margin-bottom: 2px; + padding: 4px 16px 8px 16px; + margin-bottom: 2px; } .xproperty-content dl { margin: 0; padding-left: 16px; + margin: 0; + padding-left: 16px; } .xproperty-title { cursor: default; padding: 0; overflow: hidden; + cursor: default; + padding: 0; + overflow: hidden; } .xproperty-title .xproperty-property { float: left; margin-right: 8px; + float: left; + margin-right: 8px; } .xproperty_number_input input { width: 2em; + width: 2em; } .xproperty-title h2 { display: block; @@ -152,48 +206,57 @@ xproperty-title h2 { margin: 0; font-size: 1em; font-weight: 100; - background: transparent url($xwiki.getSkinFile('icons/datamodel/propertyType-Generic.png', true)) 14px center no-repeat; + background: transparent url(/file/resources/icons/datamodel/propertyType-Generic.png) 14px center no-repeat; min-height: 16px; } .xproperty-title label { font-size: 60%; line-height: 1em; + font-size: 60%; + line-height: 1em; } .xproperty-content { clear: both; + clear: both; } .xproperty-title .xproperty-prettyName { float: none; clear: both; + float: none; + clear: both; } .xobject-content dt, .xproperty-content dt { font-size: 75%; font-weight: bold; + font-size: 75%; + font-weight: bold; } .xobject-content dd, .xproperty-content dd { margin: 0 0 4px; + margin: 0 0 4px; } #body .collapsable .xobject-title h3, #body .collapsable .xclass-title, #body .collapsable .xproperty-title { - background-image: url($xwiki.getSkinFile('icons/silk/bullet_toggle_minus.gif', true)); + background-image: url(/file/resources/icons/silk/bullet_toggle_minus.gif); background-position: 0 center; background-repeat: no-repeat; } #body .collapsed .xobject-title h3, #body .collapsed .xclass-title, #body .collapsed .xproperty-title { - background-image: url($xwiki.getSkinFile('icons/silk/bullet_toggle_plus.gif', true)); + background-image: url(/file/resources/icons/silk/bullet_toggle_plus.gif); } .xclass.collapsed .xclass-content, .xobject.collapsed .xobject-content, .xproperty.collapsed .xproperty-content { display: none; + display: none; } .collapsable dt .collapser { - background-image: url($xwiki.getSkinFile('icons/silk/bullet_toggle_minus.gif', true)); + background-image: url(/file/resources/icons/silk/bullet_toggle_minus.gif); background-position: -4px center; background-repeat: no-repeat; cursor: default; @@ -203,12 +266,14 @@ xproperty-title h2 { } #xwikiobjects .collapsable dd { padding-left: 10px; + padding-left: 10px; } #xwikiclassproperties .collapsable dt { margin-left: -10px; + margin-left: -10px; } .collapsable dt .collapsed { - background-image: url($xwiki.getSkinFile('icons/silk/bullet_toggle_plus.gif', true)); + background-image: url(/file/resources/icons/silk/bullet_toggle_plus.gif); } .xproperty-title .move { display: block; @@ -218,43 +283,50 @@ xproperty-title h2 { top: 2px; padding: 2px; cursor: move; + display: block; + overflow: hidden; + position: absolute; + right: 0; + top: 2px; + padding: 2px; + cursor: move; } .dragged .xproperty-title { - border: 1px solid $theme.borderColor; + border: 1px solid var(--borderColor); } .StringClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/string.png', true)); + background-image: url(/file/resources/icons/datamodel/string.png); } .DateClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/calendar.png', true)); + background-image: url(/file/resources/icons/datamodel/calendar.png); } .TextAreaClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/textarea.png', true)); + background-image: url(/file/resources/icons/datamodel/textarea.png); } .NumberClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/number.png', true)); + background-image: url(/file/resources/icons/datamodel/number.png); } .BooleanClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/boolean.png, true')); + background-image: url(/file/resources/icons/datamodel/boolean.png); } .StaticListClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/staticlist.png, true')); + background-image: url(/file/resources/icons/datamodel/staticlist.png); } .GroupsClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/groups.png, true')); + background-image: url(/file/resources/icons/datamodel/groups.png); } .UsersClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/users.png', true)); + background-image: url(/file/resources/icons/datamodel/users.png); } .LevelsClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/rights.png', true)); + background-image: url(/file/resources/icons/datamodel/rights.png); } .DBListClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/database.png', true)); + background-image: url(/file/resources/icons/datamodel/database.png); } .DBTreeListClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/tree.png', true)); + background-image: url(/file/resources/icons/datamodel/tree.png); } .PasswordClass h2 { - background-image: url($xwiki.getSkinFile('icons/datamodel/password.png', true)); + background-image: url(/file/resources/icons/datamodel/password.png); } diff --git a/src/main/webapp/resources/js/xwiki/editors/dataeditors.js b/src/main/webapp/resources/js/xwiki/editors/dataeditors.js index d82a21a8f..0b786aba9 100644 --- a/src/main/webapp/resources/js/xwiki/editors/dataeditors.js +++ b/src/main/webapp/resources/js/xwiki/editors/dataeditors.js @@ -1,4 +1,13 @@ +// this is minified code reformatted $j(document).ready(function () { + let translations = {}; + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded( + (celMessages) => (translations = celMessages.dataeditors), + ); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } $$('#xwikiobjects a.delete').each(function (B) { B.observe( 'click', @@ -25,10 +34,10 @@ $j(document).ready(function () { }, }, { - confirmationText: "$msg.get('core.editors.object.delete.confirm')", - progressMessageText: "$msg.get('core.editors.object.delete.inProgress')", - successMessageText: "$msg.get('core.editors.object.delete.done')", - failureMessageText: "$msg.get('core.editors.object.delete.failed')", + confirmationText: translations.confirmationText, + progressMessageText: translations.progressMessageText, + successMessageText: translations.successMessageText, + failureMessageText: translations.failureMessageText, }, ); } @@ -115,6 +124,86 @@ $j(document).ready(function () { ); }); }); +if (typeof XWiki == 'undefined') { + XWiki = new Object(); +} +if (typeof XWiki.editors == 'undefined') { + XWiki.editors = new Object(); +} +XWiki.editors.XPropertyOrdering = Class.create({ + initialize: function () { + $$('.xproperty-content').each(function (A) { + A.select('input').each(function (B) { + if (B.id.endsWith('_number')) { + A.numberProperty = B; + B.up().hide(); + if (B.up().previous('dt')) { + B.up().previous('dt').hide(); + } + } + }); + }); + if ($$('.xproperty').size() <= 1) { + return; + } + $$('.xproperty-title').each(function (B) { + var A = new Element('img', { + src: '/file/resources/icons/datamodel/move.png', + class: 'move', + alt: 'move', + title: 'Drag and drop to change the order', + }); + B.makePositioned(); + B.appendChild(A); + A.observe( + 'click', + function (C) { + C.stop(); + }.bindAsEventListener(), + ); + }); + Sortable.create('xclassContent', { + tag: 'div', + only: 'xproperty', + handle: 'move', + starteffect: this.startDrag.bind(this), + endeffect: this.endDrag.bind(this), + onUpdate: this.updateOrder.bind(this), + }); + }, + updateOrder: function (A) { + var C = A.childElements(); + for (var B = 0; B < C.size(); ++B) { + var D = C[B].down('.xproperty-content'); + D.numberProperty.value = B + 1; + } + }, + startDrag: function (A) { + A.addClassName('dragged'); + $('xclassContent') + .childElements() + .each(function (B) { + B._expandedBeforeDrag = !B.hasClassName('collapsed'); + B.addClassName('collapsed'); + }); + }, + endDrag: function (A) { + A.removeClassName('dragged'); + $('xclassContent') + .childElements() + .each(function (B) { + if (B._expandedBeforeDrag) { + B.removeClassName('collapsed'); + } + }); + }, +}); +$j(document).ready(function () { + if ($('xclassContent')) { + new XWiki.editors.XPropertyOrdering(); + } +}); + if (typeof XWiki == 'undefined') { XWiki = new Object(); } diff --git a/src/main/webapp/resources/js/xwiki/importer/import.css b/src/main/webapp/resources/js/xwiki/importer/import.css index 4a9fab98a..df3f0a2ad 100644 --- a/src/main/webapp/resources/js/xwiki/importer/import.css +++ b/src/main/webapp/resources/js/xwiki/importer/import.css @@ -1,4 +1,4 @@ -#template('colorThemeInit.vm') +@import '/file/resources/celRes/theme/defaultColors.css'; /* Overriding skins */ #import ul.xlist li.xitem div.xitemcontainer { @@ -49,7 +49,7 @@ div.loading { } #packagelist fieldset { - background-color: $theme.backgroundSecondaryColor; + background-color: var(--backgroundSecondaryColor); padding: 5px; } @@ -74,7 +74,7 @@ div.loading { } #packagelist .active { - border: 0px solid $theme.borderColor; + border: 0px solid var(--borderColor); background-color: #fcfcfc; } @@ -83,7 +83,7 @@ div.loading { } #packagelistcontainer .size { - color: $theme.textSecondaryColor; + color: var(--textSecondaryColor); } #packagelistcontainer .xwikibuttonlinks { @@ -109,7 +109,7 @@ div.loading { #packageDescription { background-color: #fcfcfc; - border: 0px solid $theme.borderColor; + border: 0px solid var(--borderColor); overflow: hidden; padding: 10px; margin-bottom: 1px; @@ -130,12 +130,12 @@ div.loading { } #packagecontainer .packageinfos span { - color: $theme.textSecondaryColor; + color: var(--textSecondaryColor); margin: 0 5px 0; } #packagecontainer .packageinfos span.label { - color: $theme.textColor; + color: var(--textColor); font-size: 0.85em; font-weight: 700; text-transform: uppercase; @@ -148,7 +148,7 @@ div.loading { } .selectLinks span { - color: $theme.linkColor; + color: var(--linkColor); cursor: pointer; margin-left: 0.2em; } @@ -158,8 +158,8 @@ div#package div.importOption { } div#package ul.package { - background-color: $theme.pageContentBackgroundColor; - border: 0px solid $theme.borderColor; + background-color: var(--pageContentBackgroundColor); + border: 0px solid var(--borderColor); margin: 0 0 1em 0 !important; padding: 3px !important; width: 98%; @@ -187,7 +187,7 @@ ul.package li.xitem div.xitemcontainer div.spacename { } ul.package li.xitem div.xitemcontainer div.selection { - color: $theme.textSecondaryColor; + color: var(--textSecondaryColor); margin-left: auto; font-size: 0.8em; line-height: 1.7em; diff --git a/src/main/webapp/resources/js/xwiki/importer/import.js b/src/main/webapp/resources/js/xwiki/importer/import.js index f39585090..bedfc4a7a 100644 --- a/src/main/webapp/resources/js/xwiki/importer/import.js +++ b/src/main/webapp/resources/js/xwiki/importer/import.js @@ -10,12 +10,6 @@ var XWiki = (function (XWiki) { console.warn('celExecOnceAfterMessagesLoaded not available!'); } - // FIXME: we should have those images outside SmartClient library to lessen the dependency towards the library - var expandFolderImagePath = - "$xwiki.getSkinFile('js/smartclient/skins/Enterprise/images/TreeGrid/opener_closed.png', true)"; - var collapseFolderImagePath = - "$xwiki.getSkinFile('js/smartclient/skins/Enterprise/images/TreeGrid/opener_opened.png', true)"; - /** * Initialization hook for the rich UI. * We hijack clicks on package names links, to display the rich importer UI since javascript is available. diff --git a/src/main/webapp/resources/js/xwiki/lightbox/lightbox.css b/src/main/webapp/resources/js/xwiki/lightbox/lightbox.css index d0e43d091..219fa4df3 100644 --- a/src/main/webapp/resources/js/xwiki/lightbox/lightbox.css +++ b/src/main/webapp/resources/js/xwiki/lightbox/lightbox.css @@ -87,7 +87,7 @@ margin: 0 1px; } #lb-bg { - background-image: url('$xwiki.getSkinFile('js/xwiki/lightbox/back.png', true)'); + background-image: url(/file/resources/js/xwiki/lightbox/back.png); background-repeat: repeat; height: 100%; width: 100%; @@ -189,6 +189,6 @@ margin-right: 10px; width: 30px; cursor: pointer; - background-image: url('$xwiki.getSkinFile('js/xwiki/lightbox/btnClose.png', true)'); + background-image: url(/file/resources/js/xwiki/lightbox/btnClose.png); background-repeat: no-repeat; } diff --git a/src/main/webapp/resources/js/xwiki/lightbox/lightbox.js b/src/main/webapp/resources/js/xwiki/lightbox/lightbox.js index 27aa10441..d559fb9ae 100644 --- a/src/main/webapp/resources/js/xwiki/lightbox/lightbox.js +++ b/src/main/webapp/resources/js/xwiki/lightbox/lightbox.js @@ -96,8 +96,7 @@ Lightbox = Class.create({ this.nextURL = A; }, getWaiting: function () { - var A = "$xwiki.getSkinFile('icons/ajax-loader.gif', true)"; - return '
'; + return '
'; }, lbcustominit: function (B, A, E, C) { if (!$('lb')) { diff --git a/src/main/webapp/resources/js/xwiki/lightbox/lightboxIE.css b/src/main/webapp/resources/js/xwiki/lightbox/lightboxIE.css deleted file mode 100644 index 72c057bd6..000000000 --- a/src/main/webapp/resources/js/xwiki/lightbox/lightboxIE.css +++ /dev/null @@ -1,212 +0,0 @@ -.rounded .top *, -.rounded .bottom *, -.roundedlight .top *, -.roundedlight .bottom * { - display: block; - overflow: hidden; - border-color: #a9b6c3; - border-style: solid; - background: #eef3f6 none repeat scroll 0 50%; - height: 1px; - border-width: 0 1px; - margin: 0; - padding: 0; - zoom: 1; - line-height: 1px; -} -.rounded, -.rounded .top, -.rounded .bottom { - height: 16px; -} -.roundedlight, -.roundedlight .top, -.roundedlight .bottom { - height: 5px; -} -.roundedlight .b1, -.roundedlight .b1b { - background: #a9b6c3 none repeat scroll 0 50%; - margin: 0 5px; - border-width: 0; -} -.roundedlight .b2, -.roundedlight .b2b { - border-width: 0 2px; - margin: 0 3px; -} -.roundedlight .b3, -.roundedlight .b3b { - margin: 0 2px; -} -.roundedlight .b4, -.roundedlight .b4b { - height: 2px; - margin: 0 1px; -} -.rounded .b1, -.rounded .b1b { - border-width: 0; - margin: 0 16px; - background: #a9b6c3 none repeat scroll 0 50%; -} -.rounded .b2, -.rounded .b2b { - border-width: 0 3px; - margin: 0 13px; -} -.rounded .b3, -.rounded .b3b { - border-width: 0 2px; - margin: 0 11px; -} -.rounded .b4, -.rounded .b4b { - border-width: 0 2px; - margin: 0 9px; -} -.rounded .b5, -.rounded .b5b { - margin: 0 8px; -} -.rounded .b6, -.rounded .b6b { - margin: 0 7px; -} -.rounded .b7, -.rounded .b7b { - margin: 0 6px; -} -.rounded .b8, -.rounded .b8b { - margin: 0 5px; -} -.rounded .b9, -.rounded .b9b { - margin: 0 4px; -} -.rounded .b10, -.rounded .b10b { - height: 2px; - margin: 0 3px; -} -.rounded .b11, -.rounded .b11b { - height: 2px; - margin: 0 2px; -} -.rounded .b12, -.rounded .b12b { - height: 3px; - margin: 0 1px; -} -#lb-bg { - background-color: #000; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; - z-index: 100000; - filter: alpha(opacity=70); - opacity: 0.7; - overflow: auto; -} -#lb input[type='text'], -#lb textarea { - cursor: text; -} -#lb button { - cursor: hand; -} -#lb-align { - min-height: 100%; - position: absolute; - width: 100%; - left: 0; - text-align: center; - vertical-align: middle; - z-index: 100002; -} -#lb { - position: absolute; - left: 50%; - top: 50px; - margin-left: -450px; - z-index: 100005; - width: 900px; -} -.lb-content { - background: #eef3f6; - border: 1px solid #a9b6c3; - border-width: 0 1px; - padding: 0; - text-align: center; -} -#lb ul li { - _zoom: 1; -} -.lb-squarred { - background: #eef3f6; - border: 1px solid #a9b6c3; -} -#lb-bottom .lb-squarred { - border-top-width: 0; -} -#lb-top .lb-squarred { - border-bottom-width: 0; -} -#lb-content h1, -#lb-content h2, -#lb-content h3 { - margin-top: 0; - padding-top: 0; -} -#lb-top .roundedlight { - margin-bottom: -0.15em; - margin-top: -0.9em; -} -#lb-bottom .roundedlight { - margin-top: -0.75em; -} -#lb-top .rounded { - margin-bottom: 0; - margin-top: 0; -} -#lb-bottom .rounded { - margin-top: -0.2em; -} -* + html #lb-top .rounded .b1, -* html #lb-top .rounded .b1, -* + html #lb-top .roundedlight .b1, -* html #lb-top .roundedlight .b1 { - margin-bottom: -1em; -} -* + html #lb-bottom .rounded .b12b, -* html #lb-bottom .rounded .b12b, -* + html #lb-bottom .roundedlight .b4b, -* html #lb-bottom .roundedlight .b4b { - margin-bottom: -1em; -} -#lb .lb-content { - padding: 4px 18px; -} -.lb-content { - overflow: hidden; - text-align: left; -} -#close-wrap { - position: relative; - top: 18px; - right: 7px; - text-align: right; - cursor: default; -} -#lb-close { - margin-left: auto; - margin-right: 10px; - width: 30px; - cursor: pointer; - background-image: url($xwiki.getSkinFile('js/xwiki/lightbox/btnClose.png', true)); - background-repeat: no-repeat; -} diff --git a/src/main/webapp/resources/js/xwiki/table/livetable.css b/src/main/webapp/resources/js/xwiki/table/livetable.css index c7904b248..8f0432540 100644 --- a/src/main/webapp/resources/js/xwiki/table/livetable.css +++ b/src/main/webapp/resources/js/xwiki/table/livetable.css @@ -4,39 +4,49 @@ line-height: 22px; border: 0; } + .xwiki-livetable-loader, .xwiki-livetable-loader img { float: left; } + .xwiki-livetable-pagination .xwiki-livetable-limits { float: left; } + .xwiki-livetable-pagination .xwiki-livetable-limits strong { font-weight: normal; } + .xwiki-livetable-pagination .xwiki-livetable-pagination-content, .xwiki-livetable-pagination .xwiki-livetable-pagination-text { display: in-line; } + .xwiki-livetable-pagination span.pagenumber { color: #888; cursor: pointer; } + .xwiki-livetable-pagination span.pagenumber:hover { color: #4d4d4d; text-decoration: underlined; } + .xwiki-livetable-pagination span.selected { color: #4d4d4d; font-weight: bold; } + .xwiki-livetable-pagination span.pagenumber:focus { outline: dotted 1px #000; } + .pagination { float: right; margin-right: 10px; } + .controlPagination { position: relative; width: 42px; @@ -46,6 +56,7 @@ padding: 0 !important; float: right; } + .controlPagination span { position: absolute; top: 0; @@ -55,61 +66,75 @@ overflow: hidden; border: none; } + .controlPagination span.prevPagination, .controlPagination span.noPrevPagination, .controlPagination span.nextPagination, .controlPagination span.noNextPagination { - background-image: url("$xwiki.getSkinFile('icons/xwiki/pagination-controls.png', true)"); + background-image: url(/file/resources/icons/xwiki/pagination-controls.png); width: 21px; height: 22px; } + .controlPagination span.prevPagination:hover, .controlPagination span.nextPagination:hover { cursor: pointer; } + .controlPagination span.prevPagination { background-position: left top; } + .controlPagination span.noPrevPagination { background-position: left bottom; } + .controlPagination span.nextPagination { background-position: right top; left: 21px; } + .controlPagination span.noNextPagination { background-position: right bottom; left: 21px; } + table.xwiki-livetable { width: 100%; margin: 0; } + .xwiki-livetable td.xwiki-livetable-display-container { margin: 0; border-color: #fff; padding: 0 0 0 4px; width: auto; } + .xwiki-livetable td.xwiki-livetable-display-container table.xwiki-livetable-display { margin: 0; border-collapse: collapse; width: 100%; } + .xwiki-livetable-display td { border-color: #fff; border-bottom-color: #ccc; } + html > body .xwiki-livetable-display td { border: 0; } + table.xwiki-livetable table.xwiki-livetable-display thead.xwiki-livetable-display-header { border-bottom: 5px solid #ddd; } + thead.xwiki-livetable-display-header tr.xwiki-livetable-display-filters:hover, thead.xwiki-livetable-display-header tr.rowHover. { background-color: #fff; } + thead.xwiki-livetable-display-header th.xwiki-livetable-display-header-text { background-color: #ddd; border: 0; @@ -121,30 +146,38 @@ thead.xwiki-livetable-display-header th.xwiki-livetable-display-header-text { text-align: left; white-space: nowrap; } + thead.xwiki-livetable-display-header th.sortable a { color: #4d4d4d; text-decoration: none; } + thead.xwiki-livetable-display-header th.sortable { cursor: pointer; } + thead.xwiki-livetable-display-header th.desc { - background: #ddd url("$xwiki.getSkinFile('icons/silk/bullet_arrow_down.gif', true)") no-repeat scroll right center; + background: #ddd url(/file/resources/icons/silk/bullet_arrow_down.gif) no-repeat scroll right center; } + thead.xwiki-livetable-display-header th.asc { - background: #ddd url("$xwiki.getSkinFile('icons/silk/bullet_arrow_up.gif', true)") no-repeat scroll right center; + background: #ddd url(/file/resources/icons/silk/bullet_arrow_up.gif) no-repeat scroll right center; } + thead.xwiki-livetable-display-header th.selected { color: #4d4d4d; background-color: lemonChiffon; } + thead.xwiki-livetable-display-header td.xwiki-livetable-display-header-filter { padding: 1px; } + html > body thead.xwiki-livetable-display-header td.xwiki-livetable-display-header-filter { padding: 2px 5px 2px 0; border-color: transparent; } + thead.xwiki-livetable-display-header td.xwiki-livetable-display-header-filter input, thead.xwiki-livetable-display-header td.xwiki-livetable-display-header-filter select { width: 100%; @@ -153,57 +186,69 @@ thead.xwiki-livetable-display-header td.xwiki-livetable-display-header-filter se margin: 0; padding: 0 0 0 2px; } + tbody.xwiki-livetable-display-body tr { border-bottom: 1px solid #ccc; } + tbody.xwiki-livetable-display-body tr:hover, tbody.xwiki-livetable-display-body tr.rowHover { background-color: lemonChiffon; } + tbody.xwiki-livetable-display-body tr.rowHover td { border-left-color: lemonChiffon; border-right-color: lemonChiffon; } + tbody.xwiki-livetable-display-body td { color: #4d4d4d; padding: 3px 2px 3px 4px; background-image: none; } + tbody.xwiki-livetable-display-body a, tbody.xwiki-livetable-display-body a:hover { color: #00007e; } + tbody.xwiki-livetable-display-body td.linkeditor, tbody.xwiki-livetable-display-body td.editableCellHover.linkeditor a { padding-right: 16px; cursor: pointer; } + tbody.xwiki-livetable-display-body td:hover.linkeditor { - background: lemonChiffon url("$xwiki.getSkinFile('pencil.gif', true)") no-repeat scroll right center; + background: lemonChiffon url(/file/resources/pencil.gif) no-repeat scroll right center; cursor: pointer; } + tbody.xwiki-livetable-display-body td.linkeditor a.editableCellHover { display: block; - background: lemonChiffon url("$xwiki.getSkinFile('pencil.gif', true)") no-repeat scroll right center; + background: lemonChiffon url(/file/resources/pencil.gif) no-repeat scroll right center; cursor: pointer; color: #4d4d4d; padding-right: 16px; } + tbody.xwiki-livetable-display-body td.linkeditor a { color: #4d4d4d; text-decoration: none; } + tbody.xwiki-livetable-display-body td:hover.typenumeric, tbody.xwiki-livetable-display-body td.editableCellHover.typenumeric, tbody.xwiki-livetable-display-body td.typenumeric { text-align: right; } + tbody.xwiki-livetable-display-body td:hover.typenone, tbody.xwiki-livetable-display-body td.editableCellHover.typenone, tbody.xwiki-livetable-display-body td.typenone { text-align: center; padding-left: 0; } + tbody.xwiki-livetable-display-body td a.action { color: #888; padding-left: 20px; @@ -211,49 +256,63 @@ tbody.xwiki-livetable-display-body td a.action { margin-right: 5px; padding-bottom: 1px; } + tbody.xwiki-livetable-display-body td a.action:hover { text-decoration: underline; } + tbody.xwiki-livetable-display-body td a.actioncopy { - background-image: url($xwiki.getSkinFile('icons/silk/page_white_copy.gif', true)); + background-image: url(/file/resources/icons/silk/page_white_copy.gif); } + tbody.xwiki-livetable-display-body td a.actionrename { - background-image: url($xwiki.getSkinFile('icons/silk/textfield_rename.gif', true)); + background-image: url(/file/resources/icons/silk/textfield_rename.gif); } + tbody.xwiki-livetable-display-body td a.actiondelete { - background-image: url($xwiki.getSkinFile('icons/silk/cross.gif', true)); + background-image: url(/file/resources/icons/silk/cross.gif); } + tbody.xwiki-livetable-display-body td a.actionrights { - background-image: url($xwiki.getSkinFile('icons/silk/lock_edit.gif', true)); + background-image: url(/file/resources/icons/silk/lock_edit.gif); } + tbody.xwiki-livetable-display-body td a.actionedit { - background-image: url($xwiki.getSkinFile('icons/silk/page_white_edit.gif', true)); + background-image: url(/file/resources/icons/silk/page_white_edit.gif); } + div.dialog-loading { border: 1px solid #aaa; } + div.dialog-loading tr.dialogTop td.dialogTopCenter div.Caption { background-color: #ddd; } + div.dialog-loading tr.dialogMiddle td.dialogMiddleCenter div.gwt-ModalDialog-Content { padding: 20px; } + div.xwikigwt-editfield { background-color: #fff; border: 1px solid #aaa; } + div.xwikigwt-editfield-main { padding: 20px; } + div.xwikigwt-editfield tr.dialogTop td.dialogTopCenter div.Caption { background-color: #ddd; color: #4d4d4d; padding: 9px 4px 4px; } + div.xwikigwt-editfield tr.dialogMiddle td.dialogMiddleCenter div.xwikigwt-editfield-actions { margin-top: 10px; width: 75%; } + div.xwikigwt-editfield tr.dialogMiddle td.dialogMiddleCenter div.xwikigwt-editfield-actions .xwikigwt-cancel { background-color: #fff; color: #00007e; @@ -261,10 +320,12 @@ div.xwikigwt-editfield tr.dialogMiddle td.dialogMiddleCenter div.xwikigwt-editfi border: 0; float: right; } + div.xwikigwt-editfield tr.dialogMiddle td.dialogMiddleCenter div.xwikigwt-editfield-actions .xwikigwt-next { background-color: #ddd; color: #000; } + .xwiki-livetable-tagcloud-container { border: 1px solid #ddd; border-bottom: 5px solid #ddd; @@ -273,12 +334,14 @@ div.xwikigwt-editfield tr.dialogMiddle td.dialogMiddleCenter div.xwikigwt-editfi position: relative; margin-top: 10px; } + .xwiki-livetable-tagcloud-container h2 { - background: url($xwiki.getSkinFile('icons/silk/tag_yellow.gif', true)) no-repeat; + background: url(/file/resources/icons/silk/tag_yellow.gif) no-repeat; font-size: 1em; color: #888; padding-left: 25px; } + .xwiki-livetable-tagcloud-container h2 span { color: #888; font-size: 0.8em; @@ -287,28 +350,34 @@ div.xwikigwt-editfield tr.dialogMiddle td.dialogMiddleCenter div.xwikigwt-editfi margin: 0 0 10px; border: none; } + .xwiki-livetable-tagcloud-container div.clearfloats { background-color: transparent; margin: 0; overflow: hidden; } + div.xwiki-livetable-tagcloud ol.tagCloud { margin: 0; } + div.xwiki-livetable-tagcloud ol.tagCloud li span { color: #ddd; padding: 0 3px 0 3px; border: 1px solid #fff; } + div.xwiki-livetable-tagcloud ol.tagCloud li.selectable span { cursor: pointer; color: #4d4d4d; } + div.xwiki-livetable-tagcloud ol.tagCloud li.selected span { background-color: lemonChiffon; border-bottom: 1px solid #ddd; border-top: 1px solid #ddd; } + .xwiki-livetable-tagcloud-tip .tippointer { position: relative; width: 0; @@ -320,6 +389,7 @@ div.xwiki-livetable-tagcloud ol.tagCloud li.selected span { border-left: 20px dotted transparent; border-bottom: 0 none; } + .xwiki-livetable-tagcloud-tip .tippointer div { position: absolute; width: 0; @@ -331,44 +401,54 @@ div.xwiki-livetable-tagcloud ol.tagCloud li.selected span { border-left: 15px dotted transparent; border-bottom: 0 none; } + div.xwiki-livetable-pagination-content { - background: url($xwiki.getSkinFile('icons/silk/page_white_copy.gif', true)) no-repeat; + background: url(/file/resources/icons/silk/page_white_copy.gif) no-repeat; padding-left: 20px; padding-bottom: 2px; display: inline; } + div.xwiki-livetable-pagination-content span.pagenumber { display: inline; color: #888; cursor: pointer; } + div.xwiki-livetable-pagination-content span.pagenumber:hover { color: #4d4d4d; text-decoration: underlined; } + div.xwiki-livetable-pagination-content span.selected { color: #4d4d4d; font-weight: bold; } + div.xwiki-livetable-pagination-content span.pagenumber:focus { outline: dotted 1px #000; } + .display { border-collapse: collapse; border: 1px solid #e8e8e8; width: 100%; } + .display td { border: 1px solid #e8e8e8; padding: 3px; } + .icon-manage { cursor: pointer; padding-right: 10px; } + .icon-manageg { padding-right: 10px; } + #ajax-loader { margin: 0; padding: 0; @@ -384,21 +464,26 @@ div.xwiki-livetable-pagination-content span.pagenumber:focus { padding: 8px; text-indent: 5px; } + .theader { background-color: #ccc; color: #fff; font-weight: bold; font-size: 1em; } + #table-filters { background-color: #efefef; } + .filter { width: 70%; } + .theader td { padding: 3px 0 3px 10px; } + table.livetable { width: 100%; position: relative; diff --git a/src/main/webapp/resources/js/xwiki/table/livetable.js b/src/main/webapp/resources/js/xwiki/table/livetable.js index 940c4adce..f050685a2 100644 --- a/src/main/webapp/resources/js/xwiki/table/livetable.js +++ b/src/main/webapp/resources/js/xwiki/table/livetable.js @@ -1,4 +1,11 @@ (function () { + let translations = {}; + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded((celMessages) => (translations = celMessages.livetable)); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } + /** * XWiki namespace */ @@ -73,6 +80,7 @@ options = {}; } + this.action = options.action || 'view'; // FIXME check if this can be removed safely. this.action = options.action || 'view'; // FIXME check if this can be removed safely. // Initialize table params that are used for permalinks @@ -89,6 +97,9 @@ // Initialize the throttling delay, that is the delay a user can type a second filter key after a first one without // sending an AJAX request to the server. this.throttlingDelay = options.throttlingDelay || 0.5; + // Initialize the throttling delay, that is the delay a user can type a second filter key after a first one without + // sending an AJAX request to the server. + this.throttlingDelay = options.throttlingDelay || 0.5; // If permalinks is enable, load initial hash, using the URL hash if available or the default above this.permalinks = new LiveTableHash( @@ -96,6 +107,9 @@ typeof options.permalinks == 'undefined' || options.permalinks, ); + // Get params from permalinks + this.limit = this.permalinks.getLimit(); + var initialPage = this.permalinks.getPage(); // Get params from permalinks this.limit = this.permalinks.getLimit(); var initialPage = this.permalinks.getPage(); @@ -175,6 +189,11 @@ getRows: function (reqOffset, reqLimit, displayOffset, displayLimit, delay) { var self = this; + if (this.nextRequestTimeoutId) { + // If a request was queued previously, cancel it + window.clearTimeout(this.nextRequestTimeoutId); + delete this.nextRequestTimeoutId; + } if (this.nextRequestTimeoutId) { // If a request was queued previously, cancel it window.clearTimeout(this.nextRequestTimeoutId); @@ -203,6 +222,7 @@ } url += self.getSortURLFragment(); + self.loadingStatus.removeClassName('hidden'); self.loadingStatus.removeClassName('hidden'); // Let code know the table is about to load new entries. @@ -232,13 +252,21 @@ onSuccess: function (transport) { var res = eval('(' + transport.responseText + ')'); + if (res.reqNo < self.sendReqNo) { + return; + } if (res.reqNo < self.sendReqNo) { return; } + self.recvReqNo = res.reqNo; + self.loadingStatus.addClassName('hidden'); self.recvReqNo = res.reqNo; self.loadingStatus.addClassName('hidden'); + if (self.tagCloud && res.matchingtags) { + self.tagCloud.updateTagCloud(res.tags, res.matchingtags); + } if (self.tagCloud && res.matchingtags) { self.tagCloud.updateTagCloud(res.tags, res.matchingtags); } @@ -306,12 +334,14 @@ off + ' - ' + f + - " $msg.get('xe.pagination.results.of') " + + ' ' + + translations.resultsOf + + ' ' + this.totalRows + ''; msg = msg.toLowerCase(); - this.limitsDisplay.innerHTML = "$msg.get('xe.pagination.results') " + msg; + this.limitsDisplay.innerHTML = translations.results + ' ' + msg; this.clearDisplay(); for (var i = off; i <= f; i++) { @@ -352,6 +382,8 @@ showRows: function (offset, limit, delay) { this.lastOffset = offset; + // Update permalinks + this.permalinks.update(); // Update permalinks this.permalinks.update(); @@ -365,6 +397,9 @@ return buff; } + // Make a range of required rows + var min = -1; + var max = -1; // Make a range of required rows var min = -1; var max = -1; @@ -584,6 +619,7 @@ this.params = this.getTableParams(); this.filters = new Object(); + if (!this.enable) return; if (!this.enable) return; var hashString = window.location.hash.substring(1); @@ -883,6 +919,7 @@ this.inputs = this.filterNodes.invoke('select', 'input').flatten(); this.selects = this.filterNodes.invoke('select', 'select').flatten(); + this.initializeFilters(); this.initializeFilters(); this.attachEventHandlers(); @@ -1176,21 +1213,4 @@ return popularityMap; }, }); - - /** - * The Ugly: Fix IE6 - * Add specific classes when mouse is over table rows, since it cannot be handled in CSS. - */ - if (browser.isIE6x) { - // get notified of all new rows created by live tables. - document.observe('xwiki:livetable:newrow', function (ev) { - // Add events listeners to mouse over/out on the - Event.observe(ev.memo.row, 'mouseover', function (event) { - event.element().up('tr').addClassName('rowHover'); - }); - Event.observe(ev.memo.row, 'mouseout', function (event) { - event.element().up('tr').removeClassName('rowHover'); - }); - }); - } })(); diff --git a/src/main/webapp/resources/js/xwiki/table/tablefilterNsort.js b/src/main/webapp/resources/js/xwiki/table/tablefilterNsort.js index 2937aa45f..1c2d3c5c2 100644 --- a/src/main/webapp/resources/js/xwiki/table/tablefilterNsort.js +++ b/src/main/webapp/resources/js/xwiki/table/tablefilterNsort.js @@ -1,7 +1,7 @@ var image_path = ''; -var image_up = "$xwiki.getSkinFile('icons/table/arrow-up.gif', true)"; -var image_down = "$xwiki.getSkinFile('js/xwiki/table/img/arrow-down.gif', true)"; -var image_none = "$xwiki.getSkinFile('js/xwiki/table/img/arrow-none.gif', true)"; +var image_up = '/file/resources/icons/table/arrow-up.gif'; +var image_down = '/file/resources/js/xwiki/table/img/arrow-down.gif'; +var image_none = '/file/resources/js/xwiki/table/img/arrow-none.gif'; var TblId, StartRow, SearchFlt, ModFn, ModFnId; ((TblId = new Array()), (StartRow = new Array())); ((ModFn = new Array()), (ModFnId = new Array())); diff --git a/src/main/webapp/resources/js/xwiki/viewers/attachments.css b/src/main/webapp/resources/js/xwiki/viewers/attachments.css index 861e1839d..d9d22ee03 100644 --- a/src/main/webapp/resources/js/xwiki/viewers/attachments.css +++ b/src/main/webapp/resources/js/xwiki/viewers/attachments.css @@ -7,26 +7,32 @@ background: transparent 2px center no-repeat; padding-left: 20px; } + .add-file-input { margin-left: 10px; background-position: 2px top; - background-image: url($xwiki.getSkinFile('icons/silk/textfield_add.gif', true)); + background-image: url(/file/resources/icons/silk/textfield_add.gif); } + .add-file-input:hover { color: #070; } + .remove-file-input { - background-image: url($xwiki.getSkinFile('icons/silk/cross.gif', true)); + background-image: url(/file/resources/icons/silk/cross.gif); width: 16px; text-indent: 30px; } + .remove-file-input:hover { color: #d00; } + .uploadFileInput { margin: 5px 10px !important; border: 1px solid #ddd !important; } + .attachment .xwikibuttonlinks a { width: 16px; height: 16px; @@ -38,12 +44,15 @@ float: right; margin: 0 0 0 4px; } + .attachment .xwikibuttonlinks a.deletelink { - background-image: url($xwiki.getSkinFile('icons/silk/cross.gif', true)); + background-image: url(/file/resources/icons/silk/cross.gif); } + .attachment .xwikibuttonlinks a.editlink { - background-image: url($xwiki.getSkinFile('icons/silk/pencil.gif', true)); + background-image: url(/file/resources/icons/silk/pencil.gif); } + #AddAttachment { border-top: 1px solid #ddd; } diff --git a/src/main/webapp/resources/js/xwiki/viewers/attachments.js b/src/main/webapp/resources/js/xwiki/viewers/attachments.js index 7e215112b..62b67bd9e 100644 --- a/src/main/webapp/resources/js/xwiki/viewers/attachments.js +++ b/src/main/webapp/resources/js/xwiki/viewers/attachments.js @@ -1,4 +1,12 @@ var XWiki = (function (XWiki) { + let translations = {}; + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded( + (celMessages) => (translations = celMessages.attachments), + ); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } // Start XWiki augmentation. var viewers = (XWiki.viewers = XWiki.viewers || {}); /** @@ -58,10 +66,10 @@ var XWiki = (function (XWiki) { }, /* Interaction parameters */ { - confirmationText: "$msg.get('core.viewers.attachments.delete.confirm')", - progressMessageText: "$msg.get('core.viewers.attachments.delete.inProgress')", - successMessageText: "$msg.get('core.viewers.attachments.delete.done')", - failureMessageText: "$msg.get('core.viewers.attachments.delete.failed')", + confirmationText: translations.deleteConfirm, + progressMessageText: translations.deleteInProgress, + successMessageText: translations.deleteDone, + failureMessageText: translations.deleteFailed, }, ); } @@ -75,7 +83,7 @@ var XWiki = (function (XWiki) { $('Attachmentstab') .down('.itemCount') .update( - "$msg.get('docextra.extranb', ['__number__'])".replace( + translations['extranb'].replace( '__number__', $('Attachmentspane').select('.attachment').size(), ), @@ -85,7 +93,7 @@ var XWiki = (function (XWiki) { $('attachmentsshortcut') .down('.itemCount') .update( - "$msg.get('docextra.extranb', ['__number__'])".replace( + translations['extranb'].replace( '__number__', $('Attachmentspane').select('.attachment').size(), ), @@ -113,7 +121,7 @@ var XWiki = (function (XWiki) { addAddButton: function () { var addButton = new Element('input', { type: 'button', - value: "$msg.get('core.viewers.attachments.upload.addFileInput')", + value: translations.addFileInput, className: 'attachmentActionButton add-file-input', }); this.addDiv = new Element('div'); @@ -159,8 +167,8 @@ var XWiki = (function (XWiki) { createRemoveButton: function () { var removeButton = new Element('input', { type: 'button', - value: "$msg.get('core.viewers.attachments.upload.removeFileInput')", - title: "$msg.get('core.viewers.attachments.upload.removeFileInput.title')", + value: translations.removeFileInput, + title: translations.removeFileInputTitle, className: 'attachmentActionButton remove-file-input', }); Event.observe(removeButton, 'click', this.removeField.bindAsEventListener(this)); diff --git a/src/main/webapp/resources/js/xwiki/widgets/modalPopup.css b/src/main/webapp/resources/js/xwiki/widgets/modalPopup.css index f777291a6..9cde34f4c 100644 --- a/src/main/webapp/resources/js/xwiki/widgets/modalPopup.css +++ b/src/main/webapp/resources/js/xwiki/widgets/modalPopup.css @@ -1,4 +1,5 @@ -#template('colorThemeInit.vm') .xdialog-modal-container { +@import '/file/resources/celRes/theme/defaultColors.css'; +.xdialog-modal-container { position: fixed; top: 0px; bottom: 0px; @@ -30,9 +31,9 @@ margin: auto; position: relative; width: 400px; - color: $theme.textColor; - border: 2px solid $theme.borderColor; - background-color: $theme.backgroundSecondaryColor; + color: var(--textColor); + border: 2px solid var(--borderColor); + background-color: var(--backgroundSecondaryColor); } .xdialog-close { float: right; @@ -46,7 +47,7 @@ text-transform: lowercase; font-family: Arial, Helvetica, sans-serif; line-height: 8px; - color: $theme.textColor; + color: var(--textColor); } * html .xdialog-close { width: 22px; @@ -56,5 +57,5 @@ font-weight: bold; margin-top: -5px; margin-bottom: 10px; - color: $theme.textColor; + color: var(--textColor); } diff --git a/src/main/webapp/resources/js/xwiki/xwiki-misc.js b/src/main/webapp/resources/js/xwiki/xwiki-misc.js new file mode 100644 index 000000000..352f7e305 --- /dev/null +++ b/src/main/webapp/resources/js/xwiki/xwiki-misc.js @@ -0,0 +1,20 @@ +/** this are js-snippets moved to disk from xwiki-sheets on + * dropping skinx plugins **/ +document.addEventListener('DOMContentLoaded', function () { + const switcher = document.getElementById('classname'); + if (switcher) { + switcher.addEventListener('change', function () { + const value = this.options[this.selectedIndex].value; + if (value !== '-') { + window.location = value; + } + }); + const form = switcher.closest('form'); + if (form) { + const submit = form.querySelector("input[type='submit']"); + if (submit) { + submit.style.display = 'none'; + } + } + } +}); diff --git a/src/main/webapp/resources/js/xwiki/xwiki.js b/src/main/webapp/resources/js/xwiki/xwiki.js index e56cc115f..6473f738a 100644 --- a/src/main/webapp/resources/js/xwiki/xwiki.js +++ b/src/main/webapp/resources/js/xwiki/xwiki.js @@ -7,6 +7,10 @@ var XWiki = (function (XWiki) { */ Object.extend(XWiki, { + messages: { + translations: {}, + celMeta: {}, + }, constants: { /** * Character that separates wiki from space in a page fullName (example: xwiki:Main.WebHome). @@ -338,7 +342,7 @@ var XWiki = (function (XWiki) { error.next().hasClassName('xwikirenderingerrordescription') ) { error.style.cursor = 'pointer'; - error.title = "$msg.get('platform.core.rendering.error.readTechnicalInformation')"; + error.title = this.messages.translations.readTechnicalInformation; Event.observe(error, 'click', function (event) { event.element().next().toggleClassName('hidden'); }); @@ -381,49 +385,6 @@ var XWiki = (function (XWiki) { } }, - /** - * Insert a link for editing sections. - */ - insertSectionEditLinks: function () { - // Insert links only in view mode and for xwiki/2.0 documents. - if (XWiki.docsyntax == 'xwiki/2.0' && XWiki.contextaction == 'view' && XWiki.hasEdit) { - // Section count starts at one, not zero. - var sectioncount = 1; - - // We can't use element.select() since it does not keep the order of the elements in the flow. - var nodes = $('xwikicontent'); - if (!nodes) { - return; - } - nodes = nodes.childNodes; - - // Only allow section editing for the specified depth level (2 by default) - var headerPattern = new RegExp('H[1-' + $xwiki.getSectionEditingDepth() + ']'); - - // For all non-generated headers, add a SPAN and A element in order to be able to edit the section. - for (var i = 0; i < nodes.length; i++) { - var node = $(nodes[i]); - - if ( - headerPattern.test(node.nodeName) && - node.className.include('wikigeneratedheader') == false - ) { - var editspan = document.createElement('SPAN'); - var editlink = document.createElement('A'); - - editlink.href = window.docediturl + '?section=' + sectioncount; - editlink.style.textDecoration = 'none'; - editlink.innerHTML = "$msg.get('edit')"; - editspan.className = 'edit_section'; - - editspan.appendChild(editlink); - node.insert({ after: editspan }); - sectioncount++; - } - } - } - }, - /** * Display a modal box allowing to create the new document from a template when clicking on broken links. */ @@ -467,9 +428,11 @@ var XWiki = (function (XWiki) { } }, onFailure: function () { - new XWiki.widgets.Notification("$msg.get('core.create.ajax.error')", 'error', { - inactive: true, - }).show(); + new XWiki.widgets.Notification( + this.messages.translations.createAjaxError, + 'error', + { inactive: true }, + ).show(); }, }); event.stop(); @@ -629,15 +592,20 @@ var XWiki = (function (XWiki) { // It would fire the custom dom:loaded event twice, which could make their observers misbehave. if (typeof this.isInitialized == 'undefined' || this.isInitialized == false) { this.isInitialized = true; - document.fire('xwiki:dom:loading'); - - this.makeRenderingErrorsExpandable(); - this.fixLinksTargetAttribute(); - this.insertSectionEditLinks(); - this.insertCreatePageFromTemplateModalBoxes(); - this.watchlist.initialize(); - - document.fire('xwiki:dom:loaded'); + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded((celMessages) => { + this.messages.translations = celMessages.xwiki; + this.messages.celMeta = celMessages.celmeta; + document.fire('xwiki:dom:loading'); + this.makeRenderingErrorsExpandable(); + this.fixLinksTargetAttribute(); + this.insertCreatePageFromTemplateModalBoxes(); + this.watchlist.initialize(); + document.fire('xwiki:dom:loaded'); + }); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } } }, }); @@ -1362,12 +1330,13 @@ document.observe('xwiki:dom:loading', function () { $$('meta[name=space]').length > 0 ? $$('meta[name=space]')[0].content : 'Main'; XWiki.Document.currentPage = $$('meta[name=page]').length > 0 ? $$('meta[name=page]')[0].content : 'WebHome'; - XWiki.Document.URLTemplate = "$xwiki.getURL('__space__.__page__', '__action__')"; + XWiki.Document.URLTemplate = '/__action__/__space__/__page__'; XWiki.Document.RestURLTemplate = - '${request.contextPath}/rest/wikis/__wiki__/spaces/__space__/pages/__page__'; - XWiki.Document.WikiSearchURLStub = '${request.contextPath}/rest/wikis/__wiki__/search'; + XWiki.messages.celMeta.contextPath + '/rest/wikis/__wiki__/spaces/__space__/pages/__page__'; + XWiki.Document.WikiSearchURLStub = + XWiki.messages.celMeta.contextPath + '/rest/wikis/__wiki__/search'; XWiki.Document.SpaceSearchURLStub = - '${request.contextPath}/rest/wikis/__wiki__/spaces/__space__/search'; + XWiki.messages.celMeta.contextPath + '/rest/wikis/__wiki__/spaces/__space__/search'; XWiki.Document.getRestSearchURL = function (queryString, space, wiki) { wiki = wiki || XWiki.Document.currentWiki; var url; diff --git a/src/main/webapp/resources/uicomponents/pagination/pagination.css b/src/main/webapp/resources/uicomponents/pagination/pagination.css index 24e319041..c5e37bd59 100644 --- a/src/main/webapp/resources/uicomponents/pagination/pagination.css +++ b/src/main/webapp/resources/uicomponents/pagination/pagination.css @@ -49,7 +49,7 @@ outline: none; overflow: hidden; border: none; - background-image: url($xwiki.getSkinFile('icons/xwiki/pagination-controls.png', true)); + background-image: url(/file/resources/icons/xwiki/pagination-controls.png); width: 21px; height: 22px; } diff --git a/src/main/webapp/resources/uicomponents/search/search.css b/src/main/webapp/resources/uicomponents/search/search.css index 0d574204c..051daf301 100644 --- a/src/main/webapp/resources/uicomponents/search/search.css +++ b/src/main/webapp/resources/uicomponents/search/search.css @@ -17,13 +17,13 @@ display: inline-block; width: 82%; padding-left: 20px; - background: transparent url($xwiki.getSkinFile('icons/silk/page_white_text.gif', true)) no-repeat left top; + background: transparent url(/file/resources/icons/silk/page_white_text.gif) no-repeat left top; } .resultItem .type-comment { - background-image: url($xwiki.getSkinFile('icons/silk/comment.gif', true)); + background-image: url(/file/resources/icons/silk/comment.gif); } .resultItem .type-attachment { - background-image: url($xwiki.getSkinFile('icons/silk/attach.gif', true)); + background-image: url(/file/resources/icons/silk/attach.gif); } .itemDescription a, .itemDescription a:hover { @@ -80,10 +80,10 @@ padding-right: 16px; } .itemOthers .itemComments a { - background-image: url($xwiki.getSkinFile('icons/silk/comment.gif', true)); + background-image: url(/file/resources/icons/silk/comment.gif); } .itemOthers .itemAttachments a { - background-image: url($xwiki.getSkinFile('icons/silk/attach.gif', true)); + background-image: url(/file/resources/icons/silk/attach.gif); } .itemRating { position: relative; @@ -93,7 +93,7 @@ margin: 1px 0 0 0 !important; padding: 0 !important; background-position: left top; - background-image: url($xwiki.getSkinFile('icons/xwiki/rating.png', true)); + background-image: url(/file/resources/icons/xwiki/rating.png); } .relevance .currentRelevance, .itemRating .currentRating { @@ -109,7 +109,7 @@ .itemRating .currentRating { height: 11px; line-height: 11px; - background-image: url($xwiki.getSkinFile('icons/xwiki/rating.png', true)); + background-image: url(/file/resources/icons/xwiki/rating.png); background-position: left center; } .itemRelevance { @@ -127,13 +127,13 @@ margin: 5px 0 0 0 !important; padding: 0 !important; background-position: left bottom; - background-image: url($xwiki.getSkinFile('icons/xwiki/relevance.png', true)); + background-image: url(/file/resources/icons/xwiki/relevance.png); float: right; } .relevance .currentRelevance { height: 8px; line-height: 8px; - background-image: url($xwiki.getSkinFile('icons/xwiki/relevance.png', true)); + background-image: url(/file/resources/icons/xwiki/relevance.png); background-position: left top; } .relevanceText { @@ -159,16 +159,16 @@ background: transparent no-repeat center center; } .itemActions .copy { - background-image: url($xwiki.getSkinFile('icons/silk/page_white_copy.gif', true)); + background-image: url(/file/resources/icons/silk/page_white_copy.gif); } .itemActions .delete { - background-image: url($xwiki.getSkinFile('icons/silk/cross.gif', true)); + background-image: url(/file/resources/icons/silk/cross.gif); } .itemActions .rename { - background-image: url($xwiki.getSkinFile('icons/silk/textfield_rename.gif', true)); + background-image: url(/file/resources/icons/silk/textfield_rename.gif); } .itemActions .rights { - background-image: url($xwiki.getSkinFile('icons/silk/lock_edit.gif', true)); + background-image: url(/file/resources/icons/silk/lock_edit.gif); } #searchBar { margin-bottom: 1em; @@ -181,7 +181,7 @@ font-size: 1.1em; } #searchBar .searchQuery { - background: transparent url($xwiki.getSkinFile('icons/xwiki/search.png', true)) left center no-repeat; + background: transparent url(/file/resources/icons/xwiki/search.png) left center no-repeat; display: inline-block; padding-left: 18px; border: 2px solid #ccc; diff --git a/src/main/webapp/resources/uicomponents/viewers/code.js b/src/main/webapp/resources/uicomponents/viewers/code.js index 42afe246d..b19abe789 100644 --- a/src/main/webapp/resources/uicomponents/viewers/code.js +++ b/src/main/webapp/resources/uicomponents/viewers/code.js @@ -11,11 +11,19 @@ if (typeof XWiki.viewers == 'undefined') { * JavaScript snippet that toggles line numbers on code view. */ XWiki.viewers.Code = Class.create({ + translations: {}, initialize: function (initialShowLineNumbers) { + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded( + (celMessages) => (this.translations = celMessages.code), + ); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } this.showingLineNumbers = initialShowLineNumbers; this.toggleLink = $('toggleLineNumbers'); - this.showText = "$msg.get('core.viewers.code.showLineNumbers')"; - this.hideText = "$msg.get('core.viewers.code.hideLineNumbers')"; + this.showText = this.translations.showLineNumbers; + this.hideText = this.translations.hideLineNumbers; if (this.toggleLink) { this.textarea = this.toggleLink.up().down('textarea'); if (this.textarea) { diff --git a/src/main/webapp/resources/uicomponents/viewers/comments.css b/src/main/webapp/resources/uicomponents/viewers/comments.css index 66a4a45ab..2e17fb9a9 100644 --- a/src/main/webapp/resources/uicomponents/viewers/comments.css +++ b/src/main/webapp/resources/uicomponents/viewers/comments.css @@ -61,10 +61,10 @@ li.reply { margin: 0 0 0 4px; } .commentdelete a { - background-image: url($xwiki.getSkinFile('icons/silk/cross.gif', true)); + background-image: url(/file/resources/icons/silk/cross.gif); } .commentreply a { - background-image: url($xwiki.getSkinFile('icons/silk/comments_add.gif', true)); + background-image: url(/file/resources/icons/silk/comments_add.gif); } #AddComment { border-top: 1px solid #ddd; @@ -80,7 +80,7 @@ li.reply { } #AddComment .commentcontainer { padding: 4px 32px; - background: transparent url($xwiki.getSkinFile('icons/xwiki/rquo.gif', true)) right 4px no-repeat; + background: transparent url(/file/resources/icons/xwiki/rquo.gif) right 4px no-repeat; } #AddComment .commentcontainer label { width: 24px; @@ -89,7 +89,7 @@ li.reply { font-size: 1px; line-height: 120px; overflow: hidden; - background: transparent url($xwiki.getSkinFile('icons/xwiki/lquo.gif', true)) left top no-repeat; + background: transparent url(/file/resources/icons/xwiki/lquo.gif) left top no-repeat; display: inline; float: left; margin-left: -32px; diff --git a/src/main/webapp/resources/uicomponents/viewers/comments.js b/src/main/webapp/resources/uicomponents/viewers/comments.js index c9148d572..b658225ac 100644 --- a/src/main/webapp/resources/uicomponents/viewers/comments.js +++ b/src/main/webapp/resources/uicomponents/viewers/comments.js @@ -1,13 +1,22 @@ var XWiki = (function (XWiki) { // Start XWiki augmentation. var viewers = (XWiki.viewers = XWiki.viewers || {}); + /** * Javascript enhancements for the comments viewer. */ viewers.Comments = Class.create({ + translations: translations, xcommentSelector: '.xwikicomment', /** Constructor. Adds all the JS improvements of the Comments area. */ initialize: function () { + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded( + (celMessages) => (this.translations = celMessages.comments), + ); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } if ($('commentscontent')) { // If the comments area is already visible, enhance it. this.startup(); @@ -89,9 +98,7 @@ var XWiki = (function (XWiki) { this.resetForm(); } // Replace the comment with a "deleted comment" placeholder - comment.replace( - this.createNotification("$msg.get('core.viewers.comments.commentDeleted')"), - ); + comment.replace(this.createNotification(this.translations.commentDeleted)); this.updateCount(); }.bind(this), onComplete: function () { @@ -101,10 +108,10 @@ var XWiki = (function (XWiki) { }, /* Interaction parameters */ { - confirmationText: "$msg.get('core.viewers.comments.delete.confirm')", - progressMessageText: "$msg.get('core.viewers.comments.delete.inProgress')", - successMessageText: "$msg.get('core.viewers.comments.delete.done')", - failureMessageText: "$msg.get('core.viewers.comments.delete.failed')", + confirmationText: this.translations.deleteConfirm, + progressMessageText: this.translations.deleteInProgress, + successMessageText: this.translations.deleteDone, + failureMessageText: this.translations.deleteFailed, }, ); } @@ -152,7 +159,7 @@ var XWiki = (function (XWiki) { // Disable the button, to avoid a cascade of clicks from impatient users item.disabled = true; item._x_notification = new XWiki.widgets.Notification( - "$msg.get('core.viewers.comments.editForm.fetch.inProgress')", + this.translations.editFormFetchInProgress, 'inprogress', ); }, @@ -185,7 +192,7 @@ var XWiki = (function (XWiki) { } item._x_notification.replace( new XWiki.widgets.Notification( - "$msg.get('core.viewers.comments.editForm.fetch.failed')" + failureReason, + this.translations.editFormFetchFailed + failureReason, 'error', ), ); @@ -291,7 +298,7 @@ var XWiki = (function (XWiki) { formData.unset('action_cancel'); // Create a notification message to display to the user when the submit is being sent form._x_notification = new XWiki.widgets.Notification( - "$msg.get('core.viewers.comments.add.inProgress')", + this.translations.addInProgress, 'inprogress', ); form.disable(); @@ -303,10 +310,7 @@ var XWiki = (function (XWiki) { this.restartNeeded = true; this.editing = false; form._x_notification.replace( - new XWiki.widgets.Notification( - "$msg.get('core.viewers.comments.add.done')", - 'done', - ), + new XWiki.widgets.Notification(this.translations.addDone, 'done'), ); }.bind(this), onFailure: function (response) { @@ -319,7 +323,7 @@ var XWiki = (function (XWiki) { } form._x_notification.replace( new XWiki.widgets.Notification( - "$msg.get('core.viewers.comments.add.failed')" + failureReason, + this.translations.addFailed + failureReason, 'error', ), ); @@ -363,7 +367,7 @@ var XWiki = (function (XWiki) { if (!form) { return; } - var previewURL = "$xwiki.getURL('__space__.__page__', 'preview')" + var previewURL = '/preview/__space__/__page__' .replace('__space__', encodeURIComponent($$('meta[name=space]')[0].content)) .replace('__page__', encodeURIComponent($$('meta[name=page]')[0].content)); form.commentElt = form.down('textarea'); @@ -374,7 +378,7 @@ var XWiki = (function (XWiki) { new Element('input', { type: 'button', class: 'button', - value: "$msg.get('core.viewers.comments.preview.button.preview')", + value: this.translations.previewButtonPreview, }), ); form.previewButton._x_modePreview = false; @@ -390,7 +394,7 @@ var XWiki = (function (XWiki) { if (!form.previewButton._x_modePreview && !form.previewButton.disabled) { form.previewButton.disabled = true; var notification = new XWiki.widgets.Notification( - "$msg.get('core.viewers.comments.preview.inProgress')", + this.translations.previewInProgress, 'inprogress', ); new Ajax.Request(previewURL, { @@ -416,7 +420,7 @@ var XWiki = (function (XWiki) { } notification.replace( new XWiki.widgets.Notification( - "$msg.get('core.viewers.comments.preview.failed')" + failureReason, + this.translations.previewFailed + failureReason, 'error', ), ); @@ -445,8 +449,7 @@ var XWiki = (function (XWiki) { form.previewContent.update(content); form.previewContent.show(); form.commentElt.hide(); - form.previewButton.down('input').value = - "$msg.get('core.viewers.comments.preview.button.back')"; + form.previewButton.down('input').value = this.translations.previewButtonBack; }, /** * Display the comment textarea instead of the comment preview. @@ -458,8 +461,7 @@ var XWiki = (function (XWiki) { form.previewContent.hide(); form.previewContent.update(''); form.commentElt.show(); - form.previewButton.down('input').value = - "$msg.get('core.viewers.comments.preview.button.preview')"; + form.previewButton.down('input').value = this.translations.previewButtonPreview; }, resetForm: function (event) { if (event) { @@ -484,20 +486,14 @@ var XWiki = (function (XWiki) { $('Commentstab') .down('.itemCount') .update( - "$msg.get('docextra.extranb', ['__number__'])".replace( - '__number__', - $$(this.xcommentSelector).size(), - ), + this.translations['extranb'].replace('__number__', $$(this.xcommentSelector).size()), ); } if ($('commentsshortcut') && $('commentsshortcut').down('.itemCount')) { $('commentsshortcut') .down('.itemCount') .update( - "$msg.get('docextra.extranb', ['__number__'])".replace( - '__number__', - $$(this.xcommentSelector).size(), - ), + this.translations['extranb'].replace('__number__', $$(this.xcommentSelector).size()), ); } }, diff --git a/src/main/webapp/resources/uicomponents/widgets/confirmationBox.css b/src/main/webapp/resources/uicomponents/widgets/confirmationBox.css index 5df44d218..0636e6102 100644 --- a/src/main/webapp/resources/uicomponents/widgets/confirmationBox.css +++ b/src/main/webapp/resources/uicomponents/widgets/confirmationBox.css @@ -1,10 +1,12 @@ .xdialog-box-confirmation { border-color: #28c !important; } + .xdialog-box-confirmation .xdialog-close { color: #28c !important; } + .xdialog-box-confirmation .question { - background: transparent url($xwiki.getSkinFile('icons/silk/help.gif', true)) left 2px no-repeat; + background: transparent url(/file/resources/icons/silk/help.gif) left 2px no-repeat; padding: 4px 0 6px 22px; } diff --git a/src/main/webapp/resources/uicomponents/widgets/confirmationBox.js b/src/main/webapp/resources/uicomponents/widgets/confirmationBox.js index 5911c9a6b..650725c28 100644 --- a/src/main/webapp/resources/uicomponents/widgets/confirmationBox.js +++ b/src/main/webapp/resources/uicomponents/widgets/confirmationBox.js @@ -11,12 +11,24 @@ if ( XWiki.widgets.ConfirmationBox = Class.create(XWiki.widgets.ModalPopup, { /** Default displayed texts */ defaultInteractionParameters: { - confirmationText: "$msg.get('core.widgets.confirmationBox.defaultQuestion')", - yesButtonText: "$msg.get('core.widgets.confirmationBox.button.yes')", - noButtonText: "$msg.get('core.widgets.confirmationBox.button.no')", + confirmationText: '?', + yesButtonText: 'yes', + noButtonText: 'no', }, /** Constructor. Registers the key listener that pops up the dialog. */ initialize: function ($super, behavior, interactionParameters) { + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded( + (celMessages) => + (this.defaultInteractionParameters = { + confirmationText: celMessages.confirmationBox.defaultQuestion, + yesButtonText: celMessages.confirmationBox.yes, + noButtonText: celMessages.confirmationBox.no, + }), + ); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } this.interactionParameters = Object.extend( Object.clone(this.defaultInteractionParameters), interactionParameters || {}, diff --git a/src/main/webapp/resources/uicomponents/widgets/confirmedAjaxRequest.js b/src/main/webapp/resources/uicomponents/widgets/confirmedAjaxRequest.js index 7ebe2cae6..2c8f3ca1e 100644 --- a/src/main/webapp/resources/uicomponents/widgets/confirmedAjaxRequest.js +++ b/src/main/webapp/resources/uicomponents/widgets/confirmedAjaxRequest.js @@ -48,17 +48,24 @@ if ( }, /** Constructor. Registers the key listener that pops up the dialog. */ initialize: function ($super, requestUrl, ajaxRequestParameters, interactionParameters) { - this.interactionParameters = Object.extend( - { - displayProgressMessage: true, - progressMessageText: "$msg.get('core.widgets.confirmationBox.notification.inProgress')", - displaySuccessMessage: true, - successMessageText: "$msg.get('core.widgets.confirmationBox.notification.done')", - displayFailureMessage: true, - failureMessageText: "$msg.get('core.widgets.confirmationBox.notification.failed')", - }, - interactionParameters || {}, - ); + if (window.celExecOnceAfterMessagesLoaded) { + window.celExecOnceAfterMessagesLoaded( + (celMessages) => + (this.interactionParameters = Object.extend( + { + displayProgressMessage: true, + progressMessageText: celMessages.confirmedAjaxRequest.notificationInProgress, + displaySuccessMessage: true, + successMessageText: celMessages.confirmedAjaxRequest.notificationDone, + displayFailureMessage: true, + failureMessageText: celMessages.confirmedAjaxRequest.notificationFailed, + }, + interactionParameters || {}, + )), + ); + } else { + console.warn('celExecOnceAfterMessagesLoaded not available!'); + } this.requestUrl = requestUrl; this.ajaxRequestParameters = Object.extend( Object.clone(this.defaultAjaxRequestParameters), diff --git a/src/main/webapp/resources/uicomponents/widgets/list/xlist.js b/src/main/webapp/resources/uicomponents/widgets/list/xlist.js index de3c1aafe..61e0da244 100644 --- a/src/main/webapp/resources/uicomponents/widgets/list/xlist.js +++ b/src/main/webapp/resources/uicomponents/widgets/list/xlist.js @@ -10,7 +10,7 @@ * ], * { // options * numbered: false, - * icon: "$xwiki.getSkinFile('icons/silk/sport_basketball.gif')", + * icon: "pathToIcon", * classes : "myListExtraClass", * itemClasses : "myListItemExtraClasses", * eventListeners : { @@ -25,7 +25,7 @@ * * xlist.addItem( * new XWiki.widgets.XListItem('A fifth element added later', { - * icon : "$xwiki.getSkinFile('icons/silk/bomb.gif')", // this overrides the one defined for the whole list + * icon : "pathToIcon", // this overrides the one defined for the whole list * eventListeners: { * // Event listeners defined just for this specific list item * 'mouseout' : function() { console.log('just this list item is bound to this event', this); } diff --git a/src/main/webapp/resources/uicomponents/widgets/notification.css b/src/main/webapp/resources/uicomponents/widgets/notification.css index 73f47f24a..e24084bd1 100644 --- a/src/main/webapp/resources/uicomponents/widgets/notification.css +++ b/src/main/webapp/resources/uicomponents/widgets/notification.css @@ -1,5 +1,5 @@ .xnotification-container { - position : fixed; + position: fixed; bottom: 0; left: 0%; width: 100%; @@ -7,9 +7,11 @@ z-index: 1200; display: block !important; } + .xnotification-wrapper { padding-top: 1px; } + .xnotification { cursor: pointer; display: inline; @@ -21,35 +23,34 @@ line-height: 20px; } -#set($notificationCustommization = []) -## each element: [notification type, bg color, text color, icon] -#set($discard = $notificationCustommization.add(["info", "#268", "#fff"])) -#set($discard = $notificationCustommization.add(["warning", "#fd8", "#330"])) -#set($discard = $notificationCustommization.add(["error", "#a00", "#fff"])) -#set($discard = $notificationCustommization.add(["inprogress", "#333", "#fff", "icons/xwiki/spinner-white.gif"])) -#set($discard = $notificationCustommization.add(["done", "#160", "#fff"])) -## -#foreach($item in $notificationCustommization) - #set($notificationType = ${item.get(0)}) - #set($bgColor = ${item.get(1)}) - #set($textColor = ${item.get(2)}) - #set($imgUrl = '') - #if ($item.size() >= 4) - #set($imgName = "$!{item.get(3)}") - #if($imgName.indexOf("/") >= 0) - #set($imgUrl = $xwiki.getSkinFile($imgName, true)) - #else - #set($imgUrl = $xwiki.getSkinFile("icons/silk/${imgName}.gif", true)) - #end - #end -/** $notificationType */ -.xnotification-${notificationType} { - background-color: $bgColor; - color: $textColor; - border-color: $textColor; -#if($imgUrl != '') - background-image: url(${imgUrl}); +.xnotification-info { + background-color: #268; + color: #fff; + border-color: #fff; +} + +.xnotification-warning { + background-color: #fd8; + color: #330; + border-color: #330; +} + +.xnotification-error { + background-color: #a00; + color: #fff; + border-color: #fff; +} + +.xnotification-inprogress { + background-color: #333; + color: #fff; + border-color: #fff; + background-image: url(/file/resources/icons/xwiki/spinner%2Dwhite.gif); padding-left: 22px; -#end } -#end + +.xnotification-done { + background-color: #160; + color: #fff; + border-color: #fff; +} diff --git a/src/main/webapp/skins/albatross/screenlayout.css b/src/main/webapp/skins/albatross/screenlayout.css index 02e58b30d..ad79964a9 100644 --- a/src/main/webapp/skins/albatross/screenlayout.css +++ b/src/main/webapp/skins/albatross/screenlayout.css @@ -1,5 +1,5 @@ -@import url(google-fonts/Terminal-Dosis/Terminal-Dosis-200,300,400,500,600,700,800.css); -@import url(google-fonts/Open-Sans/Open-Sans-300italic,400italic,600italic,700italic,800italic,300,400,600,700,800.css); +@import url(/file/resources/celRes/google-fonts/Terminal-Dosis/Terminal-Dosis-200,300,400,500,600,700,800.css); +@import url(/file/resources/celRes/google-fonts/Open-Sans/Open-Sans-300italic,400italic,600italic,700italic,800italic,300,400,600,700,800.css); /** General layout of the page @@ -175,10 +175,10 @@ Space header, footer margin-left: 4px; } .edit-meta-tools a.edit-parent { - background-image: url("$xwiki.getSkinFile('icons/xwiki/parent_edit.gif')"); + background-image: url(/file/resources/icons/xwiki/parent_edit.gif); } .edit-meta-tools a.hide-edit-parent { - background-image: url("$xwiki.getSkinFile('icons/silk/chart_organisation.gif')"); + background-image: url(/file/resources/icons/silk/chart_organisation.gif); } /* Parent editing area */ @@ -267,8 +267,6 @@ Content #xwikieditcontent textarea#content { width: 100%; } -.layoutsubsection { -} .layoutsubsection.about { border: none; @@ -296,8 +294,6 @@ Zone for Comments, attachments, History... padding: 0px; border: none; } -.xwikiintratitle { -} .xwikiintracontent { margin: 0px; } @@ -355,8 +351,6 @@ fieldset.xwikimessage .buttons a { Comments ---------------------------------------------- */ -.xwikicomment { -} #xwikidata #commentscontent { background: #e5f0fe url('icons/black-bg-comments-left.png') left top no-repeat; @@ -430,8 +424,6 @@ Comments text-decoration: none; color: #000 !important; } -.commentcontent { -} .xwikibuttonlink a { background-color: #bbb; @@ -517,7 +509,9 @@ html > body #actionmenu { left: 0; width: 100%; } - +html > body.celementsmenubarvisible #actionmenu { + top: 28px; +} #actionmenu a { text-decoration: none; } @@ -715,8 +709,6 @@ Panels margin-left: -200px; } -.panels { -} html > body .panels { margin-top: 0px; } @@ -918,9 +910,6 @@ html > body .xwikidatatable { overflow: hidden; height: 24px; width: 24px; - /* position: relative; - top: -4em; -*/ } .edit_section a { visibility: visible; @@ -1003,9 +992,6 @@ div.pagelayoutoptions td { vertical-align: bottom; } -#selectedoption { -} - #selectedoption .lmcontentcolumn { background-color: #acf; } diff --git a/src/main/webapp/skins/albatross/style.css b/src/main/webapp/skins/albatross/style.css index 29cf09809..72d29557b 100644 --- a/src/main/webapp/skins/albatross/style.css +++ b/src/main/webapp/skins/albatross/style.css @@ -1,26 +1,3 @@ -@import 'elements.css'; - -@import 'classes.css'; - -/* @import "js/xwiki/chartwizard/chwSkin.css";*/ -@import 'xwiki.css'; - -@import 'wiki.css'; - -@import 'page.css'; - -@import 'rss.css'; - -@import 'screenlayout.css?ver=20230902'; - -@import 'microformats.css'; - -@import 'presentation.css'; - -@import 'colorsblack.css'; - -/*@import "ie.css"; */ - /* Empty lines between block elements. Generated by the new rendering */ .wikimodel-emptyline { height: 1em; diff --git a/src/main/webapp/skins/albatross/wiki.css b/src/main/webapp/skins/albatross/wiki.css index cce759f37..018757527 100644 --- a/src/main/webapp/skins/albatross/wiki.css +++ b/src/main/webapp/skins/albatross/wiki.css @@ -429,7 +429,7 @@ span.wikicreatelink a { /* Used to signify a rendering error in the rendered page. Valid only with new rendering */ .xwikirenderingerror { background-color: #eee; - background-image: url($xwiki.getSkinFile('icons/silk/exclamation.gif', true)); + background-image: url(/file/resources/icons/silk/exclamation.gif); background-position: 2px 50%; background-repeat: no-repeat; color: #e14726; diff --git a/src/main/webapp/templates/celMacros/CelMessages.vm b/src/main/webapp/templates/celMacros/CelMessages.vm index f599d86cc..c5df5d184 100644 --- a/src/main/webapp/templates/celMacros/CelMessages.vm +++ b/src/main/webapp/templates/celMacros/CelMessages.vm @@ -2,6 +2,8 @@ $jsonBuilder.openProperty('celmeta') $jsonBuilder.openDictionary() $jsonBuilder.addStringProperty('language', "$language") $jsonBuilder.addStringProperty('admin-language', "$admin_language") +$jsonBuilder.addStringProperty('contextPath', "${request.contextPath}") +$jsonBuilder.addStringProperty('database', "${context.database}") $jsonBuilder.openProperty('isAdmin') $jsonBuilder.addBoolean($isAdmin) $jsonBuilder.openProperty('isSuperAdmin') @@ -102,3 +104,113 @@ $jsonBuilder.openProperty('celmenu') $jsonBuilder.openDictionary() $jsonBuilder.addStringProperty('supportLinkURL', "$!services.celementsweb.getSupportLinkURL()") $jsonBuilder.closeDictionary() + +## actionButtons.js +$jsonBuilder.openProperty('actionButtons') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('cancel', "$!adminMsg.get('core.shortcuts.edit.cancel')") +$jsonBuilder.addStringProperty('preview', "$!adminMsg.get('core.shortcuts.edit.preview')") +$jsonBuilder.addStringProperty('backtoedit', "$!adminMsg.get('core.shortcuts.edit.backtoedit')") +$jsonBuilder.addStringProperty('saveandview', "$!adminMsg.get('core.shortcuts.edit.saveandview')") +$jsonBuilder.addStringProperty('saveandcontinue', "$!adminMsg.get('core.shortcuts.edit.saveandcontinue')") +$jsonBuilder.addStringProperty('mandatoryField', "$!adminMsg.get('core.editors.validation.mandatoryField')") +$jsonBuilder.addStringProperty('commentPrompt', "$!adminMsg.get('core.comment.prompt')") +$jsonBuilder.closeDictionary() +## attachments.js +$jsonBuilder.openProperty('attachments') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('deleteConfirm', "$!adminMsg.get('core.viewers.attachments.delete.confirm')") +$jsonBuilder.addStringProperty('deleteInProgress', "$!adminMsg.get('core.viewers.attachments.delete.inProgress')") +$jsonBuilder.addStringProperty('deleteDone', "$!adminMsg.get('core.viewers.attachments.delete.done')") +$jsonBuilder.addStringProperty('deleteFailed', "$!adminMsg.get('core.viewers.attachments.delete.failed')") +$jsonBuilder.addStringProperty('addFileInput', "$!adminMsg.get('core.viewers.attachments.upload.addFileInput')") +$jsonBuilder.addStringProperty('removeFileInput', "$!adminMsg.get('core.viewers.attachments.upload.removeFileInput')") +$jsonBuilder.addStringProperty('removeFileInputTitle', "$!adminMsg.get('core.viewers.attachments.upload.removeFileInput.title')") +$jsonBuilder.addStringProperty('extranb', "$!adminMsg.get('docextra.extranb', ['__number__'])") +$jsonBuilder.closeDictionary() +## code.js +$jsonBuilder.openProperty('code') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('showLineNumbers', "$!adminMsg.get('core.viewers.code.showLineNumbers')") +$jsonBuilder.addStringProperty('hideLineNumbers', "$!adminMsg.get('core.viewers.code.hideLineNumbers')") +$jsonBuilder.closeDictionary() +## comments.js +$jsonBuilder.openProperty('comments') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('commentDeleted', "$!adminMsg.get('core.viewers.comments.commentDeleted')") +$jsonBuilder.addStringProperty('deleteConfirm', "$!adminMsg.get('core.viewers.comments.delete.confirm')") +$jsonBuilder.addStringProperty('deleteInProgress', "$!adminMsg.get('core.viewers.comments.delete.inProgress')") +$jsonBuilder.addStringProperty('deleteDone', "$!adminMsg.get('core.viewers.comments.delete.done')") +$jsonBuilder.addStringProperty('deleteFailed', "$!adminMsg.get('core.viewers.comments.delete.failed')") +$jsonBuilder.addStringProperty('editFormFetchInProgress', "$!adminMsg.get('core.viewers.comments.editForm.fetch.inProgress')") +$jsonBuilder.addStringProperty('editFormFetchFailed', "$!adminMsg.get('core.viewers.comments.editForm.fetch.failed')") +$jsonBuilder.addStringProperty('addInProgress', "$!adminMsg.get('core.viewers.comments.add.inProgress')") +$jsonBuilder.addStringProperty('addDone', "$!adminMsg.get('core.viewers.comments.add.done')") +$jsonBuilder.addStringProperty('addFailed', "$!adminMsg.get('core.viewers.comments.add.failed')") +$jsonBuilder.addStringProperty('previewButtonPreview', "$!adminMsg.get('core.viewers.comments.preview.button.preview')") +$jsonBuilder.addStringProperty('previewInProgress', "$!adminMsg.get('core.viewers.comments.preview.inProgress')") +$jsonBuilder.addStringProperty('previewFailed', "$!adminMsg.get('core.viewers.comments.preview.failed')") +$jsonBuilder.addStringProperty('previewButtonBack', "$!adminMsg.get('core.viewers.comments.preview.button.back')") +$jsonBuilder.addStringProperty('extranb', "$!adminMsg.get('docextra.extranb', ['__number__'])") +$jsonBuilder.closeDictionary() +## confirmationBox.js +$jsonBuilder.openProperty('confirmationBox') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('defaultQuestion', "$!adminMsg.get('core.widgets.confirmationBox.defaultQuestion')") +$jsonBuilder.addStringProperty('yes', "$!adminMsg.get('core.widgets.confirmationBox.button.yes')") +$jsonBuilder.addStringProperty('no', "$!adminMsg.get('core.widgets.confirmationBox.button.no')") +$jsonBuilder.closeDictionary() +## confirmedAjaxRequest.js +$jsonBuilder.openProperty('confirmedAjaxRequest') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('notificationInProgress', "$!adminMsg.get('core.widgets.confirmationBox.notification.inProgress')") +$jsonBuilder.addStringProperty('notificationDone', "$!adminMsg.get('core.widgets.confirmationBox.notification.done')") +$jsonBuilder.addStringProperty('notificationFailed', "$!adminMsg.get('core.widgets.confirmationBox.notification.failed')") +$jsonBuilder.closeDictionary() +## dataeditors.js +$jsonBuilder.openProperty('dataeditors') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('confirmationText', "$!adminMsg.get('core.editors.object.delete.confirm')") +$jsonBuilder.addStringProperty('progressMessageText', "$!adminMsg.get('core.editors.object.delete.inProgress')") +$jsonBuilder.addStringProperty('successMessageText', "$!adminMsg.get('core.editors.object.delete.done')") +$jsonBuilder.addStringProperty('failureMessageText', "$!adminMsg.get('core.editors.object.delete.failed')") +$jsonBuilder.closeDictionary() +## livetable.js +$jsonBuilder.openProperty('livetable') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('resultsOf', "$!adminMsg.get('xe.pagination.results.of')") +$jsonBuilder.addStringProperty('results', "$!adminMsg.get('xe.pagination.results')") +$jsonBuilder.closeDictionary() +## usersandgroups.js +$jsonBuilder.openProperty('usersandgroups') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('denyrightforcurrentuser', "$!adminMsg.get('rightsmanager.denyrightforcurrentuser')") +$jsonBuilder.addStringProperty('clearrightforcurrentuserinstead', "$!adminMsg.get('rightsmanager.clearrightforcurrentuserinstead')") +$jsonBuilder.addStringProperty('clearrightforcurrentuser', "$!adminMsg.get('rightsmanager.clearrightforcurrentuser')") +$jsonBuilder.addStringProperty('denyrightforgroup', "$!adminMsg.get('rightsmanager.denyrightforgroup')") +$jsonBuilder.addStringProperty('clearrightforgroupinstead', "$!adminMsg.get('rightsmanager.clearrightforgroupinstead')") +$jsonBuilder.addStringProperty('clearrightforgroup', "$!adminMsg.get('rightsmanager.clearrightforgroup')") +$jsonBuilder.addStringProperty('denyrightforuorg', "$!adminMsg.get('rightsmanager.denyrightforuorg')") +$jsonBuilder.addStringProperty('clearrightforuorg', "$!adminMsg.get('rightsmanager.clearrightforuorg')") +$jsonBuilder.addStringProperty('saveFailure', "$!adminMsg.get('platform.core.rightsManagement.saveFailure')") +$jsonBuilder.addStringProperty('ajaxFailure', "$!adminMsg.get('platform.core.rightsManagement.ajaxFailure')") +$jsonBuilder.addStringProperty('edit', "$!adminMsg.get('edit')") +$jsonBuilder.addStringProperty('delete', "$!adminMsg.get('delete')") +$jsonBuilder.addStringProperty('confirmdeleteuser', "$!adminMsg.get('rightsmanager.confirmdeleteuser')") +$jsonBuilder.addStringProperty('confirmdeletegroup', "$!adminMsg.get('rightsmanager.confirmdeletegroup')") +$jsonBuilder.addStringProperty('confirmdeletemember', "$!adminMsg.get('rightsmanager.confirmdeletemember')") +$jsonBuilder.closeDictionary() +## xwiki.js +$jsonBuilder.openProperty('xwiki') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('readTechnicalInformation', "$!adminMsg.get('platform.core.rendering.error.readTechnicalInformation')") +$jsonBuilder.addStringProperty('edit', "$!adminMsg.get('edit')") +$jsonBuilder.addStringProperty('createAjaxError', "$!adminMsg.get('core.create.ajax.error')") +$jsonBuilder.closeDictionary() +## xwikiexplorer.js +$jsonBuilder.openProperty('xwikiexplorer') +$jsonBuilder.openDictionary() +$jsonBuilder.addStringProperty('attachmentsTitle', "$!adminMsg.get('xwikiexplorer.attachments.title')") +$jsonBuilder.addStringProperty('addPageTitle', "$!adminMsg.get('xwikiexplorer.addpage.title')") +$jsonBuilder.addStringProperty('addAttachmentTitle', "$!adminMsg.get('xwikiexplorer.addattachment.title')") +$jsonBuilder.closeDictionary() diff --git a/src/main/webapp/templates/celTemplates/ObjectEdit.vm b/src/main/webapp/templates/celTemplates/ObjectEdit.vm index f2f13a11c..614a3d8a9 100644 --- a/src/main/webapp/templates/celTemplates/ObjectEdit.vm +++ b/src/main/webapp/templates/celTemplates/ObjectEdit.vm @@ -190,9 +190,7 @@ $!jsService.includeExtJsFile($extJsParam.setJsFile(':celJS/prototype.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':celJS/initCelements.min.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/xwiki.js', 'file'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/list/xlist.js', 'file'))## -$!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/suggest/ajaxSuggest.js', 'file'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/scriptaculous/effects.js', 'file'))## -$!jsService.includeExtJsFile($extJsParam.setJsFile(':celJS/addSuggest.js', 'file'))## #end #if($cel_embedded_editobj) #set($cel_editobj_validationClass = '') diff --git a/src/main/webapp/templates/code.vm b/src/main/webapp/templates/code.vm index 5ca072ae2..b90a601b3 100644 --- a/src/main/webapp/templates/code.vm +++ b/src/main/webapp/templates/code.vm @@ -6,8 +6,6 @@ #set($extJsParam = $jsService.createExtJSParam().setAction('file')) #set($extJsParam = $extJsParam.setLazyLoad(true)) $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/viewers/code.js'))## -$!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/fullScreen.js'))## -

$msg.get('core.viewers.code.title', [$escapetool.xml($doc.getPlainTitle()), $doc.getURL()])

## ---------------------------- ## Display the shortcuts diff --git a/src/main/webapp/templates/createinline.vm b/src/main/webapp/templates/createinline.vm index b239ae40f..1d245a418 100644 --- a/src/main/webapp/templates/createinline.vm +++ b/src/main/webapp/templates/createinline.vm @@ -1,3 +1,5 @@ +#set($jsService = $services.javascript) +#set($extJsParam = $jsService.createExtJSParam().setAction('file')) ## --------------------------------------------------------------------------------------------------------- ## Since this template can be used for creating a Page or a Space, check the passed "tocreate" parameter ## which can be either "page" or "space". If no "tocreate" parameter is passed then we default to creating a Page. @@ -127,8 +129,8 @@ ## --------------------------------------------------------------------------------------------------------- ## Output JavaScript validation code ## --------------------------------------------------------------------------------------------------------- -$xwiki.get('jsfx').use('uicomponents/widgets/validation/livevalidation_prototype.js')## -$xwiki.get('ssfx').use('uicomponents/widgets/validation/livevalidation.css')## +$!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/validation/livevalidation_prototype.js'))## +$services.css.includeCSSPage(':uicomponents/widgets/validation/livevalidation.css')## - **# $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/widgets/modalPopup.js'))## - $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/widgets/jumpToPage.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/confirmationBox.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/confirmedAjaxRequest.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/notification.js'))## diff --git a/src/main/webapp/templates/inline.vm b/src/main/webapp/templates/inline.vm index b803263b2..fe5a479f5 100644 --- a/src/main/webapp/templates/inline.vm +++ b/src/main/webapp/templates/inline.vm @@ -1,15 +1,14 @@ #set($contextIsFinished = false) #if(("$!request.viewer" != '') || ("$!request.skin" != '') || (($xwiki.getSkin().indexOf('.') < 0) && ("$xwiki.getSkin()" != 'cellskin'))) - #set($jsService = $services.javascript) - #set($extJsParam = $jsService.createExtJSParam().setAction('file')) - $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/scriptaculous/scriptaculous.js'))## - $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/actionbuttons/actionButtons.js'))## #if((!$request.editor) || ($request.editor.trim() == "")) #set($editor = "inline") #else #set($editor = $request.editor) #end + #set($jsService = $services.javascript) + #set($extJsParam = $jsService.createExtJSParam().setAction('file')) #template("startpage.vm") + $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/actionbuttons/actionButtons.js'))## #template("edit${editor}.vm") #template("endpage.vm") #else diff --git a/src/main/webapp/templates/javascript.vm b/src/main/webapp/templates/javascript.vm index bb5479094..0097eb99e 100644 --- a/src/main/webapp/templates/javascript.vm +++ b/src/main/webapp/templates/javascript.vm @@ -1,7 +1,6 @@ ## ## CSS files related to JS libraries. ## - ## ## JS Libraries. @@ -13,18 +12,16 @@ $!jsService.includeExtJsFile($extJsParam.setJsFile(':celJS/jquery.min.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':celJS/jquery-noconflict.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':celJS/initCelements.min.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/xwiki.js'))## +$!jsService.includeExtJsFile($extJsParam.setJsFile(':js/scriptaculous/scriptaculous.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/scriptaculous/effects.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/widgets/modalPopup.js'))## $services.css.includeCSSPage(':js/xwiki/widgets/modalPopup.css')## -$!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/widgets/jumpToPage.js'))## -##$xwiki.ssfx.use('js/xwiki/widgets/jumpToPage.css', {'forceSkinAction' : true, 'language' : $context.language}) $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/confirmationBox.js'))## $services.css.includeCSSPage(':uicomponents/widgets/confirmationBox.css')## $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/confirmedAjaxRequest.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/notification.js'))## $services.css.includeCSSPage(':uicomponents/widgets/notification.css')## $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/widgets/list/xlist.js'))## -$!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/suggest/suggest.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/xwiki-misc.js'))## #if($hasedit || $isContentEditor || $isAdmin || ($services.celMenu.getMenuHeaders().size() > 0)) $!services.css.includeCSSPage(':celRes/celements2.css')## @@ -48,8 +45,6 @@ $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/xwiki-misc.js'))## #set($searchSuggestConfigHash = "${searchSuggestConfigHash}|${sourceId}") #end #end - $!jsService.includeExtJsFile($extJsParam.setJsFile(':uicomponents/search/searchSuggest.js'))## - $services.css.includeCSSPage(':uicomponents/search/searchSuggest.css')## #end #end #if (($xcontext.action=="inline") || ($xcontext.action=="edit") || ($xcontext.action=="admin")) @@ -84,58 +79,58 @@ window.docgeturl = "${doc.getURL('get')}"; // ]]> ## -#if (($xcontext.action=="inline") || ($xcontext.action=="edit") || ($xcontext.action=="admin")) - + function prepareCancelEdit() { + lockEdit(); + } + function cancelCancelEdit() { + cancelCancelEditFlag = false; + } + Event.observe(window, "unload", cancelEdit); + Event.observe(window, "pagehide", cancelEdit); + $j(document).ready(prepareCancelEdit); + // ]]> + #end ## diff --git a/src/main/webapp/templates/preview.vm b/src/main/webapp/templates/preview.vm index 87d354ace..62e5ff1c2 100644 --- a/src/main/webapp/templates/preview.vm +++ b/src/main/webapp/templates/preview.vm @@ -1,8 +1,7 @@ +#template("startpage.vm") #set($jsService = $services.javascript) #set($extJsParam = $jsService.createExtJSParam().setAction('file')) -$!jsService.includeExtJsFile($extJsParam.setJsFile(':js/scriptaculous/scriptaculous.js'))## $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/actionbuttons/actionButtons.js'))## -#template("startpage.vm")
#template("previewactions.vm")
$tdoc.getRenderedContent($tdoc.content, $tdoc.getSyntaxId()) diff --git a/src/main/webapp/templates/startpage.vm b/src/main/webapp/templates/startpage.vm index 463cf79b1..e5b3ff760 100644 --- a/src/main/webapp/templates/startpage.vm +++ b/src/main/webapp/templates/startpage.vm @@ -15,4 +15,4 @@
#else
## class="content#if($showLeftPanels == "0")hideleft#end#if($showRightPanels == "0")hideright#end"> -#end \ No newline at end of file +#end diff --git a/src/main/webapp/templates/stylesheets.vm b/src/main/webapp/templates/stylesheets.vm index 737c6117d..4745e2d4d 100644 --- a/src/main/webapp/templates/stylesheets.vm +++ b/src/main/webapp/templates/stylesheets.vm @@ -1,27 +1,12 @@ -#template('colorThemeInit.vm') -## The default stylesheet configuration option allows to override the default style.css CSS -#set ($defaultstyle = $xwiki.getSpacePreference('stylesheet')) -#if ($defaultstyle == '') - #set ($defaultstyle = "style.css") -#end -#set ($defaultStyleURL = $xwiki.getSkinFile($defaultstyle, true)) - - -#set ($a11y = "$!{request.getCookie('a11y').getValue()}") -#if ($a11y == '') - #set ($a11y = "$!{xwiki.getUserPreference('accessibility')}") -#end -#if ($a11y == '1') - -#end -## The stylesheets configuration option allows to override the alternate stylesheets -## style1.css, style2.css and style3.css -#set ($stylesheets = $xwiki.getSpacePreference('stylesheets')) -#if ($stylesheets != '') - #foreach ($stylesheet in $util.split($stylesheets, ',')) - #if (!$stylesheet.equalsIgnoreCase($defaultstyle)) - - #end - #end -#end -$!services.css.displayAllCSS() +$services.css.includeCSSPage(':skins/albatross/style.css')## +$services.css.includeCSSPage(':skins/albatross/elements.css')## +$services.css.includeCSSPage(':skins/albatross/classes.css')## +$services.css.includeCSSPage(':skins/albatross/xwiki.css')## +$services.css.includeCSSPage(':skins/albatross/wiki.css')## +$services.css.includeCSSPage(':skins/albatross/page.css')## +$services.css.includeCSSPage(':skins/albatross/rss.css')## +$services.css.includeCSSPage(':skins/albatross/screenlayout.css')## +$services.css.includeCSSPage(':skins/albatross/microformats.css')## +$services.css.includeCSSPage(':skins/albatross/presentation.css')## +$services.css.includeCSSPage(':skins/albatross/colorsblack.css')## +$services.css.displayAllCSS() diff --git a/src/main/webapp/templates/tagedit.vm b/src/main/webapp/templates/tagedit.vm index 87e349dba..ba265a475 100644 --- a/src/main/webapp/templates/tagedit.vm +++ b/src/main/webapp/templates/tagedit.vm @@ -93,7 +93,7 @@ #set($seps = $xwiki.getDocument("XWiki.TagClass").xWikiClass.tags.getProperty('separators').value)
-
+
#end #end