tdiary-contrib 5.0.8 → 5.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d9a46bf4de48e3f68a55368e90037739d4893f8cf01e8a84856ab0d20909c6e
4
- data.tar.gz: 1ed06a04c4e91f800324a748f0aa463144a1903513480609d3bf2982d87921a7
3
+ metadata.gz: 8ee22d81638a67676a46950b6b5fd99200e2d297b2f231cb472ece17db32e0fb
4
+ data.tar.gz: d61ceb27d570b6b6f8e77d5f117000f3ebbc124627003398d32248d4d02302e3
5
5
  SHA512:
6
- metadata.gz: f4e92b1579a74a59a33c733b087f6bc450614cdfe7bf4e691f95ae510a863f24308674a78bf811e86195dd7c80dbb99a034bf96a0919a1b934da402fc2c62882
7
- data.tar.gz: 7c666a539ff02568ed5abc27a3d8d6876be81c03d599a823affaee81031c01d23d822df8a919bbfaf7929a6f24536bb66e9220f8d4adc15a8c6e363791c09878
6
+ metadata.gz: b4daf824d46d3249e6ccc1e66a9a83c172fa772b7eaae0e570e3ad93a6c60ce5537a5993b3f3a9fc4e858367445c1145608e05c93bb6404d05efa7991c39bc54
7
+ data.tar.gz: 573f697640ad4fbfae1c5f76e06b7ce3b84abab8077c6800df6c7767ee319614e7db3e82cd9e830f68476008c7449b135c960c27ad040113d90e78691d7d6e9f
@@ -0,0 +1,5 @@
1
+ /*
2
+ shogizumen.js ver.20170713
3
+ (c) maasa. | http://www.geocities.jp/ookami_maasa/shogizumen/
4
+ */
5
+ (function(a){if(typeof(SSZumen)=="undefined"){SSZumen=a;window.addEventListener("load",SSZumen,false)}})(function(){function u(){var v=document.createElement("div");v.innerHTML="<svg/>";return v.firstChild&&v.firstChild.viewBox!=undefined}if(!u()){return}var k=".shogizumen";var p="pre";var j=0;var a=0;var c=0;var l=function(){var w=document.querySelectorAll(k);for(var x=0;x<w.length;x++){var v=w[x];var C;if(v.tagName.toLowerCase()!=p){C=v.querySelector(p)}else{C=v;v=v.parentNode}var B=m(C.innerHTML);if(B!=false){var y=C.offsetWidth;var A=C.offsetHeight;C.style.display="none";var z=v.insertBefore(b(y,A,B),C);z.appendChild(C)}}};var r="123456789";var h="123456789";var s="一二三四五六七八九";var t="玉飛角金銀桂香歩玉龍馬金全圭杏と";var n=function(w){var v=new RegExp("["+h+s+"]","g");w=w.replace(v,function(x){return r.charAt((h+s).indexOf(x)%9)});w=w.replace("0","0");w=w.replace(/十([1-9])/,"1$1");w=w.replace("十","10");w=w.replace(/(.)(1?[0-9])/g,function(y,x,B){for(var z=0,A="";z<B;z++){A+=x}return A});return w};var o=function(v){v=v.replace("王","玉");v=v.replace("竜","龍");v=v.replace("仝","杏");v=v.replace("个","と");return v};var m=function(I){var w,B,G,E,K,D,A,C;var F=new Array(98);for(var A=0;A<95;A++){F[A]=0}F[95]="先手";F[96]="後手";F[97]=-1;var v="";var z="";var J=/^([先下後上]手の)?持駒:([^\n]*)/mg;while((w=J.exec(I))!=null){if(/[後上]/.test(w[1])){z=w[2]}else{v=w[2]}}J=/^([先下後上]手):(.*)\n/mg;while((w=J.exec(I))!=null){w[2].replace(/^\s+/,"");w[2].replace(/(\s| ).*$/,"");if(/[後上]/.test(w[1])){F[96]=w[2]}else{F[95]=w[2]}}E=1;J=/^\|([^\n]*)/mg;while((w=J.exec(I))!=null){w[1]=o(w[1]);G=9;C=new RegExp("([\\+\\-vV\\^\\s])(.)","g");while((B=C.exec(w[1]))!=null){K=("vV-".indexOf(B[1])>-1)?2:0;if((D=t.indexOf(B[2]))>-1){if(D>7){D-=8;K=K|1}F[E*9-G]=K*8+D+1}if(--G<1){break}}if(++E>9){break}}if(E==1){return false}v=n(v);for(A=0;A<v.length;A++){if((D=t.indexOf(v.charAt(A)))>0){F[81+D-1]+=1}}z=n(z);for(A=0;A<z.length;A++){if((D=t.indexOf(z.charAt(A)))>0){F[88+D-1]+=1}}J=/^手数=\d+\s+[▲△▽]?(.)(.)(.*)まで/mg;if((w=J.exec(I))!=null){var H=-100;if((D=0+w[1])>0){H=8-D}else{if((D=h.indexOf(w[1]))>0){H=8-D}}if((D=0+w[2])>0){H+=D*9}else{if((D=h.indexOf(w[2]))>0){H+=D*9}else{if((D=s.indexOf(w[2]))>0){H+=D*9}}}F[97]=H}return F};var d="http://www.w3.org/2000/svg";var e="inherit";var f=1;var q="currentColor";var i=function(x,A){var z="";for(var y=1;y<8;y++){var w=A[81+x*7+y-1];if(w>0){z+=t.charAt(y);if(w>1){if(w>10){z+="十";w-=10}z+=s.charAt(w-1)}}}if(z==""){return"なし"}return z};var g=function(D,A,z,C){var y=A.createElementNS(d,"g");var E=(D==0)?"☗"+C[95]+" ":"☖"+C[96]+" ";E+=i(D,C);for(var x=0;x<E.length-f;x++){var F=A.createElementNS(d,"text");F.textContent=E.charAt(E.length-x-1);F.setAttribute("font-family",e);F.setAttribute("font-size",z*9/14);F.setAttribute("fill",q);F.setAttribute("text-anchor","middle");F.setAttribute("x",0);F.setAttribute("y",-x*z*9/14);y.appendChild(F)}if(f){var F=A.createElementNS(d,"polygon");var B=-E.length*z*9/14;F.setAttribute("points","0,"+B+" "+z*0.23+","+(B+z*0.1)+" "+z*0.3+","+(B+z*0.6)+" "+z*-0.3+","+(B+z*0.6)+" "+z*-0.23+","+(B+z*0.1));if(D!=0){F.setAttribute("fill","none")}else{F.setAttribute("fill",q)}F.setAttribute("stroke",q);F.setAttribute("stroke-width",z/25);y.appendChild(F)}var w=(E.length>14)?14/E.length:1;if(D==0){y.setAttribute("transform","translate("+(z*11.35)+","+(z*9.7)+") scale(1,"+w+")")}else{y.setAttribute("transform","translate("+(z*0.65)+","+(z*0.8)+") scale(-1,"+(-w)+")")}return y};var b=function(I,P,T){var R=document;var M=R.createElementNS(d,"svg");var K=T[97];var S=j;if(S==0){S=(I/12<P/10)?Math.floor(I/12):Math.floor(P/10);if(S<a){S=a}if(c&&S>c){S=c}}console.log(I,P,S);M.setAttribute("width",S*12);M.setAttribute("height",S*10);M.style.verticalAlign="bottom";var J=Math.floor(S*1.25);var H=Math.floor(S*0.75);var N;if(window.devicePixelRatio&&window.devicePixelRatio>=2){N=1/2}else{N=1}var Q=R.createElementNS(d,"g");var v=R.createElementNS(d,"rect");v.setAttribute("x",J);v.setAttribute("y",H);v.setAttribute("width",S*9+1);v.setAttribute("height",S*9+1);v.setAttribute("stroke-width",2);v.setAttribute("stroke",q);v.setAttribute("fill","none");Q.appendChild(v);for(var O=0;O<9;O++){if(O){var V=R.createElementNS(d,"line");var X=R.createElementNS(d,"line");V.setAttribute("x1",O*S+J+N/2);V.setAttribute("x2",O*S+J+N/2);V.setAttribute("y1",H+N/2);V.setAttribute("y2",H+S*9+N/2);V.setAttribute("stroke-width",N);V.setAttribute("stroke",q);X.setAttribute("y1",O*S+H+N/2);X.setAttribute("y2",O*S+H+N/2);X.setAttribute("x1",J+N/2);X.setAttribute("x2",J+S*9+N/2);X.setAttribute("stroke-width",N);X.setAttribute("stroke",q);Q.appendChild(V);Q.appendChild(X)}var U=R.createElementNS(d,"text");var W=R.createElementNS(d,"text");U.setAttribute("x",O*S+J+S/2);U.setAttribute("y",H-S/6);U.setAttribute("font-family",e);U.textContent=h.charAt(8-O);U.setAttribute("font-size",S*0.4);U.setAttribute("fill",q);U.setAttribute("text-anchor","middle");Q.appendChild(U);W.setAttribute("x",J+S*9+S*0.35);W.setAttribute("y",O*S+H+S*0.6);W.textContent=s.charAt(O);W.setAttribute("font-size",S*0.4);W.setAttribute("font-family",e);W.setAttribute("fill",q);W.setAttribute("text-anchor","middle");Q.appendChild(W)}M.appendChild(Q);for(var O=0;O<81;O++){if(T[O]>0){var G=(O%9)*S+J+S/2+N/2;var F=Math.floor(O/9)*S+H+S/2+N/2;var A=R.createElementNS(d,"g");var L=t.charAt((T[O]-1)&15);var z=R.createElementNS(d,"text");z.setAttribute("fill",q);if("全圭杏".indexOf(L)!=-1){var z=R.createElementNS(d,"text");z.setAttribute("font-size",S*0.82);L=t.charAt((T[O]-1)&7);if(O==K){z.setAttribute("class","szLastMove")}else{z.setAttribute("font-family",e)}z.setAttribute("text-anchor","middle");z.setAttribute("dy",-S*0.09);z.textContent="成";A.appendChild(z);z=R.createElementNS(d,"text");z.setAttribute("dy",S*0.32+S*0.41);if(T[O]>16){A.setAttribute("transform","translate("+(G)+","+(F)+") scale(-1,-0.5)")}else{A.setAttribute("transform","translate("+(G)+","+(F)+") scale(1,0.5)")}}else{z.setAttribute("dy",S*0.32);if(T[O]>16){A.setAttribute("transform","translate("+(G)+","+(F)+") scale(-1,-1)")}else{A.setAttribute("transform","translate("+(G)+","+(F)+")")}}z.setAttribute("font-size",S*0.82);if(O==K){z.setAttribute("class","szLastMove")}else{z.setAttribute("font-family",e)}z.setAttribute("text-anchor","middle");z.textContent=L;A.appendChild(z);M.appendChild(A)}}var C=g(0,R,S,T);M.appendChild(C);var B=g(1,R,S,T);M.appendChild(B);var E=document.createElement("div");E.style.position="relative";E.style.width=S*12+"px";E.style.height=S*10+"px";E.style.overflow="auto";(function(w){w.onmouseover=function(x){this.childNodes[1].style.display="block"};w.onmouseout=function(x){this.childNodes[1].style.display="none"}})(E);var D=document.createElement("div");D.style.position="absolute";D.style.right=0+"px";D.style.top=0+"px";D.style.zIndex="9999";D.style.width="30px";D.style.height="16px";D.style.borderRadius="4px";D.style.backgroundColor="#CCC";D.style.display="none";D.style.fontSize="14px";D.style.lineHeight="1";D.style.color="black";D.style.cursor="pointer";D.style.baseline="middle";D.title="表示切替(局面図⇔kif形式)";D.style.textAlign="center";D.innerHTML="⇔";D.onclick=function(){var w=this.parentNode;if(this.previousSibling.style.display=="none"){this.previousSibling.style.display="";this.nextSibling.style.display="none"}else{this.previousSibling.style.display="none";this.nextSibling.style.display=""}};E.appendChild(M);E.appendChild(D);return E};l()});
@@ -1,5 +1,5 @@
1
1
  module TDiary
