質問編集履歴
2
タグの追加
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -132,6 +132,124 @@
|
|
132
132
|
|
133
133
|
|
134
134
|
|
135
|
+
function onFail(){
|
136
|
+
|
137
|
+
console.log("写真を取得できませんでした")
|
138
|
+
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
$(document).on('pageinit', '#main-page', function(){
|
144
|
+
|
145
|
+
var onSuccess = function(pictureUrl){
|
146
|
+
|
147
|
+
images = [];
|
148
|
+
|
149
|
+
var $img = $('<img>');
|
150
|
+
|
151
|
+
$img.attr('src', pictureUrl);
|
152
|
+
|
153
|
+
images.push({
|
154
|
+
|
155
|
+
element: $img,
|
156
|
+
|
157
|
+
label: '無加工'
|
158
|
+
|
159
|
+
});
|
160
|
+
|
161
|
+
myNavi.pushPage('image.html');
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
$(this).on('click', ',take-from-camera', function(){
|
166
|
+
|
167
|
+
getPictureFromCamera(onSuccess);
|
168
|
+
|
169
|
+
});
|
170
|
+
|
171
|
+
$(this).on('click', ',take-from-gallery', function(){
|
172
|
+
|
173
|
+
getPictureFromGallery(onSuccess);
|
174
|
+
|
175
|
+
});
|
176
|
+
|
177
|
+
});
|
178
|
+
|
179
|
+
</script>
|
180
|
+
|
181
|
+
</head>
|
182
|
+
|
183
|
+
<body>
|
184
|
+
|
185
|
+
<ons-navigator var="myNavi">画面の切り替え
|
186
|
+
|
187
|
+
<ons-page id="main-page">
|
188
|
+
|
189
|
+
<ons-toolbar>
|
190
|
+
|
191
|
+
<div class="center">画像変換アプリ</div>
|
192
|
+
|
193
|
+
</ons-toolbar>
|
194
|
+
|
195
|
+
<br>
|
196
|
+
|
197
|
+
<ons-list>
|
198
|
+
|
199
|
+
<ons-list-item modifier="chevron" class="take-from-gallery">
|
200
|
+
|
201
|
+
<ons-icon icon="ion-images"></ons-icon>ギャラリーから選ぶ
|
202
|
+
|
203
|
+
</ons-list-item>
|
204
|
+
|
205
|
+
<ons-list-item modifier="chevron" class="take-from-camera">
|
206
|
+
|
207
|
+
<ons-icon icon="ion-camera"></ons-icon>カメラで撮影
|
208
|
+
|
209
|
+
</ons-list-item>
|
210
|
+
|
211
|
+
</ons-list>
|
212
|
+
|
213
|
+
<br>
|
214
|
+
|
215
|
+
</ons-page>
|
216
|
+
|
217
|
+
</ons-navigator>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<ons-template id="image.html">
|
222
|
+
|
223
|
+
<ons-page id="image-page">
|
224
|
+
|
225
|
+
<ons-toolbar>
|
226
|
+
|
227
|
+
<div class="left">
|
228
|
+
|
229
|
+
<ons-back-button ons-if-platform="ios">Back</ons-back-button>
|
230
|
+
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="center">画像</div>
|
234
|
+
|
235
|
+
</ons-toolbar>
|
236
|
+
|
237
|
+
<ons-carousel var="imageCarousel" class="image-carousel" fullscreen auto-scroll overscrollable>
|
238
|
+
|
239
|
+
</ons-carousel>
|
240
|
+
|
241
|
+
</ons-page>
|
242
|
+
|
243
|
+
</ons-template>
|
244
|
+
|
245
|
+
</body>
|
246
|
+
|
247
|
+
</html>
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
135
253
|
|
136
254
|
|
137
255
|
```
|