aboutsummaryrefslogtreecommitdiff
path: root/js/components/about-box.reel/about-box.js
diff options
context:
space:
mode:
authorPushkar Joshi2012-02-24 12:08:49 -0800
committerPushkar Joshi2012-02-24 12:08:49 -0800
commit03ca7a5ed13c25faaa9100bb666e062fd15335e6 (patch)
treec51112223ceb9121cd595a60335eb2795215590f /js/components/about-box.reel/about-box.js
parentfcb12cc09eb3cd3b42bd215877ba18f449275b75 (diff)
parent053fc63a2950c7a5ee4ebf98033b64d474a3c46e (diff)
downloadninja-03ca7a5ed13c25faaa9100bb666e062fd15335e6.tar.gz
Merge branch 'pentool' into brushtool
Conflicts: imports/codemirror/mode/scheme/scheme.js js/tools/BrushTool.js
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});