opal-httpget 0.1.5 → 0.1.7

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: 1f9bbc00f219b1639088a2d92f32e874b1dd0576d306c885cf3b42da29785591
4
- data.tar.gz: '083188ee196fd95ac79efa7ec3f30d6afca0976632087f36713836e1ffd5dfd7'
3
+ metadata.gz: aa63346a96974fabe7505bd8c7929a8897e0ee05cf93fc06fc6f59c1ec418b19
4
+ data.tar.gz: 1944f7f9bc20ad8a49ac08d622698ff9bc47d7571f453beb50eabfd4d7a7f7ab
5
5
  SHA512:
6
- metadata.gz: 8afcaf2d802fea8fcfc45b600f52ba00b0c3348d4ef1d4af99d6c254e17883aa099b728ddcfde80a40372ae832dfd63d3d6f1f25f8356741fbb09b5ad340b4ea
7
- data.tar.gz: 40b2d620c392247387afd0085b68b2d8ac6111d4b224feb5889f75c5ae30c276973f9e642443da15ab36a7c2352b9428fee6d9f1b57b321b21ef8f89596cf414
6
+ metadata.gz: d4005c58e735c3d9423e46bf72b27340c834442b99f1153a027b4150e1cf3787df4cdda45f13431a63749bd1683f3632beba94c2110a55a75d5bc6958e6c0fcb
7
+ data.tar.gz: 8dbc07e3308b5f1b2cdb6c17ce2cf78cb9d1caed14a03d9d8a020f44b2fe5cdc1802e99e0910a6631cf3da0ca15080a8061ebc1877862087a5b6e99c18d3dead
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Opal
4
4
  module Httpget
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.7"
6
6
  end
7
7
  end
data/lib/opal/httpget.rb CHANGED
@@ -62,31 +62,41 @@ module Opal
62
62
  module_function
63
63
 
64
64
  ## 画像プリロードの構文。参考: https://www.webdesignleaves.com/wp/jquery/1355/
65
- def mypreload(files)
65
+
66
+ # def mypreload(files)
67
+ # %x{
68
+ # for(var i = 0; i< files.length; i++){
69
+ # $("<img>").attr("src", files[i]);
70
+ # }
71
+ # }
72
+ # end
73
+
74
+ ## ここで、先に画像ファイルを読み込む。
75
+ def preload_images(files, &next_proc)
76
+ imnum, targetnum = 0, files.length
77
+ # mypreload(files)
66
78
  %x{
67
79
  for(var i = 0; i< files.length; i++){
68
80
  $("<img>").attr("src", files[i]);
81
+
82
+ if (i == files.length-1) {
83
+ #{ yield }
84
+ }
69
85
  }
70
86
  }
71
87
  end
72
88
 
73
- ## ここで、先に画像ファイルを読み込む。
74
- def preload_images(files, &next_proc)
75
- imnum, targetnum = 0, files.length
76
- mypreload(files)
77
- yield
78
- end
79
89
 
80
- end
90
+ # おまけ機能: テキストの変更
91
+ def change_text(id, text)
92
+ `document.querySelector(id).textContent=text;`
93
+ end
81
94
 
82
- # おまけ機能: テキストの変更
83
- def change_text(id, text)
84
- `document.querySelector(id).textContent=text;`
85
- end
95
+ # おまけ機能: テキストの変更
96
+ def open_window(url)
97
+ `window.open( url );`
98
+ end
86
99
 
87
- # おまけ機能: テキストの変更
88
- def open_window(url)
89
- `window.open( url );`
90
100
  end
91
101
 
92
102
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-httpget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - showata