2
2
  class Contrib
3
- VERSION = "5.0.8"
3
+ VERSION = "5.0.9"
4
4
  end
5
5
  end
@@ -1,34 +1,23 @@
1
1
  #
2
- # everytrail.rb: plugin embedding trip map on everytrail.com.
2
+ # everytrail.rb: everytrail plugin is obsoleted
3
3
  #
4
- # Copyright (C) 2010 TADA Tadashi <t@tdtds.jp>
5
- # You can redistribute it and/or modify it under GPL2.
6
- #
7
-
8
- def everytrail_adjust_size( size )
9
- s = size.collect {|i| i.to_i }
10
- s[0] = 400 if s[0] == 0
11
- s[1] = 300 if s[1] == 0
12
- s
4
+ def everytrail_obsoleted(label = nil)
5
+ if label
6
+ "<div>(EveryTrail is obsoleted. [#{h label}])</div>"
7
+ else
8
+ "<div>(EveryTrail is obsoleted.)</div>"
9
+ end
13
10
  end
14
11
 
15
12
  def everytrail( trip_id, label = nil, size = [400, 300] )
16
- size = everytrail_adjust_size( size )
17
- r = %Q|<div class="everytrail"><iframe src="http://www.everytrail.com/iframe2.php?trip_id=#{h trip_id}&amp;width=#{size[0]}&amp;height=#{size[1]}" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" width=#{size[0]} height=#{size[1]}>|
18
- r << %Q|<a href="http://www.everytrail.com/view_trip.php?trip_id=#{h trip_id}">#{h label}</a>| if label
19
- r << %Q|</iframe></div>|
13
+ everytrail_obsoleted(label)
20
14
  end
