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

Changeset 7175


Ignore:
Timestamp:
May 13, 2008, 5:57:24 PM (11 years ago)
Author:
ebihara
Message:

#2380:文字装飾機能のボタンに小窓アイコンを追加

Location:
OpenPNE/trunk
Files:
6 edited
1 copied

Legend:

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

    r7140 r7175  
    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",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});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});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

    r7140 r7175  
    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",
     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

    r7147 r7175  
    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.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');});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;" 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});}}
    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;}else{o.content=t._previewToText(o.content,ed);}}});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('mce_editor_textarea_op_b',n.nodeName.toLowerCase()=='b');cm.setActive('mce_editor_textarea_op_u',n.nodeName.toLowerCase()=='u');cm.setActive('mce_editor_textarea_op_s',n.nodeName.toLowerCase()=='s');cm.setActive('mce_editor_textarea_op_i',n.nodeName.toLowerCase()=='i');});},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);}
    1010if(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}}
    1111c=this._createOpenPNEEmojiButton(n,emoji_config[n],cm);}
     12if(n=="op_cmd"){c=this._createOpenPNECmdButton(n,{title:"{#openpne.op_cmd}",image:config["op_cmd"].imageURL,cmd:"mceOpenPNE_op_cmd"},cm);}
    1213return c;},getInfo:function(){return{longname:'OpenPNE plugin',author:'Kousuke Ebihara',version:"1.0"}},_createOpenPNEColorButton:function(id,s,cm){var t=cm,ed=t.editor,cmd,c;if(t.get(id)){return null;}
    1314s.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);};}
     
    1617s.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);};}
    1718if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}
    18 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.OpenPNEEmojiButton(id,s);ed.onMouseDown.add(c.hideMenu,c);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);}
     19id=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.OpenPNEEmojiButton(id,s);ed.onMouseDown.add(c.hideMenu,c);ed.onRemove.add(function(){c.destroy();});return t.add(c);},_createOpenPNECmdButton:function(id,s,cm){var t=cm,ed=t.editor,cmd,c;if(t.get(id)){return null;}
     20s.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);};}
     21if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}
     22id=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);}
    1923function convertHtmlTagToDecoTag(doc,tagname)
    2024{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);}
  • OpenPNE/trunk/public_html/js/tiny_mce/plugins/openpne/editor_plugin.js.src

    r7147 r7175  
    9494    });
    9595
     96    tinymce.create('tinymce.ui.OpenPNECmdButton:tinymce.ui.Button', {
     97        renderHTML : function() {
     98            var s = this.settings;
     99            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>';
     100
     101            return h;
     102        },
     103    });
     104
    96105    tinymce.PluginManager.requireLangPack('openpne');
    97106
     
    126135            ed.addCommand('mceOpenPNE_op_image', function() {
    127136                window.open(config.op_image.contentURL, '', 'width=600,height=550,toolbar=no,scrollbars=yes,left=10,top=10');
     137            });
     138            ed.addCommand('mceOpenPNE_op_cmd', function() {
     139                window.open('http://www.openpne.jp/cmd/');
    128140            });
    129141
     
    187199            }
    188200
     201            if (n == "op_cmd") {
     202                c = this._createOpenPNECmdButton(n, {title: "{#openpne.op_cmd}", image: config["op_cmd"].imageURL, cmd: "mceOpenPNE_op_cmd"}, cm);
     203            }
     204
    189205            return c;
    190206        },
     
    261277            return t.add(c);
    262278        },
     279
     280        _createOpenPNECmdButton : function(id, s, cm) {
     281            var t = cm, ed = t.editor, cmd, c;
     282
     283            if (t.get(id)) {
     284                return null;
     285            }
     286
     287            s.title = ed.translate(s.title);
     288            s.scope = s.scope || ed;
     289
     290            if (!s.onclick) {
     291                s.onclick = function(v) { ed.execCommand(s.cmd, s.ui || false, v || s.value); };
     292            }
     293
     294            if (!s.onselect) {
     295                s.onselect = function(v) { ed.execCommand(s.cmd, s.ui || false, v || s.value); };
     296            }
     297
     298            id = t.prefix + id;
     299
     300            s = tinymce.extend({ title : s.title, 'class' : 'mce_' + id, 'menu_class' : ed.getParam('skin') + 'Skin', scope : s.scope}, s);
     301
     302            c = new tinymce.ui.OpenPNECmdButton(id, s);
     303
     304            ed.onPostRender.add(function() {
     305                var parentContainer = document.getElementById(c.id).parentNode;
     306                parentContainer.style.width = "45px";
     307            });
     308
     309            ed.onRemove.add(function() {
     310                c.destroy();
     311            });
     312
     313            return t.add(c);
     314        },
     315
    263316        _previewToText : function(s, editor) {
    264317            var editorDoc = editor.getBody();
  • OpenPNE/trunk/webapp/modules/admin/templates/edit_skin_image.tpl

    r6811 r7175  
    10171017</form></dd>
    10181018</dl>
     1019<dl class="box">
     1020<dt><strong>小窓紹介</strong></dt>
     1021<dd class="image">({assign var=skinname value=deco_op_cmd})
     1022<a href="({t_img_url_skin filename=$skinname})" target="_blank"><img src="({t_img_url_skin filename=$skinname w=180 h=180})" /></a>
     1023</dd>
     1024<dd class="default">
     1025({if $skin_list[$skinname]})[<a href="?m=({$module_name})&amp;a=do_({$hash_tbl->hash('delete_skin_image','do')})&amp;skinname=({$skinname})&amp;sessid=({$PHPSESSID})">デフォルトに戻す</a>]<br />({/if})
     1026</dd>
     1027<dd class="submit">
     1028<form action="./" method="post" enctype="multipart/form-data" >
     1029<input type="hidden" name="m" value="({$module_name})" />
     1030<input type="hidden" name="a" value="do_({$hash_tbl->hash('update_skin_image','do')})" />
     1031<input type="hidden" name="sessid" value="({$PHPSESSID})" />
     1032<input type="hidden" name="skinname" value="({$skinname})" />
     1033<input type="file" name="upfile" /><span class="textBtnS"><input type="submit" value="変更" /></span>
     1034</form></dd>
     1035</dl>
    10191036({/if})
    10201037<br class="clear" />
  • OpenPNE/trunk/webapp/modules/pc/templates/inc_tinymce_textarea.tpl

    r7154 r7175  
    5151            isEnabled : ({if $smarty.const.OPENPNE_EMOJI_DOCOMO_FOR_PC})0({else})1({/if}),
    5252            imageURL : "({t_img_url_skin filename=deco_op_emoji_softbank})"
     53        },
     54        op_cmd : {
     55            isEnabled : 1,
     56            imageURL : "({t_img_url_skin filename=deco_op_cmd})"
    5357        }
    5458    }
     
    8690</script>
    8791({/if})
     92<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>
    8893</div>
    8994
Note: See TracChangeset for help on using the changeset viewer.