aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-09 14:35:44 -0700
committerValerio Virgillito2012-07-09 14:35:44 -0700
commit84b3327bd92faafab7954b5eb64c7abe24a3fe13 (patch)
tree3f56cbed2f08c5a81ea79eaf0bcb9bd031d8a627 /js/controllers
parentc0a42c56f768a873ba637f5b86d5f6a84d4a3312 (diff)
parent40c6eb2c06b34f65a74d59ef9687251952858bab (diff)
downloadninja-84b3327bd92faafab7954b5eb64c7abe24a3fe13.tar.gz
Merge branch 'normalize' of https://github.com/kriskowal/ninja-internal
Conflicts: js/components/gradientpicker.reel/gradientpicker.js js/components/tools-properties/text-properties.reel/text-properties.js js/document/views/base.js js/document/views/design.js js/helper-classes/3D/StageLine.js js/helper-classes/3D/draw-utils.js js/lib/drawing/world.js js/lib/geom/circle.js js/lib/geom/line.js js/lib/geom/rectangle.js js/lib/geom/shape-primitive.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/flag-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/water-material.js js/panels/Materials/materials-library-panel.reel/materials-library-panel.html js/panels/Materials/materials-library-panel.reel/materials-library-panel.js js/panels/Materials/materials-popup.reel/materials-popup.html js/panels/Materials/materials-popup.reel/materials-popup.js js/tools/LineTool.js Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers')
-rw-r--r--js/controllers/clipboard-controller.js4
-rwxr-xr-xjs/controllers/color-controller.js284
-rwxr-xr-xjs/controllers/document-controller.js160
-rwxr-xr-xjs/controllers/elements/controller-factory.js2
-rwxr-xr-xjs/controllers/elements/element-controller.js30
-rwxr-xr-xjs/controllers/elements/shapes-controller.js4
-rw-r--r--js/controllers/objects-controller.js6
-rwxr-xr-xjs/controllers/selection-controller.js10
-rwxr-xr-xjs/controllers/styles-controller.js276
-rwxr-xr-xjs/controllers/undo-controller.js2
10 files changed, 389 insertions, 389 deletions
diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js
index 74aef060..e3aa76df 100644
--- a/js/controllers/clipboard-controller.js
+++ b/js/controllers/clipboard-controller.js
@@ -30,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
30 30
31//////////////////////////////////////////////////////////////////////// 31////////////////////////////////////////////////////////////////////////
32// 32//
33var Montage = require("montage/core/core").Montage, 33var Montage = require("montage/core/core").Montage,
34 Component = require("montage/ui/component").Component, 34 Component = require("montage/ui/component").Component,
35 ElementsClipboardAgent = require("js/clipboard/internal-ops/elements-clipboard-agent").ElementsClipboardAgent, 35 ElementsClipboardAgent = require("js/clipboard/internal-ops/elements-clipboard-agent").ElementsClipboardAgent,
36 ExternalAppsClipboardAgent= require("js/clipboard/external-apps-clipboard-agent").ExternalAppsClipboardAgent; 36 ExternalAppsClipboardAgent= require("js/clipboard/external-apps-clipboard-agent").ExternalAppsClipboardAgent;
37 37
diff --git a/js/controllers/color-controller.js b/js/controllers/color-controller.js
index c5c614ea..8be2421f 100755
--- a/js/controllers/color-controller.js
+++ b/js/controllers/color-controller.js
@@ -27,16 +27,16 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28POSSIBILITY OF SUCH DAMAGE. 28POSSIBILITY OF SUCH DAMAGE.
29</copyright> */ 29</copyright> */
30 30
31//////////////////////////////////////////////////////////////////////// 31////////////////////////////////////////////////////////////////////////
32// 32//
33var Montage = require("montage/core/core").Montage, 33var Montage = require("montage/core/core").Montage,
34 Component = require("montage/ui/component").Component, 34 Component = require("montage/ui/component").Component,
35 ColorModel = require("js/models/color-model").ColorModel, 35 ColorModel = require("js/models/color-model").ColorModel,
36 ColorPanelBase = require("js/panels/Color/colorpanelbase.reel").ColorPanelBase, 36 ColorPanelBase = require("js/panels/Color/colorpanelbase.reel").ColorPanelBase,
37 ElementsMediator = require("js/mediators/element-mediator").ElementMediator, 37 ElementsMediator = require("js/mediators/element-mediator").ElementMediator,
38 ColorPopupManager = require("js/panels/Color/colorpopup-manager").ColorPopupManager, 38 ColorPopupManager = require("js/panels/Color/colorpopup-manager").ColorPopupManager,
39 ColorButtonManager = require("js/panels/Color/colorbutton-manager").ColorButtonManager; 39 ColorButtonManager = require("js/panels/Color/colorbutton-manager").ColorButtonManager;
40//////////////////////////////////////////////////////////////////////// 40////////////////////////////////////////////////////////////////////////
41//Exporting as ColorController 41//Exporting as ColorController
42exports.ColorController = Montage.create(Component, { 42exports.ColorController = Montage.create(Component, {
@@ -48,14 +48,14 @@ exports.ColorController = Montage.create(Component, {
48 //////////////////////////////////////////////////////////////////// 48 ////////////////////////////////////////////////////////////////////
49 // 49 //
50 deserializedFromTemplate: { 50 deserializedFromTemplate: {
51 value: function () { 51 value: function () {
52 //Setting up colorManager in other classes 52 //Setting up colorManager in other classes
53 this.colorPanelBase.colorManager = this.colorModel; 53 this.colorPanelBase.colorManager = this.colorModel;
54 this.colorPopupManager.colorManager = this.colorModel; 54 this.colorPopupManager.colorManager = this.colorModel;
55 this.colorButtonManager.colorManager = this.colorModel; 55 this.colorButtonManager.colorManager = this.colorModel;
56 //Listening for color changes 56 //Listening for color changes
57 this.colorModel.addEventListener('change', this, false); 57 this.colorModel.addEventListener('change', this, false);
58 } 58 }
59 }, 59 },
60 //////////////////////////////////////////////////////////////////// 60 ////////////////////////////////////////////////////////////////////
61 // 61 //
@@ -90,7 +90,7 @@ exports.ColorController = Montage.create(Component, {
90 //////////////////////////////////////////////////////////////////// 90 ////////////////////////////////////////////////////////////////////
91 // 91 //
92 _popupTab: { 92 _popupTab: {
93 value: 'wheel' 93 value: 'wheel'
94 }, 94 },
95 //////////////////////////////////////////////////////////////////// 95 ////////////////////////////////////////////////////////////////////
96 // 96 //
@@ -131,7 +131,7 @@ exports.ColorController = Montage.create(Component, {
131 //////////////////////////////////////////////////////////////////// 131 ////////////////////////////////////////////////////////////////////
132 // 132 //
133 _fill: { 133 _fill: {
134 value: null 134 value: null
135 }, 135 },
136 //////////////////////////////////////////////////////////////////// 136 ////////////////////////////////////////////////////////////////////
137 // 137 //
@@ -142,7 +142,7 @@ exports.ColorController = Montage.create(Component, {
142 //////////////////////////////////////////////////////////////////// 142 ////////////////////////////////////////////////////////////////////
143 // 143 //
144 _stroke: { 144 _stroke: {
145 value: null 145 value: null
146 }, 146 },
147 //////////////////////////////////////////////////////////////////// 147 ////////////////////////////////////////////////////////////////////
148 // 148 //
@@ -154,16 +154,16 @@ exports.ColorController = Montage.create(Component, {
154 // 154 //
155 getBackground: { 155 getBackground: {
156 value: function (element) { 156 value: function (element) {
157 //TODO: Return object with all background properties 157 //TODO: Return object with all background properties
158 console.log(ElementsMediator.getProperty(element, 'background-color')); 158 console.log(ElementsMediator.getProperty(element, 'background-color'));
159 console.log(ElementsMediator.getProperty(element, 'background-image')); 159 console.log(ElementsMediator.getProperty(element, 'background-image'));
160 } 160 }
161 }, 161 },
162 //////////////////////////////////////////////////////////////////// 162 ////////////////////////////////////////////////////////////////////
163 // 163 //
164 getBorder: { 164 getBorder: {
165 value: function (element) { 165 value: function (element) {
166 166
167 } 167 }
168 }, 168 },
169 //////////////////////////////////////////////////////////////////// 169 ////////////////////////////////////////////////////////////////////
@@ -189,14 +189,14 @@ exports.ColorController = Montage.create(Component, {
189 // 189 //
190 handleChange: { 190 handleChange: {
191 value: function (e) { 191 value: function (e) {
192 // 192 //
193 var color, input = e._event.input, panelMode, mode = e._event.mode; 193 var color, input = e._event.input, panelMode, mode = e._event.mode;
194 if (this.colorView) { 194 if (this.colorView) {
195 panelMode = this.colorView.panelMode; 195 panelMode = this.colorView.panelMode;
196 } 196 }
197 // 197 //
198 if (mode === 'nocolor') { 198 if (mode === 'nocolor') {
199 color = {value: null, css: 'none'}; 199 color = {value: null, css: 'none'};
200 } else if (panelMode === 'rgb' && e._event.rgba && mode !== 'gradient') { 200 } else if (panelMode === 'rgb' && e._event.rgba && mode !== 'gradient') {
201 color = e._event.rgba; 201 color = e._event.rgba;
202 color.webGlColor = e._event.webGlColor; 202 color.webGlColor = e._event.webGlColor;
@@ -206,7 +206,7 @@ exports.ColorController = Montage.create(Component, {
206 } else if (mode !== 'gradient'){ 206 } else if (mode !== 'gradient'){
207 color = {value: e._event.hex, css: '#'+e._event.hex}; 207 color = {value: e._event.hex, css: '#'+e._event.hex};
208 } else if (mode === 'gradient'){ 208 } else if (mode === 'gradient'){
209 color = e._event.value.value; 209 color = e._event.value.value;
210 } 210 }
211 color.mode = panelMode; 211 color.mode = panelMode;
212 color.wasSetByCode = true; 212 color.wasSetByCode = true;
@@ -215,15 +215,15 @@ exports.ColorController = Montage.create(Component, {
215 //////////////////////////////////////////////////////////// 215 ////////////////////////////////////////////////////////////
216 // 216 //
217 if (input === 'fill') { 217 if (input === 'fill') {
218 // 218 //
219 this.fill = color; 219 this.fill = color;
220 // 220 //
221 if(e._event.wasSetByCode) return; 221 if(e._event.wasSetByCode) return;
222 // 222 //
223 this.setColor(mode, color, true); 223 this.setColor(mode, color, true);
224 } else if (input === 'stroke') { 224 } else if (input === 'stroke') {
225 // 225 //
226 this.stroke = color; 226 this.stroke = color;
227 // 227 //
228 if(e._event.wasSetByCode) return; 228 if(e._event.wasSetByCode) return;
229 229
@@ -237,93 +237,93 @@ exports.ColorController = Montage.create(Component, {
237 //Converts CSS to a color object to be used by the color model 237 //Converts CSS to a color object to be used by the color model
238 getColorObjFromCss: { 238 getColorObjFromCss: {
239 value: function (css) { 239 value: function (css) {
240 // 240 //
241 var color, arr, i, j, temp, c, gradient; 241 var color, arr, i, j, temp, c, gradient;
242 //console.log(css.indexOf('-webkit'), css); 242 //console.log(css.indexOf('-webkit'), css);
243 if (css && css.indexOf('-webkit') >= 0) { 243 if (css && css.indexOf('-webkit') >= 0) {
244 // 244 //
245 gradient = {mode: null, stops: null}; 245 gradient = {mode: null, stops: null};
246 //Checking for gradient type 246 //Checking for gradient type
247 if (css.indexOf('-webkit-radial-gradient') >= 0) { 247 if (css.indexOf('-webkit-radial-gradient') >= 0) {
<