openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs | README

commit ca93e6b2de6d430c3f83fad66553d147d761987f
parent d40ea3f2ab1bc835e6d603ba85fc49088dca49db
Author: Jan Dankert <develop@jandankert.de>
Date:   Tue, 23 Feb 2021 01:00:33 +0100

New: Undo for closed dialogs with unsaved changes.

Diffstat:
Mmodules/cms/ui/themes/default/script/openrat.js | 104++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
Mmodules/cms/ui/themes/default/script/openrat.min.js | 6+++---
Mmodules/cms/ui/themes/default/script/openrat/dialog.js | 77++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
Mmodules/cms/ui/themes/default/script/openrat/notice.js | 25++++++++++++++++++-------
Mmodules/cms/ui/themes/default/script/openrat/workbench.js | 2+-
Mmodules/language/Language_CN.class.php | 2+-
Mmodules/language/Language_DE.class.php | 2+-
Mmodules/language/Language_EN.class.php | 2+-
Mmodules/language/Language_ES.class.php | 4++--
Mmodules/language/Language_FR.class.php | 2+-
Mmodules/language/Language_IT.class.php | 2+-
Mmodules/language/Language_RU.class.php | 4++--
Mmodules/language/Messages.class.php | 2+-
Mmodules/language/language.yml | 12+++++-------
14 files changed, 160 insertions(+), 86 deletions(-)

