diff --git a/README b/README index 12846a17..f6a8a73b 100644 --- a/README +++ b/README @@ -5,20 +5,20 @@ TOC: A. How to get (and contribute) JMVC 1. Start a new project in git. - + 2. Fork .... - http://github.com/jupiterjs/steal and + http://github.com/jupiterjs/steal and http://github.com/jupiterjs/jquerymx - + 3. Add steal and javascriptmvc as submodules of your project... git submodule add git@github.com:_YOU_/steal.git steal git submodule add git@github.com:_YOU_/jquerymx.git jquery - + * Notice javascriptmvc is under the jquery folder - + 4. Learn a little more about submodules ... http://johnleach.co.uk/words/archives/2008/10/12/323/git-submodules-in-n-easy-steps - + 5. Make changes in steal or jmvc, and push them back to your fork. - + 6. Make a pull request to your fork. diff --git a/build.js b/build.js index 1d840746..fb38e236 100644 --- a/build.js +++ b/build.js @@ -2,12 +2,12 @@ load('steal/rhino/rhino.js') -var i, fileName, cmd, +var i, fileName, cmd, plugins = [ - "class" , + "class" , "controller", { - plugin: "controller/subscribe", + plugin: "controller/subscribe", exclude: ["jquery/controller/controller.js", "jquery/class/class.js", "jquery/lang/lang.js", @@ -19,16 +19,16 @@ var i, fileName, cmd, "event/pause", "event/resize", { - plugin: "event/drag/limit", + plugin: "event/drag/limit", exclude: ["jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]}, { - plugin: "event/drag/scroll", + plugin: "event/drag/scroll", exclude: ["jquery/dom/within/within.js", "jquery/dom/compare/compare.js", "jquery/event/drop/drop.js","jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]}, { plugin: "event/drop", exclude: ["jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]}, "event/hover", - "view/ejs", + "view/ejs", "dom/closest", "dom/compare", { @@ -37,7 +37,7 @@ var i, fileName, cmd, }, "dom/fixture", "dom/form_params", - "dom/within", + "dom/within", "dom/cur_styles", "model", { @@ -109,14 +109,14 @@ var plugin, exclude, fileDest, fileName; out: fileDest, exclude: exclude.length? exclude: false }) - - + + var outBaos = new java.io.ByteArrayOutputStream(); var output = new java.io.PrintStream(outBaos); runCommand("java", "-jar", "steal/build/scripts/compiler.jar", "--compilation_level", "SIMPLE_OPTIMIZATIONS", "--warning_level", "QUIET", "--js", fileDest, { output: output }); - + var minFileDest = fileDest.replace(".js", ".min.js") new steal.File(minFileDest).save(outBaos.toString()); } @@ -133,13 +133,13 @@ for (i = 0; i < plugins.length; i++) { } fileName = fileName || "jquery." + plugin.replace(/\//g, ".").replace(/dom\./, "").replace(/\_/, "") + ".js"; fileDest = "jquery/dist/" + fileName - // compress + // compress var outBaos = new java.io.ByteArrayOutputStream(); var output = new java.io.PrintStream(outBaos); runCommand("java", "-jar", "steal/build/scripts/compiler.jar", "--compilation_level", "SIMPLE_OPTIMIZATIONS", "--warning_level", "QUIET", "--js", fileDest, { output: output }); - + var minFileDest = fileDest.replace(".js", ".min.js") new steal.File(minFileDest).save(outBaos.toString()); print("***" + fileName + " pluginified and compressed") diff --git a/buildAll.js b/buildAll.js index 95b0a721..87f6ca13 100644 --- a/buildAll.js +++ b/buildAll.js @@ -9,13 +9,13 @@ load('steal/rhino/rhino.js') steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( function(s){ var ignore = /\.\w+|test|generate|dist|qunit|fixtures|pages/ - + var plugins = [], /** * {"path/to/file.js" : ["file2/thing.js", ...]} */ files = {}; - + s.File('jquery').contents(function( name, type, current ) { if (type !== 'file' && !ignore.test(name)) { var folder = current+"/"+name; @@ -24,20 +24,20 @@ steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( fu plugins.push(folder); steal.File(folder).contents(arguments.callee, folder) } - + //steal.File(path + "/" + (current ? current + "/" : "") + name).contents(arguments.callee, (current ? current + "/" : "") + name); } },"jquery"); - + // tell it to load all plugins into this page - + //steal.win().build_in_progress = true; print(" LOADING APP ") steal.build.open('steal/rhino/blank.html', { startFiles: plugins }, function(opener){ - + opener.each('js', function(options, text, stl){ print(options.rootSrc) var dependencies = files[options.rootSrc] = []; @@ -50,7 +50,7 @@ steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( fu } } }) - + s.File("jquery/dist/standalone").mkdirs(); s.File("jquery/dist/standalone/dependencies.json").save($.toJSON(files)); //get each file ... @@ -74,9 +74,9 @@ steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( fu s.File("jquery/dist/standalone/"+out+".js").save(content); s.File("jquery/dist/standalone/"+out+".min.js").save(compressor(content)); } - + }) - + /* var pageSteal = steal.build.open("steal/rhino/empty.html").steal, steals = pageSteal.total, @@ -91,21 +91,21 @@ steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( fu print("123 " + depend.path); //depends(depend, steals); } - - + + } } }, all = function(c){ for(var i =0; i < steals.length; i++){ var pSteal =steals[i]; - + if(!pSteal.func){ c(pSteal) } - + } - + }; print(" LOADED, GETTING DEPENDS"); all(function(stl){ @@ -123,8 +123,8 @@ steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( fu } } })*/ - - - + + + }) \ No newline at end of file diff --git a/class/class.html b/class/class.html index ef16143d..4a29f26e 100644 --- a/class/class.html +++ b/class/class.html @@ -6,7 +6,7 @@ @@ -16,12 +16,12 @@ diff --git a/controller/subscribe/subscribe.js b/controller/subscribe/subscribe.js index 26280343..4af33b2c 100644 --- a/controller/subscribe/subscribe.js +++ b/controller/subscribe/subscribe.js @@ -6,23 +6,23 @@ steal('jquery/controller', 'jquery/lang/openajax').then(function() { * @parent jQuery.Controller.static.processors * @plugin jquery/controller/subscribe * Adds OpenAjax.Hub subscribing to controllers. - * + * * $.Controller("Subscriber",{ * "recipe.updated subscribe" : function(called, recipe){ - * + * * }, * "todo.* subscribe" : function(called, todo){ - * + * * } * }) - * + * * You should typically be listening to jQuery triggered events when communicating between * controllers. Subscribe should be used for listening to model changes. - * + * * ### API - * + * * This is the call signiture for the processor, not the controller subscription callbacks. - * + * * @param {HTMLElement} el the element being bound. This isn't used. * @param {String} event the event type (subscribe). * @param {String} selector the subscription name diff --git a/controller/view/test/qunit/controller_view_test.js b/controller/view/test/qunit/controller_view_test.js index 506da897..ff66cfa6 100644 --- a/controller/view/test/qunit/controller_view_test.js +++ b/controller/view/test/qunit/controller_view_test.js @@ -1,10 +1,10 @@ steal('jquery/controller/view','jquery/view/micro','funcunit/qunit') //load qunit .then(function(){ - + module("jquery/controller/view"); - + test("this.view", function(){ - + $.Controller.extend("jquery.Controller.View.Test.Qunit",{ init: function() { this.element.html(this.view()) @@ -12,36 +12,36 @@ steal('jquery/controller/view','jquery/view/micro','funcunit/qunit') //load qun }) jQuery.View.ext = ".micro"; $("#qunit-test-area").append("
"); - + new jquery.Controller.View.Test.Qunit( $('#cont_view') ); - + ok(/Hello World/i.test($('#cont_view').text()),"view rendered") }); - + test("test.suffix.doubling", function(){ - + $.Controller.extend("jquery.Controller.View.Test.Qunit",{ init: function() { this.element.html(this.view('init.micro')) } }) - + jQuery.View.ext = ".ejs"; // Reset view extension to default - equal(".ejs", jQuery.View.ext); - + equal(".ejs", jQuery.View.ext); + $("#qunit-test-area").append("
"); - + new jquery.Controller.View.Test.Qunit( $('#suffix_test_cont_view') ); - + ok(/Hello World/i.test($('#suffix_test_cont_view').text()),"view rendered") }); - + test("complex paths nested inside a controller directory", function(){ $.Controller.extend("Myproject.Controllers.Foo.Bar"); - + var path = jQuery.Controller._calculatePosition(Myproject.Controllers.Foo.Bar, "init.ejs", "init") equals(path, "//myproject/views/foo/bar/init.ejs", "view path is correct") - + $.Controller.extend("Myproject.Controllers.FooBar"); path = jQuery.Controller._calculatePosition(Myproject.Controllers.FooBar, "init.ejs", "init") equals(path, "//myproject/views/foo_bar/init.ejs", "view path is correct") diff --git a/controller/view/test/qunit/qunit.js b/controller/view/test/qunit/qunit.js index 7873c312..b02f4079 100644 --- a/controller/view/test/qunit/qunit.js +++ b/controller/view/test/qunit/qunit.js @@ -2,4 +2,4 @@ steal('jquery/controller/view','jquery/view/micro') //load your app .then('funcunit/qunit') //load qunit .then("./controller_view_test.js") - + diff --git a/controller/view/view.js b/controller/view/view.js index 5c05345f..6ca99002 100644 --- a/controller/view/view.js +++ b/controller/view/view.js @@ -4,7 +4,7 @@ steal('jquery/controller', 'jquery/view').then(function( $ ) { }; jQuery.Controller._calculatePosition = function( Class, view, action_name ) { - + var classParts = Class.fullName.split('.'), classPartsWithoutPrefix = classParts.slice(0); classPartsWithoutPrefix.splice(0, 2); // Remove prefix (usually 2 elements) @@ -14,7 +14,7 @@ steal('jquery/controller', 'jquery/view').then(function( $ ) { path = hasControllers? jQuery.String.underscore(classParts[0]): jQuery.String.underscore(classParts.join("/")), controller_name = jQuery.String.underscore(classPartsWithoutPrefix.join('/')).toLowerCase(), suffix = (typeof view == "string" && /\.[\w\d]+$/.test(view)) ? "" : jQuery.View.ext; - + //calculate view if ( typeof view == "string" ) { if ( view.substr(0, 2) == "//" ) { //leave where it is @@ -66,17 +66,17 @@ steal('jquery/controller', 'jquery/view').then(function( $ ) { /** * @tag view * Renders a View template with the controller instance. If the first argument - * is not supplied, + * is not supplied, * it looks for a view in /views/controller_name/action_name.ejs. * If data is not provided, it uses the controller instance as data. * @codestart * TasksController = $.Controller.extend('TasksController',{ * click: function( el ) { * // renders with views/tasks/click.ejs - * el.html( this.view() ) + * el.html( this.view() ) * // renders with views/tasks/under.ejs * el.after( this.view("under", [1,2]) ); - * // renders with views/tasks/under.micro + * // renders with views/tasks/under.micro * el.after( this.view("under.micro", [1,2]) ); * // renders with views/shared/top.ejs * el.before( this.view("shared/top", {phrase: "hi"}) ); @@ -87,7 +87,7 @@ steal('jquery/controller', 'jquery/view').then(function( $ ) { * @return {String} the rendered result of the view. * @param {String} [view] The view you are going to render. If a view isn't explicity given * this function will try to guess at the correct view as show in the example code above. - * @param {Object} [data] data to be provided to the view. If not present, the controller instance + * @param {Object} [data] data to be provided to the view. If not present, the controller instance * is used. * @param {Object} [myhelpers] an object of helpers that will be available in the view. If not present * this controller class's "Helpers" property will be used. diff --git a/dom/closest/closest.js b/dom/closest/closest.js index 14ac24da..903e776d 100644 --- a/dom/closest/closest.js +++ b/dom/closest/closest.js @@ -6,16 +6,16 @@ steal('jquery/dom').then(function(){ * @function closest * @parent dom * @plugin jquery/dom/closest - * Overwrites closest to allow open > selectors. This allows controller + * Overwrites closest to allow open > selectors. This allows controller * actions such as: - * + * * ">li click" : function( el, ev ) { ... } */ var oldClosest = jQuery.fn.closest; jQuery.fn.closest = function(selectors, context){ var rooted = {}, res, result, thing, i, j, selector, rootedIsEmpty = true, selector, selectorsArr = selectors; if(typeof selectors == "string") selectorsArr = [selectors]; - + $.each(selectorsArr, function(i, selector){ if(selector.indexOf(">") == 0 ){ if(selector.indexOf(" ") != -1){ @@ -26,9 +26,9 @@ steal('jquery/dom').then(function(){ rootedIsEmpty = false; } }) - + res = oldClosest.call(this, selectors, context); - + if(rootedIsEmpty) return res; i =0; while(i < res.length){ diff --git a/dom/compare/compare.html b/dom/compare/compare.html index 83c356a8..2bbddbee 100644 --- a/dom/compare/compare.html +++ b/dom/compare/compare.html @@ -56,11 +56,11 @@

