Refactoring: cleaning directories structure
[fnpeditor.git] / src / editor / modules / indicator / indicator.js
diff --git a/src/editor/modules/indicator/indicator.js b/src/editor/modules/indicator/indicator.js
new file mode 100644 (file)
index 0000000..827a4b7
--- /dev/null
@@ -0,0 +1,35 @@
+define([
+'libs/jquery',
+'libs/underscore',
+'libs/text!./template.html'
+], function($, _, template) {
+
+'use strict';
+
+return function(sandbox) {
+
+    var view = {
+        dom: $(_.template(template)()),
+        setup: function() {
+        
+        }
+    };
+
+    return {
+        start: function() { sandbox.publish('ready'); },
+        getView: function() { return view.dom; },
+        showMessage: function(msg) {
+            view.dom.html('<span>' + msg + '</span>').show();
+        },
+        clearMessage: function(report) {
+            view.dom.empty();
+            if(report && report.message) {
+                view.dom.html('<span class="success">' + report.message + '</span>').show().fadeOut(4000);
+            }
+        }
+        
+    };
+
+};
+
+});