Commit 6b7e1f1e authored by Stefan Galinski's avatar Stefan Galinski 🎮

[TASK] Update to tinymce 4.1.7

parent db780b0b
......@@ -6,9 +6,9 @@
$('input[type=checkbox]').attr('checked', 1)
3. Unpack the downloaded sources
3. Unpack the downloaded sources inside a separate folder
4. Remove the tinymce directory inside the extension and move "tinymce/js/tinymce" from the download source as a
replacement.
5. Move the files of the "langs" directory from the downloaded languages into "tinymce/langs/"
5. Replace the "langs" directory with the downloaded one
6. Update the VERSIONS.md file
7. Push the new code to git (check the differences and test the stuff before!)
\ No newline at end of file
### Used Versions
- TinyMCE - 4.1.6
- Languages - 18.10.2014
\ No newline at end of file
- TinyMCE - 4.1.7
- Languages - 27.11.2014
\ No newline at end of file
......@@ -59,6 +59,7 @@ tinymce.addI18n('ar_SA',{
"Restore last draft": "\u0627\u0633\u062a\u0639\u0627\u062f\u0629 \u0623\u062e\u0631 \u0645\u0633\u0648\u062f\u0629",
"Special character": "Special character",
"Source code": "Source code",
"Color": "\u062a\u062d\u062f\u064a\u062f \u0627\u0644\u0644\u0648\u0646",
"Right to left": "\u0645\u0646 \u0627\u0644\u064a\u0645\u064a\u0646 \u0625\u0644\u064a \u0627\u0644\u064a\u0633\u0627\u0631",
"Left to right": "\u0645\u0646 \u0627\u0644\u064a\u0633\u0627\u0631 \u0625\u0644\u064a \u0627\u0644\u064a\u0645\u064a\u0646",
"Emoticons": "\u0627\u0644\u0631\u0645\u0648\u0632",
......
......@@ -66,6 +66,7 @@ tinymce.addI18n('bs',{
"Restore last draft": "Vrati posljednju skicu",
"Special character": "Specijalni znak",
"Source code": "Izvorni kod",
"Color": "Boja",
"Right to left": "S desna na lijevo",
"Left to right": "S lijeva na desno",
"Emoticons": "Smajliji",
......
......@@ -103,6 +103,13 @@ tinymce.addI18n('es_MX',{
"Target": "Objetivo",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "El URL que ha insertado tiene formato de correo electr\u00f3nico. Desea agregar con prefijo responder a.",
"Insert\/edit link": "Inserta\/editar enlace",
"Insert\/edit video": "Insertar\/editar video",
"Poster": "Cartel",
"Alternative source": "Fuente alternativa",
"Paste your embed code below:": "Pegue su c\u00f3digo de inserci\u00f3n abajo:",
"Insert video": "Insertar video",
"Embed": "Incrustar",
"Nonbreaking space": "Espacio de no separaci\u00f3n",
"Page break": "Salto de pagina ",
"Paste as text": "Copiar como texto",
"Preview": "Vista previa ",
......
......@@ -133,6 +133,7 @@ tinymce.addI18n('ko_KR',{
"Height": "\ub192\uc774",
"Paste row after": "\ub2e4\uc74c\uc5d0 \ud589 \ubd99\uc5ec\ub123\uae30",
"Alignment": "\uc815\ub82c",
"Border color": "\ud14c\ub450\ub9ac \uc0c9",
"Column group": "\uc5f4 \uadf8\ub8f9",
"Row": "\uc5f4",
"Insert column before": "\uc774\uc804\uc5d0 \ud589 \uc0bd\uc785",
......@@ -148,15 +149,20 @@ tinymce.addI18n('ko_KR',{
"Paste row before": "\uc774\uc804\uc5d0 \ud589 \ubd99\uc5ec\ub123\uae30",
"Scope": "\ubc94\uc704",
"Delete table": "\ud14c\uc774\ube14 \uc0ad\uc81c",
"H Align": "\uac00\ub85c \uc815\ub82c",
"Top": "\uc0c1\ub2e8",
"Header cell": "\ud5e4\ub354 \uc140",
"Column": "\ud589",
"Row group": "\ud589 \uadf8\ub8f9",
"Cell": "\uc140",
"Header": "\ud5e4\ub354",
"Middle": "\uc911\uac04",
"Cell type": "\uc140 \ud0c0\uc785",
"Copy row": "\ud589 \ubcf5\uc0ac",
"Row properties": "\ud589 \uc18d\uc131",
"Table properties": "\ud14c\uc774\ube14 \uc18d\uc131",
"Row group": "\ud589 \uadf8\ub8f9",
"Bottom": "\ud558\ub2e8",
"V Align": "\uc138\ub85c \uc815\ub82c",
"Header": "\ud5e4\ub354",
"Right": "\uc624\ub978\ucabd",
"Insert column after": "\ub2e4\uc74c\uc5d0 \uc5f4 \uc0bd\uc785",
"Cols": "\uc5f4",
......
This is where language files should be placed.
Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
tinymce.addI18n('sl_SI',{
"Cut": "Izre\u017ei",
"Heading 5": "Podnaslov 5",
"Header 2": "Naslov 2",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Varnostne nastavitve brskalnika ne dopu\u0161\u010dajo direktnega dostopa do odlo\u017ei\u0161\u010da. Uporabite kombinacijo tipk Ctrl+X\/C\/V na tipkovnici.",
"Heading 4": "Podnaslov 4",
"Div": "Div",
"Heading 2": "Podnaslov 2",
"Paste": "Prilepi",
"Close": "Zapri",
"Font Family": "Dru\u017eina tipografije",
"Font Family": "Dru\u017eina pisav",
"Pre": "Predformat",
"Align right": "Desna poravnava",
"New document": "Nov dokument",
"Blockquote": "Zamik besedila",
"Numbered list": "O\u0161tevil\u010den seznam",
"Heading 1": "Podnaslov 1",
"Headings": "Podnaslovi",
"Increase indent": "Pove\u010daj zamik",
"Formats": "Oblika",
"Headers": "Naslovi",
......@@ -23,7 +28,7 @@ tinymce.addI18n('sl_SI',{
"Header 1": "Naslov 1",
"Superscript": "Nadpisano",
"Clear formatting": "Odstrani oblikovanje",
"Font Sizes": "Velikosti tipografije",
"Font Sizes": "Velikosti pisave",
"Subscript": "Podpisano",
"Header 6": "Naslov 6",
"Redo": "Ponovi",
......@@ -34,6 +39,8 @@ tinymce.addI18n('sl_SI',{
"Italic": "Le\u017ee\u010de",
"Align center": "Sredinska poravnava",
"Header 5": "Naslov 5",
"Heading 6": "Podnaslov 6",
"Heading 3": "Podnaslov 3",
"Decrease indent": "Zmanj\u0161aj zamik",
"Header 4": "Naslov 4",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Odlagali\u0161\u010de je zdaj v tekstovnem na\u010dinu. Vsebina bo preslikana kot golo besedilo brez oblike, dokler te mo\u017enosti ne izklju\u010dite.",
......@@ -59,6 +66,7 @@ tinymce.addI18n('sl_SI',{
"Restore last draft": "Obnovi zadnji osnutek",
"Special character": "Posebni znaki",
"Source code": "Izvorna koda",
"Color": "Barva",
"Right to left": "Od desne proti levi",
"Left to right": "Od leve proti desni",
"Emoticons": "Sme\u0161ki",
......@@ -91,9 +99,9 @@ tinymce.addI18n('sl_SI',{
"Insert link": "Vstavi povezavo",
"New window": "Novo okno",
"None": "Brez",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "Vne\u0161eni URL predstavlja zunanjo povezavo. Ali \u017eelite dodati \"http:\/\/\" predpono?",
"Target": "Cilj",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "Vne\u0161eni URL predstavlja e-po\u0161tni naslov. Ali \u017eelite dodati potrebno \"mailto:\" predpono?",
"Insert\/edit link": "Vstavi\/uredi povezavo",
"Insert\/edit video": "Vstavi\/uredi video",
"Poster": "Poster",
......@@ -121,11 +129,13 @@ tinymce.addI18n('sl_SI',{
"Finish": "Zaklju\u010di",
"Ignore all": "Prezri vse",
"Ignore": "Prezri",
"Add to Dictionary": "Dodaj v slovar",
"Insert row before": "Vstavi vrstico pred",
"Rows": "Vrstice",
"Height": "Vi\u0161ina",
"Paste row after": "Prilepi vrstico za",
"Alignment": "Poravnava",
"Border color": "Barva obrobe",
"Column group": "Grupiranje stolpcev",
"Row": "Vrstica",
"Insert column before": "Vstavi stolpec pred",
......@@ -141,15 +151,20 @@ tinymce.addI18n('sl_SI',{
"Paste row before": "Prilepi vrstico pred",
"Scope": "Obseg",
"Delete table": "Izbri\u0161i tabelo",
"H Align": "Horizontalna poravnava",
"Top": "Vrh",
"Header cell": "Celica glave",
"Column": "Stolpec",
"Row group": "Grupiranje vrstic",
"Cell": "Celica",
"Header": "Glava",
"Middle": "Sredina",
"Cell type": "Tip celice",
"Copy row": "Kopiraj vrstico",
"Row properties": "Lastnosti vrstice",
"Table properties": "Lastnosti tabele",
"Row group": "Grupiranje vrstic",
"Bottom": "Dno",
"V Align": "Vertikalna poravnava",
"Header": "Glava",
"Right": "Desno",
"Insert column after": "Vstavi stolpec za",
"Cols": "Stolpci",
......@@ -164,6 +179,9 @@ tinymce.addI18n('sl_SI',{
"Insert template": "Vstavi predlogo",
"Templates": "Predloge",
"Background color": "Barva ozadja",
"Custom...": "Po meri ...",
"Custom color": "Barva po meri",
"No color": "Brezbarvno",
"Text color": "Barva besedila",
"Show blocks": "Prika\u017ei bloke",
"Show invisible characters": "Prika\u017ei skrite znake",
......
......@@ -66,6 +66,7 @@ tinymce.addI18n('tr_TR',{
"Restore last draft": "Son tasla\u011f\u0131 kurtar",
"Special character": "\u00d6zel karakter",
"Source code": "Kaynak kodu",
"Color": "Renk",
"Right to left": "Sa\u011fdan sola",
"Left to right": "Soldan sa\u011fa",
"Emoticons": "G\u00fcl\u00fcc\u00fckler",
......@@ -134,6 +135,7 @@ tinymce.addI18n('tr_TR',{
"Height": "Y\u00fckseklik",
"Paste row after": "Sonras\u0131na sat\u0131r yap\u0131\u015ft\u0131r",
"Alignment": "Hizalama",
"Border color": "Kenarl\u0131k Rengi",
"Column group": "S\u00fctun grubu",
"Row": "Sat\u0131r",
"Insert column before": "\u00d6ncesine yeni s\u00fctun ekle",
......@@ -177,6 +179,9 @@ tinymce.addI18n('tr_TR',{
"Insert template": "\u015eablon ekle",
"Templates": "\u015eablonlar",
"Background color": "Arkaplan rengi",
"Custom...": "\u00d6zel",
"Custom color": "\u00d6zel Renk",
"No color": "Renk Yok",
"Text color": "Yaz\u0131 rengi",
"Show blocks": "Bloklar\u0131 g\u00f6r\u00fcnt\u00fcle",
"Show invisible characters": "G\u00f6r\u00fcnmez karakterleri g\u00f6ster",
......
tinymce.PluginManager.add("advlist",function(a){function b(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function c(b,c){var d,e=a.dom,f=a.selection;d=e.getParent(f.getNode(),"ol,ul"),d&&d.nodeName==b&&c!==!1||a.execCommand("UL"==b?"InsertUnorderedList":"InsertOrderedList"),c=c===!1?g[b]:c,g[b]=c,d=e.getParent(f.getNode(),"ol,ul"),d&&(e.setStyle(d,"listStyleType",c?c:null),d.removeAttribute("data-mce-style")),a.focus()}function d(b){var c=a.dom.getStyle(a.dom.getParent(a.selection.getNode(),"ol,ul"),"listStyleType")||"";b.control.items().each(function(a){a.active(a.settings.data===c)})}var e,f,g={};e=b("OL",a.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),f=b("UL",a.getParam("advlist_bullet_styles","default,circle,disc,square")),a.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:e,onshow:d,onselect:function(a){c("OL",a.control.settings.data)},onclick:function(){c("OL",!1)}}),a.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:f,onshow:d,onselect:function(a){c("UL",a.control.settings.data)},onclick:function(){c("UL",!1)}})});
\ No newline at end of file
tinymce.PluginManager.add("advlist",function(a){function b(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function c(b,c){a.undoManager.transact(function(){var d,e=a.dom,f=a.selection;d=e.getParent(f.getNode(),"ol,ul"),d&&d.nodeName==b&&c!==!1||a.execCommand("UL"==b?"InsertUnorderedList":"InsertOrderedList"),c=c===!1?g[b]:c,g[b]=c,d=e.getParent(f.getNode(),"ol,ul"),d&&(e.setStyle(d,"listStyleType",c?c:null),d.removeAttribute("data-mce-style")),a.focus()})}function d(b){var c=a.dom.getStyle(a.dom.getParent(a.selection.getNode(),"ol,ul"),"listStyleType")||"";b.control.items().each(function(a){a.active(a.settings.data===c)})}var e,f,g={};e=b("OL",a.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),f=b("UL",a.getParam("advlist_bullet_styles","default,circle,disc,square")),a.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:e,onshow:d,onselect:function(a){c("OL",a.control.settings.data)},onclick:function(){c("OL",!1)}}),a.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:f,onshow:d,onselect:function(a){c("UL",a.control.settings.data)},onclick:function(){c("UL",!1)}})});
\ No newline at end of file
tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0>b&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){g.setStart(a,d(a,b))}function f(a,b){g.setEnd(a,d(a,b))}var g,h,i,j,k,l,m,n,o,p;if(g=a.selection.getRng(!0).cloneRange(),g.startOffset<5){if(n=g.endContainer.previousSibling,!n){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;n=g.endContainer.firstChild.nextSibling}if(o=n.length,e(n,o),f(n,o),g.endOffset<5)return;h=g.endOffset,j=n}else{if(j=g.endContainer,3!=j.nodeType&&j.firstChild){for(;3!=j.nodeType&&j.firstChild;)j=j.firstChild;3==j.nodeType&&(e(j,0),f(j,j.nodeValue.length))}h=1==g.endOffset?2:g.endOffset-1-b}i=h;do e(j,h>=2?h-2:0),f(j,h>=1?h-1:0),h-=1,p=g.toString();while(" "!=p&&""!==p&&160!=p.charCodeAt(0)&&h-2>=0&&p!=c);g.toString()==c||160==g.toString().charCodeAt(0)?(e(j,h),f(j,i),h+=1):0===g.startOffset?(e(j,0),f(j,i)):(e(j,h),f(j,i)),l=g.toString(),"."==l.charAt(l.length-1)&&f(j,i-1),l=g.toString(),m=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),m&&("www."==m[1]?m[1]="http://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),k=a.selection.getBookmark(),a.selection.setRng(g),a.execCommand("createlink",!1,m[1]+m[2]),a.selection.moveToBookmark(k),a.nodeChanged())}var f;return a.on("keydown",function(b){return 13==b.keyCode?d(a):void 0}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(b){}}}):(a.on("keypress",function(c){return 41==c.keyCode?b(a):void 0}),void a.on("keyup",function(b){return 32==b.keyCode?c(a):void 0}))});
\ No newline at end of file
tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0>b&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){1!=a.nodeType||a.hasChildNodes()?g.setStart(a,d(a,b)):g.setStartBefore(a)}function f(a,b){1!=a.nodeType||a.hasChildNodes()?g.setEnd(a,d(a,b)):g.setEndAfter(a)}var g,h,i,j,k,l,m,n,o,p;if(g=a.selection.getRng(!0).cloneRange(),g.startOffset<5){if(n=g.endContainer.previousSibling,!n){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;n=g.endContainer.firstChild.nextSibling}if(o=n.length,e(n,o),f(n,o),g.endOffset<5)return;h=g.endOffset,j=n}else{if(j=g.endContainer,3!=j.nodeType&&j.firstChild){for(;3!=j.nodeType&&j.firstChild;)j=j.firstChild;3==j.nodeType&&(e(j,0),f(j,j.nodeValue.length))}h=1==g.endOffset?2:g.endOffset-1-b}i=h;do e(j,h>=2?h-2:0),f(j,h>=1?h-1:0),h-=1,p=g.toString();while(" "!=p&&""!==p&&160!=p.charCodeAt(0)&&h-2>=0&&p!=c);g.toString()==c||160==g.toString().charCodeAt(0)?(e(j,h),f(j,i),h+=1):0===g.startOffset?(e(j,0),f(j,i)):(e(j,h),f(j,i)),l=g.toString(),"."==l.charAt(l.length-1)&&f(j,i-1),l=g.toString(),m=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),m&&("www."==m[1]?m[1]="http://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),k=a.selection.getBookmark(),a.selection.setRng(g),a.execCommand("createlink",!1,m[1]+m[2]),a.selection.moveToBookmark(k),a.nodeChanged())}var f;return a.on("keydown",function(b){return 13==b.keyCode?d(a):void 0}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(b){}}}):(a.on("keypress",function(c){return 41==c.keyCode?b(a):void 0}),void a.on("keyup",function(b){return 32==b.keyCode?c(a):void 0}))});
\ No newline at end of file
tinymce.PluginManager.add("image",function(a){function b(a,b){function c(a,c){d.parentNode&&d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(d.clientWidth,d.clientHeight)},d.onerror=function(){c()};var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d),d.src=a}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){return function(){var c=a.settings.image_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function e(d){function e(){var a,b,c,d;a=j.find("#width")[0],b=j.find("#height")[0],a&&b&&(c=a.value(),d=b.value(),j.find("#constrain")[0].checked()&&k&&l&&c&&d&&(k!=c?(d=Math.round(c/k*d),b.value(d)):(c=Math.round(d/l*c),a.value(c))),k=c,l=d)}function f(){function b(b){function c(){b.onload=b.onerror=null,a.selection&&(a.selection.select(b),a.nodeChanged())}b.onload=function(){o.width||o.height||!r||p.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),c()},b.onerror=c}i(),e(),o=tinymce.extend(o,j.toJSON()),o.alt||(o.alt=""),""===o.width&&(o.width=null),""===o.height&&(o.height=null),o.style||(o.style=null),o={src:o.src,alt:o.alt,width:o.width,height:o.height,style:o.style,"class":o["class"]},a.undoManager.transact(function(){return o.src?(q?p.setAttribs(q,o):(o.id="__mcenew",a.focus(),a.selection.setContent(p.createHTML("img",o)),q=p.get("__mcenew"),p.setAttrib(q,"id",null)),void b(q)):void(q&&(p.remove(q),a.focus(),a.nodeChanged()))})}function g(a){return a&&(a=a.replace(/px$/,"")),a}function h(c){var d=c.meta||{};m&&m.value(a.convertURL(this.value(),"src")),tinymce.each(d,function(a,b){j.find("#"+b).value(a)}),d.width||d.height||b(this.value(),function(a){a.width&&a.height&&r&&(k=a.width,l=a.height,j.find("#width").value(k),j.find("#height").value(l))})}function i(){function b(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a}if(a.settings.image_advtab){var c=j.toJSON(),d=p.parseStyle(c.style);delete d.margin,d["margin-top"]=d["margin-bottom"]=b(c.vspace),d["margin-left"]=d["margin-right"]=b(c.hspace),d["border-width"]=b(c.border),j.find("#style").value(p.serializeStyle(p.parseStyle(p.serializeStyle(d))))}}var j,k,l,m,n,o={},p=a.dom,q=a.selection.getNode(),r=a.settings.image_dimensions!==!1;k=p.getAttrib(q,"width"),l=p.getAttrib(q,"height"),"IMG"!=q.nodeName||q.getAttribute("data-mce-object")||q.getAttribute("data-mce-placeholder")?q=null:o={src:p.getAttrib(q,"src"),alt:p.getAttrib(q,"alt"),"class":p.getAttrib(q,"class"),width:k,height:l},d&&(m={type:"listbox",label:"Image list",values:c(d,function(b){b.value=a.convertURL(b.value||b.url,"src")},[{text:"None",value:""}]),value:o.src&&a.convertURL(o.src,"src"),onselect:function(a){var b=j.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),j.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){m=this}}),a.settings.image_class_list&&(n={name:"class",type:"listbox",label:"Class",values:c(a.settings.image_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"img",classes:[b.value]})})})});var s=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:h},m];a.settings.image_description!==!1&&s.push({name:"alt",type:"textbox",label:"Image description"}),r&&s.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),s.push(n),a.settings.image_advtab?(q&&(o.hspace=g(q.style.marginLeft||q.style.marginRight),o.vspace=g(q.style.marginTop||q.style.marginBottom),o.border=g(q.style.borderWidth),o.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(q,"style")))),j=a.windowManager.open({title:"Insert/edit image",data:o,bodyType:"tabpanel",body:[{title:"General",type:"form",items:s},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:i},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:f})):j=a.windowManager.open({title:"Insert/edit image",data:o,body:s,onSubmit:f})}a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:d(e),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),a.addMenuItem("image",{icon:"image",text:"Insert image",onclick:d(e),context:"insert",prependToContext:!0}),a.addCommand("mceImage",d(e))});
\ No newline at end of file
tinymce.PluginManager.add("image",function(a){function b(a,b){function c(a,c){d.parentNode&&d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(d.clientWidth,d.clientHeight)},d.onerror=function(){c()};var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d),d.src=a}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){return function(){var c=a.settings.image_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function e(d){function e(){var a,b,c,d;a=j.find("#width")[0],b=j.find("#height")[0],a&&b&&(c=a.value(),d=b.value(),j.find("#constrain")[0].checked()&&k&&l&&c&&d&&(k!=c?(d=Math.round(c/k*d),b.value(d)):(c=Math.round(d/l*c),a.value(c))),k=c,l=d)}function f(){function b(b){function c(){b.onload=b.onerror=null,a.selection&&(a.selection.select(b),a.nodeChanged())}b.onload=function(){o.width||o.height||!r||p.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),c()},b.onerror=c}i(),e(),o=tinymce.extend(o,j.toJSON()),o.alt||(o.alt=""),""===o.width&&(o.width=null),""===o.height&&(o.height=null),o.style||(o.style=null),o={src:o.src,alt:o.alt,width:o.width,height:o.height,style:o.style,"class":o["class"]},a.undoManager.transact(function(){return o.src?(q?p.setAttribs(q,o):(o.id="__mcenew",a.focus(),a.selection.setContent(p.createHTML("img",o)),q=p.get("__mcenew"),p.setAttrib(q,"id",null)),void b(q)):void(q&&(p.remove(q),a.focus(),a.nodeChanged()))})}function g(a){return a&&(a=a.replace(/px$/,"")),a}function h(c){var d=c.meta||{};if(m&&m.value(a.convertURL(this.value(),"src")),tinymce.each(d,function(a,b){j.find("#"+b).value(a)}),!d.width&&!d.height){var e=this.value(),f=new RegExp("^(?:[a-z]+:)?//","i"),g=a.settings.document_base_url;g&&!f.test(e)&&e.substring(0,g.length)!==g&&this.value(g+e),b(this.value(),function(a){a.width&&a.height&&r&&(k=a.width,l=a.height,j.find("#width").value(k),j.find("#height").value(l))})}}function i(){function b(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a}if(a.settings.image_advtab){var c=j.toJSON(),d=p.parseStyle(c.style);delete d.margin,d["margin-top"]=d["margin-bottom"]=b(c.vspace),d["margin-left"]=d["margin-right"]=b(c.hspace),d["border-width"]=b(c.border),j.find("#style").value(p.serializeStyle(p.parseStyle(p.serializeStyle(d))))}}var j,k,l,m,n,o={},p=a.dom,q=a.selection.getNode(),r=a.settings.image_dimensions!==!1;k=p.getAttrib(q,"width"),l=p.getAttrib(q,"height"),"IMG"!=q.nodeName||q.getAttribute("data-mce-object")||q.getAttribute("data-mce-placeholder")?q=null:o={src:p.getAttrib(q,"src"),alt:p.getAttrib(q,"alt"),"class":p.getAttrib(q,"class"),width:k,height:l},d&&(m={type:"listbox",label:"Image list",values:c(d,function(b){b.value=a.convertURL(b.value||b.url,"src")},[{text:"None",value:""}]),value:o.src&&a.convertURL(o.src,"src"),onselect:function(a){var b=j.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),j.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){m=this}}),a.settings.image_class_list&&(n={name:"class",type:"listbox",label:"Class",values:c(a.settings.image_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"img",classes:[b.value]})})})});var s=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:h},m];a.settings.image_description!==!1&&s.push({name:"alt",type:"textbox",label:"Image description"}),r&&s.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),s.push(n),a.settings.image_advtab?(q&&(o.hspace=g(q.style.marginLeft||q.style.marginRight),o.vspace=g(q.style.marginTop||q.style.marginBottom),o.border=g(q.style.borderWidth),o.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(q,"style")))),j=a.windowManager.open({title:"Insert/edit image",data:o,bodyType:"tabpanel",body:[{title:"General",type:"form",items:s},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:i},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:f})):j=a.windowManager.open({title:"Insert/edit image",data:o,body:s,onSubmit:f})}a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:d(e),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),a.addMenuItem("image",{icon:"image",text:"Insert image",onclick:d(e),context:"insert",prependToContext:!0}),a.addCommand("mceImage",d(e))});
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment