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/editable.reel/editable.js | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'js/components/editable.reel') 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 } - + }); -- cgit v1.2.3 From fdbec324dad4ab33d97282ab021d2c1661bc097c Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 9 Jul 2012 16:27:52 -0700 Subject: BSD License --- js/components/editable.reel/editable.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'js/components/editable.reel') diff --git a/js/components/editable.reel/editable.js b/js/components/editable.reel/editable.js index a0568648..c008a18e 100644 --- a/js/components/editable.reel/editable.js +++ b/js/components/editable.reel/editable.js @@ -1,24 +1,25 @@ /* -Copyright (c) 2012, Motorola Mobility, Inc +Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. -BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- cgit v1.2.3