├── assets ├── jquery │ ├── src │ │ ├── outro.js │ │ ├── selector.js │ │ ├── var │ │ │ ├── arr.js │ │ │ ├── rnotwhite.js │ │ │ ├── strundefined.js │ │ │ ├── push.js │ │ │ ├── slice.js │ │ │ ├── class2type.js │ │ │ ├── concat.js │ │ │ ├── indexOf.js │ │ │ ├── pnum.js │ │ │ ├── hasOwn.js │ │ │ ├── toString.js │ │ │ └── support.js │ │ ├── ajax │ │ │ ├── var │ │ │ │ ├── rquery.js │ │ │ │ └── nonce.js │ │ │ ├── parseJSON.js │ │ │ ├── parseXML.js │ │ │ ├── script.js │ │ │ ├── load.js │ │ │ ├── jsonp.js │ │ │ └── xhr.js │ │ ├── css │ │ │ ├── var │ │ │ │ ├── rmargin.js │ │ │ │ ├── cssExpand.js │ │ │ │ ├── rnumnonpx.js │ │ │ │ ├── isHidden.js │ │ │ │ └── getStyles.js │ │ │ ├── hiddenVisibleSelectors.js │ │ │ ├── addGetHookIf.js │ │ │ ├── swap.js │ │ │ ├── curCSS.js │ │ │ ├── defaultDisplay.js │ │ │ └── support.js │ │ ├── manipulation │ │ │ ├── var │ │ │ │ └── rcheckableType.js │ │ │ ├── _evalUrl.js │ │ │ └── support.js │ │ ├── data │ │ │ ├── var │ │ │ │ ├── data_priv.js │ │ │ │ └── data_user.js │ │ │ ├── accepts.js │ │ │ └── Data.js │ │ ├── core │ │ │ ├── var │ │ │ │ └── rsingleTag.js │ │ │ ├── parseHTML.js │ │ │ ├── access.js │ │ │ ├── ready.js │ │ │ └── init.js │ │ ├── traversing │ │ │ ├── var │ │ │ │ └── rneedsContext.js │ │ │ └── findFilter.js │ │ ├── event │ │ │ ├── support.js │ │ │ ├── ajax.js │ │ │ └── alias.js │ │ ├── attributes.js │ │ ├── deprecated.js │ │ ├── effects │ │ │ ├── animatedSelector.js │ │ │ └── Tween.js │ │ ├── selector-sizzle.js │ │ ├── queue │ │ │ └── delay.js │ │ ├── jquery.js │ │ ├── exports │ │ │ ├── global.js │ │ │ └── amd.js │ │ ├── attributes │ │ │ ├── support.js │ │ │ ├── prop.js │ │ │ ├── attr.js │ │ │ ├── val.js │ │ │ └── classes.js │ │ ├── intro.js │ │ ├── wrap.js │ │ ├── dimensions.js │ │ ├── serialize.js │ │ ├── queue.js │ │ ├── deferred.js │ │ ├── selector-native.js │ │ ├── traversing.js │ │ ├── data.js │ │ ├── callbacks.js │ │ ├── offset.js │ │ ├── core.js │ │ ├── css.js │ │ └── manipulation.js │ ├── bower.json │ ├── .bower.json │ └── MIT-LICENSE.txt └── marked │ ├── doc │ ├── todo.md │ └── broken.md │ ├── index.js │ ├── Makefile │ ├── component.json │ ├── bower.json │ ├── Gulpfile.js │ ├── package.json │ ├── .bower.json │ ├── LICENSE │ ├── man │ └── marked.1 │ ├── bin │ └── marked │ └── README.md ├── .bowerrc ├── rtlmd.appcache ├── README.md ├── .gitignore ├── initcontent.md ├── license ├── app ├── js │ ├── rtlmd.js │ └── autogrow.js ├── scss │ └── style.scss └── css │ └── style.css └── index.html /assets/jquery/src/outro.js: -------------------------------------------------------------------------------- 1 | })); 2 | -------------------------------------------------------------------------------- /assets/marked/doc/todo.md: -------------------------------------------------------------------------------- 1 | # Todo 2 | 3 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory" : "assets/" 3 | } 4 | -------------------------------------------------------------------------------- /assets/jquery/src/selector.js: -------------------------------------------------------------------------------- 1 | define([ "./selector-sizzle" ]); 2 | -------------------------------------------------------------------------------- /assets/marked/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/marked'); 2 | -------------------------------------------------------------------------------- /assets/jquery/src/var/arr.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return []; 3 | }); 4 | -------------------------------------------------------------------------------- /assets/jquery/src/ajax/var/rquery.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/\?/); 3 | }); 4 | -------------------------------------------------------------------------------- /assets/jquery/src/var/rnotwhite.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/\S+/g); 3 | }); 4 | -------------------------------------------------------------------------------- /assets/jquery/src/css/var/rmargin.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/^margin/); 3 | }); 4 | -------------------------------------------------------------------------------- /assets/jquery/src/var/strundefined.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return typeof undefined; 3 | }); 4 | -------------------------------------------------------------------------------- /assets/jquery/src/var/push.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.push; 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/var/slice.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.slice; 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/var/class2type.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // [[Class]] -> type pairs 3 | return {}; 4 | }); 5 | -------------------------------------------------------------------------------- /assets/jquery/src/var/concat.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.concat; 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/var/indexOf.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.indexOf; 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/css/var/cssExpand.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return [ "Top", "Right", "Bottom", "Left" ]; 3 | }); 4 | -------------------------------------------------------------------------------- /assets/jquery/src/manipulation/var/rcheckableType.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/^(?:checkbox|radio)$/i); 3 | }); 4 | -------------------------------------------------------------------------------- /assets/jquery/src/var/pnum.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; 3 | }); 4 | -------------------------------------------------------------------------------- /assets/jquery/src/ajax/var/nonce.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core" 3 | ], function( jQuery ) { 4 | return jQuery.now(); 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/data/var/data_priv.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../Data" 3 | ], function( Data ) { 4 | return new Data(); 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/data/var/data_user.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../Data" 3 | ], function( Data ) { 4 | return new Data(); 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/var/hasOwn.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./class2type" 3 | ], function( class2type ) { 4 | return class2type.hasOwnProperty; 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/var/toString.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./class2type" 3 | ], function( class2type ) { 4 | return class2type.toString; 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/core/var/rsingleTag.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // Match a standalone tag 3 | return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); 4 | }); 5 | -------------------------------------------------------------------------------- /assets/jquery/src/var/support.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // All support tests are defined in their respective modules. 3 | return {}; 4 | }); 5 | -------------------------------------------------------------------------------- /assets/jquery/src/css/var/rnumnonpx.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../var/pnum" 3 | ], function( pnum ) { 4 | return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 5 | }); 6 | -------------------------------------------------------------------------------- /assets/jquery/src/traversing/var/rneedsContext.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core", 3 | "../../selector" 4 | ], function( jQuery ) { 5 | return jQuery.expr.match.needsContext; 6 | }); 7 | -------------------------------------------------------------------------------- /assets/jquery/src/event/support.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | support.focusinBubbles = "onfocusin" in window; 6 | 7 | return support; 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /assets/jquery/src/attributes.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./attributes/attr", 4 | "./attributes/prop", 5 | "./attributes/classes", 6 | "./attributes/val" 7 | ], function( jQuery ) { 8 | 9 | // Return jQuery for attributes-only inclusion 10 | return jQuery; 11 | }); 12 | -------------------------------------------------------------------------------- /assets/marked/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @cp lib/marked.js marked.js 3 | @uglifyjs --comments '/\*[^\0]+?Copyright[^\0]+?\*/' -o marked.min.js lib/marked.js 4 | 5 | clean: 6 | @rm marked.js 7 | @rm marked.min.js 8 | 9 | bench: 10 | @node test --bench 11 | 12 | .PHONY: clean all 13 | -------------------------------------------------------------------------------- /assets/jquery/src/ajax/parseJSON.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Support: Android 2.3 6 | // Workaround failure to string-cast null input 7 | jQuery.parseJSON = function( data ) { 8 | return JSON.parse( data + "" ); 9 | }; 10 | 11 | return jQuery.parseJSON; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /assets/jquery/src/deprecated.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./traversing" 4 | ], function( jQuery ) { 5 | 6 | // The number of elements contained in the matched element set 7 | jQuery.fn.size = function() { 8 | return this.length; 9 | }; 10 | 11 | jQuery.fn.andSelf = jQuery.fn.addBack; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /assets/marked/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "version": "0.3.4", 4 | "repo": "chjj/marked", 5 | "description": "A markdown parser built for speed", 6 | "keywords": ["markdown", "markup", "html"], 7 | "scripts": ["lib/marked.js"], 8 | "main": "lib/marked.js", 9 | "license": "MIT" 10 | } 11 | -------------------------------------------------------------------------------- /assets/jquery/src/effects/animatedSelector.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../selector", 4 | "../effects" 5 | ], function( jQuery ) { 6 | 7 | jQuery.expr.filters.animated = function( elem ) { 8 | return jQuery.grep(jQuery.timers, function( fn ) { 9 | return elem === fn.elem; 10 | }).length; 11 | }; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /assets/jquery/src/manipulation/_evalUrl.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../ajax" 3 | ], function( jQuery ) { 4 | 5 | jQuery._evalUrl = function( url ) { 6 | return jQuery.ajax({ 7 | url: url, 8 | type: "GET", 9 | dataType: "script", 10 | async: false, 11 | global: false, 12 | "throws": true 13 | }); 14 | }; 15 | 16 | return jQuery._evalUrl; 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /assets/jquery/src/selector-sizzle.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "sizzle" 4 | ], function( jQuery, Sizzle ) { 5 | 6 | jQuery.find = Sizzle; 7 | jQuery.expr = Sizzle.selectors; 8 | jQuery.expr[":"] = jQuery.expr.pseudos; 9 | jQuery.unique = Sizzle.uniqueSort; 10 | jQuery.text = Sizzle.getText; 11 | jQuery.isXMLDoc = Sizzle.isXML; 12 | jQuery.contains = Sizzle.contains; 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /assets/jquery/src/event/ajax.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../event" 4 | ], function( jQuery ) { 5 | 6 | // Attach a bunch of functions for handling common AJAX events 7 | jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { 8 | jQuery.fn[ type ] = function( fn ) { 9 | return this.on( type, fn ); 10 | }; 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /assets/jquery/src/css/var/isHidden.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core", 3 | "../../selector" 4 | // css is assumed 5 | ], function( jQuery ) { 6 | 7 | return function( elem, el ) { 8 | // isHidden might be called from jQuery#filter function; 9 | // in that case, element will be second argument 10 | elem = el || elem; 11 | return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); 12 | }; 13 | }); 14 | -------------------------------------------------------------------------------- /rtlmd.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | 3 | CACHE: 4 | http://yui.yahooapis.com/pure/0.5.0/pure-min.css 5 | css/rtl.css 6 | https://camo.githubusercontent.com/82b228a3648bf44fc1163ef44c62fcc60081495e/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f7265645f6161303030302e706e67 7 | index.html 8 | js/marked.js 9 | js/jquery-1.11.1.min.js 10 | js/autogrow.min.js 11 | js/rtl.js 12 | initcontent.md 13 | 14 | 15 | NETWORK: 16 | * 17 | -------------------------------------------------------------------------------- /assets/jquery/src/css/hiddenVisibleSelectors.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../selector" 4 | ], function( jQuery ) { 5 | 6 | jQuery.expr.filters.hidden = function( elem ) { 7 | // Support: Opera <= 12.12 8 | // Opera reports offsetWidths and offsetHeights less than zero on some elements 9 | return elem.offsetWidth <= 0 && elem.offsetHeight <= 0; 10 | }; 11 | jQuery.expr.filters.visible = function( elem ) { 12 | return !jQuery.expr.filters.hidden( elem ); 13 | }; 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /assets/jquery/src/css/var/getStyles.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return function( elem ) { 3 | // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 4 | // IE throws on elements created in popups 5 | // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6 | if ( elem.ownerDocument.defaultView.opener ) { 7 | return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); 8 | } 9 | 10 | return window.getComputedStyle( elem, null ); 11 | }; 12 | }); 13 | -------------------------------------------------------------------------------- /assets/jquery/src/data/accepts.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | /** 6 | * Determines whether an object can have data 7 | */ 8 | jQuery.acceptData = function( owner ) { 9 | // Accepts only: 10 | // - Node 11 | // - Node.ELEMENT_NODE 12 | // - Node.DOCUMENT_NODE 13 | // - Object 14 | // - Any 15 | /* jshint -W018 */ 16 | return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 17 | }; 18 | 19 | return jQuery.acceptData; 20 | }); 21 | -------------------------------------------------------------------------------- /assets/marked/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "version": "0.3.4", 4 | "homepage": "https://github.com/chjj/marked", 5 | "authors": [ 6 | "Christopher Jeffrey " 7 | ], 8 | "description": "A markdown parser built for speed", 9 | "keywords": [ 10 | "markdown", 11 | "markup", 12 | "html" 13 | ], 14 | "main": "lib/marked.js", 15 | "license": "MIT", 16 | "ignore": [ 17 | "**/.*", 18 | "node_modules", 19 | "bower_components", 20 | "app/bower_components", 21 | "test", 22 | "tests" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /assets/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /assets/marked/Gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var uglify = require('gulp-uglify'); 3 | var concat = require('gulp-concat'); 4 | 5 | var preserveFirstComment = function() { 6 | var set = false; 7 | 8 | return function() { 9 | if (set) return false; 10 | set = true; 11 | return true; 12 | }; 13 | }; 14 | 15 | gulp.task('uglify', function() { 16 | gulp.src('lib/marked.js') 17 | .pipe(uglify({preserveComments: preserveFirstComment()})) 18 | .pipe(concat('marked.min.js')) 19 | .pipe(gulp.dest('.')); 20 | }); 21 | 22 | gulp.task('default', ['uglify']); 23 | -------------------------------------------------------------------------------- /assets/jquery/src/css/addGetHookIf.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | 3 | function addGetHookIf( conditionFn, hookFn ) { 4 | // Define the hook, we'll check on the first run if it's really needed. 5 | return { 6 | get: function() { 7 | if ( conditionFn() ) { 8 | // Hook not needed (or it's not possible to use it due 9 | // to missing dependency), remove it. 10 | delete this.get; 11 | return; 12 | } 13 | 14 | // Hook needed; redefine it so that the support test is not executed again. 15 | return (this.get = hookFn).apply( this, arguments ); 16 | } 17 | }; 18 | } 19 | 20 | return addGetHookIf; 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /assets/jquery/src/ajax/parseXML.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Cross-browser xml parsing 6 | jQuery.parseXML = function( data ) { 7 | var xml, tmp; 8 | if ( !data || typeof data !== "string" ) { 9 | return null; 10 | } 11 | 12 | // Support: IE9 13 | try { 14 | tmp = new DOMParser(); 15 | xml = tmp.parseFromString( data, "text/xml" ); 16 | } catch ( e ) { 17 | xml = undefined; 18 | } 19 | 20 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 21 | jQuery.error( "Invalid XML: " + data ); 22 | } 23 | return xml; 24 | }; 25 | 26 | return jQuery.parseXML; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /assets/jquery/src/queue/delay.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../queue", 4 | "../effects" // Delay is optional because of this dependency 5 | ], function( jQuery ) { 6 | 7 | // Based off of the plugin by Clint Helfers, with permission. 8 | // http://blindsignals.com/index.php/2009/07/jquery-delay/ 9 | jQuery.fn.delay = function( time, type ) { 10 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 11 | type = type || "fx"; 12 | 13 | return this.queue( type, function( next, hooks ) { 14 | var timeout = setTimeout( next, time ); 15 | hooks.stop = function() { 16 | clearTimeout( timeout ); 17 | }; 18 | }); 19 | }; 20 | 21 | return jQuery.fn.delay; 22 | }); 23 | -------------------------------------------------------------------------------- /assets/jquery/src/css/swap.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // A method for quickly swapping in/out CSS properties to get correct calculations. 6 | jQuery.swap = function( elem, options, callback, args ) { 7 | var ret, name, 8 | old = {}; 9 | 10 | // Remember the old values, and insert the new ones 11 | for ( name in options ) { 12 | old[ name ] = elem.style[ name ]; 13 | elem.style[ name ] = options[ name ]; 14 | } 15 | 16 | ret = callback.apply( elem, args || [] ); 17 | 18 | // Revert the old values 19 | for ( name in options ) { 20 | elem.style[ name ] = old[ name ]; 21 | } 22 | 23 | return ret; 24 | }; 25 | 26 | return jQuery.swap; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [RTL Markdown Editor](http://rtlmd.productivity.directory) [![Join the chat at https://gitter.im/dariubs/rtlmd](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dariubs/rtlmd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 2 | ===== 3 | Simple rtl markdown editor for rtl languages. 4 | 5 | Feel free to use code blocks and see them ltr :D 6 | 7 | by [@dariubs](http://dariubs.github.io) for [Productivity Directory](https://productivity.directory) 8 | 9 | 10 | To-do 11 | ----- 12 | check [enhancement](https://github.com/dariubs/rtlmd/labels/enhancement) tag on repo issues. 13 | 14 | License 15 | ----- 16 | [MIT](https://github.com/dariubs/rtlmd/blob/gh-pages/license) 17 | 18 | 19 | -------------------------------------------------------------------------------- /assets/jquery/src/jquery.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./selector", 4 | "./traversing", 5 | "./callbacks", 6 | "./deferred", 7 | "./core/ready", 8 | "./data", 9 | "./queue", 10 | "./queue/delay", 11 | "./attributes", 12 | "./event", 13 | "./event/alias", 14 | "./manipulation", 15 | "./manipulation/_evalUrl", 16 | "./wrap", 17 | "./css", 18 | "./css/hiddenVisibleSelectors", 19 | "./serialize", 20 | "./ajax", 21 | "./ajax/xhr", 22 | "./ajax/script", 23 | "./ajax/jsonp", 24 | "./ajax/load", 25 | "./event/ajax", 26 | "./effects", 27 | "./effects/animatedSelector", 28 | "./offset", 29 | "./dimensions", 30 | "./deprecated", 31 | "./exports/amd", 32 | "./exports/global" 33 | ], function( jQuery ) { 34 | 35 | return jQuery; 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .gitignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | logs 5 | *.log 6 | 7 | # Runtime data 8 | pids 9 | *.pid 10 | *.seed 11 | 12 | # Directory for instrumented libs generated by jscoverage/JSCover 13 | lib-cov 14 | 15 | # Coverage directory used by tools like istanbul 16 | coverage 17 | 18 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 19 | .grunt 20 | 21 | # Compiled binary addons (http://nodejs.org/api/addons.html) 22 | build/Release 23 | 24 | # Dependency directory 25 | # Commenting this out is preferred by some people, see 26 | # https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | # Users Environment Variables 30 | .lock-wscript 31 | 32 | # webstorm 33 | .idea/ -------------------------------------------------------------------------------- /assets/jquery/src/exports/global.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../var/strundefined" 4 | ], function( jQuery, strundefined ) { 5 | 6 | var 7 | // Map over jQuery in case of overwrite 8 | _jQuery = window.jQuery, 9 | 10 | // Map over the $ in case of overwrite 11 | _$ = window.$; 12 | 13 | jQuery.noConflict = function( deep ) { 14 | if ( window.$ === jQuery ) { 15 | window.$ = _$; 16 | } 17 | 18 | if ( deep && window.jQuery === jQuery ) { 19 | window.jQuery = _jQuery; 20 | } 21 | 22 | return jQuery; 23 | }; 24 | 25 | // Expose jQuery and $ identifiers, even in AMD 26 | // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 27 | // and CommonJS for browser emulators (#13566) 28 | if ( typeof noGlobal === strundefined ) { 29 | window.jQuery = window.$ = jQuery; 30 | } 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /assets/marked/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "description": "A markdown parser built for speed", 4 | "author": "Christopher Jeffrey", 5 | "version": "0.3.5", 6 | "main": "./lib/marked.js", 7 | "bin": "./bin/marked", 8 | "man": "./man/marked.1", 9 | "preferGlobal": true, 10 | "repository": "git://github.com/chjj/marked.git", 11 | "homepage": "https://github.com/chjj/marked", 12 | "bugs": { "url": "http://github.com/chjj/marked/issues" }, 13 | "license": "MIT", 14 | "keywords": ["markdown", "markup", "html"], 15 | "tags": ["markdown", "markup", "html"], 16 | "devDependencies": { 17 | "markdown": "*", 18 | "showdown": "*", 19 | "gulp": "^3.8.11", 20 | "gulp-uglify": "^1.1.0", 21 | "gulp-concat": "^2.5.2" 22 | }, 23 | "scripts": { "test": "node test", "bench": "node test --bench" } 24 | } 25 | -------------------------------------------------------------------------------- /assets/marked/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "version": "0.3.5", 4 | "homepage": "https://github.com/chjj/marked", 5 | "authors": [ 6 | "Christopher Jeffrey " 7 | ], 8 | "description": "A markdown parser built for speed", 9 | "keywords": [ 10 | "markdown", 11 | "markup", 12 | "html" 13 | ], 14 | "main": "lib/marked.js", 15 | "license": "MIT", 16 | "ignore": [ 17 | "**/.*", 18 | "node_modules", 19 | "bower_components", 20 | "app/bower_components", 21 | "test", 22 | "tests" 23 | ], 24 | "_release": "0.3.5", 25 | "_resolution": { 26 | "type": "version", 27 | "tag": "v0.3.5", 28 | "commit": "88ce4df47c4d994dc1b1df1477a21fb893e11ddc" 29 | }, 30 | "_source": "git://github.com/chjj/marked.git", 31 | "_target": "~0.3.5", 32 | "_originalSource": "marked", 33 | "_direct": true 34 | } -------------------------------------------------------------------------------- /assets/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ], 28 | "homepage": "https://github.com/jquery/jquery", 29 | "_release": "2.1.4", 30 | "_resolution": { 31 | "type": "version", 32 | "tag": "2.1.4", 33 | "commit": "7751e69b615c6eca6f783a81e292a55725af6b85" 34 | }, 35 | "_source": "git://github.com/jquery/jquery.git", 36 | "_target": "~2.1.4", 37 | "_originalSource": "jquery" 38 | } -------------------------------------------------------------------------------- /initcontent.md: -------------------------------------------------------------------------------- 1 | سلام دنیا 2 | === 3 | 4 | این یک نوشتار آزمایشی برای نمایش قابلیتهای [مارک داون](http://daringfireball.net/projects/markdown/) است. 5 | 6 | یک لیست 7 | --- 8 | 9 | ویژگی های نرم افزار آزاد 10 | 11 | * آزادی اجرای برنامه برای هر کاری (آزادی صفرم) 12 | * *آزادی مطالعه چگونگی کار برنامه و تغییر آن (پیش نیاز: متن برنامه) (آزادی یکم)* 13 | * **آزادی تکثیر و کپی برنامه (آزادی دوم)** 14 | * ***آزادی تقویت و بهتر کردن برنامه و توزیع آن برای همگان (پیش نیاز: متن برنامه) (آزادی سوم)*** 15 | 16 | 17 | قابلیت افزودن تکه کدها 18 | --- 19 | ```javascript 20 | alert("Hello World") 21 | ``` 22 | 23 | و نوشته های تورفته 24 | --- 25 | >آزادی نرم‌افزارهای آزاد تا جایی هست که حتی می‌توان بدون پرداخت هزینه‌ای برای مجوز، کپی‌هایی از یک نرم‌افزار آزاد را، یا بدون تغییرات، رایگان یا در ازای دریافت وجه، برای هرکس و هرجایی آن را توزیع کرد. 26 | 27 | و اضافه کردن لینک ها 28 | --- 29 | - [بنیاد نرم افزار آزاد](http://www.fsf.org/) 30 | - [بنیاد گنو](https://www.gnu.org) -------------------------------------------------------------------------------- /assets/jquery/src/attributes/support.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | (function() { 6 | var input = document.createElement( "input" ), 7 | select = document.createElement( "select" ), 8 | opt = select.appendChild( document.createElement( "option" ) ); 9 | 10 | input.type = "checkbox"; 11 | 12 | // Support: iOS<=5.1, Android<=4.2+ 13 | // Default value for a checkbox should be "on" 14 | support.checkOn = input.value !== ""; 15 | 16 | // Support: IE<=11+ 17 | // Must access selectedIndex to make default options select 18 | support.optSelected = opt.selected; 19 | 20 | // Support: Android<=2.3 21 | // Options inside disabled selects are incorrectly marked as disabled 22 | select.disabled = true; 23 | support.optDisabled = !opt.disabled; 24 | 25 | // Support: IE<=11+ 26 | // An input loses its value after becoming a radio 27 | input = document.createElement( "input" ); 28 | input.value = "t"; 29 | input.type = "radio"; 30 | support.radioValue = input.value === "t"; 31 | })(); 32 | 33 | return support; 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Dariush Abbasi 0 ? 13 | this.on( name, null, data, fn ) : 14 | this.trigger( name ); 15 | }; 16 | }); 17 | 18 | jQuery.fn.extend({ 19 | hover: function( fnOver, fnOut ) { 20 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 21 | }, 22 | 23 | bind: function( types, data, fn ) { 24 | return this.on( types, null, data, fn ); 25 | }, 26 | unbind: function( types, fn ) { 27 | return this.off( types, null, fn ); 28 | }, 29 | 30 | delegate: function( selector, types, data, fn ) { 31 | return this.on( types, selector, data, fn ); 32 | }, 33 | undelegate: function( selector, types, fn ) { 34 | // ( namespace ) or ( selector, types [, fn] ) 35 | return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); 36 | } 37 | }); 38 | 39 | }); 40 | -------------------------------------------------------------------------------- /app/js/autogrow.js: -------------------------------------------------------------------------------- 1 | ;(function(e){e.fn.autogrow=function(t){function s(n){var r=e(this),i=r.innerHeight(),s=this.scrollHeight,o=r.data("autogrow-start-height")||0,u;if(io){u=r.clone().addClass(t.cloneClass).css({position:"absolute",zIndex:-10,height:""}).val(r.val());r.after(u);do{s=u[0].scrollHeight-1;u.innerHeight(s)}while(s===u[0].scrollHeight);s++;u.remove();r.focus();ss&&t.animate?r.stop().animate({height:s},t.speed):r.innerHeight(s)}else{r.innerHeight(o)}}}var n=e(this).css({overflow:"hidden",resize:"none"}),r=n.selector,i={context:e(document),animate:true,speed:200,fixMinHeight:true,cloneClass:"autogrowclone",onInitialize:false};t=e.isPlainObject(t)?t:{context:t?t:e(document)};t=e.extend({},i,t);n.each(function(n,r){var i,o;r=e(r);if(r.is(":visible")||parseInt(r.css("height"),10)>0){i=parseInt(r.css("height"),10)||r.innerHeight()}else{o=r.clone().addClass(t.cloneClass).val(r.val()).css({position:"absolute",visibility:"hidden",display:"block"});e("body").append(o);i=o.innerHeight();o.remove()}if(t.fixMinHeight){r.data("autogrow-start-height",i)}r.css("height",i);if(t.onInitialize){s.call(r)}});t.context.on("keyup paste",r,s);return n}})(jQuery); 2 | -------------------------------------------------------------------------------- /assets/jquery/src/core/access.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Multifunctional method to get and set values of a collection 6 | // The value/s can optionally be executed if it's a function 7 | var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 8 | var i = 0, 9 | len = elems.length, 10 | bulk = key == null; 11 | 12 | // Sets many values 13 | if ( jQuery.type( key ) === "object" ) { 14 | chainable = true; 15 | for ( i in key ) { 16 | jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); 17 | } 18 | 19 | // Sets one value 20 | } else if ( value !== undefined ) { 21 | chainable = true; 22 | 23 | if ( !jQuery.isFunction( value ) ) { 24 | raw = true; 25 | } 26 | 27 | if ( bulk ) { 28 | // Bulk operations run against the entire set 29 | if ( raw ) { 30 | fn.call( elems, value ); 31 | fn = null; 32 | 33 | // ...except when executing function values 34 | } else { 35 | bulk = fn; 36 | fn = function( elem, key, value ) { 37 | return bulk.call( jQuery( elem ), value ); 38 | }; 39 | } 40 | } 41 | 42 | if ( fn ) { 43 | for ( ; i < len; i++ ) { 44 | fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); 45 | } 46 | } 47 | } 48 | 49 | return chainable ? 50 | elems : 51 | 52 | // Gets 53 | bulk ? 54 | fn.call( elems ) : 55 | len ? fn( elems[0], key ) : emptyGet; 56 | }; 57 | 58 | return access; 59 | 60 | }); 61 | -------------------------------------------------------------------------------- /assets/jquery/src/ajax/script.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../ajax" 4 | ], function( jQuery ) { 5 | 6 | // Install script dataType 7 | jQuery.ajaxSetup({ 8 | accepts: { 9 | script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 10 | }, 11 | contents: { 12 | script: /(?:java|ecma)script/ 13 | }, 14 | converters: { 15 | "text script": function( text ) { 16 | jQuery.globalEval( text ); 17 | return text; 18 | } 19 | } 20 | }); 21 | 22 | // Handle cache's special case and crossDomain 23 | jQuery.ajaxPrefilter( "script", function( s ) { 24 | if ( s.cache === undefined ) { 25 | s.cache = false; 26 | } 27 | if ( s.crossDomain ) { 28 | s.type = "GET"; 29 | } 30 | }); 31 | 32 | // Bind script tag hack transport 33 | jQuery.ajaxTransport( "script", function( s ) { 34 | // This transport only deals with cross domain requests 35 | if ( s.crossDomain ) { 36 | var script, callback; 37 | return { 38 | send: function( _, complete ) { 39 | script = jQuery(" 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /assets/jquery/src/css/support.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../var/support" 4 | ], function( jQuery, support ) { 5 | 6 | (function() { 7 | var pixelPositionVal, boxSizingReliableVal, 8 | docElem = document.documentElement, 9 | container = document.createElement( "div" ), 10 | div = document.createElement( "div" ); 11 | 12 | if ( !div.style ) { 13 | return; 14 | } 15 | 16 | // Support: IE9-11+ 17 | // Style of cloned element affects source element cloned (#8908) 18 | div.style.backgroundClip = "content-box"; 19 | div.cloneNode( true ).style.backgroundClip = ""; 20 | support.clearCloneStyle = div.style.backgroundClip === "content-box"; 21 | 22 | container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" + 23 | "position:absolute"; 24 | container.appendChild( div ); 25 | 26 | // Executing both pixelPosition & boxSizingReliable tests require only one layout 27 | // so they're executed at the same time to save the second computation. 28 | function computePixelPositionAndBoxSizingReliable() { 29 | div.style.cssText = 30 | // Support: Firefox<29, Android 2.3 31 | // Vendor-prefix box-sizing 32 | "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + 33 | "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + 34 | "border:1px;padding:1px;width:4px;position:absolute"; 35 | div.innerHTML = ""; 36 | docElem.appendChild( container ); 37 | 38 | var divStyle = window.getComputedStyle( div, null ); 39 | pixelPositionVal = divStyle.top !== "1%"; 40 | boxSizingReliableVal = divStyle.width === "4px"; 41 | 42 | docElem.removeChild( container ); 43 | } 44 | 45 | // Support: node.js jsdom 46 | // Don't assume that getComputedStyle is a property of the global object 47 | if ( window.getComputedStyle ) { 48 | jQuery.extend( support, { 49 | pixelPosition: function() { 50 | 51 | // This test is executed only once but we still do memoizing 52 | // since we can use the boxSizingReliable pre-computing. 53 | // No need to check if the test was already performed, though. 54 | computePixelPositionAndBoxSizingReliable(); 55 | return pixelPositionVal; 56 | }, 57 | boxSizingReliable: function() { 58 | if ( boxSizingReliableVal == null ) { 59 | computePixelPositionAndBoxSizingReliable(); 60 | } 61 | return boxSizingReliableVal; 62 | }, 63 | reliableMarginRight: function() { 64 | 65 | // Support: Android 2.3 66 | // Check if div with explicit width and no margin-right incorrectly 67 | // gets computed margin-right based on width of container. (#3333) 68 | // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 69 | // This support function is only executed once so no memoizing is needed. 70 | var ret, 71 | marginDiv = div.appendChild( document.createElement( "div" ) ); 72 | 73 | // Reset CSS: box-sizing; display; margin; border; padding 74 | marginDiv.style.cssText = div.style.cssText = 75 | // Support: Firefox<29, Android 2.3 76 | // Vendor-prefix box-sizing 77 | "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 78 | "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; 79 | marginDiv.style.marginRight = marginDiv.style.width = "0"; 80 | div.style.width = "1px"; 81 | docElem.appendChild( container ); 82 | 83 | ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight ); 84 | 85 | docElem.removeChild( container ); 86 | div.removeChild( marginDiv ); 87 | 88 | return ret; 89 | } 90 | }); 91 | } 92 | })(); 93 | 94 | return support; 95 | 96 | }); 97 | -------------------------------------------------------------------------------- /assets/jquery/src/effects/Tween.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../css" 4 | ], function( jQuery ) { 5 | 6 | function Tween( elem, options, prop, end, easing ) { 7 | return new Tween.prototype.init( elem, options, prop, end, easing ); 8 | } 9 | jQuery.Tween = Tween; 10 | 11 | Tween.prototype = { 12 | constructor: Tween, 13 | init: function( elem, options, prop, end, easing, unit ) { 14 | this.elem = elem; 15 | this.prop = prop; 16 | this.easing = easing || "swing"; 17 | this.options = options; 18 | this.start = this.now = this.cur(); 19 | this.end = end; 20 | this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 21 | }, 22 | cur: function() { 23 | var hooks = Tween.propHooks[ this.prop ]; 24 | 25 | return hooks && hooks.get ? 26 | hooks.get( this ) : 27 | Tween.propHooks._default.get( this ); 28 | }, 29 | run: function( percent ) { 30 | var eased, 31 | hooks = Tween.propHooks[ this.prop ]; 32 | 33 | if ( this.options.duration ) { 34 | this.pos = eased = jQuery.easing[ this.easing ]( 35 | percent, this.options.duration * percent, 0, 1, this.options.duration 36 | ); 37 | } else { 38 | this.pos = eased = percent; 39 | } 40 | this.now = ( this.end - this.start ) * eased + this.start; 41 | 42 | if ( this.options.step ) { 43 | this.options.step.call( this.elem, this.now, this ); 44 | } 45 | 46 | if ( hooks && hooks.set ) { 47 | hooks.set( this ); 48 | } else { 49 | Tween.propHooks._default.set( this ); 50 | } 51 | return this; 52 | } 53 | }; 54 | 55 | Tween.prototype.init.prototype = Tween.prototype; 56 | 57 | Tween.propHooks = { 58 | _default: { 59 | get: function( tween ) { 60 | var result; 61 | 62 | if ( tween.elem[ tween.prop ] != null && 63 | (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { 64 | return tween.elem[ tween.prop ]; 65 | } 66 | 67 | // Passing an empty string as a 3rd parameter to .css will automatically 68 | // attempt a parseFloat and fallback to a string if the parse fails. 69 | // Simple values such as "10px" are parsed to Float; 70 | // complex values such as "rotate(1rad)" are returned as-is. 71 | result = jQuery.css( tween.elem, tween.prop, "" ); 72 | // Empty strings, null, undefined and "auto" are converted to 0. 73 | return !result || result === "auto" ? 0 : result; 74 | }, 75 | set: function( tween ) { 76 | // Use step hook for back compat. 77 | // Use cssHook if its there. 78 | // Use .style if available and use plain properties where available. 79 | if ( jQuery.fx.step[ tween.prop ] ) { 80 | jQuery.fx.step[ tween.prop ]( tween ); 81 | } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { 82 | jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 83 | } else { 84 | tween.elem[ tween.prop ] = tween.now; 85 | } 86 | } 87 | } 88 | }; 89 | 90 | // Support: IE9 91 | // Panic based approach to setting things on disconnected nodes 92 | Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 93 | set: function( tween ) { 94 | if ( tween.elem.nodeType && tween.elem.parentNode ) { 95 | tween.elem[ tween.prop ] = tween.now; 96 | } 97 | } 98 | }; 99 | 100 | jQuery.easing = { 101 | linear: function( p ) { 102 | return p; 103 | }, 104 | swing: function( p ) { 105 | return 0.5 - Math.cos( p * Math.PI ) / 2; 106 | } 107 | }; 108 | 109 | jQuery.fx = Tween.prototype.init; 110 | 111 | // Back Compat <1.8 extension point 112 | jQuery.fx.step = {}; 113 | 114 | }); 115 | -------------------------------------------------------------------------------- /assets/jquery/src/serialize.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./manipulation/var/rcheckableType", 4 | "./core/init", 5 | "./traversing", // filter 6 | "./attributes/prop" 7 | ], function( jQuery, rcheckableType ) { 8 | 9 | var r20 = /%20/g, 10 | rbracket = /\[\]$/, 11 | rCRLF = /\r?\n/g, 12 | rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 13 | rsubmittable = /^(?:input|select|textarea|keygen)/i; 14 | 15 | function buildParams( prefix, obj, traditional, add ) { 16 | var name; 17 | 18 | if ( jQuery.isArray( obj ) ) { 19 | // Serialize array item. 20 | jQuery.each( obj, function( i, v ) { 21 | if ( traditional || rbracket.test( prefix ) ) { 22 | // Treat each array item as a scalar. 23 | add( prefix, v ); 24 | 25 | } else { 26 | // Item is non-scalar (array or object), encode its numeric index. 27 | buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); 28 | } 29 | }); 30 | 31 | } else if ( !traditional && jQuery.type( obj ) === "object" ) { 32 | // Serialize object item. 33 | for ( name in obj ) { 34 | buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 35 | } 36 | 37 | } else { 38 | // Serialize scalar item. 39 | add( prefix, obj ); 40 | } 41 | } 42 | 43 | // Serialize an array of form elements or a set of 44 | // key/values into a query string 45 | jQuery.param = function( a, traditional ) { 46 | var prefix, 47 | s = [], 48 | add = function( key, value ) { 49 | // If value is a function, invoke it and return its value 50 | value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); 51 | s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 52 | }; 53 | 54 | // Set traditional to true for jQuery <= 1.3.2 behavior. 55 | if ( traditional === undefined ) { 56 | traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 57 | } 58 | 59 | // If an array was passed in, assume that it is an array of form elements. 60 | if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 61 | // Serialize the form elements 62 | jQuery.each( a, function() { 63 | add( this.name, this.value ); 64 | }); 65 | 66 | } else { 67 | // If traditional, encode the "old" way (the way 1.3.2 or older 68 | // did it), otherwise encode params recursively. 69 | for ( prefix in a ) { 70 | buildParams( prefix, a[ prefix ], traditional, add ); 71 | } 72 | } 73 | 74 | // Return the resulting serialization 75 | return s.join( "&" ).replace( r20, "+" ); 76 | }; 77 | 78 | jQuery.fn.extend({ 79 | serialize: function() { 80 | return jQuery.param( this.serializeArray() ); 81 | }, 82 | serializeArray: function() { 83 | return this.map(function() { 84 | // Can add propHook for "elements" to filter or add form elements 85 | var elements = jQuery.prop( this, "elements" ); 86 | return elements ? jQuery.makeArray( elements ) : this; 87 | }) 88 | .filter(function() { 89 | var type = this.type; 90 | 91 | // Use .is( ":disabled" ) so that fieldset[disabled] works 92 | return this.name && !jQuery( this ).is( ":disabled" ) && 93 | rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 94 | ( this.checked || !rcheckableType.test( type ) ); 95 | }) 96 | .map(function( i, elem ) { 97 | var val = jQuery( this ).val(); 98 | 99 | return val == null ? 100 | null : 101 | jQuery.isArray( val ) ? 102 | jQuery.map( val, function( val ) { 103 | return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 104 | }) : 105 | { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 106 | }).get(); 107 | } 108 | }); 109 | 110 | return jQuery; 111 | }); 112 | -------------------------------------------------------------------------------- /assets/jquery/src/queue.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./data/var/data_priv", 4 | "./deferred", 5 | "./callbacks" 6 | ], function( jQuery, data_priv ) { 7 | 8 | jQuery.extend({ 9 | queue: function( elem, type, data ) { 10 | var queue; 11 | 12 | if ( elem ) { 13 | type = ( type || "fx" ) + "queue"; 14 | queue = data_priv.get( elem, type ); 15 | 16 | // Speed up dequeue by getting out quickly if this is just a lookup 17 | if ( data ) { 18 | if ( !queue || jQuery.isArray( data ) ) { 19 | queue = data_priv.access( elem, type, jQuery.makeArray(data) ); 20 | } else { 21 | queue.push( data ); 22 | } 23 | } 24 | return queue || []; 25 | } 26 | }, 27 | 28 | dequeue: function( elem, type ) { 29 | type = type || "fx"; 30 | 31 | var queue = jQuery.queue( elem, type ), 32 | startLength = queue.length, 33 | fn = queue.shift(), 34 | hooks = jQuery._queueHooks( elem, type ), 35 | next = function() { 36 | jQuery.dequeue( elem, type ); 37 | }; 38 | 39 | // If the fx queue is dequeued, always remove the progress sentinel 40 | if ( fn === "inprogress" ) { 41 | fn = queue.shift(); 42 | startLength--; 43 | } 44 | 45 | if ( fn ) { 46 | 47 | // Add a progress sentinel to prevent the fx queue from being 48 | // automatically dequeued 49 | if ( type === "fx" ) { 50 | queue.unshift( "inprogress" ); 51 | } 52 | 53 | // Clear up the last queue stop function 54 | delete hooks.stop; 55 | fn.call( elem, next, hooks ); 56 | } 57 | 58 | if ( !startLength && hooks ) { 59 | hooks.empty.fire(); 60 | } 61 | }, 62 | 63 | // Not public - generate a queueHooks object, or return the current one 64 | _queueHooks: function( elem, type ) { 65 | var key = type + "queueHooks"; 66 | return data_priv.get( elem, key ) || data_priv.access( elem, key, { 67 | empty: jQuery.Callbacks("once memory").add(function() { 68 | data_priv.remove( elem, [ type + "queue", key ] ); 69 | }) 70 | }); 71 | } 72 | }); 73 | 74 | jQuery.fn.extend({ 75 | queue: function( type, data ) { 76 | var setter = 2; 77 | 78 | if ( typeof type !== "string" ) { 79 | data = type; 80 | type = "fx"; 81 | setter--; 82 | } 83 | 84 | if ( arguments.length < setter ) { 85 | return jQuery.queue( this[0], type ); 86 | } 87 | 88 | return data === undefined ? 89 | this : 90 | this.each(function() { 91 | var queue = jQuery.queue( this, type, data ); 92 | 93 | // Ensure a hooks for this queue 94 | jQuery._queueHooks( this, type ); 95 | 96 | if ( type === "fx" && queue[0] !== "inprogress" ) { 97 | jQuery.dequeue( this, type ); 98 | } 99 | }); 100 | }, 101 | dequeue: function( type ) { 102 | return this.each(function() { 103 | jQuery.dequeue( this, type ); 104 | }); 105 | }, 106 | clearQueue: function( type ) { 107 | return this.queue( type || "fx", [] ); 108 | }, 109 | // Get a promise resolved when queues of a certain type 110 | // are emptied (fx is the type by default) 111 | promise: function( type, obj ) { 112 | var tmp, 113 | count = 1, 114 | defer = jQuery.Deferred(), 115 | elements = this, 116 | i = this.length, 117 | resolve = function() { 118 | if ( !( --count ) ) { 119 | defer.resolveWith( elements, [ elements ] ); 120 | } 121 | }; 122 | 123 | if ( typeof type !== "string" ) { 124 | obj = type; 125 | type = undefined; 126 | } 127 | type = type || "fx"; 128 | 129 | while ( i-- ) { 130 | tmp = data_priv.get( elements[ i ], type + "queueHooks" ); 131 | if ( tmp && tmp.empty ) { 132 | count++; 133 | tmp.empty.add( resolve ); 134 | } 135 | } 136 | resolve(); 137 | return defer.promise( obj ); 138 | } 139 | }); 140 | 141 | return jQuery; 142 | }); 143 | -------------------------------------------------------------------------------- /assets/jquery/src/core/init.js: -------------------------------------------------------------------------------- 1 | // Initialize a jQuery object 2 | define([ 3 | "../core", 4 | "./var/rsingleTag", 5 | "../traversing/findFilter" 6 | ], function( jQuery, rsingleTag ) { 7 | 8 | // A central reference to the root jQuery(document) 9 | var rootjQuery, 10 | 11 | // A simple way to check for HTML strings 12 | // Prioritize #id over to avoid XSS via location.hash (#9521) 13 | // Strict HTML recognition (#11290: must start with <) 14 | rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 15 | 16 | init = jQuery.fn.init = function( selector, context ) { 17 | var match, elem; 18 | 19 | // HANDLE: $(""), $(null), $(undefined), $(false) 20 | if ( !selector ) { 21 | return this; 22 | } 23 | 24 | // Handle HTML strings 25 | if ( typeof selector === "string" ) { 26 | if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { 27 | // Assume that strings that start and end with <> are HTML and skip the regex check 28 | match = [ null, selector, null ]; 29 | 30 | } else { 31 | match = rquickExpr.exec( selector ); 32 | } 33 | 34 | // Match html or make sure no context is specified for #id 35 | if ( match && (match[1] || !context) ) { 36 | 37 | // HANDLE: $(html) -> $(array) 38 | if ( match[1] ) { 39 | context = context instanceof jQuery ? context[0] : context; 40 | 41 | // Option to run scripts is true for back-compat 42 | // Intentionally let the error be thrown if parseHTML is not present 43 | jQuery.merge( this, jQuery.parseHTML( 44 | match[1], 45 | context && context.nodeType ? context.ownerDocument || context : document, 46 | true 47 | ) ); 48 | 49 | // HANDLE: $(html, props) 50 | if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { 51 | for ( match in context ) { 52 | // Properties of context are called as methods if possible 53 | if ( jQuery.isFunction( this[ match ] ) ) { 54 | this[ match ]( context[ match ] ); 55 | 56 | // ...and otherwise set as attributes 57 | } else { 58 | this.attr( match, context[ match ] ); 59 | } 60 | } 61 | } 62 | 63 | return this; 64 | 65 | // HANDLE: $(#id) 66 | } else { 67 | elem = document.getElementById( match[2] ); 68 | 69 | // Support: Blackberry 4.6 70 | // gEBID returns nodes no longer in the document (#6963) 71 | if ( elem && elem.parentNode ) { 72 | // Inject the element directly into the jQuery object 73 | this.length = 1; 74 | this[0] = elem; 75 | } 76 | 77 | this.context = document; 78 | this.selector = selector; 79 | return this; 80 | } 81 | 82 | // HANDLE: $(expr, $(...)) 83 | } else if ( !context || context.jquery ) { 84 | return ( context || rootjQuery ).find( selector ); 85 | 86 | // HANDLE: $(expr, context) 87 | // (which is just equivalent to: $(context).find(expr) 88 | } else { 89 | return this.constructor( context ).find( selector ); 90 | } 91 | 92 | // HANDLE: $(DOMElement) 93 | } else if ( selector.nodeType ) { 94 | this.context = this[0] = selector; 95 | this.length = 1; 96 | return this; 97 | 98 | // HANDLE: $(function) 99 | // Shortcut for document ready 100 | } else if ( jQuery.isFunction( selector ) ) { 101 | return typeof rootjQuery.ready !== "undefined" ? 102 | rootjQuery.ready( selector ) : 103 | // Execute immediately if ready is not present 104 | selector( jQuery ); 105 | } 106 | 107 | if ( selector.selector !== undefined ) { 108 | this.selector = selector.selector; 109 | this.context = selector.context; 110 | } 111 | 112 | return jQuery.makeArray( selector, this ); 113 | }; 114 | 115 | // Give the init function the jQuery prototype for later instantiation 116 | init.prototype = jQuery.fn; 117 | 118 | // Initialize central reference 119 | rootjQuery = jQuery( document ); 120 | 121 | return init; 122 | 123 | }); 124 | -------------------------------------------------------------------------------- /assets/jquery/src/attributes/attr.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../var/rnotwhite", 4 | "../var/strundefined", 5 | "../core/access", 6 | "./support", 7 | "../selector" 8 | ], function( jQuery, rnotwhite, strundefined, access, support ) { 9 | 10 | var nodeHook, boolHook, 11 | attrHandle = jQuery.expr.attrHandle; 12 | 13 | jQuery.fn.extend({ 14 | attr: function( name, value ) { 15 | return access( this, jQuery.attr, name, value, arguments.length > 1 ); 16 | }, 17 | 18 | removeAttr: function( name ) { 19 | return this.each(function() { 20 | jQuery.removeAttr( this, name ); 21 | }); 22 | } 23 | }); 24 | 25 | jQuery.extend({ 26 | attr: function( elem, name, value ) { 27 | var hooks, ret, 28 | nType = elem.nodeType; 29 | 30 | // don't get/set attributes on text, comment and attribute nodes 31 | if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 32 | return; 33 | } 34 | 35 | // Fallback to prop when attributes are not supported 36 | if ( typeof elem.getAttribute === strundefined ) { 37 | return jQuery.prop( elem, name, value ); 38 | } 39 | 40 | // All attributes are lowercase 41 | // Grab necessary hook if one is defined 42 | if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 43 | name = name.toLowerCase(); 44 | hooks = jQuery.attrHooks[ name ] || 45 | ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); 46 | } 47 | 48 | if ( value !== undefined ) { 49 | 50 | if ( value === null ) { 51 | jQuery.removeAttr( elem, name ); 52 | 53 | } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { 54 | return ret; 55 | 56 | } else { 57 | elem.setAttribute( name, value + "" ); 58 | return value; 59 | } 60 | 61 | } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { 62 | return ret; 63 | 64 | } else { 65 | ret = jQuery.find.attr( elem, name ); 66 | 67 | // Non-existent attributes return null, we normalize to undefined 68 | return ret == null ? 69 | undefined : 70 | ret; 71 | } 72 | }, 73 | 74 | removeAttr: function( elem, value ) { 75 | var name, propName, 76 | i = 0, 77 | attrNames = value && value.match( rnotwhite ); 78 | 79 | if ( attrNames && elem.nodeType === 1 ) { 80 | while ( (name = attrNames[i++]) ) { 81 | propName = jQuery.propFix[ name ] || name; 82 | 83 | // Boolean attributes get special treatment (#10870) 84 | if ( jQuery.expr.match.bool.test( name ) ) { 85 | // Set corresponding property to false 86 | elem[ propName ] = false; 87 | } 88 | 89 | elem.removeAttribute( name ); 90 | } 91 | } 92 | }, 93 | 94 | attrHooks: { 95 | type: { 96 | set: function( elem, value ) { 97 | if ( !support.radioValue && value === "radio" && 98 | jQuery.nodeName( elem, "input" ) ) { 99 | var val = elem.value; 100 | elem.setAttribute( "type", value ); 101 | if ( val ) { 102 | elem.value = val; 103 | } 104 | return value; 105 | } 106 | } 107 | } 108 | } 109 | }); 110 | 111 | // Hooks for boolean attributes 112 | boolHook = { 113 | set: function( elem, value, name ) { 114 | if ( value === false ) { 115 | // Remove boolean attributes when set to false 116 | jQuery.removeAttr( elem, name ); 117 | } else { 118 | elem.setAttribute( name, name ); 119 | } 120 | return name; 121 | } 122 | }; 123 | jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 124 | var getter = attrHandle[ name ] || jQuery.find.attr; 125 | 126 | attrHandle[ name ] = function( elem, name, isXML ) { 127 | var ret, handle; 128 | if ( !isXML ) { 129 | // Avoid an infinite loop by temporarily removing this function from the getter 130 | handle = attrHandle[ name ]; 131 | attrHandle[ name ] = ret; 132 | ret = getter( elem, name, isXML ) != null ? 133 | name.toLowerCase() : 134 | null; 135 | attrHandle[ name ] = handle; 136 | } 137 | return ret; 138 | }; 139 | }); 140 | 141 | }); 142 | -------------------------------------------------------------------------------- /assets/jquery/src/ajax/xhr.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../var/support", 4 | "../ajax" 5 | ], function( jQuery, support ) { 6 | 7 | jQuery.ajaxSettings.xhr = function() { 8 | try { 9 | return new XMLHttpRequest(); 10 | } catch( e ) {} 11 | }; 12 | 13 | var xhrId = 0, 14 | xhrCallbacks = {}, 15 | xhrSuccessStatus = { 16 | // file protocol always yields status code 0, assume 200 17 | 0: 200, 18 | // Support: IE9 19 | // #1450: sometimes IE returns 1223 when it should be 204 20 | 1223: 204 21 | }, 22 | xhrSupported = jQuery.ajaxSettings.xhr(); 23 | 24 | // Support: IE9 25 | // Open requests must be manually aborted on unload (#5280) 26 | // See https://support.microsoft.com/kb/2856746 for more info 27 | if ( window.attachEvent ) { 28 | window.attachEvent( "onunload", function() { 29 | for ( var key in xhrCallbacks ) { 30 | xhrCallbacks[ key ](); 31 | } 32 | }); 33 | } 34 | 35 | support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 36 | support.ajax = xhrSupported = !!xhrSupported; 37 | 38 | jQuery.ajaxTransport(function( options ) { 39 | var callback; 40 | 41 | // Cross domain only allowed if supported through XMLHttpRequest 42 | if ( support.cors || xhrSupported && !options.crossDomain ) { 43 | return { 44 | send: function( headers, complete ) { 45 | var i, 46 | xhr = options.xhr(), 47 | id = ++xhrId; 48 | 49 | xhr.open( options.type, options.url, options.async, options.username, options.password ); 50 | 51 | // Apply custom fields if provided 52 | if ( options.xhrFields ) { 53 | for ( i in options.xhrFields ) { 54 | xhr[ i ] = options.xhrFields[ i ]; 55 | } 56 | } 57 | 58 | // Override mime type if needed 59 | if ( options.mimeType && xhr.overrideMimeType ) { 60 | xhr.overrideMimeType( options.mimeType ); 61 | } 62 | 63 | // X-Requested-With header 64 | // For cross-domain requests, seeing as conditions for a preflight are 65 | // akin to a jigsaw puzzle, we simply never set it to be sure. 66 | // (it can always be set on a per-request basis or even using ajaxSetup) 67 | // For same-domain requests, won't change header if already provided. 68 | if ( !options.crossDomain && !headers["X-Requested-With"] ) { 69 | headers["X-Requested-With"] = "XMLHttpRequest"; 70 | } 71 | 72 | // Set headers 73 | for ( i in headers ) { 74 | xhr.setRequestHeader( i, headers[ i ] ); 75 | } 76 | 77 | // Callback 78 | callback = function( type ) { 79 | return function() { 80 | if ( callback ) { 81 | delete xhrCallbacks[ id ]; 82 | callback = xhr.onload = xhr.onerror = null; 83 | 84 | if ( type === "abort" ) { 85 | xhr.abort(); 86 | } else if ( type === "error" ) { 87 | complete( 88 | // file: protocol always yields status 0; see #8605, #14207 89 | xhr.status, 90 | xhr.statusText 91 | ); 92 | } else { 93 | complete( 94 | xhrSuccessStatus[ xhr.status ] || xhr.status, 95 | xhr.statusText, 96 | // Support: IE9 97 | // Accessing binary-data responseText throws an exception 98 | // (#11426) 99 | typeof xhr.responseText === "string" ? { 100 | text: xhr.responseText 101 | } : undefined, 102 | xhr.getAllResponseHeaders() 103 | ); 104 | } 105 | } 106 | }; 107 | }; 108 | 109 | // Listen to events 110 | xhr.onload = callback(); 111 | xhr.onerror = callback("error"); 112 | 113 | // Create the abort callback 114 | callback = xhrCallbacks[ id ] = callback("abort"); 115 | 116 | try { 117 | // Do send the request (this may raise an exception) 118 | xhr.send( options.hasContent && options.data || null ); 119 | } catch ( e ) { 120 | // #14683: Only rethrow if this hasn't been notified as an error yet 121 | if ( callback ) { 122 | throw e; 123 | } 124 | } 125 | }, 126 | 127 | abort: function() { 128 | if ( callback ) { 129 | callback(); 130 | } 131 | } 132 | }; 133 | } 134 | }); 135 | 136 | }); 137 | -------------------------------------------------------------------------------- /assets/marked/bin/marked: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Marked CLI 5 | * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) 6 | */ 7 | 8 | var fs = require('fs') 9 | , util = require('util') 10 | , marked = require('../'); 11 | 12 | /** 13 | * Man Page 14 | */ 15 | 16 | function help() { 17 | var spawn = require('child_process').spawn; 18 | 19 | var options = { 20 | cwd: process.cwd(), 21 | env: process.env, 22 | setsid: false, 23 | customFds: [0, 1, 2] 24 | }; 25 | 26 | spawn('man', 27 | [__dirname + '/../man/marked.1'], 28 | options); 29 | } 30 | 31 | /** 32 | * Main 33 | */ 34 | 35 | function main(argv, callback) { 36 | var files = [] 37 | , options = {} 38 | , input 39 | , output 40 | , arg 41 | , tokens 42 | , opt; 43 | 44 | function getarg() { 45 | var arg = argv.shift(); 46 | 47 | if (arg.indexOf('--') === 0) { 48 | // e.g. --opt 49 | arg = arg.split('='); 50 | if (arg.length > 1) { 51 | // e.g. --opt=val 52 | argv.unshift(arg.slice(1).join('=')); 53 | } 54 | arg = arg[0]; 55 | } else if (arg[0] === '-') { 56 | if (arg.length > 2) { 57 | // e.g. -abc 58 | argv = arg.substring(1).split('').map(function(ch) { 59 | return '-' + ch; 60 | }).concat(argv); 61 | arg = argv.shift(); 62 | } else { 63 | // e.g. -a 64 | } 65 | } else { 66 | // e.g. foo 67 | } 68 | 69 | return arg; 70 | } 71 | 72 | while (argv.length) { 73 | arg = getarg(); 74 | switch (arg) { 75 | case '--test': 76 | return require('../test').main(process.argv.slice()); 77 | case '-o': 78 | case '--output': 79 | output = argv.shift(); 80 | break; 81 | case '-i': 82 | case '--input': 83 | input = argv.shift(); 84 | break; 85 | case '-t': 86 | case '--tokens': 87 | tokens = true; 88 | break; 89 | case '-h': 90 | case '--help': 91 | return help(); 92 | default: 93 | if (arg.indexOf('--') === 0) { 94 | opt = camelize(arg.replace(/^--(no-)?/, '')); 95 | if (!marked.defaults.hasOwnProperty(opt)) { 96 | continue; 97 | } 98 | if (arg.indexOf('--no-') === 0) { 99 | options[opt] = typeof marked.defaults[opt] !== 'boolean' 100 | ? null 101 | : false; 102 | } else { 103 | options[opt] = typeof marked.defaults[opt] !== 'boolean' 104 | ? argv.shift() 105 | : true; 106 | } 107 | } else { 108 | files.push(arg); 109 | } 110 | break; 111 | } 112 | } 113 | 114 | function getData(callback) { 115 | if (!input) { 116 | if (files.length <= 2) { 117 | return getStdin(callback); 118 | } 119 | input = files.pop(); 120 | } 121 | return fs.readFile(input, 'utf8', callback); 122 | } 123 | 124 | return getData(function(err, data) { 125 | if (err) return callback(err); 126 | 127 | data = tokens 128 | ? JSON.stringify(marked.lexer(data, options), null, 2) 129 | : marked(data, options); 130 | 131 | if (!output) { 132 | process.stdout.write(data + '\n'); 133 | return callback(); 134 | } 135 | 136 | return fs.writeFile(output, data, callback); 137 | }); 138 | } 139 | 140 | /** 141 | * Helpers 142 | */ 143 | 144 | function getStdin(callback) { 145 | var stdin = process.stdin 146 | , buff = ''; 147 | 148 | stdin.setEncoding('utf8'); 149 | 150 | stdin.on('data', function(data) { 151 | buff += data; 152 | }); 153 | 154 | stdin.on('error', function(err) { 155 | return callback(err); 156 | }); 157 | 158 | stdin.on('end', function() { 159 | return callback(null, buff); 160 | }); 161 | 162 | try { 163 | stdin.resume(); 164 | } catch (e) { 165 | callback(e); 166 | } 167 | } 168 | 169 | function camelize(text) { 170 | return text.replace(/(\w)-(\w)/g, function(_, a, b) { 171 | return a + b.toUpperCase(); 172 | }); 173 | } 174 | 175 | /** 176 | * Expose / Entry Point 177 | */ 178 | 179 | if (!module.parent) { 180 | process.title = 'marked'; 181 | main(process.argv.slice(), function(err, code) { 182 | if (err) throw err; 183 | return process.exit(code || 0); 184 | }); 185 | } else { 186 | module.exports = main; 187 | } 188 | -------------------------------------------------------------------------------- /assets/jquery/src/attributes/val.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "./support", 4 | "../core/init" 5 | ], function( jQuery, support ) { 6 | 7 | var rreturn = /\r/g; 8 | 9 | jQuery.fn.extend({ 10 | val: function( value ) { 11 | var hooks, ret, isFunction, 12 | elem = this[0]; 13 | 14 | if ( !arguments.length ) { 15 | if ( elem ) { 16 | hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 17 | 18 | if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { 19 | return ret; 20 | } 21 | 22 | ret = elem.value; 23 | 24 | return typeof ret === "string" ? 25 | // Handle most common string cases 26 | ret.replace(rreturn, "") : 27 | // Handle cases where value is null/undef or number 28 | ret == null ? "" : ret; 29 | } 30 | 31 | return; 32 | } 33 | 34 | isFunction = jQuery.isFunction( value ); 35 | 36 | return this.each(function( i ) { 37 | var val; 38 | 39 | if ( this.nodeType !== 1 ) { 40 | return; 41 | } 42 | 43 | if ( isFunction ) { 44 | val = value.call( this, i, jQuery( this ).val() ); 45 | } else { 46 | val = value; 47 | } 48 | 49 | // Treat null/undefined as ""; convert numbers to string 50 | if ( val == null ) { 51 | val = ""; 52 | 53 | } else if ( typeof val === "number" ) { 54 | val += ""; 55 | 56 | } else if ( jQuery.isArray( val ) ) { 57 | val = jQuery.map( val, function( value ) { 58 | return value == null ? "" : value + ""; 59 | }); 60 | } 61 | 62 | hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 63 | 64 | // If set returns undefined, fall back to normal setting 65 | if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { 66 | this.value = val; 67 | } 68 | }); 69 | } 70 | }); 71 | 72 | jQuery.extend({ 73 | valHooks: { 74 | option: { 75 | get: function( elem ) { 76 | var val = jQuery.find.attr( elem, "value" ); 77 | return val != null ? 78 | val : 79 | // Support: IE10-11+ 80 | // option.text throws exceptions (#14686, #14858) 81 | jQuery.trim( jQuery.text( elem ) ); 82 | } 83 | }, 84 | select: { 85 | get: function( elem ) { 86 | var value, option, 87 | options = elem.options, 88 | index = elem.selectedIndex, 89 | one = elem.type === "select-one" || index < 0, 90 | values = one ? null : [], 91 | max = one ? index + 1 : options.length, 92 | i = index < 0 ? 93 | max : 94 | one ? index : 0; 95 | 96 | // Loop through all the selected options 97 | for ( ; i < max; i++ ) { 98 | option = options[ i ]; 99 | 100 | // IE6-9 doesn't update selected after form reset (#2551) 101 | if ( ( option.selected || i === index ) && 102 | // Don't return options that are disabled or in a disabled optgroup 103 | ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) && 104 | ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 105 | 106 | // Get the specific value for the option 107 | value = jQuery( option ).val(); 108 | 109 | // We don't need an array for one selects 110 | if ( one ) { 111 | return value; 112 | } 113 | 114 | // Multi-Selects return an array 115 | values.push( value ); 116 | } 117 | } 118 | 119 | return values; 120 | }, 121 | 122 | set: function( elem, value ) { 123 | var optionSet, option, 124 | options = elem.options, 125 | values = jQuery.makeArray( value ), 126 | i = options.length; 127 | 128 | while ( i-- ) { 129 | option = options[ i ]; 130 | if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) { 131 | optionSet = true; 132 | } 133 | } 134 | 135 | // Force browsers to behave consistently when non-matching value is set 136 | if ( !optionSet ) { 137 | elem.selectedIndex = -1; 138 | } 139 | return values; 140 | } 141 | } 142 | } 143 | }); 144 | 145 | // Radios and checkboxes getter/setter 146 | jQuery.each([ "radio", "checkbox" ], function() { 147 | jQuery.valHooks[ this ] = { 148 | set: function( elem, value ) { 149 | if ( jQuery.isArray( value ) ) { 150 | return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); 151 | } 152 | } 153 | }; 154 | if ( !support.checkOn ) { 155 | jQuery.valHooks[ this ].get = function( elem ) { 156 | return elem.getAttribute("value") === null ? "on" : elem.value; 157 | }; 158 | } 159 | }); 160 | 161 | }); 162 | -------------------------------------------------------------------------------- /assets/jquery/src/attributes/classes.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../var/rnotwhite", 4 | "../var/strundefined", 5 | "../data/var/data_priv", 6 | "../core/init" 7 | ], function( jQuery, rnotwhite, strundefined, data_priv ) { 8 | 9 | var rclass = /[\t\r\n\f]/g; 10 | 11 | jQuery.fn.extend({ 12 | addClass: function( value ) { 13 | var classes, elem, cur, clazz, j, finalValue, 14 | proceed = typeof value === "string" && value, 15 | i = 0, 16 | len = this.length; 17 | 18 | if ( jQuery.isFunction( value ) ) { 19 | return this.each(function( j ) { 20 | jQuery( this ).addClass( value.call( this, j, this.className ) ); 21 | }); 22 | } 23 | 24 | if ( proceed ) { 25 | // The disjunction here is for better compressibility (see removeClass) 26 | classes = ( value || "" ).match( rnotwhite ) || []; 27 | 28 | for ( ; i < len; i++ ) { 29 | elem = this[ i ]; 30 | cur = elem.nodeType === 1 && ( elem.className ? 31 | ( " " + elem.className + " " ).replace( rclass, " " ) : 32 | " " 33 | ); 34 | 35 | if ( cur ) { 36 | j = 0; 37 | while ( (clazz = classes[j++]) ) { 38 | if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 39 | cur += clazz + " "; 40 | } 41 | } 42 | 43 | // only assign if different to avoid unneeded rendering. 44 | finalValue = jQuery.trim( cur ); 45 | if ( elem.className !== finalValue ) { 46 | elem.className = finalValue; 47 | } 48 | } 49 | } 50 | } 51 | 52 | return this; 53 | }, 54 | 55 | removeClass: function( value ) { 56 | var classes, elem, cur, clazz, j, finalValue, 57 | proceed = arguments.length === 0 || typeof value === "string" && value, 58 | i = 0, 59 | len = this.length; 60 | 61 | if ( jQuery.isFunction( value ) ) { 62 | return this.each(function( j ) { 63 | jQuery( this ).removeClass( value.call( this, j, this.className ) ); 64 | }); 65 | } 66 | if ( proceed ) { 67 | classes = ( value || "" ).match( rnotwhite ) || []; 68 | 69 | for ( ; i < len; i++ ) { 70 | elem = this[ i ]; 71 | // This expression is here for better compressibility (see addClass) 72 | cur = elem.nodeType === 1 && ( elem.className ? 73 | ( " " + elem.className + " " ).replace( rclass, " " ) : 74 | "" 75 | ); 76 | 77 | if ( cur ) { 78 | j = 0; 79 | while ( (clazz = classes[j++]) ) { 80 | // Remove *all* instances 81 | while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { 82 | cur = cur.replace( " " + clazz + " ", " " ); 83 | } 84 | } 85 | 86 | // Only assign if different to avoid unneeded rendering. 87 | finalValue = value ? jQuery.trim( cur ) : ""; 88 | if ( elem.className !== finalValue ) { 89 | elem.className = finalValue; 90 | } 91 | } 92 | } 93 | } 94 | 95 | return this; 96 | }, 97 | 98 | toggleClass: function( value, stateVal ) { 99 | var type = typeof value; 100 | 101 | if ( typeof stateVal === "boolean" && type === "string" ) { 102 | return stateVal ? this.addClass( value ) : this.removeClass( value ); 103 | } 104 | 105 | if ( jQuery.isFunction( value ) ) { 106 | return this.each(function( i ) { 107 | jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); 108 | }); 109 | } 110 | 111 | return this.each(function() { 112 | if ( type === "string" ) { 113 | // Toggle individual class names 114 | var className, 115 | i = 0, 116 | self = jQuery( this ), 117 | classNames = value.match( rnotwhite ) || []; 118 | 119 | while ( (className = classNames[ i++ ]) ) { 120 | // Check each className given, space separated list 121 | if ( self.hasClass( className ) ) { 122 | self.removeClass( className ); 123 | } else { 124 | self.addClass( className ); 125 | } 126 | } 127 | 128 | // Toggle whole class name 129 | } else if ( type === strundefined || type === "boolean" ) { 130 | if ( this.className ) { 131 | // store className if set 132 | data_priv.set( this, "__className__", this.className ); 133 | } 134 | 135 | // If the element has a class name or if we're passed `false`, 136 | // then remove the whole classname (if there was one, the above saved it). 137 | // Otherwise bring back whatever was previously saved (if anything), 138 | // falling back to the empty string if nothing was stored. 139 | this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || ""; 140 | } 141 | }); 142 | }, 143 | 144 | hasClass: function( selector ) { 145 | var className = " " + selector + " ", 146 | i = 0, 147 | l = this.length; 148 | for ( ; i < l; i++ ) { 149 | if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { 150 | return true; 151 | } 152 | } 153 | 154 | return false; 155 | } 156 | }); 157 | 158 | }); 159 | -------------------------------------------------------------------------------- /assets/jquery/src/deferred.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./var/slice", 4 | "./callbacks" 5 | ], function( jQuery, slice ) { 6 | 7 | jQuery.extend({ 8 | 9 | Deferred: function( func ) { 10 | var tuples = [ 11 | // action, add listener, listener list, final state 12 | [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], 13 | [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], 14 | [ "notify", "progress", jQuery.Callbacks("memory") ] 15 | ], 16 | state = "pending", 17 | promise = { 18 | state: function() { 19 | return state; 20 | }, 21 | always: function() { 22 | deferred.done( arguments ).fail( arguments ); 23 | return this; 24 | }, 25 | then: function( /* fnDone, fnFail, fnProgress */ ) { 26 | var fns = arguments; 27 | return jQuery.Deferred(function( newDefer ) { 28 | jQuery.each( tuples, function( i, tuple ) { 29 | var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 30 | // deferred[ done | fail | progress ] for forwarding actions to newDefer 31 | deferred[ tuple[1] ](function() { 32 | var returned = fn && fn.apply( this, arguments ); 33 | if ( returned && jQuery.isFunction( returned.promise ) ) { 34 | returned.promise() 35 | .done( newDefer.resolve ) 36 | .fail( newDefer.reject ) 37 | .progress( newDefer.notify ); 38 | } else { 39 | newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); 40 | } 41 | }); 42 | }); 43 | fns = null; 44 | }).promise(); 45 | }, 46 | // Get a promise for this deferred 47 | // If obj is provided, the promise aspect is added to the object 48 | promise: function( obj ) { 49 | return obj != null ? jQuery.extend( obj, promise ) : promise; 50 | } 51 | }, 52 | deferred = {}; 53 | 54 | // Keep pipe for back-compat 55 | promise.pipe = promise.then; 56 | 57 | // Add list-specific methods 58 | jQuery.each( tuples, function( i, tuple ) { 59 | var list = tuple[ 2 ], 60 | stateString = tuple[ 3 ]; 61 | 62 | // promise[ done | fail | progress ] = list.add 63 | promise[ tuple[1] ] = list.add; 64 | 65 | // Handle state 66 | if ( stateString ) { 67 | list.add(function() { 68 | // state = [ resolved | rejected ] 69 | state = stateString; 70 | 71 | // [ reject_list | resolve_list ].disable; progress_list.lock 72 | }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 73 | } 74 | 75 | // deferred[ resolve | reject | notify ] 76 | deferred[ tuple[0] ] = function() { 77 | deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); 78 | return this; 79 | }; 80 | deferred[ tuple[0] + "With" ] = list.fireWith; 81 | }); 82 | 83 | // Make the deferred a promise 84 | promise.promise( deferred ); 85 | 86 | // Call given func if any 87 | if ( func ) { 88 | func.call( deferred, deferred ); 89 | } 90 | 91 | // All done! 92 | return deferred; 93 | }, 94 | 95 | // Deferred helper 96 | when: function( subordinate /* , ..., subordinateN */ ) { 97 | var i = 0, 98 | resolveValues = slice.call( arguments ), 99 | length = resolveValues.length, 100 | 101 | // the count of uncompleted subordinates 102 | remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, 103 | 104 | // the master Deferred. If resolveValues consist of only a single Deferred, just use that. 105 | deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 106 | 107 | // Update function for both resolve and progress values 108 | updateFunc = function( i, contexts, values ) { 109 | return function( value ) { 110 | contexts[ i ] = this; 111 | values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 112 | if ( values === progressValues ) { 113 | deferred.notifyWith( contexts, values ); 114 | } else if ( !( --remaining ) ) { 115 | deferred.resolveWith( contexts, values ); 116 | } 117 | }; 118 | }, 119 | 120 | progressValues, progressContexts, resolveContexts; 121 | 122 | // Add listeners to Deferred subordinates; treat others as resolved 123 | if ( length > 1 ) { 124 | progressValues = new Array( length ); 125 | progressContexts = new Array( length ); 126 | resolveContexts = new Array( length ); 127 | for ( ; i < length; i++ ) { 128 | if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { 129 | resolveValues[ i ].promise() 130 | .done( updateFunc( i, resolveContexts, resolveValues ) ) 131 | .fail( deferred.reject ) 132 | .progress( updateFunc( i, progressContexts, progressValues ) ); 133 | } else { 134 | --remaining; 135 | } 136 | } 137 | } 138 | 139 | // If we're not waiting on anything, resolve the master 140 | if ( !remaining ) { 141 | deferred.resolveWith( resolveContexts, resolveValues ); 142 | } 143 | 144 | return deferred.promise(); 145 | } 146 | }); 147 | 148 | return jQuery; 149 | }); 150 | -------------------------------------------------------------------------------- /assets/jquery/src/selector-native.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core" 3 | ], function( jQuery ) { 4 | 5 | /* 6 | * Optional (non-Sizzle) selector module for custom builds. 7 | * 8 | * Note that this DOES NOT SUPPORT many documented jQuery 9 | * features in exchange for its smaller size: 10 | * 11 | * Attribute not equal selector 12 | * Positional selectors (:first; :eq(n); :odd; etc.) 13 | * Type selectors (:input; :checkbox; :button; etc.) 14 | * State-based selectors (:animated; :visible; :hidden; etc.) 15 | * :has(selector) 16 | * :not(complex selector) 17 | * custom selectors via Sizzle extensions 18 | * Leading combinators (e.g., $collection.find("> *")) 19 | * Reliable functionality on XML fragments 20 | * Requiring all parts of a selector to match elements under context 21 | * (e.g., $div.find("div > *") now matches children of $div) 22 | * Matching against non-elements 23 | * Reliable sorting of disconnected nodes 24 | * querySelectorAll bug fixes (e.g., unreliable :focus on WebKit) 25 | * 26 | * If any of these are unacceptable tradeoffs, either use Sizzle or 27 | * customize this stub for the project's specific needs. 28 | */ 29 | 30 | var docElem = window.document.documentElement, 31 | selector_hasDuplicate, 32 | matches = docElem.matches || 33 | docElem.webkitMatchesSelector || 34 | docElem.mozMatchesSelector || 35 | docElem.oMatchesSelector || 36 | docElem.msMatchesSelector, 37 | selector_sortOrder = function( a, b ) { 38 | // Flag for duplicate removal 39 | if ( a === b ) { 40 | selector_hasDuplicate = true; 41 | return 0; 42 | } 43 | 44 | var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); 45 | 46 | if ( compare ) { 47 | // Disconnected nodes 48 | if ( compare & 1 ) { 49 | 50 | // Choose the first element that is related to our document 51 | if ( a === document || jQuery.contains(document, a) ) { 52 | return -1; 53 | } 54 | if ( b === document || jQuery.contains(document, b) ) { 55 | return 1; 56 | } 57 | 58 | // Maintain original order 59 | return 0; 60 | } 61 | 62 | return compare & 4 ? -1 : 1; 63 | } 64 | 65 | // Not directly comparable, sort on existence of method 66 | return a.compareDocumentPosition ? -1 : 1; 67 | }; 68 | 69 | jQuery.extend({ 70 | find: function( selector, context, results, seed ) { 71 | var elem, nodeType, 72 | i = 0; 73 | 74 | results = results || []; 75 | context = context || document; 76 | 77 | // Same basic safeguard as Sizzle 78 | if ( !selector || typeof selector !== "string" ) { 79 | return results; 80 | } 81 | 82 | // Early return if context is not an element or document 83 | if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { 84 | return []; 85 | } 86 | 87 | if ( seed ) { 88 | while ( (elem = seed[i++]) ) { 89 | if ( jQuery.find.matchesSelector(elem, selector) ) { 90 | results.push( elem ); 91 | } 92 | } 93 | } else { 94 | jQuery.merge( results, context.querySelectorAll(selector) ); 95 | } 96 | 97 | return results; 98 | }, 99 | unique: function( results ) { 100 | var elem, 101 | duplicates = [], 102 | i = 0, 103 | j = 0; 104 | 105 | selector_hasDuplicate = false; 106 | results.sort( selector_sortOrder ); 107 | 108 | if ( selector_hasDuplicate ) { 109 | while ( (elem = results[i++]) ) { 110 | if ( elem === results[ i ] ) { 111 | j = duplicates.push( i ); 112 | } 113 | } 114 | while ( j-- ) { 115 | results.splice( duplicates[ j ], 1 ); 116 | } 117 | } 118 | 119 | return results; 120 | }, 121 | text: function( elem ) { 122 | var node, 123 | ret = "", 124 | i = 0, 125 | nodeType = elem.nodeType; 126 | 127 | if ( !nodeType ) { 128 | // If no nodeType, this is expected to be an array 129 | while ( (node = elem[i++]) ) { 130 | // Do not traverse comment nodes 131 | ret += jQuery.text( node ); 132 | } 133 | } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 134 | // Use textContent for elements 135 | return elem.textContent; 136 | } else if ( nodeType === 3 || nodeType === 4 ) { 137 | return elem.nodeValue; 138 | } 139 | // Do not include comment or processing instruction nodes 140 | 141 | return ret; 142 | }, 143 | contains: function( a, b ) { 144 | var adown = a.nodeType === 9 ? a.documentElement : a, 145 | bup = b && b.parentNode; 146 | return a === bup || !!( bup && bup.nodeType === 1 && adown.contains(bup) ); 147 | }, 148 | isXMLDoc: function( elem ) { 149 | return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML"; 150 | }, 151 | expr: { 152 | attrHandle: {}, 153 | match: { 154 | bool: /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i, 155 | needsContext: /^[\x20\t\r\n\f]*[>+~]/ 156 | } 157 | } 158 | }); 159 | 160 | jQuery.extend( jQuery.find, { 161 | matches: function( expr, elements ) { 162 | return jQuery.find( expr, null, null, elements ); 163 | }, 164 | matchesSelector: function( elem, expr ) { 165 | return matches.call( elem, expr ); 166 | }, 167 | attr: function( elem, name ) { 168 | return elem.getAttribute( name ); 169 | } 170 | }); 171 | 172 | }); 173 | -------------------------------------------------------------------------------- /assets/jquery/src/traversing.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./var/indexOf", 4 | "./traversing/var/rneedsContext", 5 | "./core/init", 6 | "./traversing/findFilter", 7 | "./selector" 8 | ], function( jQuery, indexOf, rneedsContext ) { 9 | 10 | var rparentsprev = /^(?:parents|prev(?:Until|All))/, 11 | // Methods guaranteed to produce a unique set when starting from a unique set 12 | guaranteedUnique = { 13 | children: true, 14 | contents: true, 15 | next: true, 16 | prev: true 17 | }; 18 | 19 | jQuery.extend({ 20 | dir: function( elem, dir, until ) { 21 | var matched = [], 22 | truncate = until !== undefined; 23 | 24 | while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { 25 | if ( elem.nodeType === 1 ) { 26 | if ( truncate && jQuery( elem ).is( until ) ) { 27 | break; 28 | } 29 | matched.push( elem ); 30 | } 31 | } 32 | return matched; 33 | }, 34 | 35 | sibling: function( n, elem ) { 36 | var matched = []; 37 | 38 | for ( ; n; n = n.nextSibling ) { 39 | if ( n.nodeType === 1 && n !== elem ) { 40 | matched.push( n ); 41 | } 42 | } 43 | 44 | return matched; 45 | } 46 | }); 47 | 48 | jQuery.fn.extend({ 49 | has: function( target ) { 50 | var targets = jQuery( target, this ), 51 | l = targets.length; 52 | 53 | return this.filter(function() { 54 | var i = 0; 55 | for ( ; i < l; i++ ) { 56 | if ( jQuery.contains( this, targets[i] ) ) { 57 | return true; 58 | } 59 | } 60 | }); 61 | }, 62 | 63 | closest: function( selectors, context ) { 64 | var cur, 65 | i = 0, 66 | l = this.length, 67 | matched = [], 68 | pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? 69 | jQuery( selectors, context || this.context ) : 70 | 0; 71 | 72 | for ( ; i < l; i++ ) { 73 | for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { 74 | // Always skip document fragments 75 | if ( cur.nodeType < 11 && (pos ? 76 | pos.index(cur) > -1 : 77 | 78 | // Don't pass non-elements to Sizzle 79 | cur.nodeType === 1 && 80 | jQuery.find.matchesSelector(cur, selectors)) ) { 81 | 82 | matched.push( cur ); 83 | break; 84 | } 85 | } 86 | } 87 | 88 | return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); 89 | }, 90 | 91 | // Determine the position of an element within the set 92 | index: function( elem ) { 93 | 94 | // No argument, return index in parent 95 | if ( !elem ) { 96 | return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 97 | } 98 | 99 | // Index in selector 100 | if ( typeof elem === "string" ) { 101 | return indexOf.call( jQuery( elem ), this[ 0 ] ); 102 | } 103 | 104 | // Locate the position of the desired element 105 | return indexOf.call( this, 106 | 107 | // If it receives a jQuery object, the first element is used 108 | elem.jquery ? elem[ 0 ] : elem 109 | ); 110 | }, 111 | 112 | add: function( selector, context ) { 113 | return this.pushStack( 114 | jQuery.unique( 115 | jQuery.merge( this.get(), jQuery( selector, context ) ) 116 | ) 117 | ); 118 | }, 119 | 120 | addBack: function( selector ) { 121 | return this.add( selector == null ? 122 | this.prevObject : this.prevObject.filter(selector) 123 | ); 124 | } 125 | }); 126 | 127 | function sibling( cur, dir ) { 128 | while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} 129 | return cur; 130 | } 131 | 132 | jQuery.each({ 133 | parent: function( elem ) { 134 | var parent = elem.parentNode; 135 | return parent && parent.nodeType !== 11 ? parent : null; 136 | }, 137 | parents: function( elem ) { 138 | return jQuery.dir( elem, "parentNode" ); 139 | }, 140 | parentsUntil: function( elem, i, until ) { 141 | return jQuery.dir( elem, "parentNode", until ); 142 | }, 143 | next: function( elem ) { 144 | return sibling( elem, "nextSibling" ); 145 | }, 146 | prev: function( elem ) { 147 | return sibling( elem, "previousSibling" ); 148 | }, 149 | nextAll: function( elem ) { 150 | return jQuery.dir( elem, "nextSibling" ); 151 | }, 152 | prevAll: function( elem ) { 153 | return jQuery.dir( elem, "previousSibling" ); 154 | }, 155 | nextUntil: function( elem, i, until ) { 156 | return jQuery.dir( elem, "nextSibling", until ); 157 | }, 158 | prevUntil: function( elem, i, until ) { 159 | return jQuery.dir( elem, "previousSibling", until ); 160 | }, 161 | siblings: function( elem ) { 162 | return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); 163 | }, 164 | children: function( elem ) { 165 | return jQuery.sibling( elem.firstChild ); 166 | }, 167 | contents: function( elem ) { 168 | return elem.contentDocument || jQuery.merge( [], elem.childNodes ); 169 | } 170 | }, function( name, fn ) { 171 | jQuery.fn[ name ] = function( until, selector ) { 172 | var matched = jQuery.map( this, fn, until ); 173 | 174 | if ( name.slice( -5 ) !== "Until" ) { 175 | selector = until; 176 | } 177 | 178 | if ( selector && typeof selector === "string" ) { 179 | matched = jQuery.filter( selector, matched ); 180 | } 181 | 182 | if ( this.length > 1 ) { 183 | // Remove duplicates 184 | if ( !guaranteedUnique[ name ] ) { 185 | jQuery.unique( matched ); 186 | } 187 | 188 | // Reverse order for parents* and prev-derivatives 189 | if ( rparentsprev.test( name ) ) { 190 | matched.reverse(); 191 | } 192 | } 193 | 194 | return this.pushStack( matched ); 195 | }; 196 | }); 197 | 198 | return jQuery; 199 | }); 200 | -------------------------------------------------------------------------------- /assets/jquery/src/data/Data.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../var/rnotwhite", 4 | "./accepts" 5 | ], function( jQuery, rnotwhite ) { 6 | 7 | function Data() { 8 | // Support: Android<4, 9 | // Old WebKit does not have Object.preventExtensions/freeze method, 10 | // return new empty object instead with no [[set]] accessor 11 | Object.defineProperty( this.cache = {}, 0, { 12 | get: function() { 13 | return {}; 14 | } 15 | }); 16 | 17 | this.expando = jQuery.expando + Data.uid++; 18 | } 19 | 20 | Data.uid = 1; 21 | Data.accepts = jQuery.acceptData; 22 | 23 | Data.prototype = { 24 | key: function( owner ) { 25 | // We can accept data for non-element nodes in modern browsers, 26 | // but we should not, see #8335. 27 | // Always return the key for a frozen object. 28 | if ( !Data.accepts( owner ) ) { 29 | return 0; 30 | } 31 | 32 | var descriptor = {}, 33 | // Check if the owner object already has a cache key 34 | unlock = owner[ this.expando ]; 35 | 36 | // If not, create one 37 | if ( !unlock ) { 38 | unlock = Data.uid++; 39 | 40 | // Secure it in a non-enumerable, non-writable property 41 | try { 42 | descriptor[ this.expando ] = { value: unlock }; 43 | Object.defineProperties( owner, descriptor ); 44 | 45 | // Support: Android<4 46 | // Fallback to a less secure definition 47 | } catch ( e ) { 48 | descriptor[ this.expando ] = unlock; 49 | jQuery.extend( owner, descriptor ); 50 | } 51 | } 52 | 53 | // Ensure the cache object 54 | if ( !this.cache[ unlock ] ) { 55 | this.cache[ unlock ] = {}; 56 | } 57 | 58 | return unlock; 59 | }, 60 | set: function( owner, data, value ) { 61 | var prop, 62 | // There may be an unlock assigned to this node, 63 | // if there is no entry for this "owner", create one inline 64 | // and set the unlock as though an owner entry had always existed 65 | unlock = this.key( owner ), 66 | cache = this.cache[ unlock ]; 67 | 68 | // Handle: [ owner, key, value ] args 69 | if ( typeof data === "string" ) { 70 | cache[ data ] = value; 71 | 72 | // Handle: [ owner, { properties } ] args 73 | } else { 74 | // Fresh assignments by object are shallow copied 75 | if ( jQuery.isEmptyObject( cache ) ) { 76 | jQuery.extend( this.cache[ unlock ], data ); 77 | // Otherwise, copy the properties one-by-one to the cache object 78 | } else { 79 | for ( prop in data ) { 80 | cache[ prop ] = data[ prop ]; 81 | } 82 | } 83 | } 84 | return cache; 85 | }, 86 | get: function( owner, key ) { 87 | // Either a valid cache is found, or will be created. 88 | // New caches will be created and the unlock returned, 89 | // allowing direct access to the newly created 90 | // empty data object. A valid owner object must be provided. 91 | var cache = this.cache[ this.key( owner ) ]; 92 | 93 | return key === undefined ? 94 | cache : cache[ key ]; 95 | }, 96 | access: function( owner, key, value ) { 97 | var stored; 98 | // In cases where either: 99 | // 100 | // 1. No key was specified 101 | // 2. A string key was specified, but no value provided 102 | // 103 | // Take the "read" path and allow the get method to determine 104 | // which value to return, respectively either: 105 | // 106 | // 1. The entire cache object 107 | // 2. The data stored at the key 108 | // 109 | if ( key === undefined || 110 | ((key && typeof key === "string") && value === undefined) ) { 111 | 112 | stored = this.get( owner, key ); 113 | 114 | return stored !== undefined ? 115 | stored : this.get( owner, jQuery.camelCase(key) ); 116 | } 117 | 118 | // [*]When the key is not a string, or both a key and value 119 | // are specified, set or extend (existing objects) with either: 120 | // 121 | // 1. An object of properties 122 | // 2. A key and value 123 | // 124 | this.set( owner, key, value ); 125 | 126 | // Since the "set" path can have two possible entry points 127 | // return the expected data based on which path was taken[*] 128 | return value !== undefined ? value : key; 129 | }, 130 | remove: function( owner, key ) { 131 | var i, name, camel, 132 | unlock = this.key( owner ), 133 | cache = this.cache[ unlock ]; 134 | 135 | if ( key === undefined ) { 136 | this.cache[ unlock ] = {}; 137 | 138 | } else { 139 | // Support array or space separated string of keys 140 | if ( jQuery.isArray( key ) ) { 141 | // If "name" is an array of keys... 142 | // When data is initially created, via ("key", "val") signature, 143 | // keys will be converted to camelCase. 144 | // Since there is no way to tell _how_ a key was added, remove 145 | // both plain key and camelCase key. #12786 146 | // This will only penalize the array argument path. 147 | name = key.concat( key.map( jQuery.camelCase ) ); 148 | } else { 149 | camel = jQuery.camelCase( key ); 150 | // Try the string as a key before any manipulation 151 | if ( key in cache ) { 152 | name = [ key, camel ]; 153 | } else { 154 | // If a key with the spaces exists, use it. 155 | // Otherwise, create an array by matching non-whitespace 156 | name = camel; 157 | name = name in cache ? 158 | [ name ] : ( name.match( rnotwhite ) || [] ); 159 | } 160 | } 161 | 162 | i = name.length; 163 | while ( i-- ) { 164 | delete cache[ name[ i ] ]; 165 | } 166 | } 167 | }, 168 | hasData: function( owner ) { 169 | return !jQuery.isEmptyObject( 170 | this.cache[ owner[ this.expando ] ] || {} 171 | ); 172 | }, 173 | discard: function( owner ) { 174 | if ( owner[ this.expando ] ) { 175 | delete this.cache[ owner[ this.expando ] ]; 176 | } 177 | } 178 | }; 179 | 180 | return Data; 181 | }); 182 | -------------------------------------------------------------------------------- /assets/jquery/src/data.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./var/rnotwhite", 4 | "./core/access", 5 | "./data/var/data_priv", 6 | "./data/var/data_user" 7 | ], function( jQuery, rnotwhite, access, data_priv, data_user ) { 8 | 9 | // Implementation Summary 10 | // 11 | // 1. Enforce API surface and semantic compatibility with 1.9.x branch 12 | // 2. Improve the module's maintainability by reducing the storage 13 | // paths to a single mechanism. 14 | // 3. Use the same single mechanism to support "private" and "user" data. 15 | // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 16 | // 5. Avoid exposing implementation details on user objects (eg. expando properties) 17 | // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 18 | 19 | var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 20 | rmultiDash = /([A-Z])/g; 21 | 22 | function dataAttr( elem, key, data ) { 23 | var name; 24 | 25 | // If nothing was found internally, try to fetch any 26 | // data from the HTML5 data-* attribute 27 | if ( data === undefined && elem.nodeType === 1 ) { 28 | name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 29 | data = elem.getAttribute( name ); 30 | 31 | if ( typeof data === "string" ) { 32 | try { 33 | data = data === "true" ? true : 34 | data === "false" ? false : 35 | data === "null" ? null : 36 | // Only convert to a number if it doesn't change the string 37 | +data + "" === data ? +data : 38 | rbrace.test( data ) ? jQuery.parseJSON( data ) : 39 | data; 40 | } catch( e ) {} 41 | 42 | // Make sure we set the data so it isn't changed later 43 | data_user.set( elem, key, data ); 44 | } else { 45 | data = undefined; 46 | } 47 | } 48 | return data; 49 | } 50 | 51 | jQuery.extend({ 52 | hasData: function( elem ) { 53 | return data_user.hasData( elem ) || data_priv.hasData( elem ); 54 | }, 55 | 56 | data: function( elem, name, data ) { 57 | return data_user.access( elem, name, data ); 58 | }, 59 | 60 | removeData: function( elem, name ) { 61 | data_user.remove( elem, name ); 62 | }, 63 | 64 | // TODO: Now that all calls to _data and _removeData have been replaced 65 | // with direct calls to data_priv methods, these can be deprecated. 66 | _data: function( elem, name, data ) { 67 | return data_priv.access( elem, name, data ); 68 | }, 69 | 70 | _removeData: function( elem, name ) { 71 | data_priv.remove( elem, name ); 72 | } 73 | }); 74 | 75 | jQuery.fn.extend({ 76 | data: function( key, value ) { 77 | var i, name, data, 78 | elem = this[ 0 ], 79 | attrs = elem && elem.attributes; 80 | 81 | // Gets all values 82 | if ( key === undefined ) { 83 | if ( this.length ) { 84 | data = data_user.get( elem ); 85 | 86 | if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { 87 | i = attrs.length; 88 | while ( i-- ) { 89 | 90 | // Support: IE11+ 91 | // The attrs elements can be null (#14894) 92 | if ( attrs[ i ] ) { 93 | name = attrs[ i ].name; 94 | if ( name.indexOf( "data-" ) === 0 ) { 95 | name = jQuery.camelCase( name.slice(5) ); 96 | dataAttr( elem, name, data[ name ] ); 97 | } 98 | } 99 | } 100 | data_priv.set( elem, "hasDataAttrs", true ); 101 | } 102 | } 103 | 104 | return data; 105 | } 106 | 107 | // Sets multiple values 108 | if ( typeof key === "object" ) { 109 | return this.each(function() { 110 | data_user.set( this, key ); 111 | }); 112 | } 113 | 114 | return access( this, function( value ) { 115 | var data, 116 | camelKey = jQuery.camelCase( key ); 117 | 118 | // The calling jQuery object (element matches) is not empty 119 | // (and therefore has an element appears at this[ 0 ]) and the 120 | // `value` parameter was not undefined. An empty jQuery object 121 | // will result in `undefined` for elem = this[ 0 ] which will 122 | // throw an exception if an attempt to read a data cache is made. 123 | if ( elem && value === undefined ) { 124 | // Attempt to get data from the cache 125 | // with the key as-is 126 | data = data_user.get( elem, key ); 127 | if ( data !== undefined ) { 128 | return data; 129 | } 130 | 131 | // Attempt to get data from the cache 132 | // with the key camelized 133 | data = data_user.get( elem, camelKey ); 134 | if ( data !== undefined ) { 135 | return data; 136 | } 137 | 138 | // Attempt to "discover" the data in 139 | // HTML5 custom data-* attrs 140 | data = dataAttr( elem, camelKey, undefined ); 141 | if ( data !== undefined ) { 142 | return data; 143 | } 144 | 145 | // We tried really hard, but the data doesn't exist. 146 | return; 147 | } 148 | 149 | // Set the data... 150 | this.each(function() { 151 | // First, attempt to store a copy or reference of any 152 | // data that might've been store with a camelCased key. 153 | var data = data_user.get( this, camelKey ); 154 | 155 | // For HTML5 data-* attribute interop, we have to 156 | // store property names with dashes in a camelCase form. 157 | // This might not apply to all properties...* 158 | data_user.set( this, camelKey, value ); 159 | 160 | // *... In the case of properties that might _actually_ 161 | // have dashes, we need to also store a copy of that 162 | // unchanged property. 163 | if ( key.indexOf("-") !== -1 && data !== undefined ) { 164 | data_user.set( this, key, value ); 165 | } 166 | }); 167 | }, null, value, arguments.length > 1, null, true ); 168 | }, 169 | 170 | removeData: function( key ) { 171 | return this.each(function() { 172 | data_user.remove( this, key ); 173 | }); 174 | } 175 | }); 176 | 177 | return jQuery; 178 | }); 179 | -------------------------------------------------------------------------------- /assets/jquery/src/callbacks.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./var/rnotwhite" 4 | ], function( jQuery, rnotwhite ) { 5 | 6 | // String to Object options format cache 7 | var optionsCache = {}; 8 | 9 | // Convert String-formatted options into Object-formatted ones and store in cache 10 | function createOptions( options ) { 11 | var object = optionsCache[ options ] = {}; 12 | jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { 13 | object[ flag ] = true; 14 | }); 15 | return object; 16 | } 17 | 18 | /* 19 | * Create a callback list using the following parameters: 20 | * 21 | * options: an optional list of space-separated options that will change how 22 | * the callback list behaves or a more traditional option object 23 | * 24 | * By default a callback list will act like an event callback list and can be 25 | * "fired" multiple times. 26 | * 27 | * Possible options: 28 | * 29 | * once: will ensure the callback list can only be fired once (like a Deferred) 30 | * 31 | * memory: will keep track of previous values and will call any callback added 32 | * after the list has been fired right away with the latest "memorized" 33 | * values (like a Deferred) 34 | * 35 | * unique: will ensure a callback can only be added once (no duplicate in the list) 36 | * 37 | * stopOnFalse: interrupt callings when a callback returns false 38 | * 39 | */ 40 | jQuery.Callbacks = function( options ) { 41 | 42 | // Convert options from String-formatted to Object-formatted if needed 43 | // (we check in cache first) 44 | options = typeof options === "string" ? 45 | ( optionsCache[ options ] || createOptions( options ) ) : 46 | jQuery.extend( {}, options ); 47 | 48 | var // Last fire value (for non-forgettable lists) 49 | memory, 50 | // Flag to know if list was already fired 51 | fired, 52 | // Flag to know if list is currently firing 53 | firing, 54 | // First callback to fire (used internally by add and fireWith) 55 | firingStart, 56 | // End of the loop when firing 57 | firingLength, 58 | // Index of currently firing callback (modified by remove if needed) 59 | firingIndex, 60 | // Actual callback list 61 | list = [], 62 | // Stack of fire calls for repeatable lists 63 | stack = !options.once && [], 64 | // Fire callbacks 65 | fire = function( data ) { 66 | memory = options.memory && data; 67 | fired = true; 68 | firingIndex = firingStart || 0; 69 | firingStart = 0; 70 | firingLength = list.length; 71 | firing = true; 72 | for ( ; list && firingIndex < firingLength; firingIndex++ ) { 73 | if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { 74 | memory = false; // To prevent further calls using add 75 | break; 76 | } 77 | } 78 | firing = false; 79 | if ( list ) { 80 | if ( stack ) { 81 | if ( stack.length ) { 82 | fire( stack.shift() ); 83 | } 84 | } else if ( memory ) { 85 | list = []; 86 | } else { 87 | self.disable(); 88 | } 89 | } 90 | }, 91 | // Actual Callbacks object 92 | self = { 93 | // Add a callback or a collection of callbacks to the list 94 | add: function() { 95 | if ( list ) { 96 | // First, we save the current length 97 | var start = list.length; 98 | (function add( args ) { 99 | jQuery.each( args, function( _, arg ) { 100 | var type = jQuery.type( arg ); 101 | if ( type === "function" ) { 102 | if ( !options.unique || !self.has( arg ) ) { 103 | list.push( arg ); 104 | } 105 | } else if ( arg && arg.length && type !== "string" ) { 106 | // Inspect recursively 107 | add( arg ); 108 | } 109 | }); 110 | })( arguments ); 111 | // Do we need to add the callbacks to the 112 | // current firing batch? 113 | if ( firing ) { 114 | firingLength = list.length; 115 | // With memory, if we're not firing then 116 | // we should call right away 117 | } else if ( memory ) { 118 | firingStart = start; 119 | fire( memory ); 120 | } 121 | } 122 | return this; 123 | }, 124 | // Remove a callback from the list 125 | remove: function() { 126 | if ( list ) { 127 | jQuery.each( arguments, function( _, arg ) { 128 | var index; 129 | while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 130 | list.splice( index, 1 ); 131 | // Handle firing indexes 132 | if ( firing ) { 133 | if ( index <= firingLength ) { 134 | firingLength--; 135 | } 136 | if ( index <= firingIndex ) { 137 | firingIndex--; 138 | } 139 | } 140 | } 141 | }); 142 | } 143 | return this; 144 | }, 145 | // Check if a given callback is in the list. 146 | // If no argument is given, return whether or not list has callbacks attached. 147 | has: function( fn ) { 148 | return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); 149 | }, 150 | // Remove all callbacks from the list 151 | empty: function() { 152 | list = []; 153 | firingLength = 0; 154 | return this; 155 | }, 156 | // Have the list do nothing anymore 157 | disable: function() { 158 | list = stack = memory = undefined; 159 | return this; 160 | }, 161 | // Is it disabled? 162 | disabled: function() { 163 | return !list; 164 | }, 165 | // Lock the list in its current state 166 | lock: function() { 167 | stack = undefined; 168 | if ( !memory ) { 169 | self.disable(); 170 | } 171 | return this; 172 | }, 173 | // Is it locked? 174 | locked: function() { 175 | return !stack; 176 | }, 177 | // Call all callbacks with the given context and arguments 178 | fireWith: function( context, args ) { 179 | if ( list && ( !fired || stack ) ) { 180 | args = args || []; 181 | args = [ context, args.slice ? args.slice() : args ]; 182 | if ( firing ) { 183 | stack.push( args ); 184 | } else { 185 | fire( args ); 186 | } 187 | } 188 | return this; 189 | }, 190 | // Call all the callbacks with the given arguments 191 | fire: function() { 192 | self.fireWith( this, arguments ); 193 | return this; 194 | }, 195 | // To know if the callbacks have already been called at least once 196 | fired: function() { 197 | return !!fired; 198 | } 199 | }; 200 | 201 | return self; 202 | }; 203 | 204 | return jQuery; 205 | }); 206 | -------------------------------------------------------------------------------- /assets/jquery/src/offset.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./var/strundefined", 4 | "./core/access", 5 | "./css/var/rnumnonpx", 6 | "./css/curCSS", 7 | "./css/addGetHookIf", 8 | "./css/support", 9 | 10 | "./core/init", 11 | "./css", 12 | "./selector" // contains 13 | ], function( jQuery, strundefined, access, rnumnonpx, curCSS, addGetHookIf, support ) { 14 | 15 | var docElem = window.document.documentElement; 16 | 17 | /** 18 | * Gets a window from an element 19 | */ 20 | function getWindow( elem ) { 21 | return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; 22 | } 23 | 24 | jQuery.offset = { 25 | setOffset: function( elem, options, i ) { 26 | var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 27 | position = jQuery.css( elem, "position" ), 28 | curElem = jQuery( elem ), 29 | props = {}; 30 | 31 | // Set position first, in-case top/left are set even on static elem 32 | if ( position === "static" ) { 33 | elem.style.position = "relative"; 34 | } 35 | 36 | curOffset = curElem.offset(); 37 | curCSSTop = jQuery.css( elem, "top" ); 38 | curCSSLeft = jQuery.css( elem, "left" ); 39 | calculatePosition = ( position === "absolute" || position === "fixed" ) && 40 | ( curCSSTop + curCSSLeft ).indexOf("auto") > -1; 41 | 42 | // Need to be able to calculate position if either 43 | // top or left is auto and position is either absolute or fixed 44 | if ( calculatePosition ) { 45 | curPosition = curElem.position(); 46 | curTop = curPosition.top; 47 | curLeft = curPosition.left; 48 | 49 | } else { 50 | curTop = parseFloat( curCSSTop ) || 0; 51 | curLeft = parseFloat( curCSSLeft ) || 0; 52 | } 53 | 54 | if ( jQuery.isFunction( options ) ) { 55 | options = options.call( elem, i, curOffset ); 56 | } 57 | 58 | if ( options.top != null ) { 59 | props.top = ( options.top - curOffset.top ) + curTop; 60 | } 61 | if ( options.left != null ) { 62 | props.left = ( options.left - curOffset.left ) + curLeft; 63 | } 64 | 65 | if ( "using" in options ) { 66 | options.using.call( elem, props ); 67 | 68 | } else { 69 | curElem.css( props ); 70 | } 71 | } 72 | }; 73 | 74 | jQuery.fn.extend({ 75 | offset: function( options ) { 76 | if ( arguments.length ) { 77 | return options === undefined ? 78 | this : 79 | this.each(function( i ) { 80 | jQuery.offset.setOffset( this, options, i ); 81 | }); 82 | } 83 | 84 | var docElem, win, 85 | elem = this[ 0 ], 86 | box = { top: 0, left: 0 }, 87 | doc = elem && elem.ownerDocument; 88 | 89 | if ( !doc ) { 90 | return; 91 | } 92 | 93 | docElem = doc.documentElement; 94 | 95 | // Make sure it's not a disconnected DOM node 96 | if ( !jQuery.contains( docElem, elem ) ) { 97 | return box; 98 | } 99 | 100 | // Support: BlackBerry 5, iOS 3 (original iPhone) 101 | // If we don't have gBCR, just use 0,0 rather than error 102 | if ( typeof elem.getBoundingClientRect !== strundefined ) { 103 | box = elem.getBoundingClientRect(); 104 | } 105 | win = getWindow( doc ); 106 | return { 107 | top: box.top + win.pageYOffset - docElem.clientTop, 108 | left: box.left + win.pageXOffset - docElem.clientLeft 109 | }; 110 | }, 111 | 112 | position: function() { 113 | if ( !this[ 0 ] ) { 114 | return; 115 | } 116 | 117 | var offsetParent, offset, 118 | elem = this[ 0 ], 119 | parentOffset = { top: 0, left: 0 }; 120 | 121 | // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent 122 | if ( jQuery.css( elem, "position" ) === "fixed" ) { 123 | // Assume getBoundingClientRect is there when computed position is fixed 124 | offset = elem.getBoundingClientRect(); 125 | 126 | } else { 127 | // Get *real* offsetParent 128 | offsetParent = this.offsetParent(); 129 | 130 | // Get correct offsets 131 | offset = this.offset(); 132 | if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 133 | parentOffset = offsetParent.offset(); 134 | } 135 | 136 | // Add offsetParent borders 137 | parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); 138 | parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); 139 | } 140 | 141 | // Subtract parent offsets and element margins 142 | return { 143 | top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 144 | left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 145 | }; 146 | }, 147 | 148 | offsetParent: function() { 149 | return this.map(function() { 150 | var offsetParent = this.offsetParent || docElem; 151 | 152 | while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { 153 | offsetParent = offsetParent.offsetParent; 154 | } 155 | 156 | return offsetParent || docElem; 157 | }); 158 | } 159 | }); 160 | 161 | // Create scrollLeft and scrollTop methods 162 | jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 163 | var top = "pageYOffset" === prop; 164 | 165 | jQuery.fn[ method ] = function( val ) { 166 | return access( this, function( elem, method, val ) { 167 | var win = getWindow( elem ); 168 | 169 | if ( val === undefined ) { 170 | return win ? win[ prop ] : elem[ method ]; 171 | } 172 | 173 | if ( win ) { 174 | win.scrollTo( 175 | !top ? val : window.pageXOffset, 176 | top ? val : window.pageYOffset 177 | ); 178 | 179 | } else { 180 | elem[ method ] = val; 181 | } 182 | }, method, val, arguments.length, null ); 183 | }; 184 | }); 185 | 186 | // Support: Safari<7+, Chrome<37+ 187 | // Add the top/left cssHooks using jQuery.fn.position 188 | // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 189 | // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280 190 | // getComputedStyle returns percent when specified for top/left/bottom/right; 191 | // rather than make the css module depend on the offset module, just check for it here 192 | jQuery.each( [ "top", "left" ], function( i, prop ) { 193 | jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 194 | function( elem, computed ) { 195 | if ( computed ) { 196 | computed = curCSS( elem, prop ); 197 | // If curCSS returns percentage, fallback to offset 198 | return rnumnonpx.test( computed ) ? 199 | jQuery( elem ).position()[ prop ] + "px" : 200 | computed; 201 | } 202 | } 203 | ); 204 | }); 205 | 206 | return jQuery; 207 | }); 208 | -------------------------------------------------------------------------------- /assets/marked/doc/broken.md: -------------------------------------------------------------------------------- 1 | # Markdown is broken 2 | 3 | I have a lot of scraps of markdown engine oddities that I've collected over the 4 | years. What you see below is slightly messy, but it's what I've managed to 5 | cobble together to illustrate the differences between markdown engines, and 6 | why, if there ever is a markdown specification, it has to be absolutely 7 | thorough. There are a lot more of these little differences I have documented 8 | elsewhere. I know I will find them lingering on my disk one day, but until 9 | then, I'll continue to add whatever strange nonsensical things I find. 10 | 11 | Some of these examples may only mention a particular engine compared to marked. 12 | However, the examples with markdown.pl could easily be swapped out for 13 | discount, upskirt, or markdown.js, and you would very easily see even more 14 | inconsistencies. 15 | 16 | A lot of this was written when I was very unsatisfied with the inconsistencies 17 | between markdown engines. Please excuse the frustration noticeable in my 18 | writing. 19 | 20 | ## Examples of markdown's "stupid" list parsing 21 | 22 | ``` 23 | $ markdown.pl 24 | 25 | * item1 26 | 27 | * item2 28 | 29 | text 30 | ^D 31 |
    32 |
  • item1

    33 | 34 |
      35 |
    • item2
    • 36 |
    37 | 38 |

    text

  • 39 |

