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 +4 -4
- data/lib/opal/httpget/version.rb +1 -1
- data/lib/opal/httpget.rb +18 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa63346a96974fabe7505bd8c7929a8897e0ee05cf93fc06fc6f59c1ec418b19
|
4
|
+
data.tar.gz: 1944f7f9bc20ad8a49ac08d622698ff9bc47d7571f453beb50eabfd4d7a7f7ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4005c58e735c3d9423e46bf72b27340c834442b99f1153a027b4150e1cf3787df4cdda45f13431a63749bd1683f3632beba94c2110a55a75d5bc6958e6c0fcb
|
7
|
+
data.tar.gz: 8dbc07e3308b5f1b2cdb6c17ce2cf78cb9d1caed14a03d9d8a020f44b2fe5cdc1802e99e0910a6631cf3da0ca15080a8061ebc1877862087a5b6e99c18d3dead
|
data/lib/opal/httpget/version.rb
CHANGED
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
|
-
|
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
|