ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 7358


Ignore:
Timestamp:
May 23, 2008, 11:37:39 PM (12 years ago)
Author:
ebihara
Message:

#2352:revert r7289

Location:
OpenPNE/trunk/public_html/js/tiny_mce/plugins/openpne
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/public_html/js/tiny_mce/plugins/openpne/editor_plugin.js

    r7289 r7358  
    3131id=t.prefix+id;s=tinymce.extend({title:s.title,'class':'mce_'+id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope},s);c=new tinymce.ui.OpenPNECmdButton(id,s);ed.onPostRender.add(function(){var parentContainer=document.getElementById(c.id).parentNode;parentContainer.style.width="45px";});ed.onRemove.add(function(){c.destroy();});return t.add(c);},_previewToText:function(s,editor){var editorDoc=editor.getBody();function rep(re,str){s=s.replace(re,str);};if(!tinymce.isWebKit){s=tinymce.trim(s);rep('/<(\/?)strong>/gi','<\1b>');rep('/<(\/?)strike>/gi','<\1s>');rep('/<(\/?)em>/gi','<\1i>');editor.dom.setHTML(editor.getBody(),s);}
    3232function convertHtmlTagToDecoTag(doc,tagname)
    33 {var tagList=doc.getElementsByTagName(tagname);var org_tagname=tagname;var args={};if(Prototype.Browser.IE&&org_tagname!="font"){var reg=new RegExp("<"+tagname+">","gi");editorDoc.innerHTML=editorDoc.innerHTML.replace(reg,"<op"+tagname+">");var reg=new RegExp("</"+tagname+">","gi");editorDoc.innerHTML=editorDoc.innerHTML.replace(reg,"</op"+tagname+">");s=editorDoc.innerHTML;return;}
    34 while(tagList.length){targetObj=tagList[0];if(org_tagname=="font"){var size=targetObj.getAttribute("size");var color=targetObj.getAttribute("color");if(size&&color){if(tinymce.isIE){targetObj.removeAttribute("color");targetObj.innerHTML='<font color="'+color+'">'+targetObj.innerHTML+"</font>";}else{var fontSize=document.createElement("font");fontSize.setAttribute("size",size);fontSize.removeAttribute("color");var clone=targetObj.cloneNode(true);clone.removeAttribute("size");fontSize.appendChild(clone);targetObj.parentNode.replaceChild(fontSize,targetObj);}
     33{var tagList=doc.getElementsByTagName(tagname);var org_tagname=tagname;var args={};while(tagList.length){targetObj=tagList[0];if(org_tagname=="font"){var size=targetObj.getAttribute("size");var color=targetObj.getAttribute("color");if(size&&color){if(tinymce.isIE){targetObj.removeAttribute("color");targetObj.innerHTML='<font color="'+color+'">'+targetObj.innerHTML+"</font>";}else{var fontSize=document.createElement("font");fontSize.setAttribute("size",size);fontSize.removeAttribute("color");var clone=targetObj.cloneNode(true);clone.removeAttribute("size");fontSize.appendChild(clone);targetObj.parentNode.replaceChild(fontSize,targetObj);}
    3534tagList=doc.getElementsByTagName(org_tagname);args={};continue;}
    3635if(size=='5'){tagname='op:large';}else if(size=='1'){tagname='op:small';}
     
    4039tagList=doc.getElementsByTagName(org_tagname);}
    4140s=editorDoc.innerHTML;}
    42 var convertList=new Array('span','font','b','u','s','i');for(var i=0;i<convertList.length;i++){convertHtmlTagToDecoTag(editor.getBody(),convertList[i]);}
     41var convertList=new Array('span','b','u','s','i','font');for(var i=0;i<convertList.length;i++){convertHtmlTagToDecoTag(editor.getBody(),convertList[i]);}
    4342rep(/<\/?div>/gi,"");if(tinymce.isIE){rep(/<op/gi,"<op:");rep(/<\/op/gi,"</op:");}
    4443rep(/<br\s?\/?[^>]*>/gi,"\n\n");rep(/&nbsp;/gi," ");rep(/&quot;/gi,"\"");rep(/&lt;/gi,"<");rep(/&gt;/gi,">");rep(/&amp;/gi,"&");return s;},_textToPreview:function(s){s=tinymce.trim(s);var rule=/&lt;op:(b|u|s|i|large|small|color)( code="(#[0-9a-f]{3,6})"|)&gt;(.*?)&lt;\/op:\1&gt;/i;function rep(re,str){s=s.replace(re,str);};function convertDecoTagToHtmlTag(matches)
  • OpenPNE/trunk/public_html/js/tiny_mce/plugins/openpne/editor_plugin.js.src

    r7289 r7358  
    378378                var org_tagname = tagname;
    379379                var args = {};
    380 
    381                 if (Prototype.Browser.IE && org_tagname != "font") {
    382                     var reg = new RegExp("<" + tagname + ">", "gi");
    383                     editorDoc.innerHTML = editorDoc.innerHTML.replace(reg, "<op" + tagname + ">");
    384 
    385                     var reg = new RegExp("</" + tagname + ">", "gi");
    386                     editorDoc.innerHTML = editorDoc.innerHTML.replace(reg, "</op" + tagname + ">");
    387 
    388                     s = editorDoc.innerHTML;
    389                     return;
    390                 }
    391380
    392381                while (tagList.length) {
     
    477466            }
    478467
    479             var convertList = new Array('span', 'font', 'b', 'u', 's', 'i');
     468            var convertList = new Array('span', 'b', 'u', 's', 'i', 'font');
    480469            for (var i = 0; i < convertList.length; i++) {
    481470                convertHtmlTagToDecoTag(editor.getBody(), convertList[i]);
Note: See TracChangeset for help on using the changeset viewer.