client/js/main.js
changeset 647 eaaa1efce396
parent 622 02e3c464223f
child 648 e388117572d8
equal deleted inserted replaced
646:61c45e41a515 647:eaaa1efce396
    99 
    99 
   100         this.options = _.defaults(_opts, Rkns.defaults, {
   100         this.options = _.defaults(_opts, Rkns.defaults, {
   101             templates: _.defaults(_opts.templates, renkanJST) || renkanJST,
   101             templates: _.defaults(_opts.templates, renkanJST) || renkanJST,
   102             node_editor_templates: _.defaults(_opts.node_editor_templates, Rkns.defaults.node_editor_templates)
   102             node_editor_templates: _.defaults(_opts.node_editor_templates, Rkns.defaults.node_editor_templates)
   103         });
   103         });
   104         this.template = renkanJST['templates/main.html'];
   104         this.template = this.options.templates['templates/main.html'];
   105 
   105 
   106         var types_templates = {};
   106         var types_templates = {};
   107         _.each(this.options.node_editor_templates, function(value, key) {
   107         _.each(this.options.node_editor_templates, function(value, key) {
   108             types_templates[key] = _this.options.templates[value];
   108             types_templates[key] = _this.options.templates[value];
   109             delete _this.options.templates[value];
   109             delete _this.options.templates[value];
   150                 this.renderer.redrawUsers();
   150                 this.renderer.redrawUsers();
   151             }
   151             }
   152         });
   152         });
   153 
   153 
   154         this.colorPicker = (function() {
   154         this.colorPicker = (function() {
   155             var _tmpl = renkanJST['templates/colorpicker.html'];
   155             var _tmpl = _this.options.templates['templates/colorpicker.html'];
   156             return '<ul class="Rk-Edit-ColorPicker">' + Rkns.pickerColors.map(function(c) {
   156             return '<ul class="Rk-Edit-ColorPicker">' + Rkns.pickerColors.map(function(c) {
   157                 return _tmpl({
   157                 return _tmpl({
   158                     c: c
   158                     c: c
   159                 });
   159                 });
   160             }).join("") + '</ul>';
   160             }).join("") + '</ul>';
   165         }
   165         }
   166 
   166 
   167         if (!this.options.search.length) {
   167         if (!this.options.search.length) {
   168             this.$.find(".Rk-Web-Search-Form").detach();
   168             this.$.find(".Rk-Web-Search-Form").detach();
   169         } else {
   169         } else {
   170             var _tmpl = renkanJST['templates/search.html'],
   170             var _tmpl = _this.options.templates['templates/search.html'],
   171                 _select = this.$.find(".Rk-Search-List"),
   171                 _select = this.$.find(".Rk-Search-List"),
   172                 _input = this.$.find(".Rk-Web-Search-Input"),
   172                 _input = this.$.find(".Rk-Web-Search-Input"),
   173                 _form = this.$.find(".Rk-Web-Search-Form");
   173                 _form = this.$.find(".Rk-Web-Search-Form");
   174             _.each(this.options.search, function(_search, _key) {
   174             _.each(this.options.search, function(_search, _key) {
   175                 if (Rkns[_search.type] && Rkns[_search.type].Search) {
   175                 if (Rkns[_search.type] && Rkns[_search.type].Search) {