survivalkit 1.0.beta.8 → 1.0.beta.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +3 -0
- data/README.markdown +2 -2
- data/lib/survivalkit.rb +3 -2
- data/stylesheets/survivalkit/fonts/_font-awesome.scss +355 -0
- data/stylesheets/survivalkit/fonts/_league-gothic.scss +46 -0
- data/stylesheets/survivalkit/fonts/_ostrich-sans.scss +69 -0
- data/stylesheets/survivalkit/mixins/_ui.scss +22 -12
- data/stylesheets/survivalkit/survival-kit/_survival-kit.sass +157 -0
- data/templates/clean/manifest.rb +94 -0
- data/templates/drupal/script.js +2 -17
- data/templates/project/libs/jquery-1.8.2.min.js +2 -0
- data/templates/project/libs/modernizr-2.6.2.min.js +815 -0
- data/templates/project/manifest.rb +46 -27
- data/templates/project/script.js +2 -17
- data/templates/project/sources/FitText/README.md +52 -0
- data/templates/project/sources/FitText/example.html +60 -0
- data/templates/project/sources/FitText/jquery.fittext.js +43 -0
- data/templates/shared/fonts/font-awesome/fontawesome-webfont.eot +0 -0
- data/templates/shared/fonts/font-awesome/fontawesome-webfont.svg +255 -0
- data/templates/shared/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
- data/templates/shared/fonts/font-awesome/fontawesome-webfont.woff +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-condensed-italic-webfont.eot +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-condensed-italic-webfont.svg +224 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-condensed-italic-webfont.ttf +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-condensed-italic-webfont.woff +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-condensed-regular-webfont.eot +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-condensed-regular-webfont.svg +224 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-condensed-regular-webfont.ttf +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-condensed-regular-webfont.woff +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-italic-webfont.eot +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-italic-webfont.svg +224 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-italic-webfont.ttf +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-italic-webfont.woff +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-regular-webfont.eot +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-regular-webfont.svg +223 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-regular-webfont.ttf +0 -0
- data/templates/shared/fonts/league-gothic/leaguegothic-regular-webfont.woff +0 -0
- data/templates/shared/fonts/ostrich/ostrich-black-webfont.eot +0 -0
- data/templates/shared/fonts/ostrich/ostrich-black-webfont.svg +141 -0
- data/templates/shared/fonts/ostrich/ostrich-black-webfont.ttf +0 -0
- data/templates/shared/fonts/ostrich/ostrich-black-webfont.woff +0 -0
- data/templates/shared/fonts/ostrich/ostrich-bold-webfont.eot +0 -0
- data/templates/shared/fonts/ostrich/ostrich-bold-webfont.svg +141 -0
- data/templates/shared/fonts/ostrich/ostrich-bold-webfont.ttf +0 -0
- data/templates/shared/fonts/ostrich/ostrich-bold-webfont.woff +0 -0
- data/templates/shared/fonts/ostrich/ostrich-dashed-webfont.eot +0 -0
- data/templates/shared/fonts/ostrich/ostrich-dashed-webfont.svg +141 -0
- data/templates/shared/fonts/ostrich/ostrich-dashed-webfont.ttf +0 -0
- data/templates/shared/fonts/ostrich/ostrich-dashed-webfont.woff +0 -0
- data/templates/shared/fonts/ostrich/ostrich-light-webfont.eot +0 -0
- data/templates/shared/fonts/ostrich/ostrich-light-webfont.svg +140 -0
- data/templates/shared/fonts/ostrich/ostrich-light-webfont.ttf +0 -0
- data/templates/shared/fonts/ostrich/ostrich-light-webfont.woff +0 -0
- data/templates/shared/fonts/ostrich/ostrich-regular-webfont.eot +0 -0
- data/templates/shared/fonts/ostrich/ostrich-regular-webfont.svg +141 -0
- data/templates/shared/fonts/ostrich/ostrich-regular-webfont.ttf +0 -0
- data/templates/shared/fonts/ostrich/ostrich-regular-webfont.woff +0 -0
- data/templates/shared/fonts/ostrich/ostrich-rounded-webfont.eot +0 -0
- data/templates/shared/fonts/ostrich/ostrich-rounded-webfont.svg +141 -0
- data/templates/shared/fonts/ostrich/ostrich-rounded-webfont.ttf +0 -0
- data/templates/shared/fonts/ostrich/ostrich-rounded-webfont.woff +0 -0
- data/templates/shared/partials/01-variables/_colors.scss +1 -1
- data/templates/shared/partials/01-variables/_fonts.scss +10 -0
- data/templates/shared/partials/06-ui-patterns/_drupal-patterns.scss +4 -5
- data/templates/shared/partials/07-styletile/_tile-design.scss +2 -2
- data/templates/shared/style.scss +2 -1
- metadata +73 -187
- data/stylesheets/survivalkit/survival_kit/_survival-kit.scss +0 -145
- data/templates/drupal/libs/320-up/helper.js +0 -146
- data/templates/drupal/libs/320-up/imgSizer.js +0 -61
- data/templates/drupal/libs/dd_belatedpng.js +0 -13
- data/templates/drupal/libs/formalize/README.txt +0 -11
- data/templates/drupal/libs/formalize/dojo.formalize.js +0 -174
- data/templates/drupal/libs/formalize/extjs.formalize.js +0 -168
- data/templates/drupal/libs/formalize/jquery.formalize.js +0 -158
- data/templates/drupal/libs/formalize/mootools.formalize.js +0 -163
- data/templates/drupal/libs/formalize/prototype.formalize.js +0 -171
- data/templates/drupal/libs/formalize/yui.formalize.js +0 -168
- data/templates/drupal/libs/jquery-1.6.js +0 -8865
- data/templates/drupal/libs/jquery-1.6.min.js +0 -16
- data/templates/drupal/libs/modernizr-2.0.min.js +0 -4
- data/templates/drupal/libs/mootools-core-1.3.1-full-compat-yc.js +0 -485
- data/templates/drupal/libs/plugins.js +0 -58
- data/templates/drupal/libs/respond.min.js +0 -7
- data/templates/drupal/libs/selectivizr-min.js +0 -5
- data/templates/drupal/libs/selectivizr.js +0 -5
- data/templates/project/files/apple-touch-icon-114x114-precomposed.png +0 -0
- data/templates/project/files/apple-touch-icon-72x72-precomposed.png +0 -0
- data/templates/project/files/apple-touch-icon.png +0 -0
- data/templates/project/files/crossdomain.xml +0 -25
- data/templates/project/files/favicon.ico +0 -0
- data/templates/project/files/favicon.png +0 -0
- data/templates/project/files/google.yml +0 -22
- data/templates/project/files/htaccess.htaccess +0 -478
- data/templates/project/files/html/404.html +0 -22
- data/templates/project/files/html/formalize_jquery_demo.html +0 -288
- data/templates/project/files/html/formalize_jquery_disabled.html +0 -288
- data/templates/project/files/html/formalize_jquery_errors.html +0 -288
- data/templates/project/files/html/index.html +0 -100
- data/templates/project/files/html/survivalkit/elements-common.html +0 -588
- data/templates/project/files/html/survivalkit/elements-html5.html +0 -2988
- data/templates/project/files/html/survivalkit/elements-typography.html +0 -240
- data/templates/project/files/html/survivalkit/elements-ui-patterns-drupal-css.html +0 -1883
- data/templates/project/files/html/survivalkit/elements-ui-patterns-drupal.html +0 -1882
- data/templates/project/files/html/survivalkit/elements-ui-patterns.html +0 -267
- data/templates/project/files/html/survivalkit/index.html +0 -132
- data/templates/project/files/html/survivalkit/styletile/index.html +0 -1
- data/templates/project/files/html/survivalkit/styletile/styletile.html +0 -215
- data/templates/project/files/humans.txt +0 -43
- data/templates/project/files/robots.txt +0 -5
- data/templates/project/libs/320-up/helper.js +0 -146
- data/templates/project/libs/320-up/imgSizer.js +0 -61
- data/templates/project/libs/jquery-1.6.js +0 -8865
- data/templates/project/libs/jquery-1.6.min.js +0 -16
- data/templates/project/libs/modernizr-2.0.min.js +0 -4
- data/templates/project/libs/plugins.js +0 -58
- data/templates/project/libs/selectivizr.js +0 -5
- data/templates/project/templates/_flashes.html.haml +0 -4
- data/templates/project/templates/_footer.html.haml +0 -2
- data/templates/project/templates/_head.html.haml +0 -26
- data/templates/project/templates/_header.html.haml +0 -1
- data/templates/project/templates/_javascripts.html.haml +0 -27
- data/templates/project/templates/_stylesheets.html.haml +0 -5
- data/templates/project/templates/application.html.haml +0 -28
- data/templates/project/templates/old/_layout.haml +0 -1
- data/templates/project/templates/old/home.html.haml +0 -14
- data/templates/project/templates/old/layouts/default.haml +0 -62
- data/templates/project/templates/old/layouts/survivalkit/default.haml +0 -64
- data/templates/project/templates/old/layouts/survivalkit/styletile.haml +0 -64
- data/templates/project/templates/old/survivalkit/_layout.haml +0 -1
- data/templates/project/templates/old/survivalkit/elements-common.haml +0 -33
- data/templates/project/templates/old/survivalkit/elements-html5.haml +0 -71
- data/templates/project/templates/old/survivalkit/elements-typography.haml +0 -100
- data/templates/project/templates/old/survivalkit/elements-ui-patterns-drupal.haml +0 -38
- data/templates/project/templates/old/survivalkit/elements-ui-patterns.haml +0 -23
- data/templates/project/templates/old/survivalkit/index.haml +0 -2
- data/templates/project/templates/old/survivalkit/partials/common/abbr.haml +0 -8
- data/templates/project/templates/old/survivalkit/partials/common/acronym.haml +0 -8
- data/templates/project/templates/old/survivalkit/partials/common/characters.haml +0 -11
- data/templates/project/templates/old/survivalkit/partials/common/cite.haml +0 -12
- data/templates/project/templates/old/survivalkit/partials/common/code.haml +0 -8
- data/templates/project/templates/old/survivalkit/partials/common/dfn.haml +0 -8
- data/templates/project/templates/old/survivalkit/partials/common/em.haml +0 -10
- data/templates/project/templates/old/survivalkit/partials/common/forms.haml +0 -27
- data/templates/project/templates/old/survivalkit/partials/common/headers.haml +0 -23
- data/templates/project/templates/old/survivalkit/partials/common/inline-images.haml +0 -9
- data/templates/project/templates/old/survivalkit/partials/common/kbd.haml +0 -10
- data/templates/project/templates/old/survivalkit/partials/common/links.haml +0 -10
- data/templates/project/templates/old/survivalkit/partials/common/lists.haml +0 -55
- data/templates/project/templates/old/survivalkit/partials/common/others.haml +0 -35
- data/templates/project/templates/old/survivalkit/partials/common/paragraphs.haml +0 -15
- data/templates/project/templates/old/survivalkit/partials/common/pre.haml +0 -27
- data/templates/project/templates/old/survivalkit/partials/common/q.haml +0 -8
- data/templates/project/templates/old/survivalkit/partials/common/samp.haml +0 -8
- data/templates/project/templates/old/survivalkit/partials/common/strong.haml +0 -8
- data/templates/project/templates/old/survivalkit/partials/common/tables.haml +0 -43
- data/templates/project/templates/old/survivalkit/partials/common/var.haml +0 -8
- data/templates/project/templates/old/survivalkit/partials/header-styletile.haml +0 -9
- data/templates/project/templates/old/survivalkit/partials/header.haml +0 -6
- data/templates/project/templates/old/survivalkit/partials/html5/a.haml +0 -36
- data/templates/project/templates/old/survivalkit/partials/html5/abbr.haml +0 -26
- data/templates/project/templates/old/survivalkit/partials/html5/address.haml +0 -27
- data/templates/project/templates/old/survivalkit/partials/html5/all-headings.haml +0 -31
- data/templates/project/templates/old/survivalkit/partials/html5/article.haml +0 -22
- data/templates/project/templates/old/survivalkit/partials/html5/aside.haml +0 -20
- data/templates/project/templates/old/survivalkit/partials/html5/b.haml +0 -21
- data/templates/project/templates/old/survivalkit/partials/html5/bdi.haml +0 -30
- data/templates/project/templates/old/survivalkit/partials/html5/blockquote.haml +0 -32
- data/templates/project/templates/old/survivalkit/partials/html5/cite.haml +0 -46
- data/templates/project/templates/old/survivalkit/partials/html5/code.haml +0 -70
- data/templates/project/templates/old/survivalkit/partials/html5/details.haml +0 -42
- data/templates/project/templates/old/survivalkit/partials/html5/dfn.haml +0 -52
- data/templates/project/templates/old/survivalkit/partials/html5/dl.haml +0 -69
- data/templates/project/templates/old/survivalkit/partials/html5/em.haml +0 -15
- data/templates/project/templates/old/survivalkit/partials/html5/fieldset.haml +0 -49
- data/templates/project/templates/old/survivalkit/partials/html5/figure.haml +0 -48
- data/templates/project/templates/old/survivalkit/partials/html5/footer.haml +0 -37
- data/templates/project/templates/old/survivalkit/partials/html5/header.haml +0 -44
- data/templates/project/templates/old/survivalkit/partials/html5/hgroup.haml +0 -20
- data/templates/project/templates/old/survivalkit/partials/html5/hr.haml +0 -52
- data/templates/project/templates/old/survivalkit/partials/html5/i.haml +0 -28
- data/templates/project/templates/old/survivalkit/partials/html5/kbd.haml +0 -19
- data/templates/project/templates/old/survivalkit/partials/html5/label.haml +0 -18
- data/templates/project/templates/old/survivalkit/partials/html5/li.haml +0 -91
- data/templates/project/templates/old/survivalkit/partials/html5/mark.haml +0 -30
- data/templates/project/templates/old/survivalkit/partials/html5/menu.haml +0 -39
- data/templates/project/templates/old/survivalkit/partials/html5/nav.haml +0 -68
- data/templates/project/templates/old/survivalkit/partials/html5/ol.haml +0 -23
- data/templates/project/templates/old/survivalkit/partials/html5/p.haml +0 -41
- data/templates/project/templates/old/survivalkit/partials/html5/pre.haml +0 -48
- data/templates/project/templates/old/survivalkit/partials/html5/q.haml +0 -34
- data/templates/project/templates/old/survivalkit/partials/html5/ruby.haml +0 -55
- data/templates/project/templates/old/survivalkit/partials/html5/s.haml +0 -17
- data/templates/project/templates/old/survivalkit/partials/html5/samp.haml +0 -27
- data/templates/project/templates/old/survivalkit/partials/html5/sample-forms.haml +0 -52
- data/templates/project/templates/old/survivalkit/partials/html5/sample-tables.haml +0 -152
- data/templates/project/templates/old/survivalkit/partials/html5/section.haml +0 -21
- data/templates/project/templates/old/survivalkit/partials/html5/small.haml +0 -33
- data/templates/project/templates/old/survivalkit/partials/html5/strong.haml +0 -25
- data/templates/project/templates/old/survivalkit/partials/html5/sub-sup.haml +0 -58
- data/templates/project/templates/old/survivalkit/partials/html5/table.haml +0 -196
- data/templates/project/templates/old/survivalkit/partials/html5/text-summary.haml +0 -305
- data/templates/project/templates/old/survivalkit/partials/html5/thead.haml +0 -67
- data/templates/project/templates/old/survivalkit/partials/html5/time.haml +0 -31
- data/templates/project/templates/old/survivalkit/partials/html5/ul.haml +0 -21
- data/templates/project/templates/old/survivalkit/partials/menu.haml +0 -14
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/block.haml +0 -7
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/breadcrumbs.haml +0 -7
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/comments.haml +0 -69
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/field-image.haml +0 -7
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/form-comment.haml +0 -54
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/form-login.haml +0 -23
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/form-new-account.haml +0 -24
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/form-new-password.haml +0 -16
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/links.haml +0 -6
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/menu.haml +0 -10
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/messages.haml +0 -21
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/node.haml +0 -28
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/pager.haml +0 -17
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/rss-link.haml +0 -5
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/search.haml +0 -14
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/site-name.haml +0 -6
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/tabs.haml +0 -14
- data/templates/project/templates/old/survivalkit/partials/patterns-drupal/taxonomy.haml +0 -10
- data/templates/project/templates/old/survivalkit/partials/patterns-general/block.haml +0 -7
- data/templates/project/templates/old/survivalkit/partials/patterns-general/breadcrumbs.haml +0 -7
- data/templates/project/templates/old/survivalkit/partials/patterns-general/comments.haml +0 -69
- data/templates/project/templates/old/survivalkit/partials/patterns-general/field-image.haml +0 -7
- data/templates/project/templates/old/survivalkit/partials/patterns-general/form-comment.haml +0 -54
- data/templates/project/templates/old/survivalkit/partials/patterns-general/form-login.haml +0 -23
- data/templates/project/templates/old/survivalkit/partials/patterns-general/form-new-account.haml +0 -24
- data/templates/project/templates/old/survivalkit/partials/patterns-general/form-new-password.haml +0 -16
- data/templates/project/templates/old/survivalkit/partials/patterns-general/links.haml +0 -6
- data/templates/project/templates/old/survivalkit/partials/patterns-general/menu.haml +0 -10
- data/templates/project/templates/old/survivalkit/partials/patterns-general/messages.haml +0 -21
- data/templates/project/templates/old/survivalkit/partials/patterns-general/node.haml +0 -28
- data/templates/project/templates/old/survivalkit/partials/patterns-general/pager.haml +0 -17
- data/templates/project/templates/old/survivalkit/partials/patterns-general/rss-link.haml +0 -5
- data/templates/project/templates/old/survivalkit/partials/patterns-general/search.haml +0 -14
- data/templates/project/templates/old/survivalkit/partials/patterns-general/site-name.haml +0 -6
- data/templates/project/templates/old/survivalkit/partials/patterns-general/tabs.haml +0 -14
- data/templates/project/templates/old/survivalkit/partials/patterns-general/taxonomy.haml +0 -10
- data/templates/project/templates/old/survivalkit/styletile/_layout.haml +0 -1
- data/templates/project/templates/old/survivalkit/styletile/index.redirect +0 -1
- data/templates/project/templates/old/survivalkit/styletile/styletile.haml +0 -60
- data/templates/project/templates/old/view_helpers.rb +0 -25
- data/templates/shared/survivalkit/drupal7.scss +0 -3224
- data/templates/shared/survivalkit/survivalkit.scss +0 -32
@@ -1,146 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* MBP - Mobile boilerplate helper functions
|
3
|
-
*/
|
4
|
-
(function(document){
|
5
|
-
|
6
|
-
window.MBP = window.MBP || {};
|
7
|
-
|
8
|
-
// Fix for iPhone viewport scale bug
|
9
|
-
// http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
|
10
|
-
|
11
|
-
MBP.viewportmeta = document.querySelector && document.querySelector('meta[name="viewport"]');
|
12
|
-
MBP.ua = navigator.userAgent;
|
13
|
-
|
14
|
-
MBP.scaleFix = function () {
|
15
|
-
if (MBP.viewportmeta && /iPhone|iPad/.test(MBP.ua) && !/Opera Mini/.test(MBP.ua)) {
|
16
|
-
MBP.viewportmeta.content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
|
17
|
-
document.addEventListener("gesturestart", MBP.gestureStart, false);
|
18
|
-
}
|
19
|
-
};
|
20
|
-
MBP.gestureStart = function () {
|
21
|
-
MBP.viewportmeta.content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
|
22
|
-
};
|
23
|
-
|
24
|
-
|
25
|
-
// Hide URL Bar for iOS
|
26
|
-
// http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/
|
27
|
-
|
28
|
-
MBP.hideUrlBar = function () {
|
29
|
-
/iPhone/.test(MBP.ua) && !pageYOffset && !location.hash && setTimeout(function () {
|
30
|
-
window.scrollTo(0, 1);
|
31
|
-
}, 1000);
|
32
|
-
};
|
33
|
-
|
34
|
-
|
35
|
-
// Fast Buttons - read wiki below before using
|
36
|
-
// https://github.com/shichuan/mobile-html5-boilerplate/wiki/JavaScript-Helper
|
37
|
-
|
38
|
-
MBP.fastButton = function (element, handler) {
|
39
|
-
this.element = element;
|
40
|
-
this.handler = handler;
|
41
|
-
if (element.addEventListener) {
|
42
|
-
element.addEventListener('touchstart', this, false);
|
43
|
-
element.addEventListener('click', this, false);
|
44
|
-
}
|
45
|
-
};
|
46
|
-
|
47
|
-
MBP.fastButton.prototype.handleEvent = function(event) {
|
48
|
-
switch (event.type) {
|
49
|
-
case 'touchstart': this.onTouchStart(event); break;
|
50
|
-
case 'touchmove': this.onTouchMove(event); break;
|
51
|
-
case 'touchend': this.onClick(event); break;
|
52
|
-
case 'click': this.onClick(event); break;
|
53
|
-
}
|
54
|
-
};
|
55
|
-
|
56
|
-
MBP.fastButton.prototype.onTouchStart = function(event) {
|
57
|
-
event.stopPropagation();
|
58
|
-
this.element.addEventListener('touchend', this, false);
|
59
|
-
document.body.addEventListener('touchmove', this, false);
|
60
|
-
this.startX = event.touches[0].clientX;
|
61
|
-
this.startY = event.touches[0].clientY;
|
62
|
-
this.element.style.backgroundColor = "rgba(0,0,0,.7)";
|
63
|
-
};
|
64
|
-
|
65
|
-
MBP.fastButton.prototype.onTouchMove = function(event) {
|
66
|
-
if(Math.abs(event.touches[0].clientX - this.startX) > 10 || Math.abs(event.touches[0].clientY - this.startY) > 10) {
|
67
|
-
this.reset();
|
68
|
-
}
|
69
|
-
};
|
70
|
-
|
71
|
-
MBP.fastButton.prototype.onClick = function(event) {
|
72
|
-
event.stopPropagation();
|
73
|
-
this.reset();
|
74
|
-
this.handler(event);
|
75
|
-
if(event.type == 'touchend') {
|
76
|
-
MBP.preventGhostClick(this.startX, this.startY);
|
77
|
-
}
|
78
|
-
this.element.style.backgroundColor = "";
|
79
|
-
};
|
80
|
-
|
81
|
-
MBP.fastButton.prototype.reset = function() {
|
82
|
-
this.element.removeEventListener('touchend', this, false);
|
83
|
-
document.body.removeEventListener('touchmove', this, false);
|
84
|
-
this.element.style.backgroundColor = "";
|
85
|
-
};
|
86
|
-
|
87
|
-
MBP.preventGhostClick = function (x, y) {
|
88
|
-
MBP.coords.push(x, y);
|
89
|
-
window.setTimeout(function (){
|
90
|
-
MBP.coords.splice(0, 2);
|
91
|
-
}, 2500);
|
92
|
-
};
|
93
|
-
|
94
|
-
MBP.ghostClickHandler = function (event) {
|
95
|
-
for(var i = 0, len = MBP.coords.length; i < len; i += 2) {
|
96
|
-
var x = MBP.coords[i];
|
97
|
-
var y = MBP.coords[i + 1];
|
98
|
-
if(Math.abs(event.clientX - x) < 25 && Math.abs(event.clientY - y) < 25) {
|
99
|
-
event.stopPropagation();
|
100
|
-
event.preventDefault();
|
101
|
-
}
|
102
|
-
}
|
103
|
-
};
|
104
|
-
|
105
|
-
if (document.addEventListener) {
|
106
|
-
document.addEventListener('click', MBP.ghostClickHandler, true);
|
107
|
-
}
|
108
|
-
|
109
|
-
MBP.coords = [];
|
110
|
-
|
111
|
-
|
112
|
-
// iOS Startup Image
|
113
|
-
// https://github.com/shichuan/mobile-html5-boilerplate/issues#issue/2
|
114
|
-
|
115
|
-
MBP.splash = function () {
|
116
|
-
var filename = navigator.platform === 'iPad' ? 'h/' : 'l/';
|
117
|
-
document.write('<link rel="apple-touch-startup-image" href="/img/' + filename + 'splash.png" />' );
|
118
|
-
};
|
119
|
-
|
120
|
-
|
121
|
-
// Autogrow
|
122
|
-
// http://googlecode.blogspot.com/2009/07/gmail-for-mobile-html5-series.html
|
123
|
-
|
124
|
-
MBP.autogrow = function (element, lh) {
|
125
|
-
|
126
|
-
function handler(e){
|
127
|
-
var newHeight = this.scrollHeight,
|
128
|
-
currentHeight = this.clientHeight;
|
129
|
-
if (newHeight > currentHeight) {
|
130
|
-
this.style.height = newHeight + 3 * textLineHeight + "px";
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
|
-
var setLineHeight = (lh) ? lh : 12,
|
135
|
-
textLineHeight = element.currentStyle ? element.currentStyle.lineHeight :
|
136
|
-
getComputedStyle(element, null).lineHeight;
|
137
|
-
|
138
|
-
textLineHeight = (textLineHeight.indexOf("px") == -1) ? setLineHeight :
|
139
|
-
parseInt(textLineHeight, 10);
|
140
|
-
|
141
|
-
element.style.overflow = "hidden";
|
142
|
-
element.addEventListener ? element.addEventListener('keyup', handler, false) :
|
143
|
-
element.attachEvent('onkeyup', handler);
|
144
|
-
};
|
145
|
-
|
146
|
-
})(document);
|
@@ -1,61 +0,0 @@
|
|
1
|
-
var imgSizer = {
|
2
|
-
Config : {
|
3
|
-
imgCache : []
|
4
|
-
,spacer : "/path/to/your/spacer.gif"
|
5
|
-
}
|
6
|
-
|
7
|
-
,collate : function(aScope) {
|
8
|
-
var isOldIE = (document.all && !window.opera && !window.XDomainRequest) ? 1 : 0;
|
9
|
-
if (isOldIE && document.getElementsByTagName) {
|
10
|
-
var c = imgSizer;
|
11
|
-
var imgCache = c.Config.imgCache;
|
12
|
-
|
13
|
-
var images = (aScope && aScope.length) ? aScope : document.getElementsByTagName("img");
|
14
|
-
for (var i = 0; i < images.length; i++) {
|
15
|
-
images[i].origWidth = images[i].offsetWidth;
|
16
|
-
images[i].origHeight = images[i].offsetHeight;
|
17
|
-
|
18
|
-
imgCache.push(images[i]);
|
19
|
-
c.ieAlpha(images[i]);
|
20
|
-
images[i].style.width = "100%";
|
21
|
-
}
|
22
|
-
|
23
|
-
if (imgCache.length) {
|
24
|
-
c.resize(function() {
|
25
|
-
for (var i = 0; i < imgCache.length; i++) {
|
26
|
-
var ratio = (imgCache[i].offsetWidth / imgCache[i].origWidth);
|
27
|
-
imgCache[i].style.height = (imgCache[i].origHeight * ratio) + "px";
|
28
|
-
}
|
29
|
-
});
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
,ieAlpha : function(img) {
|
35
|
-
var c = imgSizer;
|
36
|
-
if (img.oldSrc) {
|
37
|
-
img.src = img.oldSrc;
|
38
|
-
}
|
39
|
-
var src = img.src;
|
40
|
-
img.style.width = img.offsetWidth + "px";
|
41
|
-
img.style.height = img.offsetHeight + "px";
|
42
|
-
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
|
43
|
-
img.oldSrc = src;
|
44
|
-
img.src = c.Config.spacer;
|
45
|
-
}
|
46
|
-
|
47
|
-
// Ghettomodified version of Simon Willison's addLoadEvent() -- http://simonwillison.net/2004/May/26/addLoadEvent/
|
48
|
-
,resize : function(func) {
|
49
|
-
var oldonresize = window.onresize;
|
50
|
-
if (typeof window.onresize != 'function') {
|
51
|
-
window.onresize = func;
|
52
|
-
} else {
|
53
|
-
window.onresize = function() {
|
54
|
-
if (oldonresize) {
|
55
|
-
oldonresize();
|
56
|
-
}
|
57
|
-
func();
|
58
|
-
}
|
59
|
-
}
|
60
|
-
}
|
61
|
-
}
|