projects
/
app.Builder.js
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
resources/RooUsage.txt
[app.Builder.js]
/
src
/
JsRender
/
Roo.vala
diff --git
a/src/JsRender/Roo.vala
b/src/JsRender/Roo.vala
index
004131c
..
25f003c
100644
(file)
--- a/
src/JsRender/Roo.vala
+++ b/
src/JsRender/Roo.vala
@@
-87,11
+87,11
@@
namespace JsRender {
{
{
-
print
("load Items!");
+
GLib.debug
("load Items!");
if (this.tree != null) {
return;
}
if (this.tree != null) {
return;
}
-
print
("load " + this.path);
+
GLib.debug
("load " + this.path);
var pa = new Json.Parser();
pa.load_from_file(this.path);
var pa = new Json.Parser();
pa.load_from_file(this.path);
@@
-136,8
+136,8
@@
namespace JsRender {
public override void save()
{
public override void save()
{
-
print
("--- JsRender.Roo.save");
-
print
("save() - reset transStrings\n");
+
GLib.debug
("--- JsRender.Roo.save");
+
GLib.debug
("save() - reset transStrings\n");
this.transStrings = new Gee.HashMap<string,string>();
this.findTransStrings(this.tree);
this.transStrings = new Gee.HashMap<string,string>();
this.findTransStrings(this.tree);
@@
-185,12
+185,12
@@
namespace JsRender {
{
var top = this.tree.fqn();
{
var top = this.tree.fqn();
-
print
("TOP = " + top + "\n" );
- if (top.index_of("Roo.bootstrap.") < 0 &&
-
top.index_of("Roo.mailer.") < 0
-
) {
-
return;
- }
+
GLib.debug
("TOP = " + top + "\n" );
+ if (top.index_of("Roo.bootstrap.") < 0 &&
+ top.index_of("Roo.mailer.") < 0
+ ) {
+ return;
+ }
//now write the js file..
//now write the js file..
@@
-215,7
+215,7
@@
namespace JsRender {
print("Skip save - templates folder does not exist : %s\n", targetdir);
return;
}
print("Skip save - templates folder does not exist : %s\n", targetdir);
return;
}
- print("SAVE HTML -- %s\n%s\n",targetdir + "/" + bn, html);
+
//
print("SAVE HTML -- %s\n%s\n",targetdir + "/" + bn, html);
try {
this.writeFile(targetdir + "/" + bn , html);
} catch (FileError e ) {
try {
this.writeFile(targetdir + "/" + bn , html);
} catch (FileError e ) {
@@
-276,17
+276,17
@@
namespace JsRender {
var str = iter.get_value();
if (this.doubleStringProps.index_of(kname) > -1) {
var str = iter.get_value();
if (this.doubleStringProps.index_of(kname) > -1) {
-
print
("flag=%s type=%s name=%s : %s\n", kflag,ktype,kname,str);
+
GLib.debug
("flag=%s type=%s name=%s : %s\n", kflag,ktype,kname,str);
this.transStrings.set(str,
this.transStrings.set(str,
- GLib.Checksum.compute_for_string (ChecksumType.MD5, str)
+ GLib.Checksum.compute_for_string (ChecksumType.MD5, str
.strip()
)
);
continue;
}
if (ktype.down() == "string" && kname[0] == '_') {
);
continue;
}
if (ktype.down() == "string" && kname[0] == '_') {
-
print
("flag=%s type=%s name=%s : %s\n", kflag,ktype,kname,str);
+
GLib.debug
("flag=%s type=%s name=%s : %s\n", kflag,ktype,kname,str);
this.transStrings.set(str,
this.transStrings.set(str,
- GLib.Checksum.compute_for_string (ChecksumType.MD5, str)
+ GLib.Checksum.compute_for_string (ChecksumType.MD5, str
.strip()
)
);
continue;
}
);
continue;
}
@@
-306,9
+306,9
@@
namespace JsRender {
public string transStringsToJs()
{
public string transStringsToJs()
{
-
print
("Roo.transStringsToJs()\n");
+
GLib.debug
("Roo.transStringsToJs()\n");
if (this.transStrings.size < 1) {
if (this.transStrings.size < 1) {
-
print
("Roo.transStringsToJs() size < 1?\n");
+
GLib.debug
("Roo.transStringsToJs() size < 1?\n");
return "";
}
return "";
}
@@
-401,6
+401,13
@@
namespace JsRender {
*
*
*/
*
*
*/
+ public override string toSourceCode()
+ {
+ this.transStrings = new Gee.HashMap<string,string>();
+ this.findTransStrings(this.tree);
+ return this.toSource();
+ }
+
public override string toSource()
{
// dump the file tree back out to a string.
public override string toSource()
{
// dump the file tree back out to a string.