aboutsummaryrefslogtreecommitdiff
path: root/js/components
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-13 13:38:09 -0700
committerValerio Virgillito2012-06-13 13:38:09 -0700
commita827f2769d75848c0ba0bff03a927c1f2706322b (patch)
treedbd9ec47cd2828bfa43c6b6a69ff9e82d5e03377 /js/components
parenta75947d69f571d723552f926f94d195514a01cbd (diff)
parent5a7774f6769a7a682e21bafe0e57007668f16153 (diff)
downloadninja-a827f2769d75848c0ba0bff03a927c1f2706322b.tar.gz
Merge branch 'refs/heads/master' into montage-v10-integration
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