21
15
 
22
16
  def everytrail_flash( trip_id, label = nil, size = [400, 300] )
23
- size = everytrail_adjust_size( size )
24
- %Q|<div class="everytrail"><object width="#{size[0]}" height="#{size[1]}" codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab"><param name="movie" value="http://www.everytrail.com/swf/widget.swf"><param name="FlashVars" value="units=metric&amp;mode=0&amp;key=ABQIAAAAggE6oX7o-2CFkLBRN20X9BTCaWgBOrVzmDbJc0e41WeTNzCWNBSYkdZ8D6iOk2yqQd-kgDCXfoqiUQ&amp;tripId=#{trip_id}"><embed src="http://www.everytrail.com/swf/widget.swf" quality="high" width="#{size[0]}" height="#{size[1]}" FlashVars="units=metric&amp;mode=0&amp;key=ABQIAAAAggE6oX7o-2CFkLBRN20X9BTCaWgBOrVzmDbJc0e41WeTNzCWNBSYkdZ8D6iOk2yqQd-kgDCXfoqiUQ&amp;tripId=#{trip_id}" play="true" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object></div>|
17
+ everytrail_obsoleted(label)
25
18
  end
26
19
 
27
20
  def everytrail_widget( trip_id, latitude = nil, longtitude = nil, label = nil, size = [400, 300] )
