Changeset 22134
- Timestamp:
- 10/26/08 02:47:44 (5 years ago)
- Files:
-
- 1 modified
-
lang/ruby/hiki/plugins/tmethod.rb (modified) (5 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/hiki/plugins/tmethod.rb
- Property svn:mime-type set to text/plain; charset=EUC-JP
r18586 r22134 1 1 # tmethod.rb $Revision: 1.00 $ 2 2 # 3 # tmethod : �������ǿʹԤ����ⶶ��åɡ�����������������3 # tmethod : クリックで進行する「高橋メソッド」風巨大文字プレゼンテーションを挿入 4 4 # 5 # �ѥ���:6 # str : �ʸ��"|"�ϥ��饤�ɤζ��ꡢ"/"�ϥ��饤������ԤȤʤ롣7 # "|" ��|"����������ϡ����\"����ƥ��������ס�8 # width : ���饤�ɤ���������ꡣ(�ǥե���: 480)9 # height : ���饤�ɤι⤵���ԥ�������ꡣ(�ǥե���: 320)5 # パラメタ : 6 # str : 本文。"|"はスライドの区切り、"/"はスライド内の改行となる。 7 # "|"と"|"を表示する場合には、前に"\"をつけてエスケープ。 8 # width : スライドの幅。ピクセルで指定。(デフォルト : 480) 9 # height : スライドの高さ。ピクセルで指定。(デフォルト : 320) 10 10 # 11 # ����� {{tmethod('����������������/ŷ��')}}11 # 記述例 : {{tmethod('こんに/ちは|今日は/いい/天気')}} 12 12 # 13 # ʸ�������ϡ�ɽ���ƥ����Ȥȥ��饤�ɤΥ������˹礦�褦��ưŪ������������14 # JavaScript + DHTML �����������Τǡ������ˤ��Ƥ�������������Ȥ⤢������15 # �¤�tDiary �Υץ饰������ƺ����Τ�ܤ��Τޤ�Ǥ��������ʤ�����13 # 文字のサイズは、表示テキストとスライドのサイズに合うよう自動的に調整されます。 14 # JavaScript + DHTMLを用いて動かすので、閲覧環境によっては表示されないこともあります。 15 # 実は tDiary のプラグインとして作ったのをほぼそのまんまです。ごめんなさい。 16 16 # 17 # Copyright (c) 2006 Maripo Goda 17 # Copyright (c) 2006 Maripo Goda 18 18 # mailto:madin@madin.jp 19 19 # Document URL http://www.madin.jp/works/plugin.html … … 22 22 @tmethodID = 0; 23 23 24 def tmethod (str='', width='480', height='320')24 def tmethod (str='', width='480', height='320') 25 25 scriptID = 'bp' + @tmethodID.to_s; #str.crypt('takahashi').slice(2..4) 26 26 @tmethodID += 1; 27 27 28 presen_ary = str.gsub("\\/", '⁄').gsub("\\|","&\#65073").split(/\|/);28 presen_ary = str.gsub("\\/", '⁄').gsub("\\|", "︱").split(/\|/); 29 29 presen_ary.collect!{|s| 30 s = '"' + s.gsub('/', '<br>') + '"'30 s = '"' + s.gsub('/', '<br>') + '"' 31 31 } 32 32 presen_str = presen_ary.join(',') … … 36 36 <!-- 37 37 t#{scriptID} = 0; 38 w#{scriptID} =#{width};39 h#{scriptID} ="#{height}";38 w#{scriptID} = #{width}; 39 h#{scriptID} = "#{height}"; 40 40 msg#{scriptID} = new Array(#{presen_str}); 41 41 function #{scriptID} () { 42 42 if (t#{scriptID} < msg#{scriptID}.length) { 43 msgArr = msg#{scriptID}[t#{scriptID}].split( '<br>');43 msgArr = msg#{scriptID}[t#{scriptID}].split("<br>"); 44 44 maxPx = h#{scriptID} * 0.8; 45 45 for (t = 0; t < msgArr.length; t ++) { … … 47 47 } 48 48 maxPx = Math.min(maxPx, Math.floor(h#{scriptID} * 0.8 / msgArr.length)); 49 with (document.getElementById("#{scriptID}")) {49 with (document.getElementById("#{scriptID}")) { 50 50 innerHTML = msg#{scriptID}[t#{scriptID}]; 51 51 style.fontSize = maxPx+"px"; … … 57 57 t#{scriptID} = 0; 58 58 with (document.getElementById("#{scriptID}")) { 59 innerHTML = " ��EPLAY��;60 style.fontSize = '100%';61 style.top = '50%';59 innerHTML = "《REPLAY》"; 60 style.fontSize = "100%"; 61 style.top = "50%"; 62 62 } 63 63 } 64 64 } 65 65 66 function countLength (str) 67 { 68 len = 0; 69 for (i = 0; i < str.length; i++) { 66 function countLength (str) { 67 var len = 0; 68 for (var i = 0, l = str.length; i < l; i ++) { 70 69 len ++; 71 70 if (escape(str.charAt(i)).length > 3) { 72 len ++ 71 len ++; 73 72 } 74 73 } 75 74 return Math.max(len, 1); 76 75 } 77 -->76 //--> 78 77 </script> 79 78 80 79 <noscript><p>JavaScript Required.</p></noscript> 81 <div class="bigpresen" style="text-align:center; position:relative; width:#{width}px; height:#{height}px; background:#fff; border:ridge 4px#ccc;" onclick="#{scriptID}()">80 <div class="bigpresen" style="text-align:center; position:relative; width:#{width}px; height:#{height}px; background:#fff; border:4px ridge #ccc;" onclick="#{scriptID}()"> 82 81 83 <span id="#{scriptID}" style="width:100%; position:absolute; top:50%; left:0; line-height:100%; color:black; font-family:' �ͣ��Х����å�', sans-serif;">��TART��/span>82 <span id="#{scriptID}" style="width:100%; position:absolute; top:50%; left:0; line-height:100%; color:black; font-family:'MS Pゴシック', sans-serif;">《START》</span> 84 83 85 84 </div>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)