diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/PluginManager.py | 6 | ||||
-rw-r--r-- | module/remote/wsbackend/ApiHandler.py | 3 | ||||
-rw-r--r-- | module/web/static/js/views/modal/modalView.js | 12 | ||||
-rw-r--r-- | module/web/static/js/views/packageTreeView.js | 8 | ||||
-rw-r--r-- | module/web/templates/default/dashboard.html | 6 |
5 files changed, 20 insertions, 15 deletions
diff --git a/module/PluginManager.py b/module/PluginManager.py index 81a5ee81c..2bd438c37 100644 --- a/module/PluginManager.py +++ b/module/PluginManager.py @@ -49,6 +49,8 @@ class PluginManager: # note the nongreedy character: that means we can not embed list and dicts MULTI = re.compile(r'__(?P<attr>[a-z0-9_]+)__\s*=\s*((?:\{|\[|"{3}).*?(?:"""|\}|\]))', re.DOTALL | re.M | re.I) + NO_MATCH = re.compile(r'^no_match$') + def __init__(self, core): self.core = core @@ -178,8 +180,8 @@ class PluginManager: plugin_re = re.compile(attrs["pattern"]) except: self.logDebug(folder, name, "Invalid regexp pattern '%s'" % attrs["pattern"]) - plugin_re = None - else: plugin_re = None + plugin_re = self.NO_MATCH + else: plugin_re = self.NO_MATCH deps = attrs.get("dependencies", None) diff --git a/module/remote/wsbackend/ApiHandler.py b/module/remote/wsbackend/ApiHandler.py index 8f6bb3a0a..478ea6de0 100644 --- a/module/remote/wsbackend/ApiHandler.py +++ b/module/remote/wsbackend/ApiHandler.py @@ -64,7 +64,7 @@ class ApiHandler: if type(o) != list and len(o) > 2: self.log.debug("Invalid Api call: %s" % o) return self.send_result(req, 500, "Invalid Api call") - if len(o) == 1: # arguments ommited + if len(o) == 1: # arguments omitted o.append([]) func, args = o @@ -100,6 +100,7 @@ class ApiHandler: except Exception, e: return self.send_result(req, 500, str(e)) + # None is invalid json type if result is None: result = True return self.send_result(req, 200, result) diff --git a/module/web/static/js/views/modal/modalView.js b/module/web/static/js/views/modal/modalView.js index b20aab57d..297808ead 100644 --- a/module/web/static/js/views/modal/modalView.js +++ b/module/web/static/js/views/modal/modalView.js @@ -32,21 +32,19 @@ define(['jquery', 'backbone', 'underscore', 'text!tpl/default/modal.html', 'omni }); }, show: function(subjects, internalCallback) { - subjects.overlay.fadeIn(250, function() { - internalCallback(subjects); - }); + subjects.overlay.fadeIn(300); + internalCallback(subjects); }}}, modal: { hideClass: 'hide', animations: { hide: function(subjects, internalCallback) { - subjects.modal.transition({opacity: 'hide', scale: 0.7}, 250, function() { - internalCallback(subjects); - }); + subjects.modal.transition({opacity: 'hide', scale: 0.7}, 300); + internalCallback(subjects); }, show: function(subjects, internalCallback) { - subjects.modal.transition({opacity: 'show', scale: 1}, 250, function() { + subjects.modal.transition({opacity: 'show', scale: 1}, 400, function() { internalCallback(subjects); }); }} diff --git a/module/web/static/js/views/packageTreeView.js b/module/web/static/js/views/packageTreeView.js index 30f159cf7..3cef27601 100644 --- a/module/web/static/js/views/packageTreeView.js +++ b/module/web/static/js/views/packageTreeView.js @@ -4,7 +4,7 @@ define(['jquery', 'backbone', 'underscore', 'models/TreeCollection', 'views/pack // Renders whole PackageView return Backbone.View.extend({ - el: '#content', + el: '#dashboard', events: { 'click #add': 'addPackage', @@ -27,6 +27,7 @@ define(['jquery', 'backbone', 'underscore', 'models/TreeCollection', 'views/pack var packs = this.tree.get('packages'), files = this.tree.get('files'); + this.$el.empty() this.$el.append($('<span>Root: ' + this.tree.get('root').get('name') + ' </span>')); this.$el.append($('<input id="name" type="text" size="20">')); this.$el.append($('<a id="add" href="#"> Add</a><br>')); @@ -57,9 +58,10 @@ define(['jquery', 'backbone', 'underscore', 'models/TreeCollection', 'views/pack addPackage: function() { var self = this; var settings = { + type: 'POST', data: { - name: '"' + $('#name').val() + '"', - links: '["some link"]' + name: JSON.stringify($('#name').val()), + links: JSON.stringify(['some link']) }, success: function() { self.tree.fetch({success: function() { diff --git a/module/web/templates/default/dashboard.html b/module/web/templates/default/dashboard.html index 05f5b85a3..adcc6dc71 100644 --- a/module/web/templates/default/dashboard.html +++ b/module/web/templates/default/dashboard.html @@ -11,7 +11,7 @@ <ul id="dash-nav" class="nav nav-pills">
<li>
<ul class="breadcrumb">
- <li><a href="#">Home</a> <span class="divider">/</span></li>
+ <li><a href="#">{{ _("Home") }}</a> <span class="divider">/</span></li>
<li><a href="#">Library</a> <span class="divider">/</span></li>
<li class="active">Data</li>
</ul>
@@ -60,6 +60,8 @@ <li class="active" style="float: right;">
<a>All</a>
</li>
-
</ul>
+ <div id="dashboard">
+ {# Build up by js #}
+ </div>
{% endblock %}
\ No newline at end of file |