40 | ``` 41 | 42 | 43 | ``` 44 | $ marked 45 | * item1 46 | 47 | * item2 48 | 49 | text 50 | ^D 51 |
    52 |
  • item1

    53 |
      54 |
    • item2
    • 55 |
    56 |

    text

    57 |
  • 58 |
59 | ``` 60 | 61 | Which looks correct to you? 62 | 63 | - - - 64 | 65 | ``` 66 | $ markdown.pl 67 | * hello 68 | > world 69 | ^D 70 |

    71 |
  • hello

    72 | 73 |
    74 |

    world

  • 75 |

76 | 77 | ``` 78 | 79 | ``` 80 | $ marked 81 | * hello 82 | > world 83 | ^D 84 |
    85 |
  • hello
    86 |

    world

    87 |
    88 |
  • 89 |
90 | ``` 91 | 92 | Again, which looks correct to you? 93 | 94 | - - - 95 | 96 | EXAMPLE: 97 | 98 | ``` 99 | $ markdown.pl 100 | * hello 101 | * world 102 | * hi 103 | code 104 | ^D 105 |
    106 |
  • hello 107 |
      108 |
    • world
    • 109 |
    • hi 110 | code
    • 111 |
  • 112 |
113 | ``` 114 | 115 | The code isn't a code block even though it's after the bullet margin. I know, 116 | lets give it two more spaces, effectively making it 8 spaces past the bullet. 117 | 118 | ``` 119 | $ markdown.pl 120 | * hello 121 | * world 122 | * hi 123 | code 124 | ^D 125 |
    126 |
  • hello 127 |
      128 |
    • world
    • 129 |
    • hi 130 | code
    • 131 |
  • 132 |
