diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 00000000..7bb67b3f --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "res/bower-libs" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 840cd0d3..fb588958 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ chrome-app* .settings node_modules Thumbs.db +res/bower-libs diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 00000000..c4aeac23 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,209 @@ +module.exports = function(grunt) { + + grunt.loadNpmTasks('grunt-contrib-requirejs'); + grunt.loadNpmTasks('grunt-contrib-less'); + grunt.loadNpmTasks('grunt-string-replace'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-bower-requirejs'); + + /*************************************************************************** + * Configuration + */ + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + requirejs: { + compile: { + options: { + baseUrl: "res", + name: "main", + out: "res-min/main.js", + mainConfigFile: 'res/main.js', + optimize: "uglify2", + uglify2: { + output: { + beautify: true, + indent_level: 1, + }, + }, + excludeShallow: [ + 'css/css-builder', + 'less/lessc-server', + 'less/lessc' + ], + } + } + }, + less: { + compile: { + files: [ + { + expand: true, + cwd: 'res/themes', + src: [ + '*.less' + ], + dest: 'res-min/themes', + ext: '.css', + } + ] + }, + compress: { + options: { + compress: true, + paths: 'res/styles' + }, + files: [ + { + expand: true, + cwd: 'res-min/themes', + src: [ + '*.css' + ], + dest: 'res-min/themes', + } + ] + }, + }, + 'string-replace': { + 'css-import': { + files: { + './': 'res-min/themes/*.css', + }, + options: { + replacements: [ + { + pattern: /@import /g, + replacement: '@import (less) ' + } + ] + } + }, + 'cache-manifest': { + files: { + 'cache.manifest': 'cache.manifest' + }, + options: { + replacements: [ + { + pattern: /(#Date ).*/, + replacement: '$1<%= grunt.template.today() %>' + }, + { + pattern: /(#DynamicResourcesBegin\n)[\s\S]*(\n#DynamicResourcesEnd)/, + replacement: '$1<%= resources %>$2' + }, + ] + } + } + }, + copy: { + resources: { + files: [ + // Fonts + { + expand: true, + cwd: 'res/libs/fontello/font', + src: [ + '**' + ], + dest: 'res-min/font/' + }, + // Images + { + expand: true, + cwd: 'res/img', + src: [ + '**' + ], + dest: 'res-min/img/' + }, + // Libraries + { + expand: true, + cwd: 'res/bower-libs/requirejs', + src: [ + 'require.js' + ], + dest: 'res-min/' + }, + ] + } + }, + // Inject bower dependencies into RequireJS configuration + bower: { + target: { + rjsConfig: 'res/main.js' + } + } + }); + + /*************************************************************************** + * Clean + */ + grunt.registerTask('clean', function() { + + // Remove res-min/ folder + grunt.file['delete']('res-min'); + + }); + + /*************************************************************************** + * Build JavaScript + */ + grunt.registerTask('build-js', function() { + + // Run r.js optimization + grunt.task.run('requirejs'); + + }); + + /*************************************************************************** + * Build CSS + */ + grunt.registerTask('build-css', function() { + + // First compile less files + grunt.task.run('less:compile'); + // Then force evaluation of CSS imports + grunt.task.run('string-replace:css-import'); + // Run less another time with CSS evaluation and compression + grunt.task.run('less:compress'); + + }); + + /*************************************************************************** + * Resources + */ + grunt.registerTask('build-res', function() { + + // Copy some resources (images, fonts...) + grunt.task.run('copy:resources'); + + // List resources and inject them in cache.manifest + grunt.task.run('list-res'); + grunt.task.run('string-replace:cache-manifest'); + + }); + + /*************************************************************************** + * Other tasks + */ + grunt.registerTask('list-res', function() { + var resourceList = []; + grunt.file.recurse('res-min', function(abspath) { + resourceList.push(abspath); + }); + grunt.config.set('resources', resourceList.join('\n')); + }); + + function getResources(folder) { + return result; + } + + grunt.registerTask('default', function() { + grunt.task.run('clean'); + grunt.task.run('build-js'); + grunt.task.run('build-css'); + grunt.task.run('build-res'); + }); +}; \ No newline at end of file diff --git a/bower.json b/bower.json new file mode 100644 index 00000000..22711a60 --- /dev/null +++ b/bower.json @@ -0,0 +1,21 @@ +{ + "name": "stackedit", + "dependencies": { + "bootstrap": "3.0.0", + "jquery": "2.0.3", + "underscore": "1.5.1", + "requirejs": "~2.1.8", + "require-css": "~0.0.7", + "require-less": "~0.0.7", + "mousetrap": "~1.4.4", + "jgrowl": "~1.2.10", + "google-code-prettify": "~1.0.0", + "highlightjs": "~7.3.0", + "jquery-ui": "~1.10.3", + "jquery-mousewheel": "~3.1.3", + "css_browser_selector": "*", + "FileSaver": "*", + "stacktrace": "~0.5.3", + "requirejs-text": "~2.0.10" + } +} diff --git a/cache.manifest b/cache.manifest index 605ab3db..758481fd 100644 --- a/cache.manifest +++ b/cache.manifest @@ -1,9 +1,9 @@ CACHE MANIFEST +#Date Fri Aug 30 2013 23:33:00 CACHE: index.html viewer.html -res/libs/require.js lib/MathJax/MathJax.js?config=TeX-AMS_HTML lib/MathJax/config/Safe.js lib/MathJax/config/TeX-AMS_HTML.js @@ -85,9 +85,7 @@ lib/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/PUA.js lib/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SpacingModLetters.js lib/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SuppMathOperators.js -#dynamic - -# Mon 26 Aug 2013 13:29:32 WEST +#DynamicResourcesBegin res-min/font/fontello.eot res-min/font/fontello.svg res-min/font/fontello.ttf @@ -106,9 +104,11 @@ res-min/img/stackedit-32.ico res-min/img/stackedit-64.png res-min/img/stackedit-promo.png res-min/main.js +res-min/require.js res-min/themes/blue-gray.css res-min/themes/default.css res-min/themes/night.css +#DynamicResourcesEnd NETWORK: * \ No newline at end of file diff --git a/index.html b/index.html index f7e546b9..1d603083 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ ] }; - + diff --git a/package.json b/package.json new file mode 100644 index 00000000..508e2483 --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "stackedit", + "version": "2.0.0", + "description": "StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.", + "main": "res/main.js", + "directories": { + "doc": "doc" + }, + "dependencies": { + "less": "~1.4.2", + "requirejs": "~2.1.8" + }, + "devDependencies": { + "grunt": "~0.4.1", + "grunt-contrib-requirejs": "~0.4.1", + "grunt-contrib-less": "~0.7.0", + "grunt-string-replace": "~0.2.4", + "grunt-contrib-copy": "~0.4.1", + "bower": "~1.2.5", + "grunt-bower-requirejs": "~0.7.1", + "grunt-bower-task": "~0.3.1" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/benweet/stackedit.git" + }, + "author": "Benoit Schweblin", + "license": "Apache License", + "bugs": { + "url": "https://github.com/benweet/stackedit/issues" + } +} diff --git a/res-min/main.js b/res-min/main.js index 0a1d5b24..fb4262d0 100644 --- a/res-min/main.js +++ b/res-min/main.js @@ -23,9 +23,10 @@ * Date: 2013-06-03 */ -// > http://underscorejs.org -// > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// > Underscore may be freely distributed under the MIT license. +// Underscore.js 1.5.1 +// http://underscorejs.org +// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. //Copyright (C) 2012 Kory Nunn @@ -36,7 +37,7 @@ /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ /** - * @license RequireJS text 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/requirejs/text for details */ @@ -67,12 +68,12 @@ * Mousetrap is a simple keyboard shortcut library for Javascript with * no external dependencies * - * @version 1.4.1 + * @version 1.4.4 * @url craig.is/killing/mice */ /** - * jGrowl 1.2.12 + * jGrowl 1.2.10 * * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. @@ -80,24 +81,13 @@ * Written by Stan Lemon * Last updated: 2013.02.14 * - * jGrowl is a jQuery plugin implementing unobtrusive userland notifications. These + * jGrowl is a jQuery plugin implementing unobtrusive userland notifications. These * notifications function similarly to the Growl Framework available for * Mac OS X (http://growl.info). * * To Do: * - Move library settings to containers and allow them to be changed per container * - * Changes in 1.2.13 - * - Fixed clearing interval when the container shuts down - * - * Changes in 1.2.12 - * - Added compressed versions using UglifyJS and Sqwish - * - Improved README with configuration options explanation - * - Added a source map - * - * Changes in 1.2.11 - * - Fix artifacts left behind by the shutdown method and text-cleanup - * * Changes in 1.2.10 * - Fix beforeClose to be called in click event * @@ -110,14 +100,14 @@ * * Changes in 1.2.6 * - Fixed js error when a notification is opening and closing at the same time - * + * * Changes in 1.2.5 * - Changed wrapper jGrowl's options usage to "o" instead of $.jGrowl.defaults * - Added themeState option to control 'highlight' or 'error' for jQuery UI * - Ammended some CSS to provide default positioning for nested usage. * - Changed some CSS to be prefixed with jGrowl- to prevent namespacing issues - * - Added two new options - openDuration and closeDuration to allow - * better control of notification open and close speeds, respectively + * - Added two new options - openDuration and closeDuration to allow + * better control of notification open and close speeds, respectively * Patch contributed by Jesse Vincet. * - Added afterOpen callback. Patch contributed by Russel Branca. * @@ -215,13 +205,29 @@ // limitations under the License. /* -CSS Browser Selector 0.6.1 -Originally written by Rafael Lima (http://rafael.adm.br) +CSS Browser Selector v0.4.0 (Nov 02, 2010) +Rafael Lima (http://rafael.adm.br) http://rafael.adm.br/css_browser_selector License: http://creativecommons.org/licenses/by/2.5/ +Contributors: http://rafael.adm.br/css_browser_selector#contributors -Co-maintained by: -https://github.com/verbatim/css_browser_selector +v0.5.0 2011-08-24 +andrew relkin + +modified, now detects: +any version of Firefox +more versions of Windows (Win8, Win7, Vista, XP, Win2k) +more versions of IE under unique conditions +more detailed support for Opera +if "no-js" in HTML class: removes and replaces with "js" () + +identifies + browsers: Firefox; IE; Opera; Safari; Chrome, Konqueror, Iron + browser versions: (most importantly: ie6, ie7, ie8, ie9) + rendering engines: Webkit; Mozilla; Gecko + platforms/OSes: Mac; Win: Win7, Vista, XP, Win2k; FreeBSD; Linux/x11 + devices: Ipod; Ipad; Iphone; WebTV; Blackberry; Android; J2me; mobile(generic) + enabled technology: JS */ @@ -482,10 +488,68 @@ https://github.com/verbatim/css_browser_selector * Licensed under the MIT license. */ -/*! jQuery UI - v1.10.3 - 2013-08-03 -* http://jqueryui.com -* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.effect.js, jquery.ui.effect-slide.js -* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ +/*! + * jQuery UI Core 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/category/ui-core/ + */ + +/*! + * jQuery UI Widget 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/jQuery.widget/ + */ + +/*! + * jQuery UI Mouse 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/mouse/ + * + * Depends: + * jquery.ui.widget.js + */ + +/*! + * jQuery UI Draggable 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/draggable/ + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ + +/*! + * jQuery UI Effects 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/category/effects-core/ + */ /*! * jQuery Color Animations v2.1.2 @@ -498,6 +562,20 @@ https://github.com/verbatim/css_browser_selector * Date: Wed Jan 16 08:47:09 2013 -0600 */ +/*! + * jQuery UI Effects Slide 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/slide-effect/ + * + * Depends: + * jquery.ui.effect.js + */ + /** * @preserve * jquery.layout 1.3.0 - Release Candidate 30.79 @@ -583,34 +661,12 @@ function runDelayedFunction() { void 0 !== delayedFunction && delayedFunction(); } -function log(e) { - window.console && showLog && console.log(e); -} - function css_browser_selector(e) { - function t() { - var e = window.outerWidth || y.clientWidth, t = window.outerHeight || y.clientHeight; - n.orientation = t > e ? "portrait" : "landscape", y.className = y.className.replace(/ ?orientation_\w+/g, "").replace(/ [min|max|cl]+[w|h]_\d+/g, ""); - for (var r = o - 1; r >= 0; r--) if (e >= i[r]) { - n.maxw = i[r]; - break; - } - widthClasses = ""; - for (var s in n) widthClasses += " " + s + "_" + n[s]; - return y.className = y.className + widthClasses, widthClasses; - } - var n = {}, i = [ 320, 480, 640, 768, 1024, 1152, 1280, 1440, 1680, 1920, 2560 ], o = i.length, r = e.toLowerCase(), s = function(e) { - return RegExp(e, "i").test(r); - }, a = function(e, t) { - t = t.replace(".", "_"); - for (var n = t.indexOf("_"), i = ""; n > 0; ) i += " " + e + t.substring(0, n), - n = t.indexOf("_", n + 1); - return i += " " + e + t; - }, l = "gecko", c = "webkit", u = "chrome", d = "firefox", p = "safari", f = "opera", h = "mobile", g = "android", m = "blackberry", v = "lang_", b = "device_", y = document.documentElement, w = [ !/opera|webtv/i.test(r) && /msie\s(\d+)/.test(r) ? "ie ie" + (/trident\/4\.0/.test(r) ? "8" : RegExp.$1) : s("firefox/") ? l + " " + d + (/firefox\/((\d+)(\.(\d+))(\.\d+)*)/.test(r) ? " " + d + RegExp.$2 + " " + d + RegExp.$2 + "_" + RegExp.$4 : "") : s("gecko/") ? l : s("opera") ? f + (/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(r) ? " " + f + RegExp.$2 + " " + f + RegExp.$2 + "_" + RegExp.$4 : /opera(\s|\/)(\d+)\.(\d+)/.test(r) ? " " + f + RegExp.$2 + " " + f + RegExp.$2 + "_" + RegExp.$3 : "") : s("konqueror") ? "konqueror" : s("blackberry") ? m + (/Version\/(\d+)(\.(\d+)+)/i.test(r) ? " " + m + RegExp.$1 + " " + m + RegExp.$1 + RegExp.$2.replace(".", "_") : /Blackberry ?(([0-9]+)([a-z]?))[\/|;]/gi.test(r) ? " " + m + RegExp.$2 + (RegExp.$3 ? " " + m + RegExp.$2 + RegExp.$3 : "") : "") : s("android") ? g + (/Version\/(\d+)(\.(\d+))+/i.test(r) ? " " + g + RegExp.$1 + " " + g + RegExp.$1 + RegExp.$2.replace(".", "_") : "") + (/Android (.+); (.+) Build/i.test(r) ? " " + b + RegExp.$2.replace(/ /g, "_").replace(/-/g, "_") : "") : s("chrome") ? c + " " + u + (/chrome\/((\d+)(\.(\d+))(\.\d+)*)/.test(r) ? " " + u + RegExp.$2 + (RegExp.$4 > 0 ? " " + u + RegExp.$2 + "_" + RegExp.$4 : "") : "") : s("iron") ? c + " iron" : s("applewebkit/") ? c + " " + p + (/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(r) ? " " + p + RegExp.$2 + " " + p + RegExp.$2 + RegExp.$3.replace(".", "_") : / Safari\/(\d+)/i.test(r) ? "419" == RegExp.$1 || "417" == RegExp.$1 || "416" == RegExp.$1 || "412" == RegExp.$1 ? " " + p + "2_0" : "312" == RegExp.$1 ? " " + p + "1_3" : "125" == RegExp.$1 ? " " + p + "1_2" : "85" == RegExp.$1 ? " " + p + "1_0" : "" : "") : s("mozilla/") ? l : "", s("android|mobi|mobile|j2me|iphone|ipod|ipad|blackberry|playbook|kindle|silk") ? h : "", s("j2me") ? "j2me" : s("ipad|ipod|iphone") ? (/CPU( iPhone)? OS (\d+[_|\.]\d+([_|\.]\d+)*)/i.test(r) ? "ios" + a("ios", RegExp.$2) : "") + " " + (/(ip(ad|od|hone))/gi.test(r) ? RegExp.$1 : "") : s("playbook") ? "playbook" : s("kindle|silk") ? "kindle" : s("playbook") ? "playbook" : s("mac") ? "mac" + (/mac os x ((\d+)[.|_](\d+))/.test(r) ? " mac" + RegExp.$2 + " mac" + RegExp.$1.replace(".", "_") : "") : s("win") ? "win" + (s("windows nt 6.2") ? " win8" : s("windows nt 6.1") ? " win7" : s("windows nt 6.0") ? " vista" : s("windows nt 5.2") || s("windows nt 5.1") ? " win_xp" : s("windows nt 5.0") ? " win_2k" : s("windows nt 4.0") || s("WinNT4.0") ? " win_nt" : "") : s("freebsd") ? "freebsd" : s("x11|linux") ? "linux" : "", /[; |\[](([a-z]{2})(\-[a-z]{2})?)[)|;|\]]/i.test(r) ? (v + RegExp.$2).replace("-", "_") + ("" != RegExp.$3 ? (" " + v + RegExp.$1).replace("-", "_") : "") : "", s("ipad|iphone|ipod") && !s("safari") ? "ipad_app" : "" ]; - window.onresize = t, t(); - var x = w.join(" ") + " js "; - return y.className = (x + y.className.replace(/\b(no[-|_]?)?js\b/g, "")).replace(/^ /, "").replace(/ +/g, " "), - x; + var t = e.toLowerCase(), n = function(e) { + return t.indexOf(e) > -1; + }, i = "gecko", o = "webkit", r = "safari", a = "opera", s = "mobile", l = "firefox", c = document.documentElement, u = [ !/opera|webtv/i.test(t) && /msie\s(\d)/.test(t) ? "ie ie" + (/trident\/4\.0/.test(t) ? "8" : RegExp.$1) : n("firefox/") ? i + " " + l + (/firefox\/(\d+(\.?\d+)*)/.test(t) ? " " + l + RegExp.$1.replace(/\./g, "").substr(0, 2) : "") : n("gecko/") ? i : n("opera") ? a + (/version\/((\d+)(\.\d+)*)/.test(t) ? " " + a + RegExp.$2 + " " + a + RegExp.$2 + RegExp.$3.replace(".", "_").substr(0, 2) : /opera(\s|\/)(\d+)/.test(t) ? " " + a + RegExp.$2 : "") : n("konqueror") ? "konqueror" : n("blackberry") ? s + " blackberry" : n("android") ? s + " android" : n("chrome") ? o + " chrome" : n("iron") ? o + " iron" : n("applewebkit/") ? o + " " + r + (/version\/(\d+)/.test(t) ? " " + r + RegExp.$1 : "") : n("mozilla/") ? i : "", n("j2me") ? s + " j2me" : n("iphone") ? s + " iphone" : n("ipod") ? s + " ipod" : n("ipad") ? s + " ipad" : n("mac") ? "mac" : n("darwin") ? "mac" : n("webtv") ? "webtv" : n("win") ? "win" + (n("windows nt 6.2") ? " win8" : n("windows nt 6.1") ? " win7" : n("windows nt 6.0") ? " vista" : n("windows nt 5.2") || n("windows nt 5.1") ? " xp" : n("windows nt 5.0") ? " win2k" : "") : n("freebsd") ? "freebsd" : n("x11") || n("linux") ? "linux" : "", "js" ], d = u.join(" "); + return c.className = (c.className.replace(/no-?js/g, "") + " " + d).replace(/^ /, ""), + d; } (function(e, t) { @@ -620,7 +676,7 @@ function css_browser_selector(e) { } function i(e) { var t = ht[e] = {}; - return rt.each(e.match(at) || [], function(e, n) { + return rt.each(e.match(st) || [], function(e, n) { t[n] = !0; }), t; } @@ -638,19 +694,19 @@ function css_browser_selector(e) { try { i = "true" === i ? !0 : "false" === i ? !1 : "null" === i ? null : +i + "" === i ? +i : vt.test(i) ? JSON.parse(i) : i; } catch (r) {} - gt.set(e, n, i); + mt.set(e, n, i); } else i = t; return i; } - function s() { + function a() { return !0; } - function a() { + function s() { return !1; } function l() { try { - return U.activeElement; + return G.activeElement; } catch (e) {} } function c(e, t) { @@ -665,7 +721,7 @@ function css_browser_selector(e) { return e === t !== n; }); if ("string" == typeof t) { - if (It.test(t)) return rt.filter(t, e, n); + if (Nt.test(t)) return rt.filter(t, e, n); t = rt.filter(t, e); } return rt.grep(e, function(e) { @@ -679,29 +735,29 @@ function css_browser_selector(e) { return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e; } function f(e) { - var t = jt.exec(e.type); + var t = Ot.exec(e.type); return t ? e.type = t[1] : e.removeAttribute("type"), e; } function h(e, t) { - for (var n = e.length, i = 0; n > i; i++) mt.set(e[i], "globalEval", !t || mt.get(t[i], "globalEval")); + for (var n = e.length, i = 0; n > i; i++) gt.set(e[i], "globalEval", !t || gt.get(t[i], "globalEval")); } - function g(e, t) { - var n, i, o, r, s, a, l, c; + function m(e, t) { + var n, i, o, r, a, s, l, c; if (1 === t.nodeType) { - if (mt.hasData(e) && (r = mt.access(e), s = mt.set(t, r), c = r.events)) { - delete s.handle, s.events = {}; + if (gt.hasData(e) && (r = gt.access(e), a = gt.set(t, r), c = r.events)) { + delete a.handle, a.events = {}; for (o in c) for (n = 0, i = c[o].length; i > n; n++) rt.event.add(t, o, c[o][n]); } - gt.hasData(e) && (a = gt.access(e), l = rt.extend({}, a), gt.set(t, l)); + mt.hasData(e) && (s = mt.access(e), l = rt.extend({}, s), mt.set(t, l)); } } - function m(e, n) { + function g(e, n) { var i = e.getElementsByTagName ? e.getElementsByTagName(n || "*") : e.querySelectorAll ? e.querySelectorAll(n || "*") : []; return n === t || n && rt.nodeName(e, n) ? rt.merge([ e ], i) : i; } function v(e, t) { var n = t.nodeName.toLowerCase(); - "input" === n && zt.test(e.type) ? t.checked = e.checked : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue); + "input" === n && Rt.test(e.type) ? t.checked = e.checked : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue); } function b(e, t) { if (t in e) return t; @@ -712,109 +768,109 @@ function css_browser_selector(e) { function y(e, t) { return e = t || e, "none" === rt.css(e, "display") || !rt.contains(e.ownerDocument, e); } - function w(t) { + function x(t) { return e.getComputedStyle(t, null); } - function x(e, t) { - for (var n, i, o, r = [], s = 0, a = e.length; a > s; s++) i = e[s], i.style && (r[s] = mt.get(i, "olddisplay"), - n = i.style.display, t ? (r[s] || "none" !== n || (i.style.display = ""), "" === i.style.display && y(i) && (r[s] = mt.access(i, "olddisplay", T(i.nodeName)))) : r[s] || (o = y(i), - (n && "none" !== n || !o) && mt.set(i, "olddisplay", o ? n : rt.css(i, "display")))); - for (s = 0; a > s; s++) i = e[s], i.style && (t && "none" !== i.style.display && "" !== i.style.display || (i.style.display = t ? r[s] || "" : "none")); + function w(e, t) { + for (var n, i, o, r = [], a = 0, s = e.length; s > a; a++) i = e[a], i.style && (r[a] = gt.get(i, "olddisplay"), + n = i.style.display, t ? (r[a] || "none" !== n || (i.style.display = ""), "" === i.style.display && y(i) && (r[a] = gt.access(i, "olddisplay", _(i.nodeName)))) : r[a] || (o = y(i), + (n && "none" !== n || !o) && gt.set(i, "olddisplay", o ? n : rt.css(i, "display")))); + for (a = 0; s > a; a++) i = e[a], i.style && (t && "none" !== i.style.display && "" !== i.style.display || (i.style.display = t ? r[a] || "" : "none")); return e; } - function k(e, t, n) { - var i = Gt.exec(t); + function C(e, t, n) { + var i = Wt.exec(t); return i ? Math.max(0, i[1] - (n || 0)) + (i[2] || "px") : t; } - function C(e, t, n, i, o) { - for (var r = n === (i ? "border" : "content") ? 4 : "width" === t ? 1 : 0, s = 0; 4 > r; r += 2) "margin" === n && (s += rt.css(e, n + Zt[r], !0, o)), - i ? ("content" === n && (s -= rt.css(e, "padding" + Zt[r], !0, o)), "margin" !== n && (s -= rt.css(e, "border" + Zt[r] + "Width", !0, o))) : (s += rt.css(e, "padding" + Zt[r], !0, o), - "padding" !== n && (s += rt.css(e, "border" + Zt[r] + "Width", !0, o))); - return s; + function k(e, t, n, i, o) { + for (var r = n === (i ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; 4 > r; r += 2) "margin" === n && (a += rt.css(e, n + Jt[r], !0, o)), + i ? ("content" === n && (a -= rt.css(e, "padding" + Jt[r], !0, o)), "margin" !== n && (a -= rt.css(e, "border" + Jt[r] + "Width", !0, o))) : (a += rt.css(e, "padding" + Jt[r], !0, o), + "padding" !== n && (a += rt.css(e, "border" + Jt[r] + "Width", !0, o))); + return a; } function S(e, t, n) { - var i = !0, o = "width" === t ? e.offsetWidth : e.offsetHeight, r = w(e), s = rt.support.boxSizing && "border-box" === rt.css(e, "boxSizing", !1, r); + var i = !0, o = "width" === t ? e.offsetWidth : e.offsetHeight, r = x(e), a = rt.support.boxSizing && "border-box" === rt.css(e, "boxSizing", !1, r); if (0 >= o || null == o) { - if (o = qt(e, t, r), (0 > o || null == o) && (o = e.style[t]), Vt.test(o)) return o; - i = s && (rt.support.boxSizingReliable || o === e.style[t]), o = parseFloat(o) || 0; + if (o = Bt(e, t, r), (0 > o || null == o) && (o = e.style[t]), Vt.test(o)) return o; + i = a && (rt.support.boxSizingReliable || o === e.style[t]), o = parseFloat(o) || 0; } - return o + C(e, t, n || (s ? "border" : "content"), i, r) + "px"; + return o + k(e, t, n || (a ? "border" : "content"), i, r) + "px"; } - function T(e) { - var t = U, n = Yt[e]; - return n || (n = E(e, t), "none" !== n && n || (Bt = (Bt || rt("