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

Changeset 7425


Ignore:
Timestamp:
May 27, 2008, 2:50:41 PM (11 years ago)
Author:
ebihara
Message:

#2530:プレビューモードでwindow.open()されるURLが過剰にエスケープされる問題への対策

Location:
OpenPNE/trunk
Files:
3 edited

Legend:

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

    r7407 r7425  
    66DOM.addClass(m,'mceColorSplitMenu');return w;},renderHTML:function(){var s=this.settings,h='<a id="'+this.id+'" href="javascript:;" class="mceButton mceButtonEnabled '+s['class']
    77+'" onmousedown="return false;" onclick="return false;" title="'+tinymce.DOM.encode(s.title)+'">';if(s.image){h+='<img class="mceIcon" src="'+s.image+'" /></a>';}else{h+='<span class="mceIcon '+s['class']+'"></span></a>';}
    8 return h;},postRender:function(){tinymce.dom.Event.add(this.id,'click',this.showMenu,this);}});tinymce.create('tinymce.ui.OpenPNECmdButton:tinymce.ui.Button',{renderHTML:function(){var s=this.settings;var h='<a id="'+this.id+'" href="javascript:;" class="mceButton mceButtonEnabled '+s['class']+'" style="width:40px; margin-left: 25px;" onmousedown="return false;" onclick="return false;" title="'+tinymce.DOM.encode(s.title)+'"><img class="mceIcon" style="width:40px;" src="'+s.image+'" /></a>';return h;}});tinymce.PluginManager.requireLangPack('openpne');var config=pne_mce_editor_get_config();tinymce.create('tinymce.plugins.OpenPNEPlugin',{init:function(ed,url){var t=this;ed.settings.content_css=url+"/css/editor.css";ed.addCommand('mceOpenPNE_op_b',function(){tinyMCE.execCommand("Bold");});ed.addCommand('mceOpenPNE_op_u',function(){tinyMCE.execCommand("Underline");});ed.addCommand('mceOpenPNE_op_s',function(){tinyMCE.execCommand("Strikethrough");});ed.addCommand('mceOpenPNE_op_i',function(){tinyMCE.execCommand("Italic");});ed.addCommand('mceOpenPNE_op_large',function(){tinyMCE.execCommand("Fontsize",false,5);});ed.addCommand('mceOpenPNE_op_small',function(){tinyMCE.execCommand("Fontsize",false,1);});ed.addCommand('mceOpenPNE_op_image',function(){window.open(config.op_image.contentURL,'','width=600,height=550,toolbar=no,scrollbars=yes,left=10,top=10');});ed.addCommand('mceOpenPNE_op_cmd',function(){window.open(config.op_cmd.contentURL);});for(var key in config){var value=config[key];if(value.isEnabled&&key!="op_color"){ed.addButton(key,{title:'{#openpne.'+key+'}',image:value.imageURL,cmd:'mceOpenPNE_'+key});}}
     8return h;},postRender:function(){tinymce.dom.Event.add(this.id,'click',this.showMenu,this);}});tinymce.create('tinymce.ui.OpenPNECmdButton:tinymce.ui.Button',{renderHTML:function(){var s=this.settings;var h='<a id="'+this.id+'" href="javascript:;" class="mceButton mceButtonEnabled '+s['class']+'" style="width:40px; margin-left: 25px;" onmousedown="return false;" onclick="return false;" title="'+tinymce.DOM.encode(s.title)+'"><img class="mceIcon" style="width:40px;" src="'+s.image+'" /></a>';return h;}});tinymce.PluginManager.requireLangPack('openpne');var config=pne_mce_editor_get_config();tinymce.create('tinymce.plugins.OpenPNEPlugin',{init:function(ed,url){var t=this;ed.settings.content_css=url+"/css/editor.css";ed.addCommand('mceOpenPNE_op_b',function(){tinyMCE.execCommand("Bold");});ed.addCommand('mceOpenPNE_op_u',function(){tinyMCE.execCommand("Underline");});ed.addCommand('mceOpenPNE_op_s',function(){tinyMCE.execCommand("Strikethrough");});ed.addCommand('mceOpenPNE_op_i',function(){tinyMCE.execCommand("Italic");});ed.addCommand('mceOpenPNE_op_large',function(){tinyMCE.execCommand("Fontsize",false,5);});ed.addCommand('mceOpenPNE_op_small',function(){tinyMCE.execCommand("Fontsize",false,1);});ed.addCommand('mceOpenPNE_op_image',function(){window.open(config.op_image.contentURL.unescapeHTML(),'','width=600,height=550,toolbar=no,scrollbars=yes,left=10,top=10');});ed.addCommand('mceOpenPNE_op_cmd',function(){window.open(config.op_cmd.contentURL.unescapeHTML());});for(var key in config){var value=config[key];if(value.isEnabled&&key!="op_color"){ed.addButton(key,{title:'{#openpne.'+key+'}',image:value.imageURL,cmd:'mceOpenPNE_'+key});}}
    99ed.onBeforeSetContent.add(function(ed,o){o.content=t._textToPreview(o.content);});ed.onPostProcess.add(function(ed,o){if(o.save){if(ed.isHidden()){o.content=ed.getElement().value.replace(/\n\n/g,"\n \n");}else{o.content=t._previewToText(o.content,ed);}}});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('mce_editor_textarea_op_b',false);cm.setActive('mce_editor_textarea_op_u',false);cm.setActive('mce_editor_textarea_op_s',false);cm.setActive('mce_editor_textarea_op_i',false);cm.setActive('mce_editor_textarea_op_large',false);cm.setActive('mce_editor_textarea_op_small',false);var elm=n;while(elm.parentNode){var tagname=t._getTagName(elm);if((tagname=="large"||tagname=="small")&&(cm.get('mce_editor_textarea_op_large').isActive()||cm.get('mce_editor_textarea_op_small').isActive())){elm=elm.parentNode;continue;}
    1010cm.setActive('mce_editor_textarea_op_'+tagname,true);elm=elm.parentNode;}});},createControl:function(n,cm){var c=null;if(n=="op_color"&&config["op_color"].isEnabled){c=this._createOpenPNEColorButton("op_color",{title:"{#openpne.op_color}",image:config["op_color"].imageURL,cmd:"ForeColor"},cm);}
  • OpenPNE/trunk/public_html/js/tiny_mce/plugins/openpne/editor_plugin.js.src

    r7407 r7425  
    138138            });
    139139            ed.addCommand('mceOpenPNE_op_image', function() {
    140                 window.open(config.op_image.contentURL, '', 'width=600,height=550,toolbar=no,scrollbars=yes,left=10,top=10');
     140                window.open(config.op_image.contentURL.unescapeHTML(), '', 'width=600,height=550,toolbar=no,scrollbars=yes,left=10,top=10');
    141141            });
    142142            ed.addCommand('mceOpenPNE_op_cmd', function() {
    143                 window.open(config.op_cmd.contentURL);
     143                window.open(config.op_cmd.contentURL.unescapeHTML());
    144144            });
    145145
  • OpenPNE/trunk/webapp/modules/pc/templates/inc_tinymce_textarea.tpl

    r7407 r7425  
    3838            isEnabled : ({$smarty.const.OPENPNE_USE_ALBUM}),
    3939            imageURL : "({t_img_url_skin filename=deco_op_image})",
    40             contentURL : "({t_url _html=0 m=pc a=page_h_album_insert_dialog})"
     40            contentURL : "({t_url m=pc a=page_h_album_insert_dialog})"
    4141        },
    4242        op_emoji_docomo : {
Note: See TracChangeset for help on using the changeset viewer.