133 | ``` 134 | 135 | And, it's still not a code block. Did you also notice that the 3rd item isn't 136 | even its own list? Markdown screws that up too because of its indentation 137 | unaware parsing. 138 | 139 | - - - 140 | 141 | Let's look at some more examples of markdown's list parsing: 142 | 143 | ``` 144 | $ markdown.pl 145 | 146 | * item1 147 | 148 | * item2 149 | 150 | text 151 | ^D 152 |
    153 |
  • item1

    154 | 155 |
      156 |
    • item2
    • 157 |
    158 | 159 |

    text

  • 160 |

161 | ``` 162 | 163 | Misnested tags. 164 | 165 | 166 | ``` 167 | $ marked 168 | * item1 169 | 170 | * item2 171 | 172 | text 173 | ^D 174 |
    175 |
  • item1

    176 |
      177 |
    • item2
    • 178 |
    179 |

    text

    180 |
  • 181 |
182 | ``` 183 | 184 | Which looks correct to you? 185 | 186 | - - - 187 | 188 | ``` 189 | $ markdown.pl 190 | * hello 191 | > world 192 | ^D 193 |

    194 |
  • hello

    195 | 196 |
    197 |

    world

  • 198 |

199 | 200 | ``` 201 | 202 | More misnested tags. 203 | 204 | 205 | ``` 206 | $ marked 207 | * hello 208 | > world 209 | ^D 210 |
    211 |
  • hello
    212 |

    world

    213 |
    214 |
  • 215 |