Key

0001004Node A precedes Node B. 0010008Node B contains Node A. 01000016Node A contains Node B. - + - diff --git a/dom/form_params/form_params.js b/dom/form_params/form_params.js index a47ca517..dd5a9fb4 100644 --- a/dom/form_params/form_params.js +++ b/dom/form_params/form_params.js @@ -24,10 +24,10 @@ steal("jquery/dom").then(function( $ ) { * @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/dom/form_params/form_params.js * @plugin jquery/dom/form_params * @test jquery/dom/form_params/qunit.html - * - * Returns an object of name-value pairs that represents values in a form. + * + * Returns an object of name-value pairs that represents values in a form. * It is able to nest values whose element's name has square brackets. - * + * * Example html: * @codestart html * <form> @@ -36,12 +36,12 @@ steal("jquery/dom").then(function( $ ) { * <form/> * @codeend * Example code: - * + * * $('form').formParams() //-> { foo:{bar:'2', ced: '4'} } - * - * + * + * * @demo jquery/dom/form_params/form_params.html - * + * * @param {Boolean} [convert=false] True if strings that look like numbers and booleans should be converted. Defaults to true. * @return {Object} An object of name-value pairs. */ diff --git a/dom/form_params/form_params_test.js b/dom/form_params/form_params_test.js index 44c2c2b1..72e40fdb 100644 --- a/dom/form_params/form_params_test.js +++ b/dom/form_params/form_params_test.js @@ -5,12 +5,12 @@ steal("jquery/dom/form_params") //load your app $.ajaxSetup({ cache : false }); - + module("jquery/dom/form_params") test("with a form", function(){ $("#qunit-test-area").html("//jquery/dom/form_params/test/basics.micro",{}) - + var formParams = $("#qunit-test-area form").formParams() ; ok(formParams.params.one === "1","one is right"); ok(formParams.params.two === "2","two is right"); @@ -20,13 +20,13 @@ test("with a form", function(){ equal(typeof formParams.id , 'string', "Id value is empty"); - + }); test("with true false", function(){ $("#qunit-test-area").html("//jquery/dom/form_params/test/truthy.micro",{}); - + var formParams = $("#qunit-test-area form").formParams(true); ok(formParams.foo === undefined, "foo is undefined") ok(formParams.bar.abc === true, "form bar is true"); diff --git a/dom/form_params/test/basics.micro b/dom/form_params/test/basics.micro index 5c5b5be8..94c4dbd4 100644 --- a/dom/form_params/test/basics.micro +++ b/dom/form_params/test/basics.micro @@ -8,19 +8,19 @@ - + - - + + - - + + diff --git a/dom/form_params/test/checkbox.micro b/dom/form_params/test/checkbox.micro index f4214373..6049c49e 100644 --- a/dom/form_params/test/checkbox.micro +++ b/dom/form_params/test/checkbox.micro @@ -1,20 +1,20 @@ -
-
-
- -
- -
-
-
Reference
-
+ +
+
+ +
+ +
+
+
Reference
+
-
- +
+ - -
-
- - - \ No newline at end of file + +
+ + + + \ No newline at end of file diff --git a/dom/form_params/test/truthy.micro b/dom/form_params/test/truthy.micro index d12fdba5..61e449ab 100644 --- a/dom/form_params/test/truthy.micro +++ b/dom/form_params/test/truthy.micro @@ -1,5 +1,5 @@
- + diff --git a/dom/range/range.html b/dom/range/range.html index b5f9d139..2ce828f7 100644 --- a/dom/range/range.html +++ b/dom/range/range.html @@ -29,9 +29,9 @@

The Range Plugin

We'll figure out what to do with form elements later.


 		
- \ No newline at end of file diff --git a/dom/range/range.js b/dom/range/range.js index 7f3db253..412136b2 100644 --- a/dom/range/range.js +++ b/dom/range/range.js @@ -5,9 +5,9 @@ steal('jquery','jquery/dom/compare').then(function($){ /** * @function jQuery.fn.range * @parent $.Range - * + * * Returns a jQuery.Range for the element selected. - * + * * $('#content').range() */ $.fn.range = function(){ @@ -16,7 +16,7 @@ $.fn.range = function(){ var convertType = function(type){ return type.replace(/([a-z])([a-z]+)/gi, function(all,first, next){ - return first+next.toLowerCase() + return first+next.toLowerCase() }).replace(/_/g,""); }, reverse = function(type){ @@ -30,7 +30,7 @@ getWindow = function( element ) { bisect = function(el, start, end){ //split the start and end ... figure out who is touching ... if(end-start == 1){ - return + return } }, support = {}; @@ -38,46 +38,46 @@ support = {}; * @Class jQuery.Range * @parent dom * @tag alpha - * - * Provides text range helpers for creating, moving, + * + * Provides text range helpers for creating, moving, * and comparing ranges cross browser. - * + * * ## Examples - * + * * // Get the current range * var range = $.Range.current() - * + * * // move the end of the range 2 characters right * range.end("+2") - * + * * // get the startOffset of the range and the container * range.start() //-> { offset: 2, container: HTMLELement } - * + * * //get the most common ancestor element * var parent = range.parent() - * + * * //select the parent * var range2 = new $.Range(parent) - * + * * @constructor - * + * * Returns a jQuery range object. - * - * @param {TextRange|HTMLElement|Point} [range] An object specifiying a + * + * @param {TextRange|HTMLElement|Point} [range] An object specifiying a * range. Depending on the object, the selected text will be different. $.Range supports the - * following types - * + * following types + * * - __undefined or null__ - returns a range with nothing selected * - __HTMLElement__ - returns a range with the node's text selected * - __Point__ - returns a range at the point on the screen. The point can be specified like: - * + * * //client coordinates * {clientX: 200, clientY: 300} - * + * * //page coordinates - * {pageX: 200, pageY: 300} + * {pageX: 200, pageY: 300} * {top: 200, left: 300} - * + * * - __TextRange__ a raw text range object. */ $.Range = function(range){ @@ -98,7 +98,7 @@ $.Range = function(range){ if(range){ this.select(range) } - + } else if (range.clientX != null || range.pageX != null || range.left != null) { this.moveToPoint(range) } else if (range.originalEvent && range.originalEvent.touches && range.originalEvent.touches.length) { @@ -107,7 +107,7 @@ $.Range = function(range){ this.moveToPoint(range.originalEvent.changedTouches[0]) } else { this.range = range; - } + } }; /** * @static @@ -115,9 +115,9 @@ $.Range = function(range){ $.Range. /** * Gets the current range. - * + * * $.Range.current() //-> jquery.range - * + * * @param {HTMLElement} [el] an optional element used to get selection for a given window. * @return {jQuery.Range} a jQuery.Range wrapped range. */ @@ -150,33 +150,33 @@ $.extend($.Range.prototype, this.range.moveToPoint(clientX, clientY); return this; } - - + + // it's some text node in this range ... var parent = document.elementFromPoint(clientX, clientY); - + //typically it will be 'on' text for(var n=0; n < parent.childNodes.length; n++){ var node = parent.childNodes[n]; if(node.nodeType === 3 || node.nodeType === 4){ var range = $.Range(node), length = range.toString().length; - - + + // now lets start moving the end until the boundingRect is within our range - + for(var i = 1; i < length+1; i++){ var rect = range.end(i).rect(); if(rect.left <= clientX && rect.left+rect.width >= clientX && rect.top <= clientY && rect.top+rect.height >= clientY ){ - range.start(i-1); + range.start(i-1); this.range = range.range; - return; + return; } } } } - + // if not 'on' text, recursively go through and find out when we shift to next // 'line' var previous; @@ -194,19 +194,19 @@ $.extend($.Range.prototype, }else{ this.range = $.Range(parent).range } - + }, - + window : function(){ return this.win || window; }, /** * Return true if any portion of these two ranges overlap. - * + * * var foo = document.getElementById('foo'); - * + * * $.Range(foo.childNodes[0]).compare(foo.childNodes[1]) //-> false - * + * * @param {jQuery.Range} elRange * @return {Boolean} true if part of the ranges overlap, false if otherwise. */ @@ -217,7 +217,7 @@ $.extend($.Range.prototype, //if the start is within the element ... var startToStart = this.compare("START_TO_START", elRange), endToEnd = this.compare("END_TO_END", elRange) - + // if we wrap elRange if(startToStart <=0 && endToEnd >=0){ return true; @@ -236,9 +236,9 @@ $.extend($.Range.prototype, }, /** * Collapses a range - * + * * $('#foo').range().collapse() - * + * * @param {Boolean} [toStart] true if to the start of the range, false if to the * end. Defaults to false. * @return {jQuery.Range} returns the range for chaining. @@ -249,9 +249,9 @@ $.extend($.Range.prototype, }, /** * Returns the text of the range. - * + * * currentText = $.Range.current().toString() - * + * * @return {String} the text of the range */ toString : function(){ @@ -259,28 +259,28 @@ $.extend($.Range.prototype, }, /** * Gets or sets the start of the range. - * + * * If a value is not provided, start returns the range's starting container and offset like: - * - * $('#foo').range().start() //-> {container: fooElement, offset: 0 } - * + * + * $('#foo').range().start() //-> {container: fooElement, offset: 0 } + * * If a set value is provided, it can set the range. The start of the range is set differently * depending on the type of set value: - * + * * - __Object__ - an object with the new starting container and offset is provided like - * + * * $.Range().start({container: $('#foo')[0], offset: 20}) - * + * * - __Number__ - the new offset value. The container is kept the same. - * + * * - __String__ - adjusts the offset by converting the string offset to a number and adding it to the current * offset. For example, the following moves the offset forward four characters: - * + * * $('#foo').range().start("+4") - * - * + * + * * @param {Object|String|Number} [set] a set value if setting the start of the range or nothing if reading it. - * @return {jQuery.Range|Object} if setting the start, the range is returned for chaining, otherwise, the + * @return {jQuery.Range|Object} if setting the start, the range is returned for chaining, otherwise, the * start offset and container are returned. */ start : function(set){ @@ -313,11 +313,11 @@ $.extend($.Range.prototype, } return this; } - - + + }, /** - * Sets or gets the end of the range. + * Sets or gets the end of the range. * It takes similar options as [jQuery.Range.prototype.start]. * @param {Object} [set] */ @@ -352,7 +352,7 @@ $.extend($.Range.prototype, } }, /** - * Returns the most common ancestor element of + * Returns the most common ancestor element of * the endpoints in the range. This will return text elements if the range is * within a text element. * @return {HTMLNode} the TextNode or HTMLElement @@ -362,10 +362,10 @@ $.extend($.Range.prototype, if(this.range.commonAncestorContainer){ return this.range.commonAncestorContainer; } else { - + var parentElement = this.range.parentElement(), range = this.range; - + // IE's parentElement will always give an element, we want text ranges iterate(parentElement.childNodes, function(txtNode){ if($.Range(txtNode).range.inRange( range ) ){ @@ -374,17 +374,17 @@ $.extend($.Range.prototype, return false; } }); - + return parentElement; - } + } }, /** * Returns the bounding rectangle of this range. - * - * @param {String} [from] - where the coordinates should be + * + * @param {String} [from] - where the coordinates should be * positioned from. By default, coordinates are given from the client viewport. * But if 'page' is given, they are provided relative to the page. - * + * * @return {TextRectangle} - The client rects. */ rect : function(from){ @@ -399,7 +399,7 @@ $.extend($.Range.prototype, }, /** * Returns client rects - * @param {String} [from] how the rects coordinates should be given (viewport or page). Provide 'page' for + * @param {String} [from] how the rects coordinates should be given (viewport or page). Provide 'page' for * rect coordinates from the page. */ rects : function(from){ @@ -409,11 +409,11 @@ $.extend($.Range.prototype, i=0,j, len = rects.length; //return rects; - //rects are sorted, largest to smallest + //rects are sorted, largest to smallest while(i < rects.length){ var cur = rects[i], found = false; - + j = i+1; for(j = i+1; j < rects.length; j++){ if( withinRect(cur, rects[j] ) ) { @@ -426,8 +426,8 @@ $.extend($.Range.prototype, }else{ i++; } - - + + } // safari will be return overlapping ranges ... if(from == 'page'){ @@ -439,127 +439,127 @@ $.extend($.Range.prototype, return i; }) } - - + + return rects; } - + }); (function(){ //method branching .... var fn = $.Range.prototype, range = $.Range().range; - + /** * @function compare - * Compares one range to another range. - * + * Compares one range to another range. + * * ## Example - * + * * // compare the highlight element's start position * // to the start of the current range * $('#highlight') * .range() * .compare('START_TO_START', $.Range.current()) - * - * + * + * * * @param {Object} type Specifies the boundry of the * range and the compareRange to compare. - * + * * - START\_TO\_START - the start of the range and the start of compareRange * - START\_TO\_END - the start of the range and the end of compareRange * - END\_TO\_END - the end of the range and the end of compareRange * - END\_TO\_START - the end of the range and the start of compareRange - * + * * @param {$.Range} compareRange The other range * to compare against. * @return {Number} a number indicating if the range * boundary is before, - * after, or equal to compareRange's + * after, or equal to compareRange's * boundary where: - * + * * - -1 - the range boundary comes before the compareRange boundary * - 0 - the boundaries are equal * - 1 - the range boundary comes after the compareRange boundary */ - fn.compare = range.compareBoundaryPoints ? + fn.compare = range.compareBoundaryPoints ? function(type, range){ return this.range.compareBoundaryPoints(this.window().Range[reverse( type )], range.range) - }: + }: function(type, range){ return this.range.compareEndPoints(convertType(type), range.range) } - + /** * @function move * Move the endpoints of a range relative to another range. - * - * // Move the current selection's end to the + * + * // Move the current selection's end to the * // end of the #highlight element * $.Range.current().move('END_TO_END', * $('#highlight').range() ) - * - * + * + * * @param {String} type a string indicating the ranges boundary point * to move to which referenceRange boundary point where: - * + * * - START\_TO\_START - the start of the range moves to the start of referenceRange * - START\_TO\_END - the start of the range move to the end of referenceRange * - END\_TO\_END - the end of the range moves to the end of referenceRange * - END\_TO\_START - the end of the range moves to the start of referenceRange - * + * * @param {jQuery.Range} referenceRange * @return {jQuery.Range} the original range for chaining */ - fn.move = range.setStart ? + fn.move = range.setStart ? function(type, range){ - + var rangesRange = range.range; switch(type){ - case "START_TO_END" : + case "START_TO_END" : this.range.setStart(rangesRange.endContainer, rangesRange.endOffset) break; - case "START_TO_START" : + case "START_TO_START" : this.range.setStart(rangesRange.startContainer, rangesRange.startOffset) break; - case "END_TO_END" : + case "END_TO_END" : this.range.setEnd(rangesRange.endContainer, rangesRange.endOffset) break; - case "END_TO_START" : + case "END_TO_START" : this.range.setEnd(rangesRange.startContainer, rangesRange.startOffset) break; } - + return this; }: - function(type, range){ + function(type, range){ this.range.setEndPoint(convertType(type), range.range) return this; }; var cloneFunc = range.cloneRange ? "cloneRange" : "duplicate", selectFunc = range.selectNodeContents ? "selectNodeContents" : "moveToElementText"; - + fn. /** - * Clones the range and returns a new $.Range + * Clones the range and returns a new $.Range * object. - * + * * @return {jQuery.Range} returns the range as a $.Range. */ clone = function(){ return $.Range( this.range[cloneFunc]() ); }; - + fn. /** * @function - * Selects an element with this range. If nothing + * Selects an element with this range. If nothing * is provided, makes the current * range appear as if the user has selected it. - * + * * This works with text nodes. - * + * * @param {HTMLElement} [el] * @return {jQuery.Range} the range for chaining. */ @@ -587,15 +587,15 @@ $.extend($.Range.prototype, } }) this.range.moveToElementText(parent); - + this.range.moveEnd('character', end - this.range.text.length) this.range.moveStart('character', start); - } else { + } else { this.range.moveToElementText(el); } return this; }; - + })(); @@ -614,7 +614,7 @@ var iterate = function(elems, cb){ } // Traverse everything else, except comment nodes } - else + else if (elem.nodeType !== 8) { if (iterate(elem.childNodes, cb) === false) { return false; @@ -622,23 +622,23 @@ var iterate = function(elems, cb){ } } -}, +}, supportWhitespace, isWhitespace = function(el){ if(supportWhitespace == null){ supportWhitespace = 'isElementContentWhitespace' in el; } - return (supportWhitespace? el.isElementContentWhitespace : + return (supportWhitespace? el.isElementContentWhitespace : (el.nodeType === 3 && '' == el.data.trim())); -}, +}, // if a point is within a rectangle within = function(rect, point){ return rect.left <= point.clientX && rect.left + rect.width >= point.clientX && rect.top <= point.clientY && rect.top + rect.height >= point.clientY -}, +}, // if a rectangle is within another rectangle withinRect = function(outer, inner){ return within(outer, { @@ -657,12 +657,12 @@ withinRect = function(outer, inner){ clientX: inner.left + inner.width, clientY: inner.top + inner.height }) //bottom right -}, +}, // gets the scroll offset from a window scrollOffset = function( win){ var win = win ||window; doc = win.document.documentElement, body = win.document.body; - + return { left: (doc && doc.scrollLeft || body && body.scrollLeft || 0) + (doc.clientLeft || 0), top: (doc && doc.scrollTop || body && body.scrollTop || 0) + (doc.clientTop || 0) diff --git a/dom/range/range_test.js b/dom/range/range_test.js index e55246e4..0e380438 100644 --- a/dom/range/range_test.js +++ b/dom/range/range_test.js @@ -1,5 +1,5 @@ steal("funcunit/qunit", "jquery/dom/range", "jquery/dom/selection").then(function(){ - + module("jquery/dom/range"); test("basic range", function(){ @@ -13,13 +13,13 @@ test("basic range", function(){ test('jQuery helper', function(){ - + $("#qunit-test-area").html("
thisTextIsSelected
") - + var range = $('#selectMe').range(); - + equals(range.toString(), "thisTextIsSelected") - + }); test("constructor with undefined", function(){ @@ -31,13 +31,13 @@ test("constructor with undefined", function(){ }); test("constructor with element", function(){ - + $("#qunit-test-area").html("
thisTextIsSelected
") - + var range = $.Range($('#selectMe')[0]); - + equals(range.toString(), "thisTextIsSelected") - + }); test('selecting text nodes and parent', function(){ @@ -52,9 +52,9 @@ test('selecting text nodes and parent', function(){ test('parent', function(){ $("#qunit-test-area").html("
thisTextIsSelected
") var txt = $('#selectMe')[0].childNodes[0] - + var range = $.Range(txt); - + equals(range.parent(), txt) }); @@ -66,7 +66,7 @@ test("constructor with point", function(){ top: "0px", border: "solid 1px black" }) - + $("#qunit-test-area").html(""); floater.appendTo(document.body); @@ -79,13 +79,13 @@ test("constructor with point", function(){ test('current', function(){ $("#qunit-test-area").html("
thisTextIsSelected
"); $('#selectMe').range().select(); - + var range = $.Range.current(); equals(range.toString(), "thisTextIsSelected" ) }) test('rangeFromPoint', function(){ - + }); test('overlaps', function(){}); @@ -131,7 +131,7 @@ test("nested range", function(){ equals(range.start().container.data, "012", "start is 012") equals(range.end().container.data, "4", "last char is 4") }); - + test("rect", function(){ $("#qunit-test-area") .html("

0123456789

"); @@ -143,7 +143,7 @@ test("nested range", function(){ ok(rect.left, "left non-zero") ok(rect.top, "top non-zero") }); - + test("collapsed rect", function(){ $("#qunit-test-area") .html("

0123456789

"); @@ -177,7 +177,7 @@ test("nested range", function(){ $('#1').selection(3,56); var range = $.Range.current(), rects = range.rects(); - equals(rects.length, 2, "2 rects found") + equals(rects.length, 2, "2 rects found") ok(rects[1].width, "rect has width") }); diff --git a/dom/route/route.html b/dom/route/route.html index 84071408..984f5898 100644 --- a/dom/route/route.html +++ b/dom/route/route.html @@ -28,7 +28,7 @@

$.Route Demo

#!pages/// #!/val1/val2
- URLs without paths: + URLs without paths: #!pages// #!///
@@ -55,12 +55,12 @@

Data update events:

diff --git a/download/download.js b/download/download.js index 0901782b..dd67ddfb 100644 --- a/download/download.js +++ b/download/download.js @@ -3,13 +3,13 @@ dependencies: [], pluginData: null, ready: function(){ - $.getJSON('../dist/standalone/dependencies.json', + $.getJSON('../dist/standalone/dependencies.json', function(data){ $.Downloader.pluginData = data; }); - $('#pluginForm').delegate("input[type=checkbox]", "change", + $('#pluginForm').delegate("input[type=checkbox]", "change", $.proxy($.Downloader.changeHandler, $.Downloader)); - + // append css if necessary if(location.search && /csspath/.test(location.search)){ var path = location.search.split("=")[1]; @@ -21,7 +21,7 @@ cssNode.media = 'screen'; headID.appendChild(cssNode); } - + $.Downloader.setupWordbreaks(); }, // inject characters in labels @@ -55,7 +55,7 @@ } }, /** - * Push a list of plugins to the current list. If there's a duplicate, + * Push a list of plugins to the current list. If there's a duplicate, * delete the other one first. * @param {Object} dependencies an array of plugins to add to the list */ @@ -72,14 +72,14 @@ /** * Recursively gets the array of dependencies for each plugin * @param {String} name the name of the plugin - * @param {Boolean} includeSelf whether it should return with its own + * @param {Boolean} includeSelf whether it should return with its own * plugin name included */ _getDependencies: function(name){ var dependencies = this.pluginData[name], totalDependencies = [], lowerDependencies, i, j; - if(!dependencies.length || + if(!dependencies.length || (dependencies.length == 1 && dependencies[0] == "jquery/jquery.js")) { return [name]; } diff --git a/download/test/jquery-1.4.3.js b/download/test/jquery-1.4.3.js index ad9a79c4..f186d911 100644 --- a/download/test/jquery-1.4.3.js +++ b/download/test/jquery-1.4.3.js @@ -75,10 +75,10 @@ var jQuery = function( selector, context ) { // For matching the engine and version of the browser browserMatch, - + // Has the ready events already been bound? readyBound = false, - + // The functions to execute on DOM ready readyList = [], @@ -92,7 +92,7 @@ var jQuery = function( selector, context ) { slice = Array.prototype.slice, trim = String.prototype.trim, indexOf = Array.prototype.indexOf, - + // [[Class]] -> type pairs class2type = {}; @@ -111,7 +111,7 @@ jQuery.fn = jQuery.prototype = { this.length = 1; return this; } - + // The body element only exists once, optimize finding it if ( selector === "body" && !context && document.body ) { this.context = document; @@ -150,9 +150,9 @@ jQuery.fn = jQuery.prototype = { ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; } - + return jQuery.merge( this, selector ); - + // HANDLE: $("#id") } else { elem = document.getElementById( match[2] ); @@ -245,7 +245,7 @@ jQuery.fn = jQuery.prototype = { if ( jQuery.isArray( elems ) ) { push.apply( ret, elems ); - + } else { jQuery.merge( ret, elems ); } @@ -271,7 +271,7 @@ jQuery.fn = jQuery.prototype = { each: function( callback, args ) { return jQuery.each( this, callback, args ); }, - + ready: function( fn ) { // Attach the listeners jQuery.bindReady(); @@ -289,7 +289,7 @@ jQuery.fn = jQuery.prototype = { return this; }, - + eq: function( i ) { return i === -1 ? this.slice( i ) : @@ -314,7 +314,7 @@ jQuery.fn = jQuery.prototype = { return callback.call( elem, i, elem ); })); }, - + end: function() { return this.prevObject || jQuery(null); }, @@ -400,14 +400,14 @@ jQuery.extend({ return jQuery; }, - + // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, - + // Handle when the DOM is ready ready: function( wait ) { // A third-party is pushing the ready event forwards @@ -448,7 +448,7 @@ jQuery.extend({ } } }, - + bindReady: function() { if ( readyBound ) { return; @@ -467,7 +467,7 @@ jQuery.extend({ if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - + // A fallback to window.onload, that will always work window.addEventListener( "load", jQuery.ready, false ); @@ -476,7 +476,7 @@ jQuery.extend({ // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", DOMContentLoaded); - + // A fallback to window.onload, that will always work window.attachEvent( "onload", jQuery.ready ); @@ -527,20 +527,20 @@ jQuery.extend({ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } - + // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } - + // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. - + var key; for ( key in obj ) {} - + return key === undefined || hasOwn.call( obj, key ); }, @@ -550,11 +550,11 @@ jQuery.extend({ } return true; }, - + error: function( msg ) { throw msg; }, - + parseJSON: function( data ) { if ( typeof data !== "string" || !data ) { return null; @@ -562,7 +562,7 @@ jQuery.extend({ // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); - + // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test(data.replace(rvalidescape, "@") @@ -703,7 +703,7 @@ jQuery.extend({ for ( var l = second.length; j < l; j++ ) { first[ i++ ] = second[ j ]; } - + } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; @@ -783,7 +783,7 @@ jQuery.extend({ // The value/s can be optionally by executed if its a function access: function( elems, key, value, exec, fn, pass ) { var length = elems.length; - + // Setting many attributes if ( typeof key === "object" ) { for ( var k in key ) { @@ -791,19 +791,19 @@ jQuery.extend({ } return elems; } - + // Setting one attribute if ( value !== undefined ) { // Optionally, function values get executed if exec is true exec = !pass && exec && jQuery.isFunction(value); - + for ( var i = 0; i < length; i++ ) { fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); } - + return elems; } - + // Getting an attribute return length ? fn( elems[0], key ) : undefined; }, @@ -1112,7 +1112,7 @@ jQuery.extend({ // Please use with caution uuid: 0, - // Unique for each copy of jQuery on the page + // Unique for each copy of jQuery on the page expando: "jQuery" + jQuery.now(), // The following elements throw uncatchable exceptions if you @@ -1560,7 +1560,7 @@ jQuery.fn.extend({ var option = options[ i ]; // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { // Get the specific value for the option @@ -1583,7 +1583,7 @@ jQuery.fn.extend({ if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { return elem.getAttribute("value") === null ? "on" : elem.value; } - + // Everything else, we just grab the value return (elem.value || "").replace(rreturn, ""); @@ -1649,7 +1649,7 @@ jQuery.extend({ height: true, offset: true }, - + attr: function( elem, name, value, pass ) { // don't set attributes on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { @@ -1678,7 +1678,7 @@ jQuery.extend({ var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; - + // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; @@ -1818,7 +1818,7 @@ jQuery.event = { var eventKey = elem.nodeType ? "events" : "__events__", events = elemData[ eventKey ], eventHandle = elemData.handle; - + if ( typeof events === "function" ) { // On plain objects events is a fn that holds the the data // which prevents this data from being JSON serialized @@ -1898,9 +1898,9 @@ jQuery.event = { } } } - - if ( special.add ) { - special.add.call( elem, handleObj ); + + if ( special.add ) { + special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; @@ -1939,7 +1939,7 @@ jQuery.event = { if ( !elemData || !events ) { return; } - + if ( typeof events === "function" ) { elemData = events; events = events.events; @@ -1977,7 +1977,7 @@ jQuery.event = { namespaces = type.split("."); type = namespaces.shift(); - namespace = new RegExp("(^|\\.)" + + namespace = new RegExp("(^|\\.)" + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); } @@ -2137,7 +2137,7 @@ jQuery.event = { isClick = jQuery.nodeName(target, "a") && targetType === "click", special = jQuery.event.special[ targetType ] || {}; - if ( (!special._default || special._default.call( elem, event ) === false) && + if ( (!special._default || special._default.call( elem, event ) === false) && !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { try { @@ -2205,7 +2205,7 @@ jQuery.event = { event.handler = handleObj.handler; event.data = handleObj.data; event.handleObj = handleObj; - + var ret = handleObj.handler.apply( this, args ); if ( ret !== undefined ) { @@ -2301,7 +2301,7 @@ jQuery.event = { add: function( handleObj ) { jQuery.event.add( this, liveConvert( handleObj.origType, handleObj.selector ), - jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); }, remove: function( handleObj ) { @@ -2331,7 +2331,7 @@ jQuery.removeEvent = document.removeEventListener ? if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } - } : + } : function( elem, type, handle ) { if ( elem.detachEvent ) { elem.detachEvent( "on" + type, handle ); @@ -2378,7 +2378,7 @@ jQuery.Event.prototype = { if ( !e ) { return; } - + // if preventDefault exists run it on the original event if ( e.preventDefault ) { e.preventDefault(); @@ -2473,7 +2473,7 @@ if ( !jQuery.support.submitBubbles ) { return trigger( "submit", this, arguments ); } }); - + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { var elem = e.target, type = elem.type; @@ -2534,7 +2534,7 @@ if ( !jQuery.support.changeBubbles ) { if ( e.type !== "focusout" || elem.type !== "radio" ) { jQuery.data( elem, "_change_data", val ); } - + if ( data === undefined || val === data ) { return; } @@ -2548,7 +2548,7 @@ if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { filters: { - focusout: testChange, + focusout: testChange, beforedeactivate: testChange, @@ -2619,15 +2619,15 @@ if ( document.addEventListener ) { if ( focusCounts[fix]++ === 0 ) { document.addEventListener( orig, handler, true ); } - }, - teardown: function() { + }, + teardown: function() { if ( --focusCounts[fix] === 0 ) { document.removeEventListener( orig, handler, true ); } } }; - function handler( e ) { + function handler( e ) { e = jQuery.event.fix( e ); e.type = fix; return jQuery.event.trigger( e, null, e.target ); @@ -2644,7 +2644,7 @@ jQuery.each(["bind", "one"], function( i, name ) { } return this; } - + if ( jQuery.isFunction( data ) || data === false ) { fn = data; data = undefined; @@ -2684,20 +2684,20 @@ jQuery.fn.extend({ return this; }, - + delegate: function( selector, types, data, fn ) { return this.live( types, data, fn, selector ); }, - + undelegate: function( selector, types, fn ) { if ( arguments.length === 0 ) { return this.unbind( "live" ); - + } else { return this.die( types, null, fn, selector ); } }, - + trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); @@ -2753,12 +2753,12 @@ jQuery.each(["live", "die"], function( i, name ) { var type, i = 0, match, namespaces, preType, selector = origSelector || this.selector, context = origSelector ? this : jQuery( this.context ); - + if ( typeof types === "object" && !types.preventDefault ) { for ( var key in types ) { context[ name ]( key, data, types[key], selector ); } - + return this; } @@ -2805,7 +2805,7 @@ jQuery.each(["live", "die"], function( i, name ) { context.unbind( "live." + liveConvert( type, selector ), fn ); } } - + return this; }; }); @@ -2968,14 +2968,14 @@ var Sizzle = function(selector, context, results, seed) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context), soFar = selector, ret, cur, pop, i; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec(""); @@ -2983,9 +2983,9 @@ var Sizzle = function(selector, context, results, seed) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3007,7 +3007,7 @@ var Sizzle = function(selector, context, results, seed) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -3123,7 +3123,7 @@ Sizzle.find = function(expr, context, isXML){ for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var type = Expr.order[i], match; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice(1,1); @@ -3402,7 +3402,7 @@ var Expr = Sizzle.selectors = { }, ATTR: function(match, curLoop, inplace, result, not, isXML){ var name = match[1].replace(/\\/g, ""); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -3428,7 +3428,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, POS: function(match){ @@ -3549,18 +3549,18 @@ var Expr = Sizzle.selectors = { case 'only': case 'first': while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case 'last': while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } return true; @@ -3570,20 +3570,20 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { return diff === 0; @@ -3660,7 +3660,7 @@ var makeArray = function(array, results) { results.push.apply( results, array ); return results; } - + return array; }; @@ -3884,7 +3884,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function(query, context, extra, seed){ context = context || document; @@ -3917,7 +3917,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -3938,14 +3938,14 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, ":sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } if ( matches ) { Sizzle.matchesSelector = function( node, expr ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) ) { return matches.call( node, expr ); } @@ -3973,7 +3973,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function(match, context, isXML) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -4061,7 +4061,7 @@ Sizzle.contains = document.documentElement.contains ? function(a, b){ Sizzle.isXML = function(elem){ // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; @@ -4149,7 +4149,7 @@ jQuery.fn.extend({ filter: function( selector ) { return this.pushStack( winnow(this, selector, true), "filter", selector ); }, - + is: function( selector ) { return !!selector && jQuery.filter( selector, this ).length > 0; }, @@ -4165,7 +4165,7 @@ jQuery.fn.extend({ selector = selectors[i]; if ( !matches[selector] ) { - matches[selector] = jQuery.expr.match.POS.test( selector ) ? + matches[selector] = jQuery.expr.match.POS.test( selector ) ? jQuery( selector, context || this.context ) : selector; } @@ -4188,7 +4188,7 @@ jQuery.fn.extend({ return ret; } - var pos = POS.test( selectors ) ? + var pos = POS.test( selectors ) ? jQuery( selectors, context || this.context ) : null; for ( i = 0, l = this.length; i < l; i++ ) { @@ -4209,10 +4209,10 @@ jQuery.fn.extend({ } ret = ret.length > 1 ? jQuery.unique(ret) : ret; - + return this.pushStack( ret, "closest", selectors ); }, - + // Determine the position of an element within // the matched set of elements index: function( elem ) { @@ -4293,7 +4293,7 @@ jQuery.each({ }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); - + if ( !runtil.test( name ) ) { selector = until; } @@ -4322,7 +4322,7 @@ jQuery.extend({ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : jQuery.find.matches(expr, elems); }, - + dir: function( elem, dir, until ) { var matched = [], cur = elem[dir]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { @@ -4539,7 +4539,7 @@ jQuery.fn.extend({ return set; } }, - + // keepData is for internal use only--do not document remove: function( selector, keepData ) { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { @@ -4554,7 +4554,7 @@ jQuery.fn.extend({ } } } - + return this; }, @@ -4570,7 +4570,7 @@ jQuery.fn.extend({ elem.removeChild( elem.firstChild ); } } - + return this; }, @@ -4715,9 +4715,9 @@ jQuery.fn.extend({ } else { results = jQuery.buildFragment( args, this, scripts ); } - + fragment = results.fragment; - + if ( fragment.childNodes.length === 1 ) { first = fragment = fragment.firstChild; } else { @@ -4822,18 +4822,18 @@ jQuery.each({ jQuery.fn[ name ] = function( selector ) { var ret = [], insert = jQuery( selector ), parent = this.length === 1 && this[0].parentNode; - + if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { insert[ original ]( this[0] ); return this; - + } else { for ( var i = 0, l = insert.length; i < l; i++ ) { var elems = (i > 0 ? this.clone(true) : this).get(); jQuery( insert[i] )[ original ]( elems ); ret = ret.concat( elems ); } - + return this.pushStack( ret, name, insert.selector ); } }; @@ -4921,7 +4921,7 @@ jQuery.extend({ for ( i = 0; ret[i]; i++ ) { if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); - + } else { if ( ret[i].nodeType === 1 ) { ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); @@ -4933,22 +4933,22 @@ jQuery.extend({ return ret; }, - + cleanData: function( elems ) { var data, id, cache = jQuery.cache, special = jQuery.event.special, deleteExpando = jQuery.support.deleteExpando; - + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { continue; } id = elem[ jQuery.expando ]; - + if ( id ) { data = cache[ id ]; - + if ( data && data.events ) { for ( var type in data.events ) { if ( special[ type ] ) { @@ -4959,14 +4959,14 @@ jQuery.extend({ } } } - + if ( deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } - + delete cache[ id ]; } } @@ -5551,7 +5551,7 @@ jQuery.extend({ delete window[ jsonp ]; } catch( jsonpError ) {} } - + if ( head ) { head.removeChild( script ); } @@ -5808,19 +5808,19 @@ jQuery.extend({ value = jQuery.isFunction(value) ? value() : value; s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value); }; - + // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings.traditional; } - + // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray(a) || a.jquery ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); - + } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. @@ -5853,7 +5853,7 @@ function buildParams( prefix, obj, traditional, add ) { buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); } }); - + } else if ( !traditional && obj != null && typeof obj === "object" ) { if ( jQuery.isEmptyObject( obj ) ) { add( prefix, "" ); @@ -5864,7 +5864,7 @@ function buildParams( prefix, obj, traditional, add ) { buildParams( prefix + "[" + k + "]", v, traditional, add ); }); } - + } else { // Serialize scalar item. add( prefix, obj ); @@ -5922,7 +5922,7 @@ jQuery.extend({ jQuery.event.trigger( "ajaxStop" ); } }, - + triggerGlobal: function( s, type, args ) { (s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args); }, @@ -6529,7 +6529,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { jQuery.fn.offset = function( options ) { var elem = this[0], box; - if ( options ) { + if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); @@ -6571,7 +6571,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { jQuery.fn.offset = function( options ) { var elem = this[0]; - if ( options ) { + if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); @@ -6684,7 +6684,7 @@ jQuery.offset = { return { top: top, left: left }; }, - + setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); @@ -6718,7 +6718,7 @@ jQuery.offset = { if (options.left != null) { props.left = (options.left - curOffset.left) + curLeft; } - + if ( "using" in options ) { options.using.call( elem, props ); } else { @@ -6778,7 +6778,7 @@ jQuery.each( ["Left", "Top"], function( i, name ) { jQuery.fn[ method ] = function(val) { var elem = this[0], win; - + if ( !elem ) { return null; } @@ -6846,7 +6846,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { if ( !elem ) { return size == null ? null : this; } - + if ( jQuery.isFunction( size ) ) { return this.each(function( i ) { var self = jQuery( this ); diff --git a/download/test/run.js b/download/test/run.js index 6be03726..30e0e088 100644 --- a/download/test/run.js +++ b/download/test/run.js @@ -6,7 +6,7 @@ load('steal/rhino/rhino.js') steal('steal/test', function( s ) { STEALPRINT = false; s.test.module("jquery/download") - + s.test.test("controller", function(){ load('steal/rhino/rhino.js') s.test.open('jquery/download/test/controllerpage.html') diff --git a/event/default/default.html b/event/default/default.html index 68da154f..960b5b9e 100644 --- a/event/default/default.html +++ b/event/default/default.html @@ -28,7 +28,7 @@ - +

Default Events

A tabs widget that doesn't let you continue until the first part is complete.

@@ -45,10 +45,10 @@

Default Events

- - - - - + + \ No newline at end of file diff --git a/event/drag/limit/limit.js b/event/drag/limit/limit.js index 8d7b703a..f9d54e8d 100644 --- a/event/drag/limit/limit.js +++ b/event/drag/limit/limit.js @@ -12,7 +12,7 @@ steal('jquery/event/drag', 'jquery/dom/cur_styles').then(function( $ ) { * @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/event/event/drag/limit/limit.js * limits the drag to a containing element * @param {jQuery} container - * @param {Object} [center] can set the limit to the center of the object. Can be + * @param {Object} [center] can set the limit to the center of the object. Can be * 'x', 'y' or 'both' * @return {$.Drag} */ diff --git a/event/drag/scroll/scroll.js b/event/drag/scroll/scroll.js index cd530a66..948f4923 100644 --- a/event/drag/scroll/scroll.js +++ b/event/drag/scroll/scroll.js @@ -10,7 +10,7 @@ $.Drag.prototype. * @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/event/drag/scroll/scroll.js * @param {jQuery} elements to scroll. The window can be in this array. * @param {Object} options changes the default settings. - * + * * - distance {number} 30 - how many pixels away from a boundry where we start scrolling * - delta(diff) {Function} - returns how far we should scroll. It is passed how many pixels the cursor is * from the boundry. @@ -18,12 +18,12 @@ $.Drag.prototype. */ scrolls = function(elements, options){ var elements = $(elements); - + for(var i = 0 ; i < elements.length; i++){ this.constructor.responder._elements.push( elements.eq(i).data("_dropData", new $.Scrollable(elements[i], options) )[0] ) } }, - + $.Scrollable = function(element, options){ this.element = jQuery(element); this.options = $.extend({ @@ -46,16 +46,16 @@ $.extend($.Scrollable.prototype,{ this[method](el || this.element[0], ev, this, drag) }, dropover: function() { - + }, dropon: function() { this.clear_timeout(); - }, + }, dropout: function() { this.clear_timeout(); }, dropinit: function() { - + }, dropend: function() {}, clear_timeout: function() { @@ -68,26 +68,26 @@ $.extend($.Scrollable.prototype,{ return (30 - diff) / 2; }, dropmove: function( el, ev, drop, drag ) { - + //if we were about to call a move, clear it. this.clear_timeout(); - + //position of the mouse var mouse = ev.vector(), - + //get the object we are going to get the boundries of location_object = $(el == document.documentElement ? window : el), - + //get the dimension and location of that object dimensions = location_object.dimensionsv('outer'), position = location_object.offsetv(), - + //how close our mouse is to the boundries bottom = position.y()+dimensions.y() - mouse.y(), top = mouse.y() - position.y(), right = position.x()+dimensions.x() - mouse.x(), left = mouse.x() - position.x(), - + //how far we should scroll dx =0, dy =0, distance = this.options.distance; @@ -101,7 +101,7 @@ $.extend($.Scrollable.prototype,{ dx = this.options.delta(right,distance); else if(left < distance && this.x) dx = -this.options.delta(left,distance); - + //if we should scroll if(dx || dy){ //set a timeout that will create a mousemove on that object @@ -123,12 +123,12 @@ $.extend($.Scrollable.prototype,{ move: function( scroll_element, drag_element, dx, dy, ev/*, x,y,sx, sy*/ ) { scroll_element.scrollTop( scroll_element.scrollTop() + dy); scroll_element.scrollLeft(scroll_element.scrollLeft() + dx); - + drag_element.trigger( - $.event.fix({type: "mousemove", - clientX: ev.clientX, - clientY: ev.clientY, - screenX: ev.screenX, + $.event.fix({type: "mousemove", + clientX: ev.clientX, + clientY: ev.clientY, + screenX: ev.screenX, screenY: ev.screenY, pageX: ev.pageX, pageY: ev.pageY})) diff --git a/event/drag/step/step.html b/event/drag/step/step.html index 664375fc..98306760 100644 --- a/event/drag/step/step.html +++ b/event/drag/step/step.html @@ -27,7 +27,7 @@ padding: 0px; height: 240px; width: 420px; - + } #demo-html{ padding: 30px 0px 0px 30px; @@ -44,7 +44,7 @@
horizontal vertical
- - - + + \ No newline at end of file diff --git a/event/drag/step/step.js b/event/drag/step/step.js index bece565d..741d0ceb 100644 --- a/event/drag/step/step.js +++ b/event/drag/step/step.js @@ -13,23 +13,23 @@ steal('jquery/event/drag', 'jquery/dom/cur_styles').then(function( $ ) { * @plugin jquery/event/drag/step * @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/event/drag/step/step.js * makes the drag move in steps of amount pixels. - * + * * drag.step({x: 5}, $('foo'), "xy") - * + * * ## Demo - * + * * @demo jquery/event/drag/step/step.html - * + * * @param {number|Object} amount make the drag move X amount in pixels from the top-left of container. * @param {jQuery} [container] the container to move in reference to. If not provided, the document is used. * @param {String} [center] Indicates how to position the drag element in relationship to the container. - * + * * - If nothing is provided, places the top left corner of the drag element at - * 'amount' intervals from the top left corner of the container. + * 'amount' intervals from the top left corner of the container. * - If 'x' is provided, it centers the element horizontally on the top-left corner. * - If 'y' is provided, it centers the element vertically on the top-left corner of the container. * - If 'xy' is provided, it centers the element on the top-left corner of the container. - * + * * @return {jQuery.Drag} the drag object for chaining. */ step = function( amount, container, center ) { diff --git a/event/drop/drop.html b/event/drop/drop.html index 5d4af6c6..da81dfdb 100644 --- a/event/drop/drop.html +++ b/event/drop/drop.html @@ -40,25 +40,25 @@

Dropmove/Dropon

Drop Count 0 - \ No newline at end of file diff --git a/event/drop/drop.js b/event/drop/drop.js index df624632..58d37248 100644 --- a/event/drop/drop.js +++ b/event/drop/drop.js @@ -1,7 +1,7 @@ steal('jquery/event/drag','jquery/dom/within','jquery/dom/compare').then(function($){ - var event = $.event, + var event = $.event, callHanders = function(){ - + }; //somehow need to keep track of elements with selectors on them. When element is removed, somehow we need to know that // @@ -45,21 +45,21 @@ steal('jquery/event/drag','jquery/dom/within','jquery/dom/compare').then(functio *

Drop events are covered in more detail in [jQuery.Drop].

*/ "dropend"]; - - - + + + /** * @class jQuery.Drop * @parent specialevents * @plugin jquery/event/drop * @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/event/drop/drop.js * @test jquery/event/drag/qunit.html - * - * Provides drop events as a special event to jQuery. - * By binding to a drop event, the your callback functions will be + * + * Provides drop events as a special event to jQuery. + * By binding to a drop event, the your callback functions will be * called during the corresponding phase of drag. *

Drop Events

- * All drop events are called with the native event, an instance of drop, and the drag. Here are the available drop + * All drop events are called with the native event, an instance of drop, and the drag. Here are the available drop * events: *