}
- /*
- setNSID : function(id)
- {
-
- this.items[0]['|module'] = id;
-
-
- },
-
-
- getType: function() {
- return 'Roo';
- },
-
- */
+
- public override void removeFiles() {
- var html = GLib.Path.get_dirname(this.path) +"/templates/" + name + ".html";
- if (FileUtils.test(html, FileTest.EXISTS)) {
- GLib.FileUtils.remove(html);
- }
- var js = GLib.Path.get_dirname(this.path) +"/" + name + ".html";
- if (FileUtils.test(js, FileTest.EXISTS)) {
- GLib.FileUtils.remove(js);
+ public override void removeFiles() {
+ var html = GLib.Path.get_dirname(this.path) +"/templates/" + name + ".html";
+ if (FileUtils.test(html, FileTest.EXISTS)) {
+ GLib.FileUtils.remove(html);
+ }
+ var js = GLib.Path.get_dirname(this.path) +"/" + name + ".html";
+ if (FileUtils.test(js, FileTest.EXISTS)) {
+ GLib.FileUtils.remove(js);
+ }
}
- }
public override void loadItems() throws GLib.Error // : function(cb, sync) == original was async.
{
- print("load Items!");
+ GLib.debug("load Items!");
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);
this.tree.loadFromJson(tree_base, int.parse(bjs_version_str));
}
this.loaded = true;
-
+ this.toSource(); // force it to number the lines...
}
if (kflag == "$") {
continue;
}
+ // skip cms-id nodes...
+ if (kname == "html" && node.has("cms-id")) {
+ continue;
+ }
+
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);
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] == '_') {
print("flag=%s type=%s name=%s : %s\n", kflag,ktype,kname,str);
this.transStrings.set(str,
- GLib.Checksum.compute_for_string (ChecksumType.MD5, str)
+ GLib.Checksum.compute_for_string (ChecksumType.MD5, str.strip())
);
continue;
}
*
*
*/
+ 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.
if (top == null) {
return "";
}
- // get the translatable strings..
+ // get the translatable strings.. = we reload them again so calling methods get the right data...
+ this.transStrings = new Gee.HashMap<string,string>();
+ this.findTransStrings(this.tree);
+
+
if (top.contains("Dialog")) {
return this.toSourceDialog(false);
}
return "";
}
var x = new NodeToJs(this.tree, this.doubleStringProps, pad, null);
+ x.renderer = this;
x.cur_line = prefix.split("\n").length;
var ret = x.munge();