216 | ``` 217 | 218 | Again, which looks correct to you? 219 | 220 | - - - 221 | 222 | # Why quality matters - Part 2 223 | 224 | ``` bash 225 | $ markdown.pl 226 | * hello 227 | > world 228 | ^D 229 |

    230 |
  • hello

    231 | 232 |
    233 |

    world

  • 234 |

235 | 236 | ``` 237 | 238 | ``` bash 239 | $ sundown # upskirt 240 | * hello 241 | > world 242 | ^D 243 |
    244 |
  • hello 245 | > world
  • 246 |
247 | ``` 248 | 249 | ``` bash 250 | $ marked 251 | * hello 252 | > world 253 | ^D 254 |
  • hello

    world

255 | ``` 256 | 257 | Which looks correct to you? 258 | 259 | - - - 260 | 261 | See: https://github.com/evilstreak/markdown-js/issues/23 262 | 263 | ``` bash 264 | $ markdown.pl # upskirt/markdown.js/discount 265 | * hello 266 | var a = 1; 267 | * world 268 | ^D 269 |
    270 |
  • hello 271 | var a = 1;
  • 272 |
  • world
  • 273 |
274 | ``` 275 | 276 | ``` bash 277 | $ marked 278 | * hello 279 | var a = 1; 280 | * world 281 | ^D 282 |
  • hello 283 |
    code>var a = 1;
  • 284 |
  • world
