From ed368aa3b626997046a09e2e86a00e8011a4f8b1 Mon Sep 17 00:00:00 2001 From: Justin Meyer Date: Sat, 21 Aug 2010 15:02:04 -0500 Subject: [PATCH] cleaning to follow jQuery's object literal conventions --- autosuggest/autosuggest_test.js | 2 +- funcunit.js | 28 ++++++------- synthetic/demo/record.js | 20 ++++----- synthetic/drag/drag.js | 4 +- synthetic/key.js | 56 +++++++++++++------------- synthetic/mouse.js | 10 ++--- synthetic/synthetic.js | 52 ++++++++++++------------ synthetic/test/qunit/key_test.js | 10 ++--- synthetic/test/qunit/mouse_test.js | 2 +- synthetic/test/qunit/synthetic_test.js | 8 ++-- test/funcunit/funcunit_test.js | 2 +- test/funcunit/protodrag_test.js | 2 +- test/protodrag/funcunit_test.js | 2 +- 13 files changed, 99 insertions(+), 99 deletions(-) diff --git a/autosuggest/autosuggest_test.js b/autosuggest/autosuggest_test.js index 1bb21c42..991e6e6a 100644 --- a/autosuggest/autosuggest_test.js +++ b/autosuggest/autosuggest_test.js @@ -1,5 +1,5 @@ module("autosuggest",{ - setup : function(){ + setup: function() { S.open('autosuggest.html') } }); diff --git a/funcunit.js b/funcunit.js index fad056a8..7d5a4df5 100644 --- a/funcunit.js +++ b/funcunit.js @@ -30,7 +30,7 @@ var window = (function(){return this }).call(null), * you turn off your popup blocker!). @codestart module("autosuggest",{ - setup : function(){ + setup: function() { S.open('autosuggest.html') } }); @@ -83,7 +83,7 @@ test("JavaScript results",function(){ *
  • Create a JS file (pages/mypage_test.js) for your tests. The skeleton should like: @codestart module("APPNAME", { - setup : function(){ + setup: function() { // opens the page you want to test $.open("myPage.html"); } @@ -494,7 +494,7 @@ S.open("//app/app.html") * @param {Function} callback * @param {Number} timeout */ -open : function(path, callback, timeout){ +open: function( path, callback, timeout ) { var fullPath = FuncUnit.getAbsolutePath(path), temp; if(typeof callback != 'function'){ @@ -515,7 +515,7 @@ open : function(path, callback, timeout){ * Gets a path, will use steal if present * @param {String} path */ -getAbsolutePath : function(path){ +getAbsolutePath: function( path ) { if(typeof(steal) == "undefined"){ return path; } @@ -554,7 +554,7 @@ support : {}, window : { document: {} }, -_opened : function(){} +_opened: function() {} }); @@ -805,7 +805,7 @@ FuncUnit.init.prototype = { * @param {Function} [callback] a callback that is run after typing, but before the next action. * @return {FuncUnit} returns the funcUnit for chaining. */ - type: function(text, callback){ + type: function( text, callback ) { var selector = this.selector, context = this.context; FuncUnit.add(function(success, error){ @@ -823,7 +823,7 @@ FuncUnit.init.prototype = { * @param {Function} [callback] a callback that is run after the selector exists, but before the next action. * @return {FuncUnit} returns the funcUnit for chaining. */ - exists : function(callback){ + exists: function( callback ) { if(true){ return this.size(function(size){ return size > 0; @@ -841,7 +841,7 @@ FuncUnit.init.prototype = { * @param {Function} [callback] a callback that is run after the selector exists, but before the next action * @return {FuncUnit} returns the funcUnit for chaining. */ - missing : function(callback){ + missing: function( callback ) { return this.size(0, callback) }, /** @@ -853,7 +853,7 @@ FuncUnit.init.prototype = { * @param {Function} [callback] a callback that runs after the funcUnit is visible, but before the next action. * @return [funcUnit] returns the funcUnit for chaining. */ - visible : function(callback){ + visible: function( callback ) { var self = this, sel = this.selector, ret; @@ -881,7 +881,7 @@ FuncUnit.init.prototype = { * @param {Function} [callback] a callback that runs after the selector is invisible, but before the next action. * @return [funcUnit] returns the funcUnit selector for chaining. */ - invisible : function(callback){ + invisible: function( callback ) { var self = this, sel = this.selector, ret; @@ -932,7 +932,7 @@ FuncUnit.init.prototype = { * @param {Function} [callback] a callback that runs after the drag, but before the next action. * @return {funcUnit} returns the funcunit selector for chaining. */ - drag: function( options, callback){ + drag: function( options, callback ) { if(typeof options == 'string'){ options = {to: options} } @@ -981,7 +981,7 @@ FuncUnit.init.prototype = { * @param {Function} [callback] a callback that runs after the drag, but before the next action. * @return {funcUnit} returns the funcunit selector for chaining. */ - move: function(options, callback){ + move: function( options, callback ) { if(typeof options == 'string'){ options = {to: options} } @@ -1001,7 +1001,7 @@ FuncUnit.init.prototype = { * @param {Number} amount number of pixels to scroll * @param {Function} callback */ - scroll : function(direction, amount, callback){ + scroll: function( direction, amount, callback ) { var selector = this.selector, context = this.context, direction = /left|right|x/i.test(direction)? "Left" : "Right"; @@ -1018,7 +1018,7 @@ FuncUnit.init.prototype = { * @param {Number} [timeout] * @param {Object} callback */ - wait : function(timeout, callback){ + wait: function( timeout, callback ) { FuncUnit.wait(timeout, callback) } }; diff --git a/synthetic/demo/record.js b/synthetic/demo/record.js index 0e0c6dd2..226521cd 100644 --- a/synthetic/demo/record.js +++ b/synthetic/demo/record.js @@ -5,7 +5,7 @@ $(function(){ REPLAY = false; ADD = true; Recorder ={ - cb: function(i){ + cb: function( i ) { return function(){ $("#code div:nth("+(i)+")").css("color","black").css("font-weight","") $("#code div:nth("+(i+1)+")").css("color","orange").css("font-weight","bold") @@ -15,7 +15,7 @@ $(function(){ } }, - done : function(){ + done: function() { ADD = true; $("#code div").css("color","black") } @@ -28,7 +28,7 @@ $(function(){ mousemove, mouseup, h ={ - commandsText : function(func){ + commandsText: function( func ) { var text = [], command, prev, @@ -52,7 +52,7 @@ $(function(){ } return text.join("") }, - addCode : function(type, options, target){ + addCode: function( type, options, target ) { if(!ADD){ return; } @@ -78,17 +78,17 @@ $(function(){ $("#code").html(h.commandsText()) }, - getKey : function(code){ + getKey: function( code ) { for(var key in Syn.keycodes){ if(Syn.keycodes[key] == code){ return key } } }, - addKey : function(key){ + addKey: function( key ) { }, - showChar : function(character, target){ + showChar: function( character, target ) { var convert = { "\r" : "\\r", "\t" :"\\t", @@ -103,7 +103,7 @@ $(function(){ h.addCode("type",'"'+current.join("")+'"', target) }, - keydown : function(ev){ + keydown: function( ev ) { var key = h.getKey(ev.keyCode); if(keytarget != ev.target){ @@ -115,7 +115,7 @@ $(function(){ h.showChar(key, ev.target); } }, - keyup : function(ev){ + keyup: function( ev ) { var key = h.getKey(ev.keyCode); if(Syn.key.isSpecial(ev.keyCode)){ h.showChar(key+"-up", ev.target); @@ -129,7 +129,7 @@ $(function(){ },20) }, // returns a selector - selector : function(target){ + selector: function( target ) { var selector = target.nodeName.toLowerCase(); if(target.id){ return "#"+target.id diff --git a/synthetic/drag/drag.js b/synthetic/drag/drag.js index 3e677ad1..17011d64 100644 --- a/synthetic/drag/drag.js +++ b/synthetic/drag/drag.js @@ -238,7 +238,7 @@ Syn.helpers.extend(Syn.init.prototype,{ * @param {HTMLElement} from * @param {Function} callback */ - _move : function(options, from, callback){ + _move: function( options, from, callback ) { //need to convert if elements var win = Syn.helpers.getWindow(from), fro = convertOption(options.from || from, win), @@ -255,7 +255,7 @@ Syn.helpers.extend(Syn.init.prototype,{ * @param {Object} from * @param {Object} callback */ - _drag : function(options, from, callback){ + _drag: function( options, from, callback ) { //need to convert if elements var win = Syn.helpers.getWindow(from), fro = convertOption(options.from || from, win, from), diff --git a/synthetic/key.js b/synthetic/key.js index 9a3d7778..c6642432 100644 --- a/synthetic/key.js +++ b/synthetic/key.js @@ -180,7 +180,7 @@ h.extend(Syn,{ typeable : /input|textarea/i, // selects text on an element - selectText: function(el, start, end){ + selectText: function( el, start, end ) { if(el.setSelectionRange){ if(!end){ el.focus(); @@ -199,7 +199,7 @@ h.extend(Syn,{ r.select(); } }, - getText: function(el){ + getText: function( el ) { //first check if the el has anything selected .. if(Syn.typeable.test(el.nodeName)){ var sel = getSelection(el); @@ -222,7 +222,7 @@ h.extend(Syn,{ h.extend(Syn.key,{ // retrieves a description of what events for this character should look like - data : function(key){ + data: function( key ) { //check if it is described directly if(S.key.browser[key]){ return S.key.browser[key]; @@ -236,7 +236,7 @@ h.extend(Syn.key,{ }, //returns the special key if special - isSpecial : function(keyCode){ + isSpecial: function( keyCode ) { var specials = S.key.kinds.special; for(var i=0; i < specials.length; i++){ if(Syn.keycodes[ specials[i] ] == keyCode){ @@ -250,7 +250,7 @@ h.extend(Syn.key,{ * @param {Object} key * @param {Object} event */ - options : function(key, event){ + options: function( key, event ) { var keyData = Syn.key.data(key); if(!keyData[event]){ @@ -287,7 +287,7 @@ h.extend(Syn.key,{ 'function' : ['f1','f2','f3','f4','f5','f6','f7','f8','f9','f10','f11','f12'] }, //returns the default function - getDefault : function(key){ + getDefault: function( key ) { //check if it is described directly if(Syn.key.defaults[key]){ return Syn.key.defaults[key]; @@ -301,7 +301,7 @@ h.extend(Syn.key,{ }, // default behavior when typing defaults : { - 'character' : function(options, scope, key, force, sel){ + 'character' : function( options, scope, key, force, sel ) { if(/num\d+/.test(key)){ key = key.match(/\d+/)[0] } @@ -318,28 +318,28 @@ h.extend(Syn.key,{ Syn.selectText(this, before.length + charLength) } }, - 'c' : function(options, scope, key, force, sel){ + 'c' : function( options, scope, key, force, sel ) { if(Syn.key.ctrlKey){ Syn.key.clipboard = Syn.getText(this) }else{ Syn.key.defaults.character.apply(this, arguments); } }, - 'v' : function(options, scope, key, force, sel){ + 'v' : function( options, scope, key, force, sel ) { if(Syn.key.ctrlKey){ Syn.key.defaults.character.call(this, options,scope, Syn.key.clipboard, true,sel); }else{ Syn.key.defaults.character.apply(this, arguments); } }, - 'a' : function(options, scope, key, force, sel){ + 'a' : function( options, scope, key, force, sel ) { if(Syn.key.ctrlKey){ Syn.selectText(this, 0, this.value.length) }else{ Syn.key.defaults.character.apply(this, arguments); } }, - 'home' : function(){ + 'home' : function() { Syn.onParents(this, function(el){ if(el.scrollHeight != el.clientHeight){ el.scrollTop = 0; @@ -347,7 +347,7 @@ h.extend(Syn.key,{ } }) }, - 'end' : function(){ + 'end' : function() { Syn.onParents(this, function(el){ if(el.scrollHeight != el.clientHeight){ el.scrollTop = el.scrollHeight; @@ -355,7 +355,7 @@ h.extend(Syn.key,{ } }) }, - 'page-down' : function(){ + 'page-down' : function() { //find the first parent we can scroll Syn.onParents(this, function(el){ if(el.scrollHeight != el.clientHeight){ @@ -365,7 +365,7 @@ h.extend(Syn.key,{ } }) }, - 'page-up' : function(){ + 'page-up' : function() { Syn.onParents(this, function(el){ if(el.scrollHeight != el.clientHeight){ var ch = el.clientHeight @@ -374,7 +374,7 @@ h.extend(Syn.key,{ } }) }, - '\b' : function(options, scope, key, force, sel){ + '\b' : function( options, scope, key, force, sel ) { //this assumes we are deleting from the end if(!S.support.backspaceWorks && Syn.typeable.test(this.nodeName)){ var current = this.value, @@ -393,7 +393,7 @@ h.extend(Syn.key,{ //set back the selection } }, - 'delete' : function(options, scope, key, force, sel){ + 'delete' : function( options, scope, key, force, sel ) { if(!S.support.backspaceWorks && Syn.typeable.test(this.nodeName)){ var current = this.value, before = current.substr(0,sel.start), @@ -407,7 +407,7 @@ h.extend(Syn.key,{ Syn.selectText(this, sel.start) } }, - '\r' : function(options, scope, key, force, sel){ + '\r' : function( options, scope, key, force, sel ) { var nodeName = this.nodeName.toLowerCase() // submit a form @@ -435,7 +435,7 @@ h.extend(Syn.key,{ // tabindex after it in the document. // @return the next element // - '\t' : function(options, scope){ + '\t' : function( options, scope ) { // focusable elements var focusEls = getFocusable(this), // the current element's tabindex @@ -500,7 +500,7 @@ h.extend(Syn.key,{ current && current.focus(); return current; }, - 'left' : function(options, scope, key, force, sel){ + 'left' : function( options, scope, key, force, sel ) { if( Syn.typeable.test(this.nodeName) ){ if(Syn.key.shiftKey){ Syn.selectText(this, sel.start == 0 ? 0 : sel.start - 1, sel.end) @@ -509,7 +509,7 @@ h.extend(Syn.key,{ } } }, - 'right' : function(options, scope, key, force, sel){ + 'right' : function( options, scope, key, force, sel ) { if( Syn.typeable.test(this.nodeName) ){ if(Syn.key.shiftKey){ Syn.selectText(this, sel.start, sel.end+1 > this.value.length ? this.value.length : sel.end+1) @@ -518,21 +518,21 @@ h.extend(Syn.key,{ } } }, - 'up' : function(){ + 'up' : function() { if(/select/i.test(this.nodeName)){ this.selectedIndex = this.selectedIndex ? this.selectedIndex-1 : 0; //set this to change on blur? } }, - 'down' : function(){ + 'down' : function() { if(/select/i.test(this.nodeName)){ Syn.changeOnBlur(this, "selectedIndex", this.selectedIndex) this.selectedIndex = this.selectedIndex+1; //set this to change on blur? } }, - 'shift' : function(){ + 'shift' : function() { return null; } } @@ -541,14 +541,14 @@ h.extend(Syn.key,{ h.extend(Syn.create,{ keydown : { - setup : function(type, options, element){ + setup: function( type, options, element ) { if(h.inArray(options,Syn.key.kinds.special ) != -1){ Syn.key[options+"Key"] = element; } } }, keyup : { - setup : function(type, options, element){ + setup: function( type, options, element ) { if(h.inArray(options,Syn.key.kinds.special )!= -1){ Syn.key[options+"Key"] = null; } @@ -556,7 +556,7 @@ h.extend(Syn.create,{ }, key : { // return the options for a key event - options : function(type, options, element){ + options: function( type, options, element ) { //check if options is character or has character options = typeof options != "object" ? {character : options} : options; @@ -633,7 +633,7 @@ h.extend(Syn.init.prototype, * @param {Function} [callback] * @return {HTMLElement} the element currently focused. */ - _key : function(options, element, callback){ + _key: function( options, element, callback ) { //first check if it is a special up if(/-up$/.test(options) && h.inArray(options.replace("-up",""),Syn.key.kinds.special )!= -1){ @@ -721,7 +721,7 @@ h.extend(Syn.init.prototype, * @param {HTMLElement} [element] an element or an id of an element * @param {Function} [callback] a function to callback */ - _type : function(options, element, callback){ + _type: function( options, element, callback ) { //break it up into parts ... //go through each type and run var parts = options.match(/(\[[^\]]+\])|([^\[])/g), diff --git a/synthetic/mouse.js b/synthetic/mouse.js index eb7781a5..4961f26c 100644 --- a/synthetic/mouse.js +++ b/synthetic/mouse.js @@ -5,10 +5,10 @@ var h = Syn.helpers; Syn.mouse = {}; h.extend(Syn.defaults,{ - mousedown : function(options){ + mousedown: function( options ) { Syn.trigger("focus", {}, this) }, - click : function(){ + click: function() { // prevents the access denied issue in IE if the click causes the element to be destroyed var element = this; try { @@ -102,7 +102,7 @@ h.extend(Syn.defaults,{ //add create and setup behavior for mosue events h.extend(Syn.create,{ mouse : { - options : function(type, options, element){ + options: function( type, options, element ) { var doc = document.documentElement, body = document.body, center = [options.pageX || 0, options.pageY || 0], //browser might not be loaded yet (doing support code) @@ -147,7 +147,7 @@ h.extend(Syn.create,{ h.createEventObject }, click : { - setup : function(type, options, element){ + setup: function( type, options, element ) { try{ Syn.data(element,"checked", element.checked); }catch(e){} @@ -183,7 +183,7 @@ h.extend(Syn.create,{ } }, mousedown : { - setup : function(type,options, element){ + setup: function( type,options, element ) { var nn = element.nodeName.toLowerCase(); //we have to auto prevent default to prevent freezing error in safari if(Syn.browser.safari && (nn == "select" || nn == "option" )){ diff --git a/synthetic/synthetic.js b/synthetic/synthetic.js index c7247ed7..94367b61 100644 --- a/synthetic/synthetic.js +++ b/synthetic/synthetic.js @@ -172,7 +172,7 @@ extend(Syn,{ * @param {Object} element * @param {Object} callback */ - init : function(type, options, element, callback){ + init: function( type, options, element, callback ) { var args = Syn.args(options,element, callback), self = this; this.queue = []; @@ -189,7 +189,7 @@ extend(Syn,{ args.callback && args.callback.call(this, args.element, this.result); } }, - jquery : function(el, fast){ + jquery: function( el, fast ) { if(window.FuncUnit && window.FuncUnit.jquery){ return window.FuncUnit.jquery } if (el){ @@ -204,7 +204,7 @@ extend(Syn,{ * @hide * @return {Object} */ - args : function(){ + args: function() { var res = {} for(var i=0; i < arguments.length; i++){ if(typeof arguments[i] == 'function'){ @@ -222,7 +222,7 @@ extend(Syn,{ } return res; }, - click : function( options, element, callback){ + click: function( options, element, callback ) { Syn('click!',options,element, callback); }, /** @@ -233,7 +233,7 @@ extend(Syn,{ * and the next event will happen on that element. */ defaults : { - focus : function(){ + focus: function() { if(!Syn.support.focusChanges){ var element = this, nodeName = element.nodeName.toLowerCase(); @@ -253,7 +253,7 @@ extend(Syn,{ } } }, - submit : function(){ + submit: function() { Syn.onParents(this, function(el){ if( el.nodeName.toLowerCase() == 'form'){ el.submit() @@ -262,7 +262,7 @@ extend(Syn,{ }); } }, - changeOnBlur : function(element, prop, value){ + changeOnBlur: function( element, prop, value ) { bind(element, "blur", function(){ if( value != element[prop]){ @@ -278,7 +278,7 @@ extend(Syn,{ * @param {Object} el * @param {Object} type */ - closest : function(el, type){ + closest: function( el, type ) { while(el && el.nodeName.toLowerCase() != type.toLowerCase()){ el = el.parentNode } @@ -291,7 +291,7 @@ extend(Syn,{ * @param {Object} key * @param {Object} value */ - data : function(el, key, value){ + data: function( el, key, value ) { var d; if(!el[expando]){ el[expando] = id++; @@ -313,7 +313,7 @@ extend(Syn,{ * @param {Object} el * @param {Object} func */ - onParents : function(el, func){ + onParents: function( el, func ) { var res; while(el && res !== false){ res = func(el) @@ -328,7 +328,7 @@ extend(Syn,{ * @hide * @param {Object} elem */ - isFocusable : function(elem){ + isFocusable: function( elem ) { var attributeNode; return ( this.focusable.test(elem.nodeName) || ( (attributeNode = elem.getAttributeNode( "tabIndex" )) && attributeNode.specified ) ) @@ -339,7 +339,7 @@ extend(Syn,{ * @hide * @param {Object} elem */ - isVisible : function(elem){ + isVisible: function( elem ) { return (elem.offsetWidth && elem.offsetHeight) || (elem.clientWidth && elem.clientHeight) }, /** @@ -347,7 +347,7 @@ extend(Syn,{ * @hide * @param {Object} elem */ - tabIndex : function(elem){ + tabIndex: function( elem ) { var attributeNode = elem.getAttributeNode( "tabIndex" ); return attributeNode && attributeNode.specified && ( parseInt( elem.getAttribute('tabIndex') ) || 0 ) }, @@ -357,7 +357,7 @@ extend(Syn,{ //some generic helpers helpers : { createEventObject : createEventObject, - createBasicStandardEvent : function(type, defaults){ + createBasicStandardEvent: function( type, defaults ) { var event; try { event = document.createEvent("Events"); @@ -369,7 +369,7 @@ extend(Syn,{ } return event; }, - inArray : function(item, array){ + inArray: function( item, array ) { for(var i =0; i < array.length; i++){ if(array[i] == item){ return i; @@ -377,11 +377,11 @@ extend(Syn,{ } return -1; }, - getWindow : function(element){ + getWindow: function( element ) { return element.ownerDocument.defaultView || element.ownerDocument.parentWindow }, extend: extend, - scrollOffset : function(win){ + scrollOffset: function( win ) { var doc = win.document.documentElement, body = win.document.body; return { @@ -390,7 +390,7 @@ extend(Syn,{ } }, - addOffset : function(options, el){ + addOffset: function( options, el ) { var jq = Syn.jquery(el) if(typeof options == 'object' && options.clientX === undefined && @@ -466,7 +466,7 @@ extend(Syn,{ }, // unique events focus : { - event : function(type, options, element){ + event: function( type, options, element ) { Syn.onParents(element, function(el){ if( Syn.isFocusable(el)){ if(el.nodeName.toLowerCase() != 'html'){ @@ -519,7 +519,7 @@ extend(Syn,{ * @param {HTMLElement} element * @return {Boolean} true if default events were run, false if otherwise. */ - trigger : function(type, options, element){ + trigger: function( type, options, element ) { options || (options = {}); var create = Syn.create, @@ -608,7 +608,7 @@ extend(Syn.init.prototype,{ * @param {String|HTMLElement} [element] A element's id or an element. If undefined, defaults to the previous element. * @param {Function} [callback] A function to callback after the action has run, but before any future chained actions are run. */ - then : function(type, options, element, callback){ + then: function( type, options, element, callback ) { if(Syn.autoDelay){ this.delay(); } @@ -640,7 +640,7 @@ extend(Syn.init.prototype,{ * @param {Number} [timeout] * @param {Function} [callback] */ - delay : function(timeout, callback){ + delay: function( timeout, callback ) { if(typeof timeout == 'function'){ callback = timeout; timeout = null; @@ -655,7 +655,7 @@ extend(Syn.init.prototype,{ }) return this; }, - done : function( defaults, el){ + done: function( defaults, el ) { el && (this.element = el);; if(this.queue.length){ this.queue.pop().call(this, this.element, defaults); @@ -689,7 +689,7 @@ extend(Syn.init.prototype,{ * @param {HTMLElement} element * @param {Function} callback */ - "_click" : function(options, element, callback, force){ + "_click" : function( options, element, callback, force ) { Syn.helpers.addOffset(options, element); Syn.trigger("mousedown", options, element); @@ -717,7 +717,7 @@ extend(Syn.init.prototype,{ * @param {Object} element * @param {Object} callback */ - "_rightClick" : function(options, element, callback){ + "_rightClick" : function( options, element, callback ) { Syn.helpers.addOffset(options, element); var mouseopts = extend( extend({},Syn.mouse.browser.right.mouseup ), options) @@ -746,7 +746,7 @@ extend(Syn.init.prototype,{ * @param {HTMLElement} element * @param {Function} callback */ - "_dblclick" : function(options, element, callback){ + "_dblclick" : function( options, element, callback ) { Syn.helpers.addOffset(options, element); var self = this; this._click(options, element, function(){ diff --git a/synthetic/test/qunit/key_test.js b/synthetic/test/qunit/key_test.js index 1e7ad396..d9ffb425 100644 --- a/synthetic/test/qunit/key_test.js +++ b/synthetic/test/qunit/key_test.js @@ -1,5 +1,5 @@ module("funcunit/synthetic/key",{ - setup : function(){ + setup: function() { st.g("qunit-test-area").innerHTML = "
    "+ "
    "+ ""+ @@ -130,17 +130,17 @@ asyncTest("page down, page up, home, end", function(){ //list of keys to press and what to test after the scroll event var keyTest = { - "page-down": function(){ + "page-down": function() { ok( st.g("scrolldiv").scrollTop > 10 , "Moved down") }, - "page-up": function(){ + "page-up": function() { ok( st.g("scrolldiv").scrollTop == 0 , "Moved back up (page-up)") }, - "end" : function(){ + "end" : function() { var sd = st.g("scrolldiv") ok( sd.scrollTop == sd.scrollHeight - sd.clientHeight , "Moved to the end") }, - "home" : function(){ + "home" : function() { ok( st.g("scrolldiv").scrollTop == 0 , "Moved back up (home)") } }, diff --git a/synthetic/test/qunit/mouse_test.js b/synthetic/test/qunit/mouse_test.js index 4c60399c..b55e7118 100644 --- a/synthetic/test/qunit/mouse_test.js +++ b/synthetic/test/qunit/mouse_test.js @@ -1,5 +1,5 @@ module("funcunit/synthetic/mouse",{ - setup : function(){ + setup: function() { st.g("qunit-test-area").innerHTML = "
    "+ ""+ ""+ diff --git a/synthetic/test/qunit/synthetic_test.js b/synthetic/test/qunit/synthetic_test.js index 16f190b2..ee366236 100644 --- a/synthetic/test/qunit/synthetic_test.js +++ b/synthetic/test/qunit/synthetic_test.js @@ -1,17 +1,17 @@ module("funcunit/synthetic") st = { - g : function(id){ + g: function( id ) { return document.getElementById(id) }, - log :function(c){ + log: function( c ) { if(st.g("mlog")) st.g("mlog").innerHTML = st.g("mlog").innerHTML+c+"
    " }, - binder : function(id, ev, f){ + binder: function( id, ev, f ) { st.bind(st.g(id), ev, f) }, - unbinder : function(id, ev, f){ + unbinder: function( id, ev, f ) { st.unbind(st.g(id), ev, f) }, bind : window.addEventListener ? diff --git a/test/funcunit/funcunit_test.js b/test/funcunit/funcunit_test.js index 09929317..4ffc0d19 100644 --- a/test/funcunit/funcunit_test.js +++ b/test/funcunit/funcunit_test.js @@ -1,5 +1,5 @@ module("funcunit - jQuery API",{ - setup : function(){ + setup: function() { var self = this; S.open("test/myapp.html", function(){ self.pageIsLoaded = true; diff --git a/test/funcunit/protodrag_test.js b/test/funcunit/protodrag_test.js index cde950e0..e51ca809 100644 --- a/test/funcunit/protodrag_test.js +++ b/test/funcunit/protodrag_test.js @@ -1,5 +1,5 @@ module("funcunit-prototype / scriptaculous drag",{ - setup : function(){ + setup: function() { S.open("test/protodrag/myapp.html", null, 10000); } }) diff --git a/test/protodrag/funcunit_test.js b/test/protodrag/funcunit_test.js index ee95e346..3e31bd6e 100644 --- a/test/protodrag/funcunit_test.js +++ b/test/protodrag/funcunit_test.js @@ -1,5 +1,5 @@ module("myapp",{ - setup : function(){ + setup: function(){ S.open("demo/myapp.html") } })