Skip to content

Commit

Permalink
cleaning to follow jQuery's object literal conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbmeyer committed Aug 21, 2010
1 parent 5e0b4fd commit ed368aa
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion autosuggest/autosuggest_test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module("autosuggest",{
setup : function(){
setup: function() {
S.open('autosuggest.html')
}
});
Expand Down
28 changes: 14 additions & 14 deletions funcunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
});
Expand Down Expand Up @@ -83,7 +83,7 @@ test("JavaScript results",function(){
* <li>Create a JS file (<code>pages/mypage_test.js</code>) for your tests. The skeleton should like:
@codestart
module("APPNAME", {
setup : function(){
setup: function() {
// opens the page you want to test
$.open("myPage.html");
}
Expand Down Expand Up @@ -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'){
Expand All @@ -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;
}
Expand Down Expand Up @@ -554,7 +554,7 @@ support : {},
window : {
document: {}
},
_opened : function(){}
_opened: function() {}
});


Expand Down Expand Up @@ -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){
Expand All @@ -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;
Expand All @@ -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)
},
/**
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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}
}
Expand Down Expand Up @@ -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}
}
Expand All @@ -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";
Expand All @@ -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)
}
};
Expand Down
20 changes: 10 additions & 10 deletions synthetic/demo/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -15,7 +15,7 @@ $(function(){
}

},
done : function(){
done: function() {
ADD = true;
$("#code div").css("color","black")
}
Expand All @@ -28,7 +28,7 @@ $(function(){
mousemove,
mouseup,
h ={
commandsText : function(func){
commandsText: function( func ) {
var text = [],
command,
prev,
Expand All @@ -52,7 +52,7 @@ $(function(){
}
return text.join("")
},
addCode : function(type, options, target){
addCode: function( type, options, target ) {
if(!ADD){
return;
}
Expand All @@ -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",
Expand All @@ -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){
Expand All @@ -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);
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions synthetic/drag/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down
Loading

0 comments on commit ed368aa

Please sign in to comment.