diff --git a/modules/cms/ui/themes/default/script/openrat.js b/modules/cms/ui/themes/default/script/openrat.js @@ -1661,9 +1661,11 @@ Openrat.Notice = function() { this.status = 'inactive'; this.msg = ''; this.log = ''; + this.timeout = 0; let element = $('<div class="or-notice or-notice--is-inactive"></div>'); + this.onClick = $.Callbacks(); const type = Object.freeze({ warning: 0, @@ -1735,24 +1737,33 @@ Openrat.Notice = function() { element.toggleClass('notice--is-full'); }); + // Fire onclick-handler + element.find('.or-notice-text').click( function () { + notice.onClick.fire(); + } ); + // Close the notice on click element.find('.or-act-notice-close').click(function () { notice.close(); }); // Fadeout the notice after a while. - let timeout = 1; - if (this.status == 'ok') timeout = 3; - if (this.status == 'info') timeout = 30; - if (this.status == 'warning') timeout = 40; - if (this.status == 'error') timeout = 50; + if ( !this.timeout ) { + switch( this.status ) { + case 'ok' : this.timeout = 3; break; + case 'info' : this.timeout = 30; break; + case 'warning': this.timeout = 40; break; + case 'error' : this.timeout = 50; break; + default: this.timeout = 10; console.error('unknown notice status: '+this.status); + } + } - if (timeout > 0) + if (this.timeout) setTimeout(function () { element.fadeOut('slow', function () { element.remove(); }); - }, timeout * 1000); + }, this.timeout * 1000); } this.setContext = function(type,id,name) { @@ -1898,28 +1909,10 @@ Openrat.Dialog = function() { Openrat.Notice.removeAllNotices(); - //$('.or-dialog-content .or-view').html('<div class="header"><img class="or-icon" title="" src="./themes/default/images/icon/'+method+'.png" />'+name+'</div>'); - //$('.or-dialog-content .or-view').data('id',id); - $('.or-dialog').removeClass('dialog--is-closed').addClass('dialog--is-open'); - $('.or-dialog-content .or-act-dialog-name').html( name ); - - this.escapeKeyClosingHandler = function (e) { - if (e.keyCode == 27) { // ESC keycode - dialog.close(); - - $(document).off('keyup'); // de-register. - } - }; - - $(document).keyup(this.escapeKeyClosingHandler); - - // close dialog on click onto the blurred area. - $('.or-dialog-filler,.or-act-dialog-close').off('click').click( function(e) - { - e.preventDefault(); - dialog.close(); - }); + $('.or-dialog-content .or-view').html(''); // Clear old content + $('.or-dialog-content .or-act-dialog-name').html( name ); + this.show(); view.onCloseHandler.add( function() { dialog.close(); @@ -1946,24 +1939,69 @@ Openrat.Dialog = function() { } + + this.show = function() { + + $('.or-dialog').removeClass('dialog--is-closed').addClass('dialog--is-open'); + + if ( this.isDirty ) { + this.element.addClass('view--is-dirty'); + } + + let dialog = this; + + this.escapeKeyClosingHandler = function (e) { + if (e.keyCode == 27) { // ESC keycode + dialog.close(); + + $(document).off('keyup'); // de-register. + } + }; + + $(document).keyup(this.escapeKeyClosingHandler); + + // close dialog on click onto the blurred area. + $('.or-dialog-filler,.or-act-dialog-close').off('click').click( function(e) + { + e.preventDefault(); + dialog.close(); + }); + } + + + this.hide = function() { + $('.or-dialog').removeClass('dialog--is-open').addClass('dialog--is-closed'); // Dialog schließen + } + + /** * Closing the dialog. */ this.close = function() { + let dialog = this; + if ( this.isDirty ) { // ask the user if we should close this dialog let exit = window.confirm( Openrat.Workbench.language.UNSAVED_CHANGES_CONFIRM ); if ( ! exit ) - return; + return; // do not close the dialog + + let notice = new Openrat.Notice(); + notice.msg = Openrat.Workbench.language.REOPEN_CLOSED_DIALOG; + notice.setStatus( 'warning' ); + notice.timeout = 120; + notice.onClick.add( function() { + dialog.show(); + notice.close(); + }); + notice.show(); } // Remove dirty-flag from view $('.or-dialog-content .or-view.or-view--is-dirty').removeClass('view--is-dirty'); - $('.or-dialog-content .or-view').html(''); - $('.or-dialog').removeClass('dialog--is-open').addClass('dialog--is-closed'); // Dialog schließen - + this.hide(); $(document).unbind('keyup',this.escapeKeyClosingHandler); // Cleanup ESC-Key-Listener } } @@ -2561,7 +2599,7 @@ Openrat.Workbench = new function() console.warn( {message: 'The server ping has failed.',jqXHR:jqXHR,status:textStatus,error:errorThrown }); // Is there any user input? Ok, we should warn the user that the data could not be saved. - if ($('.view.dirty').length > 0) { + if ($('.or-view--is-dirty').length > 0) { window.alert("The server session is lost, please save your data."); } else { diff --git a/modules/cms/ui/themes/default/script/openrat.min.js b/modules/cms/ui/themes/default/script/openrat.min.js @@ -1171,10 +1171,10 @@ header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\ /** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ jQuery.trumbowyg={langs:{en:{viewHTML:"View HTML",undo:"Undo",redo:"Redo",formatting:"Formatting",p:"Paragraph",blockquote:"Quote",code:"Code",header:"Header",bold:"Bold",italic:"Italic",strikethrough:"Stroke",underline:"Underline",strong:"Strong",em:"Emphasis",del:"Deleted",superscript:"Superscript",subscript:"Subscript",unorderedList:"Unordered list",orderedList:"Ordered list",insertImage:"Insert Image",link:"Link",createLink:"Insert link",unlink:"Remove link",justifyLeft:"Align Left",justifyCenter:"Align Center",justifyRight:"Align Right",justifyFull:"Align Justify",horizontalRule:"Insert horizontal rule",removeformat:"Remove format",fullscreen:"Fullscreen",close:"Close",submit:"Confirm",reset:"Cancel",required:"Required",description:"Description",title:"Title",text:"Text",target:"Target",width:"Width"}},plugins:{},svgPath:null,hideButtonTexts:null},Object.defineProperty(jQuery.trumbowyg,"defaultOptions",{value:{lang:"en",fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,autogrowOnEnter:!1,imageWidthModalEdit:!1,prefix:"trumbowyg-",semantic:!0,resetCss:!1,removeformatPasted:!1,tagsToRemove:[],btns:[["viewHTML"],["undo","redo"],["formatting"],["strong","em","del"],["superscript","subscript"],["link"],["insertImage"],["justifyLeft","justifyCenter","justifyRight","justifyFull"],["unorderedList","orderedList"],["horizontalRule"],["removeformat"],["fullscreen"]],btnsDef:{},inlineElementsSelector:"a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u",pasteHandlers:[],plugins:{},urlProtocol:!1,minimalLinks:!1},writable:!1,enumerable:!0,configurable:!1}),function(e,t,n,a){"use strict";var o="tbwconfirm",r="tbwcancel";a.fn.trumbowyg=function(e,t){var n="trumbowyg";if(e===Object(e)||!e)return this.each(function(){a(this).data(n)||a(this).data(n,new i(this,e))});if(1===this.length)try{var o=a(this).data(n);switch(e){case"execCmd":return o.execCmd(t.cmd,t.param,t.forceCss);case"openModal":return o.openModal(t.title,t.content);case"closeModal":return o.closeModal();case"openModalInsert":return o.openModalInsert(t.title,t.fields,t.callback);case"saveRange":return o.saveRange();case"getRange":return o.range;case"getRangeText":return o.getRangeText();case"restoreRange":return o.restoreRange();case"enable":return o.setDisabled(!1);case"disable":return o.setDisabled(!0);case"toggle":return o.toggle();case"destroy":return o.destroy();case"empty":return o.empty();case"html":return o.html(t)}}catch(r){}return!1};var i=function(o,r){var i=this,s="trumbowyg-icons",l=a.trumbowyg;i.doc=o.ownerDocument||n,i.$ta=a(o),i.$c=a(o),r=r||{},null!=r.lang||null!=l.langs[r.lang]?i.lang=a.extend(!0,{},l.langs.en,l.langs[r.lang]):i.lang=l.langs.en,i.hideButtonTexts=null!=l.hideButtonTexts?l.hideButtonTexts:r.hideButtonTexts;var d=null!=l.svgPath?l.svgPath:r.svgPath;if(i.hasSvg=d!==!1,i.svgPath=i.doc.querySelector("base")?t.location.href.split("#")[0]:"",0===a("#"+s,i.doc).length&&d!==!1){if(null==d){for(var c=n.getElementsByTagName("script"),u=0;u<c.length;u+=1){var g=c[u].src,f=g.match("trumbowyg(.min)?.js");null!=f&&(d=g.substring(0,g.indexOf(f[0]))+"ui/icons.svg")}null==d&&console.warn("You must define svgPath: https://goo.gl/CfTY9U")}var h=i.doc.createElement("div");h.id=s,i.doc.body.insertBefore(h,i.doc.body.childNodes[0]),a.ajax({async:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",dataType:"xml",crossDomain:!0,url:d,data:null,beforeSend:null,complete:null,success:function(e){h.innerHTML=(new XMLSerializer).serializeToString(e.documentElement)}})}var p=i.lang.header,m=function(){return(t.chrome||t.Intl&&Intl.v8BreakIterator)&&"CSS"in t};i.btnsDef={viewHTML:{fn:"toggle"},undo:{isSupported:m,key:"Z"},redo:{isSupported:m,key:"Y"},p:{fn:"formatBlock"},blockquote:{fn:"formatBlock"},h1:{fn:"formatBlock",title:p+" 1"},h2:{fn:"formatBlock",title:p+" 2"},h3:{fn:"formatBlock",title:p+" 3"},h4:{fn:"formatBlock",title:p+" 4"},subscript:{tag:"sub"},superscript:{tag:"sup"},bold:{key:"B",tag:"b"},italic:{key:"I",tag:"i"},underline:{tag:"u"},strikethrough:{tag:"strike"},strong:{fn:"bold",key:"B"},em:{fn:"italic",key:"I"},del:{fn:"strikethrough"},createLink:{key:"K",tag:"a"},unlink:{},insertImage:{},justifyLeft:{tag:"left",forceCss:!0},justifyCenter:{tag:"center",forceCss:!0},justifyRight:{tag:"right",forceCss:!0},justifyFull:{tag:"justify",forceCss:!0},unorderedList:{fn:"insertUnorderedList",tag:"ul"},orderedList:{fn:"insertOrderedList",tag:"ol"},horizontalRule:{fn:"insertHorizontalRule"},removeformat:{},fullscreen:{"class":"trumbowyg-not-disable"},close:{fn:"destroy","class":"trumbowyg-not-disable"},formatting:{dropdown:["p","blockquote","h1","h2","h3","h4"],ico:"p"},link:{dropdown:["createLink","unlink"]}},i.o=a.extend(!0,{},l.defaultOptions,r),i.o.hasOwnProperty("imgDblClickHandler")||(i.o.imgDblClickHandler=i.getDefaultImgDblClickHandler()),i.urlPrefix=i.setupUrlPrefix(),i.disabled=i.o.disabled||"TEXTAREA"===o.nodeName&&o.disabled,r.btns?i.o.btns=r.btns:i.o.semantic||(i.o.btns[3]=["bold","italic","underline","strikethrough"]),a.each(i.o.btnsDef,function(e,t){i.addBtnDef(e,t)}),i.eventNamespace="trumbowyg-event",i.keys=[],i.tagToButton={},i.tagHandlers=[],i.pasteHandlers=[].concat(i.o.pasteHandlers),i.isIE=e.userAgent.indexOf("MSIE")!==-1||e.appVersion.indexOf("Trident/")!==-1,i.init()};i.prototype={DEFAULT_SEMANTIC_MAP:{b:"strong",i:"em",s:"del",strike:"del",div:"p"},init:function(){var e=this;e.height=e.$ta.height(),e.initPlugins();try{e.doc.execCommand("enableObjectResizing",!1,!1),e.doc.execCommand("defaultParagraphSeparator",!1,"p")}catch(t){}e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay(),setTimeout(function(){e.disabled&&e.setDisabled(!0),e.$c.trigger("tbwinit")})},addBtnDef:function(e,t){this.btnsDef[e]=t},setupUrlPrefix:function(){var e=this.o.urlProtocol;if(e)return"string"!=typeof e?"https://":/:\/\/$/.test(e)?e:e+"://"},buildEditor:function(){var e=this,n=e.o.prefix,o="";e.$box=a("<div/>",{"class":n+"box "+n+"editor-visible "+n+e.o.lang+" trumbowyg"}),e.isTextarea=e.$ta.is("textarea"),e.isTextarea?(o=e.$ta.val(),e.$ed=a("<div/>"),e.$box.insertAfter(e.$ta).append(e.$ed,e.$ta)):(e.$ed=e.$ta,o=e.$ed.html(),e.$ta=a("<textarea/>",{name:e.$ta.attr("id"),height:e.height}).val(o),e.$box.insertAfter(e.$ed).append(e.$ta,e.$ed),e.syncCode()),e.$ta.addClass(n+"textarea").attr("tabindex",-1),e.$ed.addClass(n+"editor").attr({contenteditable:!0,dir:e.lang._dir||"ltr"}).html(o),e.o.tabindex&&e.$ed.attr("tabindex",e.o.tabindex),e.$c.is("[placeholder]")&&e.$ed.attr("placeholder",e.$c.attr("placeholder")),e.$c.is("[spellcheck]")&&e.$ed.attr("spellcheck",e.$c.attr("spellcheck")),e.o.resetCss&&e.$ed.addClass(n+"reset-css"),e.o.autogrow||e.$ta.add(e.$ed).css({height:e.height}),e.semanticCode(),e.o.autogrowOnEnter&&e.$ed.addClass(n+"autogrow-on-enter");var r,i=!1,s=!1,l="keyup";e.$ed.on("dblclick","img",e.o.imgDblClickHandler).on("keydown",function(t){if((t.ctrlKey||t.metaKey)&&!t.altKey){i=!0;var n=e.keys[String.fromCharCode(t.which).toUpperCase()];try{return e.execCmd(n.fn,n.param),!1}catch(a){}}}).on("compositionstart compositionupdate",function(){s=!0}).on(l+" compositionend",function(t){if("compositionend"===t.type)s=!1;else if(s)return;var n=t.which;if(!(n>=37&&n<=40)){if(!t.ctrlKey&&!t.metaKey||89!==n&&90!==n)if(i||17===n)"undefined"==typeof t.which&&e.semanticCode(!1,!1,!0);else{var a=!e.isIE||"compositionend"===t.type;e.semanticCode(!1,a&&13===n),e.$c.trigger("tbwchange")}else e.$c.trigger("tbwchange");setTimeout(function(){i=!1},50)}}).on("mouseup keydown keyup",function(t){(!t.ctrlKey&&!t.metaKey||t.altKey)&&setTimeout(function(){i=!1},50),clearTimeout(r),r=setTimeout(function(){e.updateButtonPaneStatus()},50)}).on("focus blur",function(t){if(e.$c.trigger("tbw"+t.type),"blur"===t.type&&a("."+n+"active-button",e.$btnPane).removeClass(n+"active-button "+n+"active"),e.o.autogrowOnEnter){if(e.autogrowOnEnterDontClose)return;"focus"===t.type?(e.autogrowOnEnterWasFocused=!0,e.autogrowEditorOnEnter()):e.o.autogrow||(e.$ed.css({height:e.$ed.css("min-height")}),e.$c.trigger("tbwresize"))}}).on("cut",function(){setTimeout(function(){e.semanticCode(!1,!0),e.$c.trigger("tbwchange")},0)}).on("paste",function(n){if(e.o.removeformatPasted){n.preventDefault(),t.getSelection&&t.getSelection().deleteFromDocument&&t.getSelection().deleteFromDocument();try{var o=t.clipboardData.getData("Text");try{e.doc.selection.createRange().pasteHTML(o)}catch(r){e.doc.getSelection().getRangeAt(0).insertNode(e.doc.createTextNode(o))}e.$c.trigger("tbwchange",n)}catch(i){e.execCmd("insertText",(n.originalEvent||n).clipboardData.getData("text/plain"))}}a.each(e.pasteHandlers,function(e,t){t(n)}),setTimeout(function(){e.semanticCode(!1,!0),e.$c.trigger("tbwpaste",n)},0)}),e.$ta.on("keyup",function(){e.$c.trigger("tbwchange")}).on("paste",function(){setTimeout(function(){e.$c.trigger("tbwchange")},0)}),e.$box.on("keydown",function(t){if(27===t.which&&1===a("."+n+"modal-box",e.$box).length)return e.closeModal(),!1})},autogrowEditorOnEnter:function(){var e=this;e.$ed.removeClass("autogrow-on-enter");var t=e.$ed[0].clientHeight;e.$ed.height("auto");var n=e.$ed[0].scrollHeight;e.$ed.addClass("autogrow-on-enter"),t!==n&&(e.$ed.height(t),setTimeout(function(){e.$ed.css({height:n}),e.$c.trigger("tbwresize")},0))},buildBtnPane:function(){var e=this,t=e.o.prefix,n=e.$btnPane=a("<div/>",{"class":t+"button-pane"});a.each(e.o.btns,function(o,r){a.isArray(r)||(r=[r]);var i=a("<div/>",{"class":t+"button-group "+(r.indexOf("fullscreen")>=0?t+"right":"")});a.each(r,function(t,n){try{e.isSupportedBtn(n)&&i.append(e.buildBtn(n))}catch(a){}}),i.html().trim().length>0&&n.append(i)}),e.$box.prepend(n)},buildBtn:function(e){var t=this,n=t.o.prefix,o=t.btnsDef[e],r=o.dropdown,i=null==o.hasIcon||o.hasIcon,s=t.lang[e]||e,l=a("<button/>",{type:"button","class":n+e+"-button "+(o["class"]||"")+(i?"":" "+n+"textual-button"),html:t.hasSvg&&i?'<svg><use xlink:href="'+t.svgPath+"#"+n+(o.ico||e).replace(/([A-Z]+)/g,"-$1").toLowerCase()+'"/></svg>':t.hideButtonTexts?"":o.text||o.title||t.lang[e]||e,title:(o.title||o.text||s)+(o.key?" (Ctrl + "+o.key+")":""),tabindex:-1,mousedown:function(){return r&&!a("."+e+"-"+n+"dropdown",t.$box).is(":hidden")||a("body",t.doc).trigger("mousedown"),!((t.$btnPane.hasClass(n+"disable")||t.$box.hasClass(n+"disabled"))&&!a(this).hasClass(n+"active")&&!a(this).hasClass(n+"not-disable"))&&(t.execCmd(!!r&&"dropdown"||o.fn||e,o.param||e,o.forceCss),!1)}});if(r){l.addClass(n+"open-dropdown");var d=n+"dropdown",c={"class":d+"-"+e+" "+d+" "+n+"fixed-top"};c["data-"+d]=e;var u=a("<div/>",c);a.each(r,function(e,n){t.btnsDef[n]&&t.isSupportedBtn(n)&&u.append(t.buildSubBtn(n))}),t.$box.append(u.hide())}else o.key&&(t.keys[o.key]={fn:o.fn||e,param:o.param||e});return r||(t.tagToButton[(o.tag||e).toLowerCase()]=e),l},buildSubBtn:function(e){var t=this,n=t.o.prefix,o=t.btnsDef[e],r=null==o.hasIcon||o.hasIcon;return o.key&&(t.keys[o.key]={fn:o.fn||e,param:o.param||e}),t.tagToButton[(o.tag||e).toLowerCase()]=e,a("<button/>",{type:"button","class":n+e+"-dropdown-button"+(o.ico?" "+n+o.ico+"-button":""),html:t.hasSvg&&r?'<svg><use xlink:href="'+t.svgPath+"#"+n+(o.ico||e).replace(/([A-Z]+)/g,"-$1").toLowerCase()+'"/></svg>'+(o.text||o.title||t.lang[e]||e):o.text||o.title||t.lang[e]||e,title:o.key?" (Ctrl + "+o.key+")":null,style:o.style||null,mousedown:function(){return a("body",t.doc).trigger("mousedown"),t.execCmd(o.fn||e,o.param||e,o.forceCss),!1}})},isSupportedBtn:function(e){try{return this.btnsDef[e].isSupported()}catch(t){}return!0},buildOverlay:function(){var e=this;return e.$overlay=a("<div/>",{"class":e.o.prefix+"overlay"}).appendTo(e.$box),e.$overlay},showOverlay:function(){var e=this;a(t).trigger("scroll"),e.$overlay.fadeIn(200),e.$box.addClass(e.o.prefix+"box-blur")},hideOverlay:function(){var e=this;e.$overlay.fadeOut(50),e.$box.removeClass(e.o.prefix+"box-blur")},fixedBtnPaneEvents:function(){var e=this,n=e.o.fixedFullWidth,o=e.$box;e.o.fixedBtnPane&&(e.isFixed=!1,a(t).on("scroll."+e.eventNamespace+" resize."+e.eventNamespace,function(){if(o){e.syncCode();var r=a(t).scrollTop(),i=o.offset().top+1,s=e.$btnPane,l=s.outerHeight()-2;r-i>0&&r-i-e.height<0?(e.isFixed||(e.isFixed=!0,s.css({position:"fixed",top:0,left:n?"0":"auto",zIndex:7}),a([e.$ta,e.$ed]).css({marginTop:s.height()})),s.css({width:n?"100%":o.width()-1+"px"}),a("."+e.o.prefix+"fixed-top",o).css({position:n?"fixed":"absolute",top:n?l:l+(r-i)+"px",zIndex:15})):e.isFixed&&(e.isFixed=!1,s.removeAttr("style"),a([e.$ta,e.$ed]).css({marginTop:0}),a("."+e.o.prefix+"fixed-top",o).css({position:"absolute",top:l}))}}))},setDisabled:function(e){var t=this,n=t.o.prefix;t.disabled=e,e?t.$ta.attr("disabled",!0):t.$ta.removeAttr("disabled"),t.$box.toggleClass(n+"disabled",e),t.$ed.attr("contenteditable",!e)},destroy:function(){var e=this,n=e.o.prefix;e.isTextarea?e.$box.after(e.$ta.css({height:""}).val(e.html()).removeClass(n+"textarea").show()):e.$box.after(e.$ed.css({height:""}).removeClass(n+"editor").removeAttr("contenteditable").removeAttr("dir").html(e.html()).show()),e.$ed.off("dblclick","img"),e.destroyPlugins(),e.$box.remove(),e.$c.removeData("trumbowyg"),a("body").removeClass(n+"body-fullscreen"),e.$c.trigger("tbwclose"),a(t).off("scroll."+e.eventNamespace+" resize."+e.eventNamespace)},empty:function(){this.$ta.val(""),this.syncCode(!0)},toggle:function(){var e=this,t=e.o.prefix;e.o.autogrowOnEnter&&(e.autogrowOnEnterDontClose=!e.$box.hasClass(t+"editor-hidden")),e.semanticCode(!1,!0),setTimeout(function(){e.doc.activeElement.blur(),e.$box.toggleClass(t+"editor-hidden "+t+"editor-visible"),e.$btnPane.toggleClass(t+"disable"),a("."+t+"viewHTML-button",e.$btnPane).toggleClass(t+"active"),e.$box.hasClass(t+"editor-visible")?e.$ta.attr("tabindex",-1):e.$ta.removeAttr("tabindex"),e.o.autogrowOnEnter&&!e.autogrowOnEnterDontClose&&e.autogrowEditorOnEnter()},0)},dropdown:function(e){var n=this,o=n.doc,r=n.o.prefix,i=a("[data-"+r+"dropdown="+e+"]",n.$box),s=a("."+r+e+"-button",n.$btnPane),l=i.is(":hidden");if(a("body",o).trigger("mousedown"),l){var d=s.offset().left;s.addClass(r+"active"),i.css({position:"absolute",top:s.offset().top-n.$btnPane.offset().top+s.outerHeight(),left:n.o.fixedFullWidth&&n.isFixed?d+"px":d-n.$btnPane.offset().left+"px"}).show(),a(t).trigger("scroll"),a("body",o).on("mousedown."+n.eventNamespace,function(e){i.is(e.target)||(a("."+r+"dropdown",n.$box).hide(),a("."+r+"active",n.$btnPane).removeClass(r+"active"),a("body",o).off("mousedown."+n.eventNamespace))})}},html:function(e){var t=this;return null!=e?(t.$ta.val(e),t.syncCode(!0),t.$c.trigger("tbwchange"),t):t.$ta.val()},syncTextarea:function(){var e=this;e.$ta.val(e.$ed.text().trim().length>0||e.$ed.find("hr,img,embed,iframe,input").length>0?e.$ed.html():"")},syncCode:function(e){var t=this;if(!e&&t.$ed.is(":visible"))t.syncTextarea();else{var n=a("<div>").html(t.$ta.val()),o=a("<div>").append(n);a(t.o.tagsToRemove.join(","),o).remove(),t.$ed.html(o.contents().html())}if(t.o.autogrow&&(t.height=t.$ed.height(),t.height!==t.$ta.css("height")&&(t.$ta.css({height:t.height}),t.$c.trigger("tbwresize"))),t.o.autogrowOnEnter){t.$ed.height("auto");var r=t.autogrowOnEnterWasFocused?t.$ed[0].scrollHeight:t.$ed.css("min-height");r!==t.$ta.css("height")&&(t.$ed.css({height:r}),t.$c.trigger("tbwresize"))}},semanticCode:function(e,t,n){var o=this;if(o.saveRange(),o.syncCode(e),o.o.semantic){if(o.semanticTag("b"),o.semanticTag("i"),o.semanticTag("s"),o.semanticTag("strike"),t){var r=o.o.inlineElementsSelector,i=":not("+r+")";o.$ed.contents().filter(function(){return 3===this.nodeType&&this.nodeValue.trim().length>0}).wrap("<span data-tbw/>");var s=function(e){if(0!==e.length){var t=e.nextUntil(i).addBack().wrapAll("<p/>").parent(),n=t.nextAll(r).first();t.next("br").remove(),s(n)}};s(o.$ed.children(r).first()),o.semanticTag("div",!0),o.$ed.find("p").filter(function(){return(!o.range||this!==o.range.startContainer)&&(0===a(this).text().trim().length&&0===a(this).children().not("br,span").length)}).contents().unwrap(),a("[data-tbw]",o.$ed).contents().unwrap(),o.$ed.find("p:empty").remove()}n||o.restoreRange(),o.syncTextarea()}},semanticTag:function(e,t){var n;if(null!=this.o.semantic&&"object"==typeof this.o.semantic&&this.o.semantic.hasOwnProperty(e))n=this.o.semantic[e];else{if(this.o.semantic!==!0||!this.DEFAULT_SEMANTIC_MAP.hasOwnProperty(e))return;n=this.DEFAULT_SEMANTIC_MAP[e]}a(e,this.$ed).each(function(){var e=a(this);e.wrap("<"+n+"/>"),t&&a.each(e.prop("attributes"),function(){e.parent().attr(this.name,this.value)}),e.contents().unwrap()})},createLink:function(){for(var e,t,n,o=this,r=o.doc.getSelection(),i=r.focusNode,s=(new XMLSerializer).serializeToString(r.getRangeAt(0).cloneContents());["A","DIV"].indexOf(i.nodeName)<0;)i=i.parentNode;if(i&&"A"===i.nodeName){var l=a(i);s=l.text(),e=l.attr("href"),o.o.minimalLinks||(t=l.attr("title"),n=l.attr("target"));var d=o.doc.createRange();d.selectNode(i),r.removeAllRanges(),r.addRange(d)}o.saveRange();var c={url:{label:"URL",required:!0,value:e},text:{label:o.lang.text,value:s}};o.o.minimalLinks||Object.assign(c,{title:{label:o.lang.title,value:t},target:{label:o.lang.target,value:n}}),o.openModalInsert(o.lang.createLink,c,function(e){var t=o.prependUrlPrefix(e.url);if(!t.length)return!1;var n=a(['<a href="',e.url,'">',e.text||e.url,"</a>"].join(""));return o.o.minimalLinks||(e.title.length>0&&n.attr("title",e.title),e.target.length>0&&n.attr("target",e.target)),o.range.deleteContents(),o.range.insertNode(n[0]),o.syncCode(),o.$c.trigger("tbwchange"),!0})},prependUrlPrefix:function(e){var t=this;if(!t.urlPrefix)return e;const n=/^([a-z][-+.a-z0-9]*:|\/|#)/i;if(n.test(e))return e;const a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return a.test(e)?"mailto:"+e:t.urlPrefix+e},unlink:function(){var e=this,t=e.doc.getSelection(),n=t.focusNode;if(t.isCollapsed){for(;["A","DIV"].indexOf(n.nodeName)<0;)n=n.parentNode;if(n&&"A"===n.nodeName){var a=e.doc.createRange();a.selectNode(n),t.removeAllRanges(),t.addRange(a)}}e.execCmd("unlink",void 0,void 0,!0)},insertImage:function(){var e=this;e.saveRange();var t={url:{label:"URL",required:!0},alt:{label:e.lang.description,value:e.getRangeText()}};e.o.imageWidthModalEdit&&(t.width={}),e.openModalInsert(e.lang.insertImage,t,function(t){e.execCmd("insertImage",t.url);var n=a('img[src="'+t.url+'"]:not([alt])',e.$box);return n.attr("alt",t.alt),e.o.imageWidthModalEdit&&n.attr({width:t.width}),e.syncCode(),e.$c.trigger("tbwchange"),!0})},fullscreen:function(){var e,n=this,o=n.o.prefix,r=o+"fullscreen";n.$box.toggleClass(r),e=n.$box.hasClass(r),a("body").toggleClass(o+"body-fullscreen",e),a(t).trigger("scroll"),n.$c.trigger("tbw"+(e?"open":"close")+"fullscreen")},execCmd:function(e,t,n,a){var o=this;a=!!a||"","dropdown"!==e&&o.$ed.focus();try{o.doc.execCommand("styleWithCSS",!1,n||!1)}catch(r){}try{o[e+a](t)}catch(r){try{e(t)}catch(i){"insertHorizontalRule"===e?t=void 0:"formatBlock"===e&&o.isIE&&(t="<"+t+">"),o.doc.execCommand(e,!1,t),o.syncCode(),o.semanticCode(!1,!0)}"dropdown"!==e&&(o.updateButtonPaneStatus(),o.$c.trigger("tbwchange"))}},openModal:function(e,n){var i=this,s=i.o.prefix;if(a("."+s+"modal-box",i.$box).length>0)return!1;i.o.autogrowOnEnter&&(i.autogrowOnEnterDontClose=!0),i.saveRange(),i.showOverlay(),i.$btnPane.addClass(s+"disable");var l=a("<div/>",{"class":s+"modal "+s+"fixed-top"}).css({top:i.$btnPane.height()}).appendTo(i.$box);i.$overlay.one("click",function(){return l.trigger(r),!1});var d=a("<form/>",{action:"",html:n}).on("submit",function(){return l.trigger(o),!1}).on("reset",function(){return l.trigger(r),!1}).on("submit reset",function(){i.o.autogrowOnEnter&&(i.autogrowOnEnterDontClose=!1)}),c=a("<div/>",{"class":s+"modal-box",html:d}).css({top:"-"+i.$btnPane.outerHeight()+"px",opacity:0}).appendTo(l).animate({top:0,opacity:1},100);return a("<span/>",{text:e,"class":s+"modal-title"}).prependTo(c),l.height(c.outerHeight()+10),a("input:first",c).focus(),i.buildModalBtn("submit",c),i.buildModalBtn("reset",c),a(t).trigger("scroll"),l},buildModalBtn:function(e,t){var n=this,o=n.o.prefix;return a("<button/>",{"class":o+"modal-button "+o+"modal-"+e,type:e,text:n.lang[e]||e}).appendTo(a("form",t))},closeModal:function(){var e=this,t=e.o.prefix;e.$btnPane.removeClass(t+"disable"),e.$overlay.off();var n=a("."+t+"modal-box",e.$box);n.animate({top:"-"+n.height()},100,function(){n.parent().remove(),e.hideOverlay()}),e.restoreRange()},openModalInsert:function(e,t,n){var i=this,s=i.o.prefix,l=i.lang,d="";return a.each(t,function(e,t){var n=t.label||e,a=t.name||e,o=t.attributes||{},r=Object.keys(o).map(function(e){return e+'="'+o[e]+'"'}).join(" ");d+='<label><input type="'+(t.type||"text")+'" name="'+a+'"'+("checkbox"===t.type&&t.value?' checked="checked"':' value="'+(t.value||"").replace(/"/g,"&quot;"))+'"'+r+'><span class="'+s+'input-infos"><span>'+(l[n]?l[n]:n)+"</span></span></label>"}),i.openModal(e,d).on(o,function(){var e=a("form",a(this)),r=!0,s={};a.each(t,function(t,n){var o=n.name||t,l=a('input[name="'+o+'"]',e),d=l.attr("type");switch(d.toLowerCase()){case"checkbox":s[o]=l.is(":checked");break;case"radio":s[o]=l.filter(":checked").val();break;default:s[o]=a.trim(l.val())}n.required&&""===s[o]?(r=!1,i.addErrorOnModalField(l,i.lang.required)):n.pattern&&!n.pattern.test(s[o])&&(r=!1,i.addErrorOnModalField(l,n.patternError))}),r&&(i.restoreRange(),n(s,t)&&(i.syncCode(),i.$c.trigger("tbwchange"),i.closeModal(),a(this).off(o)))}).one(r,function(){a(this).off(o),i.closeModal()})},addErrorOnModalField:function(e,t){var n=this.o.prefix,o=e.parent();e.on("change keyup",function(){o.removeClass(n+"input-error")}),o.addClass(n+"input-error").find("input+span").append(a("<span/>",{"class":n+"msg-error",text:t}))},getDefaultImgDblClickHandler:function(){var e=this;return function(){var t=a(this),n=t.attr("src"),o="(Base64)";0===n.indexOf("data:image")&&(n=o);var r={url:{label:"URL",value:n,required:!0},alt:{label:e.lang.description,value:t.attr("alt")}};return e.o.imageWidthModalEdit&&(r.width={value:t.attr("width")?t.attr("width"):""}),e.openModalInsert(e.lang.insertImage,r,function(n){return n.src!==o&&t.attr({src:n.url}),t.attr({alt:n.alt}),e.o.imageWidthModalEdit&&(parseInt(n.width)>0?t.attr({width:n.width}):t.removeAttr("width")),!0}),!1}},saveRange:function(){var e=this,t=e.doc.getSelection();if(e.range=null,t.rangeCount){var n,a=e.range=t.getRangeAt(0),o=e.doc.createRange();o.selectNodeContents(e.$ed[0]),o.setEnd(a.startContainer,a.startOffset),n=(o+"").length,e.metaRange={start:n,end:n+(a+"").length}}},restoreRange:function(){var e,t=this,n=t.metaRange,a=t.range,o=t.doc.getSelection();if(a){if(n&&n.start!==n.end){var r,i=0,s=[t.$ed[0]],l=!1,d=!1;for(e=t.doc.createRange();!d&&(r=s.pop());)if(3===r.nodeType){var c=i+r.length;!l&&n.start>=i&&n.start<=c&&(e.setStart(r,n.start-i),l=!0),l&&n.end>=i&&n.end<=c&&(e.setEnd(r,n.end-i),d=!0),i=c}else for(var u=r.childNodes,g=u.length;g>0;)g-=1,s.push(u[g])}o.removeAllRanges(),o.addRange(e||a)}},getRangeText:function(){return this.range+""},updateButtonPaneStatus:function(){var e=this,t=e.o.prefix,n=e.getTagsRecursive(e.doc.getSelection().focusNode),o=t+"active-button "+t+"active";a("."+t+"active-button",e.$btnPane).removeClass(o),a.each(n,function(n,r){var i=e.tagToButton[r.toLowerCase()],s=a("."+t+i+"-button",e.$btnPane);if(s.length>0)s.addClass(o);else try{s=a("."+t+"dropdown ."+t+i+"-dropdown-button",e.$box);var l=s.parent().data("dropdown");a("."+t+l+"-button",e.$box).addClass(o)}catch(d){}})},getTagsRecursive:function(e,t){var n=this;if(t=t||(e&&e.tagName?[e.tagName]:[]),!e||!e.parentNode)return t;e=e.parentNode;var o=e.tagName;return"DIV"===o?t:("P"===o&&""!==e.style.textAlign&&t.push(e.style.textAlign),a.each(n.tagHandlers,function(a,o){t=t.concat(o(e,n))}),t.push(o),n.getTagsRecursive(e,t).filter(function(e){return null!=e}))},initPlugins:function(){var e=this;e.loadedPlugins=[],a.each(a.trumbowyg.plugins,function(t,n){n.shouldInit&&!n.shouldInit(e)||(n.init(e),n.tagHandler&&e.tagHandlers.push(n.tagHandler),e.loadedPlugins.push(n))})},destroyPlugins:function(){a.each(this.loadedPlugins,function(e,t){t.destroy&&t.destroy()})}}}(navigator,window,document,jQuery); ;window.Openrat={};let originalAddClass=jQuery.fn.addClass;jQuery.fn.addClass=function(s){return originalAddClass.call(this,'or-'+s)};let originalRemoveClass=jQuery.fn.removeClass;jQuery.fn.removeClass=function(s){return originalRemoveClass.call(this,'or-'+s)};let originalHasClass=jQuery.fn.hasClass;jQuery.fn.hasClass=function(s){return originalHasClass.call(this,'or-'+s)}; -;Openrat.Notice=function(){'use strict';this.typ='';this.id=0;this.name='';this.status='inactive';this.msg='';this.log='';let element=$('<div class="or-notice or-notice--is-inactive"></div>');const type=Object.freeze({warning:0,validation:1,info:2,success:3,error:3,loading:3,inactive:4});this.before=function(){};this.close=function(){element.fadeOut('fast',function(){element.remove()})};this.setStatus=function(t){element.removeClass('notice--'+this.status);this.status=t;element.addClass('notice--'+this.status)};this.inProgress=function(){element.addClass('loader')};this.stopProgress=function(){element.removeClass('loader')};this.show=function(){console.debug('user notice: '+this.msg);let notice=this;element.removeClass('notice--is-inactive');element.appendTo('.or-notices');let toolbar=$('<div class="or-notice-toolbar"></div>');toolbar.appendTo(element);toolbar.append('<i class="or-image-icon or-image-icon--menu-close or-act-notice-close"></i>');if(this.log)toolbar.append('<i class="or-act-notice-full or-image-icon or-image-icon--menu-fullscreen"></i>');if(this.name)element.append('<div class="or-notice-name"><a class="or-act-clickable" href="'+Openrat.Navigator.createShortUrl(this.typ,this.id)+'" data-type="open" data-action="'+this.typ+'" data-id="'+this.id+'"><i class="or-notice-action-full or-image-icon or-image-icon--action-'+this.typ+'"></i> '+this.name+'</a></div>');element.append('<div class="or-notice-text">'+htmlEntities(this.msg)+'</div>');if(this.log)element.append('<div class="or-notice-log"><pre>'+htmlEntities(this.log)+'</pre></div>');element.orLinkify();element.find('.or-act-notice-full').click(function(){element.toggleClass('notice--is-full')});element.find('.or-act-notice-close').click(function(){notice.close()});let timeout=1;if(this.status=='ok')timeout=3;if(this.status=='info')timeout=30;if(this.status=='warning')timeout=40;if(this.status=='error')timeout=50;if(timeout>0)setTimeout(function(){element.fadeOut('slow',function(){element.remove()})},timeout*1000)};this.setContext=function(t,e,i){this.typ=t;this.id=e;this.name=i};this.start=function(t,e,i,n,o,log=null,notifyTheBrowser=!1){this.setContext(t,e,i);this.msg=o;this.log=log;if(notifyTheBrowser)this.notifyBrowser(o);this.setStatus(n)};this.notifyBrowser=function(){let text=this.msg;if(!('Notification' in window)){return} +;Openrat.Notice=function(){'use strict';this.typ='';this.id=0;this.name='';this.status='inactive';this.msg='';this.log='';this.timeout=0;let element=$('<div class="or-notice or-notice--is-inactive"></div>');this.onClick=$.Callbacks();const type=Object.freeze({warning:0,validation:1,info:2,success:3,error:3,loading:3,inactive:4});this.before=function(){};this.close=function(){element.fadeOut('fast',function(){element.remove()})};this.setStatus=function(t){element.removeClass('notice--'+this.status);this.status=t;element.addClass('notice--'+this.status)};this.inProgress=function(){element.addClass('loader')};this.stopProgress=function(){element.removeClass('loader')};this.show=function(){console.debug('user notice: '+this.msg);let notice=this;element.removeClass('notice--is-inactive');element.appendTo('.or-notices');let toolbar=$('<div class="or-notice-toolbar"></div>');toolbar.appendTo(element);toolbar.append('<i class="or-image-icon or-image-icon--menu-close or-act-notice-close"></i>');if(this.log)toolbar.append('<i class="or-act-notice-full or-image-icon or-image-icon--menu-fullscreen"></i>');if(this.name)element.append('<div class="or-notice-name"><a class="or-act-clickable" href="'+Openrat.Navigator.createShortUrl(this.typ,this.id)+'" data-type="open" data-action="'+this.typ+'" data-id="'+this.id+'"><i class="or-notice-action-full or-image-icon or-image-icon--action-'+this.typ+'"></i> '+this.name+'</a></div>');element.append('<div class="or-notice-text">'+htmlEntities(this.msg)+'</div>');if(this.log)element.append('<div class="or-notice-log"><pre>'+htmlEntities(this.log)+'</pre></div>');element.orLinkify();element.find('.or-act-notice-full').click(function(){element.toggleClass('notice--is-full')});element.find('.or-notice-text').click(function(){notice.onClick.fire()});element.find('.or-act-notice-close').click(function(){notice.close()});if(!this.timeout){switch(this.status){case'ok':this.timeout=3;break;case'info':this.timeout=30;break;case'warning':this.timeout=40;break;case'error':this.timeout=50;break;default:this.timeout=10;console.error('unknown notice status: '+this.status)}};if(this.timeout)setTimeout(function(){element.fadeOut('slow',function(){element.remove()})},this.timeout*1000)};this.setContext=function(t,e,i){this.typ=t;this.id=e;this.name=i};this.start=function(t,e,i,n,o,log=null,notifyTheBrowser=!1){this.setContext(t,e,i);this.msg=o;this.log=log;if(notifyTheBrowser)this.notifyBrowser(o);this.setStatus(n)};this.notifyBrowser=function(){let text=this.msg;if(!('Notification' in window)){return} else if(Notification.permission==='granted'){let notification=new Notification(text)} else if(Notification.permission!=='denied'){Notification.requestPermission(function(t){if(t==='granted'){let notification=new Notification(text)}})}};let htmlEntities=function(t){return String(t).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;')}};Openrat.Notice.removeNoticesWithStatus=function(t){$('.or-notices').find('.or-notice--'+t).remove()};Openrat.Notice.removeAllNotices=function(t){$('.or-notices').find('.or-notice').remove()}; -;Openrat.Dialog=function(){this.view;this.isDirty=!1;this.element=$('.or-dialog-content .or-view');this.start=function(e,i,t,o,n){if(!i)i=Openrat.Workbench.state.action;if(!o)o=Openrat.Workbench.state.id;let dialog=this;let view=new Openrat.View(i,t,o,n);Openrat.Notice.removeAllNotices();$('.or-dialog').removeClass('dialog--is-closed').addClass('dialog--is-open');$('.or-dialog-content .or-act-dialog-name').html(e);this.escapeKeyClosingHandler=function(e){if(e.keyCode==27){dialog.close();$(document).off('keyup')}};$(document).keyup(this.escapeKeyClosingHandler);$('.or-dialog-filler,.or-act-dialog-close').off('click').click(function(e){e.preventDefault();dialog.close()});view.onCloseHandler.add(function(){dialog.close()});view.onChangeHandler.add(function(){console.debug('Changes detected');dialog.isDirty=!0;dialog.element.addClass('view--is-dirty')});view.onSaveHandler.add(function(){dialog.isDirty=!1;dialog.element.removeClass('view--is-dirty')});this.view=view;return this.view.start(this.element)};this.close=function(){if(this.isDirty){let exit=window.confirm(Openrat.Workbench.language.UNSAVED_CHANGES_CONFIRM);if(!exit)return};$('.or-dialog-content .or-view.or-view--is-dirty').removeClass('view--is-dirty');$('.or-dialog-content .or-view').html('');$('.or-dialog').removeClass('dialog--is-open').addClass('dialog--is-closed');$(document).unbind('keyup',this.escapeKeyClosingHandler)}}; +;Openrat.Dialog=function(){this.view;this.isDirty=!1;this.element=$('.or-dialog-content .or-view');this.start=function(e,i,o,t,n){if(!i)i=Openrat.Workbench.state.action;if(!t)t=Openrat.Workbench.state.id;let dialog=this;let view=new Openrat.View(i,o,t,n);Openrat.Notice.removeAllNotices();$('.or-dialog-content .or-view').html('');$('.or-dialog-content .or-act-dialog-name').html(e);this.show();view.onCloseHandler.add(function(){dialog.close()});view.onChangeHandler.add(function(){console.debug('Changes detected');dialog.isDirty=!0;dialog.element.addClass('view--is-dirty')});view.onSaveHandler.add(function(){dialog.isDirty=!1;dialog.element.removeClass('view--is-dirty')});this.view=view;return this.view.start(this.element)};this.show=function(){$('.or-dialog').removeClass('dialog--is-closed').addClass('dialog--is-open');if(this.isDirty){this.element.addClass('view--is-dirty')};let dialog=this;this.escapeKeyClosingHandler=function(e){if(e.keyCode==27){dialog.close();$(document).off('keyup')}};$(document).keyup(this.escapeKeyClosingHandler);$('.or-dialog-filler,.or-act-dialog-close').off('click').click(function(e){e.preventDefault();dialog.close()})};this.hide=function(){$('.or-dialog').removeClass('dialog--is-open').addClass('dialog--is-closed')};this.close=function(){let dialog=this;if(this.isDirty){let exit=window.confirm(Openrat.Workbench.language.UNSAVED_CHANGES_CONFIRM);if(!exit)return;let notice=new Openrat.Notice();notice.msg=Openrat.Workbench.language.REOPEN_CLOSED_DIALOG;notice.setStatus('warning');notice.timeout=120;notice.onClick.add(function(){dialog.show();notice.close()});notice.show()};$('.or-dialog-content .or-view.or-view--is-dirty').removeClass('view--is-dirty');this.hide();$(document).unbind('keyup',this.escapeKeyClosingHandler)}}; ;Openrat.View=function(e,t,i,n){this.action=e;this.method=t;this.id=i;this.params=n;this.onCloseHandler=$.Callbacks();this.onChangeHandler=$.Callbacks();this.onSaveHandler=$.Callbacks();this.before=function(){};this.start=function(e){this.before();this.element=e;return this.loadView()};this.afterLoad=function(){};this.close=function(){this.onCloseHandler.fire()};function a(e){Openrat.Workbench.afterViewLoadedHandler.fire(e)};this.loadView=function(){let url=Openrat.View.createUrl(this.action,this.method,this.id,this.params,!1);let element=this.element;let view=this;let loadViewHtmlPromise=$.ajax(url);$(this.element).addClass('loader');console.debug(view);loadViewHtmlPromise.done(function(e,t){if(!e)e='';$(element).html(e);$(element).find('form').each(function(){let form=new Openrat.Form();form.onChangeHandler.add(function(){view.onChangeHandler.fire()});form.onSaveHandler.add(function(){view.onSaveHandler.fire()});form.onCloseHandler.add(function(){view.close()});form.forwardTo=function(e,t,i,n){view.action=e;view.method=t;view.id=i;view.params=n;view.loadView()};form.initOnElement(this)});a(element)});loadViewHtmlPromise.fail(function(e,t,i){$(element).html('');console.error({view:view,url:url,status:t,cause:i});let notice=new Openrat.Notice();notice.setStatus('error');notice.msg=Openrat.Workbench.language.ERROR;notice.show()});loadViewHtmlPromise.always(function(){$(element).removeClass('loader')});let apiUrl=Openrat.View.createUrl(this.action,this.method,this.id,this.params,!0);return loadViewHtmlPromise};Openrat.View.createUrl=function(e,subaction,i,extraid={},api=!1){let url='./';if(api)url+='api/';url+='?';if(e)url+='&action='+e;if(subaction)url+='&subaction='+subaction;if(i)url+='&id='+i;if(typeof extraid==='string'){extraid=extraid.replace(/'/g,'"');let extraObject=jQuery.parseJSON(extraid);jQuery.each(extraObject,function(e,t){url=url+'&'+e+'='+t})} else if(typeof extraid==='object'){jQuery.each(extraid,function(e,t){url=url+'&'+e+'='+t})} else{};return url}}; @@ -1184,7 +1184,7 @@ else if(afterSuccess=='forward'){if(forwardTo)form.forwardTo(data.action,forward else{if(async);else Openrat.Workbench.reloadViews()}})},error:function(e,t,o){console.warn({message:'could not post form',jqXHR:e,form:form,status:t,error:o});form.setLoadStatus(!1);status.close();let msg='';try{msg=jQuery.parseJSON(e.responseText).error}catch(s){msg=e.responseText};let notice=new Openrat.Notice();notice.setStatus('error');notice.msg=msg;notice.show()}});$(form.element).fadeIn()}};this.doResponse=function(e,t,o,onSuccess=$.noop){if(t!='success'){console.error('Server error: '+t);let notice=new Openrat.Notice();notice.setStatus('error');notice.msg=Openrat.Workbench.language.ERROR;notice.show();return};let form=this;$.each(e['notices'],function(t,e){let notifyBrowser=$(o).data('async');let notice=new Openrat.Notice();notice.setContext(e.type,e.id,e.name);notice.log=e.log;notice.setStatus(e.status);notice.msg=e.text;notice.show();if(notifyBrowser)notice.notifyBrowser();if(e.status=='ok'){onSuccess();Openrat.Workbench.dataChangedHandler.fire()} else{}});$.each(e['errors'],function(e,t){$('.or-input[name='+t+']').addClass('input--error').parent().addClass('input--error').parents('.or-group').removeClass('closed').addClass('show').addClass('open')})}}; ;Openrat.Workbench=new function(){'use strict';this.state={action:'',id:0,extra:{}};this.popupWindow=null;this.initialize=function(){this.initializePingTimer();this.initializeDirtyWarning();this.initializeState();this.openModalDialog();Openrat.Workbench.registerOpenClose($('.or-collapsible'));console.info('Application started')};this.initializeDirtyWarning=function(){window.addEventListener('beforeunload',function(e){if($('.or-view--is-dirty').length>0){e.preventDefault();return'Unsaved content will be lost.'} -else{return undefined}})};this.openModalDialog=function(){if($('#dialog').data('action')){let dialog=new Openrat.Dialog();dialog.start('',$('#dialog').data('action'),$('#dialog').data('action'),0,{})}};this.initializeState=function(){let parts=window.location.hash.split('/');let state={action:'index',id:0};if(parts.length>=2)state.action=parts[1].toLowerCase();if(parts.length>=3)state.id=parts[2].replace(/[^0-9_]/gim,'');Openrat.Workbench.state=state;Openrat.Navigator.toActualHistory(state)};this.initializePingTimer=function(){let ping=function(){let pingPromise=$.getJSON(Openrat.View.createUrl('profile','ping',0,{},!0));console.debug('ping');pingPromise.fail(function(e,t,i){console.warn({message:'The server ping has failed.',jqXHR:e,status:t,error:i});if($('.view.dirty').length>0){window.alert('The server session is lost, please save your data.')} +else{return undefined}})};this.openModalDialog=function(){if($('#dialog').data('action')){let dialog=new Openrat.Dialog();dialog.start('',$('#dialog').data('action'),$('#dialog').data('action'),0,{})}};this.initializeState=function(){let parts=window.location.hash.split('/');let state={action:'index',id:0};if(parts.length>=2)state.action=parts[1].toLowerCase();if(parts.length>=3)state.id=parts[2].replace(/[^0-9_]/gim,'');Openrat.Workbench.state=state;Openrat.Navigator.toActualHistory(state)};this.initializePingTimer=function(){let ping=function(){let pingPromise=$.getJSON(Openrat.View.createUrl('profile','ping',0,{},!0));console.debug('ping');pingPromise.fail(function(e,t,i){console.warn({message:'The server ping has failed.',jqXHR:e,status:t,error:i});if($('.or-view--is-dirty').length>0){window.alert('The server session is lost, please save your data.')} else{}})};let timeoutMinutes=5;window.setInterval(ping,timeoutMinutes*60*1000)};this.loadNewActionState=function(e){Openrat.Workbench.state=e;Openrat.Workbench.loadNewAction(e.action,e.id,e.data);this.afterNewActionHandler.fire()};this.afterNewActionHandler=$.Callbacks();this.afterAllViewsLoaded=$.Callbacks();this.loadNewAction=function(e,t,i){this.reloadViews()};this.reloadViews=function(){$('.or-workbench-section--is-closed .or-act-view-loader').empty();let promise=Openrat.Workbench.loadViews($('.or-workbench .or-act-view-loader'));promise.done(function(){Openrat.Workbench.afterAllViewsLoaded.fire()});return promise};this.reloadAll=function(){let promise=Openrat.Workbench.loadViews($('.or-act-view-loader,.or-act-view-static').empty());console.debug('reloading all views');promise.done(function(){Openrat.Workbench.afterAllViewsLoaded.fire()});this.loadUserStyle();this.loadLanguage();this.loadUISettings();return promise};this.loadUserStyle=function(){let url=Openrat.View.createUrl('profile','userinfo',0,{},!0);$.getJSON(url,function(e){let style=e.output['style'];Openrat.Workbench.setUserStyle(style);let color=e.output['theme-color'];Openrat.Workbench.setThemeColor(color)})};this.settings={};this.language={};this.loadLanguage=function(){let url=Openrat.View.createUrl('profile','language',0,{},!0);$.getJSON(url,function(e){Openrat.Workbench.language=e.output.language})};this.loadUISettings=function(){let url=Openrat.View.createUrl('profile','uisettings',0,{},!0);$.getJSON(url,function(e){Openrat.Workbench.settings=e.output.settings.settings})};this.loadViews=function(e){let promises=[];e.each(function(e){let $targetDOMElement=$(this);promises.push(Openrat.Workbench.loadNewActionIntoElement($targetDOMElement))});return $.when.apply($,promises)};this.loadNewActionIntoElement=function(e){let action;if(e.is('.or-act-view-static'))action=e.attr('data-action');else action=Openrat.Workbench.state.action;let id=Openrat.Workbench.state.id;let params=Openrat.Workbench.state.extra;let method=e.data('method');let view=new Openrat.View(action,method,id,params);return view.start(e)};this.setUserStyle=function(e){var t=$('html'),i=t.attr('class').split(/\s+/);$.each(i,function(e,i){if(i.startsWith('or-theme-')){t.removeClass(i.substring(3))}});t.addClass('theme-'+e.toLowerCase())};this.setThemeColor=function(e){$('#theme-color').attr('content',e)};this.dataChangedHandler=$.Callbacks();this.dataChangedHandler.add(function(){if(Openrat.Workbench.popupWindow)Openrat.Workbench.popupWindow.location.reload()});this.afterViewLoadedHandler=$.Callbacks();this.setApplicationTitle=function(e){if(e)$('head > title').text(e+' - '+$('head > title').data('default'));else $('head > title').text($('head > title').data('default'))};this.registerOpenClose=function(e){$(e).children('.or-collapsible-act-switch').click(function(){$(this).closest('.or-collapsible').toggleClass('collapsible--is-open').toggleClass('collapsible--is-closed')})};this.openNewAction=function(e,t,i){$('.or-workbench-navigation').removeClass('workbench-navigation--is-open');Openrat.Workbench.setApplicationTitle(e);Openrat.Navigator.navigateToNew({'action':t,'id':i})};this.registerDraggable=function(e){$(e).find('.or-draggable').draggable({helper:'clone',opacity:0.7,zIndex:3,distance:10,cursor:'move',revert:'false'})};this.registerDroppable=function(e){$(e).find('.or-droppable-selector').droppable({accept:'.or-draggable',hoverClass:'droppable--hover',activeClass:'droppable--active',drop:function(e,t){let dropped=t.draggable;console.info('dropped:');console.info(dropped);let id=$(dropped).find('.or-link').data('id');let name=$(dropped).find('.or-navtree-text').text();if(!name)name=id;$(this).find('.or-selector-link-value').val(id);$(this).find('.or-selector-link-name').val(name).attr('placeholder',name)}})}}; ;Openrat.Navigator=new function(){'use strict';this.navigateTo=function(t){Openrat.Workbench.loadNewActionState(t)};this.navigateToNew=function(t){this.navigateTo(t);window.history.pushState(t,t.name,this.createShortUrl(t.action,t.id))};this.toActualHistory=function(t){window.history.replaceState(t,t.name,this.createShortUrl(t.action,t.id))};this.createShortUrl=function(t,i){return'./#/'+t+(i?'/'+i:'')}}; ;$(function(){$('html').removeClass('nojs');$('.or--initial-hidden').removeClass('-initial-hidden');function e(){};e();window.onpopstate=function(e){Openrat.Navigator.navigateTo(e.state)};Openrat.Workbench.initialize();Openrat.Workbench.reloadAll();let registerWorkbenchGlobalEvents=function(){$('.keystroke').each(function(){let keystrokeElement=$(this);let keystroke=keystrokeElement.text();if(keystroke.length==0)return;let keyaction=function(){keystrokeElement.click()};$(document).bind('keydown',keystroke,keyaction)})};$('.or-act-initial-notice').each(function(){let notice=new Openrat.Notice();notice.setStatus('info');notice.msg=$(this).text();notice.show();$(this).remove()});registerWorkbenchGlobalEvents();let closeMenu=function(){$('body').click(function(){$('.or-menu').removeClass('menu--is-open')})};closeMenu();let closeMobileNavigation=function(){$('.or-act-navigation-close').click(function(){$('.or-workbench-navigation').removeClass('workbench-navigation--is-open');$('.or-workbench').removeClass('workbench--navigation-is-open')})};closeMobileNavigation();let closeDesktopNavigation=function(){$('.or-workbench-title .or-act-nav-small').click(function(){$('.or-workbench').addClass('workbench--navigation-is-small');$('.or-workbench-navigation').addClass('workbench-navigation--is-small')})};closeDesktopNavigation();let registerGlobalSearch=function(){$('.or-search-input .or-input').orSearch({onSearchActive:function(){$('.or-search').addClass('search--is-active')},onSearchInactive:function(){$('.or-search').removeClass('search--is-active')},dropdown:'.or-act-search-result',resultEntryClass:'or-search-result-entry',select:function(e){Openrat.Workbench.openNewAction(e.name,e.action,e.id)},afterSelect:function(){}});$('.or-search .or-act-search-delete').click(function(){$('.or-search .or-title-input').val('').change()})};registerGlobalSearch();Openrat.Workbench.afterNewActionHandler.add(function(){$('.or-sidebar').find('.or-sidebar-button').orLinkify()});Openrat.Workbench.afterNewActionHandler.add(function(){let url=Openrat.View.createUrl('tree','path',Openrat.Workbench.state.id,{'type':Openrat.Workbench.state.action});let loadPromise=$.get(url);loadPromise.done(function(e){$('.or-breadcrumb').empty().append(e).find('.or-act-clickable').orLinkify();$('nav .or-navtree-node').removeClass('or-navtree-node--selected');$('.or-breadcrumb a').each(function(){let action=$(this).data('action');let id=$(this).data('id');let $navControl=$('nav .or-navtree-node[data-type='+action+'][data-id='+id+'].or-navtree-node--is-closed .or-navtree-node-control');$navControl.click()})}).fail(function(e,t,n){console.warn({message:'Failed to load path',url:url,jqXHR:e,status:t,error:n})}).always(function(){})});Openrat.Workbench.afterNewActionHandler.fire()});let filterMenus=function(){let action=Openrat.Workbench.state.action;let id=Openrat.Workbench.state.id;$('.or-workbench-title .or-dropdown-entry.or-act-clickable').addClass('dropdown-entry--active');$('.or-workbench-title .or-dropdown-entry.or-act-clickable.or-filtered').removeClass('dropdown-entry--active').addClass('dropdown-entry--inactive');$('.or-workbench-title .or-dropdown-entry.or-act-clickable.or-filtered .or-link').attr('data-id',id);let url=Openrat.View.createUrl('profile','available',id,{'queryaction':action},!0);let promise=$.getJSON(url);promise.done(function(e){jQuery.each(e.output.views,function(e,t){$('.or-workbench-title .or-dropdown-entry.or-act-clickable.or-filtered > .or-link[data-method=\''+t+'\']').parent().addClass('dropdown-entry--active').removeClass('dropdown-entry--inactive')})})};Openrat.Workbench.afterAllViewsLoaded.add(function(){filterMenus()});Openrat.Workbench.afterViewLoadedHandler.add(function(e){if(Openrat.Workbench.popupWindow)$(e).find('a[data-type=\'popup\']').each(function(){Openrat.Workbench.popupWindow.location.href=$(this).attr('data-url')})});Openrat.Workbench.afterViewLoadedHandler.add(function(e){$(e).find('.or-input--password').dblclick(function(){$(this).toggleAttr('type','text','password')});$(e).find('.or-act-make-visible').click(function(){$(this).toggleClass('btn--is-active');$(this).parent().children('input').toggleAttr('type','text','password')})});Openrat.Workbench.afterViewLoadedHandler.add(function(e){e.find('.or-act-load-nav-tree').each(function(){let type=$(this).data('type')||'root';let loadBranchUrl='./?action=tree&subaction=branch&id=0&type='+type;let $targetElement=$(this);$.get(loadBranchUrl).done(function(e){let $ul=$('<ul class="or-navtree-list" />');$ul.appendTo($targetElement.empty()).append(e);$ul.find('li').orTree({'openAction':function(e,t,n){Openrat.Workbench.openNewAction(e,t,n)}});$ul.find('.or-act-clickable').orLinkify();$ul.find('.or-navtree-node-control').first().click()})})});Openrat.Workbench.afterViewLoadedHandler.add(function(e){var t=$(e).closest('section');t.toggleClass('is-empty',$(e).is(':empty'));if(!$(e).is(':empty'))t.slideDown('fast');else t.slideUp('fast');$(e).find('.or-act-nav-open-close').click(function(){$('.or-workbench').toggleClass('workbench--navigation-is-open');$('.or-workbench-navigation').toggleClass('workbench-navigation--is-open')});$(e).find('.or-act-nav-small').click(function(){$('.or-workbench').addClass('workbench--navigation-is-small');$('.or-workbench-navigation').addClass('workbench-navigation--is-small')});$(e).find('.or-act-nav-wide').click(function(){$('.or-workbench').removeClass('workbench--navigation-is-small');$('.or-workbench-navigation').removeClass('workbench-navigation--is-small')});$(e).find('.or-act-selector-tree-button').click(function(){let $selector=$(this).parent('.or-selector');let $targetElement=$selector.find('.or-act-load-selector-tree');if($selector.hasClass('selector--is-tree-active')){$selector.removeClass('selector--is-tree-active');$targetElement.empty()} diff --git a/modules/cms/ui/themes/default/script/openrat/dialog.js b/modules/cms/ui/themes/default/script/openrat/dialog.js @@ -49,28 +49,10 @@ Openrat.Dialog = function() { Openrat.Notice.removeAllNotices(); - //$('.or-dialog-content .or-view').html('<div class="header"><img class="or-icon" title="" src="./themes/default/images/icon/'+method+'.png" />'+name+'</div>'); - //$('.or-dialog-content .or-view').data('id',id); - $('.or-dialog').removeClass('dialog--is-closed').addClass('dialog--is-open'); - $('.or-dialog-content .or-act-dialog-name').html( name ); - - this.escapeKeyClosingHandler = function (e) { - if (e.keyCode == 27) { // ESC keycode - dialog.close(); - - $(document).off('keyup'); // de-register. - } - }; - - $(document).keyup(this.escapeKeyClosingHandler); - - // close dialog on click onto the blurred area. - $('.or-dialog-filler,.or-act-dialog-close').off('click').click( function(e) - { - e.preventDefault(); - dialog.close(); - }); + $('.or-dialog-content .or-view').html(''); // Clear old content + $('.or-dialog-content .or-act-dialog-name').html( name ); + this.show(); view.onCloseHandler.add( function() { dialog.close(); @@ -97,24 +79,69 @@ Openrat.Dialog = function() { } + + this.show = function() { + + $('.or-dialog').removeClass('dialog--is-closed').addClass('dialog--is-open'); + + if ( this.isDirty ) { + this.element.addClass('view--is-dirty'); + } + + let dialog = this; + + this.escapeKeyClosingHandler = function (e) { + if (e.keyCode == 27) { // ESC keycode + dialog.close(); + + $(document).off('keyup'); // de-register. + } + }; + + $(document).keyup(this.escapeKeyClosingHandler); + + // close dialog on click onto the blurred area. + $('.or-dialog-filler,.or-act-dialog-close').off('click').click( function(e) + { + e.preventDefault(); + dialog.close(); + }); + } + + + this.hide = function() { + $('.or-dialog').removeClass('dialog--is-open').addClass('dialog--is-closed'); // Dialog schließen + } + + /** * Closing the dialog. */ this.close = function() { + let dialog = this; + if ( this.isDirty ) { // ask the user if we should close this dialog let exit = window.confirm( Openrat.Workbench.language.UNSAVED_CHANGES_CONFIRM ); if ( ! exit ) - return; + return; // do not close the dialog + + let notice = new Openrat.Notice(); + notice.msg = Openrat.Workbench.language.REOPEN_CLOSED_DIALOG; + notice.setStatus( 'warning' ); + notice.timeout = 120; + notice.onClick.add( function() { + dialog.show(); + notice.close(); + }); + notice.show(); } // Remove dirty-flag from view $('.or-dialog-content .or-view.or-view--is-dirty').removeClass('view--is-dirty'); - $('.or-dialog-content .or-view').html(''); - $('.or-dialog').removeClass('dialog--is-open').addClass('dialog--is-closed'); // Dialog schließen - + this.hide(); $(document).unbind('keyup',this.escapeKeyClosingHandler); // Cleanup ESC-Key-Listener } } \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/openrat/notice.js b/modules/cms/ui/themes/default/script/openrat/notice.js @@ -12,9 +12,11 @@ Openrat.Notice = function() { this.status = 'inactive'; this.msg = ''; this.log = ''; + this.timeout = 0; let element = $('<div class="or-notice or-notice--is-inactive"></div>'); + this.onClick = $.Callbacks(); const type = Object.freeze({ warning: 0, @@ -86,24 +88,33 @@ Openrat.Notice = function() { element.toggleClass('notice--is-full'); }); + // Fire onclick-handler + element.find('.or-notice-text').click( function () { + notice.onClick.fire(); + } ); + // Close the notice on click element.find('.or-act-notice-close').click(function () { notice.close(); }); // Fadeout the notice after a while. - let timeout = 1; - if (this.status == 'ok') timeout = 3; - if (this.status == 'info') timeout = 30; - if (this.status == 'warning') timeout = 40; - if (this.status == 'error') timeout = 50; + if ( !this.timeout ) { + switch( this.status ) { + case 'ok' : this.timeout = 3; break; + case 'info' : this.timeout = 30; break; + case 'warning': this.timeout = 40; break; + case 'error' : this.timeout = 50; break; + default: this.timeout = 10; console.error('unknown notice status: '+this.status); + } + } - if (timeout > 0) + if (this.timeout) setTimeout(function () { element.fadeOut('slow', function () { element.remove(); }); - }, timeout * 1000); + }, this.timeout * 1000); } this.setContext = function(type,id,name) { diff --git a/modules/cms/ui/themes/default/script/openrat/workbench.js b/modules/cms/ui/themes/default/script/openrat/workbench.js @@ -105,7 +105,7 @@ Openrat.Workbench = new function() console.warn( {message: 'The server ping has failed.',jqXHR:jqXHR,status:textStatus,error:errorThrown }); // Is there any user input? Ok, we should warn the user that the data could not be saved. - if ($('.view.dirty').length > 0) { + if ($('.or-view--is-dirty').length > 0) { window.alert("The server session is lost, please save your data."); } else { diff --git a/modules/language/Language_CN.class.php b/modules/language/Language_CN.class.php @@ -110,7 +110,6 @@ public function get() { return [ 'BUTTON_NEXT'=>'Next', 'BUTTON_OK_DESC'=>'OK', 'BUTTON_OK'=>'Ok', -'BUTTON_UNDO'=>'Undo', 'CACHE_FILENAME'=>'Cache-Dateiname', 'CALENDAR'=>'Calendar', 'CANCEL'=>'Cancel', @@ -504,6 +503,7 @@ public function get() { return [ 'TREE'=>'Overview', 'TYPE'=>'Type', 'UNDO'=>'Undo', +'REOPEN_CLOSED_DIALOG'=>'You just canceled unsaved changes. Reopen?', 'UNKNOWN_TEXT'=>'no text available', 'UNKNOWN'=>'unknown', 'UP'=>'up', diff --git a/modules/language/Language_DE.class.php b/modules/language/Language_DE.class.php @@ -110,7 +110,6 @@ public function get() { return [ 'BUTTON_NEXT'=>'Weiter', 'BUTTON_OK_DESC'=>'Bestätigen', 'BUTTON_OK'=>'OK', -'BUTTON_UNDO'=>'Rückgängig', 'CACHE_FILENAME'=>'Cache-Dateiname', 'CALENDAR'=>'Kalender', 'CANCEL'=>'Abbrechen', @@ -504,6 +503,7 @@ public function get() { return [ 'TREE'=>'Übersicht', 'TYPE'=>'Typ', 'UNDO'=>'Rückgängig', +'REOPEN_CLOSED_DIALOG'=>'Sie haben ungespeicherte Änderungen verworfen. Wieder herstellen?', 'UNKNOWN_TEXT'=>'kein Text verfügbar', 'UNKNOWN'=>'unbekannt', 'UP'=>'hoch', diff --git a/modules/language/Language_EN.class.php b/modules/language/Language_EN.class.php @@ -110,7 +110,6 @@ public function get() { return [ 'BUTTON_NEXT'=>'Next', 'BUTTON_OK_DESC'=>'OK', 'BUTTON_OK'=>'Ok', -'BUTTON_UNDO'=>'Undo', 'CACHE_FILENAME'=>'Cache-Dateiname', 'CALENDAR'=>'Calendar', 'CANCEL'=>'Cancel', @@ -504,6 +503,7 @@ public function get() { return [ 'TREE'=>'Overview', 'TYPE'=>'Type', 'UNDO'=>'Undo', +'REOPEN_CLOSED_DIALOG'=>'You just canceled unsaved changes. Reopen?', 'UNKNOWN_TEXT'=>'no text available', 'UNKNOWN'=>'unknown', 'UP'=>'up', diff --git a/modules/language/Language_ES.class.php b/modules/language/Language_ES.class.php @@ -110,7 +110,6 @@ public function get() { return [ 'BUTTON_NEXT'=>'Next', 'BUTTON_OK_DESC'=>'OK', 'BUTTON_OK'=>'Aprobar', -'BUTTON_UNDO'=>'Deshacer', 'CACHE_FILENAME'=>'Cache-Dateiname', 'CALENDAR'=>'Calendar', 'CANCEL'=>'Cancel', @@ -503,7 +502,8 @@ public function get() { return [ 'TRANSFER'=>'Transfert', 'TREE'=>'Overview', 'TYPE'=>'Dactylographier', -'UNDO'=>'Défaire', +'UNDO'=>'Deshacer', +'REOPEN_CLOSED_DIALOG'=>'You just canceled unsaved changes. Reopen?', 'UNKNOWN_TEXT'=>'aucun texte disponible', 'UNKNOWN'=>'inconnu', 'UP'=>'vers le haut de', diff --git a/modules/language/Language_FR.class.php b/modules/language/Language_FR.class.php @@ -110,7 +110,6 @@ public function get() { return [ 'BUTTON_NEXT'=>'Next', 'BUTTON_OK_DESC'=>'OK', 'BUTTON_OK'=>'Approuver', -'BUTTON_UNDO'=>'Défaire', 'CACHE_FILENAME'=>'Cache-Dateiname', 'CALENDAR'=>'Calendar', 'CANCEL'=>'Cancel', @@ -504,6 +503,7 @@ public function get() { return [ 'TREE'=>'Overview', 'TYPE'=>'Dactylographier', 'UNDO'=>'Défaire', +'REOPEN_CLOSED_DIALOG'=>'You just canceled unsaved changes. Reopen?', 'UNKNOWN_TEXT'=>'aucun texte disponible', 'UNKNOWN'=>'inconnu', 'UP'=>'vers le haut de', diff --git a/modules/language/Language_IT.class.php b/modules/language/Language_IT.class.php @@ -110,7 +110,6 @@ public function get() { return [ 'BUTTON_NEXT'=>'Next', 'BUTTON_OK_DESC'=>'OK', 'BUTTON_OK'=>'Ok', -'BUTTON_UNDO'=>'Undo', 'CACHE_FILENAME'=>'Cache-Dateiname', 'CALENDAR'=>'Calendar', 'CANCEL'=>'Cancel', @@ -504,6 +503,7 @@ public function get() { return [ 'TREE'=>'Overview', 'TYPE'=>'Mecanografiar', 'UNDO'=>'Deshacer', +'REOPEN_CLOSED_DIALOG'=>'You just canceled unsaved changes. Reopen?', 'UNKNOWN_TEXT'=>'ningún texto disponible', 'UNKNOWN'=>'desconocido', 'UP'=>'encima de', diff --git a/modules/language/Language_RU.class.php b/modules/language/Language_RU.class.php @@ -110,7 +110,6 @@ public function get() { return [ 'BUTTON_NEXT'=>'Next', 'BUTTON_OK_DESC'=>'OK', 'BUTTON_OK'=>'OK', -'BUTTON_UNDO'=>'Ок Отменить', 'CACHE_FILENAME'=>'Cache-Dateiname', 'CALENDAR'=>'Calendar', 'CANCEL'=>'Cancel', @@ -503,7 +502,8 @@ public function get() { return [ 'TRANSFER'=>'Сегодня передача типа', 'TREE'=>'Overview', 'TYPE'=>'Type', -'UNDO'=>'Undo', +'UNDO'=>'Ок Отменить', +'REOPEN_CLOSED_DIALOG'=>'You just canceled unsaved changes. Reopen?', 'UNKNOWN_TEXT'=>'нет текста до', 'UNKNOWN'=>'Отменить неизвестных', 'UP'=>'up', diff --git a/modules/language/Messages.class.php b/modules/language/Messages.class.php @@ -110,7 +110,6 @@ class Messages { const BUTTON_NEXT = 'BUTTON_NEXT'; const BUTTON_OK_DESC = 'BUTTON_OK_DESC'; const BUTTON_OK = 'BUTTON_OK'; - const BUTTON_UNDO = 'BUTTON_UNDO'; const CACHE_FILENAME = 'CACHE_FILENAME'; const CALENDAR = 'CALENDAR'; const CANCEL = 'CANCEL'; @@ -504,6 +503,7 @@ class Messages { const TREE = 'TREE'; const TYPE = 'TYPE'; const UNDO = 'UNDO'; + const REOPEN_CLOSED_DIALOG = 'REOPEN_CLOSED_DIALOG'; const UNKNOWN_TEXT = 'UNKNOWN_TEXT'; const UNKNOWN = 'UNKNOWN'; const UP = 'UP'; diff --git a/modules/language/language.yml b/modules/language/language.yml @@ -436,12 +436,6 @@ BUTTON_OK: es: Aprobar fr: Approuver ru: OK -BUTTON_UNDO: - de: Rückgängig - en: Undo - es: Deshacer - fr: Défaire - ru: Ок Отменить CACHE_FILENAME: de: Cache-Dateiname en: Cache-Dateiname @@ -2580,9 +2574,13 @@ TYPE: UNDO: de: Rückgängig en: Undo - es: Défaire + es: Deshacer fr: Défaire + ru: Ок Отменить it: Deshacer +REOPEN_CLOSED_DIALOG: + de: Sie haben ungespeicherte Änderungen verworfen. Wieder herstellen? + en: You just canceled unsaved changes. Reopen? UNKNOWN_TEXT: de: kein Text verfügbar en: no text available