opal-httpget 0.1.6 → 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: 4bbefc4b5c28b8007fecc15f884f37e7956b4e1a3949458877b5e9d15dd98dc9
4
- data.tar.gz: 31bb6e64df3674f991460286604ebe2bb51de3935792a2460ac78b3b3fc00283
3
+ metadata.gz: aa63346a96974fabe7505bd8c7929a8897e0ee05cf93fc06fc6f59c1ec418b19
4
+ data.tar.gz: 1944f7f9bc20ad8a49ac08d622698ff9bc47d7571f453beb50eabfd4d7a7f7ab
5
5
  SHA512:
6
- metadata.gz: 4052d59f52c0d2b0db64150774c0841c40feb55bedc16fb233fbc9f2b31ca04ace3885521e81a5d849f53438099460cb5e22e84bc5dfbbf3ec075daad93bc27e
7
- data.tar.gz: bf96e618761fa005c6de47e8b5f5c70f10e46d185d4a198f1e4583acbce36e50d426d3e0187d155e8d3eda5e91f59a8fd3d50435657f49efbc6b805cf5504fa2
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.6"
5
+ VERSION = "0.1.7"
6
6
  end
7
7
  end
data/lib/opal/httpget.rb CHANGED
@@ -62,21 +62,30 @@ 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
-
80
89
 
81
90
  # おまけ機能: テキストの変更
82
91
  def change_text(id, text)
@@ -87,9 +96,7 @@ module Opal
87
96
  def open_window(url)
88
97
  `window.open( url );`
89
98
  end
90
-
91
- end
92
-
93
99
 
100
+ end
94
101
 
95
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - showata