WordPress.org

Make WordPress Core

Changeset 27387


Ignore:
Timestamp:
03/04/2014 01:56:57 AM (5 years ago)
Author:
azaozz
Message:

TinyMCE: update to 4.0.18, see #24067

Location:
trunk
Files:
1 deleted
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js

    r27179 r27387  
    295295            for (x = 0; x < width; x++) {
    296296                var chr = charmap[y * width + x];
    297                 var id = 'g' + (y * width + x);
    298 
    299                 gridHtml += '<td title="' + chr[1] + '"><div id="' + id + '" tabIndex="-1">' +
     297
     298                gridHtml += '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button">' +
    300299                    (chr ? String.fromCharCode(parseInt(chr[0], 10)) : '&nbsp;') + '</div></td>';
    301300            }
     
    311310            onclick: function(e) {
    312311                var target = e.target;
    313                 if (target.nodeName == 'DIV') {
    314                     editor.execCommand('mceInsertContent', false, target.firstChild.nodeValue);
    315                     // WP, see #27107
    316                     if ( ! e.ctrlKey ) {
     312                if (/^(TD|DIV)$/.test(target.nodeName)) {
     313                    editor.execCommand('mceInsertContent', false, tinymce.trim(target.innerText || target.textContent));
     314
     315                    if (!e.ctrlKey) {
    317316                        win.close();
    318317                    }
     
    344343                }
    345344            ],
    346             buttons: [
    347                 /* WP, see #27107
    348                 {text: "Close", onclick: function() {
    349                     win.close();
    350                 }} */
    351             ]
     345            buttons: [] // WP, see #27107
    352346        });
    353347    }
  • trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js

    r27179 r27387  
    1 tinymce.PluginManager.add("charmap",function(a){function b(){function b(a){for(;a;){if("TD"==a.nodeName)return a;a=a.parentNode}}var d,e,f,g;d='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var h=25;for(f=0;10>f;f++){for(d+="<tr>",e=0;h>e;e++){var i=c[f*h+e],j="g"+(f*h+e);d+='<td title="'+i[1]+'"><div id="'+j+'" tabIndex="-1">'+(i?String.fromCharCode(parseInt(i[0],10)):"&nbsp;")+"</div></td>"}d+="</tr>"}d+="</tbody></table>";var k={type:"container",html:d,onclick:function(b){var c=b.target;"DIV"==c.nodeName&&(a.execCommand("mceInsertContent",!1,c.firstChild.nodeValue),b.ctrlKey||g.close())},onmouseover:function(a){var c=b(a.target);c&&g.find("#preview").text(c.firstChild.firstChild.data)}};g=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[k,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[]})}var c=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];a.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:b}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:b,context:"insert"})});
     1tinymce.PluginManager.add("charmap",function(a){function b(){function b(a){for(;a;){if("TD"==a.nodeName)return a;a=a.parentNode}}var d,e,f,g;d='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var h=25;for(f=0;10>f;f++){for(d+="<tr>",e=0;h>e;e++){var i=c[f*h+e];d+='<td title="'+i[1]+'"><div tabindex="-1" title="'+i[1]+'" role="button">'+(i?String.fromCharCode(parseInt(i[0],10)):"&nbsp;")+"</div></td>"}d+="</tr>"}d+="</tbody></table>";var j={type:"container",html:d,onclick:function(b){var c=b.target;/^(TD|DIV)$/.test(c.nodeName)&&(a.execCommand("mceInsertContent",!1,tinymce.trim(c.innerText||c.textContent)),b.ctrlKey||g.close())},onmouseover:function(a){var c=b(a.target);c&&g.find("#preview").text(c.firstChild.firstChild.data)}};g=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[j,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[]})}var c=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];a.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:b}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:b,context:"insert"})});
  • trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js

    r27060 r27387  
    227227
    228228            if ( settings.title ) {
     229                // WP
    229230                string = (editor.settings.language || "en") + "." + settings.title;
    230231                translated = tinymce.i18n.translate(string);
     
    233234                    settings.title = translated;
    234235                }
     236                // WP end
    235237            }
    236238
  • trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js

    r27060 r27387  
    6060    function showDialog(imageList) {
    6161        var win, data = {}, dom = editor.dom, imgElm = editor.selection.getNode();
    62         var width, height, imageListCtrl;
     62        var width, height, imageListCtrl, classListCtrl;
     63
     64        function buildValues(listSettingName, dataItemName, defaultItems) {
     65            var selectedItem, items = [];
     66
     67            tinymce.each(editor.settings[listSettingName] || defaultItems, function(target) {
     68                var item = {
     69                    text: target.text || target.title,
     70                    value: target.value
     71                };
     72
     73                items.push(item);
     74
     75                if (data[dataItemName] === target.value || (!selectedItem && target.selected)) {
     76                    selectedItem = item;
     77                }
     78            });
     79
     80            if (selectedItem && !data[dataItemName]) {
     81                data[dataItemName] = selectedItem.value;
     82                selectedItem.selected = true;
     83            }
     84
     85            return items;
     86        }
    6387
    6488        function buildImageList() {
     
    126150            recalcSize();
    127151
    128             var data = win.toJSON();
     152            data = tinymce.extend(data, win.toJSON());
    129153            var caption = data.caption; // WP
    130154
     
    146170                width: data.width,
    147171                height: data.height,
    148                 style: data.style
     172                style: data.style,
     173                "class": data["class"]
    149174            };
     175
     176            if (!data["class"]) {
     177                delete data["class"];
     178            }
    150179
    151180            editor.undoManager.transact(function() {
     
    164193                    if (imgElm) {
    165194                        dom.remove(imgElm);
     195                        editor.focus();
    166196                        editor.nodeChanged();
    167197                    }
     
    215245                src: dom.getAttrib(imgElm, 'src'),
    216246                alt: dom.getAttrib(imgElm, 'alt'),
     247                "class": dom.getAttrib(imgElm, 'class'),
    217248                width: width,
    218249                height: height
     
    243274                    imageListCtrl = this;
    244275                }
     276            };
     277        }
     278
     279        if (editor.settings.image_class_list) {
     280            classListCtrl = {
     281                name: 'class',
     282                type: 'listbox',
     283                label: 'Class',
     284                values: buildValues('image_class_list', 'class')
    245285            };
    246286        }
     
    259299                spacing: 5,
    260300                items: [
    261                     {name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize},
     301                    {name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Width'},
    262302                    {type: 'label', text: 'x'},
    263                     {name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize},
     303                    {name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Height'},
    264304                    {name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'}
    265305                ]
    266             }
     306            },
     307            classListCtrl
    267308        ];
    268309
  • trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js

    r27060 r27387  
    1 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(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))}}):b(c)}}function d(c){function d(){var b=[{text:"None",value:""}];return tinymce.each(c,function(c){b.push({text:c.text||c.title,value:a.convertURL(c.value||c.url,"src"),menu:c.menu})}),b}function e(){var a,b,c,d;a=j.find("#width")[0],b=j.find("#height")[0],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 d(){b.onload=b.onerror=null,a.selection.select(b),a.nodeChanged()}b.onload=function(){c.width||c.height||(o.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),a.fire("wpNewImageRefresh",{node:b})),d()},b.onerror=d}i(),e();var c=j.toJSON(),d=c.caption;""===c.width&&(c.width=null),""===c.height&&(c.height=null),""===c.style&&(c.style=null),c={src:c.src,alt:c.alt,width:c.width,height:c.height,style:c.style},a.undoManager.transact(function(){var e={node:p,data:c,caption:d};return a.fire("wpImageFormSubmit",{imgData:e}),e.cancel?void b(e.node):c.src?(p?o.setAttribs(p,c):(c.id="__mcenew",a.focus(),a.selection.setContent(o.createHTML("img",c)),p=o.get("__mcenew"),o.setAttrib(p,"id",null)),void b(p)):void(p&&(o.remove(p),a.nodeChanged()))})}function g(a){return a&&(a=a.replace(/px$/,"")),a}function h(){m&&m.value(a.convertURL(this.value(),"src")),b(this.value(),function(a){a.width&&a.height&&(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=o.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(o.serializeStyle(o.parseStyle(o.serializeStyle(d))))}}var j,k,l,m,n={},o=a.dom,p=a.selection.getNode();k=o.getAttrib(p,"width"),l=o.getAttrib(p,"height"),"IMG"!=p.nodeName||p.getAttribute("data-mce-object")||p.getAttribute("data-mce-placeholder")?p=null:(n={src:o.getAttrib(p,"src"),alt:o.getAttrib(p,"alt"),width:k,height:l},a.fire("wpLoadImageData",{imgData:{data:n,node:p}})),c&&(m={type:"listbox",label:"Image list",values:d(),value:n.src&&a.convertURL(n.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())},onPostRender:function(){m=this}});var q=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:h},m,{name:"alt",type:"textbox",label:"Image description"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:e},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:e},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}];a.fire("wpLoadImageForm",{data:q}),a.settings.image_advtab?(p&&(n.hspace=g(p.style.marginLeft||p.style.marginRight),n.vspace=g(p.style.marginTop||p.style.marginBottom),n.border=g(p.style.borderWidth),n.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(p,"style")))),j=a.windowManager.open({title:"Insert/edit image",data:n,bodyType:"tabpanel",body:[{title:"General",type:"form",items:q},{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:n,body:q,onSubmit:f})}a.addCommand("mceImage",function(){c(d)()}),a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:c(d),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),a.addMenuItem("image",{icon:"image",text:"Insert image",onclick:c(d),context:"insert",prependToContext:!0})});
     1tinymce.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(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))}}):b(c)}}function d(c){function d(b,c,d){var e,f=[];return tinymce.each(a.settings[b]||d,function(a){var b={text:a.text||a.title,value:a.value};f.push(b),(p[c]===a.value||!e&&a.selected)&&(e=b)}),e&&!p[c]&&(p[c]=e.value,e.selected=!0),f}function e(){var b=[{text:"None",value:""}];return tinymce.each(c,function(c){b.push({text:c.text||c.title,value:a.convertURL(c.value||c.url,"src"),menu:c.menu})}),b}function f(){var a,b,c,d;a=k.find("#width")[0],b=k.find("#height")[0],c=a.value(),d=b.value(),k.find("#constrain")[0].checked()&&l&&m&&c&&d&&(l!=c?(d=Math.round(c/l*d),b.value(d)):(c=Math.round(d/m*c),a.value(c))),l=c,m=d}function g(){function b(b){function c(){b.onload=b.onerror=null,a.selection.select(b),a.nodeChanged()}b.onload=function(){p.width||p.height||(q.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),a.fire("wpNewImageRefresh",{node:b})),c()},b.onerror=c}j(),f(),p=tinymce.extend(p,k.toJSON());var c=p.caption;""===p.width&&(p.width=null),""===p.height&&(p.height=null),""===p.style&&(p.style=null),p={src:p.src,alt:p.alt,width:p.width,height:p.height,style:p.style,"class":p["class"]},p["class"]||delete p["class"],a.undoManager.transact(function(){var d={node:r,data:p,caption:c};return a.fire("wpImageFormSubmit",{imgData:d}),d.cancel?void b(d.node):p.src?(r?q.setAttribs(r,p):(p.id="__mcenew",a.focus(),a.selection.setContent(q.createHTML("img",p)),r=q.get("__mcenew"),q.setAttrib(r,"id",null)),void b(r)):void(r&&(q.remove(r),a.focus(),a.nodeChanged()))})}function h(a){return a&&(a=a.replace(/px$/,"")),a}function i(){n&&n.value(a.convertURL(this.value(),"src")),b(this.value(),function(a){a.width&&a.height&&(l=a.width,m=a.height,k.find("#width").value(l),k.find("#height").value(m))})}function j(){function b(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a}if(a.settings.image_advtab){var c=k.toJSON(),d=q.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),k.find("#style").value(q.serializeStyle(q.parseStyle(q.serializeStyle(d))))}}var k,l,m,n,o,p={},q=a.dom,r=a.selection.getNode();l=q.getAttrib(r,"width"),m=q.getAttrib(r,"height"),"IMG"!=r.nodeName||r.getAttribute("data-mce-object")||r.getAttribute("data-mce-placeholder")?r=null:(p={src:q.getAttrib(r,"src"),alt:q.getAttrib(r,"alt"),"class":q.getAttrib(r,"class"),width:l,height:m},a.fire("wpLoadImageData",{imgData:{data:p,node:r}})),c&&(n={type:"listbox",label:"Image list",values:e(),value:p.src&&a.convertURL(p.src,"src"),onselect:function(a){var b=k.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),k.find("#src").value(a.control.value())},onPostRender:function(){n=this}}),a.settings.image_class_list&&(o={name:"class",type:"listbox",label:"Class",values:d("image_class_list","class")});var s=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:i},n,{name:"alt",type:"textbox",label:"Image description"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:f,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:f,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]},o];a.fire("wpLoadImageForm",{data:s}),a.settings.image_advtab?(r&&(p.hspace=h(r.style.marginLeft||r.style.marginRight),p.vspace=h(r.style.marginTop||r.style.marginBottom),p.border=h(r.style.borderWidth),p.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(r,"style")))),k=a.windowManager.open({title:"Insert/edit image",data:p,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:j},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:g})):k=a.windowManager.open({title:"Insert/edit image",data:p,body:s,onSubmit:g})}a.addCommand("mceImage",function(){c(d)()}),a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:c(d),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),a.addMenuItem("image",{icon:"image",text:"Insert image",onclick:c(d),context:"insert",prependToContext:!0})});
  • trunk/src/wp-includes/js/tinymce/plugins/link/plugin.js

    r27060 r27387  
    3131    function showDialog(linkList) {
    3232        var data = {}, selection = editor.selection, dom = editor.dom, selectedElm, anchorElm, initialText;
    33         var win, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl;
     33        var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl;
    3434
    3535        function linkListChangeHandler(e) {
     
    5757        }
    5858
    59         function buildRelList(relValue) {
    60             var relListItems = [{text: 'None', value: ''}];
    61 
    62             tinymce.each(editor.settings.rel_list, function(rel) {
    63                 relListItems.push({
    64                     text: rel.text || rel.title,
    65                     value: rel.value,
    66                     selected: relValue === rel.value
    67                 });
     59        function buildValues(listSettingName, dataItemName, defaultItems) {
     60            var selectedItem, items = [];
     61
     62            tinymce.each(editor.settings[listSettingName] || defaultItems, function(target) {
     63                var item = {
     64                    text: target.text || target.title,
     65                    value: target.value
     66                };
     67
     68                items.push(item);
     69
     70                if (data[dataItemName] === target.value || (!selectedItem && target.selected)) {
     71                    selectedItem = item;
     72                }
    6873            });
    6974
    70             return relListItems;
    71         }
    72 
    73         function buildTargetList(targetValue) {
    74             var targetListItems = [];
    75 
    76             if (!editor.settings.target_list) {
    77                 targetListItems.push({text: 'None', value: ''});
    78                 targetListItems.push({text: 'New window', value: '_blank'});
    79             }
    80 
    81             tinymce.each(editor.settings.target_list, function(target) {
    82                 targetListItems.push({
    83                     text: target.text || target.title,
    84                     value: target.value,
    85                     selected: targetValue === target.value
    86                 });
    87             });
    88 
    89             return targetListItems;
     75            if (selectedItem && !data[dataItemName]) {
     76                data[dataItemName] = selectedItem.value;
     77                selectedItem.selected = true;
     78            }
     79
     80            return items;
    9081        }
    9182
     
    128119        }
    129120
     121        function isOnlyTextSelected(anchorElm) {
     122            var html = selection.getContent();
     123
     124            // Partial html and not a fully selected anchor element
     125            if (/</.test(html) && (!/^<a [^>]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') == -1)) {
     126                return false;
     127            }
     128
     129            if (anchorElm) {
     130                var nodes = anchorElm.childNodes, i;
     131
     132                if (nodes.length === 0) {
     133                    return false;
     134                }
     135
     136                for (i = nodes.length - 1; i >= 0; i--) {
     137                    if (nodes[i].nodeType != 3) {
     138                        return false;
     139                    }
     140                }
     141            }
     142
     143            return true;
     144        }
     145
    130146        selectedElm = selection.getNode();
    131147        anchorElm = dom.getParent(selectedElm, 'a[href]');
    132 
    133         var onlyText = true;
    134         if (/</.test(selection.getContent())) {
    135             onlyText = false;
    136         } else if (anchorElm) {
    137             var nodes = anchorElm.childNodes, i;
    138             if (nodes.length === 0) {
    139                 onlyText = false;
    140             } else {
    141                 for (i = nodes.length - 1; i >= 0; i--) {
    142                     if (nodes[i].nodeType != 3) {
    143                         onlyText = false;
    144                         break;
    145                     }
    146                 }
    147             }
    148         }
     148        onlyText = isOnlyTextSelected();
    149149
    150150        data.text = initialText = anchorElm ? (anchorElm.innerText || anchorElm.textContent) : selection.getContent({format: 'text'});
    151151        data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : '';
    152         data.target = anchorElm ? dom.getAttrib(anchorElm, 'target') : (editor.settings.default_link_target || '');
    153         data.rel = anchorElm ? dom.getAttrib(anchorElm, 'rel') : '';
     152        data.target = anchorElm ? dom.getAttrib(anchorElm, 'target') : (editor.settings.default_link_target || null);
     153        data.rel = anchorElm ? dom.getAttrib(anchorElm, 'rel') : null;
     154        data['class'] = anchorElm ? dom.getAttrib(anchorElm, 'class') : null;
    154155
    155156        if (onlyText) {
     
    183184                type: 'listbox',
    184185                label: 'Target',
    185                 values: buildTargetList(data.target)
     186                values: buildValues('target_list', 'target', [{text: 'None', value: ''}, {text: 'New window', value: '_blank'}])
    186187            };
    187188        }
     
    192193                type: 'listbox',
    193194                label: 'Rel',
    194                 values: buildRelList(data.rel)
     195                values: buildValues('rel_list', 'rel', [{text: 'None', value: ''}])
     196            };
     197        }
     198
     199        if (editor.settings.link_class_list) {
     200            classListCtrl = {
     201                name: 'class',
     202                type: 'listbox',
     203                label: 'Class',
     204                values: buildValues('link_class_list', 'class')
    195205            };
    196206        }
     
    214224                linkListCtrl,
    215225                relListCtrl,
    216                 targetListCtrl
     226                targetListCtrl,
     227                classListCtrl
    217228            ],
    218229            onSubmit: function(e) {
    219                 var data = e.data, href = data.href;
     230                var href;
     231
     232                data = tinymce.extend(data, e.data);
     233                href = data.href;
    220234
    221235                // Delay confirm since onSubmit will move focus
     
    242256                            href: href,
    243257                            target: data.target ? data.target : null,
    244                             rel: data.rel ? data.rel : null
     258                            rel: data.rel ? data.rel : null,
     259                            "class": data["class"] ? data["class"] : null
    245260                        });
    246261
     
    252267                                href: href,
    253268                                target: data.target ? data.target : null,
    254                                 rel: data.rel ? data.rel : null
     269                                rel: data.rel ? data.rel : null,
     270                                "class": data["class"] ? data["class"] : null
    255271                            }, dom.encode(data.text)));
    256272                        } else {
  • trunk/src/wp-includes/js/tinymce/plugins/link/plugin.min.js

    r27060 r27387  
    1 tinymce.PluginManager.add("link",function(e){function t(t){return function(){var n=e.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n)}}function n(t){function n(e){var t=f.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),f.find("#href").value(e.control.value())}function l(){var n=[{text:"None",value:""}];return tinymce.each(t,function(t){n.push({text:t.text||t.title,value:e.convertURL(t.value||t.url,"href"),menu:t.menu})}),n}function i(t){var n=[{text:"None",value:""}];return tinymce.each(e.settings.rel_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function r(t){var n=[];return e.settings.target_list||(n.push({text:"None",value:""}),n.push({text:"New window",value:"_blank"})),tinymce.each(e.settings.target_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function a(t){var l=[];return tinymce.each(e.dom.select("a:not([href])"),function(e){var n=e.name||e.id;n&&l.push({text:n,value:"#"+n,selected:-1!=t.indexOf("#"+n)})}),l.length?(l.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:l,onselect:n}):void 0}function o(){h&&h.value(e.convertURL(this.value(),"href")),!c&&0===x.text.length&&k&&this.parent().parent().find("#text")[0].value(this.value())}var u,s,c,f,d,h,v,g,x={},m=e.selection,p=e.dom;u=m.getNode(),s=p.getParent(u,"a[href]");var k=!0;if(/</.test(m.getContent()))k=!1;else if(s){var y,b=s.childNodes;if(0===b.length)k=!1;else for(y=b.length-1;y>=0;y--)if(3!=b[y].nodeType){k=!1;break}}x.text=c=s?s.innerText||s.textContent:m.getContent({format:"text"}),x.href=s?p.getAttrib(s,"href"):"",x.target=s?p.getAttrib(s,"target"):e.settings.default_link_target||"",x.rel=s?p.getAttrib(s,"rel"):"",k&&(d={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){x.text=this.value()}}),t&&(h={type:"listbox",label:"Link list",values:l(),onselect:n,value:e.convertURL(x.href,"href"),onPostRender:function(){h=this}}),e.settings.target_list!==!1&&(g={name:"target",type:"listbox",label:"Target",values:r(x.target)}),e.settings.rel_list&&(v={name:"rel",type:"listbox",label:"Rel",values:i(x.rel)}),f=e.windowManager.open({title:"Insert link",data:x,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:o,onkeyup:o},d,a(x.href),h,v,g],onSubmit:function(t){function n(t,n){var l=e.selection.getRng();window.setTimeout(function(){e.windowManager.confirm(t,function(t){e.selection.setRng(l),n(t)})},0)}function l(){s?(e.focus(),k&&i.text!=c&&(s.innerText=i.text),p.setAttribs(s,{href:r,target:i.target?i.target:null,rel:i.rel?i.rel:null}),m.select(s),e.undoManager.add()):k?e.insertContent(p.createHTML("a",{href:r,target:i.target?i.target:null,rel:i.rel?i.rel:null},p.encode(i.text))):e.execCommand("mceInsertLink",!1,{href:r,target:i.target,rel:i.rel?i.rel:null})}var i=t.data,r=i.href;return r?r.indexOf("@")>0&&-1==r.indexOf("//")&&-1==r.indexOf("mailto:")?void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(e){e&&(r="mailto:"+r),l()}):/^\s*www\./i.test(r)?void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){e&&(r="http://"+r),l()}):void l():void e.execCommand("unlink")}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t(n)),this.showDialog=n,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]",context:"insert",prependToContext:!0})});
     1tinymce.PluginManager.add("link",function(e){function t(t){return function(){var n=e.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n)}}function n(t){function n(e){var t=f.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),f.find("#href").value(e.control.value())}function l(){var n=[{text:"None",value:""}];return tinymce.each(t,function(t){n.push({text:t.text||t.title,value:e.convertURL(t.value||t.url,"href"),menu:t.menu})}),n}function i(t,n,l){var i,a=[];return tinymce.each(e.settings[t]||l,function(e){var t={text:e.text||e.title,value:e.value};a.push(t),(p[n]===e.value||!i&&e.selected)&&(i=t)}),i&&!p[n]&&(p[n]=i.value,i.selected=!0),a}function a(t){var l=[];return tinymce.each(e.dom.select("a:not([href])"),function(e){var n=e.name||e.id;n&&l.push({text:n,value:"#"+n,selected:-1!=t.indexOf("#"+n)})}),l.length?(l.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:l,onselect:n}):void 0}function r(){v&&v.value(e.convertURL(this.value(),"href")),!c&&0===p.text.length&&d&&this.parent().parent().find("#text")[0].value(this.value())}function o(e){var t=k.getContent();if(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1==t.indexOf("href=")))return!1;if(e){var n,l=e.childNodes;if(0===l.length)return!1;for(n=l.length-1;n>=0;n--)if(3!=l[n].nodeType)return!1}return!0}var s,u,c,f,d,h,v,x,g,m,p={},k=e.selection,y=e.dom;s=k.getNode(),u=y.getParent(s,"a[href]"),d=o(),p.text=c=u?u.innerText||u.textContent:k.getContent({format:"text"}),p.href=u?y.getAttrib(u,"href"):"",p.target=u?y.getAttrib(u,"target"):e.settings.default_link_target||null,p.rel=u?y.getAttrib(u,"rel"):null,p["class"]=u?y.getAttrib(u,"class"):null,d&&(h={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){p.text=this.value()}}),t&&(v={type:"listbox",label:"Link list",values:l(),onselect:n,value:e.convertURL(p.href,"href"),onPostRender:function(){v=this}}),e.settings.target_list!==!1&&(g={name:"target",type:"listbox",label:"Target",values:i("target_list","target",[{text:"None",value:""},{text:"New window",value:"_blank"}])}),e.settings.rel_list&&(x={name:"rel",type:"listbox",label:"Rel",values:i("rel_list","rel",[{text:"None",value:""}])}),e.settings.link_class_list&&(m={name:"class",type:"listbox",label:"Class",values:i("link_class_list","class")}),f=e.windowManager.open({title:"Insert link",data:p,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:r,onkeyup:r},h,a(p.href),v,x,g,m],onSubmit:function(t){function n(t,n){var l=e.selection.getRng();window.setTimeout(function(){e.windowManager.confirm(t,function(t){e.selection.setRng(l),n(t)})},0)}function l(){u?(e.focus(),d&&p.text!=c&&(u.innerText=p.text),y.setAttribs(u,{href:i,target:p.target?p.target:null,rel:p.rel?p.rel:null,"class":p["class"]?p["class"]:null}),k.select(u),e.undoManager.add()):d?e.insertContent(y.createHTML("a",{href:i,target:p.target?p.target:null,rel:p.rel?p.rel:null,"class":p["class"]?p["class"]:null},y.encode(p.text))):e.execCommand("mceInsertLink",!1,{href:i,target:p.target,rel:p.rel?p.rel:null})}var i;return p=tinymce.extend(p,t.data),(i=p.href)?i.indexOf("@")>0&&-1==i.indexOf("//")&&-1==i.indexOf("mailto:")?void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(e){e&&(i="mailto:"+i),l()}):/^\s*www\./i.test(i)?void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){e&&(i="http://"+i),l()}):void l():void e.execCommand("unlink")}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t(n)),this.showDialog=n,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]",context:"insert",prependToContext:!0})});
  • trunk/src/wp-includes/js/tinymce/plugins/media/plugin.js

    r27060 r27387  
    113113                            spacing: 5,
    114114                            items: [
    115                                 {name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize},
     115                                {name: 'width', type: 'textbox', maxLength: 5, size: 3, ariaLabel: 'Width', onchange: recalcSize},
    116116                                {type: 'label', text: 'x'},
    117                                 {name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize},
     117                                {name: 'height', type: 'textbox', maxLength: 5, size: 3, ariaLabel: 'Height', onchange: recalcSize},
    118118                                {name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'}
    119119                            ]
     
    136136                        {
    137137                            type: 'label',
    138                             text: 'Paste your embed code below:'
     138                            text: 'Paste your embed code below:',
     139                            forId: 'mcemediasource'
    139140                        },
    140141                        {
     142                            id: 'mcemediasource',
    141143                            type: 'textbox',
    142144                            flex: 1,
     
    642644        tooltip: 'Insert/edit video',
    643645        onclick: showDialog,
    644         stateSelector: 'img[data-mce-object=video]'
     646        stateSelector: ['img[data-mce-object=video]', 'img[data-mce-object=iframe]']
    645647    });
    646648
  • trunk/src/wp-includes/js/tinymce/plugins/media/plugin.min.js

    r27060 r27387  
    1 tinymce.PluginManager.add("media",function(e,t){function i(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function r(t){var i=e.settings.media_scripts;if(i)for(var r=0;r<i.length;r++)if(-1!==t.indexOf(i[r].filter))return i[r]}function a(){function t(e){var t,o,c,n;t=i.find("#width")[0],o=i.find("#height")[0],c=t.value(),n=o.value(),i.find("#constrain")[0].checked()&&r&&a&&c&&n&&(e.control==t?(n=Math.round(c/r*n),o.value(n)):(c=Math.round(n/a*c),t.value(c))),r=c,a=n}var i,r,a,m;m=s(e.selection.getNode()),r=m.width,a=m.height,i=e.windowManager.open({title:"Insert/edit video",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){m=n(this.next().find("#embed").value()),this.fromJSON(m)},items:[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source"},{name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"},{name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"},{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:t},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:t},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}]},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(c(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:"},{type:"textbox",flex:1,name:"embed",value:o(),multiline:!0,label:"Source"}]}],onSubmit:function(){e.insertContent(c(this.toJSON()))}})}function o(){var t=e.selection.getNode();return t.getAttribute("data-mce-object")?e.selection.getContent():void 0}function c(a){var o="";if(!a.source1&&(tinymce.extend(a,n(a.embed)),!a.source1))return"";if(a.source1=e.convertURL(a.source1,"source"),a.source2=e.convertURL(a.source2,"source"),a.source1mime=i(a.source1),a.source2mime=i(a.source2),a.poster=e.convertURL(a.poster,"poster"),a.flashPlayerUrl=e.convertURL(t+"/moxieplayer.swf","movie"),a.embed)o=m(a.embed,a,!0);else{tinymce.each(d,function(e){var t,i,r;if(t=e.regex.exec(a.source1)){for(r=e.url,i=0;t[i];i++)r=r.replace("$"+i,function(){return t[i]});a.source1=r,a.type=e.type,a.width=a.width||e.w,a.height=a.height||e.h}});var c=r(a.source1);c&&(a.type="script",a.width=c.width,a.height=c.height),a.width=a.width||300,a.height=a.height||150,tinymce.each(a,function(t,i){a[i]=e.dom.encode(t)}),"iframe"==a.type?o+='<iframe src="'+a.source1+'" width="'+a.width+'" height="'+a.height+'"></iframe>':"application/x-shockwave-flash"==a.source1mime?(o+='<object data="'+a.source1+'" width="'+a.width+'" height="'+a.height+'" type="application/x-shockwave-flash">',a.poster&&(o+='<img src="'+a.poster+'" width="'+a.width+'" height="'+a.height+'" />'),o+="</object>"):-1!=a.source1mime.indexOf("audio")?e.settings.audio_template_callback?o=e.settings.audio_template_callback(a):o+='<audio controls="controls" src="'+a.source1+'">'+(a.source2?'\n<source src="'+a.source2+'"'+(a.source2mime?' type="'+a.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==a.type?o+='<script src="'+a.source1+'"></script>':o=e.settings.video_template_callback?e.settings.video_template_callback(a):'<video width="'+a.width+'" height="'+a.height+'"'+(a.poster?' poster="'+a.poster+'"':"")+' controls="controls">\n<source src="'+a.source1+'"'+(a.source1mime?' type="'+a.source1mime+'"':"")+" />\n"+(a.source2?'<source src="'+a.source2+'"'+(a.source2mime?' type="'+a.source2mime+'"':"")+" />\n":"")+"</video>"}return o}function n(e){var t={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(e,i){if(t.source1||"param"!=e||(t.source1=i.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t.type||(t.type=e),t=tinymce.extend(i.map,t)),"script"==e){var a=r(i.map.src);if(!a)return;t={type:"script",source1:i.map.src,width:a.width,height:a.height}}"source"==e&&(t.source1?t.source2||(t.source2=i.map.src):t.source1=i.map.src),"img"!=e||t.poster||(t.poster=i.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function s(t){return t.getAttribute("data-mce-object")?n(e.serializer.serialize(t,{selection:!0})):{}}function m(e,t,i){function r(e,t){var i,r,a,o;for(i in t)if(a=""+t[i],e.map[i])for(r=e.length;r--;)o=e[r],o.name==i&&(a?(e.map[i]=a,o.value=a):(delete e.map[i],e.splice(r,1)));else a&&(e.push({name:i,value:a}),e.map[i]=a)}var a,o=new tinymce.html.Writer,c=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(e){o.comment(e)},cdata:function(e){o.cdata(e)},text:function(e,t){o.text(e,t)},start:function(e,n,s){switch(e){case"video":case"object":case"embed":case"img":case"iframe":r(n,{width:t.width,height:t.height})}if(i)switch(e){case"video":r(n,{poster:t.poster,src:""}),t.source2&&r(n,{src:""});break;case"iframe":r(n,{src:t.source1});break;case"source":if(c++,2>=c&&(r(n,{src:t["source"+c],type:t["source"+c+"mime"]}),!t["source"+c]))return;break;case"img":if(!t.poster)return;a=!0}o.start(e,n,s)},end:function(e){if("video"==e&&i)for(var n=1;2>=n;n++)if(t["source"+n]){var s=[];s.map={},n>c&&(r(s,{src:t["source"+n],type:t["source"+n+"mime"]}),o.start("source",s,!0))}if(t.poster&&"object"==e&&i&&!a){var m=[];m.map={},r(m,{src:t.poster,width:t.width,height:t.height}),o.start("img",m,!0)}o.end(e)}},new tinymce.html.Schema({})).parse(e),o.getContent()}var d=[{regex:/youtu\.be\/([a-z1-9.-_]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"http://player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'http://maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.schema.addValidElements("object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]");var i=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){i[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t,i){for(var a,o,c,n,s,m,d,u,l=t.length;l--;)if(o=t[l],"script"!=o.name||(u=r(o.attr("src")))){for(c=new tinymce.html.Node("img",1),c.shortEnded=!0,u&&(u.width&&o.attr("width",u.width.toString()),u.height&&o.attr("height",u.height.toString())),m=o.attributes,a=m.length;a--;)n=m[a].name,s=m[a].value,"width"!==n&&"height"!==n&&"style"!==n&&(("data"==n||"src"==n)&&(s=e.convertURL(s,n)),c.attr("data-mce-p-"+n,s));d=o.firstChild&&o.firstChild.value,d&&(c.attr("data-mce-html",escape(d)),c.firstChild=null),c.attr({width:o.attr("width")||"300",height:o.attr("height")||("audio"==i?"30":"150"),style:o.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),o.replace(c)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var i,r,a,o,c,n,s,m=e.length;m--;){for(i=e[m],s=i.attr(t),r=new tinymce.html.Node(s,1),"audio"!=s&&"script"!=s&&r.attr({width:i.attr("width"),height:i.attr("height")}),r.attr({style:i.attr("style")}),o=i.attributes,a=o.length;a--;){var d=o[a].name;0===d.indexOf("data-mce-p-")&&r.attr(d.substr(11),o[a].value)}"script"==s&&r.attr("type","text/javascript"),c=i.attr("data-mce-html"),c&&(n=new tinymce.html.Node("#text",3),n.raw=!0,n.value=unescape(c),r.append(n)),i.replace(r)}})}),e.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");("audio"==t||"script"==t)&&e.preventDefault()}),e.on("objectResized",function(e){var t,i=e.target;i.getAttribute("data-mce-object")&&(t=i.getAttribute("data-mce-html"),t&&(t=unescape(t),i.setAttribute("data-mce-html",escape(m(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:a,stateSelector:"img[data-mce-object=video]"}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:a,context:"insert",prependToContext:!0})});
     1tinymce.PluginManager.add("media",function(e,t){function i(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function r(t){var i=e.settings.media_scripts;if(i)for(var r=0;r<i.length;r++)if(-1!==t.indexOf(i[r].filter))return i[r]}function a(){function t(e){var t,o,c,n;t=i.find("#width")[0],o=i.find("#height")[0],c=t.value(),n=o.value(),i.find("#constrain")[0].checked()&&r&&a&&c&&n&&(e.control==t?(n=Math.round(c/r*n),o.value(n)):(c=Math.round(n/a*c),t.value(c))),r=c,a=n}var i,r,a,m;m=s(e.selection.getNode()),r=m.width,a=m.height,i=e.windowManager.open({title:"Insert/edit video",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){m=n(this.next().find("#embed").value()),this.fromJSON(m)},items:[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source"},{name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"},{name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"},{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,ariaLabel:"Width",onchange:t},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,ariaLabel:"Height",onchange:t},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}]},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(c(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},{id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:o(),multiline:!0,label:"Source"}]}],onSubmit:function(){e.insertContent(c(this.toJSON()))}})}function o(){var t=e.selection.getNode();return t.getAttribute("data-mce-object")?e.selection.getContent():void 0}function c(a){var o="";if(!a.source1&&(tinymce.extend(a,n(a.embed)),!a.source1))return"";if(a.source1=e.convertURL(a.source1,"source"),a.source2=e.convertURL(a.source2,"source"),a.source1mime=i(a.source1),a.source2mime=i(a.source2),a.poster=e.convertURL(a.poster,"poster"),a.flashPlayerUrl=e.convertURL(t+"/moxieplayer.swf","movie"),a.embed)o=m(a.embed,a,!0);else{tinymce.each(d,function(e){var t,i,r;if(t=e.regex.exec(a.source1)){for(r=e.url,i=0;t[i];i++)r=r.replace("$"+i,function(){return t[i]});a.source1=r,a.type=e.type,a.width=a.width||e.w,a.height=a.height||e.h}});var c=r(a.source1);c&&(a.type="script",a.width=c.width,a.height=c.height),a.width=a.width||300,a.height=a.height||150,tinymce.each(a,function(t,i){a[i]=e.dom.encode(t)}),"iframe"==a.type?o+='<iframe src="'+a.source1+'" width="'+a.width+'" height="'+a.height+'"></iframe>':"application/x-shockwave-flash"==a.source1mime?(o+='<object data="'+a.source1+'" width="'+a.width+'" height="'+a.height+'" type="application/x-shockwave-flash">',a.poster&&(o+='<img src="'+a.poster+'" width="'+a.width+'" height="'+a.height+'" />'),o+="</object>"):-1!=a.source1mime.indexOf("audio")?e.settings.audio_template_callback?o=e.settings.audio_template_callback(a):o+='<audio controls="controls" src="'+a.source1+'">'+(a.source2?'\n<source src="'+a.source2+'"'+(a.source2mime?' type="'+a.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==a.type?o+='<script src="'+a.source1+'"></script>':o=e.settings.video_template_callback?e.settings.video_template_callback(a):'<video width="'+a.width+'" height="'+a.height+'"'+(a.poster?' poster="'+a.poster+'"':"")+' controls="controls">\n<source src="'+a.source1+'"'+(a.source1mime?' type="'+a.source1mime+'"':"")+" />\n"+(a.source2?'<source src="'+a.source2+'"'+(a.source2mime?' type="'+a.source2mime+'"':"")+" />\n":"")+"</video>"}return o}function n(e){var t={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(e,i){if(t.source1||"param"!=e||(t.source1=i.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t.type||(t.type=e),t=tinymce.extend(i.map,t)),"script"==e){var a=r(i.map.src);if(!a)return;t={type:"script",source1:i.map.src,width:a.width,height:a.height}}"source"==e&&(t.source1?t.source2||(t.source2=i.map.src):t.source1=i.map.src),"img"!=e||t.poster||(t.poster=i.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function s(t){return t.getAttribute("data-mce-object")?n(e.serializer.serialize(t,{selection:!0})):{}}function m(e,t,i){function r(e,t){var i,r,a,o;for(i in t)if(a=""+t[i],e.map[i])for(r=e.length;r--;)o=e[r],o.name==i&&(a?(e.map[i]=a,o.value=a):(delete e.map[i],e.splice(r,1)));else a&&(e.push({name:i,value:a}),e.map[i]=a)}var a,o=new tinymce.html.Writer,c=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(e){o.comment(e)},cdata:function(e){o.cdata(e)},text:function(e,t){o.text(e,t)},start:function(e,n,s){switch(e){case"video":case"object":case"embed":case"img":case"iframe":r(n,{width:t.width,height:t.height})}if(i)switch(e){case"video":r(n,{poster:t.poster,src:""}),t.source2&&r(n,{src:""});break;case"iframe":r(n,{src:t.source1});break;case"source":if(c++,2>=c&&(r(n,{src:t["source"+c],type:t["source"+c+"mime"]}),!t["source"+c]))return;break;case"img":if(!t.poster)return;a=!0}o.start(e,n,s)},end:function(e){if("video"==e&&i)for(var n=1;2>=n;n++)if(t["source"+n]){var s=[];s.map={},n>c&&(r(s,{src:t["source"+n],type:t["source"+n+"mime"]}),o.start("source",s,!0))}if(t.poster&&"object"==e&&i&&!a){var m=[];m.map={},r(m,{src:t.poster,width:t.width,height:t.height}),o.start("img",m,!0)}o.end(e)}},new tinymce.html.Schema({})).parse(e),o.getContent()}var d=[{regex:/youtu\.be\/([a-z1-9.-_]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"http://player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'http://maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.schema.addValidElements("object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]");var i=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){i[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t,i){for(var a,o,c,n,s,m,d,u,l=t.length;l--;)if(o=t[l],"script"!=o.name||(u=r(o.attr("src")))){for(c=new tinymce.html.Node("img",1),c.shortEnded=!0,u&&(u.width&&o.attr("width",u.width.toString()),u.height&&o.attr("height",u.height.toString())),m=o.attributes,a=m.length;a--;)n=m[a].name,s=m[a].value,"width"!==n&&"height"!==n&&"style"!==n&&(("data"==n||"src"==n)&&(s=e.convertURL(s,n)),c.attr("data-mce-p-"+n,s));d=o.firstChild&&o.firstChild.value,d&&(c.attr("data-mce-html",escape(d)),c.firstChild=null),c.attr({width:o.attr("width")||"300",height:o.attr("height")||("audio"==i?"30":"150"),style:o.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),o.replace(c)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var i,r,a,o,c,n,s,m=e.length;m--;){for(i=e[m],s=i.attr(t),r=new tinymce.html.Node(s,1),"audio"!=s&&"script"!=s&&r.attr({width:i.attr("width"),height:i.attr("height")}),r.attr({style:i.attr("style")}),o=i.attributes,a=o.length;a--;){var d=o[a].name;0===d.indexOf("data-mce-p-")&&r.attr(d.substr(11),o[a].value)}"script"==s&&r.attr("type","text/javascript"),c=i.attr("data-mce-html"),c&&(n=new tinymce.html.Node("#text",3),n.raw=!0,n.value=unescape(c),r.append(n)),i.replace(r)}})}),e.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");("audio"==t||"script"==t)&&e.preventDefault()}),e.on("objectResized",function(e){var t,i=e.target;i.getAttribute("data-mce-object")&&(t=i.getAttribute("data-mce-html"),t&&(t=unescape(t),i.setAttribute("data-mce-html",escape(m(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:a,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:a,context:"insert",prependToContext:!0})});
  • trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.js

    r27062 r27387  
    198198 *
    199199 * We need to make a lot of ugly hacks to get the contents out of the clipboard since
    200  * the W3C Clipboard API is broken in all browsers: Gecko/WebKit/Blink. We might rewrite
    201  * this the way those API:s stabilize.
     200 * the W3C Clipboard API is broken in all browsers that have it: Gecko/WebKit/Blink.
     201 * We might rewrite this the way those API:s stabilize. Browsers doesn't handle pasting
     202 * from applications like Word the same way as it does when pasting into a contentEditable area
     203 * so we need to do lots of extra work to try to get to this clipboard data.
    202204 *
    203205 * Current implementation steps:
     
    291293
    292294        /**
    293          * Creates a paste bin element and moves the selection into that element. It will also move the element offscreen
    294          * so that resize handles doesn't get produced on IE or Drag handles or Firefox.
     295         * Creates a paste bin element as close as possible to the current caret location and places the focus inside that element
     296         * so that when the real paste event occurs the contents gets inserted into this element
     297         * instead of the current editor selection element.
    295298         */
    296299        function createPasteBin() {
    297300            var dom = editor.dom, body = editor.getBody();
    298301            var viewport = editor.dom.getViewPort(editor.getWin()), scrollTop = viewport.y, top = 20;
     302            var scrollContainer;
    299303
    300304            lastRng = editor.selection.getRng();
    301305
    302306            if (editor.inline) {
    303                 var scrollContainer = editor.selection.getScrollContainer();
     307                scrollContainer = editor.selection.getScrollContainer();
    304308
    305309                if (scrollContainer) {
     
    312316            if (lastRng.getClientRects) {
    313317                var rects = lastRng.getClientRects();
     318
    314319                if (rects.length) {
     320                    // Client rects gets us closes to the actual
     321                    // caret location in for example a wrapped paragraph block
    315322                    top = scrollTop + (rects[0].top - dom.getPos(body).y);
     323                } else {
     324                    top = scrollTop;
     325
     326                    // Check if we can find a closer location by checking the range element
     327                    var container = lastRng.startContainer;
     328                    if (container) {
     329                        if (container.nodeType == 3 && container.parentNode != body) {
     330                            container = container.parentNode;
     331                        }
     332
     333                        if (container.nodeType == 1) {
     334                            top = dom.getPos(container, scrollContainer || body).y;
     335                        }
     336                    }
    316337                }
    317338            }
     
    402423
    403424            if (dataTransfer && dataTransfer.types) {
    404                 data['text/plain'] = dataTransfer.getData('Text');
     425                // Use old WebKit API
     426                var legacyText = dataTransfer.getData('Text');
     427                if (legacyText && legacyText.length > 0) {
     428                    data['text/plain'] = legacyText;
     429                }
    405430
    406431                for (var i = 0; i < dataTransfer.types.length; i++) {
     
    424449        }
    425450
     451        /**
     452         * Checks if the clipboard contains image data if it does it will take that data
     453         * and convert it into a data url image and paste that image at the caret location.
     454         *
     455         * @param  {ClipboardEvent} e Paste event object.
     456         * @param  {Object} clipboardContent Collection of clipboard contents.
     457         * @return {Boolean} true/false if the image data was found or not.
     458         */
     459        function pasteImageData(e, clipboardContent) {
     460            function pasteImage(item) {
     461                if (items[i].type == 'image/png') {
     462                    var reader = new FileReader();
     463
     464                    reader.onload = function() {
     465                        pasteHtml('<img src="' + reader.result + '">');
     466                    };
     467
     468                    reader.readAsDataURL(item.getAsFile());
     469
     470                    return true;
     471                }
     472            }
     473
     474            // If paste data images are disabled or there is HTML or plain text
     475            // contents then proceed with the normal paste process
     476            if (!editor.settings.paste_data_images || "text/html" in clipboardContent || "text/plain" in clipboardContent) {
     477                return;
     478            }
     479
     480            if (e.clipboardData) {
     481                var items = e.clipboardData.items;
     482
     483                if (items) {
     484                    for (var i = 0; i < items.length; i++) {
     485                        if (pasteImage(items[i])) {
     486                            return true;
     487                        }
     488                    }
     489                }
     490            }
     491        }
     492
    426493        function getCaretRangeFromEvent(e) {
    427494            var doc = editor.getDoc(), rng;
    428495
    429496            if (doc.caretPositionFromPoint) {
    430                 var point = doc.caretPositionFromPoint(e.pageX, e.pageY);
     497                var point = doc.caretPositionFromPoint(e.clientX, e.clientY);
    431498                rng = doc.createRange();
    432499                rng.setStart(point.offsetNode, point.offset);
    433500                rng.collapse(true);
    434501            } else if (doc.caretRangeFromPoint) {
    435                 rng = doc.caretRangeFromPoint(e.pageX, e.pageY);
     502                rng = doc.caretRangeFromPoint(e.clientX, e.clientY);
    436503            }
    437504
     
    473540
    474541                if (e.isDefaultPrevented()) {
     542                    removePasteBin();
     543                    return;
     544                }
     545
     546                if (pasteImageData(e, clipboardContent)) {
    475547                    removePasteBin();
    476548                    return;
     
    816888                if (!validElements) {
    817889                    validElements = '@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' +
    818                         '-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br';
     890                        '-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br';
    819891                }
    820892
     
    9291001        function removeWebKitFragments(html) {
    9301002            html = Utils.filter(html, [
    931                 /^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g,        // WebKit fragment
     1003                /^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g, // WebKit fragment
    9321004                [/<span class="Apple-converted-space">\u00a0<\/span>/g, '\u00a0'], // WebKit &nbsp;
    933                 /<br>$/                                                            // Traling BR elements
     1005                /<br>$/ // Traling BR elements
    9341006            ]);
    9351007
  • trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.min.js

    r27062 r27387  
    1 !function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/pasteplugin/Utils",c="tinymce/util/Tools",d="tinymce/html/DomParser",u="tinymce/html/Schema",f="tinymce/pasteplugin/Clipboard",p="tinymce/Env",m="tinymce/util/VK",h="tinymce/pasteplugin/WordFilter",g="tinymce/html/Serializer",v="tinymce/html/Node",y="tinymce/pasteplugin/Quirks",b="tinymce/pasteplugin/Plugin",C="tinymce/PluginManager";r(l,[c,d,u],function(e,t,n){function r(t,n){return e.each(n,function(e){t=e.constructor==RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function i(r){function i(e){var t=e.name,n=e;if("br"===t)return void(s+="\n");if(l[t]&&(s+=" "),c[t])return void(s+=" ");if(3==e.type&&(s+=e.value),!e.shortEnded&&(e=e.firstChild))do i(e);while(e=e.next);d[t]&&n.next&&(s+="\n","p"==t&&(s+="\n"))}var o=new n,a=new t({},o),s="",l=o.getShortEndedElements(),c=e.makeMap("script noscript style textarea video audio iframe object"," "),d=o.getBlockElements();return i(a.parse(r)),s}return{filter:r,innerText:i}}),r(f,[p,m,l],function(e,t,n){return function(r){function i(e){var t,n=r.dom;if(t=r.fire("BeforePastePreProcess",{content:e}),t=r.fire("PastePreProcess",t),e=t.content,!t.isDefaultPrevented()){if(r.hasEventListeners("PastePostProcess")&&!t.isDefaultPrevented()){var i=n.add(r.getBody(),"div",{style:"display:none"},e);t=r.fire("PastePostProcess",{node:i}),n.remove(i),e=t.node.innerHTML}t.isDefaultPrevented()||r.insertContent(e)}}function o(e){e=r.dom.encode(e).replace(/\r\n/g,"\n");var t=r.dom.getParent(r.selection.getStart(),r.dom.isBlock),o=r.settings.forced_root_block,a;o&&(a=r.dom.createHTML(o,r.settings.forced_root_block_attrs),a=a.substr(0,a.length-3)+">"),t&&/^(PRE|DIV)$/.test(t.nodeName)||!o?e=n.filter(e,[[/\n/g,"<br>"]]):(e=n.filter(e,[[/\n\n/g,"</p>"+a],[/^(.*<\/p>)(<p>)$/,a+"$1"],[/\n/g,"<br />"]]),-1!=e.indexOf("<p>")&&(e=a+e)),i(e)}function a(){var t=r.dom,n=r.getBody(),i=r.dom.getViewPort(r.getWin()),o=i.y,a=20;if(h=r.selection.getRng(),r.inline){var s=r.selection.getScrollContainer();s&&(o=s.scrollTop)}if(h.getClientRects){var l=h.getClientRects();l.length&&(a=o+(l[0].top-t.getPos(n).y))}m=t.add(r.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+a+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},v),(e.ie||e.gecko)&&t.setStyle(m,"left","rtl"==t.getStyle(n,"direction",!0)?65535:-65535),t.bind(m,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),m.focus(),r.selection.select(m,!0)}function s(){if(m){for(var e;e=r.dom.get("mcepastebin");)r.dom.remove(e),r.dom.unbind(e);h&&r.selection.setRng(h)}y=!1,m=h=null}function l(){var e=v,t,n;for(t=r.dom.select("div[id=mcepastebin]"),n=t.length;n--;){var i=t[n].innerHTML;e==v&&(e=""),i.length>e.length&&(e=i)}return e}function c(e){var t={};if(e&&e.types){t["text/plain"]=e.getData("Text");for(var n=0;n<e.types.length;n++){var r=e.types[n];t[r]=e.getData(r)}}return t}function d(e){return c(e.clipboardData||r.getDoc().dataTransfer)}function u(e){var t=r.getDoc(),n;if(t.caretPositionFromPoint){var i=t.caretPositionFromPoint(e.pageX,e.pageY);n=t.createRange(),n.setStart(i.offsetNode,i.offset),n.collapse(!0)}else t.caretRangeFromPoint&&(n=t.caretRangeFromPoint(e.pageX,e.pageY));return n}function f(){r.on("keydown",function(n){if(!n.isDefaultPrevented()&&(t.metaKeyPressed(n)&&86==n.keyCode||n.shiftKey&&45==n.keyCode)){if(y=n.shiftKey&&86==n.keyCode,n.stopImmediatePropagation(),g=(new Date).getTime(),e.ie&&y)return n.preventDefault(),void r.fire("paste",{ieFake:!0});s(),a()}}),r.on("paste",function(t){var c=d(t),u=(new Date).getTime()-g<1e3,f="text"==p.pasteFormat||y;return t.isDefaultPrevented()?void s():(u||t.preventDefault(),!e.ie||u&&!t.ieFake||(a(),r.dom.bind(m,"paste",function(e){e.stopPropagation()}),r.getDoc().execCommand("Paste",!1,null),c["text/html"]=l()),void setTimeout(function(){var e=l();return m&&m.firstChild&&"mcepastebin"===m.firstChild.id&&(f=!0),s(),e!=v&&u||(e=c["text/html"]||c["text/plain"]||v,e!=v)?void(f?o(c["text/plain"]||n.innerText(e)):i(e)):void(u||r.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."))},0))}),r.on("dragstart",function(e){if(e.dataTransfer.types)try{e.dataTransfer.setData("mce-internal",r.selection.getContent())}catch(t){}}),r.on("drop",function(e){var t=u(e);if(t&&!e.isDefaultPrevented()){var n=c(e.dataTransfer),a=n["mce-internal"]||n["text/html"]||n["text/plain"];a&&(e.preventDefault(),r.undoManager.transact(function(){n["mce-internal"]&&r.execCommand("Delete"),r.selection.setRng(t),n["text/html"]?i(a):o(a)}))}})}var p=this,m,h,g=0,v="%MCEPASTEBIN%",y;p.pasteHtml=i,p.pasteText=o,r.on("preInit",function(){f(),r.parser.addNodeFilter("img",function(t){if(!r.settings.paste_data_images)for(var n=t.length;n--;){var i=t[n].attributes.map.src;i&&0===i.indexOf("data:image")&&(t[n].attr("data-mce-object")||i===e.transparentSrc||t[n].remove())}})}),r.on("PreProcess",function(){r.dom.remove(r.dom.get("mcepastebin"))})}}),r(h,[c,d,u,g,v,l],function(e,t,n,r,i,o){function a(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)}function s(s){var l=s.settings;s.on("BeforePastePreProcess",function(c){function d(e){function t(e,t,a,s){var l=e._listLevel||o;l!=o&&(o>l?n&&(n=n.parent.parent):(r=n,n=null)),n&&n.name==a?n.append(e):(r=r||n,n=new i(a,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>o&&r&&r.lastChild.append(n),o=l}for(var n,r,o=1,a=e.getAll("p"),s=0;s<a.length;s++)if(e=a[s],"p"==e.name&&e.firstChild){for(var l="",c=e.firstChild;c&&!(l=c.value);)c=c.firstChild;if(/^\s*[\u2022\u00b7\u00a7\u00d8\u25CF]\s*$/.test(l)){t(e,c,"ul");continue}if(/^\s*\w+\.$/.test(l)){var d=/([0-9])\./.exec(l),u=1;d&&(u=parseInt(d[1],10)),t(e,c,"ol",u);continue}n=null}}function u(t,n){if("p"===t.name){var r=/mso-list:\w+ \w+([0-9]+)/.exec(n);r&&(t._listLevel=parseInt(r[1],10))}if(s.getParam("paste_retain_style_properties","none")){var i="";if(e.each(s.dom.parseStyle(n),function(e,t){switch(t){case"horiz-align":return void(t="text-align");case"vert-align":return void(t="vertical-align");case"font-color":case"mso-foreground":return void(t="color");case"mso-background":case"mso-highlight":t="background"}("all"==p||m&&m[t])&&(i+=t+":"+e+";")}),i)return i}return null}var f=c.content,p,m;if(p=l.paste_retain_style_properties,p&&(m=e.makeMap(p)),l.paste_enable_default_filters!==!1&&a(c.content)){c.wordContent=!0,f=o.filter(f,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var h=l.paste_word_valid_elements;h||(h="@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br");var g=new n({valid_elements:h}),v=new t({},g);v.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",u(n,n.attr("style"))),"span"!=n.name||n.attributes.length||n.unwrap()}),v.addNodeFilter("a",function(e){for(var t=e.length,n,r,i;t--;)n=e[t],r=n.attr("href"),i=n.attr("name"),r&&0===r.indexOf("file://")&&(r=r.split("#")[1],r&&(r="#"+r)),r||i?n.attr({href:r,name:i}):n.unwrap()});var y=v.parse(f);d(y),c.content=new r({},g).serialize(y)}})}return s.isWordContent=a,s}),r(y,[p,c,h,l],function(e,t,n,r){return function(i){function o(e){i.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function a(e){return e=r.filter(e,[/^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g,[/<span class="Apple-converted-space">\u00a0<\/span>/g,"\xa0"],/<br>$/])}function s(e){if(!n.isWordContent(e))return e;var o=[];t.each(i.schema.getBlockElements(),function(e,t){o.push(t)});var a=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+o.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=r.filter(e,[[a,"$1"]]),e=r.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function l(e){return(i.settings.paste_remove_styles||i.settings.paste_remove_styles_if_webkit!==!1)&&(e=e.replace(/ style=\"[^\"]+\"/g,"")),e}e.webkit&&(o(l),o(a)),e.ie&&o(s)}}),r(b,[C,f,h,y],function(e,t,n,r){var i;e.add("paste",function(e){function o(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),i||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),i=!0))}var a=this,s,l=e.settings;a.clipboard=s=new t(e),a.quirks=new r(e),a.wordFilter=new n(e),e.settings.paste_as_text&&(a.clipboard.pasteFormat="text"),l.paste_preprocess&&e.on("PastePreProcess",function(e){l.paste_preprocess.call(a,a,e)}),l.paste_postprocess&&e.on("PastePostProcess",function(e){l.paste_postprocess.call(a,a,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&a.clipboard.pasteHtml(t.content),t.text&&a.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:o,active:"text"==a.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:o})})}),a([l,f,h,y,b])}(this);
     1!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r<e.length;++r){if(n=s[e[r]]||a(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(i,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function a(t){for(var n=e,i=t.split(/[.\/]/),r=0;r<i.length;++r){if(!n[i[r]])return;n=n[i[r]]}return n}function o(n){for(var i=0;i<n.length;i++){for(var r=e,a=n[i],o=a.split(/[.\/]/),l=0;l<o.length-1;++l)r[o[l]]===t&&(r[o[l]]={}),r=r[o[l]];r[o[o.length-1]]=s[a]}}var s={},l="tinymce/pasteplugin/Utils",c="tinymce/util/Tools",d="tinymce/html/DomParser",p="tinymce/html/Schema",f="tinymce/pasteplugin/Clipboard",u="tinymce/Env",m="tinymce/util/VK",g="tinymce/pasteplugin/WordFilter",v="tinymce/html/Serializer",h="tinymce/html/Node",b="tinymce/pasteplugin/Quirks",y="tinymce/pasteplugin/Plugin",P="tinymce/PluginManager";i(l,[c,d,p],function(e,t,n){function i(t,n){return e.each(n,function(e){t=e.constructor==RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function r(i){function r(e){var t=e.name,n=e;if("br"===t)return void(s+="\n");if(l[t]&&(s+=" "),c[t])return void(s+=" ");if(3==e.type&&(s+=e.value),!e.shortEnded&&(e=e.firstChild))do r(e);while(e=e.next);d[t]&&n.next&&(s+="\n","p"==t&&(s+="\n"))}var a=new n,o=new t({},a),s="",l=a.getShortEndedElements(),c=e.makeMap("script noscript style textarea video audio iframe object"," "),d=a.getBlockElements();return r(o.parse(i)),s}return{filter:i,innerText:r}}),i(f,[u,m,l],function(e,t,n){return function(i){function r(e){var t,n=i.dom;if(t=i.fire("BeforePastePreProcess",{content:e}),t=i.fire("PastePreProcess",t),e=t.content,!t.isDefaultPrevented()){if(i.hasEventListeners("PastePostProcess")&&!t.isDefaultPrevented()){var r=n.add(i.getBody(),"div",{style:"display:none"},e);t=i.fire("PastePostProcess",{node:r}),n.remove(r),e=t.node.innerHTML}t.isDefaultPrevented()||i.insertContent(e)}}function a(e){e=i.dom.encode(e).replace(/\r\n/g,"\n");var t=i.dom.getParent(i.selection.getStart(),i.dom.isBlock),a=i.settings.forced_root_block,o;a&&(o=i.dom.createHTML(a,i.settings.forced_root_block_attrs),o=o.substr(0,o.length-3)+">"),t&&/^(PRE|DIV)$/.test(t.nodeName)||!a?e=n.filter(e,[[/\n/g,"<br>"]]):(e=n.filter(e,[[/\n\n/g,"</p>"+o],[/^(.*<\/p>)(<p>)$/,o+"$1"],[/\n/g,"<br />"]]),-1!=e.indexOf("<p>")&&(e=o+e)),r(e)}function o(){var t=i.dom,n=i.getBody(),r=i.dom.getViewPort(i.getWin()),a=r.y,o=20,s;if(v=i.selection.getRng(),i.inline&&(s=i.selection.getScrollContainer(),s&&(a=s.scrollTop)),v.getClientRects){var l=v.getClientRects();if(l.length)o=a+(l[0].top-t.getPos(n).y);else{o=a;var c=v.startContainer;c&&(3==c.nodeType&&c.parentNode!=n&&(c=c.parentNode),1==c.nodeType&&(o=t.getPos(c,s||n).y))}}g=t.add(i.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+o+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},b),(e.ie||e.gecko)&&t.setStyle(g,"left","rtl"==t.getStyle(n,"direction",!0)?65535:-65535),t.bind(g,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),g.focus(),i.selection.select(g,!0)}function s(){if(g){for(var e;e=i.dom.get("mcepastebin");)i.dom.remove(e),i.dom.unbind(e);v&&i.selection.setRng(v)}y=!1,g=v=null}function l(){var e=b,t,n;for(t=i.dom.select("div[id=mcepastebin]"),n=t.length;n--;){var r=t[n].innerHTML;e==b&&(e=""),r.length>e.length&&(e=r)}return e}function c(e){var t={};if(e&&e.types){var n=e.getData("Text");n&&n.length>0&&(t["text/plain"]=n);for(var i=0;i<e.types.length;i++){var r=e.types[i];t[r]=e.getData(r)}}return t}function d(e){return c(e.clipboardData||i.getDoc().dataTransfer)}function p(e,t){function n(e){if("image/png"==a[o].type){var t=new FileReader;return t.onload=function(){r('<img src="'+t.result+'">')},t.readAsDataURL(e.getAsFile()),!0}}if(!(!i.settings.paste_data_images||"text/html"in t||"text/plain"in t)&&e.clipboardData){var a=e.clipboardData.items;if(a)for(var o=0;o<a.length;o++)if(n(a[o]))return!0}}function f(e){var t=i.getDoc(),n;if(t.caretPositionFromPoint){var r=t.caretPositionFromPoint(e.clientX,e.clientY);n=t.createRange(),n.setStart(r.offsetNode,r.offset),n.collapse(!0)}else t.caretRangeFromPoint&&(n=t.caretRangeFromPoint(e.clientX,e.clientY));return n}function u(){i.on("keydown",function(n){if(!n.isDefaultPrevented()&&(t.metaKeyPressed(n)&&86==n.keyCode||n.shiftKey&&45==n.keyCode)){if(y=n.shiftKey&&86==n.keyCode,n.stopImmediatePropagation(),h=(new Date).getTime(),e.ie&&y)return n.preventDefault(),void i.fire("paste",{ieFake:!0});s(),o()}}),i.on("paste",function(t){var c=d(t),f=(new Date).getTime()-h<1e3,u="text"==m.pasteFormat||y;return t.isDefaultPrevented()?void s():p(t,c)?void s():(f||t.preventDefault(),!e.ie||f&&!t.ieFake||(o(),i.dom.bind(g,"paste",function(e){e.stopPropagation()}),i.getDoc().execCommand("Paste",!1,null),c["text/html"]=l()),void setTimeout(function(){var e=l();return g&&g.firstChild&&"mcepastebin"===g.firstChild.id&&(u=!0),s(),e!=b&&f||(e=c["text/html"]||c["text/plain"]||b,e!=b)?void(u?a(c["text/plain"]||n.innerText(e)):r(e)):void(f||i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."))},0))}),i.on("dragstart",function(e){if(e.dataTransfer.types)try{e.dataTransfer.setData("mce-internal",i.selection.getContent())}catch(t){}}),i.on("drop",function(e){var t=f(e);if(t&&!e.isDefaultPrevented()){var n=c(e.dataTransfer),o=n["mce-internal"]||n["text/html"]||n["text/plain"];o&&(e.preventDefault(),i.undoManager.transact(function(){n["mce-internal"]&&i.execCommand("Delete"),i.selection.setRng(t),n["text/html"]?r(o):a(o)}))}})}var m=this,g,v,h=0,b="%MCEPASTEBIN%",y;m.pasteHtml=r,m.pasteText=a,i.on("preInit",function(){u(),i.parser.addNodeFilter("img",function(t){if(!i.settings.paste_data_images)for(var n=t.length;n--;){var r=t[n].attributes.map.src;r&&0===r.indexOf("data:image")&&(t[n].attr("data-mce-object")||r===e.transparentSrc||t[n].remove())}})}),i.on("PreProcess",function(){i.dom.remove(i.dom.get("mcepastebin"))})}}),i(g,[c,d,p,v,h,l],function(e,t,n,i,r,a){function o(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)}function s(s){var l=s.settings;s.on("BeforePastePreProcess",function(c){function d(e){function t(e,t,o,s){var l=e._listLevel||a;l!=a&&(a>l?n&&(n=n.parent.parent):(i=n,n=null)),n&&n.name==o?n.append(e):(i=i||n,n=new r(o,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>a&&i&&i.lastChild.append(n),a=l}for(var n,i,a=1,o=e.getAll("p"),s=0;s<o.length;s++)if(e=o[s],"p"==e.name&&e.firstChild){for(var l="",c=e.firstChild;c&&!(l=c.value);)c=c.firstChild;if(/^\s*[\u2022\u00b7\u00a7\u00d8\u25CF]\s*$/.test(l)){t(e,c,"ul");continue}if(/^\s*\w+\.$/.test(l)){var d=/([0-9])\./.exec(l),p=1;d&&(p=parseInt(d[1],10)),t(e,c,"ol",p);continue}n=null}}function p(t,n){if("p"===t.name){var i=/mso-list:\w+ \w+([0-9]+)/.exec(n);i&&(t._listLevel=parseInt(i[1],10))}if(s.getParam("paste_retain_style_properties","none")){var r="";if(e.each(s.dom.parseStyle(n),function(e,t){switch(t){case"horiz-align":return void(t="text-align");case"vert-align":return void(t="vertical-align");case"font-color":case"mso-foreground":return void(t="color");case"mso-background":case"mso-highlight":t="background"}("all"==u||m&&m[t])&&(r+=t+":"+e+";")}),r)return r}return null}var f=c.content,u,m;if(u=l.paste_retain_style_properties,u&&(m=e.makeMap(u)),l.paste_enable_default_filters!==!1&&o(c.content)){c.wordContent=!0,f=a.filter(f,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var g=l.paste_word_valid_elements;g||(g="@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br");var v=new n({valid_elements:g}),h=new t({},v);h.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",p(n,n.attr("style"))),"span"!=n.name||n.attributes.length||n.unwrap()}),h.addNodeFilter("a",function(e){for(var t=e.length,n,i,r;t--;)n=e[t],i=n.attr("href"),r=n.attr("name"),i&&0===i.indexOf("file://")&&(i=i.split("#")[1],i&&(i="#"+i)),i||r?n.attr({href:i,name:r}):n.unwrap()});var b=h.parse(f);d(b),c.content=new i({},v).serialize(b)}})}return s.isWordContent=o,s}),i(b,[u,c,g,l],function(e,t,n,i){return function(r){function a(e){r.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function o(e){return e=i.filter(e,[/^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g,[/<span class="Apple-converted-space">\u00a0<\/span>/g,"\xa0"],/<br>$/])}function s(e){if(!n.isWordContent(e))return e;var a=[];t.each(r.schema.getBlockElements(),function(e,t){a.push(t)});var o=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+a.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=i.filter(e,[[o,"$1"]]),e=i.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function l(e){return(r.settings.paste_remove_styles||r.settings.paste_remove_styles_if_webkit!==!1)&&(e=e.replace(/ style=\"[^\"]+\"/g,"")),e}e.webkit&&(a(l),a(o)),e.ie&&a(s)}}),i(y,[P,f,g,b],function(e,t,n,i){var r;e.add("paste",function(e){function a(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),r||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),r=!0))}var o=this,s,l=e.settings;o.clipboard=s=new t(e),o.quirks=new i(e),o.wordFilter=new n(e),e.settings.paste_as_text&&(o.clipboard.pasteFormat="text"),l.paste_preprocess&&e.on("PastePreProcess",function(e){l.paste_preprocess.call(o,o,e)}),l.paste_postprocess&&e.on("PastePostProcess",function(e){l.paste_postprocess.call(o,o,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&o.clipboard.pasteHtml(t.content),t.text&&o.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:a,active:"text"==o.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:a})})}),o([l,f,g,b,y])}(this);
  • trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.js

    r26876 r27387  
    7373        colors = mapColors();
    7474
    75         html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="presentation" cellspacing="0"><tbody>';
     75        html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
    7676        last = colors.length - 1;
    7777        rows = editor.settings.textcolor_rows || 5;
     
    114114
    115115        if ((value = e.target.getAttribute('data-mce-color'))) {
     116            if (this.lastId) {
     117                document.getElementById(this.lastId).setAttribute('aria-selected', false);
     118            }
     119
     120            e.target.setAttribute('aria-selected', true);
     121            this.lastId = e.target.id;
     122
    116123            buttonCtrl.hidePanel();
    117124            value = '#' + value;
     
    134141        selectcmd: 'ForeColor',
    135142        panel: {
     143            role: 'application',
     144            ariaRemember: true,
    136145            html: renderColorPicker,
    137146            onclick: onPanelClick
     
    145154        selectcmd: 'HiliteColor',
    146155        panel: {
     156            role: 'application',
     157            ariaRemember: true,
    147158            html: renderColorPicker,
    148159            onclick: onPanelClick
  • trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js

    r26876 r27387  
    1 tinymce.PluginManager.add("textcolor",function(e){function o(){var o,t,r=[];for(t=e.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Brown","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],o=0;o<t.length;o+=2)r.push({text:t[o+1],color:t[o]});return r}function t(){var t,r,l,c,n,a,F,i,d,u=this;for(t=o(),l='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="presentation" cellspacing="0"><tbody>',c=t.length-1,n=e.settings.textcolor_rows||5,a=e.settings.textcolor_cols||8,i=0;n>i;i++){for(l+="<tr>",F=0;a>F;F++)d=i*a+F,d>c?l+="<td></td>":(r=t[d],l+='<td><div id="'+u._id+"-"+d+'"'+' data-mce-color="'+r.color+'"'+' role="option"'+' tabIndex="-1"'+' style="'+(r?"background-color: #"+r.color:"")+'"'+' title="'+r.text+'">'+"</div>"+"</td>");l+="</tr>"}return l+="</tbody></table>"}function r(o){var t,r=this.parent();(t=o.target.getAttribute("data-mce-color"))&&(r.hidePanel(),t="#"+t,r.color(t),e.execCommand(r.settings.selectcmd,!1,t))}function l(){var o=this;o._color&&e.execCommand(o.settings.selectcmd,!1,o._color)}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",selectcmd:"ForeColor",panel:{html:t,onclick:r},onclick:l}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",selectcmd:"HiliteColor",panel:{html:t,onclick:r},onclick:l})});
     1tinymce.PluginManager.add("textcolor",function(e){function t(){var t,o,r=[];for(o=e.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Brown","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],t=0;t<o.length;t+=2)r.push({text:o[t+1],color:o[t]});return r}function o(){var o,r,l,a,c,i,n,F,d,s=this;for(o=t(),l='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',a=o.length-1,c=e.settings.textcolor_rows||5,i=e.settings.textcolor_cols||8,F=0;c>F;F++){for(l+="<tr>",n=0;i>n;n++)d=F*i+n,d>a?l+="<td></td>":(r=o[d],l+='<td><div id="'+s._id+"-"+d+'" data-mce-color="'+r.color+'" role="option" tabIndex="-1" style="'+(r?"background-color: #"+r.color:"")+'" title="'+r.text+'"></div></td>');l+="</tr>"}return l+="</tbody></table>"}function r(t){var o,r=this.parent();(o=t.target.getAttribute("data-mce-color"))&&(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,r.hidePanel(),o="#"+o,r.color(o),e.execCommand(r.settings.selectcmd,!1,o))}function l(){var t=this;t._color&&e.execCommand(t.settings.selectcmd,!1,t._color)}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",selectcmd:"ForeColor",panel:{role:"application",ariaRemember:!0,html:o,onclick:r},onclick:l}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",selectcmd:"HiliteColor",panel:{role:"application",ariaRemember:!0,html:o,onclick:r},onclick:l})});
  • trunk/src/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css

    r27060 r27387  
    1 .mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
     1.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
  • trunk/src/wp-includes/js/tinymce/skins/lightgray/content.min.css

    r27060 r27387  
    1 body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
     1body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
  • trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css

    r27060 r27387  
    1 .mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn.mce-disabled span{color:#aaa}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'tinymce-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + '&nbsp;')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-inserttime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-pastetext{-ie7-icon:"\e035"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB}
     1.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:focus{border-color:#a1a1a1}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn.mce-disabled span{color:#aaa}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'tinymce-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + '&nbsp;')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-insertdatetime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-pastetext{-ie7-icon:"\e035"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB}
  • trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.min.css

    r27060 r27387  
    1 .mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn.mce-disabled span{color:#aaa}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-inserttime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#bbb}
     1.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:focus{border-color:#a1a1a1}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn.mce-disabled span{color:#aaa}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-insertdatetime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#bbb}
  • trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css

    r27345 r27387  
    161161    position: relative;
    162162    height: 33px;
     163    background-color: #333; /* old IE */
    163164    background-color: rgba(0,0,0,0.3);
    164165}
  • trunk/src/wp-includes/js/tinymce/themes/modern/theme.js

    r27060 r27387  
    277277
    278278            if (item) {
    279                 item.focus();
     279                item.focus(true);
    280280            }
    281281        }
     
    392392            panel = self.panel = Factory.create({
    393393                type: inlineToolbarContainer ? 'panel' : 'floatpanel',
     394                role: 'application',
    394395                classes: 'tinymce tinymce-inline',
    395396                layout: 'flex',
     
    403404                    settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
    404405                    settings.toolbar === false ? null : {
    405                         type: 'panel', layout: 'stack', classes: "toolbar-grp", items: createToolbars()
     406                        type: 'panel', layout: 'stack', classes: "toolbar-grp", ariaRoot: true, ariaRemember: true, items: createToolbars()
    406407                    }
    407408                ]
     
    473474        panel = self.panel = Factory.create({
    474475            type: 'panel',
     476            role: 'application',
    475477            classes: 'tinymce',
    476478            style: 'visibility: hidden',
     
    479481            items: [
    480482                settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
    481                 settings.toolbar === false ? null : {type: 'panel', layout: 'stack', classes: "toolbar-grp", items: createToolbars()},
     483                settings.toolbar === false ? null : {
     484                    type: 'panel', layout: 'stack', classes: "toolbar-grp", ariaRoot: true, ariaRemember: true, items: createToolbars()
     485                },
    482486                {type: 'panel', name: 'iframe', layout: 'stack', classes: 'edit-area', html: '', border: '1 0 0 0'}
    483487            ]
     
    510514        // Add statusbar if needed
    511515        if (settings.statusbar !== false) {
    512             panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
     516            panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', ariaRoot: true, items: [
    513517                {type: 'elementpath'},
    514518                resizeHandleCtrl
  • trunk/src/wp-includes/js/tinymce/themes/modern/theme.min.js

    r27060 r27387  
    1 tinymce.ThemeManager.add("modern",function(e){function t(){function t(t){var i,o=[];if(t)return d(t.split(/[ ,]/),function(t){function n(){var n=e.selection;"bullist"==r&&n.selectorChanged("ul > li",function(e,n){for(var i,o=n.parents.length;o--&&(i=n.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(e&&"UL"==i)}),"numlist"==r&&n.selectorChanged("ol > li",function(e,n){for(var i,o=n.parents.length;o--&&(i=n.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(e&&"OL"==i)}),t.settings.stateSelector&&n.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&n.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var r;"|"==t?i=null:c.has(t)?(t={type:t},u.toolbar_items_size&&(t.size=u.toolbar_items_size),o.push(t),i=null):(i||(i={type:"buttongroup",items:[]},o.push(i)),e.buttons[t]&&(r=t,t=e.buttons[r],"function"==typeof t&&(t=t()),t.type=t.type||"button",u.toolbar_items_size&&(t.size=u.toolbar_items_size),t=c.create(t),i.items.push(t),e.initialized?n():e.on("init",n)))}),n.push({type:"toolbar",layout:"flow",items:o}),!0}for(var n=[],i=1;10>i&&t(u["toolbar"+i]);i++);return n.length||t(u.toolbar||f),n}function n(){function t(t){var n;return"|"==t?{text:"|"}:n=e.menuItems[t]}function n(n){var i,o,r,s,a;if(a=tinymce.makeMap((u.removed_menuitems||"").split(/[ ,]/)),u.menu?(o=u.menu[n],s=!0):o=h[n],o){i={text:o.title},r=[],d((o.items||"").split(/[ ,]/),function(e){var n=t(e);n&&!a[e]&&r.push(t(e))}),s||d(e.menuItems,function(e){e.context==n&&("before"==e.separator&&r.push({text:"|"}),e.prependToContext?r.unshift(e):r.push(e),"after"==e.separator&&r.push({text:"|"}))});for(var l=0;l<r.length;l++)"|"==r[l].text&&(0===l||l==r.length-1)&&r.splice(l,1);if(i.menu=r,!i.menu.length)return null}return i}var i,o=[],r=[];if(u.menu)for(i in u.menu)r.push(i);else for(i in h)r.push(i);for(var s="string"==typeof u.menubar?u.menubar.split(/[ ,]/):r,a=0;a<s.length;a++){var l=s[a];l=n(l),l&&o.push(l)}return o}function i(t){function n(e){var n=t.find(e)[0];n&&n.focus()}e.shortcuts.add("Alt+F9","",function(){n("menubar")}),e.shortcuts.add("Alt+F10","",function(){n("toolbar")}),e.shortcuts.add("Alt+F11","",function(){n("elementpath")}),t.on("cancel",function(){e.focus()})}function o(t,n){function i(e){return{width:e.clientWidth,height:e.clientHeight}}var o,r,s,a;o=e.getContainer(),r=e.getContentAreaContainer().firstChild,s=i(o),a=i(r),null!==t&&(t=Math.max(u.min_width||100,t),t=Math.min(u.max_width||65535,t),m.css(o,"width",t+(s.width-a.width)),m.css(r,"width",t)),n=Math.max(u.min_height||100,n),n=Math.min(u.max_height||65535,n),m.css(r,"height",n),e.fire("ResizeEditor")}function r(t,n){var i=e.getContentAreaContainer();l.resizeTo(i.clientWidth+t,i.clientHeight+n)}function s(o){function r(){if(h&&h.moveRel&&h.visible()&&!h._fixed){var t=e.selection.getScrollContainer(),n=e.getBody(),i=0,o=0;if(t){var r=m.getPos(n),s=m.getPos(t);i=Math.max(0,s.x-r.x),o=Math.max(0,s.y-r.y)}h.fixed(!1).moveRel(n,e.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl"]).moveBy(i,o)}}function s(){h&&(h.show(),r(),m.addClass(e.getBody(),"mce-edit-focus"))}function a(){h&&(h.hide(),m.removeClass(e.getBody(),"mce-edit-focus"))}function d(){return h?(h.visible()||s(),void 0):(h=l.panel=c.create({type:f?"panel":"floatpanel",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!!f,border:1,items:[u.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:n()},u.toolbar===!1?null:{type:"panel",layout:"stack",classes:"toolbar-grp",items:t()}]}),e.fire("BeforeRenderUI"),h.renderTo(f||document.body).reflow(),i(h),s(),e.on("nodeChange",r),e.on("activate",s),e.on("deactivate",a),e.nodeChanged(),void 0)}var h,f;return u.fixed_toolbar_container&&(f=m.select(u.fixed_toolbar_container)[0]),u.content_editable=!0,e.on("focus",function(){o.skinUiCss?tinymce.DOM.styleSheetLoader.load(o.skinUiCss,d,d):d()}),e.on("blur",a),e.on("remove",function(){h&&(h.remove(),h=null)}),o.skinUiCss&&tinymce.DOM.styleSheetLoader.load(o.skinUiCss),{}}function a(r){var s,a,d;return r.skinUiCss&&tinymce.DOM.loadCSS(r.skinUiCss),s=l.panel=c.create({type:"panel",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[u.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:n()},u.toolbar===!1?null:{type:"panel",layout:"stack",classes:"toolbar-grp",items:t()},{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),u.resize!==!1&&(a={type:"resizehandle",direction:u.resize,onResizeStart:function(){var t=e.getContentAreaContainer().firstChild;d={width:t.clientWidth,height:t.clientHeight}},onResize:function(e){"both"==u.resize?o(d.width+e.deltaX,d.height+e.deltaY):o(null,d.height+e.deltaY)}}),u.statusbar!==!1&&s.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",items:[{type:"elementpath"},a]}),u.readonly&&s.find("*").disabled(!0),e.fire("BeforeRenderUI"),s.renderBefore(r.targetNode).reflow(),u.width&&tinymce.DOM.setStyle(s.getEl(),"width",u.width),e.on("remove",function(){s.remove(),s=null}),i(s),{iframeContainer:s.find("#iframe")[0].getEl(),editorContainer:s.getEl()}}var l=this,u=e.settings,c=tinymce.ui.Factory,d=tinymce.each,m=tinymce.DOM,h={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},insert:{title:"Insert",items:"|"},view:{title:"View",items:"visualaid |"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table"},tools:{title:"Tools"}},f="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";l.renderUI=function(t){var n=u.skin!==!1?u.skin||"lightgray":!1;if(n){var i=u.skin_url;i=i?e.documentBaseURI.toAbsolute(i):tinymce.baseURL+"/skins/"+n,t.skinUiCss=tinymce.Env.documentMode<=7?i+"/skin.ie7.min.css":i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")}return e.on("ProgressState",function(e){l.throbber=l.throbber||new tinymce.ui.Throbber(l.panel.getEl("body")),e.state?l.throbber.show(e.time):l.throbber.hide()}),u.inline?s(t):a(t)},l.resizeTo=o,l.resizeBy=r});
     1tinymce.ThemeManager.add("modern",function(e){function t(){function t(t){var i,o=[];if(t)return d(t.split(/[ ,]/),function(t){function n(){var n=e.selection;"bullist"==r&&n.selectorChanged("ul > li",function(e,n){for(var i,o=n.parents.length;o--&&(i=n.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(e&&"UL"==i)}),"numlist"==r&&n.selectorChanged("ol > li",function(e,n){for(var i,o=n.parents.length;o--&&(i=n.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(e&&"OL"==i)}),t.settings.stateSelector&&n.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&n.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var r;"|"==t?i=null:c.has(t)?(t={type:t},u.toolbar_items_size&&(t.size=u.toolbar_items_size),o.push(t),i=null):(i||(i={type:"buttongroup",items:[]},o.push(i)),e.buttons[t]&&(r=t,t=e.buttons[r],"function"==typeof t&&(t=t()),t.type=t.type||"button",u.toolbar_items_size&&(t.size=u.toolbar_items_size),t=c.create(t),i.items.push(t),e.initialized?n():e.on("init",n)))}),n.push({type:"toolbar",layout:"flow",items:o}),!0}for(var n=[],i=1;10>i&&t(u["toolbar"+i]);i++);return n.length||t(u.toolbar||f),n}function n(){function t(t){var n;return"|"==t?{text:"|"}:n=e.menuItems[t]}function n(n){var i,o,r,a,s;if(s=tinymce.makeMap((u.removed_menuitems||"").split(/[ ,]/)),u.menu?(o=u.menu[n],a=!0):o=h[n],o){i={text:o.title},r=[],d((o.items||"").split(/[ ,]/),function(e){var n=t(e);n&&!s[e]&&r.push(t(e))}),a||d(e.menuItems,function(e){e.context==n&&("before"==e.separator&&r.push({text:"|"}),e.prependToContext?r.unshift(e):r.push(e),"after"==e.separator&&r.push({text:"|"}))});for(var l=0;l<r.length;l++)"|"==r[l].text&&(0===l||l==r.length-1)&&r.splice(l,1);if(i.menu=r,!i.menu.length)return null}return i}var i,o=[],r=[];if(u.menu)for(i in u.menu)r.push(i);else for(i in h)r.push(i);for(var a="string"==typeof u.menubar?u.menubar.split(/[ ,]/):r,s=0;s<a.length;s++){var l=a[s];l=n(l),l&&o.push(l)}return o}function i(t){function n(e){var n=t.find(e)[0];n&&n.focus(!0)}e.shortcuts.add("Alt+F9","",function(){n("menubar")}),e.shortcuts.add("Alt+F10","",function(){n("toolbar")}),e.shortcuts.add("Alt+F11","",function(){n("elementpath")}),t.on("cancel",function(){e.focus()})}function o(t,n){function i(e){return{width:e.clientWidth,height:e.clientHeight}}var o,r,a,s;o=e.getContainer(),r=e.getContentAreaContainer().firstChild,a=i(o),s=i(r),null!==t&&(t=Math.max(u.min_width||100,t),t=Math.min(u.max_width||65535,t),m.css(o,"width",t+(a.width-s.width)),m.css(r,"width",t)),n=Math.max(u.min_height||100,n),n=Math.min(u.max_height||65535,n),m.css(r,"height",n),e.fire("ResizeEditor")}function r(t,n){var i=e.getContentAreaContainer();l.resizeTo(i.clientWidth+t,i.clientHeight+n)}function a(o){function r(){if(h&&h.moveRel&&h.visible()&&!h._fixed){var t=e.selection.getScrollContainer(),n=e.getBody(),i=0,o=0;if(t){var r=m.getPos(n),a=m.getPos(t);i=Math.max(0,a.x-r.x),o=Math.max(0,a.y-r.y)}h.fixed(!1).moveRel(n,e.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl"]).moveBy(i,o)}}function a(){h&&(h.show(),r(),m.addClass(e.getBody(),"mce-edit-focus"))}function s(){h&&(h.hide(),m.removeClass(e.getBody(),"mce-edit-focus"))}function d(){return h?void(h.visible()||a()):(h=l.panel=c.create({type:f?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!!f,border:1,items:[u.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:n()},u.toolbar===!1?null:{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:t()}]}),e.fire("BeforeRenderUI"),h.renderTo(f||document.body).reflow(),i(h),a(),e.on("nodeChange",r),e.on("activate",a),e.on("deactivate",s),void e.nodeChanged())}var h,f;return u.fixed_toolbar_container&&(f=m.select(u.fixed_toolbar_container)[0]),u.content_editable=!0,e.on("focus",function(){o.skinUiCss?tinymce.DOM.styleSheetLoader.load(o.skinUiCss,d,d):d()}),e.on("blur",s),e.on("remove",function(){h&&(h.remove(),h=null)}),o.skinUiCss&&tinymce.DOM.styleSheetLoader.load(o.skinUiCss),{}}function s(r){var a,s,d;return r.skinUiCss&&tinymce.DOM.loadCSS(r.skinUiCss),a=l.panel=c.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[u.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:n()},u.toolbar===!1?null:{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:t()},{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),u.resize!==!1&&(s={type:"resizehandle",direction:u.resize,onResizeStart:function(){var t=e.getContentAreaContainer().firstChild;d={width:t.clientWidth,height:t.clientHeight}},onResize:function(e){"both"==u.resize?o(d.width+e.deltaX,d.height+e.deltaY):o(null,d.height+e.deltaY)}}),u.statusbar!==!1&&a.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath"},s]}),u.readonly&&a.find("*").disabled(!0),e.fire("BeforeRenderUI"),a.renderBefore(r.targetNode).reflow(),u.width&&tinymce.DOM.setStyle(a.getEl(),"width",u.width),e.on("remove",function(){a.remove(),a=null}),i(a),{iframeContainer:a.find("#iframe")[0].getEl(),editorContainer:a.getEl()}}var l=this,u=e.settings,c=tinymce.ui.Factory,d=tinymce.each,m=tinymce.DOM,h={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},insert:{title:"Insert",items:"|"},view:{title:"View",items:"visualaid |"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table"},tools:{title:"Tools"}},f="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";l.renderUI=function(t){var n=u.skin!==!1?u.skin||"lightgray":!1;if(n){var i=u.skin_url;i=i?e.documentBaseURI.toAbsolute(i):tinymce.baseURL+"/skins/"+n,t.skinUiCss=tinymce.Env.documentMode<=7?i+"/skin.ie7.min.css":i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")}return e.on("ProgressState",function(e){l.throbber=l.throbber||new tinymce.ui.Throbber(l.panel.getEl("body")),e.state?l.throbber.show(e.time):l.throbber.hide()}),u.inline?a(t):s(t)},l.resizeTo=o,l.resizeBy=r});
  • trunk/src/wp-includes/js/tinymce/tiny_mce_popup.js

    r27190 r27387  
    5959        });
    6060
    61         self.dom.bind(window, 'load', self._onDOMLoaded, self);
     61        self.dom.bind(window, 'ready', self._onDOMLoaded, self);
    6262
    6363        // Enables you to skip loading the default css
     
    330330        var e = window.event.srcElement;
    331331
    332         if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
     332        if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) {
    333333            tinyMCEPopup.restoreSelection();
     334        }
    334335    },
    335336
     
    387388        // Restore selection in IE when focus is placed on a non textarea or input element of the type text
    388389        if (tinymce.Env.ie) {
    389             if ( tinymce.Env.ie < 11 ) {
     390            if (tinymce.Env.ie < 11) {
    390391                document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
    391392
    392393                // Add base target element for it since it would fail with modal dialogs
    393                 t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'});
     394                t.dom.add(t.dom.select('head')[0], 'base', {target: '_self'});
    394395            } else {
    395396                document.addEventListener('mouseup', tinyMCEPopup._restoreSelection, false);
     
    441442        document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
    442443
    443         if ( 'textContent' in document ) {
     444        if ('textContent' in document) {
    444445            t.uiWindow.getEl('head').firstChild.textContent = document.title;
    445446        } else {
  • trunk/src/wp-includes/js/tinymce/tinymce.js

    r27062 r27387  
    1 // 4.0.16 (2014-01-31)
     1// 4.0.18 (2014-02-27)
    22
    33/**
     
    193193                    originalEvent.cancelBubble = true; // IE
    194194                }
    195              }
     195            }
    196196        };
    197197
     
    233233
    234234        function waitForDomLoaded() {
    235             if (doc.readyState === "complete" || doc.readyState === "interactive") {
     235            // Check complete or interactive state if there is a body
     236            // element on some iframes IE 8 will produce a null body
     237            if (doc.readyState === "complete" || (doc.readyState === "interactive" && doc.body)) {
    236238                removeEvent(doc, "readystatechange", waitForDomLoaded);
    237239                readyHandler();
     
    46054607        }
    46064608
    4607          function _traverseSameContainer(how) {
     4609        function _traverseSameContainer(how) {
    46084610            var frag, s, sub, n, cnt, sibling, xferNode, start, len;
    46094611
     
    90539055                        'blockquote center dir fieldset header footer article section hgroup aside nav figure');
    90549056        blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
    9055                         'th tr td li ol ul caption dl dt dd noscript menu isindex samp option ' +
     9057                        'th tr td li ol ul caption dl dt dd noscript menu isindex option ' +
    90569058                        'datalist select optgroup', textBlockElementsMap);
    90579059
     
    95679569        /**
    95689570         * Parses a valid elements string and adds it to the schema. The valid elements
    9569           format is for example "element[attr=default|otherattr]".
     9571         * format is for example "element[attr=default|otherattr]".
    95709572         * Existing rules will be replaced with the ones specified, so this extends the schema.
    95719573         *
     
    1227412276
    1227512277                    function startDrag(e) {
    12276                         resizeStarted = true;
    12277 
    1227812278                        startX = e.screenX;
    1227912279                        startY = e.screenY;
     
    1232312323                            'data-mce-bogus': true,
    1232412324                            'class': 'mce-resizehandle',
    12325                             contentEditable: false, // Hides IE move layer cursor
    12326                             unSelectabe: true,
     12325                            unselectable: true,
    1232712326                            style: 'cursor:' + name + '-resize; margin:0; padding:0'
    1232812327                        });
    1232912328
     12329                        // Hides IE move layer cursor
     12330                        // If we set it on Chrome we get this wounderful bug: #6725
     12331                        if (Env.ie) {
     12332                            handleElm.contentEditable = false;
     12333                        }
     12334
    1233012335                        dom.bind(handleElm, 'mousedown', function(e) {
     12336                            e.stopImmediatePropagation();
    1233112337                            e.preventDefault();
    1233212338                            startDrag(e);
     
    1256912575});
    1257012576
    12571 // Included from: js/tinymce/classes/dom/Selection.js
    12572 
    12573 /**
    12574  * Selection.js
    12575  *
    12576  * Copyright, Moxiecode Systems AB
    12577  * Released under LGPL License.
    12578  *
    12579  * License: http://www.tinymce.com/license
    12580  * Contributing: http://www.tinymce.com/contributing
    12581  */
    12582 
    12583 /**
    12584  * This class handles text and control selection it's an crossbrowser utility class.
    12585  * Consult the TinyMCE Wiki API for more details and examples on how to use this class.
    12586  *
    12587  * @class tinymce.dom.Selection
    12588  * @example
    12589  * // Getting the currently selected node for the active editor
    12590  * alert(tinymce.activeEditor.selection.getNode().nodeName);
    12591  */
    12592 define("tinymce/dom/Selection", [
    12593     "tinymce/dom/TreeWalker",
    12594     "tinymce/dom/TridentSelection",
    12595     "tinymce/dom/ControlSelection",
    12596     "tinymce/Env",
    12597     "tinymce/util/Tools"
    12598 ], function(TreeWalker, TridentSelection, ControlSelection, Env, Tools) {
    12599     var each = Tools.each, grep = Tools.grep, trim = Tools.trim;
    12600     var isIE = Env.ie, isOpera = Env.opera;
    12601 
    12602     /**
    12603      * Constructs a new selection instance.
    12604      *
    12605      * @constructor
    12606      * @method Selection
    12607      * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference.
    12608      * @param {Window} win Window to bind the selection object to.
    12609      * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent.
    12610      */
    12611     function Selection(dom, win, serializer, editor) {
    12612         var self = this;
    12613 
    12614         self.dom = dom;
    12615         self.win = win;
    12616         self.serializer = serializer;
    12617         self.editor = editor;
    12618 
    12619         self.controlSelection = new ControlSelection(self, editor);
    12620 
    12621         // No W3C Range support
    12622         if (!self.win.getSelection) {
    12623             self.tridentSel = new TridentSelection(self);
    12624         }
    12625     }
    12626 
    12627     Selection.prototype = {
    12628         /**
    12629          * Move the selection cursor range to the specified node and offset.
    12630          * If there is no node specified it will move it to the first suitable location within the body.
    12631          *
    12632          * @method setCursorLocation
    12633          * @param {Node} node Optional node to put the cursor in.
    12634          * @param {Number} offset Optional offset from the start of the node to put the cursor at.
    12635          */
    12636         setCursorLocation: function(node, offset) {
    12637             var self = this, rng = self.dom.createRng();
    12638 
    12639             if (!node) {
    12640                 self._moveEndPoint(rng, self.editor.getBody(), true);
    12641                 self.setRng(rng);
    12642             } else {
    12643                 rng.setStart(node, offset);
    12644                 rng.setEnd(node, offset);
    12645                 self.setRng(rng);
    12646                 self.collapse(false);
    12647             }
    12648         },
    12649 
    12650         /**
    12651          * Returns the selected contents using the DOM serializer passed in to this class.
    12652          *
    12653          * @method getContent
    12654          * @param {Object} s Optional settings class with for example output format text or html.
    12655          * @return {String} Selected contents in for example HTML format.
    12656          * @example
    12657          * // Alerts the currently selected contents
    12658          * alert(tinymce.activeEditor.selection.getContent());
    12659          *
    12660          * // Alerts the currently selected contents as plain text
    12661          * alert(tinymce.activeEditor.selection.getContent({format: 'text'}));
    12662          */
    12663         getContent: function(args) {
    12664             var self = this, rng = self.getRng(), tmpElm = self.dom.create("body");
    12665             var se = self.getSel(), whiteSpaceBefore, whiteSpaceAfter, fragment;
    12666 
    12667             args = args || {};
    12668             whiteSpaceBefore = whiteSpaceAfter = '';
    12669             args.get = true;
    12670             args.format = args.format || 'html';
    12671             args.selection = true;
    12672             self.editor.fire('BeforeGetContent', args);
    12673 
    12674             if (args.format == 'text') {
    12675                 return self.isCollapsed() ? '' : (rng.text || (se.toString ? se.toString() : ''));
    12676             }
    12677 
    12678             if (rng.cloneContents) {
    12679                 fragment = rng.cloneContents();
    12680 
    12681                 if (fragment) {
    12682                     tmpElm.appendChild(fragment);
    12683                 }
    12684             } else if (rng.item !== undefined || rng.htmlText !== undefined) {
    12685                 // IE will produce invalid markup if elements are present that
    12686                 // it doesn't understand like custom elements or HTML5 elements.
    12687                 // Adding a BR in front of the contents and then remoiving it seems to fix it though.
    12688                 tmpElm.innerHTML = '<br>' + (rng.item ? rng.item(0).outerHTML : rng.htmlText);
    12689                 tmpElm.removeChild(tmpElm.firstChild);
    12690             } else {
    12691                 tmpElm.innerHTML = rng.toString();
    12692             }
    12693 
    12694             // Keep whitespace before and after
    12695             if (/^\s/.test(tmpElm.innerHTML)) {
    12696                 whiteSpaceBefore = ' ';
    12697             }
    12698 
    12699             if (/\s+$/.test(tmpElm.innerHTML)) {
    12700                 whiteSpaceAfter = ' ';
    12701             }
    12702 
    12703             args.getInner = true;
    12704 
    12705             args.content = self.isCollapsed() ? '' : whiteSpaceBefore + self.serializer.serialize(tmpElm, args) + whiteSpaceAfter;
    12706             self.editor.fire('GetContent', args);
    12707 
    12708             return args.content;
    12709         },
    12710 
    12711         /**
    12712          * Sets the current selection to the specified content. If any contents is selected it will be replaced
    12713          * with the contents passed in to this function. If there is no selection the contents will be inserted
    12714          * where the caret is placed in the editor/page.
    12715          *
    12716          * @method setContent
    12717          * @param {String} content HTML contents to set could also be other formats depending on settings.
    12718          * @param {Object} args Optional settings object with for example data format.
    12719          * @example
    12720          * // Inserts some HTML contents at the current selection
    12721          * tinymce.activeEditor.selection.setContent('<strong>Some contents</strong>');
    12722          */
    12723         setContent: function(content, args) {
    12724             var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp;
    12725 
    12726             args = args || {format: 'html'};
    12727             args.set = true;
    12728             args.selection = true;
    12729             content = args.content = content;
    12730 
    12731             // Dispatch before set content event
    12732             if (!args.no_events) {
    12733                 self.editor.fire('BeforeSetContent', args);
    12734             }
    12735 
    12736             content = args.content;
    12737 
    12738             if (rng.insertNode) {
    12739                 // Make caret marker since insertNode places the caret in the beginning of text after insert
    12740                 content += '<span id="__caret">_</span>';
    12741 
    12742                 // Delete and insert new node
    12743                 if (rng.startContainer == doc && rng.endContainer == doc) {
    12744                     // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents
    12745                     doc.body.innerHTML = content;
    12746                 } else {
    12747                     rng.deleteContents();
    12748 
    12749                     if (doc.body.childNodes.length === 0) {
    12750                         doc.body.innerHTML = content;
    12751                     } else {
    12752                         // createContextualFragment doesn't exists in IE 9 DOMRanges
    12753                         if (rng.createContextualFragment) {
    12754                             rng.insertNode(rng.createContextualFragment(content));
    12755                         } else {
    12756                             // Fake createContextualFragment call in IE 9
    12757                             frag = doc.createDocumentFragment();
    12758                             temp = doc.createElement('div');
    12759 
    12760                             frag.appendChild(temp);
    12761                             temp.outerHTML = content;
    12762 
    12763                             rng.insertNode(frag);
    12764                         }
    12765                     }
    12766                 }
    12767 
    12768                 // Move to caret marker
    12769                 caretNode = self.dom.get('__caret');
    12770 
    12771                 // Make sure we wrap it compleatly, Opera fails with a simple select call
    12772                 rng = doc.createRange();
    12773                 rng.setStartBefore(caretNode);
    12774                 rng.setEndBefore(caretNode);
    12775                 self.setRng(rng);
    12776 
    12777                 // Remove the caret position
    12778                 self.dom.remove('__caret');
    12779 
    12780                 try {
    12781                     self.setRng(rng);
    12782                 } catch (ex) {
    12783                     // Might fail on Opera for some odd reason
    12784                 }
    12785             } else {
    12786                 if (rng.item) {
    12787                     // Delete content and get caret text selection
    12788                     doc.execCommand('Delete', false, null);
    12789                     rng = self.getRng();
    12790                 }
    12791 
    12792                 // Explorer removes spaces from the beginning of pasted contents
    12793                 if (/^\s+/.test(content)) {
    12794                     rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
    12795                     self.dom.remove('__mce_tmp');
    12796                 } else {
    12797                     rng.pasteHTML(content);
    12798                 }
    12799             }
    12800 
    12801             // Dispatch set content event
    12802             if (!args.no_events) {
    12803                 self.editor.fire('SetContent', args);
    12804             }
    12805         },
    12806 
    12807         /**
    12808          * Returns the start element of a selection range. If the start is in a text
    12809          * node the parent element will be returned.
    12810          *
    12811          * @method getStart
    12812          * @return {Element} Start element of selection range.
    12813          */
    12814         getStart: function() {
    12815             var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;
    12816 
    12817             if (rng.duplicate || rng.item) {
    12818                 // Control selection, return first item
    12819                 if (rng.item) {
    12820                     return rng.item(0);
    12821                 }
    12822 
    12823                 // Get start element
    12824                 checkRng = rng.duplicate();
    12825                 checkRng.collapse(1);
    12826                 startElement = checkRng.parentElement();
    12827                 if (startElement.ownerDocument !== self.dom.doc) {
    12828                     startElement = self.dom.getRoot();
    12829                 }
    12830 
    12831                 // Check if range parent is inside the start element, then return the inner parent element
    12832                 // This will fix issues when a single element is selected, IE would otherwise return the wrong start element
    12833                 parentElement = node = rng.parentElement();
    12834                 while ((node = node.parentNode)) {
    12835                     if (node == startElement) {
    12836                         startElement = parentElement;
    12837                         break;
    12838                     }
    12839                 }
    12840 
    12841                 return startElement;
    12842             } else {
    12843                 startElement = rng.startContainer;
    12844 
    12845                 if (startElement.nodeType == 1 && startElement.hasChildNodes()) {
    12846                     startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];
    12847                 }
    12848 
    12849                 if (startElement && startElement.nodeType == 3) {
    12850                     return startElement.parentNode;
    12851                 }
    12852 
    12853                 return startElement;
    12854             }
    12855         },
    12856 
    12857         /**
    12858          * Returns the end element of a selection range. If the end is in a text
    12859          * node the parent element will be returned.
    12860          *
    12861          * @method getEnd
    12862          * @return {Element} End element of selection range.
    12863          */
    12864         getEnd: function() {
    12865             var self = this, rng = self.getRng(), endElement, endOffset;
    12866 
    12867             if (rng.duplicate || rng.item) {
    12868                 if (rng.item) {
    12869                     return rng.item(0);
    12870                 }
    12871 
    12872                 rng = rng.duplicate();
    12873                 rng.collapse(0);
    12874                 endElement = rng.parentElement();
    12875                 if (endElement.ownerDocument !== self.dom.doc) {
    12876                     endElement = self.dom.getRoot();
    12877                 }
    12878 
    12879                 if (endElement && endElement.nodeName == 'BODY') {
    12880                     return endElement.lastChild || endElement;
    12881                 }
    12882 
    12883                 return endElement;
    12884             } else {
    12885                 endElement = rng.endContainer;
    12886                 endOffset = rng.endOffset;
    12887 
    12888                 if (endElement.nodeType == 1 && endElement.hasChildNodes()) {
    12889                     endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];
    12890                 }
    12891 
    12892                 if (endElement && endElement.nodeType == 3) {
    12893                     return endElement.parentNode;
    12894                 }
    12895 
    12896                 return endElement;
    12897             }
    12898         },
    12899 
    12900         /**
    12901          * Returns a bookmark location for the current selection. This bookmark object
    12902          * can then be used to restore the selection after some content modification to the document.
    12903          *
    12904          * @method getBookmark
    12905          * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
    12906          * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
    12907          * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
    12908          * @example
    12909          * // Stores a bookmark of the current selection
    12910          * var bm = tinymce.activeEditor.selection.getBookmark();
    12911          *
    12912          * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
    12913          *
    12914          * // Restore the selection bookmark
    12915          * tinymce.activeEditor.selection.moveToBookmark(bm);
    12916          */
    12917         getBookmark: function(type, normalized) {
    12918             var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, chr = '&#xFEFF;', styles;
    12919 
    12920             function findIndex(name, element) {
    12921                 var index = 0;
    12922 
    12923                 each(dom.select(name), function(node, i) {
    12924                     if (node == element) {
    12925                         index = i;
    12926                     }
    12927                 });
    12928 
    12929                 return index;
    12930             }
    12931 
    12932             function normalizeTableCellSelection(rng) {
    12933                 function moveEndPoint(start) {
    12934                     var container, offset, childNodes, prefix = start ? 'start' : 'end';
    12935 
    12936                     container = rng[prefix + 'Container'];
    12937                     offset = rng[prefix + 'Offset'];
    12938 
    12939                     if (container.nodeType == 1 && container.nodeName == "TR") {
    12940                         childNodes = container.childNodes;
    12941                         container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
    12942                         if (container) {
    12943                             offset = start ? 0 : container.childNodes.length;
    12944                             rng['set' + (start ? 'Start' : 'End')](container, offset);
    12945                         }
    12946                     }
    12947                 }
    12948 
    12949                 moveEndPoint(true);
    12950                 moveEndPoint();
    12951 
    12952                 return rng;
    12953             }
    12954 
    12955             function getLocation() {
    12956                 var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};
    12957 
    12958                 function getPoint(rng, start) {
    12959                     var container = rng[start ? 'startContainer' : 'endContainer'],
    12960                         offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;
    12961 
    12962                     if (container.nodeType == 3) {
    12963                         if (normalized) {
    12964                             for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) {
    12965                                 offset += node.nodeValue.length;
    12966                             }
    12967                         }
    12968 
    12969                         point.push(offset);
    12970                     } else {
    12971                         childNodes = container.childNodes;
    12972 
    12973                         if (offset >= childNodes.length && childNodes.length) {
    12974                             after = 1;
    12975                             offset = Math.max(0, childNodes.length - 1);
    12976                         }
    12977 
    12978                         point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after);
    12979                     }
    12980 
    12981                     for (; container && container != root; container = container.parentNode) {
    12982                         point.push(t.dom.nodeIndex(container, normalized));
    12983                     }
    12984 
    12985                     return point;
    12986                 }
    12987 
    12988                 bookmark.start = getPoint(rng, true);
    12989 
    12990                 if (!t.isCollapsed()) {
    12991                     bookmark.end = getPoint(rng);
    12992                 }
    12993 
    12994                 return bookmark;
    12995             }
    12996 
    12997             if (type == 2) {
    12998                 element = t.getNode();
    12999                 name = element ? element.nodeName : null;
    13000 
    13001                 if (name == 'IMG') {
    13002                     return {name: name, index: findIndex(name, element)};
    13003                 }
    13004 
    13005                 if (t.tridentSel) {
    13006                     return t.tridentSel.getBookmark(type);
    13007                 }
    13008 
    13009                 return getLocation();
    13010             }
    13011 
    13012             // Handle simple range
    13013             if (type) {
    13014                 return {rng: t.getRng()};
    13015             }
    13016 
    13017             rng = t.getRng();
    13018             id = dom.uniqueId();
    13019             collapsed = t.isCollapsed();
    13020             styles = 'overflow:hidden;line-height:0px';
    13021 
    13022             // Explorer method
    13023             if (rng.duplicate || rng.item) {
    13024                 // Text selection
    13025                 if (!rng.item) {
    13026                     rng2 = rng.duplicate();
    13027 
    13028                     try {
    13029                         // Insert start marker
    13030                         rng.collapse();
    13031                         rng.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');
    13032 
    13033                         // Insert end marker
    13034                         if (!collapsed) {
    13035                             rng2.collapse(false);
    13036 
    13037                             // Detect the empty space after block elements in IE and move the
    13038                             // end back one character <p></p>] becomes <p>]</p>
    13039                             rng.moveToElementText(rng2.parentElement());
    13040                             if (rng.compareEndPoints('StartToEnd', rng2) === 0) {
    13041                                 rng2.move('character', -1);
    13042                             }
    13043 
    13044                             rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');
    13045                         }
    13046                     } catch (ex) {
    13047                         // IE might throw unspecified error so lets ignore it
    13048                         return null;
    13049                     }
    13050                 } else {
    13051                     // Control selection
    13052                     element = rng.item(0);
    13053                     name = element.nodeName;
    13054 
    13055                     return {name: name, index: findIndex(name, element)};
    13056                 }
    13057             } else {
    13058                 element = t.getNode();
    13059                 name = element.nodeName;
    13060                 if (name == 'IMG') {
    13061                     return {name: name, index: findIndex(name, element)};
    13062                 }
    13063 
    13064                 // W3C method
    13065                 rng2 = normalizeTableCellSelection(rng.cloneRange());
    13066 
    13067                 // Insert end marker
    13068                 if (!collapsed) {
    13069                     rng2.collapse(false);
    13070                     rng2.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_end', style: styles}, chr));
    13071                 }
    13072 
    13073                 rng = normalizeTableCellSelection(rng);
    13074                 rng.collapse(true);
    13075                 rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr));
    13076             }
    13077 
    13078             t.moveToBookmark({id: id, keep: 1});
    13079 
    13080             return {id: id};
    13081         },
    13082 
    13083         /**
    13084          * Restores the selection to the specified bookmark.
    13085          *
    13086          * @method moveToBookmark
    13087          * @param {Object} bookmark Bookmark to restore selection from.
    13088          * @return {Boolean} true/false if it was successful or not.
    13089          * @example
    13090          * // Stores a bookmark of the current selection
    13091          * var bm = tinymce.activeEditor.selection.getBookmark();
    13092          *
    13093          * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
    13094          *
    13095          * // Restore the selection bookmark
    13096          * tinymce.activeEditor.selection.moveToBookmark(bm);
    13097          */
    13098         moveToBookmark: function(bookmark) {
    13099             var t = this, dom = t.dom, rng, root, startContainer, endContainer, startOffset, endOffset;
    13100 
    13101             function setEndPoint(start) {
    13102                 var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
    13103 
    13104                 if (point) {
    13105                     offset = point[0];
    13106 
    13107                     // Find container node
    13108                     for (node = root, i = point.length - 1; i >= 1; i--) {
    13109                         children = node.childNodes;
    13110 
    13111                         if (point[i] > children.length - 1) {
    13112                             return;
    13113                         }
    13114 
    13115                         node = children[point[i]];
    13116                     }
    13117 
    13118                     // Move text offset to best suitable location
    13119                     if (node.nodeType === 3) {
    13120                         offset = Math.min(point[0], node.nodeValue.length);
    13121                     }
    13122 
    13123                     // Move element offset to best suitable location
    13124                     if (node.nodeType === 1) {
    13125                         offset = Math.min(point[0], node.childNodes.length);
    13126                     }
    13127 
    13128                     // Set offset within container node
    13129                     if (start) {
    13130                         rng.setStart(node, offset);
    13131                     } else {
    13132                         rng.setEnd(node, offset);
    13133                     }
    13134                 }
    13135 
    13136                 return true;
    13137             }
    13138 
    13139             function restoreEndPoint(suffix) {
    13140                 var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;
    13141 
    13142                 if (marker) {
    13143                     node = marker.parentNode;
    13144 
    13145                     if (suffix == 'start') {
    13146                         if (!keep) {
    13147                             idx = dom.nodeIndex(marker);
    13148                         } else {
    13149                             node = marker.firstChild;
    13150                             idx = 1;
    13151                         }
    13152 
    13153                         startContainer = endContainer = node;
    13154                         startOffset = endOffset = idx;
    13155                     } else {
    13156                         if (!keep) {
    13157                             idx = dom.nodeIndex(marker);
    13158                         } else {
    13159                             node = marker.firstChild;
    13160                             idx = 1;
    13161                         }
    13162 
    13163                         endContainer = node;
    13164                         endOffset = idx;
    13165                     }
    13166 
    13167                     if (!keep) {
    13168                         prev = marker.previousSibling;
    13169                         next = marker.nextSibling;
    13170 
    13171                         // Remove all marker text nodes
    13172                         each(grep(marker.childNodes), function(node) {
    13173                             if (node.nodeType == 3) {
    13174                                 node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
    13175                             }
    13176                         });
    13177 
    13178                         // Remove marker but keep children if for example contents where inserted into the marker
    13179                         // Also remove duplicated instances of the marker for example by a
    13180                         // split operation or by WebKit auto split on paste feature
    13181                         while ((marker = dom.get(bookmark.id + '_' + suffix))) {
    13182                             dom.remove(marker, 1);
    13183                         }
    13184 
    13185                         // If siblings are text nodes then merge them unless it's Opera since it some how removes the node
    13186                         // and we are sniffing since adding a lot of detection code for a browser with 3% of the market
    13187                         // isn't worth the effort. Sorry, Opera but it's just a fact
    13188                         if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !isOpera) {
    13189                             idx = prev.nodeValue.length;
    13190                             prev.appendData(next.nodeValue);
    13191                             dom.remove(next);
    13192 
    13193                             if (suffix == 'start') {
    13194                                 startContainer = endContainer = prev;
    13195                                 startOffset = endOffset = idx;
    13196                             } else {
    13197                                 endContainer = prev;
    13198                                 endOffset = idx;
    13199                             }
    13200                         }
    13201                     }
    13202                 }
    13203             }
    13204 
    13205             function addBogus(node) {
    13206                 // Adds a bogus BR element for empty block elements
    13207                 if (dom.isBlock(node) && !node.innerHTML && !isIE) {
    13208                     node.innerHTML = '<br data-mce-bogus="1" />';
    13209                 }
    13210 
    13211                 return node;
    13212             }
    13213 
    13214             if (bookmark) {
    13215                 if (bookmark.start) {
    13216                     rng = dom.createRng();
    13217                     root = dom.getRoot();
    13218 
    13219                     if (t.tridentSel) {
    13220                         return t.tridentSel.moveToBookmark(bookmark);
    13221                     }
    13222 
    13223                     if (setEndPoint(true) && setEndPoint()) {
    13224                         t.setRng(rng);
    13225                     }
    13226                 } else if (bookmark.id) {
    13227                     // Restore start/end points
    13228                     restoreEndPoint('start');
    13229                     restoreEndPoint('end');
    13230 
    13231                     if (startContainer) {
    13232                         rng = dom.createRng();
    13233                         rng.setStart(addBogus(startContainer), startOffset);
    13234                         rng.setEnd(addBogus(endContainer), endOffset);
    13235                         t.setRng(rng);
    13236                     }
    13237                 } else if (bookmark.name) {
    13238                     t.select(dom.select(bookmark.name)[bookmark.index]);
    13239                 } else if (bookmark.rng) {
    13240                     t.setRng(bookmark.rng);
    13241                 }
    13242             }
    13243         },
    13244 
    13245         /**
    13246          * Selects the specified element. This will place the start and end of the selection range around the element.
    13247          *
    13248          * @method select
    13249          * @param {Element} node HMTL DOM element to select.
    13250          * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser.
    13251          * @return {Element} Selected element the same element as the one that got passed in.
    13252          * @example
    13253          * // Select the first paragraph in the active editor
    13254          * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
    13255          */
    13256         select: function(node, content) {
    13257             var self = this, dom = self.dom, rng = dom.createRng(), idx;
    13258 
    13259             // Clear stored range set by FocusManager
    13260             self.lastFocusBookmark = null;
    13261 
    13262             if (node) {
    13263                 if (!content && self.controlSelection.controlSelect(node)) {
    13264                     return;
    13265                 }
    13266 
    13267                 idx = dom.nodeIndex(node);
    13268                 rng.setStart(node.parentNode, idx);
    13269                 rng.setEnd(node.parentNode, idx + 1);
    13270 
    13271                 // Find first/last text node or BR element
    13272                 if (content) {
    13273                     self._moveEndPoint(rng, node, true);
    13274                     self._moveEndPoint(rng, node);
    13275                 }
    13276 
    13277                 self.setRng(rng);
    13278             }
    13279 
    13280             return node;
    13281         },
    13282 
    13283         /**
    13284          * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection.
    13285          *
    13286          * @method isCollapsed
    13287          * @return {Boolean} true/false state if the selection range is collapsed or not.
    13288          * Collapsed means if it's a caret or a larger selection.
    13289          */
    13290         isCollapsed: function() {
    13291             var self = this, rng = self.getRng(), sel = self.getSel();
    13292 
    13293             if (!rng || rng.item) {
    13294                 return false;
    13295             }
    13296 
    13297             if (rng.compareEndPoints) {
    13298                 return rng.compareEndPoints('StartToEnd', rng) === 0;
    13299             }
    13300 
    13301             return !sel || rng.collapsed;
    13302         },
    13303 
    13304         /**
    13305          * Collapse the selection to start or end of range.
    13306          *
    13307          * @method collapse
    13308          * @param {Boolean} to_start Optional boolean state if to collapse to end or not. Defaults to start.
    13309          */
    13310         collapse: function(to_start) {
    13311             var self = this, rng = self.getRng(), node;
    13312 
    13313             // Control range on IE
    13314             if (rng.item) {
    13315                 node = rng.item(0);
    13316                 rng = self.win.document.body.createTextRange();
    13317                 rng.moveToElementText(node);
    13318             }
    13319 
    13320             rng.collapse(!!to_start);
    13321             self.setRng(rng);
    13322         },
    13323 
    13324         /**
    13325          * Returns the browsers internal selection object.
    13326          *
    13327          * @method getSel
    13328          * @return {Selection} Internal browser selection object.
    13329          */
    13330         getSel: function() {
    13331             var win = this.win;
    13332 
    13333             return win.getSelection ? win.getSelection() : win.document.selection;
    13334         },
    13335 
    13336         /**
    13337          * Returns the browsers internal range object.
    13338          *
    13339          * @method getRng
    13340          * @param {Boolean} w3c Forces a compatible W3C range on IE.
    13341          * @return {Range} Internal browser range object.
    13342          * @see http://www.quirksmode.org/dom/range_intro.html
    13343          * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/
    13344          */
    13345         getRng: function(w3c) {
    13346             var self = this, selection, rng, elm, doc = self.win.document, ieRng;
    13347 
    13348             // Use last rng passed from FocusManager if it's available this enables
    13349             // calls to editor.selection.getStart() to work when caret focus is lost on IE
    13350             if (!w3c && self.lastFocusBookmark) {
    13351                 var bookmark = self.lastFocusBookmark;
    13352 
    13353                 // Convert bookmark to range IE 11 fix
    13354                 if (bookmark.startContainer) {
    13355                     rng = doc.createRange();
    13356                     rng.setStart(bookmark.startContainer, bookmark.startOffset);
    13357                     rng.setEnd(bookmark.endContainer, bookmark.endOffset);
    13358                 } else {
    13359                     rng = bookmark;
    13360                 }
    13361 
    13362                 return rng;
    13363             }
    13364 
    13365             // Found tridentSel object then we need to use that one
    13366             if (w3c && self.tridentSel) {
    13367                 return self.tridentSel.getRangeAt(0);
    13368             }
    13369 
    13370             try {
    13371                 if ((selection = self.getSel())) {
    13372                     if (selection.rangeCount > 0) {
    13373                         rng = selection.getRangeAt(0);
    13374                     } else {
    13375                         rng = selection.createRange ? selection.createRange() : doc.createRange();
    13376                     }
    13377                 }
    13378             } catch (ex) {
    13379                 // IE throws unspecified error here if TinyMCE is placed in a frame/iframe
    13380             }
    13381 
    13382             // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
    13383             // IE 11 doesn't support the selection object so we check for that as well
    13384             if (isIE && rng && rng.setStart && doc.selection) {
    13385                 try {
    13386                     // IE will sometimes throw an exception here
    13387                     ieRng = doc.selection.createRange();
    13388                 } catch (ex) {
    13389 
    13390                 }
    13391 
    13392                 if (ieRng && ieRng.item) {
    13393                     elm = ieRng.item(0);
    13394                     rng = doc.createRange();
    13395                     rng.setStartBefore(elm);
    13396                     rng.setEndAfter(elm);
    13397                 }
    13398             }
    13399 
    13400             // No range found then create an empty one
    13401             // This can occur when the editor is placed in a hidden container element on Gecko
    13402             // Or on IE when there was an exception
    13403             if (!rng) {
    13404                 rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
    13405             }
    13406 
    13407             // If range is at start of document then move it to start of body
    13408             if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
    13409                 elm = self.dom.getRoot();
    13410                 rng.setStart(elm, 0);
    13411                 rng.setEnd(elm, 0);
    13412             }
    13413 
    13414             if (self.selectedRange && self.explicitRange) {
    13415                 if (rng.compareBoundaryPoints(rng.START_TO_START, self.selectedRange) === 0 &&
    13416                     rng.compareBoundaryPoints(rng.END_TO_END, self.selectedRange) === 0) {
    13417                     // Safari, Opera and Chrome only ever select text which causes the range to change.
    13418                     // This lets us use the originally set range if the selection hasn't been changed by the user.
    13419                     rng = self.explicitRange;
    13420                 } else {
    13421                     self.selectedRange = null;
    13422                     self.explicitRange = null;
    13423                 }
    13424             }
    13425 
    13426             return rng;
    13427         },
    13428 
    13429         /**
    13430          * Changes the selection to the specified DOM range.
    13431          *
    13432          * @method setRng
    13433          * @param {Range} rng Range to select.
    13434          */
    13435         setRng: function(rng, forward) {
    13436             var self = this, sel;
    13437 
    13438             // Is IE specific range
    13439             if (rng.select) {
    13440                 try {
    13441                     rng.select();
    13442                 } catch (ex) {
    13443                     // Needed for some odd IE bug #1843306
    13444                 }
    13445 
    13446                 return;
    13447             }
    13448 
    13449             if (!self.tridentSel) {
    13450                 sel = self.getSel();
    13451 
    13452                 if (sel) {
    13453                     self.explicitRange = rng;
    13454 
    13455                     try {
    13456                         sel.removeAllRanges();
    13457                         sel.addRange(rng);
    13458                     } catch (ex) {
    13459                         // IE might throw errors here if the editor is within a hidden container and selection is changed
    13460                     }
    13461 
    13462                     // Forward is set to false and we have an extend function
    13463                     if (forward === false && sel.extend) {
    13464                         sel.collapse(rng.endContainer, rng.endOffset);
    13465                         sel.extend(rng.startContainer, rng.startOffset);
    13466                     }
    13467 
    13468                     // adding range isn't always successful so we need to check range count otherwise an exception can occur
    13469                     self.selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
    13470                 }
    13471             } else {
    13472                 // Is W3C Range fake range on IE
    13473                 if (rng.cloneRange) {
    13474                     try {
    13475                         self.tridentSel.addRange(rng);
    13476                         return;
    13477                     } catch (ex) {
    13478                         //IE9 throws an error here if called before selection is placed in the editor
    13479                     }
    13480                 }
    13481             }
    13482         },
    13483 
    13484         /**
    13485          * Sets the current selection to the specified DOM element.
    13486          *
    13487          * @method setNode
    13488          * @param {Element} elm Element to set as the contents of the selection.
    13489          * @return {Element} Returns the element that got passed in.
    13490          * @example
    13491          * // Inserts a DOM node at current selection/caret location
    13492          * tinymce.activeEditor.selection.setNode(tinymce.activeEditor.dom.create('img', {src: 'some.gif', title: 'some title'}));
    13493          */
    13494         setNode: function(elm) {
    13495             var self = this;
    13496 
    13497             self.setContent(self.dom.getOuterHTML(elm));
    13498 
    13499             return elm;
    13500         },
    13501 
    13502         /**
    13503          * Returns the currently selected element or the common ancestor element for both start and end of the selection.
    13504          *
    13505          * @method getNode
    13506          * @return {Element} Currently selected element or common ancestor element.
    13507          * @example
    13508          * // Alerts the currently selected elements node name
    13509          * alert(tinymce.activeEditor.selection.getNode().nodeName);
    13510          */
    13511         getNode: function() {
    13512             var self = this, rng = self.getRng(), elm;
    13513             var startContainer = rng.startContainer, endContainer = rng.endContainer;
    13514             var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot();
    13515 
    13516             function skipEmptyTextNodes(node, forwards) {
    13517                 var orig = node;
    13518 
    13519                 while (node && node.nodeType === 3 && node.length === 0) {
    13520                     node = forwards ? node.nextSibling : node.previousSibling;
    13521                 }
    13522 
    13523                 return node || orig;
    13524             }
    13525 
    13526             // Range maybe lost after the editor is made visible again
    13527             if (!rng) {
    13528                 return root;
    13529             }
    13530 
    13531             if (rng.setStart) {
    13532                 elm = rng.commonAncestorContainer;
    13533 
    13534                 // Handle selection a image or other control like element such as anchors
    13535                 if (!rng.collapsed) {
    13536                     if (startContainer == endContainer) {
    13537                         if (endOffset - startOffset < 2) {
    13538                             if (startContainer.hasChildNodes()) {
    13539                                 elm = startContainer.childNodes[startOffset];
    13540                             }
    13541                         }
    13542                     }
    13543 
    13544                     // If the anchor node is a element instead of a text node then return this element
    13545                     //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1)
    13546                     //  return sel.anchorNode.childNodes[sel.anchorOffset];
    13547 
    13548                     // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent.
    13549                     // This happens when you double click an underlined word in FireFox.
    13550                     if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
    13551                         if (startContainer.length === startOffset) {
    13552                             startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
    13553                         } else {
    13554                             startContainer = startContainer.parentNode;
    13555                         }
    13556 
    13557                         if (endOffset === 0) {
    13558                             endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
    13559                         } else {
    13560                             endContainer = endContainer.parentNode;
    13561                         }
    13562 
    13563                         if (startContainer && startContainer === endContainer) {
    13564                             return startContainer;
    13565                         }
    13566                     }
    13567                 }
    13568 
    13569                 if (elm && elm.nodeType == 3) {
    13570                     return elm.parentNode;
    13571                 }
    13572 
    13573                 return elm;
    13574             }
    13575 
    13576             elm = rng.item ? rng.item(0) : rng.parentElement();
    13577 
    13578             // IE 7 might return elements outside the iframe
    13579             if (elm.ownerDocument !== self.win.document) {
    13580                 elm = root;
    13581             }
    13582 
    13583             return elm;
    13584         },
    13585 
    13586         getSelectedBlocks: function(startElm, endElm) {
    13587             var self = this, dom = self.dom, node, root, selectedBlocks = [];
    13588 
    13589             root = dom.getRoot();
    13590             startElm = dom.getParent(startElm || self.getStart(), dom.isBlock);
    13591             endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock);
    13592 
    13593             if (startElm && startElm != root) {
    13594                 selectedBlocks.push(startElm);
    13595             }
    13596 
    13597             if (startElm && endElm && startElm != endElm) {
    13598                 node = startElm;
    13599 
    13600                 var walker = new TreeWalker(startElm, root);
    13601                 while ((node = walker.next()) && node != endElm) {
    13602                     if (dom.isBlock(node)) {
    13603                         selectedBlocks.push(node);
    13604                     }
    13605                 }
    13606             }
    13607 
    13608             if (endElm && startElm != endElm && endElm != root) {
    13609                 selectedBlocks.push(endElm);
    13610             }
    13611 
    13612             return selectedBlocks;
    13613         },
    13614 
    13615         isForward: function(){
    13616             var dom = this.dom, sel = this.getSel(), anchorRange, focusRange;
    13617 
    13618             // No support for selection direction then always return true
    13619             if (!sel || !sel.anchorNode || !sel.focusNode) {
    13620                 return true;
    13621             }
    13622 
    13623             anchorRange = dom.createRng();
    13624             anchorRange.setStart(sel.anchorNode, sel.anchorOffset);
    13625             anchorRange.collapse(true);
    13626 
    13627             focusRange = dom.createRng();
    13628             focusRange.setStart(sel.focusNode, sel.focusOffset);
    13629             focusRange.collapse(true);
    13630 
    13631             return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
    13632         },
    13633 
    13634         normalize: function() {
    13635             var self = this, rng, normalized, collapsed;
    13636 
    13637             function normalizeEndPoint(start) {
    13638                 var container, offset, walker, dom = self.dom, body = dom.getRoot(), node, nonEmptyElementsMap, nodeName;
    13639                 var directionLeft;
    13640 
    13641                 function hasBrBeforeAfter(node, left) {
    13642                     var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);
    13643 
    13644                     while ((node = walker[left ? 'prev' : 'next']())) {
    13645                         if (node.nodeName === "BR") {
    13646                             return true;
    13647                         }
    13648                     }
    13649                 }
    13650 
    13651                 function isPrevNode(node, name) {
    13652                     return node.previousSibling && node.previousSibling.nodeName == name;
    13653                 }
    13654 
    13655                 // Walks the dom left/right to find a suitable text node to move the endpoint into
    13656                 // It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG
    13657                 function findTextNodeRelative(left, startNode) {
    13658                     var walker, lastInlineElement;
    13659 
    13660                     startNode = startNode || container;
    13661                     walker = new TreeWalker(startNode, dom.getParent(startNode.parentNode, dom.isBlock) || body);
    13662 
    13663                     // Walk left until we hit a text node we can move to or a block/br/img
    13664                     while ((node = walker[left ? 'prev' : 'next']())) {
    13665                         // Found text node that has a length
    13666                         if (node.nodeType === 3 && node.nodeValue.length > 0) {
    13667                             container = node;
    13668                             offset = left ? node.nodeValue.length : 0;
    13669                             normalized = true;
    13670                             return;
    13671                         }
    13672 
    13673                         // Break if we find a block or a BR/IMG/INPUT etc
    13674                         if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
    13675                             return;
    13676                         }
    13677 
    13678                         lastInlineElement = node;
    13679                     }
    13680 
    13681                     // Only fetch the last inline element when in caret mode for now
    13682                     if (collapsed && lastInlineElement) {
    13683                         container = lastInlineElement;
    13684                         normalized = true;
    13685                         offset = 0;
    13686                     }
    13687                 }
    13688 
    13689                 container = rng[(start ? 'start' : 'end') + 'Container'];
    13690                 offset = rng[(start ? 'start' : 'end') + 'Offset'];
    13691                 nonEmptyElementsMap = dom.schema.getNonEmptyElements();
    13692                 directionLeft = start;
    13693 
    13694                 if (container.nodeType == 1 && offset > container.childNodes.length - 1) {
    13695                     directionLeft = false;
    13696                 }
    13697 
    13698                 // If the container is a document move it to the body element
    13699                 if (container.nodeType === 9) {
    13700                     container = dom.getRoot();
    13701                     offset = 0;
    13702                 }
    13703 
    13704                 // If the container is body try move it into the closest text node or position
    13705                 if (container === body) {
    13706                     // If start is before/after a image, table etc
    13707                     if (directionLeft) {
    13708                         node = container.childNodes[offset > 0 ? offset - 1 : 0];
    13709                         if (node) {
    13710                             nodeName = node.nodeName.toLowerCase();
    13711                             if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {
    13712                                 return;
    13713                             }
    13714                         }
    13715                     }
    13716 
    13717                     // Resolve the index
    13718                     if (container.hasChildNodes()) {
    13719                         offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
    13720                         container = container.childNodes[offset];
    13721                         offset = 0;
    13722 
    13723                         // Don't walk into elements that doesn't have any child nodes like a IMG
    13724                         if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {
    13725                             // Walk the DOM to find a text node to place the caret at or a BR
    13726                             node = container;
    13727                             walker = new TreeWalker(container, body);
    13728 
    13729                             do {
    13730                                 // Found a text node use that position
    13731                                 if (node.nodeType === 3 && node.nodeValue.length > 0) {
    13732                                     offset = directionLeft ? 0 : node.nodeValue.length;
    13733                                     container = node;
    13734                                     normalized = true;
    13735                                     break;
    13736                                 }
    13737 
    13738                                 // Found a BR/IMG element that we can place the caret before
    13739                                 if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
    13740                                     offset = dom.nodeIndex(node);
    13741                                     container = node.parentNode;
    13742 
    13743                                     // Put caret after image when moving the end point
    13744                                     if (node.nodeName ==  "IMG" && !directionLeft) {
    13745                                         offset++;
    13746                                     }
    13747 
    13748                                     normalized = true;
    13749                                     break;
    13750                                 }
    13751                             } while ((node = (directionLeft ? walker.next() : walker.prev())));
    13752                         }
    13753                     }
    13754                 }
    13755 
    13756                 // Lean the caret to the left if possible
    13757                 if (collapsed) {
    13758                     // So this: <b>x</b><i>|x</i>
    13759                     // Becomes: <b>x|</b><i>x</i>
    13760                     // Seems that only gecko has issues with this
    13761                     if (container.nodeType === 3 && offset === 0) {
    13762                         findTextNodeRelative(true);
    13763                     }
    13764 
    13765                     // Lean left into empty inline elements when the caret is before a BR
    13766                     // So this: <i><b></b><i>|<br></i>
    13767                     // Becomes: <i><b>|</b><i><br></i>
    13768                     // Seems that only gecko has issues with this.
    13769                     // Special edge case for <p><a>x</a>|<br></p> since we don't want <p><a>x|</a><br></p>
    13770                     if (container.nodeType === 1) {
    13771                         node = container.childNodes[offset];
    13772                         if(node && node.nodeName === 'BR' && !isPrevNode(node, 'A') &&
    13773                             !hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {
    13774                             findTextNodeRelative(true, container.childNodes[offset]);
    13775                         }
    13776                     }
    13777                 }
    13778 
    13779                 // Lean the start of the selection right if possible
    13780                 // So this: x[<b>x]</b>
    13781                 // Becomes: x<b>[x]</b>
    13782                 if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {
    13783                     findTextNodeRelative(false);
    13784                 }
    13785 
    13786                 // Set endpoint if it was normalized
    13787                 if (normalized) {
    13788                     rng['set' + (start ? 'Start' : 'End')](container, offset);
    13789                 }
    13790             }
    13791 
    13792             // Normalize only on non IE browsers for now
    13793             if (isIE) {
    13794                 return;
    13795             }
    13796 
    13797             rng = self.getRng();
    13798             collapsed = rng.collapsed;
    13799 
    13800             // Normalize the end points
    13801             normalizeEndPoint(true);
    13802 
    13803             if (!collapsed) {
    13804                 normalizeEndPoint();
    13805             }
    13806 
    13807             // Set the selection if it was normalized
    13808             if (normalized) {
    13809                 // If it was collapsed then make sure it still is
    13810                 if (collapsed) {
    13811                     rng.collapse(true);
    13812                 }
    13813 
    13814                 //console.log(self.dom.dumpRng(rng));
    13815                 self.setRng(rng, self.isForward());
    13816             }
    13817         },
    13818 
    13819         /**
    13820          * Executes callback of the current selection matches the specified selector or not and passes the state and args to the callback.
    13821          *
    13822          * @method selectorChanged
    13823          * @param {String} selector CSS selector to check for.
    13824          * @param {function} callback Callback with state and args when the selector is matches or not.
    13825          */
    13826         selectorChanged: function(selector, callback) {
    13827             var self = this, currentSelectors;
    13828 
    13829             if (!self.selectorChangedData) {
    13830                 self.selectorChangedData = {};
    13831                 currentSelectors = {};
    13832 
    13833                 self.editor.on('NodeChange', function(e) {
    13834                     var node = e.element, dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
    13835 
    13836                     // Check for new matching selectors
    13837                     each(self.selectorChangedData, function(callbacks, selector) {
    13838                         each(parents, function(node) {
    13839                             if (dom.is(node, selector)) {
    13840                                 if (!currentSelectors[selector]) {
    13841                                     // Execute callbacks
    13842                                     each(callbacks, function(callback) {
    13843                                         callback(true, {node: node, selector: selector, parents: parents});
    13844                                     });
    13845 
    13846                                     currentSelectors[selector] = callbacks;
    13847                                 }
    13848 
    13849                                 matchedSelectors[selector] = callbacks;
    13850                                 return false;
    13851                             }
    13852                         });
    13853                     });
    13854 
    13855                     // Check if current selectors still match
    13856                     each(currentSelectors, function(callbacks, selector) {
    13857                         if (!matchedSelectors[selector]) {
    13858                             delete currentSelectors[selector];
    13859 
    13860                             each(callbacks, function(callback) {
    13861                                 callback(false, {node: node, selector: selector, parents: parents});
    13862                             });
    13863                         }
    13864                     });
    13865                 });
    13866             }
    13867 
    13868             // Add selector listeners
    13869             if (!self.selectorChangedData[selector]) {
    13870                 self.selectorChangedData[selector] = [];
    13871             }
    13872 
    13873             self.selectorChangedData[selector].push(callback);
    13874 
    13875             return self;
    13876         },
    13877 
    13878         getScrollContainer: function() {
    13879             var scrollContainer, node = this.dom.getRoot();
    13880 
    13881             while (node && node.nodeName != 'BODY') {
    13882                 if (node.scrollHeight > node.clientHeight) {
    13883                     scrollContainer = node;
    13884                     break;
    13885                 }
    13886 
    13887                 node = node.parentNode;
    13888             }
    13889 
    13890             return scrollContainer;
    13891         },
    13892 
    13893         scrollIntoView: function(elm) {
    13894             var y, viewPort, self = this, dom = self.dom, root = dom.getRoot(), viewPortY, viewPortH;
    13895 
    13896             function getPos(elm) {
    13897                 var x = 0, y = 0;
    13898 
    13899                 var offsetParent = elm;
    13900                 while (offsetParent && offsetParent.nodeType) {
    13901                     x += offsetParent.offsetLeft || 0;
    13902                     y += offsetParent.offsetTop || 0;
    13903                     offsetParent = offsetParent.offsetParent;
    13904                 }
    13905 
    13906                 return {x: x, y: y};
    13907             }
    13908 
    13909             if (root.nodeName != 'BODY') {
    13910                 var scrollContainer = self.getScrollContainer();
    13911                 if (scrollContainer) {
    13912                     y = getPos(elm).y - getPos(scrollContainer).y;
    13913                     viewPortH = scrollContainer.clientHeight;
    13914                     viewPortY = scrollContainer.scrollTop;
    13915                     if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
    13916                         scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
    13917                     }
    13918 
    13919                     return;
    13920                 }
    13921             }
    13922 
    13923             viewPort = dom.getViewPort(self.editor.getWin());
    13924             y = dom.getPos(elm).y;
    13925             viewPortY = viewPort.y;
    13926             viewPortH = viewPort.h;
    13927             if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
    13928                 self.editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
    13929             }
    13930         },
    13931 
    13932         _moveEndPoint: function(rng, node, start) {
    13933             var root = node, walker = new TreeWalker(node, root);
    13934             var nonEmptyElementsMap = this.dom.schema.getNonEmptyElements();
    13935 
    13936             do {
    13937                 // Text node
    13938                 if (node.nodeType == 3 && trim(node.nodeValue).length !== 0) {
    13939                     if (start) {
    13940                         rng.setStart(node, 0);
    13941                     } else {
    13942                         rng.setEnd(node, node.nodeValue.length);
    13943                     }
    13944 
    13945                     return;
    13946                 }
    13947 
    13948                 // BR/IMG/INPUT elements
    13949                 if (nonEmptyElementsMap[node.nodeName]) {
    13950                     if (start) {
    13951                         rng.setStartBefore(node);
    13952                     } else {
    13953                         if (node.nodeName == 'BR') {
    13954                             rng.setEndBefore(node);
    13955                         } else {
    13956                             rng.setEndAfter(node);
    13957                         }
    13958                     }
    13959 
    13960                     return;
    13961                 }
    13962 
    13963                 // Found empty text block old IE can place the selection inside those
    13964                 if (Env.ie && Env.ie < 11 && this.dom.isBlock(node) && this.dom.isEmpty(node)) {
    13965                     if (start) {
    13966                         rng.setStart(node, 0);
    13967                     } else {
    13968                         rng.setEnd(node, 0);
    13969                     }
    13970 
    13971                     return;
    13972                 }
    13973             } while ((node = (start ? walker.next() : walker.prev())));
    13974 
    13975             // Failed to find any text node or other suitable location then move to the root of body
    13976             if (root.nodeName == 'BODY') {
    13977                 if (start) {
    13978                     rng.setStart(root, 0);
    13979                 } else {
    13980                     rng.setEnd(root, root.childNodes.length);
    13981                 }
    13982             }
    13983         },
    13984 
    13985         destroy: function() {
    13986             this.win = null;
    13987             this.controlSelection.destroy();
    13988         }
    13989     };
    13990 
    13991     return Selection;
    13992 });
    13993 
    1399412577// Included from: js/tinymce/classes/dom/RangeUtils.js
    1399512578
     
    1401112594 */
    1401212595define("tinymce/dom/RangeUtils", [
    14013     "tinymce/util/Tools"
    14014 ], function(Tools) {
     12596    "tinymce/util/Tools",
     12597    "tinymce/dom/TreeWalker"
     12598], function(Tools, TreeWalker) {
    1401512599    var each = Tools.each;
    1401612600
     
    1423412818                endOffset: endOffset
    1423512819            };
     12820        };
     12821
     12822        /**
     12823         * Normalizes the specified range by finding the closest best suitable caret location.
     12824         *
     12825         * @private
     12826         * @param {Range} rng Range to normalize.
     12827         * @return {Boolean} True/false if the specified range was normalized or not.
     12828         */
     12829        this.normalize = function(rng) {
     12830            var normalized, collapsed;
     12831
     12832            function normalizeEndPoint(start) {
     12833                var container, offset, walker, body = dom.getRoot(), node, nonEmptyElementsMap, nodeName;
     12834                var directionLeft, isAfterNode;
     12835
     12836                function hasBrBeforeAfter(node, left) {
     12837                    var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);
     12838
     12839                    while ((node = walker[left ? 'prev' : 'next']())) {
     12840                        if (node.nodeName === "BR") {
     12841                            return true;
     12842                        }
     12843                    }
     12844                }
     12845
     12846                function isPrevNode(node, name) {
     12847                    return node.previousSibling && node.previousSibling.nodeName == name;
     12848                }
     12849
     12850                // Walks the dom left/right to find a suitable text node to move the endpoint into
     12851                // It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG
     12852                function findTextNodeRelative(left, startNode) {
     12853                    var walker, lastInlineElement, parentBlockContainer;
     12854
     12855                    startNode = startNode || container;
     12856                    parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
     12857
     12858                    // Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680
     12859                    // This: <p><br>|</p> becomes <p>|<br></p>
     12860                    if (left && startNode.nodeName == 'BR' && isAfterNode && dom.isEmpty(parentBlockContainer)) {
     12861                        container = startNode.parentNode;
     12862                        offset = dom.nodeIndex(startNode);
     12863                        normalized = true;
     12864                        return;
     12865                    }
     12866
     12867                    // Walk left until we hit a text node we can move to or a block/br/img
     12868                    walker = new TreeWalker(startNode, parentBlockContainer);
     12869                    while ((node = walker[left ? 'prev' : 'next']())) {
     12870                        // Found text node that has a length
     12871                        if (node.nodeType === 3 && node.nodeValue.length > 0) {
     12872                            container = node;
     12873                            offset = left ? node.nodeValue.length : 0;
     12874                            normalized = true;
     12875                            return;
     12876                        }
     12877
     12878                        // Break if we find a block or a BR/IMG/INPUT etc
     12879                        if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
     12880                            return;
     12881                        }
     12882
     12883                        lastInlineElement = node;
     12884                    }
     12885
     12886                    // Only fetch the last inline element when in caret mode for now
     12887                    if (collapsed && lastInlineElement) {
     12888                        container = lastInlineElement;
     12889                        normalized = true;
     12890                        offset = 0;
     12891                    }
     12892                }
     12893
     12894                container = rng[(start ? 'start' : 'end') + 'Container'];
     12895                offset = rng[(start ? 'start' : 'end') + 'Offset'];
     12896                isAfterNode = container.nodeType == 1 && offset === container.childNodes.length;
     12897                nonEmptyElementsMap = dom.schema.getNonEmptyElements();
     12898                directionLeft = start;
     12899
     12900                if (container.nodeType == 1 && offset > container.childNodes.length - 1) {
     12901                    directionLeft = false;
     12902                }
     12903
     12904                // If the container is a document move it to the body element
     12905                if (container.nodeType === 9) {
     12906                    container = dom.getRoot();
     12907                    offset = 0;
     12908                }
     12909
     12910                // If the container is body try move it into the closest text node or position
     12911                if (container === body) {
     12912                    // If start is before/after a image, table etc
     12913                    if (directionLeft) {
     12914                        node = container.childNodes[offset > 0 ? offset - 1 : 0];
     12915                        if (node) {
     12916                            nodeName = node.nodeName.toLowerCase();
     12917                            if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {
     12918                                return;
     12919                            }
     12920                        }
     12921                    }
     12922
     12923                    // Resolve the index
     12924                    if (container.hasChildNodes()) {
     12925                        offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
     12926                        container = container.childNodes[offset];
     12927                        offset = 0;
     12928
     12929                        // Don't walk into elements that doesn't have any child nodes like a IMG
     12930                        if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {
     12931                            // Walk the DOM to find a text node to place the caret at or a BR
     12932                            node = container;
     12933                            walker = new TreeWalker(container, body);
     12934
     12935                            do {
     12936                                // Found a text node use that position
     12937                                if (node.nodeType === 3 && node.nodeValue.length > 0) {
     12938                                    offset = directionLeft ? 0 : node.nodeValue.length;
     12939                                    container = node;
     12940                                    normalized = true;
     12941                                    break;
     12942                                }
     12943
     12944                                // Found a BR/IMG element that we can place the caret before
     12945                                if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
     12946                                    offset = dom.nodeIndex(node);
     12947                                    container = node.parentNode;
     12948
     12949                                    // Put caret after image when moving the end point
     12950                                    if (node.nodeName ==  "IMG" && !directionLeft) {
     12951                                        offset++;
     12952                                    }
     12953
     12954                                    normalized = true;
     12955                                    break;
     12956                                }
     12957                            } while ((node = (directionLeft ? walker.next() : walker.prev())));
     12958                        }
     12959                    }
     12960                }
     12961
     12962                // Lean the caret to the left if possible
     12963                if (collapsed) {
     12964                    // So this: <b>x</b><i>|x</i>
     12965                    // Becomes: <b>x|</b><i>x</i>
     12966                    // Seems that only gecko has issues with this
     12967                    if (container.nodeType === 3 && offset === 0) {
     12968                        findTextNodeRelative(true);
     12969                    }
     12970
     12971                    // Lean left into empty inline elements when the caret is before a BR
     12972                    // So this: <i><b></b><i>|<br></i>
     12973                    // Becomes: <i><b>|</b><i><br></i>
     12974                    // Seems that only gecko has issues with this.
     12975                    // Special edge case for <p><a>x</a>|<br></p> since we don't want <p><a>x|</a><br></p>
     12976                    if (container.nodeType === 1) {
     12977                        node = container.childNodes[offset];
     12978
     12979                        // Offset is after the containers last child
     12980                        // then use the previous child for normalization
     12981                        if (!node) {
     12982                            node = container.childNodes[offset - 1];
     12983                        }
     12984
     12985                        if (node && node.nodeName === 'BR' && !isPrevNode(node, 'A') &&
     12986                            !hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {
     12987                            findTextNodeRelative(true, node);
     12988                        }
     12989                    }
     12990                }
     12991
     12992                // Lean the start of the selection right if possible
     12993                // So this: x[<b>x]</b>
     12994                // Becomes: x<b>[x]</b>
     12995                if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {
     12996                    findTextNodeRelative(false);
     12997                }
     12998
     12999                // Set endpoint if it was normalized
     13000                if (normalized) {
     13001                    rng['set' + (start ? 'Start' : 'End')](container, offset);
     13002                }
     13003            }
     13004
     13005            collapsed = rng.collapsed;
     13006
     13007            normalizeEndPoint(true);
     13008
     13009            if (!collapsed) {
     13010                normalizeEndPoint();
     13011            }
     13012
     13013            // If it was collapsed then make sure it still is
     13014            if (normalized && collapsed) {
     13015                rng.collapse(true);
     13016            }
     13017
     13018            return normalized;
    1423613019        };
    1423713020    }
     
    1426913052
    1427013053    return RangeUtils;
     13054});
     13055
     13056// Included from: js/tinymce/classes/dom/Selection.js
     13057
     13058/**
     13059 * Selection.js
     13060 *
     13061 * Copyright, Moxiecode Systems AB
     13062 * Released under LGPL License.
     13063 *
     13064 * License: http://www.tinymce.com/license
     13065 * Contributing: http://www.tinymce.com/contributing
     13066 */
     13067
     13068/**
     13069 * This class handles text and control selection it's an crossbrowser utility class.
     13070 * Consult the TinyMCE Wiki API for more details and examples on how to use this class.
     13071 *
     13072 * @class tinymce.dom.Selection
     13073 * @example
     13074 * // Getting the currently selected node for the active editor
     13075 * alert(tinymce.activeEditor.selection.getNode().nodeName);
     13076 */
     13077define("tinymce/dom/Selection", [
     13078    "tinymce/dom/TreeWalker",
     13079    "tinymce/dom/TridentSelection",
     13080    "tinymce/dom/ControlSelection",
     13081    "tinymce/dom/RangeUtils",
     13082    "tinymce/Env",
     13083    "tinymce/util/Tools"
     13084], function(TreeWalker, TridentSelection, ControlSelection, RangeUtils, Env, Tools) {
     13085    var each = Tools.each, grep = Tools.grep, trim = Tools.trim;
     13086    var isIE = Env.ie, isOpera = Env.opera;
     13087
     13088    /**
     13089     * Constructs a new selection instance.
     13090     *
     13091     * @constructor
     13092     * @method Selection
     13093     * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference.
     13094     * @param {Window} win Window to bind the selection object to.
     13095     * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent.
     13096     */
     13097    function Selection(dom, win, serializer, editor) {
     13098        var self = this;
     13099
     13100        self.dom = dom;
     13101        self.win = win;
     13102        self.serializer = serializer;
     13103        self.editor = editor;
     13104
     13105        self.controlSelection = new ControlSelection(self, editor);
     13106
     13107        // No W3C Range support
     13108        if (!self.win.getSelection) {
     13109            self.tridentSel = new TridentSelection(self);
     13110        }
     13111    }
     13112
     13113    Selection.prototype = {
     13114        /**
     13115         * Move the selection cursor range to the specified node and offset.
     13116         * If there is no node specified it will move it to the first suitable location within the body.
     13117         *
     13118         * @method setCursorLocation
     13119         * @param {Node} node Optional node to put the cursor in.
     13120         * @param {Number} offset Optional offset from the start of the node to put the cursor at.
     13121         */
     13122        setCursorLocation: function(node, offset) {
     13123            var self = this, rng = self.dom.createRng();
     13124
     13125            if (!node) {
     13126                self._moveEndPoint(rng, self.editor.getBody(), true);
     13127                self.setRng(rng);
     13128            } else {
     13129                rng.setStart(node, offset);
     13130                rng.setEnd(node, offset);
     13131                self.setRng(rng);
     13132                self.collapse(false);
     13133            }
     13134        },
     13135
     13136        /**
     13137         * Returns the selected contents using the DOM serializer passed in to this class.
     13138         *
     13139         * @method getContent
     13140         * @param {Object} s Optional settings class with for example output format text or html.
     13141         * @return {String} Selected contents in for example HTML format.
     13142         * @example
     13143         * // Alerts the currently selected contents
     13144         * alert(tinymce.activeEditor.selection.getContent());
     13145         *
     13146         * // Alerts the currently selected contents as plain text
     13147         * alert(tinymce.activeEditor.selection.getContent({format: 'text'}));
     13148         */
     13149        getContent: function(args) {
     13150            var self = this, rng = self.getRng(), tmpElm = self.dom.create("body");
     13151            var se = self.getSel(), whiteSpaceBefore, whiteSpaceAfter, fragment;
     13152
     13153            args = args || {};
     13154            whiteSpaceBefore = whiteSpaceAfter = '';
     13155            args.get = true;
     13156            args.format = args.format || 'html';
     13157            args.selection = true;
     13158            self.editor.fire('BeforeGetContent', args);
     13159
     13160            if (args.format == 'text') {
     13161                return self.isCollapsed() ? '' : (rng.text || (se.toString ? se.toString() : ''));
     13162            }
     13163
     13164            if (rng.cloneContents) {
     13165                fragment = rng.cloneContents();
     13166
     13167                if (fragment) {
     13168                    tmpElm.appendChild(fragment);
     13169                }
     13170            } else if (rng.item !== undefined || rng.htmlText !== undefined) {
     13171                // IE will produce invalid markup if elements are present that
     13172                // it doesn't understand like custom elements or HTML5 elements.
     13173                // Adding a BR in front of the contents and then remoiving it seems to fix it though.
     13174                tmpElm.innerHTML = '<br>' + (rng.item ? rng.item(0).outerHTML : rng.htmlText);
     13175                tmpElm.removeChild(tmpElm.firstChild);
     13176            } else {
     13177                tmpElm.innerHTML = rng.toString();
     13178            }
     13179
     13180            // Keep whitespace before and after
     13181            if (/^\s/.test(tmpElm.innerHTML)) {
     13182                whiteSpaceBefore = ' ';
     13183            }
     13184
     13185            if (/\s+$/.test(tmpElm.innerHTML)) {
     13186                whiteSpaceAfter = ' ';
     13187            }
     13188
     13189            args.getInner = true;
     13190
     13191            args.content = self.isCollapsed() ? '' : whiteSpaceBefore + self.serializer.serialize(tmpElm, args) + whiteSpaceAfter;
     13192            self.editor.fire('GetContent', args);
     13193
     13194            return args.content;
     13195        },
     13196
     13197        /**
     13198         * Sets the current selection to the specified content. If any contents is selected it will be replaced
     13199         * with the contents passed in to this function. If there is no selection the contents will be inserted
     13200         * where the caret is placed in the editor/page.
     13201         *
     13202         * @method setContent
     13203         * @param {String} content HTML contents to set could also be other formats depending on settings.
     13204         * @param {Object} args Optional settings object with for example data format.
     13205         * @example
     13206         * // Inserts some HTML contents at the current selection
     13207         * tinymce.activeEditor.selection.setContent('<strong>Some contents</strong>');
     13208         */
     13209        setContent: function(content, args) {
     13210            var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp;
     13211
     13212            args = args || {format: 'html'};
     13213            args.set = true;
     13214            args.selection = true;
     13215            content = args.content = content;
     13216
     13217            // Dispatch before set content event
     13218            if (!args.no_events) {
     13219                self.editor.fire('BeforeSetContent', args);
     13220            }
     13221
     13222            content = args.content;
     13223
     13224            if (rng.insertNode) {
     13225                // Make caret marker since insertNode places the caret in the beginning of text after insert
     13226                content += '<span id="__caret">_</span>';
     13227
     13228                // Delete and insert new node
     13229                if (rng.startContainer == doc && rng.endContainer == doc) {
     13230                    // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents
     13231                    doc.body.innerHTML = content;
     13232                } else {
     13233                    rng.deleteContents();
     13234
     13235                    if (doc.body.childNodes.length === 0) {
     13236                        doc.body.innerHTML = content;
     13237                    } else {
     13238                        // createContextualFragment doesn't exists in IE 9 DOMRanges
     13239                        if (rng.createContextualFragment) {
     13240                            rng.insertNode(rng.createContextualFragment(content));
     13241                        } else {
     13242                            // Fake createContextualFragment call in IE 9
     13243                            frag = doc.createDocumentFragment();
     13244                            temp = doc.createElement('div');
     13245
     13246                            frag.appendChild(temp);
     13247                            temp.outerHTML = content;
     13248
     13249                            rng.insertNode(frag);
     13250                        }
     13251                    }
     13252                }
     13253
     13254                // Move to caret marker
     13255                caretNode = self.dom.get('__caret');
     13256
     13257                // Make sure we wrap it compleatly, Opera fails with a simple select call
     13258                rng = doc.createRange();
     13259                rng.setStartBefore(caretNode);
     13260                rng.setEndBefore(caretNode);
     13261                self.setRng(rng);
     13262
     13263                // Remove the caret position
     13264                self.dom.remove('__caret');
     13265
     13266                try {
     13267                    self.setRng(rng);
     13268                } catch (ex) {
     13269                    // Might fail on Opera for some odd reason
     13270                }
     13271            } else {
     13272                if (rng.item) {
     13273                    // Delete content and get caret text selection
     13274                    doc.execCommand('Delete', false, null);
     13275                    rng = self.getRng();
     13276                }
     13277
     13278                // Explorer removes spaces from the beginning of pasted contents
     13279                if (/^\s+/.test(content)) {
     13280                    rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
     13281                    self.dom.remove('__mce_tmp');
     13282                } else {
     13283                    rng.pasteHTML(content);
     13284                }
     13285            }
     13286
     13287            // Dispatch set content event
     13288            if (!args.no_events) {
     13289                self.editor.fire('SetContent', args);
     13290            }
     13291        },
     13292
     13293        /**
     13294         * Returns the start element of a selection range. If the start is in a text
     13295         * node the parent element will be returned.
     13296         *
     13297         * @method getStart
     13298         * @return {Element} Start element of selection range.
     13299         */
     13300        getStart: function() {
     13301            var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;
     13302
     13303            if (rng.duplicate || rng.item) {
     13304                // Control selection, return first item
     13305                if (rng.item) {
     13306                    return rng.item(0);
     13307                }
     13308
     13309                // Get start element
     13310                checkRng = rng.duplicate();
     13311                checkRng.collapse(1);
     13312                startElement = checkRng.parentElement();
     13313                if (startElement.ownerDocument !== self.dom.doc) {
     13314                    startElement = self.dom.getRoot();
     13315                }
     13316
     13317                // Check if range parent is inside the start element, then return the inner parent element
     13318                // This will fix issues when a single element is selected, IE would otherwise return the wrong start element
     13319                parentElement = node = rng.parentElement();
     13320                while ((node = node.parentNode)) {
     13321                    if (node == startElement) {
     13322                        startElement = parentElement;
     13323                        break;
     13324                    }
     13325                }
     13326
     13327                return startElement;
     13328            } else {
     13329                startElement = rng.startContainer;
     13330
     13331                if (startElement.nodeType == 1 && startElement.hasChildNodes()) {
     13332                    startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];
     13333                }
     13334
     13335                if (startElement && startElement.nodeType == 3) {
     13336                    return startElement.parentNode;
     13337                }
     13338
     13339                return startElement;
     13340            }
     13341        },
     13342
     13343        /**
     13344         * Returns the end element of a selection range. If the end is in a text
     13345         * node the parent element will be returned.
     13346         *
     13347         * @method getEnd
     13348         * @return {Element} End element of selection range.
     13349         */
     13350        getEnd: function() {
     13351            var self = this, rng = self.getRng(), endElement, endOffset;
     13352
     13353            if (rng.duplicate || rng.item) {
     13354                if (rng.item) {
     13355                    return rng.item(0);
     13356                }
     13357
     13358                rng = rng.duplicate();
     13359                rng.collapse(0);
     13360                endElement = rng.parentElement();
     13361                if (endElement.ownerDocument !== self.dom.doc) {
     13362                    endElement = self.dom.getRoot();
     13363                }
     13364
     13365                if (endElement && endElement.nodeName == 'BODY') {
     13366                    return endElement.lastChild || endElement;
     13367                }
     13368
     13369                return endElement;
     13370            } else {
     13371                endElement = rng.endContainer;
     13372                endOffset = rng.endOffset;
     13373
     13374                if (endElement.nodeType == 1 && endElement.hasChildNodes()) {
     13375                    endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];
     13376                }
     13377
     13378                if (endElement && endElement.nodeType == 3) {
     13379                    return endElement.parentNode;
     13380                }
     13381
     13382                return endElement;
     13383            }
     13384        },
     13385
     13386        /**
     13387         * Returns a bookmark location for the current selection. This bookmark object
     13388         * can then be used to restore the selection after some content modification to the document.
     13389         *
     13390         * @method getBookmark
     13391         * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
     13392         * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
     13393         * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
     13394         * @example
     13395         * // Stores a bookmark of the current selection
     13396         * var bm = tinymce.activeEditor.selection.getBookmark();
     13397         *
     13398         * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
     13399         *
     13400         * // Restore the selection bookmark
     13401         * tinymce.activeEditor.selection.moveToBookmark(bm);
     13402         */
     13403        getBookmark: function(type, normalized) {
     13404            var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, chr = '&#xFEFF;', styles;
     13405
     13406            function findIndex(name, element) {
     13407                var index = 0;
     13408
     13409                each(dom.select(name), function(node, i) {
     13410                    if (node == element) {
     13411                        index = i;
     13412                    }
     13413                });
     13414
     13415                return index;
     13416            }
     13417
     13418            function normalizeTableCellSelection(rng) {
     13419                function moveEndPoint(start) {
     13420                    var container, offset, childNodes, prefix = start ? 'start' : 'end';
     13421
     13422                    container = rng[prefix + 'Container'];
     13423                    offset = rng[prefix + 'Offset'];
     13424
     13425                    if (container.nodeType == 1 && container.nodeName == "TR") {
     13426                        childNodes = container.childNodes;
     13427                        container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
     13428                        if (container) {
     13429                            offset = start ? 0 : container.childNodes.length;
     13430                            rng['set' + (start ? 'Start' : 'End')](container, offset);
     13431                        }
     13432                    }
     13433                }
     13434
     13435                moveEndPoint(true);
     13436                moveEndPoint();
     13437
     13438                return rng;
     13439            }
     13440
     13441            function getLocation() {
     13442                var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};
     13443
     13444                function getPoint(rng, start) {
     13445                    var container = rng[start ? 'startContainer' : 'endContainer'],
     13446                        offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;
     13447
     13448                    if (container.nodeType == 3) {
     13449                        if (normalized) {
     13450                            for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) {
     13451                                offset += node.nodeValue.length;
     13452                            }
     13453                        }
     13454
     13455                        point.push(offset);
     13456                    } else {
     13457                        childNodes = container.childNodes;
     13458
     13459                        if (offset >= childNodes.length && childNodes.length) {
     13460                            after = 1;
     13461                            offset = Math.max(0, childNodes.length - 1);
     13462                        }
     13463
     13464                        point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after);
     13465                    }
     13466
     13467                    for (; container && container != root; container = container.parentNode) {
     13468                        point.push(t.dom.nodeIndex(container, normalized));
     13469                    }
     13470
     13471                    return point;
     13472                }
     13473
     13474                bookmark.start = getPoint(rng, true);
     13475
     13476                if (!t.isCollapsed()) {
     13477                    bookmark.end = getPoint(rng);
     13478                }
     13479
     13480                return bookmark;
     13481            }
     13482
     13483            if (type == 2) {
     13484                element = t.getNode();
     13485                name = element ? element.nodeName : null;
     13486
     13487                if (name == 'IMG') {
     13488                    return {name: name, index: findIndex(name, element)};
     13489                }
     13490
     13491                if (t.tridentSel) {
     13492                    return t.tridentSel.getBookmark(type);
     13493                }
     13494
     13495                return getLocation();
     13496            }
     13497
     13498            // Handle simple range
     13499            if (type) {
     13500                return {rng: t.getRng()};
     13501            }
     13502
     13503            rng = t.getRng();
     13504            id = dom.uniqueId();
     13505            collapsed = t.isCollapsed();
     13506            styles = 'overflow:hidden;line-height:0px';
     13507
     13508            // Explorer method
     13509            if (rng.duplicate || rng.item) {
     13510                // Text selection
     13511                if (!rng.item) {
     13512                    rng2 = rng.duplicate();
     13513
     13514                    try {
     13515                        // Insert start marker
     13516                        rng.collapse();
     13517                        rng.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');
     13518
     13519                        // Insert end marker
     13520                        if (!collapsed) {
     13521                            rng2.collapse(false);
     13522
     13523                            // Detect the empty space after block elements in IE and move the
     13524                            // end back one character <p></p>] becomes <p>]</p>
     13525                            rng.moveToElementText(rng2.parentElement());
     13526                            if (rng.compareEndPoints('StartToEnd', rng2) === 0) {
     13527                                rng2.move('character', -1);
     13528                            }
     13529
     13530                            rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');
     13531                        }
     13532                    } catch (ex) {
     13533                        // IE might throw unspecified error so lets ignore it
     13534                        return null;
     13535                    }
     13536                } else {
     13537                    // Control selection
     13538                    element = rng.item(0);
     13539                    name = element.nodeName;
     13540
     13541                    return {name: name, index: findIndex(name, element)};
     13542                }
     13543            } else {
     13544                element = t.getNode();
     13545                name = element.nodeName;
     13546                if (name == 'IMG') {
     13547                    return {name: name, index: findIndex(name, element)};
     13548                }
     13549
     13550                // W3C method
     13551                rng2 = normalizeTableCellSelection(rng.cloneRange());
     13552
     13553                // Insert end marker
     13554                if (!collapsed) {
     13555                    rng2.collapse(false);
     13556                    rng2.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_end', style: styles}, chr));
     13557                }
     13558
     13559                rng = normalizeTableCellSelection(rng);
     13560                rng.collapse(true);
     13561                rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr));
     13562            }
     13563
     13564            t.moveToBookmark({id: id, keep: 1});
     13565
     13566            return {id: id};
     13567        },
     13568
     13569        /**
     13570         * Restores the selection to the specified bookmark.
     13571         *
     13572         * @method moveToBookmark
     13573         * @param {Object} bookmark Bookmark to restore selection from.
     13574         * @return {Boolean} true/false if it was successful or not.
     13575         * @example
     13576         * // Stores a bookmark of the current selection
     13577         * var bm = tinymce.activeEditor.selection.getBookmark();
     13578         *
     13579         * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
     13580         *
     13581         * // Restore the selection bookmark
     13582         * tinymce.activeEditor.selection.moveToBookmark(bm);
     13583         */
     13584        moveToBookmark: function(bookmark) {
     13585            var t = this, dom = t.dom, rng, root, startContainer, endContainer, startOffset, endOffset;
     13586
     13587            function setEndPoint(start) {
     13588                var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
     13589
     13590                if (point) {
     13591                    offset = point[0];
     13592
     13593                    // Find container node
     13594                    for (node = root, i = point.length - 1; i >= 1; i--) {
     13595                        children = node.childNodes;
     13596
     13597                        if (point[i] > children.length - 1) {
     13598                            return;
     13599                        }
     13600
     13601                        node = children[point[i]];
     13602                    }
     13603
     13604                    // Move text offset to best suitable location
     13605                    if (node.nodeType === 3) {
     13606                        offset = Math.min(point[0], node.nodeValue.length);
     13607                    }
     13608
     13609                    // Move element offset to best suitable location
     13610                    if (node.nodeType === 1) {
     13611                        offset = Math.min(point[0], node.childNodes.length);
     13612                    }
     13613
     13614                    // Set offset within container node
     13615                    if (start) {
     13616                        rng.setStart(node, offset);
     13617                    } else {
     13618                        rng.setEnd(node, offset);
     13619                    }
     13620                }
     13621
     13622                return true;
     13623            }
     13624
     13625            function restoreEndPoint(suffix) {
     13626                var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;
     13627
     13628                if (marker) {
     13629                    node = marker.parentNode;
     13630
     13631                    if (suffix == 'start') {
     13632                        if (!keep) {
     13633                            idx = dom.nodeIndex(marker);
     13634                        } else {
     13635                            node = marker.firstChild;
     13636                            idx = 1;
     13637                        }
     13638
     13639                        startContainer = endContainer = node;
     13640                        startOffset = endOffset = idx;
     13641                    } else {
     13642                        if (!keep) {
     13643                            idx = dom.nodeIndex(marker);
     13644                        } else {
     13645                            node = marker.firstChild;
     13646                            idx = 1;
     13647                        }
     13648
     13649                        endContainer = node;
     13650                        endOffset = idx;
     13651                    }
     13652
     13653                    if (!keep) {
     13654                        prev = marker.previousSibling;
     13655                        next = marker.nextSibling;
     13656
     13657                        // Remove all marker text nodes
     13658                        each(grep(marker.childNodes), function(node) {
     13659                            if (node.nodeType == 3) {
     13660                                node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
     13661                            }
     13662                        });
     13663
     13664                        // Remove marker but keep children if for example contents where inserted into the marker
     13665                        // Also remove duplicated instances of the marker for example by a
     13666                        // split operation or by WebKit auto split on paste feature
     13667                        while ((marker = dom.get(bookmark.id + '_' + suffix))) {
     13668                            dom.remove(marker, 1);
     13669                        }
     13670
     13671                        // If siblings are text nodes then merge them unless it's Opera since it some how removes the node
     13672                        // and we are sniffing since adding a lot of detection code for a browser with 3% of the market
     13673                        // isn't worth the effort. Sorry, Opera but it's just a fact
     13674                        if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !isOpera) {
     13675                            idx = prev.nodeValue.length;
     13676                            prev.appendData(next.nodeValue);
     13677                            dom.remove(next);
     13678
     13679                            if (suffix == 'start') {
     13680                                startContainer = endContainer = prev;
     13681                                startOffset = endOffset = idx;
     13682                            } else {
     13683                                endContainer = prev;
     13684                                endOffset = idx;
     13685                            }
     13686                        }
     13687                    }
     13688                }
     13689            }
     13690
     13691            function addBogus(node) {
     13692                // Adds a bogus BR element for empty block elements
     13693                if (dom.isBlock(node) && !node.innerHTML && !isIE) {
     13694                    node.innerHTML = '<br data-mce-bogus="1" />';
     13695                }
     13696
     13697                return node;
     13698            }
     13699
     13700            if (bookmark) {
     13701                if (bookmark.start) {
     13702                    rng = dom.createRng();
     13703                    root = dom.getRoot();
     13704
     13705                    if (t.tridentSel) {
     13706                        return t.tridentSel.moveToBookmark(bookmark);
     13707                    }
     13708
     13709                    if (setEndPoint(true) && setEndPoint()) {
     13710                        t.setRng(rng);
     13711                    }
     13712                } else if (bookmark.id) {
     13713                    // Restore start/end points
     13714                    restoreEndPoint('start');
     13715                    restoreEndPoint('end');
     13716
     13717                    if (startContainer) {
     13718                        rng = dom.createRng();
     13719                        rng.setStart(addBogus(startContainer), startOffset);
     13720                        rng.setEnd(addBogus(endContainer), endOffset);
     13721                        t.setRng(rng);
     13722                    }
     13723                } else if (bookmark.name) {
     13724                    t.select(dom.select(bookmark.name)[bookmark.index]);
     13725                } else if (bookmark.rng) {
     13726                    t.setRng(bookmark.rng);
     13727                }
     13728            }
     13729        },
     13730
     13731        /**
     13732         * Selects the specified element. This will place the start and end of the selection range around the element.
     13733         *
     13734         * @method select
     13735         * @param {Element} node HMTL DOM element to select.
     13736         * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser.
     13737         * @return {Element} Selected element the same element as the one that got passed in.
     13738         * @example
     13739         * // Select the first paragraph in the active editor
     13740         * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
     13741         */
     13742        select: function(node, content) {
     13743            var self = this, dom = self.dom, rng = dom.createRng(), idx;
     13744
     13745            // Clear stored range set by FocusManager
     13746            self.lastFocusBookmark = null;
     13747
     13748            if (node) {
     13749                if (!content && self.controlSelection.controlSelect(node)) {
     13750                    return;
     13751                }
     13752
     13753                idx = dom.nodeIndex(node);
     13754                rng.setStart(node.parentNode, idx);
     13755                rng.setEnd(node.parentNode, idx + 1);
     13756
     13757                // Find first/last text node or BR element
     13758                if (content) {
     13759                    self._moveEndPoint(rng, node, true);
     13760                    self._moveEndPoint(rng, node);
     13761                }
     13762
     13763                self.setRng(rng);
     13764            }
     13765
     13766            return node;
     13767        },
     13768
     13769        /**
     13770         * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection.
     13771         *
     13772         * @method isCollapsed
     13773         * @return {Boolean} true/false state if the selection range is collapsed or not.
     13774         * Collapsed means if it's a caret or a larger selection.
     13775         */
     13776        isCollapsed: function() {
     13777            var self = this, rng = self.getRng(), sel = self.getSel();
     13778
     13779            if (!rng || rng.item) {
     13780                return false;
     13781            }
     13782
     13783            if (rng.compareEndPoints) {
     13784                return rng.compareEndPoints('StartToEnd', rng) === 0;
     13785            }
     13786
     13787            return !sel || rng.collapsed;
     13788        },
     13789
     13790        /**
     13791         * Collapse the selection to start or end of range.
     13792         *
     13793         * @method collapse
     13794         * @param {Boolean} to_start Optional boolean state if to collapse to end or not. Defaults to start.
     13795         */
     13796        collapse: function(to_start) {
     13797            var self = this, rng = self.getRng(), node;
     13798
     13799            // Control range on IE
     13800            if (rng.item) {
     13801                node = rng.item(0);
     13802                rng = self.win.document.body.createTextRange();
     13803                rng.moveToElementText(node);
     13804            }
     13805
     13806            rng.collapse(!!to_start);
     13807            self.setRng(rng);
     13808        },
     13809
     13810        /**
     13811         * Returns the browsers internal selection object.
     13812         *
     13813         * @method getSel
     13814         * @return {Selection} Internal browser selection object.
     13815         */
     13816        getSel: function() {
     13817            var win = this.win;
     13818
     13819            return win.getSelection ? win.getSelection() : win.document.selection;
     13820        },
     13821
     13822        /**
     13823         * Returns the browsers internal range object.
     13824         *
     13825         * @method getRng
     13826         * @param {Boolean} w3c Forces a compatible W3C range on IE.
     13827         * @return {Range} Internal browser range object.
     13828         * @see http://www.quirksmode.org/dom/range_intro.html
     13829         * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/
     13830         */
     13831        getRng: function(w3c) {
     13832            var self = this, selection, rng, elm, doc = self.win.document, ieRng;
     13833
     13834            function tryCompareBounderyPoints(how, sourceRange, destinationRange) {
     13835                try {
     13836                    return sourceRange.compareBoundaryPoints(how, destinationRange);
     13837                } catch (ex) {
     13838                    // Gecko throws wrong document exception if the range points
     13839                    // to nodes that where removed from the dom #6690
     13840                    // Browsers should mutate existing DOMRange instances so that they always point
     13841                    // to something in the document this is not the case in Gecko works fine in IE/WebKit/Blink
     13842                    // For performance reasons just return -1
     13843                    return -1;
     13844                }
     13845            }
     13846
     13847            // Use last rng passed from FocusManager if it's available this enables
     13848            // calls to editor.selection.getStart() to work when caret focus is lost on IE
     13849            if (!w3c && self.lastFocusBookmark) {
     13850                var bookmark = self.lastFocusBookmark;
     13851
     13852                // Convert bookmark to range IE 11 fix
     13853                if (bookmark.startContainer) {
     13854                    rng = doc.createRange();
     13855                    rng.setStart(bookmark.startContainer, bookmark.startOffset);
     13856                    rng.setEnd(bookmark.endContainer, bookmark.endOffset);
     13857                } else {
     13858                    rng = bookmark;
     13859                }
     13860
     13861                return rng;
     13862            }
     13863
     13864            // Found tridentSel object then we need to use that one
     13865            if (w3c && self.tridentSel) {
     13866                return self.tridentSel.getRangeAt(0);
     13867            }
     13868
     13869            try {
     13870                if ((selection = self.getSel())) {
     13871                    if (selection.rangeCount > 0) {
     13872                        rng = selection.getRangeAt(0);
     13873                    } else {
     13874                        rng = selection.createRange ? selection.createRange() : doc.createRange();
     13875                    }
     13876                }
     13877            } catch (ex) {
     13878                // IE throws unspecified error here if TinyMCE is placed in a frame/iframe
     13879            }
     13880
     13881            // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
     13882            // IE 11 doesn't support the selection object so we check for that as well
     13883            if (isIE && rng && rng.setStart && doc.selection) {
     13884                try {
     13885                    // IE will sometimes throw an exception here
     13886                    ieRng = doc.selection.createRange();
     13887                } catch (ex) {
     13888
     13889                }
     13890
     13891                if (ieRng && ieRng.item) {
     13892                    elm = ieRng.item(0);
     13893                    rng = doc.createRange();
     13894                    rng.setStartBefore(elm);
     13895                    rng.setEndAfter(elm);
     13896                }
     13897            }
     13898
     13899            // No range found then create an empty one
     13900            // This can occur when the editor is placed in a hidden container element on Gecko
     13901            // Or on IE when there was an exception
     13902            if (!rng) {
     13903                rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
     13904            }
     13905
     13906            // If range is at start of document then move it to start of body
     13907            if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
     13908                elm = self.dom.getRoot();
     13909                rng.setStart(elm, 0);
     13910                rng.setEnd(elm, 0);
     13911            }
     13912
     13913            if (self.selectedRange && self.explicitRange) {
     13914                if (tryCompareBounderyPoints(rng.START_TO_START, rng, self.selectedRange) === 0 &&
     13915                    tryCompareBounderyPoints(rng.END_TO_END, rng, self.selectedRange) === 0) {
     13916                    // Safari, Opera and Chrome only ever select text which causes the range to change.
     13917                    // This lets us use the originally set range if the selection hasn't been changed by the user.
     13918                    rng = self.explicitRange;
     13919                } else {
     13920                    self.selectedRange = null;
     13921                    self.explicitRange = null;
     13922                }
     13923            }
     13924
     13925            return rng;
     13926        },
     13927
     13928        /**
     13929         * Changes the selection to the specified DOM range.
     13930         *
     13931         * @method setRng
     13932         * @param {Range} rng Range to select.
     13933         */
     13934        setRng: function(rng, forward) {
     13935            var self = this, sel;
     13936
     13937            // Is IE specific range
     13938            if (rng.select) {
     13939                try {
     13940                    rng.select();
     13941                } catch (ex) {
     13942                    // Needed for some odd IE bug #1843306
     13943                }
     13944
     13945                return;
     13946            }
     13947
     13948            if (!self.tridentSel) {
     13949                sel = self.getSel();
     13950
     13951                if (sel) {
     13952                    self.explicitRange = rng;
     13953
     13954                    try {
     13955                        sel.removeAllRanges();
     13956                        sel.addRange(rng);
     13957                    } catch (ex) {
     13958                        // IE might throw errors here if the editor is within a hidden container and selection is changed
     13959                    }
     13960
     13961                    // Forward is set to false and we have an extend function
     13962                    if (forward === false && sel.extend) {
     13963                        sel.collapse(rng.endContainer, rng.endOffset);
     13964                        sel.extend(rng.startContainer, rng.startOffset);
     13965                    }
     13966
     13967                    // adding range isn't always successful so we need to check range count otherwise an exception can occur
     13968                    self.selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
     13969                }
     13970            } else {
     13971                // Is W3C Range fake range on IE
     13972                if (rng.cloneRange) {
     13973                    try {
     13974                        self.tridentSel.addRange(rng);
     13975                        return;
     13976                    } catch (ex) {
     13977                        //IE9 throws an error here if called before selection is placed in the editor
     13978                    }
     13979                }
     13980            }
     13981        },
     13982
     13983        /**
     13984         * Sets the current selection to the specified DOM element.
     13985         *
     13986         * @method setNode
     13987         * @param {Element} elm Element to set as the contents of the selection.
     13988         * @return {Element} Returns the element that got passed in.
     13989         * @example
     13990         * // Inserts a DOM node at current selection/caret location
     13991         * tinymce.activeEditor.selection.setNode(tinymce.activeEditor.dom.create('img', {src: 'some.gif', title: 'some title'}));
     13992         */
     13993        setNode: function(elm) {
     13994            var self = this;
     13995
     13996            self.setContent(self.dom.getOuterHTML(elm));
     13997
     13998            return elm;
     13999        },
     14000
     14001        /**
     14002         * Returns the currently selected element or the common ancestor element for both start and end of the selection.
     14003         *
     14004         * @method getNode
     14005         * @return {Element} Currently selected element or common ancestor element.
     14006         * @example
     14007         * // Alerts the currently selected elements node name
     14008         * alert(tinymce.activeEditor.selection.getNode().nodeName);
     14009         */
     14010        getNode: function() {
     14011            var self = this, rng = self.getRng(), elm;
     14012            var startContainer = rng.startContainer, endContainer = rng.endContainer;
     14013            var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot();
     14014
     14015            function skipEmptyTextNodes(node, forwards) {
     14016                var orig = node;
     14017
     14018                while (node && node.nodeType === 3 && node.length === 0) {
     14019                    node = forwards ? node.nextSibling : node.previousSibling;
     14020                }
     14021
     14022                return node || orig;
     14023            }
     14024
     14025            // Range maybe lost after the editor is made visible again
     14026            if (!rng) {
     14027                return root;
     14028            }
     14029
     14030            if (rng.setStart) {
     14031                elm = rng.commonAncestorContainer;
     14032
     14033                // Handle selection a image or other control like element such as anchors
     14034                if (!rng.collapsed) {
     14035                    if (startContainer == endContainer) {
     14036                        if (endOffset - startOffset < 2) {
     14037                            if (startContainer.hasChildNodes()) {
     14038                                elm = startContainer.childNodes[startOffset];
     14039                            }
     14040                        }
     14041                    }
     14042
     14043                    // If the anchor node is a element instead of a text node then return this element
     14044                    //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1)
     14045                    //  return sel.anchorNode.childNodes[sel.anchorOffset];
     14046
     14047                    // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent.
     14048                    // This happens when you double click an underlined word in FireFox.
     14049                    if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
     14050                        if (startContainer.length === startOffset) {
     14051                            startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
     14052                        } else {
     14053                            startContainer = startContainer.parentNode;
     14054                        }
     14055
     14056                        if (endOffset === 0) {
     14057                            endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
     14058                        } else {
     14059                            endContainer = endContainer.parentNode;
     14060                        }
     14061
     14062                        if (startContainer && startContainer === endContainer) {
     14063                            return startContainer;
     14064                        }
     14065                    }
     14066                }
     14067
     14068                if (elm && elm.nodeType == 3) {
     14069                    return elm.parentNode;
     14070                }
     14071
     14072                return elm;
     14073            }
     14074
     14075            elm = rng.item ? rng.item(0) : rng.parentElement();
     14076
     14077            // IE 7 might return elements outside the iframe
     14078            if (elm.ownerDocument !== self.win.document) {
     14079                elm = root;
     14080            }
     14081
     14082            return elm;
     14083        },
     14084
     14085        getSelectedBlocks: function(startElm, endElm) {
     14086            var self = this, dom = self.dom, node, root, selectedBlocks = [];
     14087
     14088            root = dom.getRoot();
     14089            startElm = dom.getParent(startElm || self.getStart(), dom.isBlock);
     14090            endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock);
     14091
     14092            if (startElm && startElm != root) {
     14093                selectedBlocks.push(startElm);
     14094            }
     14095
     14096            if (startElm && endElm && startElm != endElm) {
     14097                node = startElm;
     14098
     14099                var walker = new TreeWalker(startElm, root);
     14100                while ((node = walker.next()) && node != endElm) {
     14101                    if (dom.isBlock(node)) {
     14102                        selectedBlocks.push(node);
     14103                    }
     14104                }
     14105            }
     14106
     14107            if (endElm && startElm != endElm && endElm != root) {
     14108                selectedBlocks.push(endElm);
     14109            }
     14110
     14111            return selectedBlocks;
     14112        },
     14113
     14114        isForward: function() {
     14115            var dom = this.dom, sel = this.getSel(), anchorRange, focusRange;
     14116
     14117            // No support for selection direction then always return true
     14118            if (!sel || !sel.anchorNode || !sel.focusNode) {
     14119                return true;
     14120            }
     14121
     14122            anchorRange = dom.createRng();
     14123            anchorRange.setStart(sel.anchorNode, sel.anchorOffset);
     14124            anchorRange.collapse(true);
     14125
     14126            focusRange = dom.createRng();
     14127            focusRange.setStart(sel.focusNode, sel.focusOffset);
     14128            focusRange.collapse(true);
     14129
     14130            return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
     14131        },
     14132
     14133        normalize: function() {
     14134            var self = this, rng = self.getRng();
     14135
     14136            if (!isIE && new RangeUtils(self.dom).normalize(rng)) {
     14137                self.setRng(rng, self.isForward());
     14138            }
     14139
     14140            return rng;
     14141        },
     14142
     14143        /**
     14144         * Executes callback of the current selection matches the specified selector or not and passes the state and args to the callback.
     14145         *
     14146         * @method selectorChanged
     14147         * @param {String} selector CSS selector to check for.
     14148         * @param {function} callback Callback with state and args when the selector is matches or not.
     14149         */
     14150        selectorChanged: function(selector, callback) {
     14151            var self = this, currentSelectors;
     14152
     14153            if (!self.selectorChangedData) {
     14154                self.selectorChangedData = {};
     14155                currentSelectors = {};
     14156
     14157                self.editor.on('NodeChange', function(e) {
     14158                    var node = e.element, dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
     14159
     14160                    // Check for new matching selectors
     14161                    each(self.selectorChangedData, function(callbacks, selector) {
     14162                        each(parents, function(node) {
     14163                            if (dom.is(node, selector)) {
     14164                                if (!currentSelectors[selector]) {
     14165                                    // Execute callbacks
     14166                                    each(callbacks, function(callback) {
     14167                                        callback(true, {node: node, selector: selector, parents: parents});
     14168                                    });
     14169
     14170                                    currentSelectors[selector] = callbacks;
     14171                                }
     14172
     14173                                matchedSelectors[selector] = callbacks;
     14174                                return false;
     14175                            }
     14176                        });
     14177                    });
     14178
     14179                    // Check if current selectors still match
     14180                    each(currentSelectors, function(callbacks, selector) {
     14181                        if (!matchedSelectors[selector]) {
     14182                            delete currentSelectors[selector];
     14183
     14184                            each(callbacks, function(callback) {
     14185                                callback(false, {node: node, selector: selector, parents: parents});
     14186                            });
     14187                        }
     14188                    });
     14189                });
     14190            }
     14191
     14192            // Add selector listeners
     14193            if (!self.selectorChangedData[selector]) {
     14194                self.selectorChangedData[selector] = [];
     14195            }
     14196
     14197            self.selectorChangedData[selector].push(callback);
     14198
     14199            return self;
     14200        },
     14201
     14202        getScrollContainer: function() {
     14203            var scrollContainer, node = this.dom.getRoot();
     14204
     14205            while (node && node.nodeName != 'BODY') {
     14206                if (node.scrollHeight > node.clientHeight) {
     14207                    scrollContainer = node;
     14208                    break;
     14209                }
     14210
     14211                node = node.parentNode;
     14212            }
     14213
     14214            return scrollContainer;
     14215        },
     14216
     14217        scrollIntoView: function(elm) {
     14218            var y, viewPort, self = this, dom = self.dom, root = dom.getRoot(), viewPortY, viewPortH;
     14219
     14220            function getPos(elm) {
     14221                var x = 0, y = 0;
     14222
     14223                var offsetParent = elm;
     14224                while (offsetParent && offsetParent.nodeType) {
     14225                    x += offsetParent.offsetLeft || 0;
     14226                    y += offsetParent.offsetTop || 0;
     14227                    offsetParent = offsetParent.offsetParent;
     14228                }
     14229
     14230                return {x: x, y: y};
     14231            }
     14232
     14233            if (root.nodeName != 'BODY') {
     14234                var scrollContainer = self.getScrollContainer();
     14235                if (scrollContainer) {
     14236                    y = getPos(elm).y - getPos(scrollContainer).y;
     14237                    viewPortH = scrollContainer.clientHeight;
     14238                    viewPortY = scrollContainer.scrollTop;
     14239                    if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
     14240                        scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
     14241                    }
     14242
     14243                    return;
     14244                }
     14245            }
     14246
     14247            viewPort = dom.getViewPort(self.editor.getWin());
     14248            y = dom.getPos(elm).y;
     14249            viewPortY = viewPort.y;
     14250            viewPortH = viewPort.h;
     14251            if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
     14252                self.editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
     14253            }
     14254        },
     14255
     14256        _moveEndPoint: function(rng, node, start) {
     14257            var root = node, walker = new TreeWalker(node, root);
     14258            var nonEmptyElementsMap = this.dom.schema.getNonEmptyElements();
     14259
     14260            do {
     14261                // Text node
     14262                if (node.nodeType == 3 && trim(node.nodeValue).length !== 0) {
     14263                    if (start) {
     14264                        rng.setStart(node, 0);
     14265                    } else {
     14266                        rng.setEnd(node, node.nodeValue.length);
     14267                    }
     14268
     14269                    return;
     14270                }
     14271
     14272                // BR/IMG/INPUT elements
     14273                if (nonEmptyElementsMap[node.nodeName]) {
     14274                    if (start) {
     14275                        rng.setStartBefore(node);
     14276                    } else {
     14277                        if (node.nodeName == 'BR') {
     14278                            rng.setEndBefore(node);
     14279                        } else {
     14280                            rng.setEndAfter(node);
     14281                        }
     14282                    }
     14283
     14284                    return;
     14285                }
     14286
     14287                // Found empty text block old IE can place the selection inside those
     14288                if (Env.ie && Env.ie < 11 && this.dom.isBlock(node) && this.dom.isEmpty(node)) {
     14289                    if (start) {
     14290                        rng.setStart(node, 0);
     14291                    } else {
     14292                        rng.setEnd(node, 0);
     14293                    }
     14294
     14295                    return;
     14296                }
     14297            } while ((node = (start ? walker.next() : walker.prev())));
     14298
     14299            // Failed to find any text node or other suitable location then move to the root of body
     14300            if (root.nodeName == 'BODY') {
     14301                if (start) {
     14302                    rng.setStart(root, 0);
     14303                } else {
     14304                    rng.setEnd(root, root.childNodes.length);
     14305                }
     14306            }
     14307        },
     14308
     14309        destroy: function() {
     14310            this.win = null;
     14311            this.controlSelection.destroy();
     14312        }
     14313    };
     14314
     14315    return Selection;
    1427114316});
    1427214317
     
    1441614461                removeformat: [
    1441714462                    {
    14418                         selector: 'b,strong,em,i,font,u,strike,sub,sup',
     14463                        selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q',
    1441914464                        remove: 'all',
    1442014465                        split: true,
     
    1483114876
    1483214877                        // If child was found and of the same type as the current node
    14833                         if (child && matchName(child, format)) {
     14878                        if (child && !isBookmarkNode(child) && matchName(child, format)) {
    1483414879                            clone = dom.clone(child, FALSE);
    1483514880                            setElementFormat(clone);
     
    1486514910                            each(dom.select(format.inline, node), function(child) {
    1486614911                                var parent;
     14912
     14913                                if (isBookmarkNode(child)) {
     14914                                    return;
     14915                                }
    1486714916
    1486814917                                // When wrap_links is set to false we don't want
     
    1616716216
    1616816217                for (node = inc ? node : node[next]; node; node = node[next]) {
    16169                     if (node.nodeType == 1 && !isWhiteSpaceNode(node)) {
     16218                    if (node.nodeType == 1 || !isWhiteSpaceNode(node)) {
    1617016219                        return node;
    1617116220                    }
     
    1628516334                }
    1628616335
    16287                 return TRUE;
     16336                return !isBookmarkNode(node1) && !isBookmarkNode(node2);
    1628816337            }
    1628916338
     
    1673216781        }
    1673316782
    16734         function addNonTypingUndoLevel() {
     16783        function addNonTypingUndoLevel(e) {
    1673516784            self.typing = false;
    16736             self.add();
     16785            self.add({}, e);
    1673716786        }
    1673816787
     
    1675616805
    1675716806            if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
    16758                 self.add();
     16807                addNonTypingUndoLevel(e);
    1675916808            }
    1676016809        });
     
    1676416813        });
    1676516814
    16766         editor.on('SaveContent ObjectResized', addNonTypingUndoLevel);
     16815        editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel);
    1676716816        editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel);
    16768         editor.dom.bind(editor.getBody(), 'focusout', function() {
    16769             if (!editor.removed && self.typing) {
    16770                 addNonTypingUndoLevel();
    16771             }
    16772         });
    1677316817
    1677416818        editor.on('KeyUp', function(e) {
     
    1680816852            if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) {
    1680916853                if (self.typing) {
    16810                     addNonTypingUndoLevel();
     16854                    addNonTypingUndoLevel(e);
    1681116855                }
    1681216856
     
    1681816862                self.beforeChange();
    1681916863                self.typing = true;
    16820                 self.add();
     16864                self.add({}, e);
    1682116865                isFirstTypedCharacter = true;
    1682216866            }
    1682316867        });
    1682416868
    16825         editor.on('MouseDown', function() {
     16869        editor.on('MouseDown', function(e) {
    1682616870            if (self.typing) {
    16827                 addNonTypingUndoLevel();
     16871                addNonTypingUndoLevel(e);
    1682816872            }
    1682916873        });
     
    1686716911             *
    1686816912             * @method add
    16869              * @param {Object} l Optional undo level object to add.
     16913             * @param {Object} level Optional undo level object to add.
     16914             * @param {DOMEvent} Event Optional event responsible for the creation of the undo level.
    1687016915             * @return {Object} Undo level that got added or null it a level wasn't needed.
    1687116916             */
    16872             add: function(level) {
     16917            add: function(level, event) {
    1687316918                var i, settings = editor.settings, lastLevel;
    1687416919
     
    1687616921                level.content = getContent();
    1687716922
    16878                 if (lock || editor.fire('BeforeAddUndo', {level: level}).isDefaultPrevented()) {
     16923                if (lock || editor.removed) {
     16924                    return null;
     16925                }
     16926
     16927                if (editor.fire('BeforeAddUndo', {level: level, originalEvent: event}).isDefaultPrevented()) {
    1687916928                    return null;
    1688016929                }
     
    1691416963                index = data.length - 1;
    1691516964
    16916                 var args = {level: level, lastLevel: lastLevel};
     16965                var args = {level: level, lastLevel: lastLevel, originalEvent: event};
    1691716966
    1691816967                editor.fire('AddUndo', args);
    1691916968
    1692016969                if (index > 0) {
     16970                    editor.isNotDirty = false;
    1692116971                    editor.fire('change', args);
    16922                     editor.isNotDirty = false;
    1692316972                }
    1692416973
     
    1705217101define("tinymce/EnterKey", [
    1705317102    "tinymce/dom/TreeWalker",
     17103    "tinymce/dom/RangeUtils",
    1705417104    "tinymce/Env"
    17055 ], function(TreeWalker, Env) {
     17105], function(TreeWalker, RangeUtils, Env) {
    1705617106    var isIE = Env.ie && Env.ie < 11;
    1705717107
     
    1706117111
    1706217112        function handleEnterKey(evt) {
    17063             var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
     17113            var rng, tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
    1706417114                newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
    1706517115
     
    1722617276                if (settings.keep_styles !== false) {
    1722717277                    do {
    17228                         if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {
     17278                        if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U|VAR|CITE|DFN|CODE|MARK|Q|SUP|SUB|SAMP)$/.test(node.nodeName)) {
    1722917279                            // Never clone a caret containers
    1723017280                            if (node.id == '_mce_caret') {
     
    1754317593            }
    1754417594
     17595            rng = selection.getRng(true);
     17596
     17597            // Event is blocked by some other handler for example the lists plugin
     17598            if (evt.isDefaultPrevented()) {
     17599                return;
     17600            }
     17601
    1754517602            // Delete any selected contents
    1754617603            if (!rng.collapsed) {
     
    1754917606            }
    1755017607
    17551             // Event is blocked by some other handler for example the lists plugin
    17552             if (evt.isDefaultPrevented()) {
    17553                 return;
    17554             }
    17555 
    1755617608            // Setup range items and newBlockName
     17609            new RangeUtils(dom).normalize(rng);
    1755717610            container = rng.startContainer;
    1755817611            offset = rng.startOffset;
     
    1756517618            if (container.nodeType == 1 && container.hasChildNodes()) {
    1756617619                isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
     17620
    1756717621                container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
    1756817622                if (isAfterLastNodeInContainer && container.nodeType == 3) {
     
    2007120125
    2007220126            // Initial states
    20073             self._id = DomUtils.id();
     20127            self._id = settings.id || DomUtils.id();
    2007420128            self._text = self._name = '';
    2007520129            self._width = self._height = 0;
     
    2102721081         */
    2102821082        aria: function(name, value) {
    21029             var self = this, elm = self.getEl();
     21083            var self = this, elm = self.getEl(self.ariaTarget);
    2103021084
    2103121085            if (typeof(value) === "undefined") {
     
    2103621090
    2103721091            if (self._rendered) {
    21038                 if (name == 'label') {
    21039                     elm.setAttribute('aria-labelledby', self._id);
    21040                 }
    21041 
    2104221092                elm.setAttribute(name == 'role' ? name : 'aria-' + name, value);
    2104321093            }
     
    2167021720});
    2167121721
     21722// Included from: js/tinymce/classes/ui/KeyboardNavigation.js
     21723
     21724/**
     21725 * KeyboardNavigation.js
     21726 *
     21727 * Copyright, Moxiecode Systems AB
     21728 * Released under LGPL License.
     21729 *
     21730 * License: http://www.tinymce.com/license
     21731 * Contributing: http://www.tinymce.com/contributing
     21732 */
     21733
     21734/**
     21735 * This class handles keyboard navigation of controls and elements.
     21736 *
     21737 * @class tinymce.ui.KeyboardNavigation
     21738 */
     21739define("tinymce/ui/KeyboardNavigation", [
     21740], function() {
     21741    "use strict";
     21742
     21743    /**
     21744     * This class handles all keyboard navigation for WAI-ARIA support. Each root container
     21745     * gets an instance of this class.
     21746     *
     21747     * @constructor
     21748     */
     21749    return function(settings) {
     21750        var root = settings.root, focusedElement, focusedControl;
     21751
     21752        focusedElement = document.activeElement;
     21753        focusedControl = root.getParentCtrl(focusedElement);
     21754
     21755        /**
     21756         * Returns the currently focused elements wai aria role of the currently
     21757         * focused element or specified element.
     21758         *
     21759         * @private
     21760         * @param {Element} elm Optional element to get role from.
     21761         * @return {String} Role of specified element.
     21762         */
     21763        function getRole(elm) {
     21764            elm = elm || focusedElement;
     21765
     21766            return elm && elm.getAttribute('role');
     21767        }
     21768
     21769        /**
     21770         * Returns the wai role of the parent element of the currently
     21771         * focused element or specified element.
     21772         *
     21773         * @private
     21774         * @param {Element} elm Optional element to get parent role from.
     21775         * @return {String} Role of the first parent that has a role.
     21776         */
     21777        function getParentRole(elm) {
     21778            var role, parent = elm || focusedElement;
     21779
     21780            while ((parent = parent.parentNode)) {
     21781                if ((role = getRole(parent))) {
     21782                    return role;
     21783                }
     21784            }
     21785        }
     21786
     21787        /**
     21788         * Returns a wai aria property by name for example aria-selected.
     21789         *
     21790         * @private
     21791         * @param {String} name Name of the aria property to get for example "disabled".
     21792         * @return {String} Aria property value.
     21793         */
     21794        function getAriaProp(name) {
     21795            var elm = focusedElement;
     21796
     21797            if (elm) {
     21798                return elm.getAttribute('aria-' + name);
     21799            }
     21800        }
     21801
     21802        /**
     21803         * Is the element a text input element or not.
     21804         *
     21805         * @private
     21806         * @param {Element} elm Element to check if it's an text input element or not.
     21807         * @return {Boolean} True/false if the element is a text element or not.
     21808         */
     21809        function isTextInputElement(elm) {
     21810            // Notice: since type can be "email" etc we don't check the type
     21811            // So all input elements gets treated as text input elements
     21812            return elm.tagName == "INPUT" || elm.tagName == "TEXTAREA";
     21813        }
     21814
     21815        /**
     21816         * Returns true/false if the specified element can be focused or not.
     21817         *
     21818         * @private
     21819         * @param {Element} elm DOM element to check if it can be focused or not.
     21820         * @return {Boolean} True/false if the element can have focus.
     21821         */
     21822        function canFocus(elm) {
     21823            if (isTextInputElement(elm) && !elm.hidden) {
     21824                return true;
     21825            }
     21826
     21827            if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(getRole(elm))) {
     21828                return true;
     21829            }
     21830
     21831            return false;
     21832        }
     21833
     21834        /**
     21835         * Returns an array of focusable visible elements within the specified container element.
     21836         *
     21837         * @private
     21838         * @param {Element} elm DOM element to find focusable elements within.
     21839         * @return {Array} Array of focusable elements.
     21840         */
     21841        function getFocusElements(elm) {
     21842            var elements = [];
     21843
     21844            function collect(elm) {
     21845                if (elm.nodeType != 1 || elm.style.display == 'none') {
     21846                    return;
     21847                }
     21848
     21849                if (canFocus(elm)) {
     21850                    elements.push(elm);
     21851                }
     21852
     21853                for (var i = 0; i < elm.childNodes.length; i++) {
     21854                    collect(elm.childNodes[i]);
     21855                }
     21856            }
     21857
     21858            collect(elm || root.getEl());
     21859
     21860            return elements;
     21861        }
     21862
     21863        /**
     21864         * Returns the navigation root control for the specified control. The navigation root
     21865         * is the control that the keyboard navigation gets scoped to for example a menubar or toolbar group.
     21866         * It will look for parents of the specified target control or the currenty focused control if this option is omitted.
     21867         *
     21868         * @private
     21869         * @param {tinymce.ui.Control} targetControl Optional target control to find root of.
     21870         * @return {tinymce.ui.Control} Navigation root control.
     21871         */
     21872        function getNavigationRoot(targetControl) {
     21873            var navigationRoot, controls;
     21874
     21875            targetControl = targetControl || focusedControl;
     21876            controls = targetControl.parents().toArray();
     21877            controls.unshift(targetControl);
     21878
     21879            for (var i = 0; i < controls.length; i++) {
     21880                navigationRoot = controls[i];
     21881
     21882                if (navigationRoot.settings.ariaRoot) {
     21883                    break;
     21884                }
     21885            }
     21886
     21887            return navigationRoot;
     21888        }
     21889
     21890        /**
     21891         * Focuses the first item in the specified targetControl element or the last aria index if the
     21892         * navigation root has the ariaRemember option enabled.
     21893         *
     21894         * @private
     21895         * @param {tinymce.ui.Control} targetControl Target control to focus the first item in.
     21896         */
     21897        function focusFirst(targetControl) {
     21898            var navigationRoot = getNavigationRoot(targetControl);
     21899            var focusElements = getFocusElements(navigationRoot.getEl());
     21900
     21901            if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) {
     21902                moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
     21903            } else {
     21904                moveFocusToIndex(0, focusElements);
     21905            }
     21906        }
     21907
     21908        /**
     21909         * Moves the focus to the specified index within the elements list.