From c5f867c779b5e281dc762e4fdf935fd9287455a0 Mon Sep 17 00:00:00 2001 From: Stefan Neculai Date: Tue, 6 May 2014 00:00:43 +0300 Subject: [PATCH] Language update. Fixes. --- js/froala_editor.min.js | 8 ++++---- js/langs/ar.js | 6 +++++- js/langs/cs.js | 6 +++++- js/langs/da.js | 6 +++++- js/langs/de.js | 6 +++++- js/langs/en_ca.js | 6 +++++- js/langs/en_gb.js | 6 +++++- js/langs/en_us.js | 6 +++++- js/langs/es.js | 6 +++++- js/langs/fa.js | 6 +++++- js/langs/fi.js | 6 +++++- js/langs/fr.js | 6 +++++- js/langs/hu.js | 6 +++++- js/langs/id.js | 6 +++++- js/langs/it.js | 6 +++++- js/langs/ja.js | 6 +++++- js/langs/ko.js | 6 +++++- js/langs/nb.js | 6 +++++- js/langs/nl.js | 6 +++++- js/langs/pl.js | 6 +++++- js/langs/pt_br.js | 6 +++++- js/langs/pt_pt.js | 6 +++++- js/langs/ro.js | 6 +++++- js/langs/ru.js | 6 +++++- js/langs/sv.js | 6 +++++- js/langs/th.js | 6 +++++- js/langs/tr.js | 6 +++++- js/langs/zh_cn.js | 6 +++++- js/langs/zh_tw.js | 6 +++++- 29 files changed, 144 insertions(+), 32 deletions(-) diff --git a/js/froala_editor.min.js b/js/froala_editor.min.js index ec2b3cfdc..7b94805ae 100644 --- a/js/froala_editor.min.js +++ b/js/froala_editor.min.js @@ -2,7 +2,7 @@ * froala_editor v1.1.4 (http://editor.froala.com) * Copyright 2014-2014 Froala */ -if("undefined"==typeof jQuery)throw new Error("Froala requires jQuery");!function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,a(c).data(),"object"==typeof d&&d),this.browser=b.browser(),this.disabledList=[],this._id=++b.count,this.init(c)};b.count=0,b.VALID_NODES=["P","PRE","BLOCKQUOTE","H1","H2","H3","H4","H5","H6","DIV","LI"],b.COLORS=["#000000","#444444","#666666","#999999","#CCCCCC","#EEEEEE","#F3F3F3","#FFFFFF","#FF0000","#FF9900","#FFFF00","#00FF00","#00FFFF","#0000FF","#9900FF","#FF00FF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#CFE2F3","#D9D2E9","#EAD1DC","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#9FC5E8","#B4A7D6","#D5A6BD","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6FA8DC","#8E7CC3","#C27BA0","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3D85C6","#674EA7","#A64D79","#990000","#B45F06","#BF9000","#38771D","#134F5C","#0B5394","#351C75","#741B47","#660000","#783F04","#7F6000","#274E13","#0C343D","#073763","#201211","#4C1130"],b.image_commands={floatImageLeft:{title:"Float Left",icon:{type:"font",value:"fa fa-align-left"}},floatImageNone:{title:"Float None",icon:{type:"font",value:"fa fa-align-justify"}},floatImageRight:{title:"Float Right",icon:{type:"font",value:"fa fa-align-right"}},linkImage:{title:"Insert Link",icon:{type:"font",value:"fa fa-link"}},replaceImage:{title:"Replace Image",icon:{type:"font",value:"fa fa-exchange"}},removeImage:{title:"Remove Image",icon:{type:"font",value:"fa fa-trash-o"}}},b.commands={bold:{title:"Bold",icon:"fa fa-bold",shortcut:"(Ctrl + B)"},italic:{title:"Italic",icon:"fa fa-italic",shortcut:"(Ctrl + I)"},underline:{cmd:"underline",title:"Underline",icon:"fa fa-underline",shortcut:"(Ctrl + U)"},strikeThrough:{title:"Strikethrough",icon:"fa fa-strikethrough"},fontSize:{title:"Font Size",icon:"fa fa-text-height",seed:[{min:11,max:52}]},color:{icon:"fa fa-font",title:"Color",seed:[{cmd:"backColor",value:b.COLORS,title:"Background Color"},{cmd:"foreColor",value:b.COLORS,title:"Text Color"}]},formatBlock:{title:"Format Block",icon_alt:"¶",seed:[{value:"n",title:"Normal"},{value:"p",title:"Paragraph"},{value:"pre",title:"Code"},{value:"blockquote",title:"Quote"},{value:"h1",title:"Heading 1"},{value:"h2",title:"Heading 2"},{value:"h3",title:"Heading 3"},{value:"h4",title:"Heading 4"},{value:"h5",title:"Heading 5"},{value:"h6",title:"Heading 6"}]},fontFamily:{title:"Font Family",icon_alt:"F"},align:{title:"Alignment",icon:"fa fa-align-center",seed:[{cmd:"justifyLeft",title:"Align Left",icon:"fa fa-align-left"},{cmd:"justifyCenter",title:"Align Center",icon:"fa fa-align-center"},{cmd:"justifyRight",title:"Align Right",icon:"fa fa-align-right"},{cmd:"justifyFull",title:"Justify",icon:"fa fa-align-justify"}]},insertOrderedList:{title:"Numbered List",icon:"fa fa-list-ol"},insertUnorderedList:{title:"Bulleted List",icon:"fa fa-list-ul"},outdent:{title:"Indent Less",icon:"fa fa-dedent",activeless:!0,shortcut:"(Ctrl + <)"},indent:{title:"Indent More",icon:"fa fa-indent",activeless:!0,shortcut:"(Ctrl + >)"},selectAll:{title:"Select All",icon:"fa fa-file-text",shortcut:"(Ctrl + A)"},createLink:{title:"Insert Link",icon:"fa fa-link",shortcut:"(Ctrl + K)"},insertImage:{title:"Insert Image",icon:"fa fa-picture-o",activeless:!0,shortcut:"(Ctrl + P)"},undo:{title:"Undo",icon:"fa fa-undo",activeless:!0,shortcut:"(Ctrl+Z)"},redo:{title:"Redo",icon:"fa fa-repeat",activeless:!0,shortcut:"(Shift+Ctrl+Z)"},html:{title:"Show HTML",icon:"fa fa-code"},save:{title:"Save",icon:"fa fa-floppy-o"},insertVideo:{title:"Insert Video",icon:"fa fa-video-camera"},inserthorizontalrule:{title:"Insert Horizontal Line",icon_alt:"―"}},b.LANGS=[],b.DEFAULTS={autosave:!1,autosaveInterval:1e4,saveURL:null,saveParams:{},blockTags:["n","p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontList:["Arial, Helvetica","Impact, Charcoal","Tahoma, Geneva","Verdana, Geneva","Times New Roman, Times"],borderColor:"#252528",buttons:["bold","italic","underline","strikeThrough","fontSize","color","sep","formatBlock","align","insertOrderedList","insertUnorderedList","outdent","indent","sep","createLink","insertImage","insertVideo","undo","redo","inserthorizontalrule"],crossDomain:!0,direction:"ltr",editorClass:"",enableScript:!1,minHeight:"auto",height:"auto",imageMargin:10,imageParams:{},imageErrorCallback:!1,imageMove:!0,imageUploadParam:"file",imageUploadURL:"http://i.froala.com/upload",imageButtons:["floatImageLeft","floatImageNone","floatImageRight","linkImage","replaceImage","removeImage"],maxImageSize:10485760,defaultImageWidth:300,allowedImageTypes:["jpeg","jpg","png","gif"],inverseSkin:!1,inlineMode:!0,paragraphy:!0,placeholder:"Type something",shortcuts:!0,customText:!1,spellcheck:!1,toolbarFixed:!0,typingTimer:150,width:"auto",language:"en_us",customButtons:[],alwaysVisible:!1,noFollow:!0,alwaysBlank:!1,plainPaste:!1,icons:{},textNearImage:!0,zIndex:1e3,mediaManager:!0,preloaderSrc:"../img/preloader.gif",imagesLoadURL:"http://i.froala.com/images",imagesLoadParams:{},imageDeleteURL:null,imageDeleteParams:{}},b.hexToRGB=function(a){var b=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;a=a.replace(b,function(a,b,c,d){return b+b+c+c+d+d});var c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return c?{r:parseInt(c[1],16),g:parseInt(c[2],16),b:parseInt(c[3],16)}:null},b.hexToRGBString=function(a){var b=this.hexToRGB(a);return"rgb("+b.r+", "+b.g+", "+b.b+")"},b.getIEversion=function(){var a,b,c=-1;return"Microsoft Internet Explorer"==navigator.appName?(a=navigator.userAgent,b=new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})"),null!==b.exec(a)&&(c=parseFloat(RegExp.$1))):"Netscape"==navigator.appName&&(a=navigator.userAgent,b=new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})"),null!==b.exec(a)&&(c=parseFloat(RegExp.$1))),c},b.browser=function(){var a={};if(b.getIEversion()>0)a.msie=!0;else{var c=navigator.userAgent.toLowerCase(),d=/(chrome)[ \/]([\w.]+)/.exec(c)||/(webkit)[ \/]([\w.]+)/.exec(c)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(c)||/(msie) ([\w.]+)/.exec(c)||c.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(c)||[],e={browser:d[1]||"",version:d[2]||"0"};d[1]&&(a[e.browser]=!0),parseInt(e.version,10)<9&&a.msie&&(a.oldMsie=!0),a.chrome?a.webkit=!0:a.webkit&&(a.safari=!0)}return a},b.prototype.text=function(){var a="";return window.getSelection?a=window.getSelection():document.getSelection?a=document.getSelection():document.selection&&(a=document.selection.createRange().text),a.toString()},b.prototype.selectionInEditor=function(){var b=this.getSelectionParent(),c=!1;return b==this.$element.get(0)&&(c=!0),c===!1&&a(b).parents().each(a.proxy(function(a,b){b==this.$element.get(0)&&(c=!0)},this)),c},b.prototype.getSelection=function(){var a="";return a=window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange()},b.prototype.getRange=function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount)return a.getRangeAt(0)}return document.createRange()},b.prototype.clearSelection=function(){if(window.getSelection){var a=window.getSelection();a.removeAllRanges()}else document.selection.createRange&&(document.selection.createRange(),document.selection.empty())},b.prototype.getSelectionElement=function(){var b=this.getSelection();if(b.rangeCount){var c=b.getRangeAt(0).startContainer;return 1!=c.nodeType&&(c=c.parentNode),a(c).children().length>0&&a(a(c).children()[0]).text()==this.text()&&(c=a(c).children()[0]),c}return this.$element.get(0)},b.prototype.getSelectionParent=function(){var b,c=null;return window.getSelection?(b=window.getSelection(),b.rangeCount&&(c=b.getRangeAt(0).commonAncestorContainer,1!=c.nodeType&&(c=c.parentNode))):(b=document.selection)&&"Control"!=b.type&&(c=b.createRange().parentElement()),null!=c&&(a.inArray(this.$element.get(0),a(c).parents())>=0||c==this.$element.get(0))?c:null},b.prototype.nodeInRange=function(a,b){var c;if(a.intersectsNode)return a.intersectsNode(b);c=b.ownerDocument.createRange();try{c.selectNode(b)}catch(d){c.selectNodeContents(b)}return-1==a.compareBoundaryPoints(Range.END_TO_START,c)&&1==a.compareBoundaryPoints(Range.START_TO_END,c)},b.prototype.getElementFromNode=function(c){for(1!=c.nodeType&&(c=c.parentNode);null!==c&&b.VALID_NODES.indexOf(c.tagName)<0;)c=c.parentNode;return null!=c&&"LI"==c.tagName&&a(c).find(b.VALID_NODES.join()).length>0?null:a.makeArray(a(c).parents()).indexOf(this.$element.get(0))>=0?c:null},b.prototype.nextNode=function(a){if(a.hasChildNodes())return a.firstChild;for(;a&&!a.nextSibling;)a=a.parentNode;return a?a.nextSibling:null},b.prototype.getRangeSelectedNodes=function(a){var b=a.startContainer,c=a.endContainer;if(b==c)return[b];for(var d=[];b&&b!=c;)d.push(b=this.nextNode(b));for(b=a.startContainer;b&&b!=a.commonAncestorContainer;)d.unshift(b),b=b.parentNode;return d},b.prototype.getSelectedNodes=function(){if(window.getSelection){var a=window.getSelection();if(!a.isCollapsed)return this.getRangeSelectedNodes(a.getRangeAt(0));if(this.selectionInEditor()){var b=a.getRangeAt(0).startContainer;return 3==b.nodeType?[b.parentNode]:[b]}}return[]},b.prototype.getSelectionElements=function(){var b=this.getSelectedNodes(),c=[];return a.each(b,a.proxy(function(a,b){if(null!==b){var d=this.getElementFromNode(b);c.indexOf(d)<0&&d!=this.$element.get(0)&&null!==d&&c.push(d)}},this)),0===c.length&&c.push(this.$element.get(0)),c},b.prototype.getSelectionLink=function(){var a,b=null;return window.getSelection?(a=window.getSelection(),b=1!==a.anchorNode.nodeType?a.anchorNode.parentNode.parentNode.href:a.anchorNode.parentNode.href):(a=document.selection)&&"Control"!=a.type&&(b=a.createRange().parentElement().href),void 0===b?null:b},b.prototype.saveSelection=function(){var a,b,c,d=this.getSelection();if(d.getRangeAt&&d.rangeCount){for(c=[],a=0,b=d.rangeCount;b>a;a+=1)c.push(d.getRangeAt(a));this.savedRanges=c}else this.savedRanges=null},b.prototype.restoreSelection=function(){var a,b,c=this.getSelection();if(this.savedRanges)for(c.removeAllRanges(),a=0,b=this.savedRanges.length;b>a;a+=1)c.addRange(this.savedRanges[a])},b.prototype.saveSelectionByMarkers=function(){var a=this.getRange();this.placeMarker(a,!0),this.placeMarker(a,!1)},b.prototype.restoreSelectionByMarkers=function(){var a=this.$element.find("#marker-true"),b=this.$element.find("#marker-false");return a.length&&b.length?(this.$element.removeAttr("contentEditable"),this.$element.focus(),this.setSelection(a[0],0,b[0],0),this.removeMarkers(),this.$element.attr("contentEditable",!0),void this.$element.focus()):!1},b.prototype.setSelection=function(a,b,c,d){try{null===c&&(c=a),null===d&&(d=b);var e=this.getSelection();if(!e)return;var f=this.getRange();f.setStart(a,b),f.setEnd(c,d),e.removeAllRanges(),e.addRange(f)}catch(g){}},b.prototype.placeMarker=function(b,c){try{var d=b.cloneRange();d.collapse(c),d.insertNode(a('',document)[0]),d.detach()}catch(e){}},b.prototype.removeMarkers=function(){this.$element.find("#marker-true, #marker-false").removeAttr("id")},b.prototype.getBoundingRect=function(){var b;if(this.browser.mozilla){b={},this.saveSelectionByMarkers();var c=this.$element.find("#marker-true"),d=this.$element.find("#marker-false");b.left=c.offset().left-a(window).scrollLeft(),b.top=c.offset().top-a(window).scrollTop(),b.width=Math.abs(d.offset().left-c.offset().left),b.height=d.offset().top-c.offset().top+d.get(0).getBoundingClientRect().height,b.right=1,b.bottom=1,this.restoreSelectionByMarkers()}else b=this.getRange().getBoundingClientRect();return b},b.prototype.repositionEditor=function(b){var c,d,e;(this.options.inlineMode||b)&&(c=this.getBoundingRect(),c.left>0&&c.top>0&&c.right>0&&c.bottom>0?(d=c.left+c.width/2+a(window).scrollLeft(),e=c.top+c.height+a(window).scrollTop(),this.isTouch()&&(d=c.left+c.width/2,e=c.top+c.height),this.showByCoordinates(d,e)):this.options.alwaysVisible?this.hide():(document.execCommand("selectAll"),c=this.getBoundingRect(),d=c.left+a(window).scrollLeft(),e=c.top+c.height+a(window).scrollTop(),this.isTouch()&&(d=c.left,e=c.top+c.height),this.showByCoordinates(d,e-20),this.getRange().collapse(!1)))},b.prototype.destroy=function(){this.sync(),this.$editor.remove(),this.$popup_editor&&this.$popup_editor.remove(),this.$overlay&&this.$overlay.remove(),this.$image_modal&&this.$image_modal.remove(),this.$element.replaceWith(this.getHTML()),this.$box.removeClass("froala-box"),this.$box.find(".html-switch").remove(),this.$box.removeData("fa.editable"),clearTimeout(this.typingTimer),clearTimeout(this.ajaxInterval),this.$element.off("mousedown mouseup click keydown keyup keypress touchstart touchend touch drop","**"),void 0!==this.$upload_frame&&this.$upload_frame.remove(),this.$textarea&&(this.$box.remove(),this.$textarea.removeData("fa.editable"),this.$textarea.show())},b.prototype.callback=function(b,c,d){var e=b+"Callback",f=!0;return this.options[e]&&a.isFunction(this.options[e])&&(f=c?this.options[e].apply(this,c):this.options[e].call(this)),void 0===d&&this.sync(),void 0==f?!0:f},b.prototype.html5Compliant=function(b){b.find("b").each(function(b,c){a(c).replaceWith(""+a(c).html()+"")}),b.find("i:not(.fa)").each(function(b,c){a(c).replaceWith(""+a(c).html()+"")})},b.prototype.syncClean=function(b,c){var d="span:empty";for(c&&(d="span:empty:not(#marker-true):not(#marker-false)");b.find(d).length;)b.find(d).remove();b.find("*").each(a.proxy(function(b,d){this.emptyElement(d)&&"SPAN"==d.tagName&&(void 0===c?a(d).remove():"marker-true"!=a(d).attr("id")&&"marker-false"!=a(d).attr("id")&&a(d).remove())},this)),b.find("a").addClass("f-link"),b.find("img").each(function(b,c){0===a(c).parents(".f-img-wrap").length&&(a(c).parents("a").length>0?a(a(c).parents("a")[0]).wrap(''):a(c).wrap(''))})},b.prototype.sync=function(){this.restoreSelectionByMarkers(),this.syncClean(this.$element),this.disableImageResize(),this.$element.trigger("placeholderCheck"),this.trackHTML!==this.getHTML()&&(this.callback("contentChanged",[],!1),this.refreshImageList(),this.trackHTML=this.getHTML()),this.$textarea&&this.$textarea.val(this.getHTML())},b.prototype.emptyElement=function(b){if("IMG"==b.tagName||a(b).find("img").length>0)return!1;for(var c=a(b).text(),d=0;d'),a(this).after(''),b.restoreSelectionByMarkers(),b.exec("createLink"),b.$link_wrapper.find('input[type="text"]').val(a(this).attr("href")),b.$link_wrapper.find('input[type="checkbox"]').prop("checked","_blank"==a(this).attr("target")),WYSIWYGModernizr.mq("(max-device-width: 320px) and (-webkit-min-device-pixel-ratio: 2)")?b.showByCoordinates(a(this).offset().left+a(this).width()/2,a(this).offset().top+a(this).height()):b.repositionEditor(!0),b.$popup_editor.show()})},b.prototype.imageHandle=function(){var b=this,c=a("").addClass("f-img-handle").on({movestart:function(c){b.hide(),b.$element.addClass("f-non-selectable").removeAttr("contenteditable"),b.isResizing=!0,a(this).attr("data-start-x",c.startX),a(this).attr("data-start-y",c.startY)},move:function(b){var c=a(this),d=b.pageX-parseInt(c.attr("data-start-x"),10);c.attr("data-start-x",b.pageX),c.attr("data-start-y",b.pageY);var e=c.prevAll("img");c.hasClass("f-h-ne")||c.hasClass("f-h-se")?e.attr("width",e.width()+d):e.attr("width",e.width()-d)},moveend:function(){if(b.isResizing=!1,a(this).removeAttr("data-start-x"),a(this).removeAttr("data-start-y"),b.$element.removeClass("f-non-selectable").attr("contenteditable",!0),b.browser.mozilla)try{document.execCommand("enableObjectResizing",!1,!1),document.execCommand("enableInlineTableEditing",!1,!1)}catch(c){}b.sync()}});return c},b.prototype.disableImageResize=function(){if(this.browser.mozilla)try{document.execCommand("enableObjectResizing",!1,!1),document.execCommand("enableInlineTableEditing",!1,!1)}catch(a){}},b.prototype.initImageResizer=function(){this.disableImageResize();var b=this;this.$element.on("mousedown","img",function(){b.imageHTML=b.getHTML(),!b.options.imageMove||b.browser.msie?b.$element.attr("contenteditable",!1):(a(this).parents(".f-img-wrap").removeAttr("contenteditable"),a(this).parent().hasClass("f-img-editor")&&(b.closeImageMode(),b.hide()))}),this.$element.find("img").each(function(a,b){b.oncontrolselect=function(){return!1}}),this.$element.on("mouseup","img",function(){b.options.imageMove||b.$element.attr("contenteditable",!0),a(this).parents(".f-img-wrap").attr("contenteditable","false")}),this.$element.on("click touchend","img",function(c){c.preventDefault(),c.stopPropagation(),b.$element.blur(),b.$image_editor.find("button").removeClass("active");var d=a(this).css("float");b.$image_editor.find('button[data-cmd="floatImage'+d.charAt(0).toUpperCase()+d.slice(1)+'"]').addClass("active"),b.$image_editor.find('.f-image-alt input[type="text"]').val(a(this).attr("alt")||a(this).attr("title")),b.showImageEditor(),a(this).parent().hasClass("f-img-editor")&&"SPAN"==a(this).parent().get(0).tagName||(a(this).wrap(''),a(this).css("margin-left","auto"),a(this).css("margin-right","auto"),a(this).css("margin-bottom","auto"),a(this).css("margin-top","auto"),0===a(this).parents(".f-img-wrap").length&&(a(this).parent().wrap(''),a(this).parents(".f-img-wrap").attr("contenteditable",!1)));var e=b.imageHandle();a(this).parent().append(e.clone(!0).addClass("f-h-ne")),a(this).parent().append(e.clone(!0).addClass("f-h-se")),a(this).parent().append(e.clone(!0).addClass("f-h-sw")),a(this).parent().append(e.clone(!0).addClass("f-h-nw")),b.clearSelection(),b.showByCoordinates(a(this).offset().left+a(this).width()/2,a(this).offset().top+a(this).height()),b.imageMode=!0}),this.$element.find("img").each(function(a,b){b.oncontrolselect=function(){return!1}})},b.prototype.initImagePopup=function(){this.$image_editor=a("
").addClass("bttn-wrapper f-image-editor");for(var c in this.options.imageButtons){var d=this.options.imageButtons[c];if(void 0!==b.image_commands[d]){var e=b.image_commands[d],f=a("