aboutsummaryrefslogtreecommitdiff
path: root/js/components
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-13 08:27:33 -0700
committerValerio Virgillito2012-06-13 08:27:33 -0700
commit5a7774f6769a7a682e21bafe0e57007668f16153 (patch)
tree1f3fdcd64c06335e62c71418333163ea0a57a417 /js/components
parent493485c1ebc4d4034e10b47c161035409e598fcf (diff)
parent5a46f92f3127f7cc7870f125e8da2b44c2891fd0 (diff)
downloadninja-5a7774f6769a7a682e21bafe0e57007668f16153.tar.gz
Merge pull request #291 from joseeight/TempPromptUI
Adding temp prompts
Diffstat (limited to 'js/components')
-rw-r--r--js/components/prompt.reel/prompt.js73
1 files changed, 73 insertions, 0 deletions
diff --git a/js/components/prompt.reel/prompt.js b/js/components/prompt.reel/prompt.js
new file mode 100644
index 00000000..652d7b7e
--- /dev/null
+++ b/js/components/prompt.reel/prompt.js
@@ -0,0 +1,73 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7////////////////////////////////////////////////////////////////////////
8//
9var Montage = require("montage/core/core").Montage,
10 Component = require("montage/ui/component").Component;
11////////////////////////////////////////////////////////////////////////
12//
13exports.NinjaPrompt = Montage.create(Component, {
14 ////////////////////////////////////////////////////////////////////
15 //TODO: This should have an UI template eventually
16 hasTemplate: {
17 value: false
18 },
19 ////////////////////////////////////////////////////////////////////
20 //Type of prompt window (should be confirm, prompt, alert, or input)
21 _type: {
22 value: null
23 },
24 ////////////////////////////////////////////////////////////////////
25 //
26 _params: {
27 value: null
28 },
29 ////////////////////////////////////////////////////////////////////
30 //
31 _callback: {
32 value: null
33 },
34 ////////////////////////////////////////////////////////////////////
35 //
36 initialize: {
37 value: function (type, params, callback) {
38 //
39 this._type = type.toLowerCase();
40 this._params = params;
41 this._callback = callback;
42 }
43 },
44 ////////////////////////////////////////////////////////////////////
45 //
46 show: {
47 value: function () {
48 //
49 var input;
50 //
51 switch (this._type) {
52 case 'confirm':
53 input = confirm(this._params.message);
54 if (this._callback) this._callback(input);
55 break;
56 default:
57 //TODO: Add support for other standard box types
58 break;
59 }
60 }
61 },
62 ////////////////////////////////////////////////////////////////////
63 //This is for later, need to hide if need (overwrite)
64 hide: {
65 value: function () {
66 //TODO: Add support as real UI component
67 }
68 }
69 ////////////////////////////////////////////////////////////////////
70 ////////////////////////////////////////////////////////////////////
71});
72////////////////////////////////////////////////////////////////////////
73//////////////////////////////////////////////////////////////////////// \ No newline at end of file