From 04343eda8c2f870b0da55cfdc8003c99fe1cc4de Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:53:10 -0700 Subject: Remove trailing spaces --- js/components/SliderBase.js | 2 +- js/components/colorwheel.reel/colorwheel.js | 4 +- js/components/combobox.reel/combobox.js | 4 +- js/components/core/class-uuid.js | 2 +- js/components/editable.reel/editable.js | 38 +- .../gradientpicker.reel/gradientpicker.js | 6 +- js/components/hintable.reel/hintable.js | 62 +-- js/components/hottext.reel/hottext.js | 4 +- .../layout/document-bar.reel/document-bar.js | 2 +- js/components/layout/tools-list.reel/tools-list.js | 2 +- .../tools-properties.reel/tools-properties.js | 2 +- js/components/prompt.reel/prompt.js | 2 +- js/components/radio.reel/radio.js | 2 +- js/components/slider.reel/slider.js | 10 +- js/components/textfield.reel/textfield.js | 2 +- js/components/toolbar.reel/toolbar.js | 2 +- .../eraser-properties.reel/eraser-properties.js | 2 +- .../eyedropper-properties.js | 2 +- .../line-properties.reel/line-properties.js | 2 +- .../oval-properties.reel/oval-properties.js | 6 +- .../pan-properties.reel/pan-properties.js | 2 +- .../pen-properties.reel/pen-properties.js | 2 +- .../rect-properties.reel/rect-properties.js | 2 +- .../rotate-stage-properties.js | 2 +- .../shape-properties.reel/shape-properties.js | 2 +- .../tag-properties.reel/tag-properties.js | 2 +- .../text-properties.reel/text-properties.js | 4 +- js/components/tools-properties/tool-properties.js | 2 +- .../treeview/ninja-branch.reel/ninja-branch.js | 22 +- js/components/ui/input-group.reel/input-group.js | 4 +- .../ui/property-control.reel/property-control.js | 2 +- js/controllers/color-controller.js | 8 +- js/controllers/document-controller.js | 4 +- js/controllers/elements/element-controller.js | 8 +- js/controllers/elements/shapes-controller.js | 2 +- js/controllers/objects-controller.js | 6 +- js/controllers/styles-controller.js | 276 +++++----- js/controllers/undo-controller.js | 2 +- js/data/tools-data.js | 4 +- js/document/controllers/document.js | 2 +- js/document/document-html.js | 2 +- js/document/document-text.js | 2 +- js/document/helpers/url-parser.js | 2 +- js/document/helpers/webgl-helper.js | 4 +- js/document/mediators/io.js | 2 +- js/document/mediators/template.js | 180 +++---- js/document/models/base.js | 4 +- js/document/models/html.js | 4 +- js/document/models/text.js | 2 +- js/document/views/base.js | 2 +- js/document/views/design.js | 4 +- js/helper-classes/3D/Rectangle.js | 2 +- js/helper-classes/3D/draw-utils.js | 6 +- js/helper-classes/3D/hit-record.js | 2 +- js/helper-classes/3D/math-utils.js | 6 +- js/helper-classes/3D/snap-2d-record.js | 4 +- js/helper-classes/3D/snap-manager.js | 40 +- js/helper-classes/3D/vec-utils.js | 4 +- js/helper-classes/3D/view-utils.js | 18 +- .../RDGE/src/core/script/MeshManager.js | 42 +- .../RDGE/src/core/script/RenderInitProcs.js | 4 +- .../RDGE/src/core/script/animation.js | 54 +- js/helper-classes/RDGE/src/core/script/camera.js | 24 +- js/helper-classes/RDGE/src/core/script/engine.js | 44 +- js/helper-classes/RDGE/src/core/script/fx/blur.js | 8 +- js/helper-classes/RDGE/src/core/script/fx/ssao.js | 8 +- js/helper-classes/RDGE/src/core/script/jpass.js | 8 +- js/helper-classes/RDGE/src/core/script/jshader.js | 20 +- .../RDGE/src/core/script/math/mat4.js | 26 +- .../RDGE/src/core/script/math/quat.js | 6 +- .../RDGE/src/core/script/math/vec2.js | 6 +- .../RDGE/src/core/script/math/vec3.js | 22 +- .../RDGE/src/core/script/math/vec4.js | 4 +- .../RDGE/src/core/script/objectManager.js | 24 +- js/helper-classes/RDGE/src/core/script/particle.js | 12 +- .../RDGE/src/core/script/precompiled.js | 10 +- .../RDGE/src/core/script/renderUtils.js | 6 +- js/helper-classes/RDGE/src/core/script/renderer.js | 26 +- .../RDGE/src/core/script/scenegraph.js | 22 +- .../RDGE/src/core/script/scenegraphNodes.js | 192 +++---- .../RDGE/src/core/script/shadowLight.js | 2 +- js/helper-classes/RDGE/src/core/script/sockets.js | 8 +- .../RDGE/src/core/script/utilities.js | 26 +- js/io/system/chromeapi.js | 4 +- js/io/system/coreioapi.js | 14 +- js/io/system/fileio.js | 6 +- js/io/system/ninjalibrary.js | 12 +- .../picker-navigator.reel/picker-navigator.js | 4 +- .../new-file-options-navigator.js | 2 +- js/lib/NJUtils.js | 40 +- js/lib/drawing/world.js | 66 +-- js/lib/geom/anchor-point.js | 12 +- js/lib/geom/brush-stroke.js | 6 +- js/lib/geom/circle.js | 2 +- js/lib/geom/geom-obj.js | 2 +- js/lib/geom/shape-primitive.js | 2 +- js/lib/geom/sub-path.js | 4 +- js/lib/math/matrix.js | 4 +- js/lib/rdge/materials/bump-metal-material.js | 16 +- js/lib/rdge/materials/cloud-material.js | 20 +- js/lib/rdge/materials/deform-material.js | 10 +- js/lib/rdge/materials/flag-material.js | 12 +- js/lib/rdge/materials/flat-material.js | 8 +- js/lib/rdge/materials/fly-material.js | 10 +- js/lib/rdge/materials/julia-material.js | 10 +- js/lib/rdge/materials/keleidoscope-material.js | 10 +- js/lib/rdge/materials/linear-gradient-material.js | 32 +- js/lib/rdge/materials/mandel-material.js | 10 +- js/lib/rdge/materials/material.js | 12 +- js/lib/rdge/materials/plasma-material.js | 10 +- js/lib/rdge/materials/pulse-material.js | 12 +- js/lib/rdge/materials/radial-gradient-material.js | 6 +- js/lib/rdge/materials/taper-material.js | 2 +- js/lib/rdge/materials/tunnel-material.js | 10 +- js/lib/rdge/materials/twist-vert-material.js | 4 +- js/lib/rdge/materials/uber-material.js | 14 +- js/lib/rdge/materials/water-material.js | 2 +- js/lib/rdge/texture.js | 18 +- js/mediators/drag-drop-mediator.js | 2 +- js/mediators/io-mediator.js | 4 +- js/mediators/keyboard-mediator.js | 2 +- js/models/color-model.js | 4 +- js/models/materials-model.js | 14 +- js/ninja.reel/ninja.js | 14 +- js/panels/CSSPanel/CSSPanel.js | 2 +- .../CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | 558 ++++++++++----------- .../ComputedStyleSubPanel.js | 30 +- js/panels/CSSPanel/css-shorthand-map.js | 22 +- .../materials-library-panel.js | 2 +- .../materials-popup.reel/materials-popup.js | 12 +- js/panels/PanelContainer.reel/PanelContainer.js | 16 +- js/panels/Project/ProjectPanel.js | 2 +- .../projectpanelbase.reel/ProjectPanelBase.js | 292 +++++------ js/panels/Resizer.js | 30 +- js/panels/Timeline/Collapser.js | 94 ++-- js/panels/Timeline/EasingMenu.reel/EasingMenu.js | 32 +- js/panels/Timeline/Keyframe.reel/Keyframe.js | 8 +- js/panels/Timeline/Layer.reel/Layer.js | 140 +++--- .../Timeline/PropertyTrack.reel/PropertyTrack.js | 2 +- js/panels/Timeline/Span.reel/Span.js | 36 +- js/panels/Timeline/Style.reel/Style.js | 60 +-- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 336 ++++++------- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 72 +-- js/panels/Timeline/Track.reel/Track.js | 4 +- js/panels/Timeline/Tween.reel/Tween.js | 12 +- .../edit-binding-view.reel/edit-binding-view.js | 2 +- js/panels/color/colorbutton-manager.js | 2 +- .../color/colorpanelbase.reel/colorpanelbase.js | 66 +-- .../color/colorpanelpopup.reel/colorpanelpopup.js | 4 +- js/panels/color/colorpopup-manager.js | 28 +- js/panels/css-panel/css-style.reel/css-style.js | 2 +- .../rule-list-container.js | 4 +- .../style-sheets-view.reel/style-sheets-view.js | 8 +- js/panels/objects/object.reel/object.js | 2 +- js/panels/properties.reel/properties.js | 4 +- .../properties.reel/sections/custom.reel/custom.js | 4 +- .../sections/three-d-view.reel/three-d-view.js | 2 +- js/stage/layout.js | 4 +- js/stage/objects-tray.reel/objects-tray.js | 10 +- js/stage/stage.reel/stage.js | 2 +- js/stage/tool-handle.js | 28 +- js/tools/BrushTool.js | 2 +- js/tools/LineTool.js | 2 +- js/tools/OvalTool.js | 2 +- js/tools/PanTool.js | 8 +- js/tools/PenTool.js | 44 +- js/tools/Rotate3DToolBase.js | 14 +- js/tools/TextTool.js | 2 +- js/tools/ToolBase.js | 6 +- js/tools/Translate3DToolBase.js | 10 +- js/tools/TranslateObject3DTool.js | 4 +- js/tools/drawing-tool-base.js | 10 +- js/tools/drawing-tool.js | 8 +- js/tools/modifier-tool-base.js | 22 +- 174 files changed, 1963 insertions(+), 1963 deletions(-) (limited to 'js') diff --git a/js/components/SliderBase.js b/js/components/SliderBase.js index 5a12fcb6..30bba8de 100755 --- a/js/components/SliderBase.js +++ b/js/components/SliderBase.js @@ -88,7 +88,7 @@ var SliderBase = exports.SliderBase = Montage.create(Component, { if(this._enabled) { this.element.classList.remove("disabled"); - + this.element.addEventListener("blur", this); this.element.addEventListener("focus", this); diff --git a/js/components/colorwheel.reel/colorwheel.js b/js/components/colorwheel.reel/colorwheel.js index 97a1751d..d2664f14 100755 --- a/js/components/colorwheel.reel/colorwheel.js +++ b/js/components/colorwheel.reel/colorwheel.js @@ -270,7 +270,7 @@ exports.ColorWheel = Montage.create(Component, { // this._isMouseDown = true; // - if ((e.offsetY < this._math.swatchPosition || e.offsetY > this._math.swatchLength+this._math.swatchPosition) || (e.offsetX < this._math.swatchPosition || e.offsetX > this._math.swatchLength+this._math.swatchPosition)) { + if ((e.offsetY < this._math.swatchPosition || e.offsetY > this._math.swatchLength+this._math.swatchPosition) || (e.offsetX < this._math.swatchPosition || e.offsetX > this._math.swatchLength+this._math.swatchPosition)) { this._scanningMode = 'wheel'; } else { this._scanningMode = 'swatch'; @@ -283,7 +283,7 @@ exports.ColorWheel = Montage.create(Component, { value: function(e) { var math = this._math; // - if ((e.offsetY < math.swatchPosition || e.offsetY > math.swatchLength+math.swatchPosition) || (e.offsetX < math.swatchPosition || e.offsetX > math.swatchLength+math.swatchPosition)) { + if ((e.offsetY < math.swatchPosition || e.offsetY > math.swatchLength+math.swatchPosition) || (e.offsetX < math.swatchPosition || e.offsetX > math.swatchLength+math.swatchPosition)) { if (this._scanningMode === 'wheel') { this.mouseSetWheelAngle(e); } diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js index 0d46e1ff..f923e30c 100755 --- a/js/components/combobox.reel/combobox.js +++ b/js/components/combobox.reel/combobox.js @@ -80,7 +80,7 @@ exports.Combobox = Montage.create(Component, { } } }, - + _value: { enumerable: false, value: null @@ -166,7 +166,7 @@ exports.Combobox = Montage.create(Component, { if(!this._valueSyncedWithInputField) { this.element.innerHTML = ""; - + var optionItem = document.createElement("option"); var items = this._items; var len = items.length; diff --git a/js/components/core/class-uuid.js b/js/components/core/class-uuid.js index 9649ea6b..010495e7 100755 --- a/js/components/core/class-uuid.js +++ b/js/components/core/class-uuid.js @@ -62,7 +62,7 @@ var Montage = require("montage/core/core").Montage, id[2] = c[(r >>>= 4) & 0xf]; id[3] = c[(r >>>= 4) & 0xf]; id[4] = c[(r >>>= 4) & 0xf]; - + return id.join(''); } } diff --git a/js/components/editable.reel/editable.js b/js/components/editable.reel/editable.js index 026446ab..a0568648 100644 --- a/js/components/editable.reel/editable.js +++ b/js/components/editable.reel/editable.js @@ -39,7 +39,7 @@ EDITABLE - Methods - startEdit - stopEdit - value -- +- - _suggest - _suggestNext - _suggestPrev @@ -70,7 +70,7 @@ exports.Editable = Montage.create(Component, { if(this.startOnEvent) { this._element.addEventListener(this.startOnEvent, this, false); } - + } }, _readOnly : { @@ -80,9 +80,9 @@ exports.Editable = Montage.create(Component, { get : function() { return this._readOnly; }, set : function(makeReadOnly) { var action = makeReadOnly ? 'add' : 'remove'; - + this._element.classList[action](this.readOnlyClass); - + if(this.isEditable) { this.stop(); } @@ -160,7 +160,7 @@ exports.Editable = Montage.create(Component, { ///// Pre Edit Value ///// Value stored when editing starts ///// Useful for reverting to previous value - + _preEditValue : { value : null }, @@ -169,26 +169,26 @@ exports.Editable = Montage.create(Component, { if(!this._readOnly) { this._isEditable = this._element.contentEditable = true; this._element.classList.add(this.editingClass); - + ///// Save the preEditValue this._preEditValue = this.value; - + // Initialize enteredValue with current value this.enteredValue = this.value; - + if(this.selectOnStart) { this.selectAll(); } - + if(this.stopOnBlur) { //console.log('adding mousedown event listener'); ///// Simulate blur on editable node by listening to the doc document.addEventListener('mousedown', this, false); } - + this._sendEvent('start'); } - + } }, stop : { @@ -209,7 +209,7 @@ exports.Editable = Montage.create(Component, { value : function() { var range = document.createRange(), sel = window.getSelection(); - + sel.removeAllRanges(); range.selectNodeContents(this._element); sel.addRange(range); @@ -244,15 +244,15 @@ exports.Editable = Montage.create(Component, { this._sendEvent('blur'); } }, - + /* -------------------- User Event Handling -------------------- */ - + handleKeydown : { value : function(e) { var k = e.keyCode; } }, - + handleKeyup : { value : function(e) { // Record change in value @@ -267,7 +267,7 @@ exports.Editable = Montage.create(Component, { if(!this.isDirty) { this.isDirty = true; } - + this._sendEvent('input'); } }, @@ -310,7 +310,7 @@ exports.Editable = Montage.create(Component, { }, /* -------------------- CONFIG -------------------- */ - + editingClass : { value : 'editable' }, @@ -326,7 +326,7 @@ exports.Editable = Montage.create(Component, { stopOnBlur : { value : true }, - keyActions : { + keyActions : { value : { stop : [27,9,13], revert : [27], @@ -334,5 +334,5 @@ exports.Editable = Montage.create(Component, { }, distinct: true } - + }); diff --git a/js/components/gradientpicker.reel/gradientpicker.js b/js/components/gradientpicker.reel/gradientpicker.js index 937b473b..f35a1fff 100755 --- a/js/components/gradientpicker.reel/gradientpicker.js +++ b/js/components/gradientpicker.reel/gradientpicker.js @@ -94,7 +94,7 @@ exports.GradientPicker = Montage.create(Component, { this._trackData.width = parseInt(getComputedStyle(this.trackChips).getPropertyCSSValue('width').cssText); //TODO: Fix events and remove this hack this.trackCover.addEventListener('mouseover', function () { - if (!this._updating) { + if (!this._updating) { this.trackCover.style.display = 'none'; } }.bind(this), true); @@ -105,7 +105,7 @@ exports.GradientPicker = Montage.create(Component, { // this.radioRadial.addEventListener('change', function (e){ this.mode = 'radial'; - }.bind(this), true); + }.bind(this), true); } }, //////////////////////////////////////////////////////////////////// @@ -139,7 +139,7 @@ exports.GradientPicker = Montage.create(Component, { var point = webkitConvertPointFromNodeToPage(this.trackMain, new WebKitPoint(0, 0)); //Setting position of track to calculate movement this._trackData.x = point.x; - this._trackData.y = point.y; + this._trackData.y = point.y; } }, //////////////////////////////////////////////////////////////////// diff --git a/js/components/hintable.reel/hintable.js b/js/components/hintable.reel/hintable.js index bd7a803a..563206e4 100644 --- a/js/components/hintable.reel/hintable.js +++ b/js/components/hintable.reel/hintable.js @@ -40,7 +40,7 @@ EDITABLE - Methods - startEdit - stopEdit - value -- +- - _suggest - _suggestNext - _suggestPrev @@ -56,7 +56,7 @@ exports.Hintable = Montage.create(Editable, { inheritsFrom : { value : Editable }, _matchIndex : { value : 0 }, matches : { value : [] }, - + _hint : { value : null }, hint : { get : function() { @@ -64,7 +64,7 @@ exports.Hintable = Montage.create(Editable, { }, set : function(hint) { hint = hint || ''; - + ///// Set the hint element's text this._getFirstTextNode(this.hintElement).textContent = hint; ///// if hintElement was removed from the DOM, the object still @@ -76,14 +76,14 @@ exports.Hintable = Montage.create(Editable, { this._hint = hint; } }, - + _hintElement : { value : null }, hintElement : { get : function() { if(!this._hintElement) { - /// Remove the phantom "
" element that is generated when + /// Remove the phantom "
" element that is generated when /// content editable element is empty - this._children(this._element, function(item) { + this._children(this._element, function(item) { return item.nodeName === 'BR'; }).forEach(function(item) { this._element.removeChild(item); @@ -91,17 +91,17 @@ exports.Hintable = Montage.create(Editable, { this._hintElement = document.createElement('span'); this._hintElement.classList.add(this.hintClass); - + this._element.appendChild(this._hintElement); } - + return this._hintElement; }, set : function(el) { this._hintElement = el; } }, - + _getHintDifference : { value : function() { if(!this.matches[this._matchIndex]) { @@ -110,12 +110,12 @@ exports.Hintable = Montage.create(Editable, { return this.matches[this._matchIndex].substr(this.value.length); } }, - + hintNext : { value : function(e) { if(e) { e.preventDefault(); } //console.log('next1'); - + if(this._matchIndex < this.matches.length - 1) { //console.log('next'); ++this._matchIndex; @@ -143,7 +143,7 @@ exports.Hintable = Montage.create(Editable, { var fullText = this._hint; this.hint = null; this.value += fullText; - + if(!preserveCaretPosition) { this.setCursor('end'); } @@ -154,13 +154,13 @@ exports.Hintable = Montage.create(Editable, { revert : { value : function(e, forceRevert) { this.hint = null; - + if(this.isEditable || forceRevert) { /// revert to old value this.value = (this._preEditValue); this._sendEvent('revert'); //console.log('reverting'); - + } } }, @@ -169,30 +169,30 @@ exports.Hintable = Montage.create(Editable, { value : function handleKeydown(e) { var k = e.keyCode, isCaretAtEnd, selection, text; - + this._super(arguments); - - /// Remove the phantom "
" element that is generated when + + /// Remove the phantom "
" element that is generated when /// content editable element is empty - this._children(this._element, function(item) { + this._children(this._element, function(item) { return item.nodeName === 'BR'; }).forEach(function(item) { this._element.removeChild(item); }, this); - + if(k === 39) { selection = window.getSelection(); text = selection.baseNode.textContent; isCaretAtEnd = (selection.anchorOffset === text.length); } - + if(this.hint && isCaretAtEnd) { ///// Advance the cursor this.hint = this.hint.substr(0, 1); this.accept(e); this.handleInput(); } - + this._execKeyAction(e); } }, @@ -208,25 +208,25 @@ exports.Hintable = Montage.create(Editable, { if(this.hints && this.hints.length) { if(val.length > 0) { // content is not empty - - this._matchIndex = 0; + + this._matchIndex = 0; this.matches = this.hints.filter(function(h) { if(!h) { return false; } return h.indexOf(val) === 0; }).sort(); - + ///// If there are no matches, or the new value doesn't match all the ///// previous matches, then get new list of matches if(!this.matches.length || !this._matchesAll(val)) { } - + if(this.matches.length) { // match(es) found if(this.matches[this._matchIndex] !== val) { // Suggest the matched hint, subtracting the typed-in string // Only if the hint is not was the user has typed already this.hint = this._getHintDifference(); } else { - this.hint = null; + this.hint = null; } } else { // no matches found this.hint = null; @@ -254,7 +254,7 @@ exports.Hintable = Montage.create(Editable, { value : function(e) { var key = e.keyCode, keys = this.keyActions; - + if(this.hint) { if( keys.hint.revert.indexOf(key) !== -1 ) { this.revert(e); } if( keys.hint.accept.indexOf(key) !== -1 ) { this.accept(e); } @@ -271,9 +271,9 @@ exports.Hintable = Montage.create(Editable, { } } }, - + /* --------------- Utils --------------- */ - + _children : { value : function(el, filter) { var f = filter || function(item) { @@ -301,7 +301,7 @@ exports.Hintable = Montage.create(Editable, { hintClass : { value : "hintable-hint" }, - keyActions : { + keyActions : { value : { hint : { accept : [9,13,186], // accept hint @@ -321,5 +321,5 @@ exports.Hintable = Montage.create(Editable, { }, distinct: true } - + }); diff --git a/js/components/hottext.reel/hottext.js b/js/components/hottext.reel/hottext.js index f49bfc5f..5e362b46 100755 --- a/js/components/hottext.reel/hottext.js +++ b/js/components/hottext.reel/hottext.js @@ -214,7 +214,7 @@ var HotText = exports.HotText = Montage.create(SliderBase, { var dX = clickPoint.x - this._xStart; var dY = clickPoint.y - this._yStart; - + var dXAbs = Math.abs(dX); var dYAbs = Math.abs(dY); @@ -224,7 +224,7 @@ var HotText = exports.HotText = Montage.create(SliderBase, { } var incrementVal = dXAbs-4; // otherwise, the first value change will be 5 pixels - var multFactor = 1; + var multFactor = 1; if(dXAbs > dYAbs) { diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js index 7e2b4dbb..890640b1 100755 --- a/js/components/layout/document-bar.reel/document-bar.js +++ b/js/components/layout/document-bar.reel/document-bar.js @@ -157,7 +157,7 @@ exports.DocumentBar = Montage.create(Component, { this.codeView.classList.add("selected"); if(this.designView.classList.contains("selected")) this.designView.classList.toggle("selected"); } - + } else if(this.type) { this.designView.classList.remove("active"); } diff --git a/js/components/layout/tools-list.reel/tools-list.js b/js/components/layout/tools-list.reel/tools-list.js index a20aa6ad..e5d34bdb 100755 --- a/js/components/layout/tools-list.reel/tools-list.js +++ b/js/components/layout/tools-list.reel/tools-list.js @@ -181,7 +181,7 @@ exports.ToolsList = Montage.create(Component, { this.RectTool.options = this.application.ninja.toolsProperties.shapeProperties.rectProperties; this.LineTool.options = this.application.ninja.toolsProperties.shapeProperties.lineProperties; this.BrushTool.options = this.application.ninja.toolsProperties.brushProperties; - + this.EraserTool.options = this.application.ninja.toolsProperties.eraserProperties; this.RotateStageTool3D.options = this.application.ninja.toolsProperties.rotateStageProperties; this.PanTool.options = this.application.ninja.toolsProperties.panProperties; diff --git a/js/components/layout/tools-properties.reel/tools-properties.js b/js/components/layout/tools-properties.reel/tools-properties.js index 8c4da4f4..fad86a66 100755 --- a/js/components/layout/tools-properties.reel/tools-properties.js +++ b/js/components/layout/tools-properties.reel/tools-properties.js @@ -174,7 +174,7 @@ exports.ToolsProperties = Montage.create(Component, { this._selectedTool = value; this[this._selectedTool.properties].visible = true; */ - + } } diff --git a/js/components/prompt.reel/prompt.js b/js/components/prompt.reel/prompt.js index 382502bf..bb2c87dd 100644 --- a/js/components/prompt.reel/prompt.js +++ b/js/components/prompt.reel/prompt.js @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; //////////////////////////////////////////////////////////////////////// -// +// exports.NinjaPrompt = Montage.create(Component, { //////////////////////////////////////////////////////////////////// //TODO: This should have an UI template eventually diff --git a/js/components/radio.reel/radio.js b/js/components/radio.reel/radio.js index e1848f18..29b1b635 100755 --- a/js/components/radio.reel/radio.js +++ b/js/components/radio.reel/radio.js @@ -188,7 +188,7 @@ exports.Radio = Montage.create(Component, { this.checked = !this.radioField.checked; } }, - + draw: { value: function() { if(!this._valueSyncedWithInputField) diff --git a/js/components/slider.reel/slider.js b/js/components/slider.reel/slider.js index 57514edb..2b3ebb1a 100755 --- a/js/components/slider.reel/slider.js +++ b/js/components/slider.reel/slider.js @@ -150,7 +150,7 @@ var Slider = exports.Slider = Montage.create(SliderBase, { clickPoint = webkitConvertPointFromPageToNode(this.element, new WebKitPoint(offset,pageY)).y; } this.value = (clickPoint*this._valueCoef)+this._minValue; - + if(!this._isMouseDown && (this._previousValue !== this._value)) { this._dispatchActionEvent(); @@ -197,7 +197,7 @@ var Slider = exports.Slider = Montage.create(SliderBase, { draw: { value: function() { this.setPercentValueFromValue(); - + if(this._direction === "horizontal") { this.knob.style.left = this._percentValue +"%"; @@ -265,7 +265,7 @@ var Slider = exports.Slider = Montage.create(SliderBase, { } - + if(this._enabled) { @@ -282,8 +282,8 @@ var Slider = exports.Slider = Montage.create(SliderBase, { this.value = this._minValue; } } - + } } - + }); diff --git a/js/components/textfield.reel/textfield.js b/js/components/textfield.reel/textfield.js index ee880910..ccce73d4 100755 --- a/js/components/textfield.reel/textfield.js +++ b/js/components/textfield.reel/textfield.js @@ -37,7 +37,7 @@ exports.TextField = Montage.create(Component, { enumerable: false, value: false }, - + _value: { enumerable: false, value: "" diff --git a/js/components/toolbar.reel/toolbar.js b/js/components/toolbar.reel/toolbar.js index 0fcb1da7..1716c05b 100644 --- a/js/components/toolbar.reel/toolbar.js +++ b/js/components/toolbar.reel/toolbar.js @@ -36,7 +36,7 @@ exports.Toolbar = Montage.create(Component, { value: null, serializable: true }, - + _needsButtonProperties : { value: null }, diff --git a/js/components/tools-properties/eraser-properties.reel/eraser-properties.js b/js/components/tools-properties/eraser-properties.reel/eraser-properties.js index 5c997ee3..dbab798a 100755 --- a/js/components/tools-properties/eraser-properties.reel/eraser-properties.js +++ b/js/components/tools-properties/eraser-properties.reel/eraser-properties.js @@ -34,7 +34,7 @@ var ToolProperties = require("js/components/tools-properties/tool-properties").T exports.EraserProperties = Montage.create(ToolProperties, { - + _subPrepare: { value: function() { //this.divElement.addEventListener("click", this, false); diff --git a/js/components/tools-properties/eyedropper-properties.reel/eyedropper-properties.js b/js/components/tools-properties/eyedropper-properties.reel/eyedropper-properties.js index e788b5f6..3442f95c 100755 --- a/js/components/tools-properties/eyedropper-properties.reel/eyedropper-properties.js +++ b/js/components/tools-properties/eyedropper-properties.reel/eyedropper-properties.js @@ -34,7 +34,7 @@ var ToolProperties = require("js/components/tools-properties/tool-properties").T exports.EyedropperProperties = Montage.create(ToolProperties, { - + _subPrepare: { value: function() { //this.divElement.addEventListener("click", this, false); diff --git a/js/components/tools-properties/line-properties.reel/line-properties.js b/js/components/tools-properties/line-properties.reel/line-properties.js index 96938457..499ad880 100755 --- a/js/components/tools-properties/line-properties.reel/line-properties.js +++ b/js/components/tools-properties/line-properties.reel/line-properties.js @@ -37,7 +37,7 @@ exports.LineProperties = Montage.create(ToolProperties, { value: null, serializable: true }, - + _subPrepare: { value: function() { //this.divElement.addEventListener("click", this, false); diff --git a/js/components/tools-properties/oval-properties.reel/oval-properties.js b/js/components/tools-properties/oval-properties.reel/oval-properties.js index dabe646f..195f5f97 100755 --- a/js/components/tools-properties/oval-properties.reel/oval-properties.js +++ b/js/components/tools-properties/oval-properties.reel/oval-properties.js @@ -41,7 +41,7 @@ exports.OvalProperties = Montage.create(ToolProperties, { value: null, serializable: true }, - + _subPrepare: { value: function() { //this.divElement.addEventListener("click", this, false); @@ -66,11 +66,11 @@ exports.OvalProperties = Montage.create(ToolProperties, { use3D: { get: function() { return this.base._use3D; } }, - + strokeSize: { get: function() { return this.base._strokeSize; } }, - + strokeStyle : { get: function() { // return this.base._strokeStyle.options[this.base._strokeStyle.value].text; diff --git a/js/components/tools-properties/pan-properties.reel/pan-properties.js b/js/components/tools-properties/pan-properties.reel/pan-properties.js index 920c6bc6..cb782af4 100755 --- a/js/components/tools-properties/pan-properties.reel/pan-properties.js +++ b/js/components/tools-properties/pan-properties.reel/pan-properties.js @@ -34,7 +34,7 @@ var ToolProperties = require("js/components/tools-properties/tool-properties").T exports.PanProperties = Montage.create(ToolProperties, { - + _subPrepare: { value: function() { //this.divElement.addEventListener("click", this, false); diff --git a/js/components/tools-properties/pen-properties.reel/pen-properties.js b/js/components/tools-properties/pen-properties.reel/pen-properties.js index 460c9633..66260ac3 100755 --- a/js/components/tools-properties/pen-properties.reel/pen-properties.js +++ b/js/components/tools-properties/pen-properties.reel/pen-properties.js @@ -108,7 +108,7 @@ var PenProperties = exports.PenProperties = Montage.create(ToolProperties, { strokeSize: { get: function () { - return this._strokeSize; + return this._strokeSize; } }, diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js index 53539113..faf6ee7b 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.js +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js @@ -76,7 +76,7 @@ exports.RectProperties = Montage.create(ToolProperties, { use3D: { get: function() { return this.base._use3D; } }, - + strokeSize: { get: function() { return this.base._strokeSize; } }, diff --git a/js/components/tools-properties/rotate-stage-properties.reel/rotate-stage-properties.js b/js/components/tools-properties/rotate-stage-properties.reel/rotate-stage-properties.js index c87e87c8..af399e7a 100755 --- a/js/components/tools-properties/rotate-stage-properties.reel/rotate-stage-properties.js +++ b/js/components/tools-properties/rotate-stage-properties.reel/rotate-stage-properties.js @@ -34,7 +34,7 @@ var ToolProperties = require("js/components/tools-properties/tool-properties").T exports.RotateStageProperties = Montage.create(ToolProperties, { - + _subPrepare: { value: function() { //this.divElement.addEventListener("click", this, false); diff --git a/js/components/tools-properties/shape-properties.reel/shape-properties.js b/js/components/tools-properties/shape-properties.reel/shape-properties.js index f812f1bf..d10d2870 100755 --- a/js/components/tools-properties/shape-properties.reel/shape-properties.js +++ b/js/components/tools-properties/shape-properties.reel/shape-properties.js @@ -206,7 +206,7 @@ var ShapeProperties = exports.ShapeProperties = Montage.create(ToolProperties, { this._fillColorCtrlContainer.style["display"] = "none"; this._fillColorCtrlContainer.visible = false; this._fillColorCtrlIcon.style["display"] = "none"; - this._fillColorCtrlIcon.visible = false; + this._fillColorCtrlIcon.visible = false; this.endDivider.style["display"] = "none"; } else { this._fillColorCtrlContainer.style["display"] = ""; diff --git a/js/components/tools-properties/tag-properties.reel/tag-properties.js b/js/components/tools-properties/tag-properties.reel/tag-properties.js index ce122681..58d70105 100755 --- a/js/components/tools-properties/tag-properties.reel/tag-properties.js +++ b/js/components/tools-properties/tag-properties.reel/tag-properties.js @@ -74,7 +74,7 @@ var TagProperties = exports.TagProperties = Montage.create(ToolProperties, { value: function() { this.customName.style["display"] = "none"; this.customLabel.style["display"] = "none"; - + this.divElement.addEventListener("click", this, false); this.imageElement.addEventListener("click", this, false); this.videoElement.addEventListener("click", this, false); diff --git a/js/components/tools-properties/text-properties.reel/text-properties.js b/js/components/tools-properties/text-properties.reel/text-properties.js index 0cfa6c4c..a3adbb1d 100755 --- a/js/components/tools-properties/text-properties.reel/text-properties.js +++ b/js/components/tools-properties/text-properties.reel/text-properties.js @@ -87,7 +87,7 @@ exports.TextProperties = Montage.create(ToolProperties, { // { value: 7, text: "36pt" } // ]; // this.fontSize.contentController = this.fontSizes; - + this.fontSelection.items = ["Arial", "Arial Black", "Courier New", "Garamond", "Georgia", "Open Sans", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana"]; this.fontSize.items = ["8pt","10pt","12pt","14pt","18pt","24pt","36pt"]; this.tagType.items = ["div", "span", "p", "section", "article", "h1", "h2", "h3", "h4", "h5", "h6"]; @@ -120,7 +120,7 @@ exports.TextProperties = Montage.create(ToolProperties, { } }, - + handleAlignLeftAction: { value: function(e) { //this.alignLeft.value = false; diff --git a/js/components/tools-properties/tool-properties.js b/js/components/tools-properties/tool-properties.js index 58c2b052..51d18d21 100755 --- a/js/components/tools-properties/tool-properties.js +++ b/js/components/tools-properties/tool-properties.js @@ -32,7 +32,7 @@ var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; exports.ToolProperties = Montage.create(Component, { - + _visible: { value: false, enumerable: false }, diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.js b/js/components/treeview/ninja-branch.reel/ninja-branch.js index f92a09bc..b4a096e3 100644 --- a/js/components/treeview/ninja-branch.reel/ninja-branch.js +++ b/js/components/treeview/ninja-branch.reel/ninja-branch.js @@ -71,7 +71,7 @@ var Branch = exports.Branch = Montage.create(TreeNode, { value: function() { this.collapser.removeAttribute('id'); this.label._element.addEventListener('click', this, false); - + if(this.hideLabel) { this.label.element.style.display = "none"; } @@ -81,17 +81,17 @@ var Branch = exports.Branch = Montage.create(TreeNode, { }, handleWebkitTransitionEnd : { value: function(e) { - e.stopPropagation(); - + e.stopPropagation(); + ///// Remove Transition this._removeTransition = true; this.collapser.removeEventListener('webkitTransitionEnd', this, false); - + //// If it's an expand transition, restore height to auto if(this.isExpanded) { this._switchToAuto = true; } - + this.needsDraw = true; } @@ -114,9 +114,9 @@ var Branch = exports.Branch = Montage.create(TreeNode, { if (this.sourceObject[this.labelKey]) { this._labelText = this.sourceObject[this.labelKey]; } - + if(this._doCollapse) { - if (this._step === 0) { + if (this._step === 0) { this.collapser.style.height = this.branchHeight; this.collapser.style.position = "relative"; this.collapser.style.overflow = 'hidden'; @@ -135,15 +135,15 @@ var Branch = exports.Branch = Montage.create(TreeNode, { } } else if(this._doExpand) { this.collapser.style.height = this.branchHeight; - + this._doExpand = false; } if(this._switchToAuto) { this.collapser.childNodes[1].style.position = 'static'; - this.collapser.style.height = 'auto'; + this.collapser.style.height = 'auto'; this._switchToAuto = false; } - + if(this._removeTransition) { this.collapser.classList.remove(this.collapseClass); this._removeTransition = false; @@ -167,7 +167,7 @@ var Branch = exports.Branch = Montage.create(TreeNode, { }, collapse : { value: function() { - this.needsDraw = this._doCollapse = true; + this.needsDraw = this._doCollapse = true; } }, branchHeight: { diff --git a/js/components/ui/input-group.reel/input-group.js b/js/components/ui/input-group.reel/input-group.js index ba0eea43..df3a81c4 100755 --- a/js/components/ui/input-group.reel/input-group.js +++ b/js/components/ui/input-group.reel/input-group.js @@ -84,7 +84,7 @@ var InputGroup = exports.InputGroup = Montage.create(Component, { this.dispatchEvent(propEvent); } }, - + value: { enumerable: true, serializable: true, @@ -96,7 +96,7 @@ var InputGroup = exports.InputGroup = Montage.create(Component, { retObject[childControl.label] = childControl._control[childControl._prop]; } return retObject; - + } }, diff --git a/js/components/ui/property-control.reel/property-control.js b/js/components/ui/property-control.reel/property-control.js index 834702fd..9b9c9482 100755 --- a/js/components/ui/property-control.reel/property-control.js +++ b/js/components/ui/property-control.reel/property-control.js @@ -195,7 +195,7 @@ var PropertyControl = exports.PropertyControl = Montage.create(Component, { propEvent.propertyLabel = this.label; propEvent.propertyValue = event.currentTarget[this._prop]; propEvent.propertyEvent = event; - + this.dispatchEvent(propEvent); } }, diff --git a/js/controllers/color-controller.js b/js/controllers/color-controller.js index 194b7153..8be2421f 100755 --- a/js/controllers/color-controller.js +++ b/js/controllers/color-controller.js @@ -27,7 +27,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + //////////////////////////////////////////////////////////////////////// // var Montage = require("montage/core/core").Montage, @@ -163,7 +163,7 @@ exports.ColorController = Montage.create(Component, { // getBorder: { value: function (element) { - + } }, //////////////////////////////////////////////////////////////////// @@ -262,14 +262,14 @@ exports.ColorController = Montage.create(Component, { c = this.parseCssToColor('rgb('+temp[0]+')'); gradient.stops.push({css: c.css, value: c.value, mode: c.mode, position: parseInt(temp[1].replace(/\%/i, ""))}); } else if (css.indexOf('rgba') >= 0) { - + temp = arr[j].split('rgba'); temp = temp[1].replace(/\(/i, ""); temp = temp.split(')'); c = this.parseCssToColor('rgba('+temp[0]+')'); gradient.stops.push({css: c.css, value: c.value, mode: c.mode, position: parseInt(temp[1].replace(/\%/i, ""))}); } - } + } } else if (css.indexOf('-webkit-gradient') >= 0) { //Linear gradient gradient.stops = []; diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 1857dfd7..bab2ed0e 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -246,7 +246,7 @@ exports.DocumentController = Montage.create(Component, { } }, //////////////////////////////////////////////////////////////////// - + /** * Public method * doc contains: @@ -361,7 +361,7 @@ exports.DocumentController = Montage.create(Component, { } }, //////////////////////////////////////////////////////////////////// - + openProjectWithURI: { value: function(uri) { console.log("URI is: ", uri); diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 646fa455..59ac238c 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -36,9 +36,9 @@ exports.ElementController = Montage.create(Component, { addElement: { value: function(el, styles) { - + if (el.getAttribute) el.setAttribute('data-ninja-node', 'true'); - + // Updated to use new methods in TimelinePanel. JR. var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); if (insertionIndex === false) { @@ -51,7 +51,7 @@ exports.ElementController = Montage.create(Component, { element.parentNode.insertBefore(el, element.nextSibling); } } - + if(styles) { this.application.ninja.stylesController.setElementStyles(el, styles); } @@ -67,7 +67,7 @@ exports.ElementController = Montage.create(Component, { el.parentNode.removeChild(el); } }, - + getProperty: { value: function(el, prop, fallbackOnComputed, isStageElement) { if(el.nodeType !== 3){ diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index bef315ba..e6774858 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -300,7 +300,7 @@ exports.ShapesController = Montage.create(CanvasController, { return null; } break; - + case "strokeMaterial": var sm = el.elementModel.shapeModel.GLGeomObj.getStrokeMaterial(); diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js index 0462df98..32eecf20 100644 --- a/js/controllers/objects-controller.js +++ b/js/controllers/objects-controller.js @@ -73,11 +73,11 @@ var objectsController = exports.ObjectsController = Montage.create(Montage, { } } }, - + /* -------------------------- Binding Methods ----------------------------- */ - + addBinding : { value: function(bindingArgs) { if(!bindingArgs.sourceObject || !bindingArgs.sourceObjectPropertyPath || !bindingArgs) { return; } @@ -122,7 +122,7 @@ var objectsController = exports.ObjectsController = Montage.create(Montage, { } }, - + getObjectBindings : { value: function(object) { var descriptors = object._bindingDescriptors, diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 1030acb4..973c3aa1 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -59,26 +59,26 @@ Methods: - Delete stylesheets - Enable stylesheets - Disable stylesheets - + use case : set background color - needs to know most specific rule WITH that property - - + - */ var stylesController = exports.StylesController = Montage.create(Component, { - + ///// Initialize after the active document has been set, and ///// bind the document to prop w/ setter. The setter calls to find ///// the stage and default css files. - ///// Active document gets automatically set when the + ///// Active document gets automatically set when the ///// document controller changes it _currentDocument : { value : null, enumerable : false }, - + currentDocument : { get : function() { return this._currentDocument; @@ -97,7 +97,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { ///// setting document via binding this._currentDocument = document; - + ///// Stage stylesheet should always be found this._stageStylesheet = this.getSheetFromElement(this.CONST.STAGE_SHEET_ID); // Returns null if sheet not found (as in non-ninja projects) @@ -191,29 +191,29 @@ var stylesController = exports.StylesController = Montage.create(Component, { } }, /* ----------------- Rule methods ----------------- */ - + ///// Add Rule ///// Passed in rule will be appended to the default stylesheet ///// The rule can be in the form of a string (one argument), or ///// the selector string and declaration string (two arguments), or ///// the selector string and a declaration object. ///// Optionally pass in the rule index (defaults to end of sheet) - + /* - Signature 1 : + Signature 1 : addRule( "#div1", "color:blue; width:100px;", 3) [str] [str] [num] - - Signature 2 (w/ styles object literal): + + Signature 2 (w/ styles object literal): addRule( "#div1", { color:"blue", width:"100px" }, 3) [str] [obj] [num] - - Signature 3 (w/ full rule as one string) : + + Signature 3 (w/ full rule as one string) : addRule( "#div1 { color:blue; width:100px; }", 3) [str] [num] - + */ - + addRule : { value : function(selector, declaration, stylesheet, index) { stylesheet = stylesheet || this._defaultStylesheet; @@ -228,20 +228,20 @@ var stylesController = exports.StylesController = Montage.create(Component, { rule; index = index || (argType === 'number') ? declaration : rulesLength; - + if(argType === 'string') { ruleText += '{' + declaration + '}'; } else if(argType === 'object') { ruleText += '{' + this.cssFromObject(declaration) + '}'; } - + stylesheet.insertRule(ruleText, index); ///// Invalidate cache because rule dominance is affected this._clearCache(); this.styleSheetModified(stylesheet); - + rule = stylesheet.rules[index]; ///// attach specificity to rule object @@ -256,7 +256,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { return rule; } }, - + ///// Create Override Rule ///// Takes a given rule and creates a rule with a selector of equal ///// or greater specificity, and inserts it after the original rule @@ -264,10 +264,10 @@ var stylesController = exports.StylesController = Montage.create(Component, { ///// and the class will have to be applied to the element in order for ///// the rule to stick ///// Returns an object containing this classname and the rule itself - + createOverrideRule : { value : function(ruleToOverride, element) { - + ///// Locally-scoped function to de-clutter variable declarations function getSelector(el, rule) { return this._getMostSpecificSelectorForElement(el, rule[this.CONST.SPECIFICITY_KEY]).selector; @@ -283,12 +283,12 @@ var stylesController = exports.StylesController = Montage.create(Component, { ///// Create new rule with selector and insert it after the rule we're overriding rule = this.addRule(overrideData.selector + ' { }', this.getRuleIndex(ruleToOverride)+1); - + return { className : overrideData.className, rule : rule }; - + } }, @@ -341,18 +341,18 @@ var stylesController = exports.StylesController = Montage.create(Component, { }; } }, - + ///// Delete Rule ///// Deletes the passed-in rule from its stylesheet ///// Argument can be the index of the rule, or the rule itself ///// If the index is passed, the sheet must be passed in - + deleteRule : { value : function(rule, sheet) { var index; - + if(typeof rule === 'number') { - ///// 1st arg is the index + ///// 1st arg is the index index = rule; } else { ///// derive the index of the rule @@ -360,7 +360,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { ///// the sheet is a property of the rule sheet = rule.parentStyleSheet; } - + if(index > -1) { sheet.deleteRule(index); } @@ -370,22 +370,22 @@ var stylesController = exports.StylesController = Montage.create(Component, { return index; } }, - + ///// Get Dominant Rule For Style - ///// Given an element, this method returns the dominant rule + ///// Given an element, this method returns the dominant rule ///// for the particular style property. ///// Optionally, it returns an override object if no single-target ///// rule is found. ///// An override object consists of a rule to override, and a ///// flag for using !important or not - + getDominantRuleForElement : { value : function(element, property, returnOverrideObject, useStageStyleSheet) { var matchedRules = this.getMatchingRules(element, true, useStageStyleSheet), doc = element.ownerDocument, useImportant = false, inLineStyleRule, rulesWithProperty, importantRules, dominantRule; - + ///// First, since an element's style attribute is a CSSStyleDeclaration ///// and not a CSSStyleRule, we want to create an imitation rule object ///// to act like any returned by getMatchedCSSRules @@ -417,7 +417,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { - Get 2) No rules with the property (i.e., no chance of property collision) - use the original rule list to find the most specific, single-target rule - - start with the highest specificity to minimize calls to querySelectorAll() + - start with the highest specificity to minimize calls to querySelectorAll() - if there is no single-target rule, create a new rule to apply this style */ @@ -439,7 +439,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { //dominantRule = this._getFirstSingleTargetRule(rulesWithProperty, doc); dominantRule = rulesWithProperty[0]; } - + } else { // no rules with property ///// In this case, we don't want to use the inline style ///// Important flag is irrelevant because the style property isn't defined @@ -457,7 +457,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { singleTargetBackup : this._getFirstSingleTargetRule(matchedRules.slice(1), doc) }; } - + return dominantRule; } }, @@ -525,58 +525,58 @@ var stylesController = exports.StylesController = Montage.create(Component, { ///// Disable Rule ///// Disables a rule by giving it a known garbage selector - + disableRule : { value : function(rule, sheet) { rule = (typeof rule === 'number') ? sheet.rules[rule] : rule; - + rule.selectorText += this.CONST.GARBAGE_SELECTOR; - + return rule; } }, - + ///// Enable Rule ///// Enables a rule by removing the known garbage selector - + enableRule : { value : function(rule, sheet) { rule = (typeof rule === 'number') ? sheet.rules[rule] : rule; - + ///// remove any occurances of the garbage selector rule.selectorText.replace(this.CONST.GARBAGE_SELECTOR, ''); - + return rule; } }, - + ///// Has Property ///// Checks to see if a rule has the property defined in ///// its declaration. ///// Optionally checks for shortand property - + hasProperty : { value: function(rule, property, checkForShorthand) { var properties = [property], shorthands = cssShorthandMap[property]; - + ///// If shorthand properties are defined, add to the array ///// of which properties to check for if(shorthands) { properties.concat(shorthands); } - + ///// return true if any property exists in rule return properties.some(function(prop) { return !!rule.style.getPropertyValue(prop); }, this); - + } }, - + ///// Matches Multiple Elements ///// Checks to see if the rule affects multiple elements - + matchesMultipleElements : { value: function(rule, document) { if(rule.isInlineStyle) { @@ -606,12 +606,12 @@ var stylesController = exports.StylesController = Montage.create(Component, { } }, - - + + ///// Set Rule Selector ///// Allows user to change the selector of given rule ///// while attaching new specificity value to rule object - + setRuleSelector : { value : function(rule, selector) { rule.selectorText = selector; @@ -622,13 +622,13 @@ var stylesController = exports.StylesController = Montage.create(Component, { return rule; } }, - + ///// Get Rule Index ///// Returns the index of the passed-in rule. ///// Returns -1 if not found. ///// A rule's index is useful to know for deleting, inserting ///// and determining rule precedence - + getRuleIndex : { value : function(rule) { var rules = nj.toArray(rule.parentStyleSheet.rules); @@ -666,7 +666,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { ///// Get All Matching Rules ///// Returns an array of css rules for an element ///// Optionally sorted by specificity, and can omit pseudo elements - + getMatchingRules : { //TODO: Remove omitPseudos from here and usages value: function(element, omitPseudos, useStageStyleSheet) { var rules, @@ -748,17 +748,17 @@ var stylesController = exports.StylesController = Montage.create(Component, { return order; } - + rules.sort(sorter.bind(this)); - + return rules; } }, - + ///// Get Common Rules ///// Returns an array of rules that are common to all the elements ///// in passed-in element array. - + getCommonRules : { value : function(elements) { var itemIndex = -1, @@ -783,17 +783,17 @@ var stylesController = exports.StylesController = Montage.create(Component, { return commonRules; } }, - + ///// Get Most Specific Selector For Element ///// Given a selector+specificity array, find the most specific ///// selector for the passed-in element - + _getMostSpecificSelectorForElement : { value : function(element, specArr) { - if(specArr.length === 1) { + if(specArr.length === 1) { return specArr[0]; } - + var matchingElements, i; for(i = 0; i < specArr.length; i++) { @@ -840,12 +840,12 @@ var stylesController = exports.StylesController = Montage.create(Component, { } }, - + ///// Get First Single Target Rule ///// Loops through the array of rules sequentially, returning