10: 2006-12-01 (金) 20:25:44 |
現: 2009-09-25 (金) 06:20:16 nao-pon |
| * とりあえずのテストページ :p [#lcf99938] | | * とりあえずのテストページ :p [#lcf99938] |
| | | |
- | とりあえず、新しいページを作ってみたよ。 | + | テスト用のページなので、適当に編集してください。 |
| | | |
- | ** xpwiki の記述はどれがいいでしょう? [#ke29eaad] | + | もちろん削除してもOK。 |
| | | |
- | #vote(xpwiki[0],XpWiki[0],xpWiki[6],XPWIKI[0]) | + | #newpage(./) |
- | - aa -- &new{2006-10-17 (火) 20:26:25}; | + | |
| | | |
- | #comment | |
- | ---- | |
- | #amazon(4839917795) | |
- | #clear | |
| | | |
- | *Code [#afe76a2b] | + | #amazon |
- | #code(javascript){{ | + | #navi |
- | function h_wikihelper_make_copy_button(arg) | + | #makepage |
- | { | + | makepageプラグインはやっぱり利用されていないんですね(><)~ |
- | document.write ("<input class=\"copyButton\" type=\"button\" value=\"COPY\" onclick=\"h_wikihelper_doCopy('" + arg + "')\"><br />"); | + | makepageプラグインの変換に成功された方いらっしゃれば[[こちら:http://xoops.hypweb.net/modules/newbb/viewtopic.php?topic_id=1823&forum=18]]にレス頂ければ嬉しいです。 |
- | } | + | |
| | | |
- | function h_wikihelper_doCopy(arg) | + | - 本当は、ケロヨンです。 -- [[ぼぼぼぼ〜]] &new{2007-03-27 (火) 14:47:52}; |
- | { | + | - むぅ -- [[ケロケロ]] &new{2007-04-10 (火) 16:11:28}; |
- | var doc = document.body.createTextRange(); | + | - テストページ -- [[nao-pon]] &new{2007-04-12 (木) 10:55:50}; |
- | doc.moveToElementText(document.all(arg)); | + | - XOOPS -- [[ケロヨン]] &new{2007-04-13 (金) 14:33:49}; |
- | doc.execCommand("copy"); | + | - :sleepy: ねむい・・・ -- [[nao-pon]] &new{2007-06-28 (木) 13:29:02}; |
- | alert(wikihelper_msg_copyed); | + | - :zzz: -- [[nao-pon]] &new{2007-06-28 (木) 13:34:02}; |
- | } | + | - (1) -- [[ケロヨン]] &new{2007-09-07 (金) 12:33:41}; |
| + | - (3) -- [[ケロヨン]] &new{2007-09-07 (金) 12:33:52}; |
| | | |
- | function wikihelper_pos(){ | + | #comment |
- | var et = document.activeElement.type; | + | ---- |
- | if (!(et == "text" || et == "textarea")) | + | |
- | { | + | |
- | if (et == "submit") wikihelper_elem = null; | + | |
- | return; | + | |
- | } | + | |
- | | + | |
- | wikihelper_elem = document.activeElement; | + | |
- | wikihelper_elem.caretPos = document.selection.createRange().duplicate(); | + | |
- | } | + | |
- | | + | |
- | function wikihelper_eclr(){ | + | |
- | wikihelper_elem = NULL; | + | |
- | } | + | |
- | | + | |
- | function wikihelper_ins(v) | + | |
- | { | + | |
- | if(!wikihelper_elem) | + | |
- | { | + | |
- | alert(wikihelper_msg_elem); | + | |
- | wikihelper_elem.focus(); | + | |
- | return; | + | |
- | } | + | |
- | | + | |
- | if (v == "&(){};") | + | |
- | { | + | |
- | inp = prompt(wikihelper_msg_inline1, ''); | + | |
- | if (inp == null) {wikihelper_elem.focus();return;} | + | |
- | v = "&" + inp; | + | |
- | inp = prompt(wikihelper_msg_inline2, ''); | + | |
- | if (inp == null) {wikihelper_elem.focus();return;} | + | |
- | v = v + "(" + inp + ")"; | + | |
- | inp = prompt(wikihelper_msg_inline3, ''); | + | |
- | if (inp == null) {wikihelper_elem.focus();return;} | + | |
- | v = v + "{" + inp + "}"; | + | |
- | v = v + ";"; | + | |
- | } | + | |
- | | + | |
- | wikihelper_elem.caretPos.text = v; | + | |
- | wikihelper_elem.focus(); | + | |
- | } | + | |
- | | + | |
- | function wikihelper_face(v) | + | |
- | { | + | |
- | if(!wikihelper_elem) | + | |
- | { | + | |
- | alert(wikihelper_msg_elem); | + | |
- | wikihelper_elem.focus(); | + | |
- | return; | + | |
- | } | + | |
- | | + | |
- | if (wikihelper_elem.caretPos.offsetLeft == wikihelper_elem.createTextRange().offsetLeft) | + | |
- | wikihelper_elem.caretPos.text = ' ' + v + ' '; | + | |
- | else | + | |
- | wikihelper_elem.caretPos.text = ' ' + v + ' '; | + | |
- | | + | |
- | wikihelper_elem.focus(); | + | |
- | } | + | |
- | | + | |
- | function wikihelper_tag(v) | + | |
- | { | + | |
- | if (!document.selection || !wikihelper_elem) | + | |
- | if (!wikihelper_elem || !wikihelper_elem.caretPos) | + | |
- | { | + | |
- | alert(wikihelper_msg_elem); | + | |
- | wikihelper_elem.focus(); | + | |
- | return; | + | |
- | } | + | |
- | | + | |
- | var str = wikihelper_elem.caretPos.text; | + | |
- | if (!str) | + | |
- | { | + | |
- | alert(wikihelper_msg_select); | + | |
- | wikihelper_elem.focus(); | + | |
- | return; | + | |
- | } | + | |
- | | + | |
- | if ( v == 'size' ) | + | |
- | { | + | |
- | var default_size = "%"; | + | |
- | v = prompt(wikihelper_msg_fontsize, default_size); | + | |
- | if (!v) return; | + | |
- | if (!v.match(/(%|pt)$/)) | + | |
- | v += "pt"; | + | |
- | if (!v.match(/\d+(%|pt)/)) | + | |
- | return; | + | |
- | } | + | |
- | if (str.match(/^&font\([^\)]*\)\{.*\};$/)) | + | |
- | { | + | |
- | str = str.replace(/^(&font\([^\)]*)(\)\{.*\};)$/,"$1," + v + "$2"); | + | |
- | } | + | |
- | else | + | |
- | { | + | |
- | str = '&font(' + v + '){' + str + '};'; | + | |
- | } | + | |
- | | + | |
- | wikihelper_elem.caretPos.text = str; | + | |
- | wikihelper_elem.focus(); | + | |
- | wikihelper_pos(); | + | |
- | } | + | |
- | | + | |
- | function wikihelper_linkPrompt(v) | + | |
- | { | + | |
- | if (!document.selection || !wikihelper_elem) | + | |
- | { | + | |
- | alert(wikihelper_msg_elem); | + | |
- | wikihelper_elem.focus(); | + | |
- | return; | + | |
- | } | + | |
- | | + | |
- | var str = document.selection.createRange().text; | + | |
- | if (!str) | + | |
- | { | + | |
- | str = prompt(wikihelper_msg_link, ''); | + | |
- | if (str == null) {wikihelper_elem.focus();return;} | + | |
- | } | + | |
- | var default_url = "http://"; | + | |
- | regex = "^s?https?://[-_.!~*'()a-zA-Z0-9;/?:@&=+$,%#]+$"; | + | |
- | var cbText = clipboardData.getData("Text"); | + | |
- | if(cbText && cbText.match(regex)) | + | |
- | default_url = cbText; | + | |
- | var my_link = prompt('URL: ', default_url); | + | |
- | if (my_link != null) { | + | |
- | if (!document.selection.createRange().text) { | + | |
- | wikihelper_elem.caretPos.text = '[[' + str + ':' + my_link + ']]'; | + | |
- | } else { | + | |
- | document.selection.createRange().text = '[[' + str + ':' + my_link + ']]'; | + | |
- | } | + | |
- | } | + | |
- | wikihelper_elem.focus(); | + | |
- | } | + | |
- | | + | |
- | function wikihelper_charcode() | + | |
- | { | + | |
- | if (!document.selection || !wikihelper_elem) | + | |
- | { | + | |
- | alert(wikihelper_msg_elem); | + | |
- | wikihelper_elem.focus(); | + | |
- | return; | + | |
- | } | + | |
- | | + | |
- | var str = document.selection.createRange().text; | + | |
- | if (!str) | + | |
- | { | + | |
- | alert(wikihelper_msg_select); | + | |
- | wikihelper_elem.focus(); | + | |
- | return; | + | |
- | } | + | |
- | | + | |
- | var j =""; | + | |
- | for(var n = 0; n < str.length; n++) j += (""+(str.charCodeAt(n))+";"); | + | |
- | str = j; | + | |
- | | + | |
- | document.selection.createRange().text = str; | + | |
- | wikihelper_elem.focus(); | + | |
- | } | + | |
- | | + | |
- | function wikihelper_initTexts() | + | |
- | { | + | |
- | if (wikihelper_initLoad) return; | + | |
- | wikihelper_initLoad = 1; | + | |
- | wikihelper_show_fontset_img(); | + | |
- | var oElements = document.getElementsByTagName("form"); | + | |
- | for (i = 0; i < oElements.length; i++) | + | |
- | { | + | |
- | oElement = oElements[i]; | + | |
- | var onkeyup = oElement.onkeyup; | + | |
- | var onmouseup = oElement.onmouseup; | + | |
- | oElement.onkeyup = function() | + | |
- | { | + | |
- | if (onkeyup) onkeyup(); | + | |
- | wikihelper_pos(); | + | |
- | }; | + | |
- | oElement.onmouseup = function() | + | |
- | { | + | |
- | if (onmouseup) onmouseup(); | + | |
- | wikihelper_pos(); | + | |
- | }; | + | |
- | } | + | |
| | | |
- | oElements = document.getElementsByTagName("input"); | + | -code プラグイン用のCSSに不備がありましたので、修正しました。- nao-pon &new(){2007-02-14 (水) 14:05:24}; |
- | for (i = 0; i < oElements.length; i++) | + | --[[trustCVS:skin/css/code.css]] |
- | { | + | |
- | oElement = oElements[i]; | + | |
- | if (oElement.type == "text" || oElement.type == "submit") | + | |
- | { | + | |
- | var rel = String(oElement.getAttribute('rel')); | + | |
- | var onfocus = oElement.onfocus; | + | |
- | if (rel == "wikihelper") { | + | |
- | //alert(rel); | + | |
- | oElement.onfocus = function() | + | |
- | { | + | |
- | if (onfocus) onfocus(); | + | |
- | wikihelper_setActive(this); | + | |
- | }; | + | |
- | } else { | + | |
- | oElement.onfocus = function() | + | |
- | { | + | |
- | if (onfocus) onfocus(); | + | |
- | wikihelper_hide_helper(); | + | |
- | }; | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | oElements = document.getElementsByTagName("textarea"); | + | |
- | for (i = 0; i < oElements.length; i++) | + | |
- | { | + | |
- | oElement = oElements[i]; | + | |
- | var rel = String(oElement.getAttribute('rel')); | + | |
- | var onfocus = oElement.onfocus; | + | |
- | if (rel == "wikihelper") { | + | |
- | oElement.onfocus = function() | + | |
- | { | + | |
- | if (onfocus) onfocus(); | + | |
- | wikihelper_setActive(this); | + | |
- | }; | + | |
- | } else { | + | |
- | oElement.onfocus = function() | + | |
- | { | + | |
- | if (onfocus) onfocus(); | + | |
- | wikihelper_hide_helper(); | + | |
- | }; | + | |
- | } | + | |
- | } | + | |
- | return; | + | |
- | } | + | |
| | | |
- | function wikihelper_setActive(elem) | + | *再現テストさせてください。 [#md7d5893] |
- | { | + | [[http://ec1.images-amazon.com/images/I/51XQVRHF7ML._SS500_.jpg]] |
- | wikihelper_elem = elem; | + | ↑この画像をクリックすると「有効なInterWikiNameではありません」ってエラーになるかな? |
- | var offset = wikihelper_cumulativeOffset(wikihelper_elem); | + | |
- | var helper = document.getElementById("wikihelper_base"); | + | |
- | helper.style.left = offset[0] + "px"; | + | |
- | helper.style.top = ( offset[1] - helper.offsetHeight - 1 ) + "px"; | + | |
- | oElements = document.getElementsByTagName("select"); | + | |
- | for (i = 0; i < oElements.length; i++) | + | |
- | { | + | |
- | oElement = oElements[i]; | + | |
- | oElement.style.visibility = "hidden"; | + | |
- | } | + | |
- | } | + | |
| | | |
- | function wikihelper_show_hint() | + | - ほんとだ!エラーになりますね。 :-o 要考察ですね。 - nao-pon |
- | { | + | |
- | alert(wikihelper_msg_winie_hint_text); | + | |
| | | |
- | if (wikihelper_elem != null) wikihelper_elem.focus(); | + | #pcomment(/テストページ/コメント) |
- | } | + | |
- | }} | + | |