007dcffb38686081cfb728fa1c1fe2c7838bdb59
[fnpeditor.git] / modules / indicator / indicator.js
1 define([\r
2 'libs/jquery-1.9.1.min',\r
3 'libs/underscore-min',\r
4 'libs/text!./template.html'\r
5 ], function($, _, template) {\r
6 \r
7 'use strict';\r
8 \r
9 return function(sandbox) {\r
10 \r
11     var view = {\r
12         dom: $(_.template(template)()),\r
13         setup: function() {\r
14         \r
15         }\r
16     };\r
17 \r
18     return {\r
19         start: function() { sandbox.publish('ready'); },\r
20         getView: function() { return view.dom; },\r
21         showMessage: function(msg) {\r
22             view.dom.html('<span>' + msg + '</span>').show();\r
23         },\r
24         clearMessage: function(report) {\r
25             view.dom.empty();\r
26             if(report && report.message) {\r
27                 view.dom.html('<span class="success">' + report.message + '</span>').show().fadeOut(4000);\r
28             }\r
29         }\r
30         \r
31     };\r
32 \r
33 };\r
34 \r
35 });\r