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

Changeset 7407


Ignore:
Timestamp:
May 26, 2008, 7:03:36 PM (12 years ago)
Author:
ebihara
Message:

#2530:小窓ボタンのリンク先URLを変更できるようにした

Location:
OpenPNE/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/public_html/js/pne_decoration.js

    r7291 r7407  
    44if(editor.isHidden()&&previewmode_checked){editor.show();document.getElementById('mce_editor_buttonmenu').style.display="none";}else if(!editor.isHidden()&&textmode_checked){editor.hide();document.getElementById('mce_editor_buttonmenu').style.display="block";}}
    55function pne_mce_editor_init()
    6 {tinyMCE.init({mode:"textareas",theme:"advanced",editor_selector:"mceEditor_dummy_selector",plugins:"openpne",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_buttons1:"op_b,op_u,op_s,op_i,op_large,op_small,op_color,op_image,op_emoji_docomo,op_emoji_au,op_emoji_softbank,|,op_cmd",theme_advanced_buttons2:"",theme_advanced_buttons3:"",valid_elements:"b/strong,u,s/strike,i,font[color|size],br",forced_root_block:false,force_p_newlines:false,force_br_newlines:true,inline_styles:false,language:"ja",entity_encoding:"raw",remove_linebreaks:false,custom_undo_redo_levels:0,custom_undo_redo:false});var textmode_checkbox=document.getElementById("mce_editor_mode_changer_1");var previewmode_checkbox=document.getElementById("mce_editor_mode_changer_2");if(previewmode_checkbox.checked){textmode_checkbox.checked=true;previewmode_checkbox.checked=false;}}
     6{tinyMCE.init({mode:"textareas",theme:"advanced",editor_selector:"mceEditor_dummy_selector",plugins:"openpne",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_buttons1:"op_b,op_u,op_s,op_i,op_large,op_small,op_color,op_image,op_emoji_docomo,op_emoji_au,op_emoji_softbank,op_cmd",theme_advanced_buttons2:"",theme_advanced_buttons3:"",valid_elements:"b/strong,u,s/strike,i,font[color|size],br",forced_root_block:false,force_p_newlines:false,force_br_newlines:true,inline_styles:false,language:"ja",entity_encoding:"raw",remove_linebreaks:false,custom_undo_redo_levels:0,custom_undo_redo:false});var textmode_checkbox=document.getElementById("mce_editor_mode_changer_1");var previewmode_checkbox=document.getElementById("mce_editor_mode_changer_2");if(previewmode_checkbox.checked){textmode_checkbox.checked=true;previewmode_checkbox.checked=false;}}
    77function pne_mce_insert_tagname(id,tagname,opt)
    88{var opt=opt||"";var elm=document.getElementById(id);var selection=new Selection(elm);var pos=selection.create();if(tagname=="op:color"&&!opt){pne_mce_show_color_table(id,tagname);return;}
  • OpenPNE/trunk/public_html/js/pne_decoration.js.src

    r7291 r7407  
    2929        theme_advanced_toolbar_location : "top",
    3030        theme_advanced_toolbar_align : "left",
    31         theme_advanced_buttons1 : "op_b,op_u,op_s,op_i,op_large,op_small,op_color,op_image,op_emoji_docomo,op_emoji_au,op_emoji_softbank,|,op_cmd",
     31        theme_advanced_buttons1 : "op_b,op_u,op_s,op_i,op_large,op_small,op_color,op_image,op_emoji_docomo,op_emoji_au,op_emoji_softbank,op_cmd",
    3232        theme_advanced_buttons2 : "",
    3333        theme_advanced_buttons3 : "",
  • OpenPNE/trunk/public_html/js/tiny_mce/plugins/openpne/editor_plugin.js

    r7385 r7407  
    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;" 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('http://www.openpne.jp/cmd/');});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,'','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});}}
    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);}
    1111if(n=="op_emoji_docomo"||n=="op_emoji_au"&&config["op_emoji_au"].isEnabled||n=="op_emoji_softbank"&&config["op_emoji_softbank"].isEnabled){var emoji_config={op_emoji_docomo:{carrier:"i",emoji:[{start:1,end:252}],title:"{#openpne."+n+"}",image:config[n].imageURL},op_emoji_au:{carrier:"e",emoji:[{start:1,end:518},{start:700,end:822}],title:"{#openpne."+n+"}",image:config[n].imageURL},op_emoji_softbank:{carrier:"s",emoji:[{start:1,end:485}],title:"{#openpne."+n+"}",image:config[n].imageURL}}
    1212c=this._createOpenPNEEmojiButton(n,emoji_config[n],cm);}
    13 if(n=="op_cmd"){c=this._createOpenPNECmdButton(n,{title:"{#openpne.op_cmd}",image:config["op_cmd"].imageURL,cmd:"mceOpenPNE_op_cmd"},cm);}
     13if(n=="op_cmd"&&config["op_cmd"].isEnabled){c=this._createOpenPNECmdButton(n,{title:"{#openpne.op_cmd}",image:config["op_cmd"].imageURL,cmd:"mceOpenPNE_op_cmd"},cm);}
    1414return c;},getInfo:function(){return{longname:'OpenPNE plugin',author:'Kousuke Ebihara',version:"1.0"}},_getTagName:function(elm){var tagname=elm.nodeName.toLowerCase();if(Prototype.Browser.WebKit&&tagname=="span"){if(elm.style.fontWeight=='bold'){return'b';}
    1515if(elm.style.textDecoration=='underline'){return'u';}
     
    2929s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}
    3030if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}
    31 id=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);}
     31id=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="70px";});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)
    3333{var tagList=doc.getElementsByTagName(tagname);var org_tagname=tagname;var args={};if(Prototype.Browser.IE&&org_tagname!="font"){return;}
  • OpenPNE/trunk/public_html/js/tiny_mce/plugins/openpne/editor_plugin.js.src

    r7385 r7407  
    101101        renderHTML : function() {
    102102            var s = this.settings;
    103             var h = '<a id="' + this.id + '" href="javascript:;" class="mceButton mceButtonEnabled ' + s['class'] + '" style="width:40px;" onmousedown="return false;" onclick="return false;" title="' + tinymce.DOM.encode(s.title) + '"><img class="mceIcon" style="width:40px;" src="' + s.image + '" /></a>';
     103            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>';
    104104
    105105            return h;
     
    141141            });
    142142            ed.addCommand('mceOpenPNE_op_cmd', function() {
    143                 window.open('http://www.openpne.jp/cmd/');
     143                window.open(config.op_cmd.contentURL);
    144144            });
    145145
     
    216216            }
    217217
    218             if (n == "op_cmd") {
     218            if (n == "op_cmd" && config["op_cmd"].isEnabled) {
    219219                c = this._createOpenPNECmdButton(n, {title: "{#openpne.op_cmd}", image: config["op_cmd"].imageURL, cmd: "mceOpenPNE_op_cmd"}, cm);
    220220            }
     
    348348            ed.onPostRender.add(function() {
    349349                var parentContainer = document.getElementById(c.id).parentNode;
    350                 parentContainer.style.width = "45px";
     350                parentContainer.style.width = "70px";
    351351            });
    352352
  • OpenPNE/trunk/webapp/lib/OpenPNE/Config.php

    r6806 r7407  
    237237            'OPENPNE_FUNCTION_CACHE_LIFETIME_SHORT' => 1200,
    238238            'OPENPNE_FUNCTION_CACHE_LIFETIME_LONG' => 3600,
     239            'OPENPNE_DECORATION_CMD_URL' => 'http://www.openpne.jp/cmd/',
    239240        );
    240241
  • OpenPNE/trunk/webapp/modules/pc/templates/inc_tinymce_textarea.tpl

    r7226 r7407  
    5353        },
    5454        op_cmd : {
    55             isEnabled : 1,
    56             imageURL : "({t_img_url_skin filename=deco_op_cmd})"
     55            isEnabled : ({if $smarty.const.OPENPNE_DECORATION_CMD_URL})1({else})0({/if}),
     56            imageURL : "({t_img_url_skin filename=deco_op_cmd})",
     57            contentURL : "({$smarty.const.OPENPNE_DECORATION_CMD_URL})"
    5758        }
    5859    }
     
    7879<a id="mce_textmode_button_op_emoji_softbank" href="#" onclick="togglePallet('epSb');"><img src="({t_img_url_skin filename=deco_op_emoji_softbank})" alt="" /></a>
    7980({/if})
    80 <a id="mce_textmode_button_op_cmd" href="#" style="margin-left:20px;" onclick="window.open('http://www.openpne.jp/cmd/')"><img src="({t_img_url_skin filename=deco_op_cmd})" alt="" /></a>
     81({if $smarty.const.OPENPNE_DECORATION_CMD_URL})
     82<a id="mce_textmode_button_op_cmd" href="#" style="margin-left:20px;" onclick="window.open('({$smarty.const.OPENPNE_DECORATION_CMD_URL})')"><img src="({t_img_url_skin filename=deco_op_cmd})" alt="" /></a>
     83({/if})
    8184
    8285({if $smarty.const.OPENPNE_EMOJI_DOCOMO_FOR_PC})
Note: See TracChangeset for help on using the changeset viewer.