ui_alchemy-rails 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.md +6 -0
- data/Rakefile +21 -0
- data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.eot +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.svg +154 -0
- data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.ttf +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.woff +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.eot +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.svg +154 -0
- data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.ttf +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.woff +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.eot +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.svg +154 -0
- data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.ttf +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.woff +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.eot +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.svg +154 -0
- data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.ttf +0 -0
- data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.woff +0 -0
- data/app/assets/fonts/alchemy/Red Hat Liberation License.txt +78 -0
- data/app/assets/fonts/alchemy/overpass_bold-web.eot +0 -0
- data/app/assets/fonts/alchemy/overpass_bold-web.svg +470 -0
- data/app/assets/fonts/alchemy/overpass_bold-web.ttf +0 -0
- data/app/assets/fonts/alchemy/overpass_bold-web.woff +0 -0
- data/app/assets/fonts/alchemy/overpass_regular-web.eot +0 -0
- data/app/assets/fonts/alchemy/overpass_regular-web.svg +470 -0
- data/app/assets/fonts/alchemy/overpass_regular-web.ttf +0 -0
- data/app/assets/fonts/alchemy/overpass_regular-web.woff +0 -0
- data/app/assets/images/alchemy/icons/action-icons.png +0 -0
- data/app/assets/images/alchemy/icons/arrow_icon.png +0 -0
- data/app/assets/images/alchemy/icons/chosen-sprite.png +0 -0
- data/app/assets/images/alchemy/icons/error_icon.png +0 -0
- data/app/assets/images/alchemy/icons/objects.png +0 -0
- data/app/assets/images/alchemy/icons/spinner.gif +0 -0
- data/app/assets/images/alchemy/icons/spinner_head.gif +0 -0
- data/app/assets/images/alchemy/icons/success_icon.png +0 -0
- data/app/assets/images/alchemy/icons/warning_icon.png +0 -0
- data/app/assets/javascripts/alchemy/flash_messages.js +12 -0
- data/app/assets/javascripts/alchemy/forms.js +25 -0
- data/app/assets/javascripts/alchemy/i18n.js +36 -0
- data/app/assets/javascripts/alchemy/login.js +130 -0
- data/app/assets/javascripts/alchemy/password.js +99 -0
- data/app/assets/stylesheets/alchemy/components/_chosen.scss +423 -0
- data/app/assets/stylesheets/alchemy/components/_content.scss +58 -0
- data/app/assets/stylesheets/alchemy/components/_helpers.scss +38 -0
- data/app/assets/stylesheets/alchemy/components/_media.scss +49 -0
- data/app/assets/stylesheets/alchemy/components/_media_object.scss +22 -0
- data/app/assets/stylesheets/alchemy/components/_normalize.scss +396 -0
- data/app/assets/stylesheets/alchemy/components/_shared.scss +18 -0
- data/app/assets/stylesheets/alchemy/components/buttons/_buttons.scss +278 -0
- data/app/assets/stylesheets/alchemy/components/buttons/_buttons_vars.scss +11 -0
- data/app/assets/stylesheets/alchemy/components/flash_messages/_flash_messages.scss +93 -0
- data/app/assets/stylesheets/alchemy/components/flash_messages/_flash_messages_vars.scss +3 -0
- data/app/assets/stylesheets/alchemy/components/fonts/_liberation.scss +44 -0
- data/app/assets/stylesheets/alchemy/components/fonts/_overpass.scss +24 -0
- data/app/assets/stylesheets/alchemy/components/footer/_footer.scss +53 -0
- data/app/assets/stylesheets/alchemy/components/footer/_footer_vars.scss +4 -0
- data/app/assets/stylesheets/alchemy/components/forms/_forms.scss +552 -0
- data/app/assets/stylesheets/alchemy/components/forms/_forms_ie.scss +45 -0
- data/app/assets/stylesheets/alchemy/components/forms/_forms_mixins.scss +18 -0
- data/app/assets/stylesheets/alchemy/components/forms/_forms_responsive.scss +167 -0
- data/app/assets/stylesheets/alchemy/components/forms/_forms_vars.scss +25 -0
- data/app/assets/stylesheets/alchemy/components/header/_header.scss +216 -0
- data/app/assets/stylesheets/alchemy/components/header/_header_vars.scss +11 -0
- data/app/assets/stylesheets/alchemy/components/login/_login.scss +173 -0
- data/app/assets/stylesheets/alchemy/components/login/_login_mixins.scss +7 -0
- data/app/assets/stylesheets/alchemy/components/login/_login_vars.scss +19 -0
- data/app/assets/stylesheets/alchemy/components/sprites/_sprites.scss +110 -0
- data/app/assets/stylesheets/alchemy/components/sprites/_sprites_mixins.scss +9 -0
- data/app/assets/stylesheets/alchemy/components/text/_text.scss +30 -0
- data/app/assets/stylesheets/alchemy/components/text/_text_vars.scss +1 -0
- data/app/assets/stylesheets/alchemy/composites/content_elements.scss +6 -0
- data/app/assets/stylesheets/alchemy/composites/login.scss +9 -0
- data/app/assets/stylesheets/alchemy/composites/shell.scss +4 -0
- data/app/assets/stylesheets/alchemy/partials/_base.scss +8 -0
- data/app/assets/stylesheets/alchemy/partials/_colors.scss +99 -0
- data/app/assets/stylesheets/alchemy/partials/_mixins.scss +24 -0
- data/app/assets/stylesheets/alchemy/partials/_vars.scss +31 -0
- data/app/helpers/ui_alchemy/gettext_translations.rb +28 -0
- data/app/helpers/ui_alchemy/layout_helper.rb +35 -0
- data/app/helpers/ui_alchemy/rails_translations.rb +21 -0
- data/app/helpers/ui_alchemy/translation_helper.rb +19 -0
- data/app/views/alchemy/layouts/_change_password_layout.html.haml +20 -0
- data/app/views/alchemy/layouts/_common_i18n.haml +4 -0
- data/app/views/alchemy/layouts/_header_layout.haml +13 -0
- data/app/views/alchemy/layouts/_login_layout.html.haml +58 -0
- data/app/views/alchemy/layouts/_user_session_layout.haml +17 -0
- data/app/views/alchemy/layouts/base.html.haml +20 -0
- data/app/views/alchemy/layouts/shell_layout.haml +10 -0
- data/lib/ui_alchemy/rails/engine.rb +6 -0
- data/lib/ui_alchemy/rails/version.rb +5 -0
- data/lib/ui_alchemy-rails.rb +2 -0
- data/vendor/assets/javascripts/alchemy/handlebars.js +2201 -0
- data/vendor/assets/javascripts/alchemy/html5shiv.js +298 -0
- data/vendor/assets/javascripts/alchemy/jquery/jquery-1.6.2.js +8981 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/chosen.jquery.js +1003 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/excanvas.js +1427 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/excanvas.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.colorhelpers.js +179 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.colorhelpers.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.crosshair.js +167 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.crosshair.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.fillbetween.js +183 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.fillbetween.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.image.js +238 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.image.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.js +2599 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.min.js +6 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.navigate.js +336 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.navigate.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.pie.js +750 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.pie.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.resize.js +60 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.resize.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.selection.js +344 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.selection.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.stack.js +184 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.stack.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.symbol.js +70 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.symbol.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.threshold.js +103 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.threshold.min.js +1 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/blank.svg +3 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/custom_test.js +67 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.css +9 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.js +1101 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.min.js +7 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.pack.js +7 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.js +396 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.min.js +7 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.pack.js +7 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.js +1337 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.min.js +7 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.pack.js +7 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/lion.svg +161 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/test.js +714 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ajaxfileupload.js +205 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ba-bbq.js +1137 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ba-resize.js +246 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.cookie.js +92 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.easing.1.3.js +205 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.fancyqueries.js +106 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.flash.js +288 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.form.js +964 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.hoverIntent.js +106 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jeditable.ajaxupload.js +62 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jeditable.js +556 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jnotify.js +210 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jscrollpane.js +1390 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jscrollpane.min.js +11 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.linkHover.js +89 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.loadmask.min.js +10 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.mousewheel.js +78 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.multiselect.filter.js +176 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.multiselect.js +668 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.pack.js +11 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.periodicalupdater.js +175 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.sortElements.js +75 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.sparkline.min.js +94 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.text-overflow.js +60 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.timepickr.js +214 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.timers.js +142 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.tipsy.js +358 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.treeTable.js +226 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.trunk8.js +203 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ui.multiselect.js +338 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ui.totop.js +58 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.uitablefilter.js +95 -0
- data/vendor/assets/javascripts/alchemy/jquery/plugins/ui.spinner.js +683 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_75_dadada_1x100.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_75_e6e6e6_1x100.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_95_ffffff_1x100.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-soft_80_e0e0e0_1x100.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_inset-hard_65_ffffff_1x100.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_8f8f8f_256x240.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_97baed_256x240.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/jquery-ui-1.8.11.custom.css +573 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/js/jquery-1.5.1.min.js +16 -0
- data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/js/jquery-ui-1.8.11.custom.min.js +783 -0
- data/vendor/assets/javascripts/alchemy/rails.js +331 -0
- data/vendor/assets/javascripts/alchemy/underscore-1.3.1.js +999 -0
- metadata +252 -0
@@ -0,0 +1,298 @@
|
|
1
|
+
/**
|
2
|
+
* @preserve HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
3
|
+
*/
|
4
|
+
;(function(window, document) {
|
5
|
+
/*jshint evil:true */
|
6
|
+
/** version */
|
7
|
+
var version = '3.6.2pre';
|
8
|
+
|
9
|
+
/** Preset options */
|
10
|
+
var options = window.html5 || {};
|
11
|
+
|
12
|
+
/** Used to skip problem elements */
|
13
|
+
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
14
|
+
|
15
|
+
/** Not all elements can be cloned in IE **/
|
16
|
+
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
17
|
+
|
18
|
+
/** Detect whether the browser supports default html5 styles */
|
19
|
+
var supportsHtml5Styles;
|
20
|
+
|
21
|
+
/** Name of the expando, to work with multiple documents or to re-shiv one document */
|
22
|
+
var expando = '_html5shiv';
|
23
|
+
|
24
|
+
/** The id for the the documents expando */
|
25
|
+
var expanID = 0;
|
26
|
+
|
27
|
+
/** Cached data for each document */
|
28
|
+
var expandoData = {};
|
29
|
+
|
30
|
+
/** Detect whether the browser supports unknown elements */
|
31
|
+
var supportsUnknownElements;
|
32
|
+
|
33
|
+
(function() {
|
34
|
+
try {
|
35
|
+
var a = document.createElement('a');
|
36
|
+
a.innerHTML = '<xyz></xyz>';
|
37
|
+
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
|
38
|
+
supportsHtml5Styles = ('hidden' in a);
|
39
|
+
|
40
|
+
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
41
|
+
// assign a false positive if unable to shiv
|
42
|
+
(document.createElement)('a');
|
43
|
+
var frag = document.createDocumentFragment();
|
44
|
+
return (
|
45
|
+
typeof frag.cloneNode == 'undefined' ||
|
46
|
+
typeof frag.createDocumentFragment == 'undefined' ||
|
47
|
+
typeof frag.createElement == 'undefined'
|
48
|
+
);
|
49
|
+
}());
|
50
|
+
} catch(e) {
|
51
|
+
supportsHtml5Styles = true;
|
52
|
+
supportsUnknownElements = true;
|
53
|
+
}
|
54
|
+
|
55
|
+
}());
|
56
|
+
|
57
|
+
/*--------------------------------------------------------------------------*/
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Creates a style sheet with the given CSS text and adds it to the document.
|
61
|
+
* @private
|
62
|
+
* @param {Document} ownerDocument The document.
|
63
|
+
* @param {String} cssText The CSS text.
|
64
|
+
* @returns {StyleSheet} The style element.
|
65
|
+
*/
|
66
|
+
function addStyleSheet(ownerDocument, cssText) {
|
67
|
+
var p = ownerDocument.createElement('p'),
|
68
|
+
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
69
|
+
|
70
|
+
p.innerHTML = 'x<style>' + cssText + '</style>';
|
71
|
+
return parent.insertBefore(p.lastChild, parent.firstChild);
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Returns the value of `html5.elements` as an array.
|
76
|
+
* @private
|
77
|
+
* @returns {Array} An array of shived element node names.
|
78
|
+
*/
|
79
|
+
function getElements() {
|
80
|
+
var elements = html5.elements;
|
81
|
+
return typeof elements == 'string' ? elements.split(' ') : elements;
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Returns the data associated to the given document
|
86
|
+
* @private
|
87
|
+
* @param {Document} ownerDocument The document.
|
88
|
+
* @returns {Object} An object of data.
|
89
|
+
*/
|
90
|
+
function getExpandoData(ownerDocument) {
|
91
|
+
var data = expandoData[ownerDocument[expando]];
|
92
|
+
if (!data) {
|
93
|
+
data = {};
|
94
|
+
expanID++;
|
95
|
+
ownerDocument[expando] = expanID;
|
96
|
+
expandoData[expanID] = data;
|
97
|
+
}
|
98
|
+
return data;
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* returns a shived element for the given nodeName and document
|
103
|
+
* @memberOf html5
|
104
|
+
* @param {String} nodeName name of the element
|
105
|
+
* @param {Document} ownerDocument The context document.
|
106
|
+
* @returns {Object} The shived element.
|
107
|
+
*/
|
108
|
+
function createElement(nodeName, ownerDocument, data){
|
109
|
+
if (!ownerDocument) {
|
110
|
+
ownerDocument = document;
|
111
|
+
}
|
112
|
+
if(supportsUnknownElements){
|
113
|
+
return ownerDocument.createElement(nodeName);
|
114
|
+
}
|
115
|
+
if (!data) {
|
116
|
+
data = getExpandoData(ownerDocument);
|
117
|
+
}
|
118
|
+
var node;
|
119
|
+
|
120
|
+
if (data.cache[nodeName]) {
|
121
|
+
node = data.cache[nodeName].cloneNode();
|
122
|
+
} else if (saveClones.test(nodeName)) {
|
123
|
+
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
124
|
+
} else {
|
125
|
+
node = data.createElem(nodeName);
|
126
|
+
}
|
127
|
+
|
128
|
+
// Avoid adding some elements to fragments in IE < 9 because
|
129
|
+
// * Attributes like `name` or `type` cannot be set/changed once an element
|
130
|
+
// is inserted into a document/fragment
|
131
|
+
// * Link elements with `src` attributes that are inaccessible, as with
|
132
|
+
// a 403 response, will cause the tab/window to crash
|
133
|
+
// * Script elements appended to fragments will execute when their `src`
|
134
|
+
// or `text` property is set
|
135
|
+
return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
|
136
|
+
}
|
137
|
+
|
138
|
+
/**
|
139
|
+
* returns a shived DocumentFragment for the given document
|
140
|
+
* @memberOf html5
|
141
|
+
* @param {Document} ownerDocument The context document.
|
142
|
+
* @returns {Object} The shived DocumentFragment.
|
143
|
+
*/
|
144
|
+
function createDocumentFragment(ownerDocument, data){
|
145
|
+
if (!ownerDocument) {
|
146
|
+
ownerDocument = document;
|
147
|
+
}
|
148
|
+
if(supportsUnknownElements){
|
149
|
+
return ownerDocument.createDocumentFragment();
|
150
|
+
}
|
151
|
+
data = data || getExpandoData(ownerDocument);
|
152
|
+
var clone = data.frag.cloneNode(),
|
153
|
+
i = 0,
|
154
|
+
elems = getElements(),
|
155
|
+
l = elems.length;
|
156
|
+
for(;i<l;i++){
|
157
|
+
clone.createElement(elems[i]);
|
158
|
+
}
|
159
|
+
return clone;
|
160
|
+
}
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
|
164
|
+
* @private
|
165
|
+
* @param {Document|DocumentFragment} ownerDocument The document.
|
166
|
+
* @param {Object} data of the document.
|
167
|
+
*/
|
168
|
+
function shivMethods(ownerDocument, data) {
|
169
|
+
if (!data.cache) {
|
170
|
+
data.cache = {};
|
171
|
+
data.createElem = ownerDocument.createElement;
|
172
|
+
data.createFrag = ownerDocument.createDocumentFragment;
|
173
|
+
data.frag = data.createFrag();
|
174
|
+
}
|
175
|
+
|
176
|
+
|
177
|
+
ownerDocument.createElement = function(nodeName) {
|
178
|
+
//abort shiv
|
179
|
+
if (!html5.shivMethods) {
|
180
|
+
return data.createElem(nodeName);
|
181
|
+
}
|
182
|
+
return createElement(nodeName, ownerDocument, data);
|
183
|
+
};
|
184
|
+
|
185
|
+
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
186
|
+
'var n=f.cloneNode(),c=n.createElement;' +
|
187
|
+
'h.shivMethods&&(' +
|
188
|
+
// unroll the `createElement` calls
|
189
|
+
getElements().join().replace(/\w+/g, function(nodeName) {
|
190
|
+
data.createElem(nodeName);
|
191
|
+
data.frag.createElement(nodeName);
|
192
|
+
return 'c("' + nodeName + '")';
|
193
|
+
}) +
|
194
|
+
');return n}'
|
195
|
+
)(html5, data.frag);
|
196
|
+
}
|
197
|
+
|
198
|
+
/*--------------------------------------------------------------------------*/
|
199
|
+
|
200
|
+
/**
|
201
|
+
* Shivs the given document.
|
202
|
+
* @memberOf html5
|
203
|
+
* @param {Document} ownerDocument The document to shiv.
|
204
|
+
* @returns {Document} The shived document.
|
205
|
+
*/
|
206
|
+
function shivDocument(ownerDocument) {
|
207
|
+
if (!ownerDocument) {
|
208
|
+
ownerDocument = document;
|
209
|
+
}
|
210
|
+
var data = getExpandoData(ownerDocument);
|
211
|
+
|
212
|
+
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
213
|
+
data.hasCSS = !!addStyleSheet(ownerDocument,
|
214
|
+
// corrects block display not defined in IE6/7/8/9
|
215
|
+
'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
|
216
|
+
// adds styling not present in IE6/7/8/9
|
217
|
+
'mark{background:#FF0;color:#000}'
|
218
|
+
);
|
219
|
+
}
|
220
|
+
if (!supportsUnknownElements) {
|
221
|
+
shivMethods(ownerDocument, data);
|
222
|
+
}
|
223
|
+
return ownerDocument;
|
224
|
+
}
|
225
|
+
|
226
|
+
/*--------------------------------------------------------------------------*/
|
227
|
+
|
228
|
+
/**
|
229
|
+
* The `html5` object is exposed so that more elements can be shived and
|
230
|
+
* existing shiving can be detected on iframes.
|
231
|
+
* @type Object
|
232
|
+
* @example
|
233
|
+
*
|
234
|
+
* // options can be changed before the script is included
|
235
|
+
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
|
236
|
+
*/
|
237
|
+
var html5 = {
|
238
|
+
|
239
|
+
/**
|
240
|
+
* An array or space separated string of node names of the elements to shiv.
|
241
|
+
* @memberOf html5
|
242
|
+
* @type Array|String
|
243
|
+
*/
|
244
|
+
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video',
|
245
|
+
|
246
|
+
/**
|
247
|
+
* current version of html5shiv
|
248
|
+
*/
|
249
|
+
'version': version,
|
250
|
+
|
251
|
+
/**
|
252
|
+
* A flag to indicate that the HTML5 style sheet should be inserted.
|
253
|
+
* @memberOf html5
|
254
|
+
* @type Boolean
|
255
|
+
*/
|
256
|
+
'shivCSS': (options.shivCSS !== false),
|
257
|
+
|
258
|
+
/**
|
259
|
+
* Is equal to true if a browser supports creating unknown/HTML5 elements
|
260
|
+
* @memberOf html5
|
261
|
+
* @type boolean
|
262
|
+
*/
|
263
|
+
'supportsUnknownElements': supportsUnknownElements,
|
264
|
+
|
265
|
+
/**
|
266
|
+
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
|
267
|
+
* methods should be overwritten.
|
268
|
+
* @memberOf html5
|
269
|
+
* @type Boolean
|
270
|
+
*/
|
271
|
+
'shivMethods': (options.shivMethods !== false),
|
272
|
+
|
273
|
+
/**
|
274
|
+
* A string to describe the type of `html5` object ("default" or "default print").
|
275
|
+
* @memberOf html5
|
276
|
+
* @type String
|
277
|
+
*/
|
278
|
+
'type': 'default',
|
279
|
+
|
280
|
+
// shivs the document according to the specified `html5` object options
|
281
|
+
'shivDocument': shivDocument,
|
282
|
+
|
283
|
+
//creates a shived element
|
284
|
+
createElement: createElement,
|
285
|
+
|
286
|
+
//creates a shived documentFragment
|
287
|
+
createDocumentFragment: createDocumentFragment
|
288
|
+
};
|
289
|
+
|
290
|
+
/*--------------------------------------------------------------------------*/
|
291
|
+
|
292
|
+
// expose html5
|
293
|
+
window.html5 = html5;
|
294
|
+
|
295
|
+
// shiv the document
|
296
|
+
shivDocument(document);
|
297
|
+
|
298
|
+
}(this, document));
|