Changeset 36087
- Timestamp:
- 12/07/09 18:34:45 (3 years ago)
- Location:
- lang/haxe/Tonyu2
- Files:
-
- 4 added
- 4 modified
-
Projects/toste/Mikata.tonyu (added)
-
Projects/toste/Teki.tonyu (added)
-
Projects/toste/Test.tonyu (modified) (1 diff)
-
Projects/toste/haxe/Mikata.hx (added)
-
Projects/toste/haxe/Teki.hx (added)
-
Projects/toste/haxe/Test.hx (modified) (2 diffs)
-
Projects/toste/toste.swf (modified) (previous)
-
htdocs/Project.class.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/haxe/Tonyu2/Projects/toste/Test.tonyu
r36072 r36087 4 4 y=200; 5 5 while (x<200) { 6 x=x+ 1;6 x=x+3; 7 7 y=y-rnd(5); 8 8 y=y+2; 9 9 update(); 10 10 } 11 new Teki{x:x, y:y}; 11 12 while (y>0) { 12 13 y=y-rnd(6);y=y+2; -
lang/haxe/Tonyu2/Projects/toste/haxe/Test.hx
r36072 r36087 14 14 } 15 15 case 2: 16 x=(x+ 1);16 x=(x+3); 17 17 y=(y-rnd(5)); 18 18 y=(y+2); … … 22 22 state=1; 23 23 case 3: 24 (function (y,x) {var _res=new Teki();_res.y=y;_res.x=x;return _res;})(y,x); 24 25 state=5; 25 26 case 5: -
lang/haxe/Tonyu2/htdocs/Project.class.js
r36072 r36087 1 1 function procAjax(p) { 2 if (p==null) return function(){};2 if (p==null) return NOP; 3 3 return function (res) { 4 4 try { … … 13 13 return ["div",{style:pos(x,y)},cont]; 14 14 } 15 function NOP(){}; 15 16 var curProject; 16 17 shortcut.add("Ctrl+W",function(){curProject.saveTonyuSource()}); … … 69 70 }); 70 71 function showResponse(res) { 71 t.fileList.set(); 72 t.fileList.set(dButton(function (e) { 73 var cl=prompt('Class Name',''); 74 t.createTonyuSource(e,cl); 75 },"New")); 72 76 res.split(/\n/).each(function (r) { 73 77 t.fileList.add(["div", 74 78 ["a",{onclick: function () { 75 t.openTonyuSource (r);79 t.openTonyuSourceAfterSave(NOP,r); 76 80 }},r]]); 77 81 }); 78 82 } 79 83 }, 80 openTonyuSource: function (n ame) {84 openTonyuSource: function (next, name) { 81 85 var t=this; 82 86 new Ajax.Request( … … 91 95 t.currentSourceName=name; 92 96 t.savedCont=res; 97 next(res); 93 98 } 99 }, 100 openTonyuSourceAfterSave: function (next,name) { 101 var t=this; 102 if (t.editorContentModified()) { 103 //alert(">"+name); 104 t.saveTonyuSource(load); 105 } else { 106 //alert("<"+name); 107 load(); 108 } 109 function load(){t.openTonyuSource(next,name)} 94 110 }, 95 111 updateModifiedIndicator: function () { … … 101 117 return t.savedCont!=t.editor.getAttr("value"); 102 118 }, 103 saveTonyuSourceAs: function (cl,cont,next) { 119 createTonyuSource: function (next, cl) { 120 var t=this 121 t.saveTonyuSourceAs(function(){t.listTonyuSource()}, cl, 122 "extends tonyu.Actor;\n\n"); 123 }, 124 saveTonyuSourceAs: function (next, cl,cont) { 104 125 var t=this; 105 126 new Ajax.Request( … … 121 142 var t=this; 122 143 //alert(t.currentSourceName); 123 if (t.currentSourceName == null) return ;124 t.saveTonyuSourceAs( t.currentSourceName, t.editor.getAttr("value"),next);144 if (t.currentSourceName == null) return next(); 145 t.saveTonyuSourceAs(next, t.currentSourceName, t.editor.getAttr("value") ); 125 146 }, 126 147 make: function (next) {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)