285 | ``` 286 | 287 | Which looks more reasonable? Why shouldn't code blocks be able to appear in 288 | list items in a sane way? 289 | 290 | - - - 291 | 292 | ``` bash 293 | $ markdown.js 294 |
hello
295 | 296 | hello 297 | ^D 298 |

<div>hello</div>

299 | 300 |

<span>hello</span>

301 | ``` 302 | 303 | ``` bash 304 | $ marked 305 |
hello
306 | 307 | hello 308 | ^D 309 |
hello
310 | 311 | 312 |

hello 313 |

314 | ``` 315 | 316 | - - - 317 | 318 | See: https://github.com/evilstreak/markdown-js/issues/27 319 | 320 | ``` bash 321 | $ markdown.js 322 | [![an image](/image)](/link) 323 | ^D 324 |

![an image

325 | ``` 326 | 327 | ``` bash 328 | $ marked 329 | [![an image](/image)](/link) 330 | ^D 331 |

an image 332 |

333 | ``` 334 | 335 | - - - 336 | 337 | See: https://github.com/evilstreak/markdown-js/issues/24 338 | 339 | ``` bash 340 | $ markdown.js 341 | > a 342 | 343 | > b 344 | 345 | > c 346 | ^D 347 |

a

bundefined> c

348 | ``` 349 | 350 | ``` bash 351 | $ marked 352 | > a 353 | 354 | > b 355 | 356 | > c 357 | ^D 358 |

a 359 | 360 |

361 |

b 362 | 363 |

364 |

c 365 |

366 | ``` 367 | 368 | - - - 369 | 370 | ``` bash 371 | $ markdown.pl 372 | * hello 373 | * world 374 | how 375 | 376 | are 377 | you 378 | 379 | * today 380 | * hi 381 | ^D 382 |
    383 |
  • hello

    384 | 385 |
      386 |
    • world 387 | how
    • 388 |
    389 | 390 |

    are 391 | you

    392 | 393 |
      394 |
    • today
    • 395 |
  • 396 |
  • hi
  • 397 |
398 | ``` 399 | 400 | ``` bash 401 | $ marked 402 | * hello 403 | * world 404 | how 405 | 406 | are 407 | you 408 | 409 | * today 410 | * hi 411 | ^D 412 |
    413 |
  • hello

    414 |
      415 |
    • world 416 | how

      417 |

      are 418 | you

      419 |
    • 420 |
    • today

      421 |
    • 422 |
    423 |
  • 424 |
  • hi
  • 425 |
426 | ``` 427 | -------------------------------------------------------------------------------- /assets/marked/README.md: -------------------------------------------------------------------------------- 1 | # marked 2 | 3 | > A full-featured markdown parser and compiler, written in JavaScript. Built 4 | > for speed. 5 | 6 | [![NPM version](https://badge.fury.io/js/marked.png)][badge] 7 | 8 | ## Install 9 | 10 | ``` bash 11 | npm install marked --save 12 | ``` 13 | 14 | ## Usage 15 | 16 | Minimal usage: 17 | 18 | ```js 19 | var marked = require('marked'); 20 | console.log(marked('I am using __markdown__.')); 21 | // Outputs:

I am using markdown.

22 | ``` 23 | 24 | Example setting options with default values: 25 | 26 | ```js 27 | var marked = require('marked'); 28 | marked.setOptions({ 29 | renderer: new marked.Renderer(), 30 | gfm: true, 31 | tables: true, 32 | breaks: false, 33 | pedantic: false, 34 | sanitize: true, 35 | smartLists: true, 36 | smartypants: false 37 | }); 38 | 39 | console.log(marked('I am using __markdown__.')); 40 | ``` 41 | 42 | ### Browser 43 | 44 | ```html 45 | 46 | 47 | 48 | 49 | Marked in the browser 50 | 51 | 52 | 53 |
54 | 58 | 59 | 60 | ``` 61 | 62 | ## marked(markdownString [,options] [,callback]) 63 | 64 | ### markdownString 65 | 66 | Type: `string` 67 | 68 | String of markdown source to be compiled. 69 | 70 | ### options 71 | 72 | Type: `object` 73 | 74 | Hash of options. Can also be set using the `marked.setOptions` method as seen 75 | above. 76 | 77 | ### callback 78 | 79 | Type: `function` 80 | 81 | Function called when the `markdownString` has been fully parsed when using 82 | async highlighting. If the `options` argument is omitted, this can be used as 83 | the second argument. 84 | 85 | ## Options 86 | 87 | ### highlight 88 | 89 | Type: `function` 90 | 91 | A function to highlight code blocks. The first example below uses async highlighting with 92 | [node-pygmentize-bundled][pygmentize], and the second is a synchronous example using 93 | [highlight.js][highlight]: 94 | 95 | ```js 96 | var marked = require('marked'); 97 | 98 | var markdownString = '```js\n console.log("hello"); \n```'; 99 | 100 | // Async highlighting with pygmentize-bundled 101 | marked.setOptions({ 102 | highlight: function (code, lang, callback) { 103 | require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { 104 | callback(err, result.toString()); 105 | }); 106 | } 107 | }); 108 | 109 | // Using async version of marked 110 | marked(markdownString, function (err, content) { 111 | if (err) throw err; 112 | console.log(content); 113 | }); 114 | 115 | // Synchronous highlighting with highlight.js 116 | marked.setOptions({ 117 | highlight: function (code) { 118 | return require('highlight.js').highlightAuto(code).value; 119 | } 120 | }); 121 | 122 | console.log(marked(markdownString)); 123 | ``` 124 | 125 | #### highlight arguments 126 | 127 | `code` 128 | 129 | Type: `string` 130 | 131 | The section of code to pass to the highlighter. 132 | 133 | `lang` 134 | 135 | Type: `string` 136 | 137 | The programming language specified in the code block. 138 | 139 | `callback` 140 | 141 | Type: `function` 142 | 143 | The callback function to call when using an async highlighter. 144 | 145 | ### renderer 146 | 147 | Type: `object` 148 | Default: `new Renderer()` 149 | 150 | An object containing functions to render tokens to HTML. 151 | 152 | #### Overriding renderer methods 153 | 154 | The renderer option allows you to render tokens in a custom manner. Here is an 155 | example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: 156 | 157 | ```javascript 158 | var marked = require('marked'); 159 | var renderer = new marked.Renderer(); 160 | 161 | renderer.heading = function (text, level) { 162 | var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); 163 | 164 | return '' + 169 | text + ''; 170 | }, 171 | 172 | console.log(marked('# heading+', { renderer: renderer })); 173 | ``` 174 | This code will output the following HTML: 175 | ```html 176 |

177 | 178 | 179 | 180 | heading+ 181 |

182 | ``` 183 | 184 | #### Block level renderer methods 185 | 186 | - code(*string* code, *string* language) 187 | - blockquote(*string* quote) 188 | - html(*string* html) 189 | - heading(*string* text, *number* level) 190 | - hr() 191 | - list(*string* body, *boolean* ordered) 192 | - listitem(*string* text) 193 | - paragraph(*string* text) 194 | - table(*string* header, *string* body) 195 | - tablerow(*string* content) 196 | - tablecell(*string* content, *object* flags) 197 | 198 | `flags` has the following properties: 199 | 200 | ```js 201 | { 202 | header: true || false, 203 | align: 'center' || 'left' || 'right' 204 | } 205 | ``` 206 | 207 | #### Inline level renderer methods 208 | 209 | - strong(*string* text) 210 | - em(*string* text) 211 | - codespan(*string* code) 212 | - br() 213 | - del(*string* text) 214 | - link(*string* href, *string* title, *string* text) 215 | - image(*string* href, *string* title, *string* text) 216 | 217 | ### gfm 218 | 219 | Type: `boolean` 220 | Default: `true` 221 | 222 | Enable [GitHub flavored markdown][gfm]. 223 | 224 | ### tables 225 | 226 | Type: `boolean` 227 | Default: `true` 228 | 229 | Enable GFM [tables][tables]. 230 | This option requires the `gfm` option to be true. 231 | 232 | ### breaks 233 | 234 | Type: `boolean` 235 | Default: `false` 236 | 237 | Enable GFM [line breaks][breaks]. 238 | This option requires the `gfm` option to be true. 239 | 240 | ### pedantic 241 | 242 | Type: `boolean` 243 | Default: `false` 244 | 245 | Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of 246 | the original markdown bugs or poor behavior. 247 | 248 | ### sanitize 249 | 250 | Type: `boolean` 251 | Default: `false` 252 | 253 | Sanitize the output. Ignore any HTML that has been input. 254 | 255 | ### smartLists 256 | 257 | Type: `boolean` 258 | Default: `true` 259 | 260 | Use smarter list behavior than the original markdown. May eventually be 261 | default with the old behavior moved into `pedantic`. 262 | 263 | ### smartypants 264 | 265 | Type: `boolean` 266 | Default: `false` 267 | 268 | Use "smart" typograhic punctuation for things like quotes and dashes. 269 | 270 | ## Access to lexer and parser 271 | 272 | You also have direct access to the lexer and parser if you so desire. 273 | 274 | ``` js 275 | var tokens = marked.lexer(text, options); 276 | console.log(marked.parser(tokens)); 277 | ``` 278 | 279 | ``` js 280 | var lexer = new marked.Lexer(options); 281 | var tokens = lexer.lex(text); 282 | console.log(tokens); 283 | console.log(lexer.rules); 284 | ``` 285 | 286 | ## CLI 287 | 288 | ``` bash 289 | $ marked -o hello.html 290 | hello world 291 | ^D 292 | $ cat hello.html 293 |

hello world

294 | ``` 295 | 296 | ## Philosophy behind marked 297 | 298 | The point of marked was to create a markdown compiler where it was possible to 299 | frequently parse huge chunks of markdown without having to worry about 300 | caching the compiled output somehow...or blocking for an unnecesarily long time. 301 | 302 | marked is very concise and still implements all markdown features. It is also 303 | now fully compatible with the client-side. 304 | 305 | marked more or less passes the official markdown test suite in its 306 | entirety. This is important because a surprising number of markdown compilers 307 | cannot pass more than a few tests. It was very difficult to get marked as 308 | compliant as it is. It could have cut corners in several areas for the sake 309 | of performance, but did not in order to be exactly what you expect in terms 310 | of a markdown rendering. In fact, this is why marked could be considered at a 311 | disadvantage in the benchmarks above. 312 | 313 | Along with implementing every markdown feature, marked also implements [GFM 314 | features][gfmf]. 315 | 316 | ## Benchmarks 317 | 318 | node v0.8.x 319 | 320 | ``` bash 321 | $ node test --bench 322 | marked completed in 3411ms. 323 | marked (gfm) completed in 3727ms. 324 | marked (pedantic) completed in 3201ms. 325 | robotskirt completed in 808ms. 326 | showdown (reuse converter) completed in 11954ms. 327 | showdown (new converter) completed in 17774ms. 328 | markdown-js completed in 17191ms. 329 | ``` 330 | 331 | __Marked is now faster than Discount, which is written in C.__ 332 | 333 | For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects. 334 | 335 | ### Pro level 336 | 337 | You also have direct access to the lexer and parser if you so desire. 338 | 339 | ``` js 340 | var tokens = marked.lexer(text, options); 341 | console.log(marked.parser(tokens)); 342 | ``` 343 | 344 | ``` js 345 | var lexer = new marked.Lexer(options); 346 | var tokens = lexer.lex(text); 347 | console.log(tokens); 348 | console.log(lexer.rules); 349 | ``` 350 | 351 | ``` bash 352 | $ node 353 | > require('marked').lexer('> i am using marked.') 354 | [ { type: 'blockquote_start' }, 355 | { type: 'paragraph', 356 | text: 'i am using marked.' }, 357 | { type: 'blockquote_end' }, 358 | links: {} ] 359 | ``` 360 | 361 | ## Running Tests & Contributing 362 | 363 | If you want to submit a pull request, make sure your changes pass the test 364 | suite. If you're adding a new feature, be sure to add your own test. 365 | 366 | The marked test suite is set up slightly strangely: `test/new` is for all tests 367 | that are not part of the original markdown.pl test suite (this is where your 368 | test should go if you make one). `test/original` is only for the original 369 | markdown.pl tests. `test/tests` houses both types of tests after they have been 370 | combined and moved/generated by running `node test --fix` or `marked --test 371 | --fix`. 372 | 373 | In other words, if you have a test to add, add it to `test/new/` and then 374 | regenerate the tests with `node test --fix`. Commit the result. If your test 375 | uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you 376 | can add `.nogfm` to the filename. So, `my-test.text` becomes 377 | `my-test.nogfm.text`. You can do this with any marked option. Say you want 378 | line breaks and smartypants enabled, your filename should be: 379 | `my-test.breaks.smartypants.text`. 380 | 381 | To run the tests: 382 | 383 | ``` bash 384 | cd marked/ 385 | node test 386 | ``` 387 | 388 | ### Contribution and License Agreement 389 | 390 | If you contribute code to this project, you are implicitly allowing your code 391 | to be distributed under the MIT license. You are also implicitly verifying that 392 | all code is your original work. `` 393 | 394 | ## License 395 | 396 | Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License) 397 | 398 | See LICENSE for more info. 399 | 400 | [gfm]: https://help.github.com/articles/github-flavored-markdown 401 | [gfmf]: http://github.github.com/github-flavored-markdown/ 402 | [pygmentize]: https://github.com/rvagg/node-pygmentize-bundled 403 | [highlight]: https://github.com/isagalaev/highlight.js 404 | [badge]: http://badge.fury.io/js/marked 405 | [tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables 406 | [breaks]: https://help.github.com/articles/github-flavored-markdown#newlines 407 | -------------------------------------------------------------------------------- /assets/jquery/src/core.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./var/arr", 3 | "./var/slice", 4 | "./var/concat", 5 | "./var/push", 6 | "./var/indexOf", 7 | "./var/class2type", 8 | "./var/toString", 9 | "./var/hasOwn", 10 | "./var/support" 11 | ], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) { 12 | 13 | var 14 | // Use the correct document accordingly with window argument (sandbox) 15 | document = window.document, 16 | 17 | version = "@VERSION", 18 | 19 | // Define a local copy of jQuery 20 | jQuery = function( selector, context ) { 21 | // The jQuery object is actually just the init constructor 'enhanced' 22 | // Need init if jQuery is called (just allow error to be thrown if not included) 23 | return new jQuery.fn.init( selector, context ); 24 | }, 25 | 26 | // Support: Android<4.1 27 | // Make sure we trim BOM and NBSP 28 | rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 29 | 30 | // Matches dashed string for camelizing 31 | rmsPrefix = /^-ms-/, 32 | rdashAlpha = /-([\da-z])/gi, 33 | 34 | // Used by jQuery.camelCase as callback to replace() 35 | fcamelCase = function( all, letter ) { 36 | return letter.toUpperCase(); 37 | }; 38 | 39 | jQuery.fn = jQuery.prototype = { 40 | // The current version of jQuery being used 41 | jquery: version, 42 | 43 | constructor: jQuery, 44 | 45 | // Start with an empty selector 46 | selector: "", 47 | 48 | // The default length of a jQuery object is 0 49 | length: 0, 50 | 51 | toArray: function() { 52 | return slice.call( this ); 53 | }, 54 | 55 | // Get the Nth element in the matched element set OR 56 | // Get the whole matched element set as a clean array 57 | get: function( num ) { 58 | return num != null ? 59 | 60 | // Return just the one element from the set 61 | ( num < 0 ? this[ num + this.length ] : this[ num ] ) : 62 | 63 | // Return all the elements in a clean array 64 | slice.call( this ); 65 | }, 66 | 67 | // Take an array of elements and push it onto the stack 68 | // (returning the new matched element set) 69 | pushStack: function( elems ) { 70 | 71 | // Build a new jQuery matched element set 72 | var ret = jQuery.merge( this.constructor(), elems ); 73 | 74 | // Add the old object onto the stack (as a reference) 75 | ret.prevObject = this; 76 | ret.context = this.context; 77 | 78 | // Return the newly-formed element set 79 | return ret; 80 | }, 81 | 82 | // Execute a callback for every element in the matched set. 83 | // (You can seed the arguments with an array of args, but this is 84 | // only used internally.) 85 | each: function( callback, args ) { 86 | return jQuery.each( this, callback, args ); 87 | }, 88 | 89 | map: function( callback ) { 90 | return this.pushStack( jQuery.map(this, function( elem, i ) { 91 | return callback.call( elem, i, elem ); 92 | })); 93 | }, 94 | 95 | slice: function() { 96 | return this.pushStack( slice.apply( this, arguments ) ); 97 | }, 98 | 99 | first: function() { 100 | return this.eq( 0 ); 101 | }, 102 | 103 | last: function() { 104 | return this.eq( -1 ); 105 | }, 106 | 107 | eq: function( i ) { 108 | var len = this.length, 109 | j = +i + ( i < 0 ? len : 0 ); 110 | return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); 111 | }, 112 | 113 | end: function() { 114 | return this.prevObject || this.constructor(null); 115 | }, 116 | 117 | // For internal use only. 118 | // Behaves like an Array's method, not like a jQuery method. 119 | push: push, 120 | sort: arr.sort, 121 | splice: arr.splice 122 | }; 123 | 124 | jQuery.extend = jQuery.fn.extend = function() { 125 | var options, name, src, copy, copyIsArray, clone, 126 | target = arguments[0] || {}, 127 | i = 1, 128 | length = arguments.length, 129 | deep = false; 130 | 131 | // Handle a deep copy situation 132 | if ( typeof target === "boolean" ) { 133 | deep = target; 134 | 135 | // Skip the boolean and the target 136 | target = arguments[ i ] || {}; 137 | i++; 138 | } 139 | 140 | // Handle case when target is a string or something (possible in deep copy) 141 | if ( typeof target !== "object" && !jQuery.isFunction(target) ) { 142 | target = {}; 143 | } 144 | 145 | // Extend jQuery itself if only one argument is passed 146 | if ( i === length ) { 147 | target = this; 148 | i--; 149 | } 150 | 151 | for ( ; i < length; i++ ) { 152 | // Only deal with non-null/undefined values 153 | if ( (options = arguments[ i ]) != null ) { 154 | // Extend the base object 155 | for ( name in options ) { 156 | src = target[ name ]; 157 | copy = options[ name ]; 158 | 159 | // Prevent never-ending loop 160 | if ( target === copy ) { 161 | continue; 162 | } 163 | 164 | // Recurse if we're merging plain objects or arrays 165 | if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { 166 | if ( copyIsArray ) { 167 | copyIsArray = false; 168 | clone = src && jQuery.isArray(src) ? src : []; 169 | 170 | } else { 171 | clone = src && jQuery.isPlainObject(src) ? src : {}; 172 | } 173 | 174 | // Never move original objects, clone them 175 | target[ name ] = jQuery.extend( deep, clone, copy ); 176 | 177 | // Don't bring in undefined values 178 | } else if ( copy !== undefined ) { 179 | target[ name ] = copy; 180 | } 181 | } 182 | } 183 | } 184 | 185 | // Return the modified object 186 | return target; 187 | }; 188 | 189 | jQuery.extend({ 190 | // Unique for each copy of jQuery on the page 191 | expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 192 | 193 | // Assume jQuery is ready without the ready module 194 | isReady: true, 195 | 196 | error: function( msg ) { 197 | throw new Error( msg ); 198 | }, 199 | 200 | noop: function() {}, 201 | 202 | isFunction: function( obj ) { 203 | return jQuery.type(obj) === "function"; 204 | }, 205 | 206 | isArray: Array.isArray, 207 | 208 | isWindow: function( obj ) { 209 | return obj != null && obj === obj.window; 210 | }, 211 | 212 | isNumeric: function( obj ) { 213 | // parseFloat NaNs numeric-cast false positives (null|true|false|"") 214 | // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 215 | // subtraction forces infinities to NaN 216 | // adding 1 corrects loss of precision from parseFloat (#15100) 217 | return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; 218 | }, 219 | 220 | isPlainObject: function( obj ) { 221 | // Not plain objects: 222 | // - Any object or value whose internal [[Class]] property is not "[object Object]" 223 | // - DOM nodes 224 | // - window 225 | if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 226 | return false; 227 | } 228 | 229 | if ( obj.constructor && 230 | !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { 231 | return false; 232 | } 233 | 234 | // If the function hasn't returned already, we're confident that 235 | // |obj| is a plain object, created by {} or constructed with new Object 236 | return true; 237 | }, 238 | 239 | isEmptyObject: function( obj ) { 240 | var name; 241 | for ( name in obj ) { 242 | return false; 243 | } 244 | return true; 245 | }, 246 | 247 | type: function( obj ) { 248 | if ( obj == null ) { 249 | return obj + ""; 250 | } 251 | // Support: Android<4.0, iOS<6 (functionish RegExp) 252 | return typeof obj === "object" || typeof obj === "function" ? 253 | class2type[ toString.call(obj) ] || "object" : 254 | typeof obj; 255 | }, 256 | 257 | // Evaluates a script in a global context 258 | globalEval: function( code ) { 259 | var script, 260 | indirect = eval; 261 | 262 | code = jQuery.trim( code ); 263 | 264 | if ( code ) { 265 | // If the code includes a valid, prologue position 266 | // strict mode pragma, execute code by injecting a 267 | // script tag into the document. 268 | if ( code.indexOf("use strict") === 1 ) { 269 | script = document.createElement("script"); 270 | script.text = code; 271 | document.head.appendChild( script ).parentNode.removeChild( script ); 272 | } else { 273 | // Otherwise, avoid the DOM node creation, insertion 274 | // and removal by using an indirect global eval 275 | indirect( code ); 276 | } 277 | } 278 | }, 279 | 280 | // Convert dashed to camelCase; used by the css and data modules 281 | // Support: IE9-11+ 282 | // Microsoft forgot to hump their vendor prefix (#9572) 283 | camelCase: function( string ) { 284 | return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 285 | }, 286 | 287 | nodeName: function( elem, name ) { 288 | return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 289 | }, 290 | 291 | // args is for internal usage only 292 | each: function( obj, callback, args ) { 293 | var value, 294 | i = 0, 295 | length = obj.length, 296 | isArray = isArraylike( obj ); 297 | 298 | if ( args ) { 299 | if ( isArray ) { 300 | for ( ; i < length; i++ ) { 301 | value = callback.apply( obj[ i ], args ); 302 | 303 | if ( value === false ) { 304 | break; 305 | } 306 | } 307 | } else { 308 | for ( i in obj ) { 309 | value = callback.apply( obj[ i ], args ); 310 | 311 | if ( value === false ) { 312 | break; 313 | } 314 | } 315 | } 316 | 317 | // A special, fast, case for the most common use of each 318 | } else { 319 | if ( isArray ) { 320 | for ( ; i < length; i++ ) { 321 | value = callback.call( obj[ i ], i, obj[ i ] ); 322 | 323 | if ( value === false ) { 324 | break; 325 | } 326 | } 327 | } else { 328 | for ( i in obj ) { 329 | value = callback.call( obj[ i ], i, obj[ i ] ); 330 | 331 | if ( value === false ) { 332 | break; 333 | } 334 | } 335 | } 336 | } 337 | 338 | return obj; 339 | }, 340 | 341 | // Support: Android<4.1 342 | trim: function( text ) { 343 | return text == null ? 344 | "" : 345 | ( text + "" ).replace( rtrim, "" ); 346 | }, 347 | 348 | // results is for internal usage only 349 | makeArray: function( arr, results ) { 350 | var ret = results || []; 351 | 352 | if ( arr != null ) { 353 | if ( isArraylike( Object(arr) ) ) { 354 | jQuery.merge( ret, 355 | typeof arr === "string" ? 356 | [ arr ] : arr 357 | ); 358 | } else { 359 | push.call( ret, arr ); 360 | } 361 | } 362 | 363 | return ret; 364 | }, 365 | 366 | inArray: function( elem, arr, i ) { 367 | return arr == null ? -1 : indexOf.call( arr, elem, i ); 368 | }, 369 | 370 | merge: function( first, second ) { 371 | var len = +second.length, 372 | j = 0, 373 | i = first.length; 374 | 375 | for ( ; j < len; j++ ) { 376 | first[ i++ ] = second[ j ]; 377 | } 378 | 379 | first.length = i; 380 | 381 | return first; 382 | }, 383 | 384 | grep: function( elems, callback, invert ) { 385 | var callbackInverse, 386 | matches = [], 387 | i = 0, 388 | length = elems.length, 389 | callbackExpect = !invert; 390 | 391 | // Go through the array, only saving the items 392 | // that pass the validator function 393 | for ( ; i < length; i++ ) { 394 | callbackInverse = !callback( elems[ i ], i ); 395 | if ( callbackInverse !== callbackExpect ) { 396 | matches.push( elems[ i ] ); 397 | } 398 | } 399 | 400 | return matches; 401 | }, 402 | 403 | // arg is for internal usage only 404 | map: function( elems, callback, arg ) { 405 | var value, 406 | i = 0, 407 | length = elems.length, 408 | isArray = isArraylike( elems ), 409 | ret = []; 410 | 411 | // Go through the array, translating each of the items to their new values 412 | if ( isArray ) { 413 | for ( ; i < length; i++ ) { 414 | value = callback( elems[ i ], i, arg ); 415 | 416 | if ( value != null ) { 417 | ret.push( value ); 418 | } 419 | } 420 | 421 | // Go through every key on the object, 422 | } else { 423 | for ( i in elems ) { 424 | value = callback( elems[ i ], i, arg ); 425 | 426 | if ( value != null ) { 427 | ret.push( value ); 428 | } 429 | } 430 | } 431 | 432 | // Flatten any nested arrays 433 | return concat.apply( [], ret ); 434 | }, 435 | 436 | // A global GUID counter for objects 437 | guid: 1, 438 | 439 | // Bind a function to a context, optionally partially applying any 440 | // arguments. 441 | proxy: function( fn, context ) { 442 | var tmp, args, proxy; 443 | 444 | if ( typeof context === "string" ) { 445 | tmp = fn[ context ]; 446 | context = fn; 447 | fn = tmp; 448 | } 449 | 450 | // Quick check to determine if target is callable, in the spec 451 | // this throws a TypeError, but we will just return undefined. 452 | if ( !jQuery.isFunction( fn ) ) { 453 | return undefined; 454 | } 455 | 456 | // Simulated bind 457 | args = slice.call( arguments, 2 ); 458 | proxy = function() { 459 | return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 460 | }; 461 | 462 | // Set the guid of unique handler to the same of original handler, so it can be removed 463 | proxy.guid = fn.guid = fn.guid || jQuery.guid++; 464 | 465 | return proxy; 466 | }, 467 | 468 | now: Date.now, 469 | 470 | // jQuery.support is not used in Core but other projects attach their 471 | // properties to it so it needs to exist. 472 | support: support 473 | }); 474 | 475 | // Populate the class2type map 476 | jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { 477 | class2type[ "[object " + name + "]" ] = name.toLowerCase(); 478 | }); 479 | 480 | function isArraylike( obj ) { 481 | 482 | // Support: iOS 8.2 (not reproducible in simulator) 483 | // `in` check used to prevent JIT error (gh-2145) 484 | // hasOwn isn't used here due to false negatives 485 | // regarding Nodelist length in IE 486 | var length = "length" in obj && obj.length, 487 | type = jQuery.type( obj ); 488 | 489 | if ( type === "function" || jQuery.isWindow( obj ) ) { 490 | return false; 491 | } 492 | 493 | if ( obj.nodeType === 1 && length ) { 494 | return true; 495 | } 496 | 497 | return type === "array" || length === 0 || 498 | typeof length === "number" && length > 0 && ( length - 1 ) in obj; 499 | } 500 | 501 | return jQuery; 502 | }); 503 | -------------------------------------------------------------------------------- /assets/jquery/src/css.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./var/pnum", 4 | "./core/access", 5 | "./css/var/rmargin", 6 | "./css/var/rnumnonpx", 7 | "./css/var/cssExpand", 8 | "./css/var/isHidden", 9 | "./css/var/getStyles", 10 | "./css/curCSS", 11 | "./css/defaultDisplay", 12 | "./css/addGetHookIf", 13 | "./css/support", 14 | "./data/var/data_priv", 15 | 16 | "./core/init", 17 | "./css/swap", 18 | "./core/ready", 19 | "./selector" // contains 20 | ], function( jQuery, pnum, access, rmargin, rnumnonpx, cssExpand, isHidden, 21 | getStyles, curCSS, defaultDisplay, addGetHookIf, support, data_priv ) { 22 | 23 | var 24 | // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption" 25 | // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 26 | rdisplayswap = /^(none|table(?!-c[ea]).+)/, 27 | rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), 28 | rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ), 29 | 30 | cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 31 | cssNormalTransform = { 32 | letterSpacing: "0", 33 | fontWeight: "400" 34 | }, 35 | 36 | cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; 37 | 38 | // Return a css property mapped to a potentially vendor prefixed property 39 | function vendorPropName( style, name ) { 40 | 41 | // Shortcut for names that are not vendor prefixed 42 | if ( name in style ) { 43 | return name; 44 | } 45 | 46 | // Check for vendor prefixed names 47 | var capName = name[0].toUpperCase() + name.slice(1), 48 | origName = name, 49 | i = cssPrefixes.length; 50 | 51 | while ( i-- ) { 52 | name = cssPrefixes[ i ] + capName; 53 | if ( name in style ) { 54 | return name; 55 | } 56 | } 57 | 58 | return origName; 59 | } 60 | 61 | function setPositiveNumber( elem, value, subtract ) { 62 | var matches = rnumsplit.exec( value ); 63 | return matches ? 64 | // Guard against undefined "subtract", e.g., when used as in cssHooks 65 | Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : 66 | value; 67 | } 68 | 69 | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 70 | var i = extra === ( isBorderBox ? "border" : "content" ) ? 71 | // If we already have the right measurement, avoid augmentation 72 | 4 : 73 | // Otherwise initialize for horizontal or vertical properties 74 | name === "width" ? 1 : 0, 75 | 76 | val = 0; 77 | 78 | for ( ; i < 4; i += 2 ) { 79 | // Both box models exclude margin, so add it if we want it 80 | if ( extra === "margin" ) { 81 | val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 82 | } 83 | 84 | if ( isBorderBox ) { 85 | // border-box includes padding, so remove it if we want content 86 | if ( extra === "content" ) { 87 | val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 88 | } 89 | 90 | // At this point, extra isn't border nor margin, so remove border 91 | if ( extra !== "margin" ) { 92 | val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 93 | } 94 | } else { 95 | // At this point, extra isn't content, so add padding 96 | val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 97 | 98 | // At this point, extra isn't content nor padding, so add border 99 | if ( extra !== "padding" ) { 100 | val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 101 | } 102 | } 103 | } 104 | 105 | return val; 106 | } 107 | 108 | function getWidthOrHeight( elem, name, extra ) { 109 | 110 | // Start with offset property, which is equivalent to the border-box value 111 | var valueIsBorderBox = true, 112 | val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 113 | styles = getStyles( elem ), 114 | isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 115 | 116 | // Some non-html elements return undefined for offsetWidth, so check for null/undefined 117 | // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 118 | // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 119 | if ( val <= 0 || val == null ) { 120 | // Fall back to computed then uncomputed css if necessary 121 | val = curCSS( elem, name, styles ); 122 | if ( val < 0 || val == null ) { 123 | val = elem.style[ name ]; 124 | } 125 | 126 | // Computed unit is not pixels. Stop here and return. 127 | if ( rnumnonpx.test(val) ) { 128 | return val; 129 | } 130 | 131 | // Check for style in case a browser which returns unreliable values 132 | // for getComputedStyle silently falls back to the reliable elem.style 133 | valueIsBorderBox = isBorderBox && 134 | ( support.boxSizingReliable() || val === elem.style[ name ] ); 135 | 136 | // Normalize "", auto, and prepare for extra 137 | val = parseFloat( val ) || 0; 138 | } 139 | 140 | // Use the active box-sizing model to add/subtract irrelevant styles 141 | return ( val + 142 | augmentWidthOrHeight( 143 | elem, 144 | name, 145 | extra || ( isBorderBox ? "border" : "content" ), 146 | valueIsBorderBox, 147 | styles 148 | ) 149 | ) + "px"; 150 | } 151 | 152 | function showHide( elements, show ) { 153 | var display, elem, hidden, 154 | values = [], 155 | index = 0, 156 | length = elements.length; 157 | 158 | for ( ; index < length; index++ ) { 159 | elem = elements[ index ]; 160 | if ( !elem.style ) { 161 | continue; 162 | } 163 | 164 | values[ index ] = data_priv.get( elem, "olddisplay" ); 165 | display = elem.style.display; 166 | if ( show ) { 167 | // Reset the inline display of this element to learn if it is 168 | // being hidden by cascaded rules or not 169 | if ( !values[ index ] && display === "none" ) { 170 | elem.style.display = ""; 171 | } 172 | 173 | // Set elements which have been overridden with display: none 174 | // in a stylesheet to whatever the default browser style is 175 | // for such an element 176 | if ( elem.style.display === "" && isHidden( elem ) ) { 177 | values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) ); 178 | } 179 | } else { 180 | hidden = isHidden( elem ); 181 | 182 | if ( display !== "none" || !hidden ) { 183 | data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); 184 | } 185 | } 186 | } 187 | 188 | // Set the display of most of the elements in a second loop 189 | // to avoid the constant reflow 190 | for ( index = 0; index < length; index++ ) { 191 | elem = elements[ index ]; 192 | if ( !elem.style ) { 193 | continue; 194 | } 195 | if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 196 | elem.style.display = show ? values[ index ] || "" : "none"; 197 | } 198 | } 199 | 200 | return elements; 201 | } 202 | 203 | jQuery.extend({ 204 | 205 | // Add in style property hooks for overriding the default 206 | // behavior of getting and setting a style property 207 | cssHooks: { 208 | opacity: { 209 | get: function( elem, computed ) { 210 | if ( computed ) { 211 | 212 | // We should always get a number back from opacity 213 | var ret = curCSS( elem, "opacity" ); 214 | return ret === "" ? "1" : ret; 215 | } 216 | } 217 | } 218 | }, 219 | 220 | // Don't automatically add "px" to these possibly-unitless properties 221 | cssNumber: { 222 | "columnCount": true, 223 | "fillOpacity": true, 224 | "flexGrow": true, 225 | "flexShrink": true, 226 | "fontWeight": true, 227 | "lineHeight": true, 228 | "opacity": true, 229 | "order": true, 230 | "orphans": true, 231 | "widows": true, 232 | "zIndex": true, 233 | "zoom": true 234 | }, 235 | 236 | // Add in properties whose names you wish to fix before 237 | // setting or getting the value 238 | cssProps: { 239 | "float": "cssFloat" 240 | }, 241 | 242 | // Get and set the style property on a DOM Node 243 | style: function( elem, name, value, extra ) { 244 | 245 | // Don't set styles on text and comment nodes 246 | if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 247 | return; 248 | } 249 | 250 | // Make sure that we're working with the right name 251 | var ret, type, hooks, 252 | origName = jQuery.camelCase( name ), 253 | style = elem.style; 254 | 255 | name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); 256 | 257 | // Gets hook for the prefixed version, then unprefixed version 258 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 259 | 260 | // Check if we're setting a value 261 | if ( value !== undefined ) { 262 | type = typeof value; 263 | 264 | // Convert "+=" or "-=" to relative numbers (#7345) 265 | if ( type === "string" && (ret = rrelNum.exec( value )) ) { 266 | value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); 267 | // Fixes bug #9237 268 | type = "number"; 269 | } 270 | 271 | // Make sure that null and NaN values aren't set (#7116) 272 | if ( value == null || value !== value ) { 273 | return; 274 | } 275 | 276 | // If a number, add 'px' to the (except for certain CSS properties) 277 | if ( type === "number" && !jQuery.cssNumber[ origName ] ) { 278 | value += "px"; 279 | } 280 | 281 | // Support: IE9-11+ 282 | // background-* props affect original clone's values 283 | if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 284 | style[ name ] = "inherit"; 285 | } 286 | 287 | // If a hook was provided, use that value, otherwise just set the specified value 288 | if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { 289 | style[ name ] = value; 290 | } 291 | 292 | } else { 293 | // If a hook was provided get the non-computed value from there 294 | if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { 295 | return ret; 296 | } 297 | 298 | // Otherwise just get the value from the style object 299 | return style[ name ]; 300 | } 301 | }, 302 | 303 | css: function( elem, name, extra, styles ) { 304 | var val, num, hooks, 305 | origName = jQuery.camelCase( name ); 306 | 307 | // Make sure that we're working with the right name 308 | name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); 309 | 310 | // Try prefixed name followed by the unprefixed name 311 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 312 | 313 | // If a hook was provided get the computed value from there 314 | if ( hooks && "get" in hooks ) { 315 | val = hooks.get( elem, true, extra ); 316 | } 317 | 318 | // Otherwise, if a way to get the computed value exists, use that 319 | if ( val === undefined ) { 320 | val = curCSS( elem, name, styles ); 321 | } 322 | 323 | // Convert "normal" to computed value 324 | if ( val === "normal" && name in cssNormalTransform ) { 325 | val = cssNormalTransform[ name ]; 326 | } 327 | 328 | // Make numeric if forced or a qualifier was provided and val looks numeric 329 | if ( extra === "" || extra ) { 330 | num = parseFloat( val ); 331 | return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; 332 | } 333 | return val; 334 | } 335 | }); 336 | 337 | jQuery.each([ "height", "width" ], function( i, name ) { 338 | jQuery.cssHooks[ name ] = { 339 | get: function( elem, computed, extra ) { 340 | if ( computed ) { 341 | 342 | // Certain elements can have dimension info if we invisibly show them 343 | // but it must have a current display style that would benefit 344 | return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? 345 | jQuery.swap( elem, cssShow, function() { 346 | return getWidthOrHeight( elem, name, extra ); 347 | }) : 348 | getWidthOrHeight( elem, name, extra ); 349 | } 350 | }, 351 | 352 | set: function( elem, value, extra ) { 353 | var styles = extra && getStyles( elem ); 354 | return setPositiveNumber( elem, value, extra ? 355 | augmentWidthOrHeight( 356 | elem, 357 | name, 358 | extra, 359 | jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 360 | styles 361 | ) : 0 362 | ); 363 | } 364 | }; 365 | }); 366 | 367 | // Support: Android 2.3 368 | jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, 369 | function( elem, computed ) { 370 | if ( computed ) { 371 | return jQuery.swap( elem, { "display": "inline-block" }, 372 | curCSS, [ elem, "marginRight" ] ); 373 | } 374 | } 375 | ); 376 | 377 | // These hooks are used by animate to expand properties 378 | jQuery.each({ 379 | margin: "", 380 | padding: "", 381 | border: "Width" 382 | }, function( prefix, suffix ) { 383 | jQuery.cssHooks[ prefix + suffix ] = { 384 | expand: function( value ) { 385 | var i = 0, 386 | expanded = {}, 387 | 388 | // Assumes a single number if not a string 389 | parts = typeof value === "string" ? value.split(" ") : [ value ]; 390 | 391 | for ( ; i < 4; i++ ) { 392 | expanded[ prefix + cssExpand[ i ] + suffix ] = 393 | parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 394 | } 395 | 396 | return expanded; 397 | } 398 | }; 399 | 400 | if ( !rmargin.test( prefix ) ) { 401 | jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 402 | } 403 | }); 404 | 405 | jQuery.fn.extend({ 406 | css: function( name, value ) { 407 | return access( this, function( elem, name, value ) { 408 | var styles, len, 409 | map = {}, 410 | i = 0; 411 | 412 | if ( jQuery.isArray( name ) ) { 413 | styles = getStyles( elem ); 414 | len = name.length; 415 | 416 | for ( ; i < len; i++ ) { 417 | map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 418 | } 419 | 420 | return map; 421 | } 422 | 423 | return value !== undefined ? 424 | jQuery.style( elem, name, value ) : 425 | jQuery.css( elem, name ); 426 | }, name, value, arguments.length > 1 ); 427 | }, 428 | show: function() { 429 | return showHide( this, true ); 430 | }, 431 | hide: function() { 432 | return showHide( this ); 433 | }, 434 | toggle: function( state ) { 435 | if ( typeof state === "boolean" ) { 436 | return state ? this.show() : this.hide(); 437 | } 438 | 439 | return this.each(function() { 440 | if ( isHidden( this ) ) { 441 | jQuery( this ).show(); 442 | } else { 443 | jQuery( this ).hide(); 444 | } 445 | }); 446 | } 447 | }); 448 | 449 | return jQuery; 450 | }); 451 | -------------------------------------------------------------------------------- /assets/jquery/src/manipulation.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./var/concat", 4 | "./var/push", 5 | "./core/access", 6 | "./manipulation/var/rcheckableType", 7 | "./manipulation/support", 8 | "./data/var/data_priv", 9 | "./data/var/data_user", 10 | 11 | "./core/init", 12 | "./data/accepts", 13 | "./traversing", 14 | "./selector", 15 | "./event" 16 | ], function( jQuery, concat, push, access, rcheckableType, support, data_priv, data_user ) { 17 | 18 | var 19 | rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, 20 | rtagName = /<([\w:]+)/, 21 | rhtml = /<|&#?\w+;/, 22 | rnoInnerhtml = /<(?:script|style|link)/i, 23 | // checked="checked" or checked 24 | rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 25 | rscriptType = /^$|\/(?:java|ecma)script/i, 26 | rscriptTypeMasked = /^true\/(.*)/, 27 | rcleanScript = /^\s*\s*$/g, 28 | 29 | // We have to close these tags to support XHTML (#13200) 30 | wrapMap = { 31 | 32 | // Support: IE9 33 | option: [ 1, "" ], 34 | 35 | thead: [ 1, "", "
" ], 36 | col: [ 2, "", "
" ], 37 | tr: [ 2, "", "
" ], 38 | td: [ 3, "", "
" ], 39 | 40 | _default: [ 0, "", "" ] 41 | }; 42 | 43 | // Support: IE9 44 | wrapMap.optgroup = wrapMap.option; 45 | 46 | wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 47 | wrapMap.th = wrapMap.td; 48 | 49 | // Support: 1.x compatibility 50 | // Manipulating tables requires a tbody 51 | function manipulationTarget( elem, content ) { 52 | return jQuery.nodeName( elem, "table" ) && 53 | jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? 54 | 55 | elem.getElementsByTagName("tbody")[0] || 56 | elem.appendChild( elem.ownerDocument.createElement("tbody") ) : 57 | elem; 58 | } 59 | 60 | // Replace/restore the type attribute of script elements for safe DOM manipulation 61 | function disableScript( elem ) { 62 | elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; 63 | return elem; 64 | } 65 | function restoreScript( elem ) { 66 | var match = rscriptTypeMasked.exec( elem.type ); 67 | 68 | if ( match ) { 69 | elem.type = match[ 1 ]; 70 | } else { 71 | elem.removeAttribute("type"); 72 | } 73 | 74 | return elem; 75 | } 76 | 77 | // Mark scripts as having already been evaluated 78 | function setGlobalEval( elems, refElements ) { 79 | var i = 0, 80 | l = elems.length; 81 | 82 | for ( ; i < l; i++ ) { 83 | data_priv.set( 84 | elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) 85 | ); 86 | } 87 | } 88 | 89 | function cloneCopyEvent( src, dest ) { 90 | var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; 91 | 92 | if ( dest.nodeType !== 1 ) { 93 | return; 94 | } 95 | 96 | // 1. Copy private data: events, handlers, etc. 97 | if ( data_priv.hasData( src ) ) { 98 | pdataOld = data_priv.access( src ); 99 | pdataCur = data_priv.set( dest, pdataOld ); 100 | events = pdataOld.events; 101 | 102 | if ( events ) { 103 | delete pdataCur.handle; 104 | pdataCur.events = {}; 105 | 106 | for ( type in events ) { 107 | for ( i = 0, l = events[ type ].length; i < l; i++ ) { 108 | jQuery.event.add( dest, type, events[ type ][ i ] ); 109 | } 110 | } 111 | } 112 | } 113 | 114 | // 2. Copy user data 115 | if ( data_user.hasData( src ) ) { 116 | udataOld = data_user.access( src ); 117 | udataCur = jQuery.extend( {}, udataOld ); 118 | 119 | data_user.set( dest, udataCur ); 120 | } 121 | } 122 | 123 | function getAll( context, tag ) { 124 | var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : 125 | context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : 126 | []; 127 | 128 | return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 129 | jQuery.merge( [ context ], ret ) : 130 | ret; 131 | } 132 | 133 | // Fix IE bugs, see support tests 134 | function fixInput( src, dest ) { 135 | var nodeName = dest.nodeName.toLowerCase(); 136 | 137 | // Fails to persist the checked state of a cloned checkbox or radio button. 138 | if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 139 | dest.checked = src.checked; 140 | 141 | // Fails to return the selected option to the default selected state when cloning options 142 | } else if ( nodeName === "input" || nodeName === "textarea" ) { 143 | dest.defaultValue = src.defaultValue; 144 | } 145 | } 146 | 147 | jQuery.extend({ 148 | clone: function( elem, dataAndEvents, deepDataAndEvents ) { 149 | var i, l, srcElements, destElements, 150 | clone = elem.cloneNode( true ), 151 | inPage = jQuery.contains( elem.ownerDocument, elem ); 152 | 153 | // Fix IE cloning issues 154 | if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 155 | !jQuery.isXMLDoc( elem ) ) { 156 | 157 | // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 158 | destElements = getAll( clone ); 159 | srcElements = getAll( elem ); 160 | 161 | for ( i = 0, l = srcElements.length; i < l; i++ ) { 162 | fixInput( srcElements[ i ], destElements[ i ] ); 163 | } 164 | } 165 | 166 | // Copy the events from the original to the clone 167 | if ( dataAndEvents ) { 168 | if ( deepDataAndEvents ) { 169 | srcElements = srcElements || getAll( elem ); 170 | destElements = destElements || getAll( clone ); 171 | 172 | for ( i = 0, l = srcElements.length; i < l; i++ ) { 173 | cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 174 | } 175 | } else { 176 | cloneCopyEvent( elem, clone ); 177 | } 178 | } 179 | 180 | // Preserve script evaluation history 181 | destElements = getAll( clone, "script" ); 182 | if ( destElements.length > 0 ) { 183 | setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 184 | } 185 | 186 | // Return the cloned set 187 | return clone; 188 | }, 189 | 190 | buildFragment: function( elems, context, scripts, selection ) { 191 | var elem, tmp, tag, wrap, contains, j, 192 | fragment = context.createDocumentFragment(), 193 | nodes = [], 194 | i = 0, 195 | l = elems.length; 196 | 197 | for ( ; i < l; i++ ) { 198 | elem = elems[ i ]; 199 | 200 | if ( elem || elem === 0 ) { 201 | 202 | // Add nodes directly 203 | if ( jQuery.type( elem ) === "object" ) { 204 | // Support: QtWebKit, PhantomJS 205 | // push.apply(_, arraylike) throws on ancient WebKit 206 | jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 207 | 208 | // Convert non-html into a text node 209 | } else if ( !rhtml.test( elem ) ) { 210 | nodes.push( context.createTextNode( elem ) ); 211 | 212 | // Convert html into DOM nodes 213 | } else { 214 | tmp = tmp || fragment.appendChild( context.createElement("div") ); 215 | 216 | // Deserialize a standard representation 217 | tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 218 | wrap = wrapMap[ tag ] || wrapMap._default; 219 | tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[ 2 ]; 220 | 221 | // Descend through wrappers to the right content 222 | j = wrap[ 0 ]; 223 | while ( j-- ) { 224 | tmp = tmp.lastChild; 225 | } 226 | 227 | // Support: QtWebKit, PhantomJS 228 | // push.apply(_, arraylike) throws on ancient WebKit 229 | jQuery.merge( nodes, tmp.childNodes ); 230 | 231 | // Remember the top-level container 232 | tmp = fragment.firstChild; 233 | 234 | // Ensure the created nodes are orphaned (#12392) 235 | tmp.textContent = ""; 236 | } 237 | } 238 | } 239 | 240 | // Remove wrapper from fragment 241 | fragment.textContent = ""; 242 | 243 | i = 0; 244 | while ( (elem = nodes[ i++ ]) ) { 245 | 246 | // #4087 - If origin and destination elements are the same, and this is 247 | // that element, do not do anything 248 | if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { 249 | continue; 250 | } 251 | 252 | contains = jQuery.contains( elem.ownerDocument, elem ); 253 | 254 | // Append to fragment 255 | tmp = getAll( fragment.appendChild( elem ), "script" ); 256 | 257 | // Preserve script evaluation history 258 | if ( contains ) { 259 | setGlobalEval( tmp ); 260 | } 261 | 262 | // Capture executables 263 | if ( scripts ) { 264 | j = 0; 265 | while ( (elem = tmp[ j++ ]) ) { 266 | if ( rscriptType.test( elem.type || "" ) ) { 267 | scripts.push( elem ); 268 | } 269 | } 270 | } 271 | } 272 | 273 | return fragment; 274 | }, 275 | 276 | cleanData: function( elems ) { 277 | var data, elem, type, key, 278 | special = jQuery.event.special, 279 | i = 0; 280 | 281 | for ( ; (elem = elems[ i ]) !== undefined; i++ ) { 282 | if ( jQuery.acceptData( elem ) ) { 283 | key = elem[ data_priv.expando ]; 284 | 285 | if ( key && (data = data_priv.cache[ key ]) ) { 286 | if ( data.events ) { 287 | for ( type in data.events ) { 288 | if ( special[ type ] ) { 289 | jQuery.event.remove( elem, type ); 290 | 291 | // This is a shortcut to avoid jQuery.event.remove's overhead 292 | } else { 293 | jQuery.removeEvent( elem, type, data.handle ); 294 | } 295 | } 296 | } 297 | if ( data_priv.cache[ key ] ) { 298 | // Discard any remaining `private` data 299 | delete data_priv.cache[ key ]; 300 | } 301 | } 302 | } 303 | // Discard any remaining `user` data 304 | delete data_user.cache[ elem[ data_user.expando ] ]; 305 | } 306 | } 307 | }); 308 | 309 | jQuery.fn.extend({ 310 | text: function( value ) { 311 | return access( this, function( value ) { 312 | return value === undefined ? 313 | jQuery.text( this ) : 314 | this.empty().each(function() { 315 | if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 316 | this.textContent = value; 317 | } 318 | }); 319 | }, null, value, arguments.length ); 320 | }, 321 | 322 | append: function() { 323 | return this.domManip( arguments, function( elem ) { 324 | if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 325 | var target = manipulationTarget( this, elem ); 326 | target.appendChild( elem ); 327 | } 328 | }); 329 | }, 330 | 331 | prepend: function() { 332 | return this.domManip( arguments, function( elem ) { 333 | if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 334 | var target = manipulationTarget( this, elem ); 335 | target.insertBefore( elem, target.firstChild ); 336 | } 337 | }); 338 | }, 339 | 340 | before: function() { 341 | return this.domManip( arguments, function( elem ) { 342 | if ( this.parentNode ) { 343 | this.parentNode.insertBefore( elem, this ); 344 | } 345 | }); 346 | }, 347 | 348 | after: function() { 349 | return this.domManip( arguments, function( elem ) { 350 | if ( this.parentNode ) { 351 | this.parentNode.insertBefore( elem, this.nextSibling ); 352 | } 353 | }); 354 | }, 355 | 356 | remove: function( selector, keepData /* Internal Use Only */ ) { 357 | var elem, 358 | elems = selector ? jQuery.filter( selector, this ) : this, 359 | i = 0; 360 | 361 | for ( ; (elem = elems[i]) != null; i++ ) { 362 | if ( !keepData && elem.nodeType === 1 ) { 363 | jQuery.cleanData( getAll( elem ) ); 364 | } 365 | 366 | if ( elem.parentNode ) { 367 | if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { 368 | setGlobalEval( getAll( elem, "script" ) ); 369 | } 370 | elem.parentNode.removeChild( elem ); 371 | } 372 | } 373 | 374 | return this; 375 | }, 376 | 377 | empty: function() { 378 | var elem, 379 | i = 0; 380 | 381 | for ( ; (elem = this[i]) != null; i++ ) { 382 | if ( elem.nodeType === 1 ) { 383 | 384 | // Prevent memory leaks 385 | jQuery.cleanData( getAll( elem, false ) ); 386 | 387 | // Remove any remaining nodes 388 | elem.textContent = ""; 389 | } 390 | } 391 | 392 | return this; 393 | }, 394 | 395 | clone: function( dataAndEvents, deepDataAndEvents ) { 396 | dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 397 | deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 398 | 399 | return this.map(function() { 400 | return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 401 | }); 402 | }, 403 | 404 | html: function( value ) { 405 | return access( this, function( value ) { 406 | var elem = this[ 0 ] || {}, 407 | i = 0, 408 | l = this.length; 409 | 410 | if ( value === undefined && elem.nodeType === 1 ) { 411 | return elem.innerHTML; 412 | } 413 | 414 | // See if we can take a shortcut and just use innerHTML 415 | if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 416 | !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 417 | 418 | value = value.replace( rxhtmlTag, "<$1>" ); 419 | 420 | try { 421 | for ( ; i < l; i++ ) { 422 | elem = this[ i ] || {}; 423 | 424 | // Remove element nodes and prevent memory leaks 425 | if ( elem.nodeType === 1 ) { 426 | jQuery.cleanData( getAll( elem, false ) ); 427 | elem.innerHTML = value; 428 | } 429 | } 430 | 431 | elem = 0; 432 | 433 | // If using innerHTML throws an exception, use the fallback method 434 | } catch( e ) {} 435 | } 436 | 437 | if ( elem ) { 438 | this.empty().append( value ); 439 | } 440 | }, null, value, arguments.length ); 441 | }, 442 | 443 | replaceWith: function() { 444 | var arg = arguments[ 0 ]; 445 | 446 | // Make the changes, replacing each context element with the new content 447 | this.domManip( arguments, function( elem ) { 448 | arg = this.parentNode; 449 | 450 | jQuery.cleanData( getAll( this ) ); 451 | 452 | if ( arg ) { 453 | arg.replaceChild( elem, this ); 454 | } 455 | }); 456 | 457 | // Force removal if there was no new content (e.g., from empty arguments) 458 | return arg && (arg.length || arg.nodeType) ? this : this.remove(); 459 | }, 460 | 461 | detach: function( selector ) { 462 | return this.remove( selector, true ); 463 | }, 464 | 465 | domManip: function( args, callback ) { 466 | 467 | // Flatten any nested arrays 468 | args = concat.apply( [], args ); 469 | 470 | var fragment, first, scripts, hasScripts, node, doc, 471 | i = 0, 472 | l = this.length, 473 | set = this, 474 | iNoClone = l - 1, 475 | value = args[ 0 ], 476 | isFunction = jQuery.isFunction( value ); 477 | 478 | // We can't cloneNode fragments that contain checked, in WebKit 479 | if ( isFunction || 480 | ( l > 1 && typeof value === "string" && 481 | !support.checkClone && rchecked.test( value ) ) ) { 482 | return this.each(function( index ) { 483 | var self = set.eq( index ); 484 | if ( isFunction ) { 485 | args[ 0 ] = value.call( this, index, self.html() ); 486 | } 487 | self.domManip( args, callback ); 488 | }); 489 | } 490 | 491 | if ( l ) { 492 | fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); 493 | first = fragment.firstChild; 494 | 495 | if ( fragment.childNodes.length === 1 ) { 496 | fragment = first; 497 | } 498 | 499 | if ( first ) { 500 | scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 501 | hasScripts = scripts.length; 502 | 503 | // Use the original fragment for the last item instead of the first because it can end up 504 | // being emptied incorrectly in certain situations (#8070). 505 | for ( ; i < l; i++ ) { 506 | node = fragment; 507 | 508 | if ( i !== iNoClone ) { 509 | node = jQuery.clone( node, true, true ); 510 | 511 | // Keep references to cloned scripts for later restoration 512 | if ( hasScripts ) { 513 | // Support: QtWebKit 514 | // jQuery.merge because push.apply(_, arraylike) throws 515 | jQuery.merge( scripts, getAll( node, "script" ) ); 516 | } 517 | } 518 | 519 | callback.call( this[ i ], node, i ); 520 | } 521 | 522 | if ( hasScripts ) { 523 | doc = scripts[ scripts.length - 1 ].ownerDocument; 524 | 525 | // Reenable scripts 526 | jQuery.map( scripts, restoreScript ); 527 | 528 | // Evaluate executable scripts on first document insertion 529 | for ( i = 0; i < hasScripts; i++ ) { 530 | node = scripts[ i ]; 531 | if ( rscriptType.test( node.type || "" ) && 532 | !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { 533 | 534 | if ( node.src ) { 535 | // Optional AJAX dependency, but won't run scripts if not present 536 | if ( jQuery._evalUrl ) { 537 | jQuery._evalUrl( node.src ); 538 | } 539 | } else { 540 | jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); 541 | } 542 | } 543 | } 544 | } 545 | } 546 | } 547 | 548 | return this; 549 | } 550 | }); 551 | 552 | jQuery.each({ 553 | appendTo: "append", 554 | prependTo: "prepend", 555 | insertBefore: "before", 556 | insertAfter: "after", 557 | replaceAll: "replaceWith" 558 | }, function( name, original ) { 559 | jQuery.fn[ name ] = function( selector ) { 560 | var elems, 561 | ret = [], 562 | insert = jQuery( selector ), 563 | last = insert.length - 1, 564 | i = 0; 565 | 566 | for ( ; i <= last; i++ ) { 567 | elems = i === last ? this : this.clone( true ); 568 | jQuery( insert[ i ] )[ original ]( elems ); 569 | 570 | // Support: QtWebKit 571 | // .get() because push.apply(_, arraylike) throws 572 | push.apply( ret, elems.get() ); 573 | } 574 | 575 | return this.pushStack( ret ); 576 | }; 577 | }); 578 | 579 | return jQuery; 580 | }); 581 | --------------------------------------------------------------------------------