From 10280b6009f38b79825ccd5a1bd6540a916b7322 Mon Sep 17 00:00:00 2001 From: Kureha Hisame Date: Tue, 17 Sep 2013 23:27:22 +0900 Subject: [PATCH] - add jquery-te editor to generator. --- generator.html | 9 +- js/jquery-te/jquery-te-1.4.0.css | 457 ++++++++++++++++++++++++++++++++++++ js/jquery-te/jquery-te-1.4.0.min.js | 9 + js/jquery-te/jquery-te.png | Bin 0 -> 2603 bytes js/lunardial/feedblog_generator.js | 13 + 5 files changed, 487 insertions(+), 1 deletion(-) create mode 100644 js/jquery-te/jquery-te-1.4.0.css create mode 100644 js/jquery-te/jquery-te-1.4.0.min.js create mode 100644 js/jquery-te/jquery-te.png diff --git a/generator.html b/generator.html index 8b4c292..dc647e8 100644 --- a/generator.html +++ b/generator.html @@ -4,14 +4,21 @@ 記事更新アプリケーション + + + - + diff --git a/js/jquery-te/jquery-te-1.4.0.css b/js/jquery-te/jquery-te-1.4.0.css new file mode 100644 index 0000000..ed615f7 --- /dev/null +++ b/js/jquery-te/jquery-te-1.4.0.css @@ -0,0 +1,457 @@ +/*! + * + * jQuery TE 1.4.0 , http://jqueryte.com/ + * Copyright (C) 2013, Fatih Koca (fattih@fattih.com), (http://jqueryte.com/about) + + * jQuery TE is provided under the MIT LICENSE. + * +*/ + +/* editor's general field */ +.jqte { + margin:30px 0; + border:#000 1px solid; + border-radius:5px; -webkit-border-radius:5px; -moz-border-radius:5px; + box-shadow:0 0 3px #999; -webkit-box-shadow:0 0 3px #999; -moz-box-shadow:0 0 3px #999; + overflow:hidden; + transition:box-shadow 0.4s, border 0.4s; -webkit-transition:-webkit-box-shadow 0.4s, border 0.4s; -moz-transition:-moz-box-shadow 0.4s, border 0.4s; -o-transition:-o-box-shadow 0.4s, border 0.4s; +} +.jqte * { + color:#333; + font-family:Arial, Helvetica, sans-serif; + font-size:14px; +} +.jqte_focused { + border-color:#00AAE7; + box-shadow:0 0 10px #00BDFF; -webkit-box-shadow:0 0 10px #00BDFF; -moz-box-shadow:0 0 10px #00BDFF; +} +/* toolbar */ +.jqte_toolbar { + overflow:auto; + padding:3px 4px; + background:#EEE; + border-bottom:#BBB 1px solid; +} +.jqte_tool { + float:left; + margin:0; + padding:0; + cursor:pointer; +} +.jqte_tool, .jqte_tool_icon, .jqte_tool_label { + border:#EEE 1px solid; + border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px +} +.jqte_hiddenField { + display:none +} +.jqte_tool_icon { + display:block; + width:22px; + height:22px; + background:url(jquery-te.png) no-repeat +} +.jqte_tool.jqte_tool_1 .jqte_tool_label { + position:relative; + display:block; + padding:3px; + width:70px; + height:16px; + overflow:hidden; +} +.jqte_tool.jqte_tool_1 .jqte_tool_text { + font:bold 13px Arial,sans-serif; + color:#222; +} +.jqte_tool.jqte_tool_1 .jqte_tool_icon { + position:absolute; + top:10px; + right:2px; + width:6px; + height:4px; + background-position:-19px -23px; + border:none; + border-radius:none; -webkit-border-radius:none; -moz-border-radius:none +} +.jqte_tool.jqte_tool_2 .jqte_tool_icon { + background-position:0 0 +} +.jqte_tool.jqte_tool_3 .jqte_tool_icon { + background-position:-22px 0 +} +.jqte_tool.jqte_tool_4 .jqte_tool_icon { + background-position:-44px 0 +} +.jqte_tool.jqte_tool_5 .jqte_tool_icon { + background-position:-66px 0 +} +.jqte_tool.jqte_tool_6 .jqte_tool_icon { + background-position:-88px 0 +} +.jqte_tool.jqte_tool_7 .jqte_tool_icon { + background-position:-110px 0 +} +.jqte_tool.jqte_tool_8 .jqte_tool_icon { + background-position:-132px 0 +} +.jqte_tool.jqte_tool_9 .jqte_tool_icon { + background-position:-154px 0 +} +.jqte_tool.jqte_tool_10 .jqte_tool_icon { + background-position:-176px 0 +} +.jqte_tool.jqte_tool_11 .jqte_tool_icon { + background-position:-198px 0 +} +.jqte_tool.jqte_tool_12 .jqte_tool_icon { + background-position:-220px 0 +} +.jqte_tool.jqte_tool_13 .jqte_tool_icon { + background-position:-242px 0 +} +.jqte_tool.jqte_tool_14 .jqte_tool_icon { + background-position:-264px 0 +} +.jqte_tool.jqte_tool_15 .jqte_tool_icon { + background-position:-286px 0 +} +.jqte_tool.jqte_tool_16 .jqte_tool_icon { + background-position:-308px 0 +} +.jqte_tool.jqte_tool_17 .jqte_tool_icon { + background-position:-330px 0 +} +.jqte_tool.jqte_tool_18 .jqte_tool_icon { + background-position:-352px 0 +} +.jqte_tool.jqte_tool_19 .jqte_tool_icon { + background-position:-374px 0 +} +.jqte_tool.jqte_tool_20 .jqte_tool_icon { + background-position:-396px 0 +} +.jqte_tool.jqte_tool_21 .jqte_tool_icon { + background-position:-418px 0 +} +.jqte_tool:hover { + background-color:#FFF; + border-color:#FFF +} +.jqte_tool:hover .jqte_tool_icon, .jqte_tool:hover .jqte_tool_label { + border:#AAA 1px solid +} +.jqte_tool:active .jqte_tool_icon, .jqte_tool:active .jqte_tool_label { + border:#777 1px solid +} +.jqte_tool.jqte_tool_1:hover .jqte_tool_icon, .jqte_tool.jqte_tool_1:active .jqte_tool_icon { + border:none +} +.jqte_tool_depressed { + background-color:#DDD; + border-color:#CCC +} +.jqte_tool_depressed .jqte_tool_icon { + border-color:#AAA +} +.jqte_tool_depressed:hover { + background-color:#EEE +} +/* link form area */ +.jqte_linkform { + padding:5px 10px; + background:#DDD; + border-bottom:#BBB 1px solid; +} +.jqte_linktypeselect { + position:relative; + float:left; + width:130px; + background:#EEE; + cursor:pointer +} +.jqte_linktypeselect:Active { + background:#FFF +} +.jqte_linktypeview { + padding:3px 5px; + border:#333 1px solid; + color:#777; + border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px; + outline:none +} +.jqte_linktypetext { + font-size:12px; +} +.jqte_linktypearrow { + position:absolute; + bottom:8px; right:6px; + width:7px; + height:6px; + margin:0 auto; + background:url(jquery-te.png) -7px -23px no-repeat; +} +.jqte_linktypes { + display:none; + position:absolute; + top:22px; left:1px; + width:125px; + background:#FFF; + border:#333 1px solid; + box-shadow:0 1px 4px #AAA; -webkit-box-shadow:0 1px 4px #AAA; -moz-box-shadow:0 1px 4px #AAA +} +.jqte_linktypes a { + display:block; + padding:4px 5px; + font-size:12px; +} +.jqte_linktypes a:hover { + background:#DDD +} +.jqte_linkinput { + float:left; + margin:0 5px; + padding:3px 5px; + width:300px; + background:#EEE; + border:#333 1px solid; + color:#777; + font-size:12px; + border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px; + outline:none; +} +.jqte_linkinput:focus, .jqte_linkinput:hover { + background:#FFF; + border-color:#000; +} +.jqte_linkbutton { + float:left; + padding:3px 12px; + background:#AAA; + border:#333 1px solid; + color:#FFF; + font-size:12px; + font-weight:bold; + cursor:pointer; + border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px; + box-shadow:inset 0 1px #EEE; -webkit-box-shadow:inset 0 1px #EEE; -moz-box-shadow:inset 0 1px #EEE; +} +.jqte_linkbutton:hover { + background:#A1A1A1 +} +.jqte_linkbutton:active { + box-shadow:inset 0 1px #CCC; -webkit-box-shadow:inset 0 1px #CCC; -moz-box-shadow:inset 0 1px #CCC; + background:#888; +} + +/* text format menu */ +.jqte_formats { + display:none; + position:absolute; + width:180px; + oveflow-x:hidden; + overflow-y:auto; + background:#FFF; + border:#AAA 1px solid; + box-shadow:0 0 5px #AAA; -webkit-box-shadow:0 0 5px #AAA; -moz-box-shadow:0 0 5px #AAA; + z-index:100; +} +.jqte_format { + display:block; + padding:4px 7px; + font-size:13px +} +.jqte_format:hover { + background:#DDD +} +.jqte_format_1, .jqte_format_2, .jqte_format_3, .jqte_format_4, .jqte_format_5, .jqte_format_6 { + font-weight:bold +} +.jqte_format_1 { + font-size:22px +} +.jqte_format_2 { + font-size:20px +} +.jqte_format_3 { + font-size:18px +} +.jqte_format_4 { + font-size:16px +} +.jqte_format_5 { + font-size:14px +} +.jqte_format_6 { + font-size:12px +} +.jqte_format_7 { + font-family:"Courier New", Courier, monospace +} + +/* font size menu */ +.jqte_fontsizes { + display:none; + position:absolute; + width:180px; + height:198px; + oveflow-x:hidden; + overflow-y:auto; + background:#FFF; + border:#AAA 1px solid; + box-shadow:0 0 5px #AAA; -webkit-box-shadow:0 0 5px #AAA; -moz-box-shadow:0 0 5px #AAA +} +.jqte_fontsize { + display:block; + padding:3px 7px; +} +.jqte_fontsize:hover { + background:#DDD +} + +/* color pallette */ +.jqte_cpalette { + display:none; + position:absolute; + padding:6px; + width:144px; + background:#FFF; + border:#AAA 1px solid; + box-shadow:0 0 5px #AAA; -webkit-box-shadow:0 0 5px #AAA; -moz-box-shadow:0 0 5px #AAA +} +.jqte_color { + display:block; + float:left; + width:16px; + height:16px; + border:#FFF 1px solid; +} +.jqte_color:hover { + border-color:#000 +} +.jqte_colorSeperator { + float:none; + clear:both; + height:7px; +} + +/* editor area */ +.jqte_editor, .jqte_source { + padding:10px; + background:#FFF; + min-height:100px; + max-height:900px; + overflow:auto; + outline:none; + word-wrap:break-word; -ms-word-wrap:break-word; + resize:vertical +} +.jqte_editor div, .jqte_editor p { + margin:0 0 7px +} +.jqte_editor a:link, .jqte_editor a:link * { + color:#0066FF !important; + text-decoration:underline; +} +.jqte_editor blockquote { + margin-top:0; + margin-bottom:7px +} +.jqte_editor img { + float:left; + margin:0 10px 5px 0 +} +.jqte_editor a[jqte-setlink], .jqte_editor a[jqte-setlink] * { + background:#3297FD !important; + color:#FFF !important +} +.jqte_editor h1, .jqte_editor h2, .jqte_editor h3, .jqte_editor h4, .jqte_editor h5, .jqte_editor h6, .jqte_editor pre { + display:block; + margin:0 0 3px; +} +.jqte_editor h1, .jqte_editor h1 * { + font-size:26px +} +.jqte_editor h2, .jqte_editor h2 * { + font-size:24px +} +.jqte_editor h3, .jqte_editor h3 * { + font-size:22px +} +.jqte_editor h4, .jqte_editor h4 * { + font-size:20px +} +.jqte_editor h5, .jqte_editor h5 * { + font-size:18px +} +.jqte_editor h6, .jqte_editor h6 * { + font-size:15px +} +.jqte_editor pre, .jqte_editor pre * { + font-family:"Courier New", Courier, monospace +} + +/* source area */ +.jqte_source, .jqte_source textarea { + background:#FFF1E8 +} +.jqte_source textarea { + margin:0 !important; + padding:0 !important; + display:block !important; + width:100% !important; + min-height:100px; + font-family:Courier, Arial, sans-serif !important; + font-weight:normal; + font-size:15px; + overflow:hidden !important; + outline:none; + resize:none; +} +.jqte_source textarea, .jqte_source textarea:focus { + css_shadow:none !important; + background:none !important; + border:none !important; +} + +/* title box */ +.jqte_title { + display:none; + position:absolute; + z-index:9999; +} +.jqte_titleArrow { + position:relative; +} +.jqte_titleArrowIcon { + width:7px; + height:6px; + margin:0 auto; + background:url(jquery-te.png) 0 -23px no-repeat; +} +.jqte_titleText { + padding:5px 7px; + margin-top:0; + min-width:5px; + min-height:1px; + max-width:400px; + background:#000; + border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px; + word-wrap:break-word; -ms-word-wrap:break-word +} +.jqte_titleText, .jqte_titleText * { + color:#FFF; + font-size:11px +} + +/* placeholder */ +.jqte_placeholder { + position:relative; + display:none; +} +.jqte_placeholder_text { + position:absolute; + top:43px; + left:10px; + font-size:14px; + color:#CCC; +} \ No newline at end of file diff --git a/js/jquery-te/jquery-te-1.4.0.min.js b/js/jquery-te/jquery-te-1.4.0.min.js new file mode 100644 index 0000000..6e9f58d --- /dev/null +++ b/js/jquery-te/jquery-te-1.4.0.min.js @@ -0,0 +1,9 @@ +/*! + * + * jQuery TE 1.4.0 , http://jqueryte.com/ + * Copyright (C) 2013, Fatih Koca (fattih@fattih.com), (http://jqueryte.com/about) + + * jQuery TE is provided under the MIT LICENSE. + * +*/ +(function(e){e.fn.jqte=function(t){function l(e,t,n,r,i){var s=f.length+1;return f.push({name:e,cls:s,command:t,key:n,tag:r,emphasis:i})}var n=[{title:"Text Format"},{title:"Font Size"},{title:"Color"},{title:"Bold",hotkey:"B"},{title:"Italic",hotkey:"I"},{title:"Underline",hotkey:"U"},{title:"Ordered List",hotkey:"."},{title:"Unordered List",hotkey:","},{title:"Subscript",hotkey:"down arrow"},{title:"Superscript",hotkey:"up arrow"},{title:"Outdent",hotkey:"left arrow"},{title:"Indent",hotkey:"right arrow"},{title:"Justify Left"},{title:"Justify Center"},{title:"Justify Right"},{title:"Strike Through",hotkey:"K"},{title:"Add Link",hotkey:"L"},{title:"Remove Link"},{title:"Cleaner Style",hotkey:"Delete"},{title:"Horizontal Rule",hotkey:"H"},{title:"Source"}];var r=[["p","Normal"],["h1","Header 1"],["h2","Header 2"],["h3","Header 3"],["h4","Header 4"],["h5","Header 5"],["h6","Header 6"],["pre","Preformatted"]];var i=["10","12","16","18","20","24","28"];var s=["0,0,0","68,68,68","102,102,102","153,153,153","204,204,204","238,238,238","243,243,243","255,255,255",null,"255,0,0","255,153,0","255,255,0","0,255,0","0,255,255","0,0,255","153,0,255","255,0,255",null,"244,204,204","252,229,205","255,242,204","217,234,211","208,224,227","207,226,243","217,210,233","234,209,220","234,153,153","249,203,156","255,229,153","182,215,168","162,196,201","159,197,232","180,167,214","213,166,189","224,102,102","246,178,107","255,217,102","147,196,125","118,165,175","111,168,220","142,124,195","194,123,160","204,0,0","230,145,56","241,194,50","106,168,79","69,129,142","61,133,198","103,78,167","166,77,121","153,0,0","180,95,6","191,144,0","56,118,29","19,79,92","11,83,148","53,28,117","116,27,71","102,0,0","120,63,4","127,96,0","39,78,19","12,52,61","7,55,99","32,18,77","76,17,48"];var o=["Web Address","E-mail Address","Picture URL"];var u=e.extend({status:true,css:"jqte",title:true,titletext:n,button:"OK",format:true,formats:r,fsize:true,fsizes:i,funit:"px",color:true,linktypes:o,b:true,i:true,u:true,ol:true,ul:true,sub:true,sup:true,outdent:true,indent:true,left:true,center:true,right:true,strike:true,link:true,unlink:true,remove:true,rule:true,source:true,placeholder:false,br:true,p:true,change:"",focus:"",blur:""},t);e.fn.jqteVal=function(t){e(this).closest("."+u.css).find("."+u.css+"_editor").html(t)};var a=navigator.userAgent.toLowerCase();if(/msie [1-7]./.test(a))u.title=false;var f=[];l("format","formats","","",false);l("fsize","fSize","","",false);l("color","colors","","",false);l("b","Bold","B",["b","strong"],true);l("i","Italic","I",["i","em"],true);l("u","Underline","U",["u"],true);l("ol","insertorderedlist","¾",["ol"],true);l("ul","insertunorderedlist","¼",["ul"],true);l("sub","subscript","(",["sub"],true);l("sup","superscript","&",["sup"],true);l("outdent","outdent","%",["blockquote"],false);l("indent","indent","'",["blockquote"],true);l("left","justifyLeft","","",false);l("center","justifyCenter","","",false);l("right","justifyRight","","",false);l("strike","strikeThrough","K",["strike"],true);l("link","linkcreator","L",["a"],true);l("unlink","unlink","",["a"],false);l("remove","removeformat",".","",false);l("rule","inserthorizontalrule","H",["hr"],false);l("source","displaysource","","",false);return this.each(function(){function B(){if(window.getSelection)return window.getSelection();else if(document.selection&&document.selection.createRange&&document.selection.type!="None")return document.selection.createRange()}function j(e,t){var n,r=B();if(window.getSelection){if(r.anchorNode&&r.getRangeAt)n=r.getRangeAt(0);if(n){r.removeAllRanges();r.addRange(n)}if(!a.match(/msie/))document.execCommand("StyleWithCSS",false,false);document.execCommand(e,false,t)}else if(document.selection&&document.selection.createRange&&document.selection.type!="None"){n=document.selection.createRange();n.execCommand(e,false,t)}q(false,false)}function F(t,n,r){if(v.not(":focus"))v.focus();if(window.getSelection){var i=B(),s,o,u;if(i.anchorNode&&i.getRangeAt){s=i.getRangeAt(0);o=document.createElement(t);e(o).attr(n,r);u=s.extractContents();o.appendChild(u);s.insertNode(o);i.removeAllRanges();if(n=="style")q(e(o),r);else q(e(o),false)}}else if(document.selection&&document.selection.createRange&&document.selection.type!="None"){var a=document.selection.createRange();var f=a.htmlText;var l="<"+t+" "+n+'="'+r+'">'+f+"";document.selection.createRange().pasteHTML(l)}}function q(e,t){var n=I();n=n?n:e;if(n&&t==false){if(n.parent().is("[style]"))n.attr("style",n.parent().attr("style"));if(n.is("[style]"))n.find("*").attr("style",n.attr("style"))}else if(e&&t&&e.is("[style]")){var r=t.split(";");r=r[0].split(":");if(e.is("[style*="+r[0]+"]"))e.find("*").css(r[0],r[1]);R(e)}}function R(t){if(t){var t=t[0];if(document.body.createTextRange){var n=document.body.createTextRange();n.moveToElementText(t);n.select()}else if(window.getSelection){var r=window.getSelection();var n=document.createRange();if(t!="undefined"&&t!=null){n.selectNodeContents(t);r.removeAllRanges();r.addRange(n);if(e(t).is(":empty")){e(t).append(" ");R(e(t))}}}}}function U(){if(!p.data("sourceOpened")){var t=I();var n="http://";W(true);if(t){var r=t.prop("tagName").toLowerCase();if(r=="a"&&t.is("[href]")){n=t.attr("href");t.attr(S,"")}else F("a",S,"")}else y.val(n).focus();g.click(function(t){if(e(t.target).hasClass(u.css+"_linktypetext")||e(t.target).hasClass(u.css+"_linktypearrow"))X(true)});w.find("a").click(function(){var t=e(this).attr(u.css+"-linktype");w.data("linktype",t);E.find("."+u.css+"_linktypetext").html(w.find("a:eq("+w.data("linktype")+")").text());V(n);X()});V(n);y.focus().val(n).bind("keypress keyup",function(e){if(e.keyCode==13){z(h.find("["+S+"]"));return false}});b.click(function(){z(h.find("["+S+"]"))})}else W(false)}function z(t){y.focus();R(t);t.removeAttr(S);if(w.data("linktype")!="2")j("createlink",y.val());else{j("insertImage",y.val());v.find("img").each(function(){var t=e(this).prev("a");var n=e(this).next("a");if(t.length>0&&t.html()=="")t.remove();else if(n.length>0&&n.html()=="")n.remove()})}W();v.trigger("change")}function W(e){Q("["+S+"]:not([href])");h.find("["+S+"][href]").removeAttr(S);if(e){p.data("linkOpened",true);d.show()}else{p.data("linkOpened",false);d.hide()}X()}function X(e){if(e)w.show();else w.hide()}function V(e){var t=w.data("linktype");if(t=="1"&&(y.val()=="http://"||y.is("[value^=http://]")||!y.is("[value^=mailto]")))y.val("mailto:");else if(t!="1"&&!y.is("[value^=http://]"))y.val("http://");else y.val(e)}function J(t){if(!p.data("sourceOpened")){if(t=="fSize")styleField=P;else if(t=="colors")styleField=H;K(styleField,true);styleField.find("a").unbind("click").click(function(){var n=e(this).attr(u.css+"-styleval");if(t=="fSize"){styleType="font-size";n=n+u.funit}else if(t=="colors"){styleType="color";n="rgb("+n+")"}var r=G(styleType);F("span","style",styleType+":"+n+";"+r);K("",false);e("."+u.css+"_title").remove();v.trigger("change")})}else K(styleField,false);W(false)}function K(e,t){var n="",r=[{d:"fsizeOpened",f:P},{d:"cpallOpened",f:H}];if(e!=""){for(var i=0;i");Z(false)})}function Z(e){var t=e?true:false;t=e&&D.data("status")?true:false;if(t||!e)D.data("status",false).slideUp(200);else D.data("status",true).slideDown(200)}function et(e){var t=D.closest("."+u.css+"_tool").find("."+u.css+"_tool_label").find("."+u.css+"_tool_text");if(e.length>10)e=e.substr(0,7)+"...";t.html(e)}function tt(e){var t,n,r;t=e.replace(/\n/gim,"").replace(/\r/gim,"").replace(/\t/gim,"").replace(/ /gim," ");n=[/\(.*?)<\/span><\/span>/gim,/<(\w*[^p])\s*[^\/>]*>\s*<\/\1>/gim,/\(.*?)\<\/div>/gim,/\(.*?)\<\/strong>/gim,/\(.*?)\<\/em>/gim];r=["$3","","$2

","$2","$2"];for(A=0;A<5;A++){for(var i=0;i(.*?)\<\/p>/ig,"
$2");if(!u.br){n=[/\
(.*?)/ig,/\(.*?)/ig];r=["

$1

","

$1

"];for(var i=0;i(.*?)\<\/p>/ig,"
$1
");return t}function nt(){var e=v.text()==""&&v.html().length<12?"":v.html();l.val(tt(e))}function rt(){v.html(tt(l.val()))}function it(t){var n=false,r=I(),i;if(r){e.each(t,function(t,s){i=r.prop("tagName").toLowerCase();if(i==s)n=true;else{r.parents().each(function(){i=e(this).prop("tagName").toLowerCase();if(i==s)n=true})}});return n}else return false}function st(t){for(var n=0;n0&&it(s)){et(u.formats[i][1]);r=true;break}}if(!r)et(u.formats[0][1])}K("",false);Z(false)}if(!e(this).data("jqte")||e(this).data("jqte")==null||e(this).data("jqte")=="undefined")e(this).data("jqte",true);else e(this).data("jqte",false);if(!u.status||!e(this).data("jqte")){if(e(this).closest("."+u.css).length>0){var t=e(this).closest("."+u.css).find("."+u.css+"_editor").html();var n="";e(e(this)[0].attributes).each(function(){if(this.nodeName!="style")n=n+" "+this.nodeName+'="'+this.nodeValue+'"'});var r=e(this).is("[data-origin]")&&e(this).attr("data-origin")!=""?e(this).attr("data-origin"):"textarea";var i=">"+t;if(r=="input"||r=="option"){t=t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">");i='value="'+t+'">'}var o=e(this).clone();e(this).data("jqte",false).closest("."+u.css).before(o).remove();o.replaceWith("<"+r+n+i+"")}return}var l=e(this);var r=e(this).prop("tagName").toLowerCase();e(this).attr("data-origin",r);var c=e(this).is("[value]")||r=="textarea"?e(this).val():e(this).html();c=c.replace(/"/g,'"').replace(/'/g,"'").replace(//g,">").replace(/&/g,"&");e(this).after('
');var h=e(this).next("."+u.css);h.html('
');var p=h.find("."+u.css+"_toolbar");var d=h.find("."+u.css+"_linkform");var v=h.find("."+u.css+"_editor");var m=u.css+"_tool_depressed";d.append('
'+u.button+'
');var g=d.find("."+u.css+"_linktypeselect");var y=d.find("."+u.css+"_linkinput");var b=d.find("."+u.css+"_linkbutton");g.append('
');var w=g.find("."+u.css+"_linktypes");var E=g.find("."+u.css+"_linktypeview");var S=u.css+"-setlink";v.after('
');var x=h.find("."+u.css+"_source");l.appendTo(x);if(r!="textarea"){var n="";e(l[0].attributes).each(function(){if(this.nodeName!="type"&&this.nodeName!="value")n=n+" "+this.nodeName+'="'+this.nodeValue+'"'});l.replaceWith("");l=x.find("textarea")}v.attr("contenteditable","true").html(c);for(var T=0;T0?u.titletext[T].hotkey!=null&&u.titletext[T].hotkey!="undefined"&&u.titletext[T].hotkey!=""?" (Ctrl+"+u.titletext[T].hotkey+")":"":"";var C=u.titletext[T].title!=null&&u.titletext[T].title!="undefined"&&u.titletext[T].title!=""?u.titletext[T].title+N:"";p.append('
');p.find("."+u.css+"_tool[data-tool="+T+"]").data({tag:f[T].tag,command:f[T].command,emphasis:f[T].emphasis,title:C});if(f[T].name=="format"&&e.isArray(u.formats)){var k=u.formats[0][1].length>0&&u.formats[0][1]!="undefined"?u.formats[0][1]:"";p.find("."+u.css+"_tool_"+f[T].cls).find("."+u.css+"_tool_icon").replaceWith(''+k+'');p.find("."+u.css+"_tool_"+f[T].cls).append('
');for(var L=0;L'+u.formats[L][1]+"")}p.find("."+u.css+"_formats").data("status",false)}else if(f[T].name=="fsize"&&e.isArray(u.fsizes)){p.find("."+u.css+"_tool_"+f[T].cls).append('
');for(var L=0;LAbcdefgh...')}}else if(f[T].name=="color"&&e.isArray(s)){p.find("."+u.css+"_tool_"+f[T].cls).append('
');for(var A=0;A');else p.find("."+u.css+"_cpalette").append('
')}}}}w.data("linktype","0");for(var T=0;T<3;T++){w.append("'+u.linktypes[T]+"");E.html('
'+w.find("a:eq("+w.data("linktype")+")").text()+"
")}var O="";if(/msie/.test(a))O="-ms-";else if(/chrome/.test(a)||/safari/.test(a)||/yandex/.test(a))O="-webkit-";else if(/mozilla/.test(a))O="-moz-";else if(/opera/.test(a))O="-o-";else if(/konqueror/.test(a))O="-khtml-";else O="";if(u.placeholder&&u.placeholder!=""){h.prepend('
'+u.placeholder+"
");var M=h.find("."+u.css+"_placeholder");M.click(function(){v.focus()})}h.find("[unselectable]").css(O+"user-select","none").addClass("unselectable").attr("unselectable","on").on("selectstart mousedown",false);var _=p.find("."+u.css+"_tool");var D=p.find("."+u.css+"_formats");var P=p.find("."+u.css+"_fontsizes");var H=p.find("."+u.css+"_cpalette");var I=function(){var t,n;if(window.getSelection){n=getSelection();t=n.anchorNode}if(!t&&document.selection&&document.selection.createRange&&document.selection.type!="None"){n=document.selection;var r=n.getRangeAt?n.getRangeAt(0):n.createRange();t=r.commonAncestorContainer?r.commonAncestorContainer:r.parentElement?r.parentElement():r.item(0)}if(t){return t.nodeName=="#text"?e(t.parentNode):e(t)}else return false};_.unbind("click").click(function(t){if(e(this).data("command")=="displaysource"&&!p.data("sourceOpened")){p.find("."+u.css+"_tool").addClass(u.css+"_hiddenField");e(this).removeClass(u.css+"_hiddenField");p.data("sourceOpened",true);l.css("height",v.outerHeight());x.removeClass(u.css+"_hiddenField");v.addClass(u.css+"_hiddenField");l.focus();W(false);K("",false);Z();if(u.placeholder&&u.placeholder!="")M.hide()}else{if(!p.data("sourceOpened")){if(e(this).data("command")=="linkcreator"){if(!p.data("linkOpened"))U();else{W(false);Z(false)}}else if(e(this).data("command")=="formats"){if(e(this).data("command")=="formats"&&!e(t.target).hasClass(u.css+"_format"))Y();K("",false);if(v.not(":focus"))v.focus()}else if(e(this).data("command")=="fSize"||e(this).data("command")=="colors"){if(e(this).data("command")=="fSize"&&!e(t.target).hasClass(u.css+"_fontsize")||e(this).data("command")=="colors"&&!e(t.target).hasClass(u.css+"_color"))J(e(this).data("command"));Z(false);if(v.not(":focus"))v.focus()}else{if(v.not(":focus"))v.focus();j(e(this).data("command"),null);K("",false);Z(false);X();e(this).data("emphasis")==true&&!e(this).hasClass(m)?e(this).addClass(m):e(this).removeClass(m);x.addClass(u.css+"_hiddenField");v.removeClass(u.css+"_hiddenField")}}else{p.data("sourceOpened",false);p.find("."+u.css+"_tool").removeClass(u.css+"_hiddenField");x.addClass(u.css+"_hiddenField");v.removeClass(u.css+"_hiddenField")}if(u.placeholder&&u.placeholder!="")v.html()!=""?M.hide():M.show()}v.trigger("change")}).hover(function(t){if(u.title&&e(this).data("title")!=""&&(e(t.target).hasClass(u.css+"_tool")||e(t.target).hasClass(u.css+"_tool_icon"))){e("."+u.css+"_title").remove();h.append('
'+e(this).data("title")+"
");var n=e("."+u.css+"_title:first");var r=n.find("."+u.css+"_titleArrowIcon");var i=e(this).position();var s=i.left+e(this).outerWidth()-n.outerWidth()/2-e(this).outerWidth()/2;var o=i.top+e(this).outerHeight()+5;n.delay(400).css({top:o,left:s}).fadeIn(200)}},function(){e("."+u.css+"_title").remove()});var ot=null;v.bind("keypress keyup keydown drop cut copy paste DOMCharacterDataModified DOMSubtreeModified",function(){if(!p.data("sourceOpened"))e(this).trigger("change");X();if(e.isFunction(u.change))u.change();if(u.placeholder&&u.placeholder!="")e(this).text()!=""?M.hide():M.show()}).bind("change",function(){if(!p.data("sourceOpened")){clearTimeout(ot);ot=setTimeout(nt,10)}}).keydown(function(e){if(e.ctrlKey){for(var t=0;tsV$&+nWwXMQuknRC`yYiSZ=OyzB3Y->uts&11uH+`)}onGofhMwb% zN0oY^^2&ErrJyR5=A6!*lL{St)QJSTWj&I0V?TU(`D2g%!4BElHX2AR3 zFc@R3OQfU--Fc@wU#IQ>xgEFwJP#}bABow>JHOFMbqBAjY;FeW;9dv(8Q4;z=Ci>6 zf^-G=7x3Yl_HhGnKkx%DeYT?3=Yf9%{{)VB`A3jO_$R=tBen9pij7ER><#|br8_8I z3p@#Y2zVU$#$e4+2EbP2`oGJ4-vR6%oH_BRV^73dyOzSA5>l>S$wGj6x9x0k4yJrL7s*PKD_@pD6Toys@{+*n#FK|HE=9%=LzWVE#k{3li`;-q8_ z?q|TQE`0!a(d9oGt6#z&oZbsH*nAndn6r;{c@dgTIJinQp;@M%$QTl$d?MEFq6ViZ z^<(>f>yF|+JZ?kUh)2D=eMtMT=^Pvql{puj*NFihTM8@4NW3e93Q?W{9zl9gF9qIO zv;H#hN0&|^Jv0b<>lN7s>~WtTs6nqzhI;ZVhn+}>_Qzh{QRI5v(V*@a5*8jqIziDG zW5$g!3q9DDj4@`x7&G3_eQr=bh1?@=KeVv#OXX9qZQ%xvk~0WNX4B8{_gTufp^C0 zcj4!>L!RsA4=dPQ*9b1VHjCYiPqmlkLzE9A=kjC7qN7!$W0I^Nsk;++4w>VOzJ9=V zV2+wcD3SFgyS8({_CfWqM>Toe?VZb2;0)4Xy`G?>Q=)Yo){Q6^fjd2kJ6&E_?s(ol z%5=SYkfd8sk5A`pU;F60hwJ3C1Ne=*UfDq9LEuloQ!f883c{5p6Lu@#iuPiH-`08& ztyXIRxXJtN{N&{1uC;>eSJZtR_ylmX`~F|xYNWAQ8)22{7U-{1Jc_vl+=BG%0lJ;k zZYu#_M0);@0B;F@?50_ueHn51Hw48lhItY8P9POMo4YGD#+LL5gGueIY)`s5=XMEr z88RPYfomxlZReefNZnrm`{_J}N#I*Wx=womuRdnS*KN|j?A*p~ACx(7t=-j&ZrT1e zl5XAF#+c*4RKaFTwC}w|#F^wV1ANl2Yh}9D+8ypVmQr*B+sBbk(oMMqgfCiar@Q4W+@-@_epYT@pb@R>g{V_?0Wii)Bkf_4b2|?lNO5irvxGRe zW5_htN$p{1&-EJS_z(SuxHw(acKlizjlE)WlkFa(lVXmyrxExatC~q6{ zQeN3z{m{+P&r7Eng3x!s5o7^kcJFR;`G=4;A!7^hQ&;XXaE~ui*Q>gwkQ=|S2jTcG z>z_M%4)_P~O5h+87f;nKWDIJw6AKdBSDjcS!hQC-B}xol#q0 zl5rRreSROQ#D|c@0DnVPy?z?_C{k~}S%dD^dNI~odluN0eeXwz(nf?NtLXO12<~G) zGOB+c63w{3pd2AabHD;+gL*(u(l`v_&_hb8h>yF|+JkB8Pfxl||HmCPkOg$ifAxPf6m$wikOUJ`~MCe*q zE=kwZp9spH1NQd&dPZKSJdPo4@YC)yh~M~n*R2Y~n{aT+R5&Sl4|-=Is;6i#4KCI9 zcsK2Nyj7%vRdPbTo|6d82|91G!U{`d#U=l`_oVBw6&bMnIc4njkFc`sqiK{useRX5S*xL#4q?0L0ofL9<5Q=xtx@4zgwd(>7Bs&0pN_HjS*EY%ChtNU(7LfGq~6A2A&LR^--*1d^cmn) z1aqhA;8eGQgGyr9j9*%7$BP7K zXJ_Yt4+8g1PEJnLYOSIuilRi4jo{{jeE)kmS}S|;@f7l}7kYg`vZ5%8qEyBp?>2iN z=eNVw+S35Wm>J}sl%BBGs^d}=MNx(xgZz7it_w->7N97KqA1ER^M4 0) { var prevIndex = document.getElementById("logBox").selectedIndex - 1; @@ -186,7 +188,9 @@ function allRemoveEntry() { document.getElementById("stdout").value = ""; document.getElementById("entry_title").value = ""; + $("#entry_stdin").jqte(); document.getElementById("entry_stdin").value = ""; + $("#entry_stdin").jqte(); } /** @@ -211,6 +215,9 @@ $(document).ready(function() { // 初期処理を実施 initialize(); + // jquery-teを初期として適用します + $("#entry_stdin").jqte(); + // ログ一覧のXMLをロードします logXMLLoader(); }); @@ -285,7 +292,9 @@ function analyzeTargetXml(xmlData) { refleshEntrylistBox(); document.getElementById("entry_title").value = ""; + $("#entry_stdin").jqte(); document.getElementById("entry_stdin").value = ""; + $("#entry_stdin").jqte(); document.getElementById("entry_category").innerHTML = ""; document.getElementById("stdout").value = ""; editIndex = -1; @@ -333,12 +342,16 @@ function applyFeedinfo() { function entryLoader(index) { if (index < 0) { document.getElementById("entry_title").value = ""; + $("#entry_stdin").jqte(); document.getElementById("entry_stdin").value = ""; + $("#entry_stdin").jqte(); addTagSelectBoxFromCategory([]); editIndex = -1; } else { document.getElementById("entry_title").value = entryList[index].title; + $("#entry_stdin").jqte(); document.getElementById("entry_stdin").value = entryList[index].content; + $("#entry_stdin").jqte(); addTagSelectBoxFromCategory(entryList[index].category); editIndex = index; } -- 2.11.0