From f2ba4ac357eb9a1bb24537ad48dc5c887ec770ed Mon Sep 17 00:00:00 2001 From: y0gzah Date: Fri, 25 Oct 2013 14:19:22 +0300 Subject: [PATCH 01/39] UriPathExtensionMapping now optional, added optional QueryStringMapping Made UriPathExtensionMapping optional Added QueryStringMapping allowing you to add ?format=jsonp to every request in order to receive a jsonp response. Made it after realizing there have been some changes to Chrome, sometimes sending a global (*/*) 'accepts' header on cross domain requests ( diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValueController.cs b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValueController.cs index 93be378..073b440 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValueController.cs +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValueController.cs @@ -14,12 +14,8 @@ public string Get(int id) { return "value 1"; } - // POST api/values - public void Post(string value) { - } - // PUT api/values/5 - public void Put(int id, string value) { + public void Put(int id, [FromBody] string value) { } // DELETE api/values/5 From 3b803bc45c21004143dc7a2bc8e64498e47367bf Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Thu, 12 Dec 2013 10:35:22 -0600 Subject: [PATCH 13/39] Add in a sample case for retrieving simple JSON. --- .../default.htm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/default.htm b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/default.htm index 5cef2ed..8b5e6de 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/default.htm +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/default.htm @@ -13,13 +13,19 @@ +

Request result:

- diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/_references.js b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/_references.js index 90747df..d560286 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/_references.js +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/_references.js @@ -1,6 +1,6 @@ -/// -/// +/// +/// /// /// -/// -/// \ No newline at end of file +/// +/// \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery-1.6.2-vsdoc.js b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery-1.6.2-vsdoc.js deleted file mode 100644 index ebfe45f..0000000 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery-1.6.2-vsdoc.js +++ /dev/null @@ -1,9134 +0,0 @@ -/* -* This file has been commented to support Visual Studio Intellisense. -* You should not use this file at runtime inside the browser--it is only -* intended to be used only for design-time IntelliSense. Please use the -* standard jQuery library for all production use. -* -* Comment version: 1.6.2 -*/ - -/*! -* Note: While Microsoft is not the author of this script file, Microsoft -* grants you the right to use this file for the sole purpose of either: -* (i) interacting through your browser with the Microsoft website, subject -* to the website's terms of use; or (ii) using the files as included with a -* Microsoft product subject to the Microsoft Software License Terms for that -* Microsoft product. Microsoft reserves all other rights to the files not -* expressly granted by Microsoft, whether by implication, estoppel or -* otherwise. The notices and licenses below are for informational purposes -* only. -* -* Provided for Informational Purposes Only -* MIT License -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -* -* jQuery JavaScript Library v1.6.2 -* http://jquery.com/ -* -* Copyright 2010, John Resig -* -* Includes Sizzle.js -* http://sizzlejs.com/ -* Copyright 2010, The Dojo Foundation -* -*/ -(function (window, undefined) { - - // Use the correct document accordingly with window argument (sandbox) - var document = window.document; - var jQuery = (function () { - - // Define a local copy of jQuery - var jQuery = function (selector, context) { - /// - /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements. - /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML. - /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s). - /// 4: $(callback) - A shorthand for $(document).ready(). - /// 5: $() - As of jQuery 1.4, if you pass no arguments in to the jQuery() method, an empty jQuery set will be returned. - /// - /// - /// 1: expression - An expression to search with. - /// 2: html - A string of HTML to create on the fly. - /// 3: elements - DOM element(s) to be encapsulated by a jQuery object. - /// 4: callback - The function to execute when the DOM is ready. - /// - /// - /// 1: context - A DOM Element, Document or jQuery to use as context. - /// - /// - - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init(selector, context); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, - - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - rwhite = /\s/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Check for non-word characters - rnonword = /\W/, - - // Check for digits - rdigit = /\d/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // 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 = [], - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - - jQuery.fn = jQuery.prototype = { - init: function (selector, context) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if (!selector) { - return this; - } - - // Handle $(DOMElement) - if (selector.nodeType) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if (selector === "body" && !context && document.body) { - this.context = document; - this[0] = document.body; - this.selector = "body"; - this.length = 1; - return this; - } - - // Handle HTML strings - if (typeof selector === "string") { - // Are we dealing with HTML string or an ID? - match = quickExpr.exec(selector); - - // Verify a match, and that no context was specified for #id - if (match && (match[1] || !context)) { - - // HANDLE: $(html) -> $(array) - if (match[1]) { - doc = (context ? context.ownerDocument || context : document); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec(selector); - - if (ret) { - if (jQuery.isPlainObject(context)) { - selector = [document.createElement(ret[1])]; - jQuery.fn.attr.call(selector, context, true); - - } else { - selector = [doc.createElement(ret[1])]; - } - - } else { - 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]); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if (elem && elem.parentNode) { - // Handle the case where IE and Opera return items - // by name instead of ID - if (elem.id !== match[2]) { - return rootjQuery.find(selector); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $("TAG") - } else if (!context && !rnonword.test(selector)) { - this.selector = selector; - this.context = document; - selector = document.getElementsByTagName(selector); - return jQuery.merge(this, selector); - - // HANDLE: $(expr, $(...)) - } else if (!context || context.jquery) { - return (context || rootjQuery).find(selector); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return jQuery(context).find(selector); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if (jQuery.isFunction(selector)) { - return rootjQuery.ready(selector); - } - - if (selector.selector !== undefined) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray(selector, this); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.4.4", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function () { - /// - /// The number of elements currently matched. - /// Part of Core - /// - /// - - return this.length; - }, - - toArray: function () { - /// - /// Retrieve all the DOM elements contained in the jQuery set, as an array. - /// - /// - return slice.call(this, 0); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function (num) { - /// - /// Access a single matched element. num is used to access the - /// Nth element matched. - /// Part of Core - /// - /// - /// - /// Access the element in the Nth position. - /// - - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - (num < 0 ? this.slice(num)[0] : this[num]); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function (elems, name, selector) { - /// - /// Set the jQuery object to an array of elements, while maintaining - /// the stack. - /// Part of Core - /// - /// - /// - /// An array of elements - /// - - // Build a new jQuery matched element set - var ret = jQuery(); - - if (jQuery.isArray(elems)) { - push.apply(ret, elems); - - } else { - jQuery.merge(ret, elems); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if (name === "find") { - ret.selector = this.selector + (this.selector ? " " : "") + selector; - } else if (name) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function (callback, args) { - /// - /// Execute a function within the context of every matched element. - /// This means that every time the passed-in function is executed - /// (which is once for every element matched) the 'this' keyword - /// points to the specific element. - /// Additionally, the function, when executed, is passed a single - /// argument representing the position of the element in the matched - /// set. - /// Part of Core - /// - /// - /// - /// A function to execute - /// - - return jQuery.each(this, callback, args); - }, - - ready: function (fn) { - /// - /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. - /// - /// The function to be executed when the DOM is ready. - - // Attach the listeners - jQuery.bindReady(); - - // If the DOM is already ready - if (jQuery.isReady) { - // Execute the function immediately - fn.call(document, jQuery); - - // Otherwise, remember the function for later - } else if (readyList) { - // Add the function to the wait list - readyList.push(fn); - } - - return this; - }, - - eq: function (i) { - /// - /// Reduce the set of matched elements to a single element. - /// The position of the element in the set of matched elements - /// starts at 0 and goes to length - 1. - /// Part of Core - /// - /// - /// - /// pos The index of the element that you wish to limit to. - /// - - return i === -1 ? - this.slice(i) : - this.slice(i, +i + 1); - }, - - first: function () { - /// - /// Reduce the set of matched elements to the first in the set. - /// - /// - - return this.eq(0); - }, - - last: function () { - /// - /// Reduce the set of matched elements to the final one in the set. - /// - /// - - return this.eq(-1); - }, - - slice: function () { - /// - /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. - /// - /// Where to start the subset (0-based). - /// Where to end the subset (not including the end element itself). - /// If omitted, ends at the end of the selection - /// The sliced elements - - return this.pushStack(slice.apply(this, arguments), - "slice", slice.call(arguments).join(",")); - }, - - map: function (callback) { - /// - /// This member is internal. - /// - /// - /// - - return this.pushStack(jQuery.map(this, function (elem, i) { - return callback.call(elem, i, elem); - })); - }, - - end: function () { - /// - /// End the most recent 'destructive' operation, reverting the list of matched elements - /// back to its previous state. After an end operation, the list of matched elements will - /// revert to the last state of matched elements. - /// If there was no destructive operation before, an empty set is returned. - /// Part of DOM/Traversing - /// - /// - - return this.prevObject || jQuery(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice - }; - - // Give the init function the jQuery prototype for later instantiation - jQuery.fn.init.prototype = jQuery.fn; - - jQuery.extend = jQuery.fn.extend = function () { - /// - /// Extend one object with one or more others, returning the original, - /// modified, object. This is a great utility for simple inheritance. - /// jQuery.extend(settings, options); - /// var settings = jQuery.extend({}, defaults, options); - /// Part of JavaScript - /// - /// - /// The object to extend - /// - /// - /// The object that will be merged into the first. - /// - /// - /// (optional) More objects to merge into the first - /// - /// - - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if (typeof target === "boolean") { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if (typeof target !== "object" && !jQuery.isFunction(target)) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if (length === i) { - target = this; - --i; - } - - for (; i < length; i++) { - // Only deal with non-null/undefined values - if ((options = arguments[i]) != null) { - // Extend the base object - for (name in options) { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target === copy) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) { - if (copyIsArray) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = jQuery.extend(deep, clone, copy); - - // Don't bring in undefined values - } else if (copy !== undefined) { - target[name] = copy; - } - } - } - } - - // Return the modified object - return target; - }; - - jQuery.extend({ - noConflict: function (deep) { - /// - /// Run this function to give control of the $ variable back - /// to whichever library first implemented it. This helps to make - /// sure that jQuery doesn't conflict with the $ object - /// of other libraries. - /// By using this function, you will only be able to access jQuery - /// using the 'jQuery' variable. For example, where you used to do - /// $("div p"), you now must do jQuery("div p"). - /// Part of Core - /// - /// - - window.$ = _$; - - if (deep) { - window.jQuery = _jQuery; - } - - 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) { - /// - /// This method is internal. - /// - /// - - // A third-party is pushing the ready event forwards - if (wait === true) { - jQuery.readyWait--; - } - - // Make sure that the DOM is not already loaded - if (!jQuery.readyWait || (wait !== true && !jQuery.isReady)) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if (!document.body) { - return setTimeout(jQuery.ready, 1); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if (wait !== true && --jQuery.readyWait > 0) { - return; - } - - // If there are functions bound, to execute - if (readyList) { - // Execute all of them - var fn, - i = 0, - ready = readyList; - - // Reset the list of functions - readyList = null; - - while ((fn = ready[i++])) { - fn.call(document, jQuery); - } - - // Trigger any bound ready events - if (jQuery.fn.trigger) { - jQuery(document).trigger("ready").unbind("ready"); - } - } - } - }, - - bindReady: function () { - if (readyBound) { - return; - } - - readyBound = true; - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if (document.readyState === "complete") { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout(jQuery.ready, 1); - } - - // Mozilla, Opera and webkit nightlies currently support this event - 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); - - // If IE event model is used - } else if (document.attachEvent) { - // 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); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch (e) { } - - if (document.documentElement.doScroll && toplevel) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function (obj) { - /// - /// Determines if the parameter passed is a function. - /// - /// The object to check - /// True if the parameter is a function; otherwise false. - - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function (obj) { - /// - /// Determine if the parameter passed is an array. - /// - /// Object to test whether or not it is an array. - /// True if the parameter is a function; otherwise false. - - return jQuery.type(obj) === "array"; - }, - - // A crude way of determining if an object is a window - isWindow: function (obj) { - return obj && typeof obj === "object" && "setInterval" in obj; - }, - - isNaN: function (obj) { - return obj == null || !rdigit.test(obj) || isNaN(obj); - }, - - type: function (obj) { - return obj == null ? - String(obj) : - class2type[toString.call(obj)] || "object"; - }, - - isPlainObject: function (obj) { - /// - /// Check to see if an object is a plain object (created using "{}" or "new Object"). - /// - /// - /// The object that will be checked to see if it's a plain object. - /// - /// - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - 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); - }, - - isEmptyObject: function (obj) { - /// - /// Check to see if an object is empty (contains no properties). - /// - /// - /// The object that will be checked to see if it's empty. - /// - /// - - for (var name in obj) { - return false; - } - return true; - }, - - error: function (msg) { - throw msg; - }, - - parseJSON: function (data) { - if (typeof data !== "string" || !data) { - return null; - } - - // 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, "@") - .replace(rvalidtokens, "]") - .replace(rvalidbraces, ""))) { - - // Try to use the native JSON parser first - return window.JSON && window.JSON.parse ? - window.JSON.parse(data) : - (new Function("return " + data))(); - - } else { - jQuery.error("Invalid JSON: " + data); - } - }, - - noop: function () { - /// - /// An empty function. - /// - /// - }, - - // Evalulates a script in a global context - globalEval: function (data) { - /// - /// Internally evaluates a script in a global context. - /// - /// - - if (data && rnotwhite.test(data)) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - - if (jQuery.support.scriptEval) { - script.appendChild(document.createTextNode(data)); - } else { - script.text = data; - } - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore(script, head.firstChild); - head.removeChild(script); - } - }, - - nodeName: function (elem, name) { - /// - /// Checks whether the specified element has the specified DOM node name. - /// - /// The element to examine - /// The node name to check - /// True if the specified node name matches the node's DOM node name; otherwise false - - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function (object, callback, args) { - /// - /// A generic iterator function, which can be used to seemlessly - /// iterate over both objects and arrays. This function is not the same - /// as $().each() - which is used to iterate, exclusively, over a jQuery - /// object. This function can be used to iterate over anything. - /// The callback has two arguments:the key (objects) or index (arrays) as first - /// the first, and the value as the second. - /// Part of JavaScript - /// - /// - /// The object, or array, to iterate over. - /// - /// - /// The function that will be executed on every object. - /// - /// - - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction(object); - - if (args) { - if (isObj) { - for (name in object) { - if (callback.apply(object[name], args) === false) { - break; - } - } - } else { - for (; i < length; ) { - if (callback.apply(object[i++], args) === false) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if (isObj) { - for (name in object) { - if (callback.call(object[name], name, object[name]) === false) { - break; - } - } - } else { - for (var value = object[0]; - i < length && callback.call(value, i, value) !== false; value = object[++i]) { } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function (text) { - return text == null ? - "" : - trim.call(text); - } : - - // Otherwise use our own trimming functionality - function (text) { - return text == null ? - "" : - text.toString().replace(trimLeft, "").replace(trimRight, ""); - }, - - // results is for internal usage only - makeArray: function (array, results) { - /// - /// Turns anything into a true array. This is an internal method. - /// - /// Anything to turn into an actual Array - /// - /// - - var ret = results || []; - - if (array != null) { - // The window, strings (and functions) also have 'length' - // The extra typeof function check is to prevent crashes - // in Safari 2 (See: #3039) - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type(array); - - if (array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow(array)) { - push.call(ret, array); - } else { - jQuery.merge(ret, array); - } - } - - return ret; - }, - - inArray: function (elem, array) { - if (array.indexOf) { - return array.indexOf(elem); - } - - for (var i = 0, length = array.length; i < length; i++) { - if (array[i] === elem) { - return i; - } - } - - return -1; - }, - - merge: function (first, second) { - /// - /// Merge two arrays together, removing all duplicates. - /// The new array is: All the results from the first array, followed - /// by the unique results from the second array. - /// Part of JavaScript - /// - /// - /// - /// The first array to merge. - /// - /// - /// The second array to merge. - /// - - var i = first.length, - j = 0; - - if (typeof second.length === "number") { - for (var l = second.length; j < l; j++) { - first[i++] = second[j]; - } - - } else { - while (second[j] !== undefined) { - first[i++] = second[j++]; - } - } - - first.length = i; - - return first; - }, - - grep: function (elems, callback, inv) { - /// - /// Filter items out of an array, by using a filter function. - /// The specified function will be passed two arguments: The - /// current array item and the index of the item in the array. The - /// function must return 'true' to keep the item in the array, - /// false to remove it. - /// }); - /// Part of JavaScript - /// - /// - /// - /// array The Array to find items in. - /// - /// - /// The function to process each item against. - /// - /// - /// Invert the selection - select the opposite of the function. - /// - - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for (var i = 0, length = elems.length; i < length; i++) { - retVal = !!callback(elems[i], i); - if (inv !== retVal) { - ret.push(elems[i]); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function (elems, callback, arg) { - /// - /// Translate all items in an array to another array of items. - /// The translation function that is provided to this method is - /// called for each item in the array and is passed one argument: - /// The item to be translated. - /// The function can then return the translated value, 'null' - /// (to remove the item), or an array of values - which will - /// be flattened into the full array. - /// Part of JavaScript - /// - /// - /// - /// array The Array to translate. - /// - /// - /// The function to process each item against. - /// - - var ret = [], value; - - // Go through the array, translating each of the items to their - // new value (or values). - for (var i = 0, length = elems.length; i < length; i++) { - value = callback(elems[i], i, arg); - - if (value != null) { - ret[ret.length] = value; - } - } - - return ret.concat.apply([], ret); - }, - - // A global GUID counter for objects - guid: 1, - - proxy: function (fn, proxy, thisObject) { - /// - /// Takes a function and returns a new one that will always have a particular scope. - /// - /// - /// The function whose scope will be changed. - /// - /// - /// The object to which the scope of the function should be set. - /// - /// - - if (arguments.length === 2) { - if (typeof proxy === "string") { - thisObject = fn; - fn = thisObject[proxy]; - proxy = undefined; - - } else if (proxy && !jQuery.isFunction(proxy)) { - thisObject = proxy; - proxy = undefined; - } - } - - if (!proxy && fn) { - proxy = function () { - return fn.apply(thisObject || this, arguments); - }; - } - - // Set the guid of unique handler to the same of original handler, so it can be removed - if (fn) { - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - } - - // So proxy can be declared as an argument - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // 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) { - jQuery.access(elems, k, key[k], exec, fn, value); - } - 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; - }, - - now: function () { - return (new Date()).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function (ua) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec(ua) || - ropera.exec(ua) || - rmsie.exec(ua) || - ua.indexOf("compatible") < 0 && rmozilla.exec(ua) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - browser: {} - }); - - // Populate the class2type map - jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (i, name) { - class2type["[object " + name + "]"] = name.toLowerCase(); - }); - - browserMatch = jQuery.uaMatch(userAgent); - if (browserMatch.browser) { - jQuery.browser[browserMatch.browser] = true; - jQuery.browser.version = browserMatch.version; - } - - // Deprecated, use jQuery.browser.webkit instead - if (jQuery.browser.webkit) { - jQuery.browser.safari = true; - } - - if (indexOf) { - jQuery.inArray = function (elem, array) { - /// - /// Determines the index of the first parameter in the array. - /// - /// The value to see if it exists in the array. - /// The array to look through for the value - /// The 0-based index of the item if it was found, otherwise -1. - - return indexOf.call(array, elem); - }; - } - - // Verify that \s matches non-breaking spaces - // (IE fails on this test) - if (!rwhite.test("\xA0")) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; - } - - // All jQuery objects should point back to these - rootjQuery = jQuery(document); - - // Cleanup functions for the document ready method - if (document.addEventListener) { - DOMContentLoaded = function () { - document.removeEventListener("DOMContentLoaded", DOMContentLoaded, false); - jQuery.ready(); - }; - - } else if (document.attachEvent) { - DOMContentLoaded = function () { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if (document.readyState === "complete") { - document.detachEvent("onreadystatechange", DOMContentLoaded); - jQuery.ready(); - } - }; - } - - // The DOM ready check for Internet Explorer - function doScrollCheck() { - if (jQuery.isReady) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch (e) { - setTimeout(doScrollCheck, 1); - return; - } - - // and execute any waiting functions - jQuery.ready(); - } - - // Expose jQuery to the global object - return (window.jQuery = window.$ = jQuery); - - })(); - - - - // [vsdoc] The following function has been modified for IntelliSense. - // [vsdoc] Stubbing support properties to "false" for IntelliSense compat. - (function () { - - jQuery.support = {}; - - // var root = document.documentElement, - // script = document.createElement("script"), - // div = document.createElement("div"), - // id = "script" + jQuery.now(); - - // div.style.display = "none"; - // div.innerHTML = "
a"; - - // var all = div.getElementsByTagName("*"), - // a = div.getElementsByTagName("a")[0], - // select = document.createElement("select"), - // opt = select.appendChild( document.createElement("option") ); - - // // Can't get basic test support - // if ( !all || !all.length || !a ) { - // return; - // } - - jQuery.support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: false, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: false, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: false, - - // Get the style information from getAttribute - // (IE uses .cssText insted) - style: false, - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: false, - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: false, - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: false, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: false, - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: false, - - // Will be defined later - deleteExpando: false, - optDisabled: false, - checkClone: false, - scriptEval: false, - noCloneEvent: false, - boxModel: false, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableHiddenOffsets: true - }; - - // // Make sure that the options inside disabled selects aren't marked as disabled - // // (WebKit marks them as diabled) - // select.disabled = true; - // jQuery.support.optDisabled = !opt.disabled; - - // script.type = "text/javascript"; - // try { - // script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); - // } catch(e) {} - - // root.insertBefore( script, root.firstChild ); - - // // Make sure that the execution of code works by injecting a script - // // tag with appendChild/createTextNode - // // (IE doesn't support this, fails, and uses .text instead) - // if ( window[ id ] ) { - // jQuery.support.scriptEval = true; - // delete window[ id ]; - // } - - // // Test to see if it's possible to delete an expando from an element - // // Fails in Internet Explorer - // try { - // delete script.test; - - // } catch(e) { - // jQuery.support.deleteExpando = false; - // } - - // root.removeChild( script ); - - // if ( div.attachEvent && div.fireEvent ) { - // div.attachEvent("onclick", function click() { - // // Cloning a node shouldn't copy over any - // // bound event handlers (IE does this) - // jQuery.support.noCloneEvent = false; - // div.detachEvent("onclick", click); - // }); - // div.cloneNode(true).fireEvent("onclick"); - // } - - // div = document.createElement("div"); - // div.innerHTML = ""; - - // var fragment = document.createDocumentFragment(); - // fragment.appendChild( div.firstChild ); - - // // WebKit doesn't clone checked state correctly in fragments - // jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; - - // // Figure out if the W3C box model works as expected - // // document.body must exist before we can do this - // jQuery(function() { - // var div = document.createElement("div"); - // div.style.width = div.style.paddingLeft = "1px"; - - // document.body.appendChild( div ); - // jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; - - // if ( "zoom" in div.style ) { - // // Check if natively block-level elements act like inline-block - // // elements when setting their display to 'inline' and giving - // // them layout - // // (IE < 8 does this) - // div.style.display = "inline"; - // div.style.zoom = 1; - // jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; - - // // Check if elements with layout shrink-wrap their children - // // (IE 6 does this) - // div.style.display = ""; - // div.innerHTML = "
"; - // jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; - // } - - // div.innerHTML = "
t
"; - // var tds = div.getElementsByTagName("td"); - - // // Check if table cells still have offsetWidth/Height when they are set - // // to display:none and there are still other visible table cells in a - // // table row; if so, offsetWidth/Height are not reliable for use when - // // determining if an element has been hidden directly using - // // display:none (it is still safe to use offsets if a parent element is - // // hidden; don safety goggles and see bug #4512 for more information). - // // (only IE 8 fails this test) - // jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; - - // tds[0].style.display = ""; - // tds[1].style.display = "none"; - - // // Check if empty table cells still have offsetWidth/Height - // // (IE < 8 fail this test) - // jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; - // div.innerHTML = ""; - - // document.body.removeChild( div ).style.display = "none"; - // div = tds = null; - // }); - - // // Technique from Juriy Zaytsev - // // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ - // var eventSupported = function( eventName ) { - // var el = document.createElement("div"); - // eventName = "on" + eventName; - - // var isSupported = (eventName in el); - // if ( !isSupported ) { - // el.setAttribute(eventName, "return;"); - // isSupported = typeof el[eventName] === "function"; - // } - // el = null; - - // return isSupported; - // }; - - jQuery.support.submitBubbles = false; - jQuery.support.changeBubbles = false; - - // // release memory in IE - // root = script = div = all = a = null; - })(); - - - - var windowData = {}, - rbrace = /^(?:\{.*\}|\[.*\])$/; - - jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - expando: "jQuery" + jQuery.now(), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - data: function (elem, name, data) { - /// - /// Store arbitrary data associated with the specified element. - /// - /// - /// The DOM element to associate with the data. - /// - /// - /// A string naming the piece of data to set. - /// - /// - /// The new data value. - /// - /// - - if (!jQuery.acceptData(elem)) { - return; - } - - elem = elem == window ? - windowData : - elem; - - var isNode = elem.nodeType, - id = isNode ? elem[jQuery.expando] : null, - cache = jQuery.cache, thisCache; - - if (isNode && !id && typeof name === "string" && data === undefined) { - return; - } - - // Get the data from the object directly - if (!isNode) { - cache = elem; - - // Compute a unique ID for the element - } else if (!id) { - elem[jQuery.expando] = id = ++jQuery.uuid; - } - - // Avoid generating a new cache unless none exists and we - // want to manipulate it. - if (typeof name === "object") { - if (isNode) { - cache[id] = jQuery.extend(cache[id], name); - - } else { - jQuery.extend(cache, name); - } - - } else if (isNode && !cache[id]) { - cache[id] = {}; - } - - thisCache = isNode ? cache[id] : cache; - - // Prevent overriding the named cache with undefined values - if (data !== undefined) { - thisCache[name] = data; - } - - return typeof name === "string" ? thisCache[name] : thisCache; - }, - - removeData: function (elem, name) { - if (!jQuery.acceptData(elem)) { - return; - } - - elem = elem == window ? - windowData : - elem; - - var isNode = elem.nodeType, - id = isNode ? elem[jQuery.expando] : elem, - cache = jQuery.cache, - thisCache = isNode ? cache[id] : id; - - // If we want to remove a specific section of the element's data - if (name) { - if (thisCache) { - // Remove the section of cache data - delete thisCache[name]; - - // If we've removed all the data, remove the element's cache - if (isNode && jQuery.isEmptyObject(thisCache)) { - jQuery.removeData(elem); - } - } - - // Otherwise, we want to remove all of the element's data - } else { - if (isNode && jQuery.support.deleteExpando) { - delete elem[jQuery.expando]; - - } else if (elem.removeAttribute) { - elem.removeAttribute(jQuery.expando); - - // Completely remove the data cache - } else if (isNode) { - delete cache[id]; - - // Remove all fields from the object - } else { - for (var n in elem) { - delete elem[n]; - } - } - } - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function (elem) { - if (elem.nodeName) { - var match = jQuery.noData[elem.nodeName.toLowerCase()]; - - if (match) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } - }); - - jQuery.fn.extend({ - data: function (key, value) { - /// - /// Store arbitrary data associated with the matched elements. - /// - /// - /// A string naming the piece of data to set. - /// - /// - /// The new data value. - /// - /// - - var data = null; - - if (typeof key === "undefined") { - if (this.length) { - var attr = this[0].attributes, name; - data = jQuery.data(this[0]); - - for (var i = 0, l = attr.length; i < l; i++) { - name = attr[i].name; - - if (name.indexOf("data-") === 0) { - name = name.substr(5); - dataAttr(this[0], name, data[name]); - } - } - } - - return data; - - } else if (typeof key === "object") { - return this.each(function () { - jQuery.data(this, key); - }); - } - - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if (value === undefined) { - data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - // Try to fetch any internally stored data first - if (data === undefined && this.length) { - data = jQuery.data(this[0], key); - data = dataAttr(this[0], key, data); - } - - return data === undefined && parts[1] ? - this.data(parts[0]) : - data; - - } else { - return this.each(function () { - var $this = jQuery(this), - args = [parts[0], value]; - - $this.triggerHandler("setData" + parts[1] + "!", args); - jQuery.data(this, key, value); - $this.triggerHandler("changeData" + parts[1] + "!", args); - }); - } - }, - - removeData: function (key) { - return this.each(function () { - jQuery.removeData(this, key); - }); - } - }); - - function dataAttr(elem, key, data) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if (data === undefined && elem.nodeType === 1) { - data = elem.getAttribute("data-" + key); - - if (typeof data === "string") { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - !jQuery.isNaN(data) ? parseFloat(data) : - rbrace.test(data) ? jQuery.parseJSON(data) : - data; - } catch (e) { } - - // Make sure we set the data so it isn't changed later - jQuery.data(elem, key, data); - - } else { - data = undefined; - } - } - - return data; - } - - - - - jQuery.extend({ - queue: function (elem, type, data) { - if (!elem) { - return; - } - - type = (type || "fx") + "queue"; - var q = jQuery.data(elem, type); - - // Speed up dequeue by getting out quickly if this is just a lookup - if (!data) { - return q || []; - } - - if (!q || jQuery.isArray(data)) { - q = jQuery.data(elem, type, jQuery.makeArray(data)); - - } else { - q.push(data); - } - - return q; - }, - - dequeue: function (elem, type) { - type = type || "fx"; - - var queue = jQuery.queue(elem, type), - fn = queue.shift(); - - // If the fx queue is dequeued, always remove the progress sentinel - if (fn === "inprogress") { - fn = queue.shift(); - } - - if (fn) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if (type === "fx") { - queue.unshift("inprogress"); - } - - fn.call(elem, function () { - jQuery.dequeue(elem, type); - }); - } - } - }); - - jQuery.fn.extend({ - queue: function (type, data) { - /// - /// 1: queue() - Returns a reference to the first element's queue (which is an array of functions). - /// 2: queue(callback) - Adds a new function, to be executed, onto the end of the queue of all matched elements. - /// 3: queue(queue) - Replaces the queue of all matched element with this new queue (the array of functions). - /// - /// The function to add to the queue. - /// - - if (typeof type !== "string") { - data = type; - type = "fx"; - } - - if (data === undefined) { - return jQuery.queue(this[0], type); - } - return this.each(function (i) { - var queue = jQuery.queue(this, type, data); - - if (type === "fx" && queue[0] !== "inprogress") { - jQuery.dequeue(this, type); - } - }); - }, - dequeue: function (type) { - /// - /// Removes a queued function from the front of the queue and executes it. - /// - /// The type of queue to access. - /// - - return this.each(function () { - jQuery.dequeue(this, type); - }); - }, - - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function (time, type) { - /// - /// Set a timer to delay execution of subsequent items in the queue. - /// - /// - /// An integer indicating the number of milliseconds to delay execution of the next item in the queue. - /// - /// - /// A string containing the name of the queue. Defaults to fx, the standard effects queue. - /// - /// - - time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; - type = type || "fx"; - - return this.queue(type, function () { - var elem = this; - setTimeout(function () { - jQuery.dequeue(elem, type); - }, time); - }); - }, - - clearQueue: function (type) { - /// - /// Remove from the queue all items that have not yet been run. - /// - /// - /// A string containing the name of the queue. Defaults to fx, the standard effects queue. - /// - /// - - return this.queue(type || "fx", []); - } - }); - - - - - var rclass = /[\n\t]/g, - rspaces = /\s+/, - rreturn = /\r/g, - rspecialurl = /^(?:href|src|style)$/, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rradiocheck = /^(?:radio|checkbox)$/i; - - jQuery.props = { - "for": "htmlFor", - "class": "className", - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - colspan: "colSpan", - tabindex: "tabIndex", - usemap: "useMap", - frameborder: "frameBorder" - }; - - jQuery.fn.extend({ - attr: function (name, value) { - /// - /// Set a single property to a computed value, on all matched elements. - /// Instead of a value, a function is provided, that computes the value. - /// Part of DOM/Attributes - /// - /// - /// - /// The name of the property to set. - /// - /// - /// A function returning the value to set. - /// - - return jQuery.access(this, name, value, true, jQuery.attr); - }, - - removeAttr: function (name, fn) { - /// - /// Remove an attribute from each of the matched elements. - /// Part of DOM/Attributes - /// - /// - /// An attribute to remove. - /// - /// - - return this.each(function () { - jQuery.attr(this, name, ""); - if (this.nodeType === 1) { - this.removeAttribute(name); - } - }); - }, - - addClass: function (value) { - /// - /// Adds the specified class(es) to each of the set of matched elements. - /// Part of DOM/Attributes - /// - /// - /// One or more class names to be added to the class attribute of each matched element. - /// - /// - - if (jQuery.isFunction(value)) { - return this.each(function (i) { - var self = jQuery(this); - self.addClass(value.call(this, i, self.attr("class"))); - }); - } - - if (value && typeof value === "string") { - var classNames = (value || "").split(rspaces); - - for (var i = 0, l = this.length; i < l; i++) { - var elem = this[i]; - - if (elem.nodeType === 1) { - if (!elem.className) { - elem.className = value; - - } else { - var className = " " + elem.className + " ", - setClass = elem.className; - - for (var c = 0, cl = classNames.length; c < cl; c++) { - if (className.indexOf(" " + classNames[c] + " ") < 0) { - setClass += " " + classNames[c]; - } - } - elem.className = jQuery.trim(setClass); - } - } - } - } - - return this; - }, - - removeClass: function (value) { - /// - /// Removes all or the specified class(es) from the set of matched elements. - /// Part of DOM/Attributes - /// - /// - /// (Optional) A class name to be removed from the class attribute of each matched element. - /// - /// - - if (jQuery.isFunction(value)) { - return this.each(function (i) { - var self = jQuery(this); - self.removeClass(value.call(this, i, self.attr("class"))); - }); - } - - if ((value && typeof value === "string") || value === undefined) { - var classNames = (value || "").split(rspaces); - - for (var i = 0, l = this.length; i < l; i++) { - var elem = this[i]; - - if (elem.nodeType === 1 && elem.className) { - if (value) { - var className = (" " + elem.className + " ").replace(rclass, " "); - for (var c = 0, cl = classNames.length; c < cl; c++) { - className = className.replace(" " + classNames[c] + " ", " "); - } - elem.className = jQuery.trim(className); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function (value, stateVal) { - /// - /// Add or remove a class from each element in the set of matched elements, depending - /// on either the class's presence or the value of the switch argument. - /// - /// - /// A class name to be toggled for each element in the matched set. - /// - /// - /// A boolean value to determine whether the class should be added or removed. - /// - /// - - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if (jQuery.isFunction(value)) { - return this.each(function (i) { - var self = jQuery(this); - self.toggleClass(value.call(this, i, self.attr("class"), stateVal), stateVal); - }); - } - - return this.each(function () { - if (type === "string") { - // toggle individual class names - var className, - i = 0, - self = jQuery(this), - state = stateVal, - classNames = value.split(rspaces); - - while ((className = classNames[i++])) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass(className); - self[state ? "addClass" : "removeClass"](className); - } - - } else if (type === "undefined" || type === "boolean") { - if (this.className) { - // store className if set - jQuery.data(this, "__className__", this.className); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery.data(this, "__className__") || ""; - } - }); - }, - - hasClass: function (selector) { - /// - /// Checks the current selection against a class and returns whether at least one selection has a given class. - /// - /// The class to check against - /// True if at least one element in the selection has the class, otherwise false. - - var className = " " + selector + " "; - for (var i = 0, l = this.length; i < l; i++) { - if ((" " + this[i].className + " ").replace(rclass, " ").indexOf(className) > -1) { - return true; - } - } - - return false; - }, - - val: function (value) { - /// - /// Set the value of every matched element. - /// Part of DOM/Attributes - /// - /// - /// - /// A string of text or an array of strings to set as the value property of each - /// matched element. - /// - - if (!arguments.length) { - var elem = this[0]; - - if (elem) { - if (jQuery.nodeName(elem, "option")) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - - // We need to handle select boxes special - if (jQuery.nodeName(elem, "select")) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if (index < 0) { - return null; - } - - // Loop through all the selected options - for (var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++) { - 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) && - (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) { - - // Get the specific value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if (one) { - return value; - } - - // Multi-Selects return an array - values.push(value); - } - } - - return values; - } - - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - 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, ""); - - } - - return undefined; - } - - var isFunction = jQuery.isFunction(value); - - return this.each(function (i) { - var self = jQuery(this), val = value; - - if (this.nodeType !== 1) { - return; - } - - if (isFunction) { - val = value.call(this, i, self.val()); - } - - // Treat null/undefined as ""; convert numbers to string - if (val == null) { - val = ""; - } else if (typeof val === "number") { - val += ""; - } else if (jQuery.isArray(val)) { - val = jQuery.map(val, function (value) { - return value == null ? "" : value + ""; - }); - } - - if (jQuery.isArray(val) && rradiocheck.test(this.type)) { - this.checked = jQuery.inArray(self.val(), val) >= 0; - - } else if (jQuery.nodeName(this, "select")) { - var values = jQuery.makeArray(val); - - jQuery("option", this).each(function () { - this.selected = jQuery.inArray(jQuery(this).val(), values) >= 0; - }); - - if (!values.length) { - this.selectedIndex = -1; - } - - } else { - this.value = val; - } - }); - } - }); - - jQuery.extend({ - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function (elem, name, value, pass) { - /// - /// This method is internal. - /// - /// - - // don't set attributes on text and comment nodes - if (!elem || elem.nodeType === 3 || elem.nodeType === 8) { - return undefined; - } - - if (pass && name in jQuery.attrFn) { - return jQuery(elem)[name](value); - } - - var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc(elem), - // Whether we are setting (or getting) - set = value !== undefined; - - // Try to normalize/fix the name - name = notxml && jQuery.props[name] || name; - - // These attributes require special treatment - var special = rspecialurl.test(name); - - // Safari mis-reports the default selected property of an option - // Accessing the parent's selectedIndex property fixes it - if (name === "selected" && !jQuery.support.optSelected) { - var parent = elem.parentNode; - if (parent) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if (parent.parentNode) { - parent.parentNode.selectedIndex; - } - } - } - - // If applicable, access the attribute via the DOM 0 way - // 'in' checks fail in Blackberry 4.7 #6931 - if ((name in elem || elem[name] !== undefined) && notxml && !special) { - if (set) { - // We can't allow the type property to be changed (since it causes problems in IE) - if (name === "type" && rtype.test(elem.nodeName) && elem.parentNode) { - jQuery.error("type property can't be changed"); - } - - if (value === null) { - if (elem.nodeType === 1) { - elem.removeAttribute(name); - } - - } else { - elem[name] = value; - } - } - - // browsers index elements by id/name on forms, give priority to attributes. - if (jQuery.nodeName(elem, "form") && elem.getAttributeNode(name)) { - return elem.getAttributeNode(name).nodeValue; - } - - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if (name === "tabIndex") { - var attributeNode = elem.getAttributeNode("tabIndex"); - - return attributeNode && attributeNode.specified ? - attributeNode.value : - rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ? - 0 : - undefined; - } - - return elem[name]; - } - - if (!jQuery.support.style && notxml && name === "style") { - if (set) { - elem.style.cssText = "" + value; - } - - return elem.style.cssText; - } - - if (set) { - // convert the value to a string (all browsers do this but IE) see #1070 - elem.setAttribute(name, "" + value); - } - - // Ensure that missing attributes return undefined - // Blackberry 4.7 returns "" from getAttribute #6938 - if (!elem.attributes[name] && (elem.hasAttribute && !elem.hasAttribute(name))) { - return undefined; - } - - var attr = !jQuery.support.hrefNormalized && notxml && special ? - // Some attributes require a special call on IE - elem.getAttribute(name, 2) : - elem.getAttribute(name); - - // Non-existent attributes return null, we normalize to undefined - return attr === null ? undefined : attr; - } - }); - - - - - var rnamespaces = /\.(.*)$/, - rformElems = /^(?:textarea|input|select)$/i, - rperiod = /\./g, - rspace = / /g, - rescape = /[^\w\s.|`]/g, - fcleanup = function (nm) { - return nm.replace(rescape, "\\$&"); - }, - focusCounts = { focusin: 0, focusout: 0 }; - - /* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ - jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function (elem, types, handler, data) { - /// - /// This method is internal. - /// - /// - - if (elem.nodeType === 3 || elem.nodeType === 8) { - return; - } - - // For whatever reason, IE has trouble passing the window object - // around, causing it to be cloned in the process - if (jQuery.isWindow(elem) && (elem !== window && !elem.frameElement)) { - elem = window; - } - - if (handler === false) { - handler = returnFalse; - } else if (!handler) { - // Fixes bug #7229. Fix recommended by jdalton - return; - } - - var handleObjIn, handleObj; - - if (handler.handler) { - handleObjIn = handler; - handler = handleObjIn.handler; - } - - // Make sure that the function being executed has a unique ID - if (!handler.guid) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure - var elemData = jQuery.data(elem); - - // If no elemData is found then we must be trying to bind to one of the - // banned noData elements - if (!elemData) { - return; - } - - // Use a key less likely to result in collisions for plain JS objects. - // Fixes bug #7150. - 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 - // the function does not need to be called, it just contains the data - eventHandle = events.handle; - events = events.events; - - } else if (!events) { - if (!elem.nodeType) { - // On plain objects, create a fn that acts as the holder - // of the values to avoid JSON serialization of event data - elemData[eventKey] = elemData = function () { }; - } - - elemData.events = events = {}; - } - - if (!eventHandle) { - elemData.handle = eventHandle = function () { - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - return typeof jQuery !== "undefined" && !jQuery.event.triggered ? - jQuery.event.handle.apply(eventHandle.elem, arguments) : - undefined; - }; - } - - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native events in IE. - eventHandle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = types.split(" "); - - var type, i = 0, namespaces; - - while ((type = types[i++])) { - handleObj = handleObjIn ? - jQuery.extend({}, handleObjIn) : - { handler: handler, data: data }; - - // Namespaced event handlers - if (type.indexOf(".") > -1) { - namespaces = type.split("."); - type = namespaces.shift(); - handleObj.namespace = namespaces.slice(0).sort().join("."); - - } else { - namespaces = []; - handleObj.namespace = ""; - } - - handleObj.type = type; - if (!handleObj.guid) { - handleObj.guid = handler.guid; - } - - // Get the current list of functions bound to this event - var handlers = events[type], - special = jQuery.event.special[type] || {}; - - // Init the event handler queue - if (!handlers) { - handlers = events[type] = []; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) { - // Bind the global event handler to the element - if (elem.addEventListener) { - elem.addEventListener(type, eventHandle, false); - - } else if (elem.attachEvent) { - elem.attachEvent("on" + type, eventHandle); - } - } - } - - if (special.add) { - special.add.call(elem, handleObj); - - if (!handleObj.handler.guid) { - handleObj.handler.guid = handler.guid; - } - } - - // Add the function to the element's handler list - handlers.push(handleObj); - - // Keep track of which events have been used, for global triggering - jQuery.event.global[type] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function (elem, types, handler) { - /// - /// This method is internal. - /// - /// - - // don't do events on text and comment nodes - if (elem.nodeType === 3 || elem.nodeType === 8) { - return; - } - - if (handler === false) { - handler = returnFalse; - } - - var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, - eventKey = elem.nodeType ? "events" : "__events__", - elemData = jQuery.data(elem), - events = elemData && elemData[eventKey]; - - if (!elemData || !events) { - return; - } - - if (typeof events === "function") { - elemData = events; - events = events.events; - } - - // types is actually an event object here - if (types && types.type) { - handler = types.handler; - types = types.type; - } - - // Unbind all events for the element - if (!types || typeof types === "string" && types.charAt(0) === ".") { - types = types || ""; - - for (type in events) { - jQuery.event.remove(elem, type + types); - } - - return; - } - - // Handle multiple events separated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - types = types.split(" "); - - while ((type = types[i++])) { - origType = type; - handleObj = null; - all = type.indexOf(".") < 0; - namespaces = []; - - if (!all) { - // Namespaced event handlers - namespaces = type.split("."); - type = namespaces.shift(); - - namespace = new RegExp("(^|\\.)" + - jQuery.map(namespaces.slice(0).sort(), fcleanup).join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - eventType = events[type]; - - if (!eventType) { - continue; - } - - if (!handler) { - for (j = 0; j < eventType.length; j++) { - handleObj = eventType[j]; - - if (all || namespace.test(handleObj.namespace)) { - jQuery.event.remove(elem, origType, handleObj.handler, j); - eventType.splice(j--, 1); - } - } - - continue; - } - - special = jQuery.event.special[type] || {}; - - for (j = pos || 0; j < eventType.length; j++) { - handleObj = eventType[j]; - - if (handler.guid === handleObj.guid) { - // remove the given handler for the given type - if (all || namespace.test(handleObj.namespace)) { - if (pos == null) { - eventType.splice(j--, 1); - } - - if (special.remove) { - special.remove.call(elem, handleObj); - } - } - - if (pos != null) { - break; - } - } - } - - // remove generic event handler if no more handlers exist - if (eventType.length === 0 || pos != null && eventType.length === 1) { - if (!special.teardown || special.teardown.call(elem, namespaces) === false) { - jQuery.removeEvent(elem, type, elemData.handle); - } - - ret = null; - delete events[type]; - } - } - - // Remove the expando if it's no longer used - if (jQuery.isEmptyObject(events)) { - var handle = elemData.handle; - if (handle) { - handle.elem = null; - } - - delete elemData.events; - delete elemData.handle; - - if (typeof elemData === "function") { - jQuery.removeData(elem, eventKey); - - } else if (jQuery.isEmptyObject(elemData)) { - jQuery.removeData(elem); - } - } - }, - - // bubbling is internal - trigger: function (event, data, elem /*, bubbling */) { - /// - /// This method is internal. - /// - /// - - // Event object or event type - var type = event.type || event, - bubbling = arguments[3]; - - if (!bubbling) { - event = typeof event === "object" ? - // jQuery.Event object - event[jQuery.expando] ? event : - // Object literal - jQuery.extend(jQuery.Event(type), event) : - // Just the event type (string) - jQuery.Event(type); - - if (type.indexOf("!") >= 0) { - event.type = type = type.slice(0, -1); - event.exclusive = true; - } - - // Handle a global trigger - if (!elem) { - // Don't bubble custom events when global (to avoid too much overhead) - event.stopPropagation(); - - // Only trigger if we've ever bound an event for it - if (jQuery.event.global[type]) { - jQuery.each(jQuery.cache, function () { - if (this.events && this.events[type]) { - jQuery.event.trigger(event, data, this.handle.elem); - } - }); - } - } - - // Handle triggering a single element - - // don't do events on text and comment nodes - if (!elem || elem.nodeType === 3 || elem.nodeType === 8) { - return undefined; - } - - // Clean up in case it is reused - event.result = undefined; - event.target = elem; - - // Clone the incoming data, if any - data = jQuery.makeArray(data); - data.unshift(event); - } - - event.currentTarget = elem; - - // Trigger the event, it is assumed that "handle" is a function - var handle = elem.nodeType ? - jQuery.data(elem, "handle") : - (jQuery.data(elem, "__events__") || {}).handle; - - if (handle) { - handle.apply(elem, data); - } - - var parent = elem.parentNode || elem.ownerDocument; - - // Trigger an inline bound script - try { - if (!(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()])) { - if (elem["on" + type] && elem["on" + type].apply(elem, data) === false) { - event.result = false; - event.preventDefault(); - } - } - - // prevent IE from throwing an error for some elements with some event types, see #3533 - } catch (inlineError) { } - - if (!event.isPropagationStopped() && parent) { - jQuery.event.trigger(event, data, parent, true); - - } else if (!event.isDefaultPrevented()) { - var old, - target = event.target, - targetType = type.replace(rnamespaces, ""), - isClick = jQuery.nodeName(target, "a") && targetType === "click", - special = jQuery.event.special[targetType] || {}; - - if ((!special._default || special._default.call(elem, event) === false) && - !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()])) { - - try { - if (target[targetType]) { - // Make sure that we don't accidentally re-trigger the onFOO events - old = target["on" + targetType]; - - if (old) { - target["on" + targetType] = null; - } - - jQuery.event.triggered = true; - target[targetType](); - } - - // prevent IE from throwing an error for some elements with some event types, see #3533 - } catch (triggerError) { } - - if (old) { - target["on" + targetType] = old; - } - - jQuery.event.triggered = false; - } - } - }, - - handle: function (event) { - /// - /// This method is internal. - /// - /// - - var all, handlers, namespaces, namespace_re, events, - namespace_sort = [], - args = jQuery.makeArray(arguments); - - event = args[0] = jQuery.event.fix(event || window.event); - event.currentTarget = this; - - // Namespaced event handlers - all = event.type.indexOf(".") < 0 && !event.exclusive; - - if (!all) { - namespaces = event.type.split("."); - event.type = namespaces.shift(); - namespace_sort = namespaces.slice(0).sort(); - namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - event.namespace = event.namespace || namespace_sort.join("."); - - events = jQuery.data(this, this.nodeType ? "events" : "__events__"); - - if (typeof events === "function") { - events = events.events; - } - - handlers = (events || {})[event.type]; - - if (events && handlers) { - // Clone the handlers to prevent manipulation - handlers = handlers.slice(0); - - for (var j = 0, l = handlers.length; j < l; j++) { - var handleObj = handlers[j]; - - // Filter the functions by class - if (all || namespace_re.test(handleObj.namespace)) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handleObj.handler; - event.data = handleObj.data; - event.handleObj = handleObj; - - var ret = handleObj.handler.apply(this, args); - - if (ret !== undefined) { - event.result = ret; - if (ret === false) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if (event.isImmediatePropagationStopped()) { - break; - } - } - } - } - - return event.result; - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function (event) { - /// - /// This method is internal. - /// - /// - - if (event[jQuery.expando]) { - return event; - } - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event(originalEvent); - - for (var i = this.props.length, prop; i; ) { - prop = this.props[--i]; - event[prop] = originalEvent[prop]; - } - - // Fix target property, if necessary - if (!event.target) { - // Fixes #1925 where srcElement might not be defined either - event.target = event.srcElement || document; - } - - // check if target is a textnode (safari) - if (event.target.nodeType === 3) { - event.target = event.target.parentNode; - } - - // Add relatedTarget, if necessary - if (!event.relatedTarget && event.fromElement) { - event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; - } - - // Calculate pageX/Y if missing and clientX/Y available - if (event.pageX == null && event.clientX != null) { - var doc = document.documentElement, - body = document.body; - - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add which for key events - if (event.which == null && (event.charCode != null || event.keyCode != null)) { - event.which = event.charCode != null ? event.charCode : event.keyCode; - } - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if (!event.metaKey && event.ctrlKey) { - event.metaKey = event.ctrlKey; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if (!event.which && event.button !== undefined) { - event.which = (event.button & 1 ? 1 : (event.button & 2 ? 3 : (event.button & 4 ? 2 : 0))); - } - - return event; - }, - - // Deprecated, use jQuery.guid instead - guid: 1E8, - - // Deprecated, use jQuery.proxy instead - proxy: jQuery.proxy, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady, - teardown: jQuery.noop - }, - - live: { - add: function (handleObj) { - jQuery.event.add(this, - liveConvert(handleObj.origType, handleObj.selector), - jQuery.extend({}, handleObj, { handler: liveHandler, guid: handleObj.handler.guid })); - }, - - remove: function (handleObj) { - jQuery.event.remove(this, liveConvert(handleObj.origType, handleObj.selector), handleObj); - } - }, - - beforeunload: { - setup: function (data, namespaces, eventHandle) { - // We only want to do this special case on windows - if (jQuery.isWindow(this)) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function (namespaces, eventHandle) { - if (this.onbeforeunload === eventHandle) { - this.onbeforeunload = null; - } - } - } - } - }; - - jQuery.removeEvent = document.removeEventListener ? - function (elem, type, handle) { - if (elem.removeEventListener) { - elem.removeEventListener(type, handle, false); - } - } : - function (elem, type, handle) { - if (elem.detachEvent) { - elem.detachEvent("on" + type, handle); - } - }; - - jQuery.Event = function (src) { - // Allow instantiation without the 'new' keyword - if (!this.preventDefault) { - return new jQuery.Event(src); - } - - // Event object - if (src && src.type) { - this.originalEvent = src; - this.type = src.type; - // Event type - } else { - this.type = src; - } - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = jQuery.now(); - - // Mark it as fixed - this[jQuery.expando] = true; - }; - - function returnFalse() { - return false; - } - function returnTrue() { - return true; - } - - // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding - // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html - jQuery.Event.prototype = { - preventDefault: function () { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if (!e) { - return; - } - - // if preventDefault exists run it on the original event - if (e.preventDefault) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function () { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if (!e) { - return; - } - // if stopPropagation exists run it on the original event - if (e.stopPropagation) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function () { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse - }; - - // Checks if an event happened on an element within another element - // Used in jQuery.event.special.mouseenter and mouseleave handlers - var withinElement = function (event) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - - // Firefox sometimes assigns relatedTarget a XUL element - // which we cannot access the parentNode property of - try { - // Traverse up the tree - while (parent && parent !== this) { - parent = parent.parentNode; - } - - if (parent !== this) { - // set the correct event type - event.type = event.data; - - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply(this, arguments); - } - - // assuming we've left the element since we most likely mousedover a xul element - } catch (e) { } - }, - - // In case of event delegation, we only need to rename the event.type, - // liveHandler will take care of the rest. -delegate = function (event) { - event.type = event.data; - jQuery.event.handle.apply(this, arguments); -}; - - // Create mouseenter and mouseleave events - jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" - }, function (orig, fix) { - jQuery.event.special[orig] = { - setup: function (data) { - jQuery.event.add(this, fix, data && data.selector ? delegate : withinElement, orig); - }, - teardown: function (data) { - jQuery.event.remove(this, fix, data && data.selector ? delegate : withinElement); - } - }; - }); - - // submit delegation - if (!jQuery.support.submitBubbles) { - - jQuery.event.special.submit = { - setup: function (data, namespaces) { - if (this.nodeName.toLowerCase() !== "form") { - jQuery.event.add(this, "click.specialSubmit", function (e) { - var elem = e.target, - type = elem.type; - - if ((type === "submit" || type === "image") && jQuery(elem).closest("form").length) { - e.liveFired = undefined; - return trigger("submit", this, arguments); - } - }); - - jQuery.event.add(this, "keypress.specialSubmit", function (e) { - var elem = e.target, - type = elem.type; - - if ((type === "text" || type === "password") && jQuery(elem).closest("form").length && e.keyCode === 13) { - e.liveFired = undefined; - return trigger("submit", this, arguments); - } - }); - - } else { - return false; - } - }, - - teardown: function (namespaces) { - jQuery.event.remove(this, ".specialSubmit"); - } - }; - - } - - // change delegation, happens here so we have bind. - if (!jQuery.support.changeBubbles) { - - var changeFilters, - - getVal = function (elem) { - var type = elem.type, val = elem.value; - - if (type === "radio" || type === "checkbox") { - val = elem.checked; - - } else if (type === "select-multiple") { - val = elem.selectedIndex > -1 ? - jQuery.map(elem.options, function (elem) { - return elem.selected; - }).join("-") : - ""; - - } else if (elem.nodeName.toLowerCase() === "select") { - val = elem.selectedIndex; - } - - return val; - }, - - testChange = function testChange(e) { - var elem = e.target, data, val; - - if (!rformElems.test(elem.nodeName) || elem.readOnly) { - return; - } - - data = jQuery.data(elem, "_change_data"); - val = getVal(elem); - - // the current data will be also retrieved by beforeactivate - if (e.type !== "focusout" || elem.type !== "radio") { - jQuery.data(elem, "_change_data", val); - } - - if (data === undefined || val === data) { - return; - } - - if (data != null || val) { - e.type = "change"; - e.liveFired = undefined; - return jQuery.event.trigger(e, arguments[1], elem); - } - }; - - jQuery.event.special.change = { - filters: { - focusout: testChange, - - beforedeactivate: testChange, - - click: function (e) { - var elem = e.target, type = elem.type; - - if (type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select") { - return testChange.call(this, e); - } - }, - - // Change has to be called before submit - // Keydown will be called before keypress, which is used in submit-event delegation - keydown: function (e) { - var elem = e.target, type = elem.type; - - if ((e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || - (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || - type === "select-multiple") { - return testChange.call(this, e); - } - }, - - // Beforeactivate happens also before the previous element is blurred - // with this event you can't trigger a change event, but you can store - // information - beforeactivate: function (e) { - var elem = e.target; - jQuery.data(elem, "_change_data", getVal(elem)); - } - }, - - setup: function (data, namespaces) { - if (this.type === "file") { - return false; - } - - for (var type in changeFilters) { - jQuery.event.add(this, type + ".specialChange", changeFilters[type]); - } - - return rformElems.test(this.nodeName); - }, - - teardown: function (namespaces) { - jQuery.event.remove(this, ".specialChange"); - - return rformElems.test(this.nodeName); - } - }; - - changeFilters = jQuery.event.special.change.filters; - - // Handle when the input is .focus()'d - changeFilters.focus = changeFilters.beforeactivate; - } - - function trigger(type, elem, args) { - args[0].type = type; - return jQuery.event.handle.apply(elem, args); - } - - // Create "bubbling" focus and blur events - if (document.addEventListener) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function (orig, fix) { - jQuery.event.special[fix] = { - setup: function () { - /// - /// This method is internal. - /// - /// - - if (focusCounts[fix]++ === 0) { - document.addEventListener(orig, handler, true); - } - }, - teardown: function () { - /// - /// This method is internal. - /// - /// - - if (--focusCounts[fix] === 0) { - document.removeEventListener(orig, handler, true); - } - } - }; - - function handler(e) { - e = jQuery.event.fix(e); - e.type = fix; - return jQuery.event.trigger(e, null, e.target); - } - }); - } - - // jQuery.each(["bind", "one"], function( i, name ) { - // jQuery.fn[ name ] = function( type, data, fn ) { - // // Handle object literals - // if ( typeof type === "object" ) { - // for ( var key in type ) { - // this[ name ](key, data, type[key], fn); - // } - // return this; - // } - - // if ( jQuery.isFunction( data ) || data === false ) { - // fn = data; - // data = undefined; - // } - - // var handler = name === "one" ? jQuery.proxy( fn, function( event ) { - // jQuery( this ).unbind( event, handler ); - // return fn.apply( this, arguments ); - // }) : fn; - - // if ( type === "unload" && name !== "one" ) { - // this.one( type, data, fn ); - - // } else { - // for ( var i = 0, l = this.length; i < l; i++ ) { - // jQuery.event.add( this[i], type, handler, data ); - // } - // } - - // return this; - // }; - // }); - - jQuery.fn["bind"] = function (type, data, fn) { - /// - /// Binds a handler to one or more events for each matched element. Can also bind custom events. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// Additional data passed to the event handler as event.data - /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. - - // Handle object literals - if (typeof type === "object") { - for (var key in type) { - this["bind"](key, data, type[key], fn); - } - return this; - } - - if (jQuery.isFunction(data)) { - fn = data; - data = undefined; - } - - var handler = "bind" === "one" ? jQuery.proxy(fn, function (event) { - jQuery(this).unbind(event, handler); - return fn.apply(this, arguments); - }) : fn; - - return type === "unload" && "bind" !== "one" ? - this.one(type, data, fn) : - this.each(function () { - jQuery.event.add(this, type, handler, data); - }); - }; - - jQuery.fn["one"] = function (type, data, fn) { - /// - /// Binds a handler to one or more events to be executed exactly once for each matched element. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// Additional data passed to the event handler as event.data - /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. - - // Handle object literals - if (typeof type === "object") { - for (var key in type) { - this["one"](key, data, type[key], fn); - } - return this; - } - - if (jQuery.isFunction(data)) { - fn = data; - data = undefined; - } - - var handler = "one" === "one" ? jQuery.proxy(fn, function (event) { - jQuery(this).unbind(event, handler); - return fn.apply(this, arguments); - }) : fn; - - return type === "unload" && "one" !== "one" ? - this.one(type, data, fn) : - this.each(function () { - jQuery.event.add(this, type, handler, data); - }); - }; - - jQuery.fn.extend({ - unbind: function (type, fn) { - /// - /// Unbinds a handler from one or more events for each matched element. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. - - // Handle object literals - if (typeof type === "object" && !type.preventDefault) { - for (var key in type) { - this.unbind(key, type[key]); - } - - } else { - for (var i = 0, l = this.length; i < l; i++) { - jQuery.event.remove(this[i], type, fn); - } - } - - 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) { - /// - /// Triggers a type of event on every matched element. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// Additional data passed to the event handler as additional arguments. - /// This parameter is undocumented. - - return this.each(function () { - jQuery.event.trigger(type, data, this); - }); - }, - - triggerHandler: function (type, data) { - /// - /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// Additional data passed to the event handler as additional arguments. - /// This parameter is undocumented. - - if (this[0]) { - var event = jQuery.Event(type); - event.preventDefault(); - event.stopPropagation(); - jQuery.event.trigger(event, data, this[0]); - return event.result; - } - }, - - toggle: function (fn) { - /// - /// Toggles among two or more function calls every other click. - /// - /// The functions among which to toggle execution - - // Save reference to arguments for access in closure - var args = arguments, - i = 1; - - // link all the functions, so any of them can unbind this click handler - while (i < args.length) { - jQuery.proxy(fn, args[i++]); - } - - return this.click(jQuery.proxy(fn, function (event) { - // Figure out which function to execute - var lastToggle = (jQuery.data(this, "lastToggle" + fn.guid) || 0) % i; - jQuery.data(this, "lastToggle" + fn.guid, lastToggle + 1); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[lastToggle].apply(this, arguments) || false; - })); - }, - - hover: function (fnOver, fnOut) { - /// - /// Simulates hovering (moving the mouse on or off of an object). - /// - /// The function to fire when the mouse is moved over a matched element. - /// The function to fire when the mouse is moved off of a matched element. - - return this.mouseenter(fnOver).mouseleave(fnOut || fnOver); - } - }); - - var liveMap = { - focus: "focusin", - blur: "focusout", - mouseenter: "mouseover", - mouseleave: "mouseout" - }; - - // jQuery.each(["live", "die"], function( i, name ) { - // jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { - // 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; - // } - - // if ( jQuery.isFunction( data ) ) { - // fn = data; - // data = undefined; - // } - - // types = (types || "").split(" "); - - // while ( (type = types[ i++ ]) != null ) { - // match = rnamespaces.exec( type ); - // namespaces = ""; - - // if ( match ) { - // namespaces = match[0]; - // type = type.replace( rnamespaces, "" ); - // } - - // if ( type === "hover" ) { - // types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); - // continue; - // } - - // preType = type; - - // if ( type === "focus" || type === "blur" ) { - // types.push( liveMap[ type ] + namespaces ); - // type = type + namespaces; - - // } else { - // type = (liveMap[ type ] || type) + namespaces; - // } - - // if ( name === "live" ) { - // // bind live handler - // for ( var j = 0, l = context.length; j < l; j++ ) { - // jQuery.event.add( context[j], "live." + liveConvert( type, selector ), - // { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); - // } - - // } else { - // // unbind live handler - // context.unbind( "live." + liveConvert( type, selector ), fn ); - // } - // } - - // return this; - // }; - // }); - - jQuery.fn["live"] = function (types, data, fn) { - /// - /// Attach a handler to the event for all elements which match the current selector, now or - /// in the future. - /// - /// - /// A string containing a JavaScript event type, such as "click" or "keydown". - /// - /// - /// A map of data that will be passed to the event handler. - /// - /// - /// A function to execute at the time the event is triggered. - /// - /// - - var type, i = 0; - - if (jQuery.isFunction(data)) { - fn = data; - data = undefined; - } - - types = (types || "").split(/\s+/); - - while ((type = types[i++]) != null) { - type = type === "focus" ? "focusin" : // focus --> focusin - type === "blur" ? "focusout" : // blur --> focusout - type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support - type; - - if ("live" === "live") { - // bind live handler - jQuery(this.context).bind(liveConvert(type, this.selector), { - data: data, selector: this.selector, live: type - }, fn); - - } else { - // unbind live handler - jQuery(this.context).unbind(liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type} : null); - } - } - - return this; - } - - jQuery.fn["die"] = function (types, data, fn) { - /// - /// Remove all event handlers previously attached using .live() from the elements. - /// - /// - /// A string containing a JavaScript event type, such as click or keydown. - /// - /// - /// The function that is to be no longer executed. - /// - /// - - var type, i = 0; - - if (jQuery.isFunction(data)) { - fn = data; - data = undefined; - } - - types = (types || "").split(/\s+/); - - while ((type = types[i++]) != null) { - type = type === "focus" ? "focusin" : // focus --> focusin - type === "blur" ? "focusout" : // blur --> focusout - type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support - type; - - if ("die" === "live") { - // bind live handler - jQuery(this.context).bind(liveConvert(type, this.selector), { - data: data, selector: this.selector, live: type - }, fn); - - } else { - // unbind live handler - jQuery(this.context).unbind(liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type} : null); - } - } - - return this; - } - - function liveHandler(event) { - var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, - elems = [], - selectors = [], - events = jQuery.data(this, this.nodeType ? "events" : "__events__"); - - if (typeof events === "function") { - events = events.events; - } - - // Make sure we avoid non-left-click bubbling in Firefox (#3861) - if (event.liveFired === this || !events || !events.live || event.button && event.type === "click") { - return; - } - - if (event.namespace) { - namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - event.liveFired = this; - - var live = events.live.slice(0); - - for (j = 0; j < live.length; j++) { - handleObj = live[j]; - - if (handleObj.origType.replace(rnamespaces, "") === event.type) { - selectors.push(handleObj.selector); - - } else { - live.splice(j--, 1); - } - } - - match = jQuery(event.target).closest(selectors, event.currentTarget); - - for (i = 0, l = match.length; i < l; i++) { - close = match[i]; - - for (j = 0; j < live.length; j++) { - handleObj = live[j]; - - if (close.selector === handleObj.selector && (!namespace || namespace.test(handleObj.namespace))) { - elem = close.elem; - related = null; - - // Those two events require additional checking - if (handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave") { - event.type = handleObj.preType; - related = jQuery(event.relatedTarget).closest(handleObj.selector)[0]; - } - - if (!related || related !== elem) { - elems.push({ elem: elem, handleObj: handleObj, level: close.level }); - } - } - } - } - - for (i = 0, l = elems.length; i < l; i++) { - match = elems[i]; - - if (maxLevel && match.level > maxLevel) { - break; - } - - event.currentTarget = match.elem; - event.data = match.handleObj.data; - event.handleObj = match.handleObj; - - ret = match.handleObj.origHandler.apply(match.elem, arguments); - - if (ret === false || event.isPropagationStopped()) { - maxLevel = match.level; - - if (ret === false) { - stop = false; - } - if (event.isImmediatePropagationStopped()) { - break; - } - } - } - - return stop; - } - - function liveConvert(type, selector) { - return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); - } - - // jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - // "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - // "change select submit keydown keypress keyup error").split(" "), function( i, name ) { - - // // Handle event binding - // jQuery.fn[ name ] = function( data, fn ) { - // if ( fn == null ) { - // fn = data; - // data = null; - // } - - // return arguments.length > 0 ? - // this.bind( name, data, fn ) : - // this.trigger( name ); - // }; - - // if ( jQuery.attrFn ) { - // jQuery.attrFn[ name ] = true; - // } - // }); - - jQuery.fn["blur"] = function (fn) { - /// - /// 1: blur() - Triggers the blur event of each matched element. - /// 2: blur(fn) - Binds a function to the blur event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("blur", fn) : this.trigger("blur"); - }; - - jQuery.fn["focus"] = function (fn) { - /// - /// 1: focus() - Triggers the focus event of each matched element. - /// 2: focus(fn) - Binds a function to the focus event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("focus", fn) : this.trigger("focus"); - }; - - jQuery.fn["focusin"] = function (fn) { - /// - /// Bind an event handler to the "focusin" JavaScript event. - /// - /// - /// A function to execute each time the event is triggered. - /// - /// - - return fn ? this.bind("focusin", fn) : this.trigger("focusin"); - }; - - jQuery.fn["focusout"] = function (fn) { - /// - /// Bind an event handler to the "focusout" JavaScript event. - /// - /// - /// A function to execute each time the event is triggered. - /// - /// - - return fn ? this.bind("focusout", fn) : this.trigger("focusout"); - }; - - jQuery.fn["load"] = function (fn) { - /// - /// 1: load() - Triggers the load event of each matched element. - /// 2: load(fn) - Binds a function to the load event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("load", fn) : this.trigger("load"); - }; - - jQuery.fn["resize"] = function (fn) { - /// - /// 1: resize() - Triggers the resize event of each matched element. - /// 2: resize(fn) - Binds a function to the resize event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("resize", fn) : this.trigger("resize"); - }; - - jQuery.fn["scroll"] = function (fn) { - /// - /// 1: scroll() - Triggers the scroll event of each matched element. - /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("scroll", fn) : this.trigger("scroll"); - }; - - jQuery.fn["unload"] = function (fn) { - /// - /// 1: unload() - Triggers the unload event of each matched element. - /// 2: unload(fn) - Binds a function to the unload event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("unload", fn) : this.trigger("unload"); - }; - - jQuery.fn["click"] = function (fn) { - /// - /// 1: click() - Triggers the click event of each matched element. - /// 2: click(fn) - Binds a function to the click event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("click", fn) : this.trigger("click"); - }; - - jQuery.fn["dblclick"] = function (fn) { - /// - /// 1: dblclick() - Triggers the dblclick event of each matched element. - /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("dblclick", fn) : this.trigger("dblclick"); - }; - - jQuery.fn["mousedown"] = function (fn) { - /// - /// Binds a function to the mousedown event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("mousedown", fn) : this.trigger("mousedown"); - }; - - jQuery.fn["mouseup"] = function (fn) { - /// - /// Bind a function to the mouseup event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("mouseup", fn) : this.trigger("mouseup"); - }; - - jQuery.fn["mousemove"] = function (fn) { - /// - /// Bind a function to the mousemove event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("mousemove", fn) : this.trigger("mousemove"); - }; - - jQuery.fn["mouseover"] = function (fn) { - /// - /// Bind a function to the mouseover event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("mouseover", fn) : this.trigger("mouseover"); - }; - - jQuery.fn["mouseout"] = function (fn) { - /// - /// Bind a function to the mouseout event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("mouseout", fn) : this.trigger("mouseout"); - }; - - jQuery.fn["mouseenter"] = function (fn) { - /// - /// Bind a function to the mouseenter event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("mouseenter", fn) : this.trigger("mouseenter"); - }; - - jQuery.fn["mouseleave"] = function (fn) { - /// - /// Bind a function to the mouseleave event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("mouseleave", fn) : this.trigger("mouseleave"); - }; - - jQuery.fn["change"] = function (fn) { - /// - /// 1: change() - Triggers the change event of each matched element. - /// 2: change(fn) - Binds a function to the change event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("change", fn) : this.trigger("change"); - }; - - jQuery.fn["select"] = function (fn) { - /// - /// 1: select() - Triggers the select event of each matched element. - /// 2: select(fn) - Binds a function to the select event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("select", fn) : this.trigger("select"); - }; - - jQuery.fn["submit"] = function (fn) { - /// - /// 1: submit() - Triggers the submit event of each matched element. - /// 2: submit(fn) - Binds a function to the submit event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("submit", fn) : this.trigger("submit"); - }; - - jQuery.fn["keydown"] = function (fn) { - /// - /// 1: keydown() - Triggers the keydown event of each matched element. - /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("keydown", fn) : this.trigger("keydown"); - }; - - jQuery.fn["keypress"] = function (fn) { - /// - /// 1: keypress() - Triggers the keypress event of each matched element. - /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("keypress", fn) : this.trigger("keypress"); - }; - - jQuery.fn["keyup"] = function (fn) { - /// - /// 1: keyup() - Triggers the keyup event of each matched element. - /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("keyup", fn) : this.trigger("keyup"); - }; - - jQuery.fn["error"] = function (fn) { - /// - /// 1: error() - Triggers the error event of each matched element. - /// 2: error(fn) - Binds a function to the error event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind("error", fn) : this.trigger("error"); - }; - - // Prevent memory leaks in IE - // Window isn't included so as not to unbind existing unload events - // More info: - // - http://isaacschlueter.com/2006/10/msie-memory-leaks/ - if (window.attachEvent && !window.addEventListener) { - jQuery(window).bind("unload", function () { - for (var id in jQuery.cache) { - if (jQuery.cache[id].handle) { - // Try/Catch is to handle iframes being unloaded, see #4280 - try { - jQuery.event.remove(jQuery.cache[id].handle.elem); - } catch (e) { } - } - } - }); - } - - - (function () { - - var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true; - - // Here we check if the JavaScript engine is using some sort of - // optimization where it does not always call our comparision - // function. If that is the case, discard the hasDuplicate value. - // Thus far that includes Google Chrome. - [0, 0].sort(function () { - baseHasDuplicate = false; - return 0; - }); - - var Sizzle = function (selector, context, results, seed) { - results = results || []; - context = context || document; - - var origContext = context; - - if (context.nodeType !== 1 && context.nodeType !== 9) { - return []; - } - - if (!selector || typeof selector !== "string") { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML(context), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec(""); - m = chunker.exec(soFar); - - if (m) { - soFar = m[3]; - - parts.push(m[1]); - - if (m[2]) { - extra = m[3]; - break; - } - } - } while (m); - - if (parts.length > 1 && origPOS.exec(selector)) { - - if (parts.length === 2 && Expr.relative[parts[0]]) { - set = posProcess(parts[0] + parts[1], context); - - } else { - set = Expr.relative[parts[0]] ? - [context] : - Sizzle(parts.shift(), context); - - while (parts.length) { - selector = parts.shift(); - - if (Expr.relative[selector]) { - selector += parts.shift(); - } - - set = posProcess(selector, set); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if (!seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1])) { - - ret = Sizzle.find(parts.shift(), context, contextXML); - context = ret.expr ? - Sizzle.filter(ret.expr, ret.set)[0] : - ret.set[0]; - } - - if (context) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed)} : - Sizzle.find(parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML); - - set = ret.expr ? - Sizzle.filter(ret.expr, ret.set) : - ret.set; - - if (parts.length > 0) { - checkSet = makeArray(set); - - } else { - prune = false; - } - - while (parts.length) { - cur = parts.pop(); - pop = cur; - - if (!Expr.relative[cur]) { - cur = ""; - } else { - pop = parts.pop(); - } - - if (pop == null) { - pop = context; - } - - Expr.relative[cur](checkSet, pop, contextXML); - } - - } else { - checkSet = parts = []; - } - } - - if (!checkSet) { - checkSet = set; - } - - if (!checkSet) { - Sizzle.error(cur || selector); - } - - if (toString.call(checkSet) === "[object Array]") { - if (!prune) { - results.push.apply(results, checkSet); - - } else if (context && context.nodeType === 1) { - for (i = 0; checkSet[i] != null; i++) { - if (checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i]))) { - results.push(set[i]); - } - } - - } else { - for (i = 0; checkSet[i] != null; i++) { - if (checkSet[i] && checkSet[i].nodeType === 1) { - results.push(set[i]); - } - } - } - - } else { - makeArray(checkSet, results); - } - - if (extra) { - Sizzle(extra, origContext, results, seed); - Sizzle.uniqueSort(results); - } - - return results; - }; - - Sizzle.uniqueSort = function (results) { - /// - /// Removes all duplicate elements from an array of elements. - /// - /// The array to translate - /// The array after translation. - - if (sortOrder) { - hasDuplicate = baseHasDuplicate; - results.sort(sortOrder); - - if (hasDuplicate) { - for (var i = 1; i < results.length; i++) { - if (results[i] === results[i - 1]) { - results.splice(i--, 1); - } - } - } - } - - return results; - }; - - Sizzle.matches = function (expr, set) { - return Sizzle(expr, null, null, set); - }; - - Sizzle.matchesSelector = function (node, expr) { - return Sizzle(expr, null, null, [node]).length > 0; - }; - - Sizzle.find = function (expr, context, isXML) { - var set; - - if (!expr) { - return []; - } - - for (var i = 0, l = Expr.order.length; i < l; i++) { - var match, - type = Expr.order[i]; - - if ((match = Expr.leftMatch[type].exec(expr))) { - var left = match[1]; - match.splice(1, 1); - - if (left.substr(left.length - 1) !== "\\") { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[type](match, context, isXML); - - if (set != null) { - expr = expr.replace(Expr.match[type], ""); - break; - } - } - } - } - - if (!set) { - set = context.getElementsByTagName("*"); - } - - return { set: set, expr: expr }; - }; - - Sizzle.filter = function (expr, set, inplace, not) { - var match, anyFound, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML(set[0]); - - while (expr && set.length) { - for (var type in Expr.filter) { - if ((match = Expr.leftMatch[type].exec(expr)) != null && match[2]) { - var found, item, - filter = Expr.filter[type], - left = match[1]; - - anyFound = false; - - match.splice(1, 1); - - if (left.substr(left.length - 1) === "\\") { - continue; - } - - if (curLoop === result) { - result = []; - } - - if (Expr.preFilter[type]) { - match = Expr.preFilter[type](match, curLoop, inplace, result, not, isXMLFilter); - - if (!match) { - anyFound = found = true; - - } else if (match === true) { - continue; - } - } - - if (match) { - for (var i = 0; (item = curLoop[i]) != null; i++) { - if (item) { - found = filter(item, match, i, curLoop); - var pass = not ^ !!found; - - if (inplace && found != null) { - if (pass) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if (pass) { - result.push(item); - anyFound = true; - } - } - } - } - - if (found !== undefined) { - if (!inplace) { - curLoop = result; - } - - expr = expr.replace(Expr.match[type], ""); - - if (!anyFound) { - return []; - } - - break; - } - } - } - - // Improper expression - if (expr === old) { - if (anyFound == null) { - Sizzle.error(expr); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; - }; - - Sizzle.error = function (msg) { - throw "Syntax error, unrecognized expression: " + msg; - }; - - var Expr = Sizzle.selectors = { - order: ["ID", "NAME", "TAG"], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function (elem) { - return elem.getAttribute("href"); - } - }, - - relative: { - "+": function (checkSet, part) { - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test(part), - isPartStrNotTag = isPartStr && !isTag; - - if (isTag) { - part = part.toLowerCase(); - } - - for (var i = 0, l = checkSet.length, elem; i < l; i++) { - if ((elem = checkSet[i])) { - while ((elem = elem.previousSibling) && elem.nodeType !== 1) { } - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if (isPartStrNotTag) { - Sizzle.filter(part, checkSet, true); - } - }, - - ">": function (checkSet, part) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if (isPartStr && !/\W/.test(part)) { - part = part.toLowerCase(); - - for (; i < l; i++) { - elem = checkSet[i]; - - if (elem) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for (; i < l; i++) { - elem = checkSet[i]; - - if (elem) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if (isPartStr) { - Sizzle.filter(part, checkSet, true); - } - } - }, - - "": function (checkSet, part, isXML) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if (typeof part === "string" && !/\W/.test(part)) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); - }, - - "~": function (checkSet, part, isXML) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if (typeof part === "string" && !/\W/.test(part)) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - - find: { - ID: function (match, context, isXML) { - if (typeof context.getElementById !== "undefined" && !isXML) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function (match, context) { - if (typeof context.getElementsByName !== "undefined") { - var ret = [], - results = context.getElementsByName(match[1]); - - for (var i = 0, l = results.length; i < l; i++) { - if (results[i].getAttribute("name") === match[1]) { - ret.push(results[i]); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function (match, context) { - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function (match, curLoop, inplace, result, not, isXML) { - match = " " + match[1].replace(/\\/g, "") + " "; - - if (isXML) { - return match; - } - - for (var i = 0, elem; (elem = curLoop[i]) != null; i++) { - if (elem) { - if (not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0)) { - if (!inplace) { - result.push(elem); - } - - } else if (inplace) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function (match) { - return match[1].replace(/\\/g, ""); - }, - - TAG: function (match, curLoop) { - return match[1].toLowerCase(); - }, - - CHILD: function (match) { - if (match[1] === "nth") { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test(match[2]) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function (match, curLoop, inplace, result, not, isXML) { - var name = match[1].replace(/\\/g, ""); - - if (!isXML && Expr.attrMap[name]) { - match[1] = Expr.attrMap[name]; - } - - if (match[2] === "~=") { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function (match, curLoop, inplace, result, not) { - if (match[1] === "not") { - // If we're dealing with a complex expression, or a simple one - if ((chunker.exec(match[3]) || "").length > 1 || /^\w/.test(match[3])) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if (!inplace) { - result.push.apply(result, ret); - } - - return false; - } - - } else if (Expr.match.POS.test(match[0]) || Expr.match.CHILD.test(match[0])) { - return true; - } - - return match; - }, - - POS: function (match) { - match.unshift(true); - - return match; - } - }, - - filters: { - enabled: function (elem) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function (elem) { - return elem.disabled === true; - }, - - checked: function (elem) { - return elem.checked === true; - }, - - selected: function (elem) { - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - - return elem.selected === true; - }, - - parent: function (elem) { - return !!elem.firstChild; - }, - - empty: function (elem) { - return !elem.firstChild; - }, - - has: function (elem, i, match) { - /// - /// Internal use only; use hasClass('class') - /// - /// - - return !!Sizzle(match[3], elem).length; - }, - - header: function (elem) { - return (/h\d/i).test(elem.nodeName); - }, - - text: function (elem) { - return "text" === elem.type; - }, - radio: function (elem) { - return "radio" === elem.type; - }, - - checkbox: function (elem) { - return "checkbox" === elem.type; - }, - - file: function (elem) { - return "file" === elem.type; - }, - password: function (elem) { - return "password" === elem.type; - }, - - submit: function (elem) { - return "submit" === elem.type; - }, - - image: function (elem) { - return "image" === elem.type; - }, - - reset: function (elem) { - return "reset" === elem.type; - }, - - button: function (elem) { - return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; - }, - - input: function (elem) { - return (/input|select|textarea|button/i).test(elem.nodeName); - } - }, - setFilters: { - first: function (elem, i) { - return i === 0; - }, - - last: function (elem, i, match, array) { - return i === array.length - 1; - }, - - even: function (elem, i) { - return i % 2 === 0; - }, - - odd: function (elem, i) { - return i % 2 === 1; - }, - - lt: function (elem, i, match) { - return i < match[3] - 0; - }, - - gt: function (elem, i, match) { - return i > match[3] - 0; - }, - - nth: function (elem, i, match) { - return match[3] - 0 === i; - }, - - eq: function (elem, i, match) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function (elem, match, i, array) { - var name = match[1], - filter = Expr.filters[name]; - - if (filter) { - return filter(elem, i, match, array); - - } else if (name === "contains") { - return (elem.textContent || elem.innerText || Sizzle.getText([elem]) || "").indexOf(match[3]) >= 0; - - } else if (name === "not") { - var not = match[3]; - - for (var j = 0, l = not.length; j < l; j++) { - if (not[j] === elem) { - return false; - } - } - - return true; - - } else { - Sizzle.error("Syntax error, unrecognized expression: " + name); - } - }, - - CHILD: function (elem, match) { - var type = match[1], - node = elem; - - switch (type) { - case "only": - case "first": - while ((node = node.previousSibling)) { - if (node.nodeType === 1) { - return false; - } - } - - if (type === "first") { - return true; - } - - node = elem; - - case "last": - while ((node = node.nextSibling)) { - if (node.nodeType === 1) { - return false; - } - } - - return true; - - case "nth": - var first = match[2], - last = match[3]; - - 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; - - } else { - return (diff % first === 0 && diff / first >= 0); - } - } - }, - - ID: function (elem, match) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function (elem, match) { - return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; - }, - - CLASS: function (elem, match) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf(match) > -1; - }, - - ATTR: function (elem, match) { - var name = match[1], - result = Expr.attrHandle[name] ? - Expr.attrHandle[name](elem) : - elem[name] != null ? - elem[name] : - elem.getAttribute(name), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function (elem, match, i, array) { - var name = match[2], - filter = Expr.setFilters[name]; - - if (filter) { - return filter(elem, i, match, array); - } - } - } - }; - - var origPOS = Expr.match.POS, - fescape = function (all, num) { - return "\\" + (num - 0 + 1); - }; - - for (var type in Expr.match) { - Expr.match[type] = new RegExp(Expr.match[type].source + (/(?![^\[]*\])(?![^\(]*\))/.source)); - Expr.leftMatch[type] = new RegExp(/(^(?:.|\r|\n)*?)/.source + Expr.match[type].source.replace(/\\(\d+)/g, fescape)); - } - - var makeArray = function (array, results) { - array = Array.prototype.slice.call(array, 0); - - if (results) { - results.push.apply(results, array); - return results; - } - - return array; - }; - - // Perform a simple check to determine if the browser is capable of - // converting a NodeList to an array using builtin methods. - // Also verifies that the returned array holds DOM nodes - // (which is not the case in the Blackberry browser) - try { - Array.prototype.slice.call(document.documentElement.childNodes, 0)[0].nodeType; - - // Provide a fallback method if it does not work - } catch (e) { - makeArray = function (array, results) { - var i = 0, - ret = results || []; - - if (toString.call(array) === "[object Array]") { - Array.prototype.push.apply(ret, array); - - } else { - if (typeof array.length === "number") { - for (var l = array.length; i < l; i++) { - ret.push(array[i]); - } - - } else { - for (; array[i]; i++) { - ret.push(array[i]); - } - } - } - - return ret; - }; - } - - var sortOrder, siblingCheck; - - if (document.documentElement.compareDocumentPosition) { - sortOrder = function (a, b) { - if (a === b) { - hasDuplicate = true; - return 0; - } - - if (!a.compareDocumentPosition || !b.compareDocumentPosition) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - - } else { - sortOrder = function (a, b) { - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // The nodes are identical, we can exit early - if (a === b) { - hasDuplicate = true; - return 0; - - // If the nodes are siblings (or identical) we can do a quick check - } else if (aup === bup) { - return siblingCheck(a, b); - - // If no parents were found then the nodes are disconnected - } else if (!aup) { - return -1; - - } else if (!bup) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while (cur) { - ap.unshift(cur); - cur = cur.parentNode; - } - - cur = bup; - - while (cur) { - bp.unshift(cur); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for (var i = 0; i < al && i < bl; i++) { - if (ap[i] !== bp[i]) { - return siblingCheck(ap[i], bp[i]); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck(a, bp[i], -1) : - siblingCheck(ap[i], b, 1); - }; - - siblingCheck = function (a, b, ret) { - if (a === b) { - return ret; - } - - var cur = a.nextSibling; - - while (cur) { - if (cur === b) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; - } - - // Utility function for retreiving the text value of an array of DOM nodes - Sizzle.getText = function (elems) { - var ret = "", elem; - - for (var i = 0; elems[i]; i++) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if (elem.nodeType === 3 || elem.nodeType === 4) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if (elem.nodeType !== 8) { - ret += Sizzle.getText(elem.childNodes); - } - } - - return ret; - }; - - // [vsdoc] The following function has been modified for IntelliSense. - // Check to see if the browser returns elements by name when - // querying by getElementById (and provide a workaround) - (function () { - // We're going to inject a fake input element with a specified name - // var form = document.createElement("div"), - // id = "script" + (new Date()).getTime(), - // root = document.documentElement; - - // form.innerHTML = ""; - - // // Inject it into the root element, check its status, and remove it quickly - // root.insertBefore( form, root.firstChild ); - - // // The workaround has to do additional checks after a getElementById - // // Which slows things down for other browsers (hence the branching) - // if ( document.getElementById( id ) ) { - Expr.find.ID = function (match, context, isXML) { - if (typeof context.getElementById !== "undefined" && !isXML) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function (elem, match) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - // } - - // root.removeChild( form ); - - // release memory in IE - root = form = null; - })(); - - // [vsdoc] The following function has been modified for IntelliSense. - (function () { - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - // var div = document.createElement("div"); - // div.appendChild( document.createComment("") ); - - // Make sure no comments are found - // if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function (match, context) { - var results = context.getElementsByTagName(match[1]); - - // Filter out possible comments - if (match[1] === "*") { - var tmp = []; - - for (var i = 0; results[i]; i++) { - if (results[i].nodeType === 1) { - tmp.push(results[i]); - } - } - - results = tmp; - } - - return results; - }; - // } - - // Check to see if an attribute returns normalized href attributes - // div.innerHTML = ""; - - // if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - // div.firstChild.getAttribute("href") !== "#" ) { - - // Expr.attrHandle.href = function( elem ) { - // return elem.getAttribute( "href", 2 ); - // }; - // } - - // release memory in IE - div = null; - })(); - - if (document.querySelectorAll) { - (function () { - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if (div.querySelectorAll && div.querySelectorAll(".TEST").length === 0) { - return; - } - - Sizzle = function (query, context, extra, seed) { - context = context || document; - - // Make sure that attribute selectors are quoted - query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if (!seed && !Sizzle.isXML(context)) { - if (context.nodeType === 9) { - try { - return makeArray(context.querySelectorAll(query), extra); - } catch (qsaError) { } - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if (context.nodeType === 1 && context.nodeName.toLowerCase() !== "object") { - var old = context.getAttribute("id"), - nid = old || id; - - if (!old) { - context.setAttribute("id", nid); - } - - try { - return makeArray(context.querySelectorAll("#" + nid + " " + query), extra); - - } catch (pseudoError) { - } finally { - if (!old) { - context.removeAttribute("id"); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for (var prop in oldSizzle) { - Sizzle[prop] = oldSizzle[prop]; - } - - // release memory in IE - div = null; - })(); - } - - (function () { - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call(document.documentElement, "[test!='']:sizzle"); - - } catch (pseudoError) { - pseudoWorks = true; - } - - if (matches) { - Sizzle.matchesSelector = function (node, expr) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if (!Sizzle.isXML(node)) { - try { - if (pseudoWorks || !Expr.match.PSEUDO.test(expr) && !/!=/.test(expr)) { - return matches.call(node, expr); - } - } catch (e) { } - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } - })(); - - (function () { - var div = document.createElement("div"); - - div.innerHTML = "
"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if (!div.getElementsByClassName || div.getElementsByClassName("e").length === 0) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - 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) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; - })(); - - function dirNodeCheck(dir, cur, doneName, checkSet, nodeCheck, isXML) { - for (var i = 0, l = checkSet.length; i < l; i++) { - var elem = checkSet[i]; - - if (elem) { - var match = false; - - elem = elem[dir]; - - while (elem) { - if (elem.sizcache === doneName) { - match = checkSet[elem.sizset]; - break; - } - - if (elem.nodeType === 1 && !isXML) { - elem.sizcache = doneName; - elem.sizset = i; - } - - if (elem.nodeName.toLowerCase() === cur) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } - } - - function dirCheck(dir, cur, doneName, checkSet, nodeCheck, isXML) { - for (var i = 0, l = checkSet.length; i < l; i++) { - var elem = checkSet[i]; - - if (elem) { - var match = false; - - elem = elem[dir]; - - while (elem) { - if (elem.sizcache === doneName) { - match = checkSet[elem.sizset]; - break; - } - - if (elem.nodeType === 1) { - if (!isXML) { - elem.sizcache = doneName; - elem.sizset = i; - } - - if (typeof cur !== "string") { - if (elem === cur) { - match = true; - break; - } - - } else if (Sizzle.filter(cur, [elem]).length > 0) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } - } - - if (document.documentElement.contains) { - Sizzle.contains = function (a, b) { - /// - /// Check to see if a DOM node is within another DOM node. - /// - /// - /// The DOM element that may contain the other element. - /// - /// - /// The DOM node that may be contained by the other element. - /// - /// - - return a !== b && (a.contains ? a.contains(b) : true); - }; - - } else if (document.documentElement.compareDocumentPosition) { - Sizzle.contains = function (a, b) { - /// - /// Check to see if a DOM node is within another DOM node. - /// - /// - /// The DOM element that may contain the other element. - /// - /// - /// The DOM node that may be contained by the other element. - /// - /// - - return !!(a.compareDocumentPosition(b) & 16); - }; - - } else { - Sizzle.contains = function () { - return false; - }; - } - - Sizzle.isXML = function (elem) { - /// - /// Determines if the parameter passed is an XML document. - /// - /// The object to test - /// True if the parameter is an XML document; otherwise false. - - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; - }; - - var posProcess = function (selector, context) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ((match = Expr.match.PSEUDO.exec(selector))) { - later += match[0]; - selector = selector.replace(Expr.match.PSEUDO, ""); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for (var i = 0, l = root.length; i < l; i++) { - Sizzle(selector, root[i], tmpSet); - } - - return Sizzle.filter(later, tmpSet); - }; - - // EXPOSE - jQuery.find = Sizzle; - jQuery.expr = Sizzle.selectors; - jQuery.expr[":"] = jQuery.expr.filters; - jQuery.unique = Sizzle.uniqueSort; - jQuery.text = Sizzle.getText; - jQuery.isXMLDoc = Sizzle.isXML; - jQuery.contains = Sizzle.contains; - - - })(); - - - var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.POS; - - jQuery.fn.extend({ - find: function (selector) { - /// - /// Searches for all elements that match the specified expression. - /// This method is a good way to find additional descendant - /// elements with which to process. - /// All searching is done using a jQuery expression. The expression can be - /// written using CSS 1-3 Selector syntax, or basic XPath. - /// Part of DOM/Traversing - /// - /// - /// - /// An expression to search with. - /// - /// - - var ret = this.pushStack("", "find", selector), - length = 0; - - for (var i = 0, l = this.length; i < l; i++) { - length = ret.length; - jQuery.find(selector, this[i], ret); - - if (i > 0) { - // Make sure that the results are unique - for (var n = length; n < ret.length; n++) { - for (var r = 0; r < length; r++) { - if (ret[r] === ret[n]) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function (target) { - /// - /// Reduce the set of matched elements to those that have a descendant that matches the - /// selector or DOM element. - /// - /// - /// A string containing a selector expression to match elements against. - /// - /// - - var targets = jQuery(target); - return this.filter(function () { - for (var i = 0, l = targets.length; i < l; i++) { - if (jQuery.contains(this, targets[i])) { - return true; - } - } - }); - }, - - not: function (selector) { - /// - /// Removes any elements inside the array of elements from the set - /// of matched elements. This method is used to remove one or more - /// elements from a jQuery object. - /// Part of DOM/Traversing - /// - /// - /// A set of elements to remove from the jQuery set of matched elements. - /// - /// - - return this.pushStack(winnow(this, selector, false), "not", selector); - }, - - filter: function (selector) { - /// - /// Removes all elements from the set of matched elements that do not - /// pass the specified filter. This method is used to narrow down - /// the results of a search. - /// }) - /// Part of DOM/Traversing - /// - /// - /// - /// A function to use for filtering - /// - /// - - return this.pushStack(winnow(this, selector, true), "filter", selector); - }, - - is: function (selector) { - /// - /// Checks the current selection against an expression and returns true, - /// if at least one element of the selection fits the given expression. - /// Does return false, if no element fits or the expression is not valid. - /// filter(String) is used internally, therefore all rules that apply there - /// apply here, too. - /// Part of DOM/Traversing - /// - /// - /// - /// The expression with which to filter - /// - - return !!selector && jQuery.filter(selector, this).length > 0; - }, - - closest: function (selectors, context) { - /// - /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. - /// - /// - /// A string containing a selector expression to match elements against. - /// - /// - /// A DOM element within which a matching element may be found. If no context is passed - /// in then the context of the jQuery set will be used instead. - /// - /// - - var ret = [], i, l, cur = this[0]; - - if (jQuery.isArray(selectors)) { - var match, selector, - matches = {}, - level = 1; - - if (cur && selectors.length) { - for (i = 0, l = selectors.length; i < l; i++) { - selector = selectors[i]; - - if (!matches[selector]) { - matches[selector] = jQuery.expr.match.POS.test(selector) ? - jQuery(selector, context || this.context) : - selector; - } - } - - while (cur && cur.ownerDocument && cur !== context) { - for (selector in matches) { - match = matches[selector]; - - if (match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match)) { - ret.push({ selector: selector, elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - } - - return ret; - } - - var pos = POS.test(selectors) ? - jQuery(selectors, context || this.context) : null; - - for (i = 0, l = this.length; i < l; i++) { - cur = this[i]; - - while (cur) { - if (pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors)) { - ret.push(cur); - break; - - } else { - cur = cur.parentNode; - if (!cur || !cur.ownerDocument || cur === context) { - break; - } - } - } - } - - 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) { - /// - /// Searches every matched element for the object and returns - /// the index of the element, if found, starting with zero. - /// Returns -1 if the object wasn't found. - /// Part of Core - /// - /// - /// - /// Object to search for - /// - - if (!elem || typeof elem === "string") { - return jQuery.inArray(this[0], - // If it receives a string, the selector is used - // If it receives nothing, the siblings are used - elem ? jQuery(elem) : this.parent().children()); - } - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this); - }, - - add: function (selector, context) { - /// - /// Adds one or more Elements to the set of matched elements. - /// Part of DOM/Traversing - /// - /// - /// A string containing a selector expression to match additional elements against. - /// - /// - /// Add some elements rooted against the specified context. - /// - /// - - var set = typeof selector === "string" ? - jQuery(selector, context || this.context) : - jQuery.makeArray(selector), - all = jQuery.merge(this.get(), set); - - return this.pushStack(isDisconnected(set[0]) || isDisconnected(all[0]) ? - all : - jQuery.unique(all)); - }, - - andSelf: function () { - /// - /// Adds the previous selection to the current selection. - /// - /// - - return this.add(this.prevObject); - } - }); - - // A painfully simple check to see if an element is disconnected - // from a document (should be improved, where feasible). - function isDisconnected(node) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; - } - - jQuery.fn.parents = function (until, selector) { - /// - /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. - /// - /// - /// A string containing a selector expression to match elements against. - /// - /// - return jQuery.dir(elem, "parentNode"); - }; - - jQuery.fn.parentsUntil = function (until, selector) { - /// - /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector. - /// - /// - /// A string containing a selector expression to indicate where to stop matching ancestor elements. - /// - /// - return jQuery.dir(elem, "parentNode", until); - }; - - jQuery.each({ - parent: function (elem) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - next: function (elem) { - return jQuery.nth(elem, 2, "nextSibling"); - }, - prev: function (elem) { - return jQuery.nth(elem, 2, "previousSibling"); - }, - nextAll: function (elem) { - return jQuery.dir(elem, "nextSibling"); - }, - prevAll: function (elem) { - return jQuery.dir(elem, "previousSibling"); - }, - nextUntil: function (elem, i, until) { - /// - /// Get all following siblings of each element up to but not including the element matched - /// by the selector. - /// - /// - /// A string containing a selector expression to indicate where to stop matching following - /// sibling elements. - /// - /// - - return jQuery.dir(elem, "nextSibling", until); - }, - prevUntil: function (elem, i, until) { - /// - /// Get all preceding siblings of each element up to but not including the element matched - /// by the selector. - /// - /// - /// A string containing a selector expression to indicate where to stop matching preceding - /// sibling elements. - /// - /// - - return jQuery.dir(elem, "previousSibling", until); - }, - siblings: function (elem) { - return jQuery.sibling(elem.parentNode.firstChild, elem); - }, - children: function (elem) { - return jQuery.sibling(elem.firstChild); - }, - contents: function (elem) { - return jQuery.nodeName(elem, "iframe") ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray(elem.childNodes); - } - }, function (name, fn) { - jQuery.fn[name] = function (until, selector) { - var ret = jQuery.map(this, fn, until); - - if (!runtil.test(name)) { - selector = until; - } - - if (selector && typeof selector === "string") { - ret = jQuery.filter(selector, ret); - } - - ret = this.length > 1 ? jQuery.unique(ret) : ret; - - if ((this.length > 1 || rmultiselector.test(selector)) && rparentsprev.test(name)) { - ret = ret.reverse(); - } - - return this.pushStack(ret, name, slice.call(arguments).join(",")); - }; - }); - - jQuery.extend({ - filter: function (expr, elems, not) { - if (not) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function (elem, dir, until) { - /// - /// This member is internal only. - /// - /// - - var matched = [], - cur = elem[dir]; - - while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery(cur).is(until))) { - if (cur.nodeType === 1) { - matched.push(cur); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function (cur, result, dir, elem) { - /// - /// This member is internal only. - /// - /// - - result = result || 1; - var num = 0; - - for (; cur; cur = cur[dir]) { - if (cur.nodeType === 1 && ++num === result) { - break; - } - } - - return cur; - }, - - sibling: function (n, elem) { - /// - /// This member is internal only. - /// - /// - - var r = []; - - for (; n; n = n.nextSibling) { - if (n.nodeType === 1 && n !== elem) { - r.push(n); - } - } - - return r; - } - }); - - // Implement the identical functionality for filter and not - function winnow(elements, qualifier, keep) { - if (jQuery.isFunction(qualifier)) { - return jQuery.grep(elements, function (elem, i) { - var retVal = !!qualifier.call(elem, i, elem); - return retVal === keep; - }); - - } else if (qualifier.nodeType) { - return jQuery.grep(elements, function (elem, i) { - return (elem === qualifier) === keep; - }); - - } else if (typeof qualifier === "string") { - var filtered = jQuery.grep(elements, function (elem) { - return elem.nodeType === 1; - }); - - if (isSimple.test(qualifier)) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter(qualifier, filtered); - } - } - - return jQuery.grep(elements, function (elem, i) { - return (jQuery.inArray(elem, qualifier) >= 0) === keep; - }); - } - - - - - var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /\s]+\/)>/g, - wrapMap = { - option: [1, ""], - legend: [1, "
", "
"], - thead: [1, "", "
"], - tr: [2, "", "
"], - td: [3, "", "
"], - col: [2, "", "
"], - area: [1, "", ""], - _default: [0, "", ""] - }; - - wrapMap.optgroup = wrapMap.option; - wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; - wrapMap.th = wrapMap.td; - - // IE can't serialize and "); - }; - - if (jQueryTmplVersion > 0) { - jQuery['tmpl']['tag']['ko_code'] = { - open: "__.push($1 || '');" - }; - jQuery['tmpl']['tag']['ko_with'] = { - open: "with($1) {", - close: "} " - }; - } - }; - - ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine(); - - // Use this one by default *only if jquery.tmpl is referenced* - var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine(); - if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0) - ko.setTemplateEngine(jqueryTmplTemplateEngineInstance); - - ko.exportSymbol('ko.jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine); -})();})(window); diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/knockout-2.0.0.js b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/knockout-2.0.0.js deleted file mode 100644 index d78d45e..0000000 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/knockout-2.0.0.js +++ /dev/null @@ -1,129 +0,0 @@ -/*! -* Note: While Microsoft is not the author of this script file, Microsoft -* grants you the right to use this file for the sole purpose of either: -* (i) interacting through your browser with the Microsoft website, subject -* to the website's terms of use; or (ii) using the files as included with a -* Microsoft product subject to the Microsoft Software License Terms for that -* Microsoft product. Microsoft reserves all other rights to the files not -* expressly granted by Microsoft, whether by implication, estoppel or -* otherwise. The notices and licenses below are for informational purposes -* only. -* -* Provided for Informational Purposes Only -* MIT License -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -*/ -// Knockout JavaScript library v2.0.0 -// (c) Steven Sanderson - http://knockoutjs.com/ -// License: MIT (http://www.opensource.org/licenses/mit-license.php) - -(function(window,undefined){ -function c(a){throw a;}var l=void 0,m=!0,o=null,p=!1,r=window.ko={};r.b=function(a,b){for(var d=a.split("."),e=window,f=0;f",b[0];);return 4r.a.k(e,a[b])&&e.push(a[b]);return e},ba:function(a,e){for(var a=a||[],b=[],f=0,d=a.length;fa.length?p:a.substring(0,e.length)===e},hb:function(a){for(var e=Array.prototype.slice.call(arguments,1),b="return ("+a+")",f=0;f",""]||!d.indexOf("",""]||(!d.indexOf("",""]||[0,"",""];a="ignored
"+ -d[1]+a+d[2]+"
";for("function"==typeof window.innerShiv?b.appendChild(window.innerShiv(a)):b.innerHTML=a;d[0]--;)b=b.lastChild;b=r.a.X(b.lastChild.childNodes)}return b};r.a.Z=function(a,b){r.a.U(a);if(b!==o&&b!==l)if("string"!=typeof b&&(b=b.toString()),"undefined"!=typeof jQuery)jQuery(a).html(b);else for(var d=r.a.ma(b),e=0;e"},Ra:function(a,b){var h=d[a];h===l&&c(Error("Couldn't find any memo with ID "+ -a+". Perhaps it's already been unmemoized."));try{return h.apply(o,b||[]),m}finally{delete d[a]}},Sa:function(a,f){var d=[];b(a,d);for(var g=0,i=d.length;gb;b++)a=a();return a})};r.toJSON=function(a){a=r.Pa(a);return r.a.qa(a)}})();r.b("ko.toJS",r.Pa);r.b("ko.toJSON",r.toJSON); -r.h={q:function(a){return"OPTION"==a.tagName?a.__ko__hasDomDataOptionValue__===m?r.a.e.get(a,r.c.options.la):a.getAttribute("value"):"SELECT"==a.tagName?0<=a.selectedIndex?r.h.q(a.options[a.selectedIndex]):l:a.value},S:function(a,b){if("OPTION"==a.tagName)switch(typeof b){case "string":r.a.e.set(a,r.c.options.la,l);"__ko__hasDomDataOptionValue__"in a&&delete a.__ko__hasDomDataOptionValue__;a.value=b;break;default:r.a.e.set(a,r.c.options.la,b),a.__ko__hasDomDataOptionValue__=m,a.value="number"===typeof b? -b:""}else if("SELECT"==a.tagName)for(var d=a.options.length-1;0<=d;d--){if(r.h.q(a.options[d])==b){a.selectedIndex=d;break}}else{if(b===o||b===l)b="";a.value=b}}};r.b("ko.selectExtensions",r.h);r.b("ko.selectExtensions.readValue",r.h.q);r.b("ko.selectExtensions.writeValue",r.h.S); -r.j=function(){function a(a,e){for(var d=o;a!=d;)d=a,a=a.replace(b,function(a,b){return e[b]});return a}var b=/\@ko_token_(\d+)\@/g,d=/^[\_$a-z][\_$a-z0-9]*(\[.*?\])*(\.[\_$a-z][\_$a-z0-9]*(\[.*?\])*)*$/i,e=["true","false"];return{D:[],Y:function(b){var e=r.a.z(b);if(3>e.length)return[];"{"===e.charAt(0)&&(e=e.substring(1,e.length-1));for(var b=[],d=o,i,j=0;j$/: -/^\s*ko\s+(.*\:.*)\s*$/,g=f?/^<\!--\s*\/ko\s*--\>$/:/^\s*\/ko\s*$/,i={ul:m,ol:m};r.f={C:{},childNodes:function(b){return a(b)?d(b):b.childNodes},ha:function(b){if(a(b))for(var b=r.f.childNodes(b),e=0,d=b.length;e"),p)}};r.c.uniqueName.Za=0; -r.c.checked={init:function(a,b,d){r.a.s(a,"click",function(){var e;if("checkbox"==a.type)e=a.checked;else if("radio"==a.type&&a.checked)e=a.value;else return;var f=b();"checkbox"==a.type&&r.a.d(f)instanceof Array?(e=r.a.k(r.a.d(f),a.value),a.checked&&0>e?f.push(a.value):!a.checked&&0<=e&&f.splice(e,1)):r.P(f)?f()!==e&&f(e):(f=d(),f._ko_property_writers&&f._ko_property_writers.checked&&f._ko_property_writers.checked(e))});"radio"==a.type&&!a.name&&r.c.uniqueName.init(a,function(){return m})},update:function(a, -b){var d=r.a.d(b());if("checkbox"==a.type)a.checked=d instanceof Array?0<=r.a.k(d,a.value):d;else if("radio"==a.type)a.checked=a.value==d}};r.c.attr={update:function(a,b){var d=r.a.d(b())||{},e;for(e in d)if("string"==typeof e){var f=r.a.d(d[e]);f===p||f===o||f===l?a.removeAttribute(e):a.setAttribute(e,f.toString())}}}; -r.c.hasfocus={init:function(a,b,d){function e(a){var e=b();a!=r.a.d(e)&&(r.P(e)?e(a):(e=d(),e._ko_property_writers&&e._ko_property_writers.hasfocus&&e._ko_property_writers.hasfocus(a)))}r.a.s(a,"focus",function(){e(m)});r.a.s(a,"focusin",function(){e(m)});r.a.s(a,"blur",function(){e(p)});r.a.s(a,"focusout",function(){e(p)})},update:function(a,b){var d=r.a.d(b());d?a.focus():a.blur();r.a.sa(a,d?"focusin":"focusout")}}; -r.c["with"]={o:function(a){return function(){var b=a();return{"if":b,data:b,templateEngine:r.p.M}}},init:function(a,b){return r.c.template.init(a,r.c["with"].o(b))},update:function(a,b,d,e,f){return r.c.template.update(a,r.c["with"].o(b),d,e,f)}};r.j.D["with"]=p;r.f.C["with"]=m;r.c["if"]={o:function(a){return function(){return{"if":a(),templateEngine:r.p.M}}},init:function(a,b){return r.c.template.init(a,r.c["if"].o(b))},update:function(a,b,d,e,f){return r.c.template.update(a,r.c["if"].o(b),d,e,f)}}; -r.j.D["if"]=p;r.f.C["if"]=m;r.c.ifnot={o:function(a){return function(){return{ifnot:a(),templateEngine:r.p.M}}},init:function(a,b){return r.c.template.init(a,r.c.ifnot.o(b))},update:function(a,b,d,e,f){return r.c.template.update(a,r.c.ifnot.o(b),d,e,f)}};r.j.D.ifnot=p;r.f.C.ifnot=m; -r.c.foreach={o:function(a){return function(){var b=r.a.d(a());return!b||"number"==typeof b.length?{foreach:b,templateEngine:r.p.M}:{foreach:b.data,includeDestroyed:b.includeDestroyed,afterAdd:b.afterAdd,beforeRemove:b.beforeRemove,afterRender:b.afterRender,templateEngine:r.p.M}}},init:function(a,b){return r.c.template.init(a,r.c.foreach.o(b))},update:function(a,b,d,e,f){return r.c.template.update(a,r.c.foreach.o(b),d,e,f)}};r.j.D.foreach=p;r.f.C.foreach=m;r.b("ko.allowedVirtualElementBindings",r.f.C); -r.t=function(){};r.t.prototype.renderTemplateSource=function(){c("Override renderTemplateSource")};r.t.prototype.createJavaScriptEvaluatorBlock=function(){c("Override createJavaScriptEvaluatorBlock")};r.t.prototype.makeTemplateSource=function(a){if("string"==typeof a){var b=document.getElementById(a);b||c(Error("Cannot find template with ID "+a));return new r.m.g(b)}if(1==a.nodeType||8==a.nodeType)return new r.m.I(a);c(Error("Unknown template type: "+a))}; -r.t.prototype.renderTemplate=function(a,b,d){return this.renderTemplateSource(this.makeTemplateSource(a),b,d)};r.t.prototype.isTemplateRewritten=function(a){return this.allowTemplateRewriting===p?m:this.W&&this.W[a]?m:this.makeTemplateSource(a).data("isRewritten")};r.t.prototype.rewriteTemplate=function(a,b){var d=this.makeTemplateSource(a),e=b(d.text());d.text(e);d.data("isRewritten",m);if("string"==typeof a)this.W=this.W||{},this.W[a]=m};r.b("ko.templateEngine",r.t); -r.$=function(){function a(a,b,d){for(var a=r.j.Y(a),g=r.j.D,i=0;i/g;return{gb:function(a,b){b.isTemplateRewritten(a)||b.rewriteTemplate(a,function(a){return r.$.ub(a,b)})},ub:function(e,f){return e.replace(b,function(b,e,d,j,k,n,t){return a(t,e,f)}).replace(d,function(b,e){return a(e,"<\!-- ko --\>",f)})},Ua:function(a){return r.r.ka(function(b,d){b.nextSibling&&r.xa(b.nextSibling,a,d)})}}}();r.b("ko.templateRewriting",r.$);r.b("ko.templateRewriting.applyMemoizedBindingsToNextSibling",r.$.Ua);r.m={};r.m.g=function(a){this.g=a}; -r.m.g.prototype.text=function(){if(0==arguments.length)return"script"==this.g.tagName.toLowerCase()?this.g.text:this.g.innerHTML;var a=arguments[0];"script"==this.g.tagName.toLowerCase()?this.g.text=a:r.a.Z(this.g,a)};r.m.g.prototype.data=function(a){if(1===arguments.length)return r.a.e.get(this.g,"templateSourceData_"+a);r.a.e.set(this.g,"templateSourceData_"+a,arguments[1])};r.m.I=function(a){this.g=a};r.m.I.prototype=new r.m.g; -r.m.I.prototype.text=function(){if(0==arguments.length)return r.a.e.get(this.g,"__ko_anon_template__");r.a.e.set(this.g,"__ko_anon_template__",arguments[0])};r.b("ko.templateSources",r.m);r.b("ko.templateSources.domElement",r.m.g);r.b("ko.templateSources.anonymousTemplate",r.m.I); -(function(){function a(a,b,d){for(var g=0;node=a[g];g++)node.parentNode===b&&(1===node.nodeType||8===node.nodeType)&&d(node)}function b(a,b,h,g,i){var i=i||{},j=i.templateEngine||d;r.$.gb(h,j);h=j.renderTemplate(h,g,i);("number"!=typeof h.length||0a&&c(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));var h=d.data("precompiled");h||(h=d.text()||"",h=jQuery.template(o,"{{ko_with $item.koBindingContext}}"+h+"{{/ko_with}}"),d.data("precompiled",h)); -d=[e.$data];e=jQuery.extend({koBindingContext:e},f.templateOptions);e=jQuery.tmpl(h,d,e);e.appendTo(document.createElement("div"));jQuery.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){document.write(" + diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj index c9f2d0c..6ad37fb 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj @@ -189,19 +189,10 @@ - - - - jquery-1.6.2.js - - - - jquery-ui-1.8.11.js - @@ -212,11 +203,8 @@ - - - From e85a283477c96000a84018a3c3a70acd783c325f Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Thu, 12 Dec 2013 11:18:21 -0600 Subject: [PATCH 16/39] Push script into the scripts section of the layout. --- .../Views/Home/Index.cshtml | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Views/Home/Index.cshtml b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Views/Home/Index.cshtml index 5e9bda5..8102d75 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Views/Home/Index.cshtml +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Views/Home/Index.cshtml @@ -58,15 +58,17 @@

Request result:

- - + +@section scripts { + +} From 77c94e5eb30eec95159e99c365196f168e608198 Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Thu, 12 Dec 2013 11:39:39 -0600 Subject: [PATCH 17/39] Fix order of route registration. --- .../Global.asax.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Global.asax.cs b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Global.asax.cs index c1c4724..8e4013b 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Global.asax.cs +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Global.asax.cs @@ -16,14 +16,14 @@ public class WebApiApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); - FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); - BundleConfig.RegisterBundles(BundleTable.Bundles); - RouteConfig.RegisterRoutes(RouteTable.Routes); - GlobalConfiguration.Configure(config => { config.MapHttpAttributeRoutes(); FormatterConfig.RegisterFormatters(config.Formatters); }); + + FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); + BundleConfig.RegisterBundles(BundleTable.Bundles); + RouteConfig.RegisterRoutes(RouteTable.Routes); } } } From 40a641051020d06ded0fafe03a39880728e8ace7 Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Thu, 12 Dec 2013 11:46:28 -0600 Subject: [PATCH 18/39] Re-apply path extension to enable use of /jsonp in the path and not break backwards compatibility. --- .../default.htm | 13 ++++++++++++- .../Controllers/ValueController.cs | 2 +- .../Controllers/ValuesController.cs | 2 +- .../JsonpMediaTypeFormatter.cs | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/default.htm b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/default.htm index d1f3011..ce7b9b2 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/default.htm +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/default.htm @@ -20,7 +20,8 @@

Request result:

diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/App_Start/FormatterConfig.cs b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/App_Start/FormatterConfig.cs index 9cd92de..a15714d 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/App_Start/FormatterConfig.cs +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/App_Start/FormatterConfig.cs @@ -12,8 +12,8 @@ public static void RegisterFormatters(MediaTypeFormatterCollection formatters) var jsonFormatter = formatters.JsonFormatter; jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - var jsonpFormatter = new JsonpMediaTypeFormatter(formatters.JsonFormatter); - formatters.Insert(0, jsonpFormatter); + var jsonpFormatter = new JsonpMediaTypeFormatter(jsonFormatter); + formatters.Add(jsonpFormatter); } } } diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValueController.cs b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValueController.cs index 073b440..80962c8 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValueController.cs +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValueController.cs @@ -6,7 +6,7 @@ using System.Web.Http; namespace WebContribContrib.Formatting.Jsonp.SampleWebHost.Controllers { - [Route("api/value/{id:int}/{format?}")] + [Route("api/value/{id:int}")] public class ValueController : ApiController { // GET api/values/5 diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValuesController.cs b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValuesController.cs index 22fa2dc..7b4405f 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValuesController.cs +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Controllers/ValuesController.cs @@ -2,7 +2,7 @@ using System.Web.Http; namespace WebContribContrib.Formatting.Jsonp.SampleWebHost.Controllers{ - [Route("api/values/{format?}")] + [Route("api/values")] public class ValuesController : ApiController { // GET api/values public IEnumerable Get() { diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj index 6ad37fb..29a826d 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj @@ -8,7 +8,7 @@ 2.0 {2BB842CA-1B0D-4405-80D0-CF87702F6310} - {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties WebContribContrib.Formatting.Jsonp.SampleWebHost diff --git a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs index 9507e0c..a441dcd 100644 --- a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs +++ b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs @@ -15,7 +15,8 @@ namespace WebApiContrib.Formatting.Jsonp /// public class JsonpMediaTypeFormatter : MediaTypeFormatter { - private static readonly MediaTypeHeaderValue _applicationJson = new MediaTypeHeaderValue("application/json"); + private static readonly MediaTypeHeaderValue _applicationJavaScript = new MediaTypeHeaderValue("application/javascript"); + private static readonly MediaTypeHeaderValue _applicationJsonp = new MediaTypeHeaderValue("application/json-p"); private static readonly MediaTypeHeaderValue _textJavaScript = new MediaTypeHeaderValue("text/javascript"); private readonly HttpRequestMessage _request; private readonly MediaTypeFormatter _jsonMediaTypeFormatter; @@ -43,6 +44,8 @@ public JsonpMediaTypeFormatter(MediaTypeFormatter jsonMediaTypeFormatter, string _callbackQueryParameter = callbackQueryParameter; SupportedMediaTypes.Add(_textJavaScript); + SupportedMediaTypes.Add(_applicationJavaScript); + SupportedMediaTypes.Add(_applicationJsonp); foreach (var encoding in _jsonMediaTypeFormatter.SupportedEncodings) { SupportedEncodings.Add(encoding); @@ -84,6 +87,9 @@ private JsonpMediaTypeFormatter(HttpRequestMessage request, string callback, Med /// The request. /// The media type chosen for the serialization. Can be null. /// An instance that can format a response to the given . + /// The parameter may not be null. + /// The parameter may not be null. + /// The is not a valid JSON-P request. public override MediaTypeFormatter GetPerRequestFormatterInstance(Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType) { if (type == null) @@ -102,8 +108,7 @@ public override MediaTypeFormatter GetPerRequestFormatterInstance(Type type, Htt return new JsonpMediaTypeFormatter(request, callback, _jsonMediaTypeFormatter, _callbackQueryParameter); } - // Not JSONP? Let the JSON formatter handle it - return _jsonMediaTypeFormatter; + throw new InvalidOperationException(Properties.Resources.NoCallback); } /// diff --git a/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.Designer.cs b/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.Designer.cs new file mode 100644 index 0000000..38fc11c --- /dev/null +++ b/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.Designer.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34003 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApiContrib.Formatting.Jsonp.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebApiContrib.Formatting.Jsonp.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to A callback parameter was not provided in the request URI.. + /// + internal static string NoCallback { + get { + return ResourceManager.GetString("NoCallback", resourceCulture); + } + } + } +} diff --git a/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.resx b/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.resx new file mode 100644 index 0000000..2da9294 --- /dev/null +++ b/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + A callback parameter was not provided in the request URI. + + \ No newline at end of file diff --git a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj index d524160..112e000 100644 --- a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj +++ b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj @@ -56,10 +56,21 @@ + + True + True + Resources.resx + + + + ResXFileCodeGenerator + Resources.Designer.cs + + - false - - - false - - - true - - - false - - - - - - - - - - - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - - - - - $(SolutionDir).nuget - packages.config - - - - - $(NuGetToolsPath)\NuGet.exe - @(PackageSource) - - "$(NuGetExePath)" - mono --runtime=v4.0.30319 $(NuGetExePath) - - $(TargetDir.Trim('\\')) - - -RequireConsent - -NonInteractive - - - $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " - $(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.paket/paket.bootstrapper.exe b/.paket/paket.bootstrapper.exe new file mode 100644 index 0000000000000000000000000000000000000000..e2adf7bb359d96cb3cae721a18ff1fadeb919ef0 GIT binary patch literal 13360 zcmeHt30M?I({Ru1!Lq=@vRod>fTD=7%nE2Epj?6&E;&4jvg{79y6mj8!=+IH4MwBJ zsCdOF9`V+A$7sBA8Ix#yH8C2E@ityDUaz>sCnP~&;R_-`+eW@4NP@cb#--h zb$4}j&t?psjzkC{F}%;8BeWe-{KO0JUxOMbRs`%&pe@b^1Gf|D2Ltm;4HnAGu_c_g zjM8aMCYGm)7>X-5Q3ey0oRv$Jv3f@B<|gl86P?`~p>#ro9*|_dy|pulBwPp=guH+v zw^FA?LQ26K4=)B3B&1bu$O-!66xF~B^e+k#^eg^tggk`*=G2A)8-Aid?f{&LM~If< zjP0QS$L$v)etQ(0WXhD0Zu0V(o zaO7wa%=T{|6-}bofeY#@LtqHya?%1i$z7yQtQ(}RGN%v_FApQVLS+_r$hkR(z!1q< zB>-n%))Ob8s0}SfL!b}vuM7bj$ypc-d5AXvxs(Ix<`A%g+=T;*+11yLoM!OtswREr zbH2C?fILj$>dZvS4>PR|^<72LKxYs8Z_7QbMY9 z3IX+{Y@iKegCL`l`KX+`^ij&VT~I^m%)&6p16&5GoPqRHGf5>^%9PGZxzc$M3rh&h z$(_JW1VcW|**Q#VwTFX-;cHI2Dy3mqt&YHSN-37Hogfpl2Q=q?h03y!5WrO~Trmkv zy9maCq%#nC=oz7MRl54Jp@1q~fi5WDMZj9IVM5A+mE}Bik5IWO-B>kXDg}jC-c;xu zp>p?8c{qhcV6w7{t5T_S_fdMVG_I?FyuiuA0+R=;Ji^a_zDm$nY1J1n1z-vr=BIQ6 z%*~2%3$VswLF3brDo^Y9g-d-yx`MC}nA&ocD!?@)3b*9RMq?tL3rdwhI*me6!YnWY zJR{-7>w7A^B6z`81k63O0^a%XCP24^wFP-hKL|MXVYgnOZv#9H=+9rEuLHag=x$Ki zE(cJdO&6ebf)_7E+-^HEq#I}%nwZ-+kq}m*wN6EpnpQ{Bk(wU3rUV%Q>OtA|V-Y$G zX{iMAxjbhul~^#xYt9HA2f6L@bCCx$3gdy=r{wKZ&3k zLXUzYv7Z68u}*?ba30$R_z);4lwn>>!)2HbdJB1&;iv>Ws~lA$6XbtDTLC^ozXMbf z7={WkRe*&893#MO#8RRQ`W6IA(L>?{Aw{jo6NDV~B~2i$gv2syg#07{&I2e#7f39# zmB?KrMcqXMAm3Af*+7w_0?|^C@U93;Xb|9!qOHIgBgWE7#F$iLtcH zz#~Q1g*++2`8EQ~28bWra}06nfdWxy7#WP!5FRKNEPydF%B@+3TBB?V^S+P9Lwf|8 zYs2P2Jrd1okIU-)7J}KW7F`QCfi|F4Xd%qhKmm3Zphkc_1ehSeGy(Pl7=g3^qmcoi z56tU)G6u!~OHiT_WG~3`WD2SUN+z0wmXmpq-$f1rc#s^1=Aj!T3y>7?XfbLhssb1x z8iQ6rt?_6hN)b&G;576p$`{Q-`;bvI58!CvKOnSt0Id=&LMPDgqGdq2E*b_?Ga^P$S-l&Y~2t59Bi;zX}Z!e+@bpioXYl>y8xaUP14Qk3fEt_&9oq zeiHu*trv>VBWL2i_$t7s;@c>YP)HtuZXuHA0AnQ*LPHFe@GzUP9TYGI{z#2nP!yp? zD)bh>HfR>W_Gl5nNF*ZFuybLUgxmqXf&2jGqCirQTtSw&28IK;o1gA5;l<4;jMY#9 zYe}=t5}_bAgVmQCnV!h39l`MGB9`SXJf}6A8BWbqF(}&_IiYN!IMJaPC0Hy>S&^~2 zKf_rJtSQY@%yMN~94rOQ!CZyK!khRH2<(v^|Iq)M^>FS(v6K^PE)V6YPF(?np89oIH-v!G zpxjCjMk|LgYO92trCD*CaWNYd6&Z{MzPh>e<;j9z@N$@u<&1^LBWhLJKAwL1vaI zoz-cLO(Tsp=v~F=%6YJoeVhf^n9pI}s?)MyzVoHR)HHA~VOXv@6Xq1QT9Ls7(@EIT z05w@yBZCHT2A)aB1$dlM?<#|Zw+MOLXyOsZ(i~CTDTir+O_5|YfDLf252MvHToP-v zPgl%sB{q$1bE!q0Yi4v{JHseOkFciwwZ?L$nE@r}^$43Q-@^QbA+5uZ%vPF=tX6O9 zV46wKRAm*T-0~vu3V4ME#aACku4j38rHdPon)>MWKk1Yg)$0xxOvJWm85qyv^SS-hsaBR6r zZ>3>w=w=IA?Y)n-K>&{2JlaA`7M) zvR^@^1lmYc4jdMc!XQ0JqEI?w;co=&ttN2PybUfeZ6e=vD1NOdQ@HxOF%5jfaG+byIMh>XiAjxXs2tog5 zi$dt>T@F0Bui?N|0yz`NC4!slsNo=rEs16Ez^8>4aKAW&e4DuDr6`J;R27x$B z$`mqy3YiQDm>DFr#Z`I;e9CHEaf}2&&D&BS*GyG7Q6j=$B9lQX!zpf1CV{Jgng-w? zAnD-b1?rFrPpv1T0MQE1a?hGtkO1r;!Lw!_Fp*MODuG(7GkfPXg)L#WZ6Xezt_YN; z@M*Iv~^X-#@6)xh^DFQPaG_5lOzkp{*Blfs2S zQaBSvtKl#$BWx!y$lzNdxc|ZDkUY|70K}M?tf|Rg=9O}6rG>yO_Io!7Wl>w8_`%89 z53X8ra+7l()+}DzZeEY9H7nbOP0X1=;R^bg0v$N)0-=uua5rVmsU3sW0=8&)0R%dX z*1{CL9KEQ``Xb!)f7_=3AJlEnSe&QqSj*IYx7Lz6EQ#eHG7@5LA!cV7wcd!&@^EVq zjHq}a_n!fza7RGFEh=1-pw}R6sfYEHoBbE`(pS)N{TGA)MVNYMI^-JT;l;;Y+Y_IR z&{b=(Kxq`gmmZz8=z4 zK~5hbHn2u4SQ3t9@J5CEjw2;un}XOt1^u$yAz3KV2|Q-tZnmG}R`{3k0N8^@P7d-~ zMp1Yi9Ctd5XCq(W$0La&H%_pS5iFt=tPFR)kh4dJMWFqw;t>1hjOB%ZUnL;+V<48% z!YsfeW(ND?UY9_;!~+in??9p5EE^rq2Fz`@1IF+u|KGPC26s*b^a_U(dKdv6wAkDm z++TZt;CqH(tCqYkTI@x8#ljs40kaN{1)yJ<5Fz5(^{?vTr~*GXckYSpRaIuBDy$b1 zaX}h29Yn!C$Liq-6Bm@9mlFP35M|+E6Vn=56B8Fy%~*nZ^>mZR!r@W4)Sy6s$r2Y- z&Y5B?a3C$yTEfc=I*zrl#e6s%Ut+YDGIfO}2ydN+VmS8NH*KLc5JgcG5ys(=|w_2W?y6pbN*+Y8ws| z&U!p&^x2%D0?tAujOA}ijkHUp;Axg)J4~~tbf$taQbr8pg0z-2Qw2MM;ex1gLxK)2 z8^DakTBC)rbxIHt@d|D1sza<0eT&*Lej=okQ#U)Zcd_oXEyHFBOp7NrKS0(9Tjx7lnvyEkSg;RNh5O zh>5!HBq46>NypN@4itCVSwx^l@e;BI(SZ*2#9m)LLQ!tiiF?K)2mYv8vS;M*i)c%=qZI??Dx5lN7wN9yEhj|ZJS-ploD;*lj2op#f1OH2!oO%py{G<>zIFV-YC^&ccUVZ`99>5QIhvA?AW*P<@A; zadp#I=5L&Fv~h)G?V{XZnMdlpgL6-pUfhyhwe(}+`$0(qFI1SuuHAobVL;Y~)bMXy zm!@^9DW9@a`aa`6{e!zZ{!#l)!SL%|SAw1QwD-B&kP;ssxO4pMr}Y7&zH#%Iw&X!8 zr-9=Z?dnbz-d=X)!{lDH?I!IcCS}F&+XGX^u5NT9Vcrr;Ywyyv zw}iRi-(KuT`_y>-azoF1E%1t6^Xt4-yM}~hyc>JqIPDJx_g9F0#9r#~4f5o^Mww#L*ubP2sV56h$@(4oQneIdf+i{wxZ)Fq5>MZ7#@*F1y ztTC7v1p4N&?tx2rd05P?+o~1e+m^Oou#Rv#8a1u*%;%={HW6 zQ#M|_6!PAo(8&*1=VVM7Qn@2z@W7Khhl{_@Y4_o|knW0|mlf~te{k|v?c8ezyKh#k zVU8AEkNK$LnrdbA%mZpUaeeRa-^Y#JcJ180>qot2)D=(6KJ_$v&f3j=D=gA4>ySfnXo(Y)Zal429gY{YRuo;uH{I=FxZX%o1m`8Kztf7bcb53ik}Pdz`MAt{}$eZgdOPlx55 zoo-*=a+PPk2|g3>ER}0kQ==$W&8jt?vcCldI{VOQMu{_wFb`s;Bis4vo{4T8j5YP zF9lx!O5r969AsO%wN)pTjnNuqrlqA}?f#wfSk!NJ!5eR>(^6&8yly=s=Syzr8{Lp{htqTvG-hcRPne&3j`xk1?w-KFsa__4*f>y2DvEpn4 zqg&hMT+LH$Mal19E{lD}|6WnmF6|?)>QnskMcX_luXh{tWN=OJ+`WAkoczwc@^byX zP5X~!?wpt{&8)ch$&`?B!_NJ3m7a7Vx&Dv*`wi7MUEle3-1A|JJ zPZYP3u9y935q;-6_UF3UZMz@3{6~m>%~n=AxKZ49o7?F81*1p!eLi@<)p^trMzB;V z?GBc-E_Vqnf_3iTF2o0ZnSZKpTII*INL;Mmf9UoD-!XI!=5H^4gHBtVxGetvbt=_? zBcocnAVNxq;Wh%q!E}2%urZ*~zrKxwbI}RYP;E9w=(K_xDYd%|a3cluU^>K(gBxjU zt7s`N0&eU~!fo|om!#EAoMe5FjkD>>vRd7;CD@i?uwIlnlGe}>QZZzaqt_w{AHi!` zY&&vu^`z|F7nY#lwHBOhvo2~x>+Vj25{uXE9Z#l2T*G7=`GWIa2%Ff=^-cHYLj>gg9Z zdd#1{`4hGGmL+?;c*XmbS5fQzJNYlZ=dLYCy%WUmzW?jEPyG58x%;VCxjz1NV|wOK znWn~$;ra5aF)PpO#AJN-4?R~;ocHM3`#<)nG)&li%sWcQ%jIA8{D;nWTTp{;|J4K2 z>Iz>AQqLJt6X>!eafNu-g->6!>S z943=kzRM+{l3f%Sd?04ctT42v}w8@uKRocrpfJbsAlVtufmrf zJy-gH?o?;@;Mp9z?OEKx)Jb8zxh)5i-y6F6+Ux)L`dsz?wVN-+&ij5Uop`qX(@{PH zOMV-}Fh%oMe)MPhgM*`Qck>R@ZQ0!}`HWj(-g}D|U#zLRQ#0$V$H)BF0dFpyr82Yg z`bcgWPW)vcAZ;1IUu}rTxH-lH78@IPAR-h-A%2i$Redghp2y$2r~hK zXtBo&u1oOt!}`DT)4i-AUW>N>cAFZ~=P^o|zE3h((na)8xk;-Ww~UDR@{fWCcMi+KTJkA=+Juj`ZyCID?%_36ibURgFsEqM zkYi65MD=(&aIU)Fb@H5|VwdUosP7i3(9l5{t$xb)-rE1hrN>v~i)SRS zIM{K-xDWp+J;kKo{<({B>C}-E4pV)7+$R6r*Sxmp@QAf1`&t%#EPw0Hfx8W(-amG= z|7_+F)$5n7^k-!~SKSzz`d!brc5CXyCh+#dNrIqjr~K!#_&}fEmxB1S% zRfEq!t(qOLNaN~IEQW)6Gqa0E0sf>J_omx7R}^dD{Pkw2-fybM*b5QCKkAm>DeMvQ ztkYx1sRHL*aUFr2PET}OcSrKH=lxl#gtuf3DLn|tJI|(!Ob_bz zEX}PZA^dAL>);=UcX#q`D7<#zhtB6MlP+)HFGaiYBe(t7v+AaJnMGmi2s{=s<%&FIB?BM^W4X2 z=SN+unNT#;xMSD_I`79zbV{jVh1mbW_FdeR$NLWSExPGE@n)awvH5cOXCFwu4!x_a zykqRS-u<^r8?(~bu9i);{iYeoq;8w$@2}_|_xz4!VEcRb>h9AyOMaYvlq_|Ry0Yi8 z?=PQFm%jg_^SmwFTg4Hjp#`_8F+=Vwt|ODdJI6O$PpYXSH9!g{;mcI*>i??uDzCT@ za+q3g!nKI~&dOP&acM%F2$)ArB@&Iha2*3jtFD@^8ait5OYWV-lKNsE9Oz&_$|dl-kBV?bo9CK(C)w9bt*Iy>P?;AbM5OoM?HFzL7YRYB9XlM(az6BVDmi4{qCNRzPdLx) z?Bw>|PcxK;jo>gy}mW3_3X%=r#5_fN8RmQ g$RJg+Y5Rl;R|myzX+3h>;wi^t?{_$Q`6Gn>4|uk$-~a#s literal 0 HcmV?d00001 diff --git a/.paket/paket.targets b/.paket/paket.targets new file mode 100644 index 0000000..22c9f0a --- /dev/null +++ b/.paket/paket.targets @@ -0,0 +1,38 @@ + + + + + true + + true + $(MSBuildThisFileDirectory) + $(MSBuildThisFileDirectory)..\ + + + + $(PaketToolsPath)paket.exe + $(PaketToolsPath)paket.bootstrapper.exe + "$(PaketExePath)" + mono --runtime=v4.0.30319 $(PaketExePath) + "$(PaketBootStrapperExePath)" + mono --runtime=v4.0.30319 $(PaketBootStrapperExePath) + + $(MSBuildProjectDirectory)\paket.references + $(MSBuildProjectFullPath).paket.references + $(PaketCommand) restore --references-files "$(PaketReferences)" + $(PaketBootStrapperCommand) + + RestorePackages; $(BuildDependsOn); + + + + + + + + + + + + + diff --git a/WebApiContrib.Formatting.Jsonp.sln b/WebApiContrib.Formatting.Jsonp.sln index 8e44d5f..e49f43a 100644 --- a/WebApiContrib.Formatting.Jsonp.sln +++ b/WebApiContrib.Formatting.Jsonp.sln @@ -1,15 +1,9 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiContrib.Formatting.Jsonp", "src\WebApiContrib.Formatting.Jsonp\WebApiContrib.Formatting.Jsonp.csproj", "{CD617362-8723-4592-A3B3-D2FBEF645CD2}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{B0465E1E-C558-4A08-BD29-512DD3699FEF}" - ProjectSection(SolutionItems) = preProject - .nuget\NuGet.Config = .nuget\NuGet.Config - .nuget\NuGet.targets = .nuget\NuGet.targets - .nuget\packages.config = .nuget\packages.config - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebContribContrib.Formatting.Jsonp.SampleWebHost", "samples\WebApiContrib.Formatting.Jsonp.SampleWebHost\WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj", "{2BB842CA-1B0D-4405-80D0-CF87702F6310}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiContrib.Formatting.Jsonp.SampleJQueryClient", "samples\WebApiContrib.Formatting.Jsonp.SampleJQueryClient\WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj", "{05EA8FD1-BBA8-49FD-AF7F-2B991A80B53E}" @@ -18,6 +12,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiContrib.Formatting.Js EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{BDE1485B-1DF1-464C-AFE4-B8547E6E83F9}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{BC242EA9-8B64-40B8-8536-CA5896423A19}" + ProjectSection(SolutionItems) = preProject + paket.dependencies = paket.dependencies + paket.lock = paket.lock + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,7 +45,7 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {05EA8FD1-BBA8-49FD-AF7F-2B991A80B53E} = {BDE1485B-1DF1-464C-AFE4-B8547E6E83F9} {2BB842CA-1B0D-4405-80D0-CF87702F6310} = {BDE1485B-1DF1-464C-AFE4-B8547E6E83F9} + {05EA8FD1-BBA8-49FD-AF7F-2B991A80B53E} = {BDE1485B-1DF1-464C-AFE4-B8547E6E83F9} EndGlobalSection EndGlobal diff --git a/paket.dependencies b/paket.dependencies new file mode 100644 index 0000000..a423082 --- /dev/null +++ b/paket.dependencies @@ -0,0 +1,24 @@ +source https://nuget.org/api/v2 + +nuget Antlr 3.4.1.9004 +nuget Microsoft.AspNet.Mvc 5.0.0 +nuget Microsoft.AspNet.Razor 3.0.0 +nuget Microsoft.AspNet.Web.Optimization 1.1.2 +nuget Microsoft.AspNet.WebApi.Client 5.0.0 +nuget Microsoft.AspNet.WebApi.Core 5.0.0 +nuget Microsoft.AspNet.WebApi.WebHost 5.0.0 +nuget Microsoft.AspNet.WebPages 3.0.0 +nuget Microsoft.Web.Infrastructure 1.0.0.0 +nuget Microsoft.Web.Optimization 1.0.0-beta2 +nuget Microsoft.jQuery.Unobtrusive.Ajax 2.0.20710.0 +nuget Microsoft.jQuery.Unobtrusive.Validation 2.0.20710.0 +nuget Modernizr 2.5.3 +nuget NUnit 2.6.3 +nuget NUnit.Runners 2.6.2 +nuget Newtonsoft.Json 5.0.8 +nuget Nuget.CommandLine 2.8.3 +nuget WebGrease 1.5.2 +nuget jQuery 1.8.0 +nuget jQuery.UI.Combined 1.8.22 +nuget jQuery.Validation 1.9.0.1 +nuget knockoutjs 2.1.0 \ No newline at end of file diff --git a/paket.lock b/paket.lock new file mode 100644 index 0000000..d145102 --- /dev/null +++ b/paket.lock @@ -0,0 +1,48 @@ +NUGET + remote: https://nuget.org/api/v2 + specs: + Antlr (3.4.1.9004) + jQuery (1.8.0) + jQuery.UI.Combined (1.8.22) + jQuery (>= 1.4.4) + jQuery.Validation (1.9.0.1) + jQuery (>= 1.3.2) + knockoutjs (2.1.0) + Microsoft.AspNet.Mvc (5.0.0) + Microsoft.AspNet.Razor (>= 3.0.0) + Microsoft.AspNet.WebPages (>= 3.0.0) + Microsoft.AspNet.Razor (3.0.0) + Microsoft.AspNet.Web.Optimization (1.1.2) + Microsoft.Web.Infrastructure (>= 1.0.0) + WebGrease (>= 1.5.2) + Microsoft.AspNet.WebApi.Client (5.0.0) + Microsoft.Net.Http (>= 2.2.13) - framework: portable-wp80+win+net45 + Newtonsoft.Json (>= 4.5.11) - framework: portable-wp80+win+net45, >= net45 + Microsoft.AspNet.WebApi.Core (5.0.0) + Microsoft.AspNet.WebApi.Client (>= 5.0.0) + Microsoft.AspNet.WebApi.WebHost (5.0.0) + Microsoft.AspNet.WebApi.Core (>= 5.0.0) + Microsoft.AspNet.WebPages (3.0.0) + Microsoft.AspNet.Razor (>= 3.0.0) + Microsoft.Web.Infrastructure (>= 1.0.0.0) + Microsoft.Bcl (1.1.10) + Microsoft.Bcl.Build (>= 1.0.14) + Microsoft.Bcl.Build (1.0.21) + Microsoft.jQuery.Unobtrusive.Ajax (2.0.20710.0) + jQuery (>= 1.4.4 < 2.0) + Microsoft.jQuery.Unobtrusive.Validation (2.0.20710.0) + jQuery.Validation (>= 1.8 < 2.0) + Microsoft.Net.Http (2.2.29) - framework: portable-wp80+win+net45 + Microsoft.Bcl (>= 1.1.10) + Microsoft.Bcl.Build (>= 1.0.14) + Microsoft.Web.Infrastructure (1.0.0.0) + Microsoft.Web.Optimization (1.0.0-beta2) + Microsoft.AspNet.Web.Optimization (>= 1.0.0-beta2) + Modernizr (2.5.3) + Newtonsoft.Json (5.0.8) + NuGet.CommandLine (2.8.3) + NUnit (2.6.3) + NUnit.Runners (2.6.2) + WebGrease (1.5.2) + Antlr (>= 3.4.1.9004) + Newtonsoft.Json (>= 5.0.4) diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/Web.config b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/Web.config index 5acfd25..0afd3b1 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/Web.config +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/Web.config @@ -41,8 +41,8 @@ - + - + \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj index 9a513df..113cf1e 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj @@ -21,7 +21,6 @@ ..\..\ - true @@ -45,10 +44,6 @@ - - False - ..\..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll - @@ -117,7 +112,7 @@ - + jquery-1.7.2.js @@ -125,9 +120,15 @@ jquery-1.7.2.js - - - + + True + + + True + + + True + @@ -137,7 +138,6 @@ Web.config - 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) @@ -166,11 +166,76 @@ - + + + + + + ..\..\packages\Newtonsoft.Json\lib\netcore45\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net35\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net20\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net40\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\portable-net45+wp80+win8\Newtonsoft.Json.dll + True + True + + + + \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/packages.config b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/packages.config deleted file mode 100644 index 7c524d3..0000000 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/paket.references b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/paket.references new file mode 100644 index 0000000..dd2bc8a --- /dev/null +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/paket.references @@ -0,0 +1,2 @@ +jQuery +Newtonsoft.Json \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.accordion.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.accordion.css index b1bfc9d..728bbba 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.accordion.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.accordion.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Accordion 1.8.22 * - * jQuery UI Accordion 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Accordion#theming */ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.all.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.all.css index 08753f3..e7de284 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.all.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.all.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI CSS Framework 1.8.22 * - * jQuery UI CSS Framework 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Theming */ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.autocomplete.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.autocomplete.css index 8a79195..906298a 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.autocomplete.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.autocomplete.css @@ -1,14 +1,10 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Autocomplete 1.8.22 * - * jQuery UI Autocomplete 1.8.11 + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * http://docs.jquery.com/UI/Autocomplete#theming */ .ui-autocomplete { position: absolute; cursor: default; } @@ -17,16 +13,11 @@ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ /* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. - * - * jQuery UI Menu 1.8.11 + * jQuery UI Menu 1.8.22 * * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Menu#theming */ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.base.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.base.css index f52ee39..5774d58 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.base.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.base.css @@ -1,11 +1,21 @@ +/*! + * jQuery UI CSS Framework 1.8.22 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming + */ @import url("jquery.ui.core.css"); -@import url("jquery.ui.resizable.css"); -@import url("jquery.ui.selectable.css"); + @import url("jquery.ui.accordion.css"); @import url("jquery.ui.autocomplete.css"); @import url("jquery.ui.button.css"); +@import url("jquery.ui.datepicker.css"); @import url("jquery.ui.dialog.css"); +@import url("jquery.ui.progressbar.css"); +@import url("jquery.ui.resizable.css"); +@import url("jquery.ui.selectable.css"); @import url("jquery.ui.slider.css"); @import url("jquery.ui.tabs.css"); -@import url("jquery.ui.datepicker.css"); -@import url("jquery.ui.progressbar.css"); \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.button.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.button.css index a776dc5..f39395a 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.button.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.button.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Button 1.8.22 * - * jQuery UI Button 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Button#theming */ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.core.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.core.css index bb11434..b2e955c 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.core.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.core.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI CSS Framework 1.8.22 * - * jQuery UI CSS Framework 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API */ @@ -18,12 +13,9 @@ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:after { clear: both; } +.ui-helper-clearfix { zoom: 1; } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.datepicker.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.datepicker.css index 0ad185e..09ceb32 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.datepicker.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.datepicker.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Datepicker 1.8.22 * - * jQuery UI Datepicker 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker#theming */ @@ -44,7 +39,7 @@ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } @@ -61,8 +56,6 @@ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ .ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ position: absolute; /*must have*/ z-index: -1; /*must have*/ filter: mask(); /*must have*/ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.dialog.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.dialog.css index 9e3dbb1..2335622 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.dialog.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.dialog.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Dialog 1.8.22 * - * jQuery UI Dialog 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog#theming */ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.progressbar.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.progressbar.css index 4dbf007..4a1a6e6 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.progressbar.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.progressbar.css @@ -1,16 +1,11 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Progressbar 1.8.22 * - * jQuery UI Progressbar 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar#theming */ -.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar { height:2em; text-align: left; overflow: hidden; } .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.resizable.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.resizable.css index 44577af..626c176 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.resizable.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.resizable.css @@ -1,19 +1,14 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Resizable 1.8.22 * - * jQuery UI Resizable 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)] + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Resizable#theming */ .ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; } .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.selectable.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.selectable.css index 37574e4..bd5ce96 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.selectable.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.selectable.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Selectable 1.8.22 * - * jQuery UI Selectable 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Selectable#theming */ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.slider.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.slider.css index a669a13..4bd34eb 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.slider.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.slider.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Slider 1.8.22 * - * jQuery UI Slider 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Slider#theming */ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.tabs.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.tabs.css index 5501945..d8d3fb2 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.tabs.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.tabs.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI Tabs 1.8.22 * - * jQuery UI Tabs 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Tabs#theming */ diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.theme.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.theme.css index 0c1b612..04c6e39 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.theme.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/themes/base/jquery.ui.theme.css @@ -1,14 +1,9 @@ -/* - * Note: While Microsoft is not the author of this file, Microsoft is - * offering you a license subject to the terms of the Microsoft Software - * License Terms for Microsoft ASP.NET Model View Controller 4 Developer Preview. - * Microsoft reserves all other rights. The notices below are provided - * for informational purposes only and are not the license terms under - * which Microsoft distributed this file. +/*! + * jQuery UI CSS Framework 1.8.22 * - * jQuery UI CSS Framework 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) +* Licensed under MIT license. + * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API * @@ -242,16 +237,11 @@ ----------------------------------*/ /* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; } -.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } -.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } -.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } -.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } -.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } -.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; border-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } /* Overlays */ .ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } -.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file +.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate-vsdoc.js b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate-vsdoc.js index 16fd703..22a5460 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate-vsdoc.js +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate-vsdoc.js @@ -8,36 +8,12 @@ */ /* -* Note: While Microsoft is not the author of this script file, Microsoft -* grants you the right to use this file for the sole purpose of either: -* (i) interacting through your browser with the Microsoft website, subject -* to the website's terms of use; or (ii) using the files as included with a -* Microsoft product subject to the Microsoft Software License Terms for that -* Microsoft product. Microsoft reserves all other rights to the files not -* expressly granted by Microsoft, whether by implication, estoppel or -* otherwise. The notices and licenses below are for informational purposes -* only. -* -* Provided for Informational Purposes Only -* MIT License -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. +* Note: While Microsoft is not the author of this file, Microsoft is +* offering you a license subject to the terms of the Microsoft Software +* License Terms for Microsoft ASP.NET Model View Controller 3. +* Microsoft reserves all other rights. The notices below are provided +* for informational purposes only and are not the license terms under +* which Microsoft distributed this file. * * jQuery validation plugin 1.8.0 * @@ -59,10 +35,9 @@ $.extend($.fn, { /// elements. Each one can be disabled, see the onxxx options (onsubmit, onfocusout, /// onkeyup, onclick). focusInvalid focuses elements when submitting a invalid form. /// - /// + /// /// A set of key/value pairs that configure the validate. All options are optional. /// - /// // if nothing is selected, return nothing; can't chain anyway if (!this.length) { @@ -162,7 +137,6 @@ $.extend($.fn, { /// /// A space-seperated list of attribute names to remove. /// - /// var result = {}, $element = this; @@ -183,7 +157,6 @@ $.extend($.fn, { /// /// A list of rules to add or remove. /// - /// var element = this[0]; @@ -340,7 +313,6 @@ $.extend($.validator, { /// /// Options to set as default. /// - /// $.extend( $.validator.defaults, settings ); }, @@ -467,7 +439,6 @@ $.extend($.validator, { /// /// One or more key/value pairs of input names and messages. /// - /// if(errors) { // add items to error list and map @@ -496,7 +467,6 @@ $.extend($.validator, { /// Resets input fields to their original value (requires form plugin), removes classes /// indicating invalid elements and hides error messages. /// - /// if ( $.fn.resetForm ) $( this.currentForm ).resetForm(); @@ -896,7 +866,6 @@ $.extend($.validator, { /// /// The compound rules /// - /// className.constructor == String ? this.classRuleSettings[className] = rules : @@ -1046,7 +1015,6 @@ $.extend($.validator, { /// jQuery.validator.format(value). When undefined, an already existing message is used /// (handy for localization), otherwise the field-specific messages have to be defined. /// - /// $.validator.methods[name] = method; $.validator.messages[name] = message != undefined ? message : $.validator.messages[name]; diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate.js b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate.js index 37a6642..c71dbb2 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate.js +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate.js @@ -1,42 +1,12 @@ /** - * Note: While Microsoft is not the author of this script file, Microsoft - * grants you the right to use this file for the sole purpose of either: - * (i) interacting through your browser with the Microsoft website, subject - * to the website's terms of use; or (ii) using the files as included with a - * Microsoft product subject to the Microsoft Software License Terms for that - * Microsoft product. Microsoft reserves all other rights to the files not - * expressly granted by Microsoft, whether by implication, estoppel or - * otherwise. The notices and licenses below are for informational purposes - * only. - * - * Provided for Informational Purposes Only - * MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * jQuery Validation Plugin 1.8.1 + * jQuery Validation Plugin 1.9.0 * * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ * http://docs.jquery.com/Plugins/Validation * * Copyright (c) 2006 - 2011 Jörn Zaefferer * + * Licensed under MIT: http://www.opensource.org/licenses/mit-license.php */ (function($) { @@ -57,19 +27,24 @@ $.extend($.fn, { return validator; } + // Add novalidate tag if HTML5. + this.attr('novalidate', 'novalidate'); + validator = new $.validator( options, this[0] ); $.data(this[0], 'validator', validator); if ( validator.settings.onsubmit ) { + var inputsAndButtons = this.find("input, button"); + // allow suppresing validation by adding a cancel class to the submit button - this.find("input, button").filter(".cancel").click(function() { + inputsAndButtons.filter(".cancel").click(function () { validator.cancelSubmit = true; }); // when a submitHandler is used, capture the submitting button if (validator.settings.submitHandler) { - this.find("input, button").filter(":submit").click(function() { + inputsAndButtons.filter(":submit").click(function () { validator.submitButton = this; }); } @@ -237,9 +212,9 @@ $.extend($.validator, { errorContainer: $( [] ), errorLabelContainer: $( [] ), onsubmit: true, - ignore: [], + ignore: ":hidden", ignoreTitle: false, - onfocusin: function(element) { + onfocusin: function(element, event) { this.lastActive = element; // hide error label and remove error class on focus if enabled @@ -248,17 +223,17 @@ $.extend($.validator, { this.addWrapper(this.errorsFor(element)).hide(); } }, - onfocusout: function(element) { + onfocusout: function(element, event) { if ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) { this.element(element); } }, - onkeyup: function(element) { + onkeyup: function(element, event) { if ( element.name in this.submitted || element == this.lastElement ) { this.element(element); } }, - onclick: function(element) { + onclick: function(element, event) { // click on selects, radiobuttons and checkboxes if ( element.name in this.submitted ) this.element(element); @@ -336,11 +311,16 @@ $.extend($.validator, { function delegate(event) { var validator = $.data(this[0].form, "validator"), eventType = "on" + event.type.replace(/^validate/, ""); - validator.settings[eventType] && validator.settings[eventType].call(validator, this[0] ); + validator.settings[eventType] && validator.settings[eventType].call(validator, this[0], event); } $(this.currentForm) - .validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", delegate) - .validateDelegate(":radio, :checkbox, select, option", "click", delegate); + .validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, " + + "[type='number'], [type='search'] ,[type='tel'], [type='url'], " + + "[type='email'], [type='datetime'], [type='date'], [type='month'], " + + "[type='week'], [type='time'], [type='datetime-local'], " + + "[type='range'], [type='color'] ", + "focusin focusout keyup", delegate) + .validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", delegate); if (this.settings.invalidHandler) $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler); @@ -367,7 +347,7 @@ $.extend($.validator, { // http://docs.jquery.com/Plugins/Validation/Validator/element element: function( element ) { - element = this.clean( element ); + element = this.validationTargetFor( this.clean( element ) ); this.lastElement = element; this.prepareElement( element ); this.currentElements = $(element); @@ -412,6 +392,7 @@ $.extend($.validator, { if ( $.fn.resetForm ) $( this.currentForm ).resetForm(); this.submitted = {}; + this.lastElement = null; this.prepareForm(); this.hideErrors(); this.elements().removeClass( this.settings.errorClass ); @@ -510,12 +491,7 @@ $.extend($.validator, { }, check: function( element ) { - element = this.clean( element ); - - // if radio/checkbox, validate first element in group instead - if (this.checkable(element)) { - element = this.findByName( element.name ).not(this.settings.ignore)[0]; - } + element = this.validationTargetFor( this.clean( element ) ); var rules = $(element).rules(); var dependencyMismatch = false; @@ -656,7 +632,7 @@ $.extend($.validator, { var label = this.errorsFor( element ); if ( label.length ) { // refresh error/success class - label.removeClass().addClass( this.settings.errorClass ); + label.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); // check if we have a generated label, replace the message then label.attr("generated") && label.html(message); @@ -696,6 +672,14 @@ $.extend($.validator, { return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); }, + validationTargetFor: function(element) { + // if radio/checkbox, validate first element in group instead + if (this.checkable(element)) { + element = this.findByName( element.name ).not(this.settings.ignore)[0]; + } + return element; + }, + checkable: function( element ) { return /radio|checkbox/i.test(element.type); }, @@ -808,9 +792,17 @@ $.extend($.validator, { var $element = $(element); for (var method in $.validator.methods) { - var value = $element.attr(method); + var value; + // If .prop exists (jQuery >= 1.6), use it to get true/false for required + if (method === 'required' && typeof $.fn.prop === 'function') { + value = $element.prop(method); + } else { + value = $element.attr(method); + } if (value) { rules[method] = value; + } else if ($element[0].getAttribute("type") === method) { + rules[method] = true; } } @@ -1033,7 +1025,7 @@ $.extend($.validator, { // http://docs.jquery.com/Plugins/Validation/Methods/email email: function(value, element) { // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/ - return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value); + return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/url @@ -1067,8 +1059,8 @@ $.extend($.validator, { creditcard: function(value, element) { if ( this.optional(element) ) return "dependency-mismatch"; - // accept only digits and dashes - if (/[^0-9-]+/.test(value)) + // accept only spaces, digits and dashes + if (/[^0-9 -]+/.test(value)) return false; var nCheck = 0, nDigit = 0, diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate.min.js b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate.min.js index 8ebfe65..ebf8367 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate.min.js +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Scripts/jquery.validate.min.js @@ -1,78 +1,48 @@ /** -* Note: While Microsoft is not the author of this script file, Microsoft -* grants you the right to use this file for the sole purpose of either: -* (i) interacting through your browser with the Microsoft website, subject -* to the website's terms of use; or (ii) using the files as included with a -* Microsoft product subject to the Microsoft Software License Terms for that -* Microsoft product. Microsoft reserves all other rights to the files not -* expressly granted by Microsoft, whether by implication, estoppel or -* otherwise. The notices and licenses below are for informational purposes -* only. -* -* Provided for Informational Purposes Only -* MIT License -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -* -* jQuery Validation Plugin 1.8.1 -* -* http://bassistance.de/jquery-plugins/jquery-plugin-validation/ -* http://docs.jquery.com/Plugins/Validation -* -* Copyright (c) 2006 - 2011 Jörn Zaefferer -* -*/ -(function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("").attr("name", + * jQuery Validation Plugin 1.9.0 + * + * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ + * http://docs.jquery.com/Plugins/Validation + * + * Copyright (c) 2006 - 2011 Jörn Zaefferer + * + * Licensed under MIT: http://www.opensource.org/licenses/mit-license.php + */ +(function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;this.attr("novalidate","novalidate");b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){a=this.find("input, button");a.filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&a.filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("").attr("name", b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&f.remove();return false}return true}b.settings.debug&&d.preventDefault();if(b.cancelSubmit){b.cancelSubmit=false;return e()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return e()}else{b.focusInvalid();return false}})}return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form(); else{var a=true,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(e,f){b[f]=d.attr(f);d.removeAttr(f)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;if(b.messages)e.messages[d.name]=c.extend(e.messages[d.name],b.messages);break;case "remove":if(!b){delete f[d.name]; return g}var h={};c.each(b.split(/\s/),function(j,i){h[i]=g[i];delete g[i]});return h}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required){e=d.required;delete d.required;d=c.extend({required:e},d)}return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a, b){this.settings=c.extend(true,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var d=c.makeArray(arguments);d.unshift(a);return c.validator.format.apply(this,d)};if(arguments.length>2&&b.constructor!=Array)b=c.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];c.each(b,function(d,e){a=a.replace(RegExp("\\{"+d+"\\}","g"),e)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error", -validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(a)).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)}, +validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(a)).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)}, onkeyup:function(a){if(a.name in this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).addClass(b).removeClass(d):c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).removeClass(b).addClass(d):c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.validator.defaults, a)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."), -minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator");e="on"+e.type.replace(/^validate/, -"");f.settings[e]&&f.settings[e].call(f,this[0])}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d=this.settings.rules; -c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",a).validateDelegate(":radio, :checkbox, select, option","click",a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form", -[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(a){this.lastElement=a=this.clean(a);this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap, -a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(d){return!(d.name in a)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)}, -objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name== -a.name}).length==1&&a},elements:function(){var a=this,b={};return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass, -this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.clean(a);if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g= -c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&&window.console&&console.log("exception occured when checking element "+a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d= -this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+ -a.name+"")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d,element:a});this.errorMap[a.name]=d;this.submitted[a.name]=d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a]; -this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight){a=0;for(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass)}this.toHide=this.toHide.not(this.toShow); -this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);if(d.length){d.removeClass().addClass(this.settings.errorClass);d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b|| -"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow=this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})}, -idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d,e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length}, -depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this,c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest< -0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true}, -email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings,a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b= -{};a=c(a);for(var d in c.validator.methods){var e=a.attr(d);if(e)b[d]=e}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{};var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e=== -false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined?e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&& -a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages;return a},normalizeRule:function(a){if(typeof a=="string"){var b={};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))}, -methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a,b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote= -e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d,mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]= -e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)|| -a>=d[0]&&a<=d[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)}, +minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator"),g="on"+e.type.replace(/^validate/, +"");f.settings[g]&&f.settings[g].call(f,this[0],e)}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d= +this.settings.rules;c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",a).validateDelegate("[type='radio'], [type='checkbox'], select, option","click", +a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(a){this.lastElement= +a=this.validationTargetFor(this.clean(a));this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap,a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(d){return!(d.name in a)})}this.settings.showErrors? +this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()== +0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name==a.name}).length==1&&a},elements:function(){var a=this,b={};return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&& +a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)}, +prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.validationTargetFor(this.clean(a));var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g=c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&&window.console&&console.log("exception occured when checking element "+ +a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d=this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+a.name+"")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d,element:a});this.errorMap[a.name]=d;this.submitted[a.name]= +d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]); +if(this.settings.unhighlight){a=0;for(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass)}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);if(d.length){d.removeClass(this.settings.validClass).addClass(this.settings.errorClass); +d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b||"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow= +this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];return a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d, +e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this, +c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted= +false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings, +a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b={};a=c(a);for(var d in c.validator.methods){var e;if(e=d==="required"&&typeof c.fn.prop==="function"?a.prop(d):a.attr(d))b[d]=e;else if(a[0].getAttribute("type")===d)b[d]=true}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{}; +var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e===false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined? +e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&&a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages; +return a},normalizeRule:function(a){if(typeof a=="string"){var b={};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))},methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a, +b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d, +mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]=e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a, +b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)||a>=d[0]&&a<=d[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)}, url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)}, -date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>= +date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 -]+/.test(a))return false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>= 0;g--){e=a.charAt(g);e=parseInt(e,10);if(f)if((e*=2)>9)e-=9;d+=e;f=!f}return d%10==0},accept:function(a,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+d+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery); (function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery); (function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a, diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Views/Web.config b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Views/Web.config index b3ec910..f6d7a9c 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Views/Web.config +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Views/Web.config @@ -1,4 +1,4 @@ - + @@ -15,7 +15,7 @@ - + @@ -27,7 +27,7 @@ - + - + @@ -52,8 +48,8 @@ - + - + diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Web.config b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Web.config index 4c4cb7a..d6de838 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Web.config +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Web.config @@ -49,11 +49,11 @@ - + - + @@ -75,6 +75,6 @@ - + \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj index f433883..1e0345d 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj @@ -21,7 +21,6 @@ ..\..\ - true ..\..\packages\WebGrease.1.5.2\lib @@ -45,79 +44,23 @@ false - - False - ..\..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll - - - False - ..\..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll - - - False - ..\..\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll - - - False - ..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll - - - False - ..\..\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll - - - False - ..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.0.0\lib\net45\System.Web.Http.WebHost.dll - - - False - ..\..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll - - - False - ..\..\packages\Microsoft.AspNet.Web.Optimization.1.1.2\lib\net40\System.Web.Optimization.dll - - - False - ..\..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll - - - False - ..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll - - - False - ..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll - - - False - ..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll - - - True - ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - False - ..\..\packages\WebGrease.1.5.2\lib\WebGrease.dll - @@ -132,79 +75,217 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + - - - - - - - - + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + jquery.validate.js + True + + + True + + + True + + + True + + + True + + + True - - - - - Web.config @@ -244,7 +325,7 @@ - + @@ -280,11 +361,449 @@ - + + + + ..\..\packages\Antlr\lib\Antlr3.Runtime.dll + True + True + + + + + + + ..\..\packages\Microsoft.AspNet.Mvc\lib\net45\System.Web.Mvc.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.Razor\lib\net45\System.Web.Razor.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.Web.Optimization\lib\net40\System.Web.Optimization.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\portable-wp8+netcore45+net45\System.Net.Http.Formatting.dll + True + True + + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\net45\System.Net.Http.Formatting.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Core\lib\net45\System.Web.Http.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.WebHost\lib\net45\System.Web.Http.WebHost.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.WebPages\lib\net45\System.Web.Helpers.dll + True + True + + + ..\..\packages\Microsoft.AspNet.WebPages\lib\net45\System.Web.WebPages.Deployment.dll + True + True + + + ..\..\packages\Microsoft.AspNet.WebPages\lib\net45\System.Web.WebPages.Razor.dll + True + True + + + ..\..\packages\Microsoft.AspNet.WebPages\lib\net45\System.Web.WebPages.dll + True + True + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll + True + True + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.Threading.Tasks.dll + True + True + + + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.Threading.Tasks.dll + True + True + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll + True + True + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8+wpa81\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8+wpa81\System.Net.Http.Primitives.dll + True + True + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8\System.Net.Http.Primitives.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.Web.Infrastructure\lib\net40\Microsoft.Web.Infrastructure.dll + True + True + + + + + + + + + ..\..\packages\Newtonsoft.Json\lib\netcore45\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net35\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net20\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net40\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\portable-net45+wp80+win8\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\WebGrease\lib\WebGrease.dll + True + True + + \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/packages.config b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/packages.config deleted file mode 100644 index def50b4..0000000 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/packages.config +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/paket.references b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/paket.references new file mode 100644 index 0000000..873b10d --- /dev/null +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/paket.references @@ -0,0 +1,19 @@ +Antlr +jQuery +jQuery.UI.Combined +jQuery.Validation +knockoutjs +Microsoft.AspNet.Mvc +Microsoft.AspNet.Razor +Microsoft.AspNet.Web.Optimization +Microsoft.AspNet.WebApi.Client +Microsoft.AspNet.WebApi.Core +Microsoft.AspNet.WebApi.WebHost +Microsoft.AspNet.WebPages +Microsoft.jQuery.Unobtrusive.Ajax +Microsoft.jQuery.Unobtrusive.Validation +Microsoft.Web.Infrastructure +Microsoft.Web.Optimization +Modernizr +Newtonsoft.Json +WebGrease \ No newline at end of file diff --git a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj index 365d4e1..1a4d4e8 100644 --- a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj +++ b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj @@ -1,4 +1,4 @@ - + @@ -12,7 +12,6 @@ v4.5 512 ..\..\ - true @@ -65,7 +64,7 @@ - + @@ -74,7 +73,6 @@ - + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\portable-wp8+netcore45+net45\System.Net.Http.Formatting.dll + True + True + + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\net45\System.Net.Http.Formatting.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Core\lib\net45\System.Web.Http.dll + True + True + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll + True + True + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.Threading.Tasks.dll + True + True + + + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.Threading.Tasks.dll + True + True + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll + True + True + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8+wpa81\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8+wpa81\System.Net.Http.Primitives.dll + True + True + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8\System.Net.Http.Primitives.dll + True + True + + + + + + + + + ..\..\packages\Newtonsoft.Json\lib\netcore45\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net35\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net20\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net40\Newtonsoft.Json.dll + True + True + + + + + + + + ..\..\packages\Newtonsoft.Json\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\portable-net45+wp80+win8\Newtonsoft.Json.dll + True + True + + + + \ No newline at end of file diff --git a/src/WebApiContrib.Formatting.Jsonp/packages.config b/src/WebApiContrib.Formatting.Jsonp/packages.config deleted file mode 100644 index 262a324..0000000 --- a/src/WebApiContrib.Formatting.Jsonp/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/WebApiContrib.Formatting.Jsonp/paket.references b/src/WebApiContrib.Formatting.Jsonp/paket.references new file mode 100644 index 0000000..cc205ae --- /dev/null +++ b/src/WebApiContrib.Formatting.Jsonp/paket.references @@ -0,0 +1,3 @@ +Microsoft.AspNet.WebApi.Client +Microsoft.AspNet.WebApi.Core +Newtonsoft.Json \ No newline at end of file diff --git a/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj b/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj index b54b7cb..c5d1188 100644 --- a/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj +++ b/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj @@ -12,7 +12,6 @@ v4.5 512 ..\..\ - true @@ -35,24 +34,10 @@ false - - ..\..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll - - - ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll - - - False - ..\..\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll - - - False - ..\..\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll - @@ -71,10 +56,9 @@ - + - + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\portable-wp8+netcore45+net45\System.Net.Http.Formatting.dll + True + True + + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\net45\System.Net.Http.Formatting.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Core\lib\net45\System.Web.Http.dll + True + True + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll + True + True + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl5\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\sl4-windowsphone71\System.Threading.Tasks.dll + True + True + + + + + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl5+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp8+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+win8\System.Threading.Tasks.dll + True + True + + + + + + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.IO.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.Runtime.dll + True + True + + + ..\..\packages\Microsoft.Bcl\lib\portable-net40+sl4+win8+wp71+wpa81\System.Threading.Tasks.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll + True + True + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8+wpa81\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8+wpa81\System.Net.Http.Primitives.dll + True + True + + + + + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8\System.Net.Http.Extensions.dll + True + True + + + ..\..\packages\Microsoft.Net.Http\lib\portable-net45+win8\System.Net.Http.Primitives.dll + True + True + + + + + + + + + ..\..\packages\Newtonsoft.Json\lib\netcore45\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net35\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net20\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net40\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\Newtonsoft.Json\lib\portable-net45+wp80+win8\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\packages\NUnit\lib\nunit.framework.dll + True + True + + \ No newline at end of file diff --git a/test/WebApiContrib.Formatting.Jsonp.Tests/packages.config b/test/WebApiContrib.Formatting.Jsonp.Tests/packages.config deleted file mode 100644 index 2a6d210..0000000 --- a/test/WebApiContrib.Formatting.Jsonp.Tests/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/test/WebApiContrib.Formatting.Jsonp.Tests/paket.references b/test/WebApiContrib.Formatting.Jsonp.Tests/paket.references new file mode 100644 index 0000000..b74596f --- /dev/null +++ b/test/WebApiContrib.Formatting.Jsonp.Tests/paket.references @@ -0,0 +1,5 @@ +Microsoft.AspNet.WebApi.Client +Microsoft.AspNet.WebApi.Core +Newtonsoft.Json +NUnit +NUnit.Runners \ No newline at end of file From eea470a92d3e65d4865a98847149a2898e72ef7a Mon Sep 17 00:00:00 2001 From: Victor Bartel Date: Fri, 13 Mar 2015 13:15:59 +0100 Subject: [PATCH 32/39] Remove useless references from the main project --- .../WebApiContrib.Formatting.Jsonp.csproj | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj index 1a4d4e8..3a6cd3c 100644 --- a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj +++ b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj @@ -1,4 +1,4 @@ - + @@ -34,9 +34,6 @@ false - - ..\..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll - @@ -44,13 +41,10 @@ False ..\..\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll - - False ..\..\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll - From 7498eb3ca1a1410986620dd126744b02fcfc4ac6 Mon Sep 17 00:00:00 2001 From: Victor Bartel Date: Fri, 13 Mar 2015 13:53:57 +0100 Subject: [PATCH 33/39] Add fake build script and fill it with trivial tasks such as build / test / clean Add release note files as in parent contrib project Upgrade version --- RELEASE_NOTES.md | 3 + WebApiContrib.Formatting.Jsonp.sln | 5 + build.cmd | 20 ++ build.fsx | 51 +++++ paket.dependencies | 3 +- paket.lock | 1 + ...Formatting.Jsonp.SampleJQueryClient.csproj | 8 +- ...trib.Formatting.Jsonp.SampleWebHost.csproj | 211 +++++++++--------- .../Properties/AssemblyInfo.cs | 4 +- .../WebApiContrib.Formatting.Jsonp.csproj | 41 +--- 10 files changed, 202 insertions(+), 145 deletions(-) create mode 100644 RELEASE_NOTES.md create mode 100644 build.cmd create mode 100644 build.fsx diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000..3477981 --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,3 @@ +### New in 3.0.1 (Released 2015-03-13) +* Suppression of useless references to System.Web +* Internal paket/fake integration \ No newline at end of file diff --git a/WebApiContrib.Formatting.Jsonp.sln b/WebApiContrib.Formatting.Jsonp.sln index e49f43a..b1ab49a 100644 --- a/WebApiContrib.Formatting.Jsonp.sln +++ b/WebApiContrib.Formatting.Jsonp.sln @@ -18,6 +18,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{BC242E paket.lock = paket.lock EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fake", "fake", "{B70D0BEB-53C2-4B8C-A275-C3E15BF795CB}" + ProjectSection(SolutionItems) = preProject + build.fsx = build.fsx + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..b81b87b --- /dev/null +++ b/build.cmd @@ -0,0 +1,20 @@ + +@echo off +cls + +.paket\paket.bootstrapper.exe +if errorlevel 1 ( + exit /b %errorlevel% +) + +.paket\paket.exe restore +if errorlevel 1 ( + exit /b %errorlevel% +) + +IF NOT EXIST build.fsx ( + .paket\paket.exe update + packages\FAKE\tools\FAKE.exe init.fsx +) + +packages\FAKE\tools\FAKE.exe build.fsx %* \ No newline at end of file diff --git a/build.fsx b/build.fsx new file mode 100644 index 0000000..807a6cf --- /dev/null +++ b/build.fsx @@ -0,0 +1,51 @@ +#I "packages/FAKE/tools" +#r "FakeLib.dll" + +open System +open System.IO +open Fake +open Fake.AssemblyInfoFile +open Fake.ReleaseNotesHelper + +type Project = { + ReleaseNotes: ReleaseNotes + SolutionFile: String + TestAssemblies: String +} + +let project = { + ReleaseNotes = LoadReleaseNotes "RELEASE_NOTES.md" + SolutionFile = "WebApiContrib.Formatting.Jsonp.sln" + TestAssemblies = "test/**/bin/Release/*Tests*.dll" +} + +let release = LoadReleaseNotes "RELEASE_NOTES.md" + +Target "Clean" (fun _ -> + CleanDirs ["bin"; "temp"] +) + +Target "Build" (fun _ -> + !! project.SolutionFile + |> MSBuildRelease "" "Rebuild" + |> ignore +) + +Target "RunTests" (fun _ -> + !! project.TestAssemblies + |> NUnit (fun p -> + { p with + DisableShadowCopy = true + TimeOut = TimeSpan.FromMinutes 20. + OutputFile = "TestResults.xml" }) +) + +Target "All" DoNothing + +"Clean" + ==> "Build" + ==> "RunTests" + ==> "All" + + +RunTargetOrDefault "All" \ No newline at end of file diff --git a/paket.dependencies b/paket.dependencies index a423082..2e18c4e 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -21,4 +21,5 @@ nuget WebGrease 1.5.2 nuget jQuery 1.8.0 nuget jQuery.UI.Combined 1.8.22 nuget jQuery.Validation 1.9.0.1 -nuget knockoutjs 2.1.0 \ No newline at end of file +nuget knockoutjs 2.1.0 +nuget FAKE \ No newline at end of file diff --git a/paket.lock b/paket.lock index d145102..a39fc6b 100644 --- a/paket.lock +++ b/paket.lock @@ -2,6 +2,7 @@ NUGET remote: https://nuget.org/api/v2 specs: Antlr (3.4.1.9004) + FAKE (3.23.0) jQuery (1.8.0) jQuery.UI.Combined (1.8.22) jQuery (>= 1.4.4) diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj index 113cf1e..4927c61 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/WebApiContrib.Formatting.Jsonp.SampleJQueryClient.csproj @@ -116,10 +116,6 @@ jquery-1.7.2.js - - - jquery-1.7.2.js - True @@ -129,6 +125,10 @@ True + + + jquery-1.7.2.js + diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj index 1e0345d..9d48516 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/WebContribContrib.Formatting.Jsonp.SampleWebHost.csproj @@ -44,76 +44,6 @@ false - - - - - - - - - - - - - - - - - - - - - - - - - - - Global.asax - - - - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - True @@ -159,43 +89,43 @@ True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True @@ -237,55 +167,79 @@ True - - - - - True - - - True - - + True - + True - + True - + True - + True - + True - + True - - jquery.validate.js + True - + True - + True - + True - + True - + True + + + + + + + + + + + + + + + + + + + + + + + + + + + Global.asax + + + + + + + Web.config @@ -313,6 +267,51 @@ + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + diff --git a/src/WebApiContrib.Formatting.Jsonp/Properties/AssemblyInfo.cs b/src/WebApiContrib.Formatting.Jsonp/Properties/AssemblyInfo.cs index dc263eb..d6ac493 100644 --- a/src/WebApiContrib.Formatting.Jsonp/Properties/AssemblyInfo.cs +++ b/src/WebApiContrib.Formatting.Jsonp/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.0.0")] -[assembly: AssemblyFileVersion("3.0.0")] +[assembly: AssemblyVersion("3.0.1")] +[assembly: AssemblyFileVersion("3.0.1")] [assembly: InternalsVisibleTo("WebApiContrib.Formatting.Jsonp.Tests")] diff --git a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj index 3a6cd3c..a0e5e6a 100644 --- a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj +++ b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj @@ -75,37 +75,6 @@ --> - - - - - ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\portable-wp8+netcore45+net45\System.Net.Http.Formatting.dll - True - True - - - - - - - ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\net45\System.Net.Http.Formatting.dll - True - True - - - - - - - - - ..\..\packages\Microsoft.AspNet.WebApi.Core\lib\net45\System.Web.Http.dll - True - True - - - - @@ -390,7 +359,15 @@
- + + + + ..\..\packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll + True + True + + + From 4952dc04d62b03032a8d659975f56d786f025940 Mon Sep 17 00:00:00 2001 From: Victor Bartel Date: Mon, 16 Mar 2015 09:23:58 +0100 Subject: [PATCH 34/39] Add an ability to push and package nuget packages --- WebApiContrib.Formatting.Jsonp.sln | 4 +++- build.bat | 5 ---- build.fsx | 19 +++++++++++++-- build.sh | 38 ++++++++++++++++++++++++++++++ paket.template | 25 ++++++++++++++++++++ publish.cmd | 20 ++++++++++++++++ 6 files changed, 103 insertions(+), 8 deletions(-) delete mode 100644 build.bat create mode 100644 build.sh create mode 100644 paket.template create mode 100644 publish.cmd diff --git a/WebApiContrib.Formatting.Jsonp.sln b/WebApiContrib.Formatting.Jsonp.sln index b1ab49a..b810d2c 100644 --- a/WebApiContrib.Formatting.Jsonp.sln +++ b/WebApiContrib.Formatting.Jsonp.sln @@ -18,9 +18,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{BC242E paket.lock = paket.lock EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fake", "fake", "{B70D0BEB-53C2-4B8C-A275-C3E15BF795CB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{B70D0BEB-53C2-4B8C-A275-C3E15BF795CB}" ProjectSection(SolutionItems) = preProject + build.cmd = build.cmd build.fsx = build.fsx + paket.template = paket.template EndProjectSection EndProject Global diff --git a/build.bat b/build.bat deleted file mode 100644 index 1cb1696..0000000 --- a/build.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -cls -%WINDIR%\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe Build.proj -pause - diff --git a/build.fsx b/build.fsx index 807a6cf..f5df5d0 100644 --- a/build.fsx +++ b/build.fsx @@ -19,8 +19,6 @@ let project = { TestAssemblies = "test/**/bin/Release/*Tests*.dll" } -let release = LoadReleaseNotes "RELEASE_NOTES.md" - Target "Clean" (fun _ -> CleanDirs ["bin"; "temp"] ) @@ -40,6 +38,20 @@ Target "RunTests" (fun _ -> OutputFile = "TestResults.xml" }) ) +Target "PackageNuget" (fun _ -> + Paket.Pack(fun p -> + { p with + OutputPath = "bin" + Version = project.ReleaseNotes.NugetVersion + ReleaseNotes = toLines project.ReleaseNotes.Notes}) +) + +Target "PublishNuget" (fun _ -> + Paket.Push(fun p -> + { p with + WorkingDir = "bin" }) +) + Target "All" DoNothing "Clean" @@ -47,5 +59,8 @@ Target "All" DoNothing ==> "RunTests" ==> "All" +"All" + ==> "PackageNuget" + ==> "PublishNuget" RunTargetOrDefault "All" \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..86f880d --- /dev/null +++ b/build.sh @@ -0,0 +1,38 @@ +#!/bin/bash +if test "$OS" = "Windows_NT" +then + # use .Net + + .paket/paket.bootstrapper.exe + exit_code=$? + if [ $exit_code -ne 0 ]; then + exit $exit_code + fi + + .paket/paket.exe restore + exit_code=$? + if [ $exit_code -ne 0 ]; then + exit $exit_code + fi + + [ ! -e build.fsx ] && .paket/paket.exe update + [ ! -e build.fsx ] && packages/FAKE/tools/FAKE.exe init.fsx + packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx +else + # use mono + mono .paket/paket.bootstrapper.exe + exit_code=$? + if [ $exit_code -ne 0 ]; then + exit $exit_code + fi + + mono .paket/paket.exe restore + exit_code=$? + if [ $exit_code -ne 0 ]; then + exit $exit_code + fi + + [ ! -e build.fsx ] && mono .paket/paket.exe update + [ ! -e build.fsx ] && mono packages/FAKE/tools/FAKE.exe init.fsx + mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx +fi \ No newline at end of file diff --git a/paket.template b/paket.template new file mode 100644 index 0000000..8336aa9 --- /dev/null +++ b/paket.template @@ -0,0 +1,25 @@ +type + file +id + WebApiContrib.Formatting.Jsonp +authors + WebApiContrib Contributors +projectUrl + https://github.com/WebApiContrib/WebApiContrib.Formatting.Jsonp +licenseUrl + https://github.com/WebApiContrib/WebApiContrib.Formatting.Jsonp/blob/master/LICENSE.txt +requireLicenseAcceptance + false +copyright + Copyright WebApiContrib 2012 - 2015 +tags + webapi webapicontrib jsonp +description + Provides a JSONP MediaTypeFormatter implementation for ASP.NET Web API +summary + Provides a JSONP MediaTypeFormatter implementation for ASP.NET Web API + +files + src/WebApiContrib.Formatting.Jsonp/bin/Release/*.dll ==> lib +dependencies + Microsoft.AspNet.WebApi.Core >= 5.0.0 \ No newline at end of file diff --git a/publish.cmd b/publish.cmd new file mode 100644 index 0000000..b81b87b --- /dev/null +++ b/publish.cmd @@ -0,0 +1,20 @@ + +@echo off +cls + +.paket\paket.bootstrapper.exe +if errorlevel 1 ( + exit /b %errorlevel% +) + +.paket\paket.exe restore +if errorlevel 1 ( + exit /b %errorlevel% +) + +IF NOT EXIST build.fsx ( + .paket\paket.exe update + packages\FAKE\tools\FAKE.exe init.fsx +) + +packages\FAKE\tools\FAKE.exe build.fsx %* \ No newline at end of file From 3f81e46d33cccc7d874714f9ddd805220973ba0a Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Thu, 28 May 2015 23:10:17 -0500 Subject: [PATCH 35/39] Fix for Rosetta Flash JSONP vulnerability #38 --- src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs index 307d6b3..d87b279 100644 --- a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs +++ b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs @@ -156,7 +156,9 @@ public override async Task WriteToStreamAsync(Type type, object value, Stream st var encoding = SelectCharacterEncoding(content == null ? null : content.Headers); using (var writer = new StreamWriter(stream, encoding, bufferSize: 4096, leaveOpen: true)) { - writer.Write(_callback + "("); + // the /**/ is a specific security mitigation for "Rosetta Flash JSONP abuse" + // the typeof check is just to reduce client error noise + writer.Write("/**/ typeof " + _callback + " === 'function' && " + _callback + "("); writer.Flush(); await _jsonMediaTypeFormatter.WriteToStreamAsync(type, value, stream, content, transportContext); writer.Write(");"); From 7e6ecdb0841d59e67108ce520fdd1cf1abb5311f Mon Sep 17 00:00:00 2001 From: Martin Pernecky Date: Thu, 25 Jun 2015 15:28:36 +0200 Subject: [PATCH 36/39] Add sanitation for callback parameter Fixes WebApiContrib/WebApiContrib.Formatting.Jsonp#40 --- .../CallbackValidator.cs | 14 ++++++++++++++ .../JsonpMediaTypeFormatter.cs | 5 +++++ .../Properties/Resources.Designer.cs | 11 ++++++++++- .../Properties/Resources.resx | 3 +++ .../WebApiContrib.Formatting.Jsonp.csproj | 1 + .../CallbackValidatorTests.cs | 19 +++++++++++++++++++ .../JsonpMediaTypeFormatterTests.cs | 11 ++++++----- ...ebApiContrib.Formatting.Jsonp.Tests.csproj | 1 + 8 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 src/WebApiContrib.Formatting.Jsonp/CallbackValidator.cs create mode 100644 test/WebApiContrib.Formatting.Jsonp.Tests/CallbackValidatorTests.cs diff --git a/src/WebApiContrib.Formatting.Jsonp/CallbackValidator.cs b/src/WebApiContrib.Formatting.Jsonp/CallbackValidator.cs new file mode 100644 index 0000000..493382b --- /dev/null +++ b/src/WebApiContrib.Formatting.Jsonp/CallbackValidator.cs @@ -0,0 +1,14 @@ +using System.Text.RegularExpressions; + +namespace WebApiContrib.Formatting.Jsonp +{ + public static class CallbackValidator + { + private static readonly Regex JsonpCallbackFormat = new Regex(@"[^0-9a-zA-Z\$_\.]|^(abstract|boolean|break|byte|case|catch|char|class|const|continue|debugger|default|delete|do|double|else|enum|export|extends|false|final|finally|float|for|function|goto|if|implements|import|in|instanceof|int|interface|long|native|new|null|package|private|protected|public|return|short|static|super|switch|synchronized|this|throw|throws|transient|true|try|typeof|var|volatile|void|while|with|NaN|Infinity|undefined)$"); + + public static bool IsValid(string callback) + { + return !JsonpCallbackFormat.IsMatch(callback); + } + } +} diff --git a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs index d87b279..f27b912 100644 --- a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs +++ b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs @@ -68,6 +68,11 @@ private JsonpMediaTypeFormatter(HttpRequestMessage request, string callback, Med throw new ArgumentNullException("callback"); } + if (!CallbackValidator.IsValid(callback)) + { + throw new InvalidOperationException(Properties.Resources.InvalidCallback); + } + _request = request; _callback = callback; } diff --git a/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.Designer.cs b/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.Designer.cs index 38fc11c..2962c6e 100644 --- a/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.Designer.cs +++ b/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34003 +// Runtime Version:4.0.30319.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Invalid callback parameter.. + /// + internal static string InvalidCallback { + get { + return ResourceManager.GetString("InvalidCallback", resourceCulture); + } + } + /// /// Looks up a localized string similar to A callback parameter was not provided in the request URI.. /// diff --git a/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.resx b/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.resx index 2da9294..213a147 100644 --- a/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.resx +++ b/src/WebApiContrib.Formatting.Jsonp/Properties/Resources.resx @@ -120,4 +120,7 @@ A callback parameter was not provided in the request URI. + + Invalid callback parameter. + \ No newline at end of file diff --git a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj index e93feea..3eb8743 100644 --- a/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj +++ b/src/WebApiContrib.Formatting.Jsonp/WebApiContrib.Formatting.Jsonp.csproj @@ -48,6 +48,7 @@ + diff --git a/test/WebApiContrib.Formatting.Jsonp.Tests/CallbackValidatorTests.cs b/test/WebApiContrib.Formatting.Jsonp.Tests/CallbackValidatorTests.cs new file mode 100644 index 0000000..249a91b --- /dev/null +++ b/test/WebApiContrib.Formatting.Jsonp.Tests/CallbackValidatorTests.cs @@ -0,0 +1,19 @@ +using NUnit.Framework; + +namespace WebApiContrib.Formatting.Jsonp.Tests +{ + [TestFixture] + class CallbackValidatorTests + { + [Test] + [TestCase("jQuery12332434", true)] + [TestCase("some.callback.into.deep.object", true)] + [TestCase("", false)] + [TestCase("alert('x'); //", false)] + [TestCase("window.location = 'x'", false)] + public void IsValid(string callback, bool isValid) + { + Assert.That(CallbackValidator.IsValid(callback), Is.EqualTo(isValid)); + } + } +} diff --git a/test/WebApiContrib.Formatting.Jsonp.Tests/JsonpMediaTypeFormatterTests.cs b/test/WebApiContrib.Formatting.Jsonp.Tests/JsonpMediaTypeFormatterTests.cs index 30fa8ff..0bfc722 100644 --- a/test/WebApiContrib.Formatting.Jsonp.Tests/JsonpMediaTypeFormatterTests.cs +++ b/test/WebApiContrib.Formatting.Jsonp.Tests/JsonpMediaTypeFormatterTests.cs @@ -56,16 +56,17 @@ public void IsJsonpRequest_ReturnsTrueForGetRequest() // Ensure JSON works [TestCase("/api/value/1", "", "application/json", "\"value 1\"")] [TestCase("/api/value/1", "application/json", "application/json", "\"value 1\"")] - [TestCase("/api/value/1?callback=?", "", "text/javascript", "?(\"value 1\");")] - [TestCase("/api/value/1?callback=?", "application/json", "text/javascript", "?(\"value 1\");")] + [TestCase("/api/value/1?callback=x", "", "text/javascript", "/**/ typeof x === 'function' && x(\"value 1\");")] + [TestCase("/api/value/1?callback=x", "application/json", "text/javascript", "/**/ typeof x === 'function' && x(\"value 1\");")] + [TestCase("/api/value/1?callback=", "application/json", "text/javascript", "Invalid callback parameter.")] // text/javascript - [TestCase("/api/value/1?callback=?", "text/javascript", "text/javascript", "?(\"value 1\");")] + [TestCase("/api/value/1?callback=x", "text/javascript", "text/javascript", "/**/ typeof x === 'function' && x(\"value 1\");")] [TestCase("/api/value/1", "text/javascript", "text/javascript", "A callback parameter was not provided in the request URI.")] // application/javascript - [TestCase("/api/value/1?callback=?", "application/javascript", "text/javascript", "?(\"value 1\");")] + [TestCase("/api/value/1?callback=x", "application/javascript", "text/javascript", "/**/ typeof x === 'function' && x(\"value 1\");")] [TestCase("/api/value/1", "application/javascript", "text/javascript", "A callback parameter was not provided in the request URI.")] // application/json-p - [TestCase("/api/value/1?callback=?", "application/json-p", "text/javascript", "?(\"value 1\");")] + [TestCase("/api/value/1?callback=x", "application/json-p", "text/javascript", "/**/ typeof x === 'function' && x(\"value 1\");")] [TestCase("/api/value/1", "application/json-p", "text/javascript", "A callback parameter was not provided in the request URI.")] public async Task WriteToStreamAsync_TestExpectations(string requestUri, string acceptMediaType, string expectedMediaType, string expectedValue) { diff --git a/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj b/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj index ee77342..a17b0c7 100644 --- a/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj +++ b/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj @@ -54,6 +54,7 @@
+ From be881edeef4f6059dbf7fe890976649f9a79df36 Mon Sep 17 00:00:00 2001 From: Martin Pernecky Date: Thu, 25 Jun 2015 17:31:56 +0200 Subject: [PATCH 37/39] various cleanup tasks --- .../Web.config | 2 -- .../Content/Site.css | 2 +- .../JsonpMediaTypeFormatter.cs | 6 ++---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/Web.config b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/Web.config index 5acfd25..1510abb 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/Web.config +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleJQueryClient/Web.config @@ -26,8 +26,6 @@ - - diff --git a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/Site.css b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/Site.css index 28a2b1b..a26e931 100644 --- a/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/Site.css +++ b/samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Content/Site.css @@ -207,7 +207,7 @@ ul#menu { background-image: -o-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%); background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #7ac0da), color-stop(1, #a4d4e6)); background-image: -webkit-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%); - background-image: linear-gradient(left, #7ac0da 0%, #a4d4e6 100%); + background-image: linear-gradient(to left, #7ac0da 0%, #a4d4e6 100%); color: #3e5667; padding: 20px 40px 30px 40px; } diff --git a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs index d87b279..b0c2807 100644 --- a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs +++ b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs @@ -17,7 +17,6 @@ public class JsonpMediaTypeFormatter : MediaTypeFormatter private static readonly MediaTypeHeaderValue _applicationJavaScript = new MediaTypeHeaderValue("application/javascript"); private static readonly MediaTypeHeaderValue _applicationJsonp = new MediaTypeHeaderValue("application/json-p"); private static readonly MediaTypeHeaderValue _textJavaScript = new MediaTypeHeaderValue("text/javascript"); - private readonly HttpRequestMessage _request; private readonly MediaTypeFormatter _jsonMediaTypeFormatter; private readonly string _callbackQueryParameter; private readonly string _callback; @@ -68,7 +67,6 @@ private JsonpMediaTypeFormatter(HttpRequestMessage request, string callback, Med throw new ArgumentNullException("callback"); } - _request = request; _callback = callback; } @@ -133,11 +131,11 @@ public override bool CanWriteType(Type type) /// /// Called during serialization to write an object of the specified - /// to the specified . + /// to the specified . /// /// The type of object to write. /// The object to write. - /// The to which to write. + /// The to which to write. /// The for the content being written. /// The . /// A that will write the value to the stream. From 5adbc229812163b9c73ff5ebeeba3654da12abab Mon Sep 17 00:00:00 2001 From: Martin Pernecky Date: Wed, 29 Jul 2015 17:47:22 +0200 Subject: [PATCH 38/39] chore: fix hint paths in tests project file --- .../WebApiContrib.Formatting.Jsonp.Tests.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj b/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj index 62366c1..4dc6625 100644 --- a/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj +++ b/test/WebApiContrib.Formatting.Jsonp.Tests/WebApiContrib.Formatting.Jsonp.Tests.csproj @@ -39,11 +39,11 @@ False - ..\..\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll + ..\..\packages\Microsoft.AspNet.WebApi.Client\lib\net45\System.Net.Http.Formatting.dll False - ..\..\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll + ..\..\packages\Microsoft.AspNet.WebApi.Core\lib\net45\System.Web.Http.dll @@ -68,7 +68,7 @@ -