3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
10 console = imports.console;
11 XObject = imports.XObject.XObject;
12 DialogSaveTemplate=new XObject({
15 delete_event : (self, event) => {
19 response : (self, response_id) => {
21 if (response_id < 1) {
25 var name = _this.name.el.get_text();
26 if (name.length < 1) {
27 StandardErrorDialog.show(
28 "You must give the template a name. "
32 if (!Regex.match_simple ("^[A-Za-z]+$", name) ||
33 !Regex.match_simple ("^[A-Za-z ]+$", name) )
35 StandardErrorDialog.show(
36 "Template Nane must contain only letters and spaces. "
40 _this.palete.saveTemplate(name, _this.data);
49 'void:show' : (Palete.Palete palete, JsRender.Node data) {
51 _this.palete = palete;
52 _this.name.el.set_text("");
58 pack : function(p,e) {
59 p.el.get_content_area().add(e.el)
77 pack : "add_action_widget,0"
82 pack : "add_action_widget,1"
86 DialogSaveTemplate.init();
87 XObject.cache['/DialogSaveTemplate'] = DialogSaveTemplate;