app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js in activeadmin_trumbowyg-0.2.12 vs app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js in activeadmin_trumbowyg-0.2.14

- old
+ new

@@ -1 +1 @@ -!function(e){"use strict";function t(){var e,t=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(t=e.getRangeAt(0).commonAncestorContainer,1!==t.nodeType&&(t=t.parentNode))):(e=document.selection)&&"Control"!==e.type&&(t=e.createRange().parentElement()),t}function r(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function n(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var r=window.getSelection();r.rangeCount>0&&(t=r.getRangeAt(0).startContainer.parentNode)}var n=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;n&&o?e(t).contents().unwrap("code").unwrap("pre"):n?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},da:{preformatted:"Præformateret <pre>"},fr:{preformatted:"Exemple de code <pre>"},hu:{preformatted:"Kód minta <pre>"},it:{preformatted:"Codice <pre>"},ja:{preformatted:"コードサンプル <pre>"},ko:{preformatted:"코드 예제 <pre>"},pt_br:{preformatted:"Exemple de código <pre>"},ru:{preformatted:"Пример кода <pre>"},tr:{preformatted:"Kod örneği <pre>"},zh_cn:{preformatted:"代码示例 <pre>"},zh_tw:{preformatted:"代碼範例 <pre>"}},plugins:{preformatted:{init:function(e){var o={fn:function(){e.saveRange();var o=e.getRangeText();if(""!==o.replace(/\s/g,""))try{var a=t().tagName.toLowerCase();if("code"===a||"pre"===a)return n();e.execCmd("insertHTML","<pre><code>"+r(o)+"</code></pre>")}catch(p){}},tag:"pre"};e.addBtnDef("preformatted",o)}}}})}(jQuery); +!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},da:{preformatted:"Præformateret <pre>"},et:{preformatted:"Eelvormindatud tekst <pre>"},fr:{preformatted:"Exemple de code <pre>"},hu:{preformatted:"Kód minta <pre>"},it:{preformatted:"Codice <pre>"},ja:{preformatted:"コードサンプル <pre>"},ko:{preformatted:"코드 예제 <pre>"},pt_br:{preformatted:"Exemple de código <pre>"},ru:{preformatted:"Пример кода <pre>"},tr:{preformatted:"Kod örneği <pre>"},zh_cn:{preformatted:"代码示例 <pre>"},zh_tw:{preformatted:"代碼範例 <pre>"}},plugins:{preformatted:{init:function(t){var r={fn:function(){t.saveRange();var r,n,o=t.getRangeText();if(""!==o.replace(/\s/g,""))try{var a=function(){var e,t=null;window.getSelection?(e=window.getSelection()).rangeCount&&1!==(t=e.getRangeAt(0).commonAncestorContainer).nodeType&&(t=t.parentNode):(e=document.selection)&&"Control"!==e.type&&(t=e.createRange().parentElement());return t}().tagName.toLowerCase();if("code"===a||"pre"===a)return function(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var r=window.getSelection();r.rangeCount>0&&(t=r.getRangeAt(0).startContainer.parentNode)}var n=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;n&&o?e(t).contents().unwrap("code").unwrap("pre"):n?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}();t.execCmd("insertHTML","<pre><code>"+(r=o,(n=document.createElement("DIV")).innerHTML=r,(n.textContent||n.innerText||"")+"</code></pre>"))}catch(e){}},tag:"pre"};t.addBtnDef("preformatted",r)}}}})}(jQuery); \ No newline at end of file