-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
538 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'compass/import-once/activate' | ||
# Require any additional compass plugins here. | ||
|
||
# Set this to the root of your project when deployed: | ||
http_path = "/" | ||
css_dir = "css" | ||
sass_dir = "scss" | ||
images_dir = "img" | ||
javascripts_dir = "js" | ||
fonts_dir = "fonts" | ||
|
||
output_style = :nested | ||
|
||
# To enable relative paths to assets via compass helper functions. Uncomment: | ||
# relative_assets = true | ||
|
||
line_comments = false | ||
color_output = false | ||
|
||
preferred_syntax = :scss |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
@charset "UTF-8"; | ||
/* | ||
* | ||
*/ | ||
|
||
.panel_wrapper #general_panel{height:auto;} | ||
.panel_wrapper #general_panel{height:auto}body{margin:0}body form{padding:0 10px} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,144 @@ | ||
(function(){tinymce.create("tinymce.plugins.yomigana",{getInfo:function(){return{longname:"Yomigana",author:"Takahashi Fumiki",authorurl:"http://hametuha.co.jp",infourl:"http://hametuha.co.jp",version:"1.0"};},init:function(editor,url){editor.addCommand("Ruby",function(){editor.focus();editor.ieBookmark=editor.selection.getBookmark(1);editor.windowManager.open({file:url+"/ruby.php",width:350,height:150,inline:1},{plugin_url:url});});editor.addButton("ruby",{title:"yomigana_dlg.rubyTitle",cmd:"Ruby",image:url+"/img/ruby.gif"});editor.addCommand('inlineQ',function(){editor.focus();editor.ieBookmark=editor.selection.getBookmark(1);editor.windowManager.open({file:url+'/q.php',width:350,height:150,inline:1},{plugin_url:url});});editor.addButton("q",{title:"yomigana_dlg.qTitle",cmd:'inlineQ',image:url+'/img/q.png'});editor.addCommand("Small",function(){var target=this.selection.getNode();if(target.nodeName=='SMALL'){var txt=document.createTextNode(target.innerHTML);this.dom.replace(txt,target,false);}else if(this.selection.getContent().length>0){var newDom=this.dom.create('small');this.dom.setHTML(newDom,this.selection.getContent());this.selection.setNode(newDom);}});editor.addButton("small",{title:"yomigana_dlg.smallTitle",cmd:'Small',image:url+'/img/small.png'});editor.addCommand('DL',function(){var startNode=this.selection.getStart();var endNode=this.selection.getEnd();var wrapper;if(this.dom.getParent(startNode,'DL')){wrapper=this.dom.getParent(startNode,'DL');}else if(this.selection.getNode().tagName=='DL'){wrapper=this.selection.getNode();} | ||
if(wrapper){for(i=0,l=wrapper.childNodes.length;i<l;i++){var p=document.createElement('p');p.innerHTML=wrapper.childNodes[i].innerHTML;this.dom.insertAfter(p,wrapper);} | ||
this.dom.remove(wrapper);}else{if(this.selection.getContent().length>0){var dl=this.dom.create('dl');if(startNode==endNode){this.dom.rename(startNode,'dt');dl.appendChild(startNode);this.selection.setNode(dl);}else{var currentNode=startNode;var d=this.dom;for(i=0;true;){this.dom.add(dl,(i%2==0?'DT':'DD'),{},currentNode.innerHTML);i++;if(currentNode==endNode||!(currentNode=this.dom.getNext(currentNode,function(node){return node&&d.isBlock(node);}))||i>100){break;}}} | ||
this.selection.setNode(dl);}}});editor.addButton("dl",{title:"yomigana_dlg.dlTitle",cmd:"DL",image:url+'/img/dl.png'});editor.onNodeChange.add(function(e,d,g,f){g=e.dom.getParent(g,"RUBY,SMALL,Q,DL");d.setDisabled("ruby",f);d.setActive("ruby",0);d.setDisabled("small",f);d.setActive("small",0);d.setDisabled("q",f);d.setActive("q",0);if(g){do{d.setDisabled(g.nodeName.toLowerCase(),0);d.setActive(g.nodeName.toLowerCase(),1);}while(g=g.parentNode);}});}});tinymce.PluginManager.add("yomigana",tinymce.plugins.yomigana);})(); | ||
(function(){ | ||
|
||
|
||
tinymce.create("tinymce.plugins.yomigana",{ | ||
|
||
getInfo:function(){ | ||
return{ | ||
longname:"Yomigana", | ||
author:"Takahashi Fumiki", | ||
authorurl:"http://takahashifumiki.com", | ||
infourl:"https://wordpress.org/plugins/wp-yomigana/", | ||
version:"1.0" | ||
}; | ||
}, | ||
|
||
init:function(editor,url){ | ||
//ルビ | ||
editor.addCommand("Ruby",function(){ | ||
editor.focus(); | ||
editor.ieBookmark = editor.selection.getBookmark(1); | ||
editor.windowManager.open( | ||
{ | ||
file: url + "/ruby.php", | ||
width: 350, | ||
height:150, | ||
inline: 1 | ||
}, | ||
{ | ||
plugin_url: url | ||
} | ||
); | ||
}); | ||
editor.addButton("ruby",{ | ||
title:"yomigana_dlg.rubyTitle", | ||
cmd:"Ruby", | ||
image: url + "/img/ruby.gif" | ||
}); | ||
//qタグ | ||
editor.addCommand('inlineQ', function(){ | ||
editor.focus(); | ||
editor.ieBookmark = editor.selection.getBookmark(1); | ||
editor.windowManager.open({ | ||
file: url + '/q.php', | ||
width: 350, | ||
height: 150, | ||
inline: 1 | ||
},{ | ||
plugin_url: url | ||
}); | ||
}); | ||
editor.addButton("q", { | ||
title: "yomigana_dlg.qTitle", | ||
cmd: 'inlineQ', | ||
image: url + '/img/q.png' | ||
}); | ||
//small | ||
editor.addCommand("Small", function(){ | ||
var target = this.selection.getNode(); | ||
if(target.nodeName == 'SMALL'){ | ||
//ノード名がSmallだったら外す | ||
var txt = document.createTextNode(target.innerHTML); | ||
this.dom.replace(txt, target, false); | ||
}else if(this.selection.getContent().length > 0){ | ||
//一文字以上選択されていたらsmallでWrapする | ||
var newDom = this.dom.create('small'); | ||
this.dom.setHTML(newDom, this.selection.getContent()); | ||
this.selection.setNode(newDom); | ||
} | ||
}); | ||
editor.addButton("small",{ | ||
title: "yomigana_dlg.smallTitle", | ||
cmd: 'Small', | ||
image: url + '/img/small.png' | ||
}); | ||
editor.addCommand('DL', function(){ | ||
var startNode = this.selection.getStart(); | ||
var endNode = this.selection.getEnd(); | ||
var wrapper; | ||
if(this.dom.getParent(startNode, 'DL')){ | ||
wrapper = this.dom.getParent(startNode, 'DL'); | ||
}else if(this.selection.getNode().tagName == 'DL'){ | ||
wrapper = this.selection.getNode(); | ||
} | ||
if(wrapper){ | ||
//親がDL | ||
for(i = 0, l = wrapper.childNodes.length; i < l; i++){ | ||
var p = document.createElement('p'); | ||
p.innerHTML = wrapper.childNodes[i].innerHTML; | ||
this.dom.insertAfter(p, wrapper); | ||
} | ||
this.dom.remove(wrapper); | ||
}else{ | ||
//まだDLじゃない | ||
if(this.selection.getContent().length > 0){ | ||
var dl = this.dom.create('dl'); | ||
if(startNode == endNode){ | ||
//一つの要素が選択されている | ||
this.dom.rename(startNode, 'dt'); | ||
dl.appendChild(startNode); | ||
this.selection.setNode(dl); | ||
}else{ | ||
//2つ以上の要素が選択されている | ||
var currentNode = startNode; | ||
var d = this.dom; | ||
for(i = 0; true;){ | ||
this.dom.add(dl, (i % 2 == 0 ? 'DT' : 'DD'), {}, currentNode.innerHTML); | ||
i++; | ||
if(currentNode == endNode || !(currentNode = this.dom.getNext(currentNode, function(node){ | ||
return node && d.isBlock(node); | ||
})) || i > 100){ | ||
break; | ||
} | ||
} | ||
} | ||
this.selection.setNode(dl); | ||
} | ||
} | ||
}); | ||
editor.addButton("dl",{ | ||
title: "yomigana_dlg.dlTitle", | ||
cmd: "DL", | ||
image: url + '/img/dl.png' | ||
}); | ||
//キャレットの移動 | ||
editor.onNodeChange.add(function(e,d,g,f){ | ||
g = e.dom.getParent(g,"RUBY,SMALL,Q,DL"); | ||
d.setDisabled("ruby",f); | ||
d.setActive("ruby",0); | ||
d.setDisabled("small",f); | ||
d.setActive("small",0); | ||
d.setDisabled("q",f); | ||
d.setActive("q",0); | ||
if(g){ | ||
do{ | ||
d.setDisabled(g.nodeName.toLowerCase(),0); | ||
d.setActive(g.nodeName.toLowerCase(),1); | ||
}while(g = g.parentNode); | ||
} | ||
}); | ||
} | ||
}); | ||
|
||
tinymce.PluginManager.add("yomigana",tinymce.plugins.yomigana); | ||
})(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.