diff options
Diffstat (limited to 'node_modules/montage/ui/rich-text-editor/overlays')
6 files changed, 1096 insertions, 0 deletions
diff --git a/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.css b/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.css new file mode 100644 index 00000000..db04d0ff --- /dev/null +++ b/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.css | |||
@@ -0,0 +1,31 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | .montage-link-popup { | ||
8 | position: absolute; | ||
9 | padding: 12px 20px; | ||
10 | border: 1px solid; | ||
11 | |||
12 | -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.2); | ||
13 | -moz-box-shadow: 0 1px 3px rgba(0,0,0,.2); | ||
14 | box-shadow: 0 1px 3px rgba(0,0,0,.2); | ||
15 | -webkit-border-radius: 2px; | ||
16 | -moz-border-radius: 2px; | ||
17 | border-radius: 2px; | ||
18 | border-color: #BBB #BBB #A8A8A8; | ||
19 | |||
20 | background-color: white; | ||
21 | color: #666; | ||
22 | font: 13px/normal "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
23 | |||
24 | cursor: default; | ||
25 | } | ||
26 | |||
27 | .montage-link-popup a { | ||
28 | cursor: pointer; | ||
29 | text-decoration: none; | ||
30 | color: #15C; | ||
31 | } \ No newline at end of file | ||
diff --git a/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.html b/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.html new file mode 100644 index 00000000..1e2ec2cc --- /dev/null +++ b/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.html | |||
@@ -0,0 +1,37 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | <html> | ||
8 | <head> | ||
9 | <title></title> | ||
10 | <link rel="stylesheet" type="text/css" href="rich-text-linkpopup.css"> | ||
11 | <script type="text/montage-serialization"> | ||
12 | { | ||
13 | "link": { | ||
14 | "module": "montage/ui/anchor.reel", | ||
15 | "name": "Anchor", | ||
16 | "properties": { | ||
17 | "element": {"#": "link"} | ||
18 | } | ||
19 | }, | ||
20 | |||
21 | "owner": { | ||
22 | "module": "montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel", | ||
23 | "name": "RichTextLinkPopup", | ||
24 | "properties": { | ||
25 | "element": {"#": "linkpopup-container"}, | ||
26 | "link": {"@": "link"} | ||
27 | } | ||
28 | } | ||
29 | } | ||
30 | </script> | ||
31 | </head> | ||
32 | <body> | ||
33 | <div id="linkpopup-container" class="montage-link-popup" contentEditable="false"> | ||
34 | <a id="link" target="_blank"></a> | ||
35 | </div> | ||
36 | </body> | ||
37 | </html> | ||
diff --git a/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.js b/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.js new file mode 100644 index 00000000..90342d81 --- /dev/null +++ b/node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.js | |||
@@ -0,0 +1,274 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | @module "montage/ui/rich-text-editor/overlays/rich-text-resizer.reel" | ||
8 | @requires montage/core/core | ||
9 | @requires montage/ui/component | ||
10 | */ | ||
11 | var Montage = require("montage").Montage, | ||
12 | Component = require("ui/component").Component; | ||
13 | |||
14 | /** | ||
15 | @class module:"montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel".RichTextLinkPopup | ||
16 | @extends module:montage/ui/component.Component | ||
17 | */ | ||
18 | exports.RichTextLinkPopup = Montage.create(Component,/** @lends module:"montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel".RichTextLinkPopup# */ { | ||
19 | |||
20 | /** | ||
21 | Description TODO | ||
22 | @private | ||
23 | */ | ||
24 | _isActive: { | ||
25 | enumerable: false, | ||
26 | value: false | ||
27 | }, | ||
28 | /** | ||
29 | Description TODO | ||
30 | @private | ||
31 | */ | ||
32 | _editor: { | ||
33 | enumerable: false, | ||
34 | value: null | ||
35 | }, | ||
36 | |||
37 | /** | ||
38 | Description TODO | ||
39 | @private | ||
40 | */ | ||
41 | target: { | ||
42 | enumerable: false, | ||
43 | value: null | ||
44 | }, | ||
45 | |||
46 | /** | ||
47 | Description TODO | ||
48 | @private | ||
49 | */ | ||
50 | _needsReset: { | ||
51 | enumerable: false, | ||
52 | value: false | ||
53 | }, | ||
54 | |||
55 | /** | ||
56 | Description TODO | ||
57 | @type {Function} | ||
58 | */ | ||
59 | initWithEditor: { | ||
60 | value: function(editor) { | ||
61 | this._editor = editor; | ||
62 | } | ||
63 | }, | ||
64 | |||
65 | /** | ||
66 | Description TODO | ||
67 | @type {Function} | ||
68 | */ | ||
69 | editorMouseUp: { | ||
70 | value: function(event) { | ||
71 | var element; | ||
72 | |||
73 | if (this._editor.activeOverlay != this) { | ||
74 | // Check if the caret is inside an image within an anchor element | ||
75 | if (event.target.nodeName == "IMG") { | ||
76 | element = event.target; | ||
77 | while (element && element != this._element) { | ||
78 | if (element.nodeName == "A") { | ||
79 | if (element != this.target) { | ||
80 | this.target = element; | ||
81 | this._needsReset = true; | ||
82 | if (this._isActive) { | ||
83 | this.needsDraw = true; | ||
84 | } else { | ||
85 | this._editor.showOverlay(this); | ||
86 | } | ||
87 | } | ||
88 | return true; | ||
89 | } | ||
90 | element = element.parentElement; | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | }, | ||
96 | |||
97 | /** | ||
98 | Description TODO | ||
99 | @type {Function} | ||
100 | */ | ||
101 | editorTouchEnd: { | ||
102 | value: function(event) { | ||
103 | this.editorMouseUp(event); | ||
104 | } | ||
105 | }, | ||