This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="form1"> | |
id (int): | |
<input type="text" id="id-text-id" value=""></input ><br /> | |
name: | |
<input type="text" id="id-text-name" value=""></input ><br /> | |
kana: | |
<input type="text" id="id-text-kana" value=""></input ><br /> | |
</form><br /> | |
<a href="#" id="id-a-add" >[ add ]</a><br /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DbHelper.prototype.get_allItems = function(view) | |
{ | |
var rqOpen = indexedDB.open(DB_NAME); | |
rqOpen.onsuccess = function(e) { | |
var db= e.target.result; | |
var tx = db.transaction(STORE_NAME, 'readonly' ); | |
var store = tx.objectStore(STORE_NAME); | |
var rq = store.openCursor(); | |
rq.onsuccess = function(e) { | |
cursor = rq.result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View.prototype.disp_init = function() { | |
$('ul#id-ul-out').remove(); | |
var divOut= $('div#id-div-out'); | |
var ulObj= $('<ul id="id-ul-out"></ul>'); | |
divOut.append( ulObj ); | |
}; | |
View.prototype.disp_line = function( item ) { | |
// console.log( items ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#export EMCC_CFLAGS="-O3" | |
rm -rf dest/* | |
export EMCC_FAST_COMPILER=0 | |
emcc hello_world.c \ | |
-o dest/hello_world.js \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <emscripten.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
printf("hello, world!\n"); | |
EM_ASM( | |
//js-call | |
console.log( '#hello, world-Inline-JS '); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//export1.c | |
#include <emscripten.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
char* ex_func01( int a, float b, const char* c ) | |
{ | |
char *po= (char *)malloc(sizeof(char) * 128 ); | |
sprintf(po, "a=%d ,b=%f ,c=%s\n", a, b, c ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//test.js | |
onload = function(){ | |
console.log('#onload'); | |
var ex_func01= cwrap( 'ex_func01', 'string', ['number' ,'number' ,'string' ] ); | |
var ret= ex_func01(1, 2.0, 'arg3'); | |
console.log('#ret=' +ret ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onload = function() { | |
var canvas =document.getElementById('id_canvas'); | |
var iW = canvas.width; | |
var iH = canvas.height; | |
console.log( 'iW='+ iW +',iH=' + iH) | |
var items= get_slideData(); | |
var slide = new CustomSlide(1000 * 10 ,items, iW, iH ); | |
slide.start(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CustomSlide.load_image = function ( item, ipos) { | |
console.log('#load_image=' + item.url ); | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', item.url ); | |
xhr.responseType = 'blob'; | |
xhr.onload = function() { | |
console.log('#r.onload,url=' + item.url ); | |
var image = new Image(); | |
var objURL = URL.createObjectURL(xhr.response); | |
image.src = objURL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CustomSlide.start_anim = function (image, msec ) { | |
var ixSt = mWidthSlide; | |
var ix = 0; | |
var imx = msec / mDuration; | |
var ixDf = ixSt / imx; | |
console.log('imx='+ imx + ',ixDf=' +ixDf +',ipos='+ mPosition_Slide ); | |
setTimeout(function(){ | |
function gravity() { | |
mContext.clearRect(0, 0, mWidthSlide, mHeightSlide); |