aboutsummaryrefslogtreecommitdiff
path: root/js/components/about-box.reel/about-box.js
diff options
context:
space:
mode:
authormayhewinator2012-02-14 10:53:56 -0800
committermayhewinator2012-02-14 10:53:56 -0800
commitf766cc203f30ea43ae8b83cf4b65d45cc4435ee9 (patch)
tree6113587f513fe191fb3538bdce1dc4874e583c93 /js/components/about-box.reel/about-box.js
parent1d82f1a041612f32bbf6c9f20d9fb14e2d11fcc7 (diff)
parent65cb57d19c7ff0a8b143c40caa4a227b9e7fd87b (diff)
downloadninja-f766cc203f30ea43ae8b83cf4b65d45cc4435ee9.tar.gz
Merge pull request #40 from mayhewinator/WorkingBranch
Implemented about box dialog
Diffstat (limited to 'js/components/about-box.reel/about-box.js')
-rw-r--r--js/components/about-box.reel/about-box.js76
1 files changed, 76 insertions, 0 deletions
diff --git a/js/components/about-box.reel/about-box.js b/js/components/about-box.reel/about-box.js
new file mode 100644
index 00000000..1a0825ff
--- /dev/null
+++ b/js/components/about-box.reel/about-box.js
@@ -0,0 +1,76 @@
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
7var Montage = require("montage/core/core").Montage,
8Component = require("montage/ui/component").Component,
9Popup = require("montage/ui/popup/popup.reel").Popup;
10
11var AboutBox = exports.AboutBox = Montage.create(Component, {
12 _ninjaVersionString: {
13 enumerable: false,
14 value: null
15 },
16
17 _popup: {
18 enumerable: false,
19 value: null
20 },
21
22 captureMouseup: {
23 value: function(event) {
24 document.removeEventListener("mouseup", this, true);
25 this._popup.hide();
26 }
27 },
28
29 captureMousedown: {
30 value: function(event) {
31 // ignore clicks on our links to the license, credits or project page
32 if(event._event.srcElement.className !== 'aboutBoxAnchor') {
33 document.addEventListener("mouseup", this, true);
34 document.removeEventListener("mousedown", this, true);
35 }
36 }
37 },
38
39 prepareForDraw: {
40 value: function() {
41 if(this._ninjaVersionString == null) {
42 this._ninjaVersionString = this.application.ninja.ninjaVersion;
43 }
44
45 if(this._ninjaVersionString) {
46 var verNum = document.getElementById("aboutBoxVersionNumber");
47 if(verNum) {
48 verNum.innerHTML = this._ninjaVersionString;
49 }
50 }
51 }
52 },
53 draw: {
54 enumerable: false,
55 value: function() {
56 }
57 },
58
59 show: {
60 value: function() {
61 document.addEventListener("mousedown", this, true);
62 var popup = this.application._alertPopup, about;
63 if(!popup) {
64 popup = Popup.create();
65 this._popup = popup;
66
67 popup.modal = true;
68 this.application._alertPopup = popup;
69
70 about = AboutBox.create();
71 popup.content = about;
72 }
73 popup.show();
74 }
75 }
76});