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

Changeset 7466


Ignore:
Timestamp:
May 28, 2008, 7:34:11 PM (12 years ago)
Author:
ebihara
Message:

#2518:プレビューモードの絵文字投稿のパレットがサイドバナーに被ることがないようにした

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

    r7437 r7466  
    22(function(){tinymce.create('tinymce.ui.OpenPNEColorButton:tinymce.ui.ColorSplitButton',{renderHTML:function(){var s=this.settings,h='<a id="'+this.id+'" href="javascript:;" class="mceButton mceButtonEnabled '+s['class']
    33+'" 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>';}
    4 return h;},postRender:function(){tinymce.dom.Event.add(this.id,'click',this.showMenu,this);},setColor:function(c){this.value=c;this.hideMenu();this.settings.onselect(c);}});tinymce.create('tinymce.ui.OpenPNEEmojiButton:tinymce.ui.ColorSplitButton',{OpenPNEEmojiButton:function(id,s){var t=this;t.parent(id,s);t.settings=s;},renderMenu:function(){var t=this,m,i=0,s=t.settings,n,tb,tr,w;var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;w=DOM.add(s.menu_container,'div',{id:t.id+'_menu',dir:'ltr','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{'class':'mceEmojiSplitMenu'});tb=DOM.add(n,'tbody');for(var num in s.emoji){var emoji=s.emoji[num];for(var i=emoji.start;i<=emoji.end;i++){if(i==emoji.start||i%25==0){tr=DOM.add(tb,'tr');}
     4return h;},postRender:function(){tinymce.dom.Event.add(this.id,'click',this.showMenu,this);},setColor:function(c){this.value=c;this.hideMenu();this.settings.onselect(c);}});tinymce.create('tinymce.ui.OpenPNEEmojiButton:tinymce.ui.ColorSplitButton',{OpenPNEEmojiButton:function(id,s){var t=this;t.parent(id,s);t.settings=s;},renderMenu:function(){var t=this,m,i=0,s=t.settings,n,tb,tr,w;var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;w=DOM.add(s.menu_container,'div',{id:t.id+'_menu',dir:'ltr','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;width:402px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{'class':'mceEmojiSplitMenu'});tb=DOM.add(n,'tbody');for(var num in s.emoji){var emoji=s.emoji[num];for(var i=emoji.start;i<=emoji.end;i++){if(i==emoji.start||i%25==0){tr=DOM.add(tb,'tr');}
    55n=DOM.add(tr,'td');n=DOM.add(n,'img',{src:"./skin/default/img/emoji/"+s.carrier+"/"+s.carrier+i+".gif",alt:"["+s.carrier+":"+i+"]"});Event.add(n,'mousedown',function(e){if(Prototype.Browser.IE){tinyMCE.execCommand("mceInsertContent",false,e.srcElement.getAttribute("alt"));}else{tinyMCE.execCommand("mceInsertContent",false,e.element().getAttribute("alt"));}});}}
    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.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});}}
     8return h;},showMenu:function(){var t=this,r,p,e;var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;if(t.isDisabled())
     9return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}
     10e=DOM.get(t.id);DOM.show(t.id+'_menu');DOM.addClass(e,'mceSplitButtonSelected');p2=DOM.getPos(e);DOM.setStyles(t.id+'_menu',{left:720-DOM.get(t.id+'_menu').clientWidth,top:p2.y+e.clientHeight,zIndex:150});e=0;Event.add(document,'mousedown',t.hideMenu,t);},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});}}
    911ed.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;}
    1012cm.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

    r7437 r7466  
    4545            var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;
    4646            w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', dir : 'ltr', 'class' : s['menu_class'] + ' ' + s['class'],
    47                 style : 'position:absolute;left:0;top:-1000px;'});
     47                style : 'position:absolute;left:0;top:-1000px;width:402px;'});
    4848            m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'});
    4949            DOM.add(m, 'span', {'class' : 'mceMenuLine'});
     
    6161
    6262                    n = DOM.add(n, 'img', {
    63                         src : "./skin/default/img/emoji/" + s.carrier +"/" + s.carrier + i + ".gif",
     63                        src : "./skin/default/img/emoji/" + s.carrier + "/" + s.carrier + i + ".gif",
    6464                        alt : "[" + s.carrier + ":" + i + "]"
    6565                    });
     
    9191
    9292            return h;
     93        },
     94
     95        showMenu : function() {
     96            var t = this, r, p, e;
     97            var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;
     98
     99            if (t.isDisabled())
     100                return;
     101
     102            if (!t.isMenuRendered) {
     103                t.renderMenu();
     104                t.isMenuRendered = true;
     105            }
     106
     107            e = DOM.get(t.id);
     108            DOM.show(t.id + '_menu');
     109            DOM.addClass(e, 'mceSplitButtonSelected');
     110            p2 = DOM.getPos(e);
     111            DOM.setStyles(t.id + '_menu', {
     112                left : 720 - DOM.get(t.id + '_menu').clientWidth,
     113                top : p2.y + e.clientHeight,
     114                zIndex : 150
     115            });
     116
     117            e = 0;
     118
     119            Event.add(document, 'mousedown', t.hideMenu, t);
    93120        },
    94121
Note: See TracChangeset for help on using the changeset viewer.