28
- size = everytrail_adjust_size( size )
29
- lat_param = latitude ? "&amp;startLat=#{latitude}" : ''
30
- lon_param = longtitude ? "&amp;startLon=#{longtitude}" : ''
31
- r = label ? %Q|<h3><a href="http://www.everytrail.com/view_trip.php?trip_id=#{h trip_id}">#{h label}</a></h3>| : ''
32
- r << %Q|<object width="#{size[0]}" height="#{size[1]}" codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab"><param name="movie" value="http://www.everytrail.com/swf/widget.swf"><param name="FlashVars" value="tripId=#{h trip_id}&amp;units=metric&amp;mode=0#{lon_param}#{lat_param}&amp;stats=off&amp;mapType=Terrain"><embed src="http://www.everytrail.com/swf/widget.swf" quality="high" width="#{size[0]}" height="#{size[1]}" FlashVars="tripId=#{h trip_id}&amp;units=metric&amp;mode=0#{lon_param}#{lat_param}&amp;stats=off&amp;mapType=Terrain" play="true" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object><br><a href="http://www.everytrail.com">Map your trip with EveryTrail</a>|
21
+ everytrail_obsoleted()
33
22
  end
34
23
 
@@ -0,0 +1,14 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # shogizumen.rb -- Just enable shogizumen.min
4
+ #
5
+ # Copyright (c) KITADAI, Yukinori <https://nyoho.jp/>
6
+ # MIT License
7
+ #
8
+ # shogizumen.min.js is under MIT license.
9
+
10
+ enable_js('shogizumen.min.js')
11
+
12
+ def shogizumen(zumen_string)
13
+ '<pre class="shogizumen">' + zumen_string + '</pre>'
14
+ end
@@ -5,6 +5,6 @@
5
5
  # You can redistribute it and/or modify it under GPL2.
6
6
  #
7
7
 
8
- def twitpic( image_id, label = 'image on Twitpic', place = 'photo' )
9
- %Q|<a class="twitpic" href="http://twitpic.com/#{h image_id}" title="#{h label}"><img class="#{h place}" src="http://twitpic.com/show/thumb/#{h image_id}.jpg" width="150" height="150" alt="#{h label}"></a>|
8
+ def twitpic(image_id, label = 'Image on Twitpic', place = 'photo')
9
+ %Q|<p><a class="twitpic" href="http://twitpic.com/#{h image_id}">#{h label}</a></p>|
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdiary-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.8
4
+ version: 5.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - tDiary contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-29 00:00:00.000000000 Z
11
+ date: 2018-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tdiary
@@ -194,6 +194,7 @@ files:
194
194
  - js/nicovideo.js
195
195
  - js/plugin_checker.js
196
196
  - js/referer.js
197
+ - js/shogizumen.min.js
197
198
  - js/show_and_hide.js
198
199
  - js/slideshow.js
199
200
  - js/socialbutton.js
@@ -340,6 +341,7 @@ files:
340
341
  - plugin/select-style.rb
341
342
  - plugin/select_style.rb
342
343
  - plugin/select_theme.rb
344
+ - plugin/shogizumen.rb
343
345
  - plugin/show_and_hide.rb
344
346
  - plugin/slideshare.rb
345
347
  - plugin/slideshow.rb