Remove obsolete resources, and make progress on some new pages.
This commit is contained in:
parent
bf7da74c67
commit
f6c1151ab0
|
@ -142,7 +142,7 @@
|
|||
@li{@a[href: "https://docs.racket-lang.org"]{Documentation}}
|
||||
@li{@a[href: "https://blog.racket-lang.org"]{Blog}}
|
||||
@li{@div[class: "medium metro info btn icon-left entypo icon-install"]{
|
||||
@a[href: "./download/"]{Download}}}}}})
|
||||
@a[href: 'download]{Download}}}}}})
|
||||
|
||||
(define html-preamble
|
||||
@list{
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font: inherit; font-size: 100%; vertical-align: baseline; }
|
||||
|
||||
b { font-weight: bold; }
|
||||
|
||||
html { line-height: 1; }
|
||||
|
||||
ol, ul { list-style: none; }
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
#lang meta/web
|
||||
|
||||
(require "resources.rkt" "data.rkt" "installer-pages.rkt" "symlinks.rkt"
|
||||
(require "resources.rkt" "data.rkt" "installer-pages.rkt" "symlinks.rkt" "../www/gumby.rkt"
|
||||
(prefix-in pre: "../stubs/pre.rkt"))
|
||||
|
||||
(provide render-download-page)
|
||||
(define (render-download-page [release current-release] [package 'racket])
|
||||
(define version (release-version release))
|
||||
@center-div{
|
||||
@h2{@(package->name package) v@version (@(release-date-string release))}
|
||||
(list
|
||||
@columns[10 #:center? #t #:row? #t #:center-text? #t]{
|
||||
@h2[style: "text-align: center"]{@(package->name package) v@version (@(release-date-string release))}
|
||||
@div[id: "download_panel" align: "center" style: "display: none;"]{
|
||||
@input[type: 'submit value: "Download" onclick: "do_jump();"
|
||||
style: '("font-size: 200%; font-weight: bolder;"
|
||||
" letter-spacing: 0.2em;"
|
||||
" margin: 0.5ex 0 1ex 0; width: 100%;")]
|
||||
" margin: 0.5ex 0 1ex 0; width: 50%;")]
|
||||
@br
|
||||
@div{
|
||||
@div[style: "margin-bottom: 20px"]{
|
||||
Platform:
|
||||
@select[id: "platform_selector"
|
||||
onchange: "selection_changed();"
|
||||
|
@ -22,35 +23,33 @@
|
|||
@(for/list ([i (in-list all-installers)]
|
||||
#:when (and (equal? release (installer-release i))
|
||||
(equal? package (installer-package i))))
|
||||
(installer->page i 'render-option))}}
|
||||
@|br br|
|
||||
(installer->page i 'render-option))}}}}
|
||||
@columns[8 #:center? #t #:center-text? #t #:row? #t]{
|
||||
@(let* ([sep @list{@nbsp @bull @nbsp}]
|
||||
[links (λ links @(tr (td (div style: "margin: 1ex 4ex;"
|
||||
(add-between links sep)))))]
|
||||
[links (λ links @(div style: "margin: 1ex 4ex;" (add-between links sep)))]
|
||||
[docs @list{@|docs|/@|version|/html}])
|
||||
@table[style: "text-align: center; font-size: small;"
|
||||
frame: 'hsides rules: 'rows]{
|
||||
@links[@list{Release: @nbsp @(release-page release){Announcement}}
|
||||
@a[href: @list{@|docs|/release/}]{Notes}
|
||||
@a[href: @docs]{Documentation}]
|
||||
@links[@license{License}
|
||||
all-version-pages
|
||||
@pre:installers{Nightly Installers}]})
|
||||
@br
|
||||
@div[id: "linux_explain"
|
||||
style: '("font-size: 75%; display: none; width: 28em;"
|
||||
" margin-top: 1ex; text-align: center;")]{
|
||||
(list
|
||||
@row{
|
||||
@links[@list{Release: @nbsp @(release-page release){Announcement}}
|
||||
@a[href: @list{@|docs|/release/}]{Notes}
|
||||
@a[href: @docs]{Documentation}]}
|
||||
@row{@links[@license{License}
|
||||
all-version-pages
|
||||
@pre:installers{Nightly Installers}]}))}
|
||||
@columns[4 #:center? #t #:center-text? #t #:row? #t]{ @div[id: "linux_explain"
|
||||
style: '("font-size: 75%; display: none;"
|
||||
" margin-top: 1ex;")]{
|
||||
@b{Note about the Linux installers:} if you don't see an option for
|
||||
your particular platform, try other Linux installers, starting from
|
||||
similar ones. Very often, a build on one Linux variant will work on
|
||||
others too.}}
|
||||
others too.}
|
||||
@downloader-script
|
||||
@noscript{
|
||||
Installers are available for the following platforms:
|
||||
@ul{@(for/list ([i (in-list all-installers)]
|
||||
#:when (and (equal? release (installer-release i))
|
||||
(equal? package (installer-package i))))
|
||||
@li{@(installer->page i 'only-platform)})}}})
|
||||
@li{@(installer->page i 'only-platform)})}}}))
|
||||
|
||||
(define (release-page* rel)
|
||||
(define ver (release-version rel))
|
||||
|
@ -70,7 +69,7 @@
|
|||
(define ver (release-version rel))
|
||||
(define file (format "~a-v~a.html" pkg ver))
|
||||
(define title @list{Download @(package->name pkg) v@ver})
|
||||
@page[#:file file #:title title #:part-of 'download]{
|
||||
@page[#:file file #:title title #:width 'full #:part-of 'download]{
|
||||
@(render-download-page rel pkg)})
|
||||
(define style
|
||||
@style/inline[type: 'text/css]{
|
||||
|
@ -87,7 +86,8 @@
|
|||
background-color: #eeee22;
|
||||
}})
|
||||
@page[#:id 'all-versions #:title "All Versions" #:part-of 'download
|
||||
#:extra-headers style]{
|
||||
#:extra-headers style #:width 'full]{
|
||||
@columns[10 #:center? #t #:row? #t]{
|
||||
@table[align: 'center cellspacing: 0 cellpadding: 4 frame: 'box
|
||||
rules: 'groups]{
|
||||
@thead{
|
||||
|
@ -117,7 +117,7 @@
|
|||
@tr[class: 'version-row]{
|
||||
@td[align: 'center colspan: 3]{@pre:installers}
|
||||
@td{@nbsp @pre:docs[#:sub 'html]{[HTML]} @;
|
||||
@nbsp @pre:docs[#:sub 'pdf]{[PDF]} @nbsp}}}}}))
|
||||
@nbsp @pre:docs[#:sub 'pdf]{[PDF]} @nbsp}}}}}}))
|
||||
|
||||
(define license
|
||||
@page[#:title "Software License" #:part-of 'download]{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,7 +5,7 @@
|
|||
(provide download)
|
||||
(define download
|
||||
@page[#:link-title "Download" #:window-title "Download Racket"
|
||||
#:file "download/" #:part-of 'download]{
|
||||
#:file "download/" #:part-of 'download #:width 'full]{
|
||||
@(render-download-page)})
|
||||
|
||||
(define images (list (copyfile (in-here "img/download.png"))
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -4,7 +4,7 @@
|
|||
|
||||
(define (css url) @link[href: url rel: "stylesheet" type: "text/css"]{})
|
||||
(define (icon name) @i[class: name]{})
|
||||
(define (row . content) (div class: "row" content))
|
||||
(define (row . content) (apply div class: "row" content))
|
||||
|
||||
(define (panetitle . l) @div[class: "panetitle" l])
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
#:push [push #f] . body)
|
||||
(define d (apply tag class: (list (print-num n) " columns"
|
||||
(and center? " centered")
|
||||
(and center-text? " center-text")
|
||||
(and center-text? " text-center")
|
||||
(and push
|
||||
(list " push_" (print-num push))))
|
||||
body))
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
/**
|
||||
* Gumby Init
|
||||
*/
|
||||
|
||||
// test for touch event support
|
||||
Modernizr.load({
|
||||
test: Modernizr.touch,
|
||||
|
||||
// if present load custom jQuery mobile build and update Gumby.click
|
||||
yep: Gumby.path+'/jquery.mobile.custom.min.js',
|
||||
callback: function(url, result, key) {
|
||||
// check jQuery mobile has successfully loaded before using tap events
|
||||
if($.mobile) {
|
||||
window.Gumby.click = 'tap';
|
||||
}
|
||||
},
|
||||
|
||||
// either way initialize Gumby
|
||||
complete: function() {
|
||||
window.Gumby.init();
|
||||
|
||||
// if AMD return Gumby object to define
|
||||
if(typeof define == "function" && define.amd) {
|
||||
define(window.Gumby);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,150 +0,0 @@
|
|||
/**
|
||||
* Gumby Framework
|
||||
* ---------------
|
||||
*
|
||||
* Follow @gumbycss on twitter and spread the love.
|
||||
* We worked super hard on making this awesome and released it to the web.
|
||||
* All we ask is you leave this intact. #gumbyisawesome
|
||||
*
|
||||
* Gumby Framework
|
||||
* http://gumbyframework.com
|
||||
*
|
||||
* Built with love by your friends @digitalsurgeons
|
||||
* http://www.digitalsurgeons.com
|
||||
*
|
||||
* Free to use under the MIT license.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function Gumby() {
|
||||
this.$dom = $(document);
|
||||
this.isOldie = !!this.$dom.find('html').hasClass('oldie');
|
||||
this.click = 'click';
|
||||
this.onReady = this.onOldie = this.onTouch = false;
|
||||
this.uiModules = {};
|
||||
this.inits = {};
|
||||
|
||||
// check and set path with js/libs default
|
||||
this.path = $('script[gumby-path]').attr('gumby-path') ||
|
||||
$('script[data-path]').attr('data-path') ||
|
||||
$('script[path]').attr('path') ||
|
||||
'js/libs';
|
||||
}
|
||||
|
||||
// initialize Gumby
|
||||
Gumby.prototype.init = function() {
|
||||
// init UI modules
|
||||
this.initUIModules();
|
||||
|
||||
var scope = this;
|
||||
|
||||
// call ready() code when dom is ready
|
||||
this.$dom.ready(function() {
|
||||
if(scope.onReady) {
|
||||
scope.onReady();
|
||||
}
|
||||
|
||||
// call oldie() callback if applicable
|
||||
if(scope.isOldie && scope.onOldie) {
|
||||
scope.onOldie();
|
||||
}
|
||||
|
||||
// call touch() callback if applicable
|
||||
if(Modernizr.touch && scope.onTouch) {
|
||||
scope.onTouch();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// public helper - set Gumby ready callback
|
||||
Gumby.prototype.ready = function(code) {
|
||||
if(code && typeof code === 'function') {
|
||||
this.onReady = code;
|
||||
}
|
||||
};
|
||||
|
||||
// public helper - set oldie callback
|
||||
Gumby.prototype.oldie = function(code) {
|
||||
if(code && typeof code === 'function') {
|
||||
this.onOldie = code;
|
||||
}
|
||||
};
|
||||
|
||||
// public helper - set touch callback
|
||||
Gumby.prototype.touch = function(code) {
|
||||
if(code && typeof code === 'function') {
|
||||
this.onTouch = code;
|
||||
}
|
||||
};
|
||||
|
||||
// public helper - return debuggin object including uiModules object
|
||||
Gumby.prototype.debug = function() {
|
||||
return {
|
||||
$dom: this.$dom,
|
||||
isOldie: this.isOldie,
|
||||
uiModules: this.uiModules,
|
||||
click: this.click
|
||||
};
|
||||
};
|
||||
|
||||
// grab attribute value, testing data- gumby- and no prefix
|
||||
Gumby.prototype.selectAttr = function() {
|
||||
var i = 0;
|
||||
|
||||
// any number of attributes can be passed
|
||||
for(; i < arguments.length; i++) {
|
||||
// various formats
|
||||
var attr = arguments[i],
|
||||
dataAttr = 'data-'+arguments[i],
|
||||
gumbyAttr = 'gumby-'+arguments[i];
|
||||
|
||||
// first test for data-attr
|
||||
if(this.attr(dataAttr)) {
|
||||
return this.attr(dataAttr);
|
||||
|
||||
// next test for gumby-attr
|
||||
} else if(this.attr(gumbyAttr)) {
|
||||
return this.attr(gumbyAttr);
|
||||
|
||||
// finally no prefix
|
||||
} else if(this.attr(attr)) {
|
||||
return this.attr(attr);
|
||||
}
|
||||
}
|
||||
|
||||
// none found
|
||||
return false;
|
||||
};
|
||||
|
||||
// add an initialisation method
|
||||
Gumby.prototype.addInitalisation = function(ref, code) {
|
||||
this.inits[ref] = code;
|
||||
};
|
||||
|
||||
// initialize a uiModule
|
||||
Gumby.prototype.initialize = function(ref) {
|
||||
if(this.inits[ref] && typeof this.inits[ref] === 'function') {
|
||||
this.inits[ref]();
|
||||
}
|
||||
};
|
||||
|
||||
// store a UI module
|
||||
Gumby.prototype.UIModule = function(data) {
|
||||
var module = data.module;
|
||||
this.uiModules[module] = data;
|
||||
};
|
||||
|
||||
// loop round and init all UI modules
|
||||
Gumby.prototype.initUIModules = function() {
|
||||
var x;
|
||||
for(x in this.uiModules) {
|
||||
this.uiModules[x].init();
|
||||
}
|
||||
};
|
||||
|
||||
window.Gumby = new Gumby();
|
||||
|
||||
}();
|
1
new-racket-web/web/www/js/libs/gumby.min.js
vendored
1
new-racket-web/web/www/js/libs/gumby.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,93 +0,0 @@
|
|||
/**
|
||||
* Gumby Checkbox
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function Checkbox($el) {
|
||||
|
||||
this.$el = $el;
|
||||
var scope = this;
|
||||
|
||||
// listen for click event and custom gumby check/uncheck events
|
||||
this.$el.on(Gumby.click, function(e) {
|
||||
scope.click(e);
|
||||
}).on('gumby.check', function() {
|
||||
scope.update(true);
|
||||
}).on('gumby.uncheck', function() {
|
||||
scope.update(false);
|
||||
});
|
||||
|
||||
// update any .checked checkboxes on load
|
||||
if(scope.$el.hasClass('checked')) {
|
||||
scope.update(true);
|
||||
}
|
||||
}
|
||||
|
||||
// handle checkbox click event
|
||||
Checkbox.prototype.click = function(e) {
|
||||
|
||||
// element responsible for event trigger
|
||||
var $target = $(e.target);
|
||||
|
||||
// prevent propagation
|
||||
e.stopPropagation();
|
||||
|
||||
// prevent checkbox checking, we'll do that manually
|
||||
e.preventDefault();
|
||||
|
||||
// check/uncheck
|
||||
if(this.$el.hasClass('checked')) {
|
||||
this.update(false);
|
||||
} else {
|
||||
this.update(true);
|
||||
}
|
||||
};
|
||||
|
||||
// update checkbox, check equals true/false to sepcify check/uncheck
|
||||
Checkbox.prototype.update = function(check) {
|
||||
|
||||
var $input = this.$el.find('input'),
|
||||
$span = this.$el.find('span');
|
||||
|
||||
// check checkbox - check input, add checked class, append <i>
|
||||
if(check) {
|
||||
|
||||
$span.append('<i class="icon-check" />');
|
||||
|
||||
$input.prop('checked', true).end()
|
||||
.addClass('checked')
|
||||
.trigger('gumby.onCheck').trigger('gumby.onChange');
|
||||
|
||||
// uncheck checkbox - uncheck input, remove checked class, remove <i>
|
||||
} else {
|
||||
$input.prop('checked', false).end()
|
||||
.find('i').remove().end()
|
||||
.removeClass('checked').trigger('gumby.onUncheck').trigger('gumby.onChange');
|
||||
}
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('checkboxes', function() {
|
||||
$('.checkbox').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isCheckbox')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isCheckbox', true);
|
||||
new Checkbox($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'checkbox',
|
||||
events: ['onCheck', 'onUncheck', 'onChange', 'check', 'uncheck'],
|
||||
init: function() {
|
||||
Gumby.initialize('checkboxes');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,83 +0,0 @@
|
|||
/**
|
||||
* Gumby FitText
|
||||
*
|
||||
* Adapted from the awesome FitText jQuery plugin
|
||||
* brought to you by Paravel - http://paravelinc.com/
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function FitText($el) {
|
||||
this.$el = $el;
|
||||
// optional compressor rate
|
||||
this.rate = Gumby.selectAttr.apply(this.$el, ['rate']) || 1;
|
||||
// optional font sizes (min|max)
|
||||
this.fontSizes = this.parseSizes(Gumby.selectAttr.apply(this.$el, ['sizes']));
|
||||
|
||||
var scope = this;
|
||||
|
||||
// lets go
|
||||
$(window).on('load resize orientationchange', function() {
|
||||
scope.resize();
|
||||
});
|
||||
}
|
||||
|
||||
// apply the resizing
|
||||
FitText.prototype.resize = function() {
|
||||
this.$el.css('font-size', this.calculateSize());
|
||||
};
|
||||
|
||||
// calculate the font size
|
||||
FitText.prototype.calculateSize = function() {
|
||||
return Math.max(Math.min(this.$el.width() / (this.rate*10), parseFloat(this.fontSizes.max)), parseFloat(this.fontSizes.min));
|
||||
};
|
||||
|
||||
// parse size attributes with min|max syntax
|
||||
FitText.prototype.parseSizes = function(attrStr) {
|
||||
var sizes = {
|
||||
min: Number.NEGATIVE_INFINITY,
|
||||
max: Number.POSITIVE_INFINITY
|
||||
};
|
||||
|
||||
// attribute is optional
|
||||
if(!attrStr) { return sizes; }
|
||||
|
||||
// min and/or max specified
|
||||
if(attrStr.indexOf('|') > -1) {
|
||||
attrStr = attrStr.split('|');
|
||||
|
||||
// both are optional
|
||||
sizes.min = Number(attrStr[0]) || sizes.min;
|
||||
sizes.max = Number(attrStr[1]) || sizes.max;
|
||||
}
|
||||
|
||||
// only one value specific without | so use as min
|
||||
sizes.min = Number(attrStr) || sizes.min;
|
||||
|
||||
return sizes;
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('fittext', function() {
|
||||
$('.fittext').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isFittext')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isFittext', true);
|
||||
new FitText($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'fittext',
|
||||
events: [],
|
||||
init: function() {
|
||||
Gumby.initialize('fittext');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,111 +0,0 @@
|
|||
/**
|
||||
* Gumby Fixed
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function Fixed($el) {
|
||||
this.$el = $el;
|
||||
this.$holder = Gumby.selectAttr.apply(this.$el, ['holder']);
|
||||
this.fixedPoint = Gumby.selectAttr.apply(this.$el, ['fixed']);
|
||||
this.unfixPoint = false;
|
||||
|
||||
// if holder attr set then create jQuery object
|
||||
// otherwise use window for scrolling cals
|
||||
if(this.$holder) {
|
||||
this.$holder = $(this.$holder);
|
||||
} else {
|
||||
this.$holder = $(window);
|
||||
}
|
||||
|
||||
// fix/unfix points specified
|
||||
if(this.fixedPoint.indexOf('|') > -1) {
|
||||
var points = this.fixedPoint.split('|');
|
||||
this.fixedPoint = points[0];
|
||||
this.unfixPoint = points[1];
|
||||
}
|
||||
|
||||
// parse possible parameters
|
||||
this.fixedPoint = this.parseAttrValue(this.fixedPoint);
|
||||
if(this.unfixPoint) {
|
||||
this.unfixPoint = this.parseAttrValue(this.unfixPoint);
|
||||
}
|
||||
|
||||
var scope = this;
|
||||
this.$holder.scroll(function() {
|
||||
scope.scroll();
|
||||
});
|
||||
}
|
||||
|
||||
// handle scroll event on window/specified holder
|
||||
Fixed.prototype.scroll = function() {
|
||||
var offset = this.$holder.scrollTop(),
|
||||
fixedPoint = this.fixedPoint,
|
||||
unfixPoint = this.unfixPoint,
|
||||
endPoint = this.endPoint;
|
||||
|
||||
// if fixed point, unfix point or end point are DOM fragements
|
||||
// then re-calculate values as could have been updated
|
||||
fixedPoint = fixedPoint instanceof jQuery ? this.fixedPoint.offset().top : this.fixedPoint;
|
||||
unfixPoint = unfixPoint instanceof jQuery ? this.unfixPoint.offset().top : this.unfixPoint;
|
||||
|
||||
// ensure unfix point is never reached if not set
|
||||
if(!unfixPoint) {
|
||||
unfixPoint = offset * 2;
|
||||
}
|
||||
|
||||
// scrolled past fixed point and no fixed class present
|
||||
if((offset >= fixedPoint) && (offset < unfixPoint) && !this.$el.hasClass('fixed')) {
|
||||
this.$el.addClass('fixed').trigger('gumby.onFixed');
|
||||
|
||||
// before fixed point, pass 0 to onUnfixed event
|
||||
} else if((offset <= fixedPoint) && this.$el.hasClass('fixed')) {
|
||||
this.$el.removeClass('fixed').trigger('gumby.onUnfixed', 0);
|
||||
}
|
||||
|
||||
// after unfix point, pass 1 to onUnfixed event
|
||||
// separate conditional as should override
|
||||
if(unfixPoint && (offset >= unfixPoint) && this.$el.hasClass('fixed')) {
|
||||
this.$el.removeClass('fixed').trigger('gumby.onUnfixed', 1);
|
||||
}
|
||||
};
|
||||
|
||||
// parse attribute values, could be px, top, selector
|
||||
Fixed.prototype.parseAttrValue = function(attr) {
|
||||
// px value fixed point
|
||||
if($.isNumeric(attr)) {
|
||||
return Number(attr);
|
||||
// 'top' string fixed point
|
||||
} else if(attr === 'top') {
|
||||
return this.$el.offset().top;
|
||||
// selector specified
|
||||
} else {
|
||||
var $el = $(attr);
|
||||
return $el.length ? $el : false;
|
||||
}
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('fixed', function() {
|
||||
$('[data-fixed],[gumby-fixed],[fixed]').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isFixed')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isFixed', true);
|
||||
new Fixed($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'fixed',
|
||||
events: ['onFixed', 'onUnfixed'],
|
||||
init: function() {
|
||||
Gumby.initialize('fixed');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,69 +0,0 @@
|
|||
/**
|
||||
* Gumby Navbar
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
// define module class and init only if we're on touch devices
|
||||
if(!Modernizr.touch) {
|
||||
return;
|
||||
}
|
||||
|
||||
function Navbar($el) {
|
||||
this.$el = $el;
|
||||
var scope = this;
|
||||
|
||||
// when navbar items are tapped hide/show dropdowns
|
||||
this.$el.find('li').on(Gumby.click, function(e) {
|
||||
var $this = $(this);
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
// prevent jump to top of page
|
||||
if(this.href === '#') {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
scope.dropdown($this);
|
||||
});
|
||||
}
|
||||
|
||||
// hide/show dropdowns
|
||||
Navbar.prototype.dropdown = function($this) {
|
||||
// we have dropdowns so open/cose
|
||||
if($this.children('.dropdown').length) {
|
||||
if($this.hasClass('active')) {
|
||||
$this.removeClass('active');
|
||||
} else {
|
||||
$this.addClass('active');
|
||||
}
|
||||
// no dropdown so close others
|
||||
} else {
|
||||
this.$items.removeClass('active');
|
||||
}
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('navbars', function() {
|
||||
$('.navbar').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isNavbar')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isNavbar', true);
|
||||
new Navbar($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'navbar',
|
||||
events: [],
|
||||
init: function() {
|
||||
Gumby.initialize('navbars');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,83 +0,0 @@
|
|||
/**
|
||||
* Gumby RadioBtn
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function RadioBtn($el) {
|
||||
|
||||
this.$el = $el;
|
||||
var scope = this;
|
||||
|
||||
// listen for click event and custom gumby check event
|
||||
this.$el.on(Gumby.click, function(e) {
|
||||
scope.click(e);
|
||||
}).on('gumby.check', function() {
|
||||
scope.update();
|
||||
});
|
||||
|
||||
// update any .checked checkboxes on load
|
||||
if(scope.$el.hasClass('checked')) {
|
||||
scope.update();
|
||||
}
|
||||
}
|
||||
|
||||
// handle radio button click event
|
||||
RadioBtn.prototype.click = function(e) {
|
||||
|
||||
// element responsible for event trigger
|
||||
var $target = $(e.target);
|
||||
|
||||
// prevent propagation
|
||||
e.stopPropagation();
|
||||
|
||||
// prevent radio button checking, we'll do that manually
|
||||
e.preventDefault();
|
||||
|
||||
// check radio button
|
||||
this.update();
|
||||
};
|
||||
|
||||
// check radio button, uncheck all others in name group
|
||||
RadioBtn.prototype.update = function() {
|
||||
var // this specific radio button
|
||||
$input = this.$el.find('input[type=radio]'),
|
||||
$span = this.$el.find('span'),
|
||||
// the group of radio buttons
|
||||
group = 'input[name="'+$input.attr('name')+'"]';
|
||||
|
||||
// uncheck radio buttons in same group - uncheck input, remove checked class, remove <i>
|
||||
$('.radio').has(group).removeClass('checked')
|
||||
.find('input').prop('checked', false).end()
|
||||
.find('i').remove();
|
||||
|
||||
// check this radio button - check input, add checked class, append <i>
|
||||
$input.prop('checked', true);
|
||||
$span.append('<i class="icon-dot" />');
|
||||
this.$el.addClass('checked').trigger('gumby.onChange');
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('radiobtns', function() {
|
||||
$('.radio').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isRadioBtn')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isRadioBtn', true);
|
||||
new RadioBtn($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'radiobtn',
|
||||
events: ['onChange', 'check'],
|
||||
init: function() {
|
||||
Gumby.initialize('radiobtns');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,74 +0,0 @@
|
|||
/**
|
||||
* Gumby Retina
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function Retina($el) {
|
||||
this.$el = $el;
|
||||
this.imageSrc = this.$el.attr('src');
|
||||
this.retinaSrc = this.fetchRetinaImage();
|
||||
this.$retinaImg = $(new Image());
|
||||
|
||||
var scope = this
|
||||
|
||||
// image src not valid
|
||||
if(!this.retinaSrc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// load retina image
|
||||
this.$retinaImg.attr('src', this.retinaSrc).load(function() {
|
||||
scope.retinaImageLoaded();
|
||||
});
|
||||
}
|
||||
|
||||
// fetch retina src by appending '@2x' to image string before extension
|
||||
Retina.prototype.fetchRetinaImage = function() {
|
||||
var imgSrc = this.imageSrc,
|
||||
index = this.imageSrc.search(/(\.|\/)(gif|jpe?g|png)$/i);
|
||||
|
||||
// image src is not valid
|
||||
if(index < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// return retina src
|
||||
return imgSrc.substr(0, index) + '@2x' + imgSrc.substr(index, imgSrc.length);
|
||||
};
|
||||
|
||||
// once retina image loaded swap original src
|
||||
Retina.prototype.retinaImageLoaded = function() {
|
||||
this.$el.attr('src', this.$retinaImg.attr('src')).trigger('gumby.onRetina');
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('retina', function() {
|
||||
|
||||
// this module is for retina devices only
|
||||
if(!window.devicePixelRatio || window.devicePixelRatio <= 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('img[data-retina],img[gumby-retina],img[retina]').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isRetina')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isRetina', true);
|
||||
new Retina($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'retina',
|
||||
events: ['onRetina'],
|
||||
init: function() {
|
||||
Gumby.initialize('retina');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,112 +0,0 @@
|
|||
/**
|
||||
* Gumby SkipLink
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function SkipLink($el) {
|
||||
|
||||
this.$el = $el;
|
||||
this.targetPos = 0;
|
||||
this.duration = Number(Gumby.selectAttr.apply(this.$el, ['duration'])) || 200;
|
||||
this.offset = Gumby.selectAttr.apply(this.$el, ['offset']) || false;
|
||||
this.easing = Gumby.selectAttr.apply(this.$el, ['easing']) || 'swing';
|
||||
|
||||
var scope = this;
|
||||
|
||||
// skip to target element on click or trigger of gumby.skipTo event
|
||||
this.$el.on(Gumby.click+' gumby.skip', function(e) {
|
||||
e.preventDefault();
|
||||
// calculate target on each click
|
||||
// other UI interactions could effect this
|
||||
scope.calculateTarget();
|
||||
});
|
||||
}
|
||||
|
||||
// calculate target px point to skip to
|
||||
SkipLink.prototype.calculateTarget = function() {
|
||||
|
||||
var scope = this,
|
||||
target = Gumby.selectAttr.apply(this.$el, ['goto']),
|
||||
$target;
|
||||
|
||||
// 'top' specified so target is 0px
|
||||
if(target == 'top') {
|
||||
this.targetPos = 0;
|
||||
|
||||
// px point specified
|
||||
} else if($.isNumeric(target)) {
|
||||
this.targetPos = Number(target);
|
||||
} else {
|
||||
|
||||
// check for element with target as selector
|
||||
$target = $(target);
|
||||
|
||||
// target does not exist, we need a target
|
||||
if(!$target) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.targetPos = $target.offset().top;
|
||||
}
|
||||
|
||||
// skip to target
|
||||
this.skipTo();
|
||||
};
|
||||
|
||||
// animate body, html scrollTop value to target px point
|
||||
SkipLink.prototype.skipTo = function() {
|
||||
var scope = this;
|
||||
|
||||
// slide to position of target
|
||||
$('html,body').animate({
|
||||
'scrollTop' : this.calculateOffset()
|
||||
}, this.duration, this.easing).promise().done(function() {
|
||||
scope.$el.trigger('gumby.onComplete');
|
||||
});
|
||||
};
|
||||
|
||||
// calculate offset with current target point
|
||||
SkipLink.prototype.calculateOffset = function() {
|
||||
// no offset so return target here
|
||||
if(!this.offset) {
|
||||
return this.targetPos;
|
||||
}
|
||||
|
||||
// negative / positive
|
||||
var op = this.offset.substr(0, 1),
|
||||
off = Number(this.offset.substr(1, this.offset.length));
|
||||
|
||||
// subtract offset from target position
|
||||
if(op === '-') {
|
||||
return this.targetPos - off;
|
||||
// add offset to target position
|
||||
} else if(op === '+') {
|
||||
return this.targetPos + off;
|
||||
}
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('skiplinks', function() {
|
||||
$('.skiplink > a, .skip').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isSkipLink')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isSkipLink', true);
|
||||
new SkipLink($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'skiplink',
|
||||
events: ['onComplete', 'skip'],
|
||||
init: function() {
|
||||
Gumby.initialize('skiplinks');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,70 +0,0 @@
|
|||
/**
|
||||
* Gumby Tabs
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function Tabs($el) {
|
||||
|
||||
this.$el = $el;
|
||||
this.$nav = this.$el.find('ul.tab-nav > li');
|
||||
this.$content = this.$el.find('.tab-content');
|
||||
|
||||
var scope = this;
|
||||
|
||||
// listen for click event on tab nav and custom gumby set event
|
||||
this.$nav.children('a').on(Gumby.click, function(e) {
|
||||
e.preventDefault();
|
||||
scope.click($(this));
|
||||
});
|
||||
|
||||
// listen for gumby.set value for dynamically set tabs
|
||||
this.$el.on('gumby.set', function(e, index) {
|
||||
scope.set(e, index);
|
||||
});
|
||||
}
|
||||
|
||||
// handle tab nav click event
|
||||
Tabs.prototype.click = function($this) {
|
||||
// index of item to activate
|
||||
var index = $this.parent().index();
|
||||
|
||||
// deactivate other tab navigation and content
|
||||
this.$nav.add(this.$content).removeClass('active');
|
||||
|
||||
// activate this tab nav link and content
|
||||
this.$nav.eq(index).add(this.$content.eq(index)).addClass('active');
|
||||
|
||||
// trigger gumby.change event and pass current active tab index
|
||||
this.$el.trigger('gumby.onChange', index);
|
||||
};
|
||||
|
||||
// set specific tab
|
||||
Tabs.prototype.set = function(e, index) {
|
||||
this.$nav.eq(index).find('a').trigger(Gumby.click);
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('tabs', function() {
|
||||
$('.tabs').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isTabs')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isTabs', true);
|
||||
new Tabs($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'tabs',
|
||||
events: ['onChange', 'set'],
|
||||
init: function() {
|
||||
Gumby.initialize('tabs');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,176 +0,0 @@
|
|||
/**
|
||||
* Gumby Toggles/Switches
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
// Toggle constructor
|
||||
function Toggle($el) {
|
||||
this.$el = $($el);
|
||||
this.targets = [];
|
||||
this.on = '';
|
||||
|
||||
if(this.$el.length) {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
||||
// Switch constructor
|
||||
function Switch($el) {
|
||||
this.$el = $($el);
|
||||
this.targets = [];
|
||||
this.on = '';
|
||||
|
||||
if(this.$el.length) {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
||||
// intialise toggles, switches will inherit method
|
||||
Toggle.prototype.init = function() {
|
||||
this.targets = this.parseTargets();
|
||||
this.on = Gumby.selectAttr.apply(this.$el, ['on']) || Gumby.click;
|
||||
|
||||
var scope = this;
|
||||
|
||||
// bind to specified event and trigger
|
||||
this.$el.on(this.on, function(e) {
|
||||
// only disable default if <a>
|
||||
if($(this).prop('tagName') === 'A') {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// stop propagation
|
||||
e.stopPropagation();
|
||||
|
||||
scope.trigger(scope.triggered);
|
||||
|
||||
// listen for gumby.trigger to dynamically trigger toggle/switch
|
||||
}).on('gumby.trigger', function() {
|
||||
scope.trigger(scope.triggered);
|
||||
});
|
||||
};
|
||||
|
||||
// parse data-for attribute, switches will inherit method
|
||||
Toggle.prototype.parseTargets = function() {
|
||||
var targetStr = Gumby.selectAttr.apply(this.$el, ['trigger']),
|
||||
secondaryTargets = 0,
|
||||
targets = [];
|
||||
|
||||
// no targets so return false
|
||||
if(!targetStr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
secondaryTargets = targetStr.indexOf('|');
|
||||
|
||||
// no secondary targets specified so return single target
|
||||
if(secondaryTargets === -1) {
|
||||
return [$(targetStr)];
|
||||
}
|
||||
|
||||
// return array of both targets, split and return 0, 1
|
||||
targets = targetStr.split('|');
|
||||
return targets.length > 1 ? [$(targets[0]), $(targets[1])] : [$(targets[0])];
|
||||
};
|
||||
|
||||
// call triggered event and pass target data
|
||||
Toggle.prototype.triggered = function() {
|
||||
// trigger gumby.onTrigger event and pass array of target status data
|
||||
this.$el.trigger('gumby.onTrigger', [this.$el.hasClass('active')]);
|
||||
};
|
||||
|
||||
// Switch object inherits from Toggle
|
||||
Switch.prototype = new Toggle();
|
||||
|
||||
// Toggle specific trigger method
|
||||
Toggle.prototype.trigger = function(cb) {
|
||||
// no targets just toggle active class on toggle
|
||||
if(!this.targets) {
|
||||
this.$el.toggleClass('active');
|
||||
|
||||
// combine single target with toggle and toggle active class
|
||||
} else if(this.targets.length == 1) {
|
||||
this.$el.add(this.targets[0]).toggleClass('active');
|
||||
|
||||
// if two targets check active state of first
|
||||
// always combine toggle and first target
|
||||
} else if(this.targets.length > 1) {
|
||||
if(this.targets[0].hasClass('active')) {
|
||||
this.$el.add(this.targets[0]).removeClass('active');
|
||||
this.targets[1].addClass('active');
|
||||
} else {
|
||||
this.targets[1].removeClass('active');
|
||||
this.$el.add(this.targets[0]).addClass('active');
|
||||
}
|
||||
}
|
||||
|
||||
// call event handler here, applying scope of object Switch/Toggle
|
||||
if(cb && typeof cb === 'function') {
|
||||
cb.apply(this);
|
||||
}
|
||||
};
|
||||
|
||||
// Switch specific trigger method
|
||||
Switch.prototype.trigger = function(cb) {
|
||||
// no targets just add active class to switch
|
||||
if(!this.targets) {
|
||||
this.$el.addClass('active');
|
||||
|
||||
// combine single target with switch and add active class
|
||||
} else if(this.targets.length == 1) {
|
||||
this.$el.add(this.targets[0]).addClass('active');
|
||||
|
||||
// if two targets check active state of first
|
||||
// always combine switch and first target
|
||||
} else if(this.targets.length > 1) {
|
||||
this.$el.add(this.targets[0]).addClass('active');
|
||||
this.targets[1].removeClass('active');
|
||||
}
|
||||
|
||||
// call event handler here, applying scope of object Switch/Toggle
|
||||
if(cb && typeof cb === 'function') {
|
||||
cb.apply(this);
|
||||
}
|
||||
};
|
||||
|
||||
// add toggle initialisation
|
||||
Gumby.addInitalisation('toggles', function() {
|
||||
$('.toggle').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isToggle')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isToggle', true);
|
||||
new Toggle($this);
|
||||
});
|
||||
});
|
||||
|
||||
// add switches initialisation
|
||||
Gumby.addInitalisation('switches', function() {
|
||||
$('.switch').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isSwitch')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isSwitch', true);
|
||||
new Switch($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'toggleswitch',
|
||||
events: ['trigger', 'onTrigger'],
|
||||
init: function() {
|
||||
// Run initialize methods
|
||||
Gumby.initialize('switches');
|
||||
Gumby.initialize('toggles');
|
||||
}
|
||||
});
|
||||
}();
|
|
@ -1,138 +0,0 @@
|
|||
/**
|
||||
* Gumby jQuery Validation Plugin
|
||||
*/
|
||||
!function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
function Validation($this, req) {
|
||||
|
||||
// input and holder .field
|
||||
this.$this = $this;
|
||||
this.$field = this.$this.parents('.field');
|
||||
|
||||
// supplied validation function with default length check
|
||||
this.req = req || function() {
|
||||
return !!this.$this.val().length;
|
||||
};
|
||||
|
||||
// reference to this class
|
||||
var scope = this;
|
||||
|
||||
// checkboxes and radio buttons use gumby.onChange event to validate
|
||||
if(this.$this.is('[type=checkbox], [type=radio]')) {
|
||||
this.$field = this.$this.parent('label');
|
||||
this.$field.on('gumby.onChange', function() {
|
||||
scope.validate();
|
||||
});
|
||||
|
||||
// selects validate on change
|
||||
} else if(this.$this.is('select')) {
|
||||
this.$field = this.$this.parents('.picker');
|
||||
this.$field.on('change', function() {
|
||||
scope.validate();
|
||||
});
|
||||
|
||||
// others (text input, textarea) use blur
|
||||
} else {
|
||||
this.$this.on('blur', function(e) {
|
||||
// ignore tab
|
||||
if(e.which !== 9) {
|
||||
scope.validate();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// validate field
|
||||
Validation.prototype.validate = function() {
|
||||
|
||||
var result = this.req(this.$this);
|
||||
|
||||
// failed
|
||||
if(!result) {
|
||||
this.$field.removeClass('success').addClass('danger');
|
||||
|
||||
// passed
|
||||
} else {
|
||||
//} else if(this.$field.hasClass('danger')) {
|
||||
this.$field.removeClass('danger').addClass('success');
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
// jQuery plugin definition
|
||||
$.fn.validation = function(options) {
|
||||
|
||||
var // extend params with defaults
|
||||
settings = $.extend({
|
||||
submit : false,
|
||||
fail: false,
|
||||
required : []
|
||||
}, options),
|
||||
// store validation objects
|
||||
validations = [];
|
||||
|
||||
// init each form plugin is called on
|
||||
return this.each(function() {
|
||||
|
||||
// no required fields so plugin is pointless
|
||||
if(!settings.required.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var $this = $(this),
|
||||
reqLength = settings.required.length,
|
||||
i;
|
||||
|
||||
// loop round each required field and instantiate new validation object
|
||||
for(i = 0; i < reqLength; i++) {
|
||||
validations.push(new Validation(
|
||||
$this.find('[name="'+settings.required[i].name+'"]'),
|
||||
settings.required[i].validate || false
|
||||
));
|
||||
}
|
||||
|
||||
// hijack submit event
|
||||
$this.on('submit', function(e) {
|
||||
|
||||
// reference to whole form pass/fail
|
||||
var failed = false;
|
||||
|
||||
// if no passed attribute found we should halt form submit
|
||||
if(!$this.data('passed')) {
|
||||
e.preventDefault();
|
||||
|
||||
// loop round validation objects and validate each
|
||||
var reqLength = validations.length, i;
|
||||
for(i = 0; i < reqLength; i++) {
|
||||
if(!validations[i].validate()) {
|
||||
failed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// passed
|
||||
if(!failed) {
|
||||
// if submit method present call that otherwise submit form
|
||||
if(settings.submit && typeof settings.submit === 'function') {
|
||||
settings.submit($this.serializeArray());
|
||||
return;
|
||||
}
|
||||
|
||||
// store passed bool and re-submit
|
||||
$this.data('passed', true).submit();
|
||||
|
||||
// failed
|
||||
} else {
|
||||
// call fail method if present
|
||||
if(settings.fail && typeof settings.fail === 'function') {
|
||||
settings.fail();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}(jQuery);
|
|
@ -1,25 +0,0 @@
|
|||
// Gumby is ready to go
|
||||
Gumby.ready(function() {
|
||||
console.log('Gumby is ready to go...', Gumby.debug());
|
||||
|
||||
// placeholder polyfil
|
||||
if(Gumby.isOldie || Gumby.$dom.find('html').hasClass('ie9')) {
|
||||
$('input, textarea').placeholder();
|
||||
}
|
||||
});
|
||||
|
||||
// Oldie document loaded
|
||||
Gumby.oldie(function() {
|
||||
console.log("This is an oldie browser...");
|
||||
});
|
||||
|
||||
// Touch devices loaded
|
||||
Gumby.touch(function() {
|
||||
console.log("This is a touch enabled device...");
|
||||
});
|
||||
|
||||
// Document ready
|
||||
$(function() {
|
||||
|
||||
});
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){arguments.callee=arguments.callee.caller;var a=[].slice.call(arguments);(typeof console.log==="object"?log.apply.call(console.log,console,a):console.log.apply(console,a))}};
|
||||
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
|
||||
{console.log();return window.console;}catch(err){return window.console={};}})());
|
||||
|
||||
/*! http://mths.be/placeholder v2.0.7 by @mathias */
|
||||
;(function(f,h,$){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=$.fn,c=$.valHooks,k,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){var l=this;l.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind({'focus.placeholder':b,'blur.placeholder':e}).data('placeholder-enabled',true).trigger('blur.placeholder');return l};j.input=a;j.textarea=d;k={get:function(m){var l=$(m);return l.data('placeholder-enabled')&&l.hasClass('placeholder')?'':m.value},set:function(m,n){var l=$(m);if(!l.data('placeholder-enabled')){return m.value=n}if(n==''){m.value=n;if(m!=h.activeElement){e.call(m)}}else{if(l.hasClass('placeholder')){b.call(m,true,n)||(m.value=n)}else{m.value=n}}return l}};a||(c.input=k);d||(c.textarea=k);$(function(){$(h).delegate('form','submit.placeholder',function(){var l=$('.placeholder',this).each(b);setTimeout(function(){l.each(e)},10)})});$(f).bind('beforeunload.placeholder',function(){$('.placeholder').each(function(){this.value=''})})}function g(m){var l={},n=/^jQuery\d+$/;$.each(m.attributes,function(p,o){if(o.specified&&!n.test(o.name)){l[o.name]=o.value}});return l}function b(m,n){var l=this,o=$(l);if(l.value==o.attr('placeholder')&&o.hasClass('placeholder')){if(o.data('placeholder-password')){o=o.hide().next().show().attr('id',o.removeAttr('id').data('placeholder-id'));if(m===true){return o[0].value=n}o.focus()}else{l.value='';o.removeClass('placeholder');l==h.activeElement&&l.select()}}}function e(){var q,l=this,p=$(l),m=p,o=this.id;if(l.value==''){if(l.type=='password'){if(!p.data('placeholder-textinput')){try{q=p.clone().attr({type:'text'})}catch(n){q=$('<input>').attr($.extend(g(this),{type:'text'}))}q.removeAttr('name').data({'placeholder-password':true,'placeholder-id':o}).bind('focus.placeholder',b);p.data({'placeholder-textinput':q,'placeholder-id':o}).before(q)}p=p.removeAttr('id').hide().prev().attr('id',o).show()}p.addClass('placeholder');p[0].value=p.attr('placeholder')}else{p.removeClass('placeholder')}}}(this,document,jQuery));
|
||||
|
||||
// place any jQuery/helper plugins in here, instead of separate, slower script files.
|
|
@ -55,7 +55,13 @@
|
|||
#:location "Worcester, MA"
|
||||
#:url "http://web.cs.wpi.edu/~kfisler/"
|
||||
(person 'kathi "Kathi Fisler"
|
||||
#:url "http://web.cs.wpi.edu/~kfisler/"))))
|
||||
#:url "http://web.cs.wpi.edu/~kfisler/"))
|
||||
(place ; -------------------------------------------------------------------
|
||||
'indiana "Indiana University"
|
||||
#:location "Bloomington, IN"
|
||||
#:url "http://homes.soic.indiana.edu/samth/"
|
||||
(person 'samth "Sam Tobin-Hochstadt"
|
||||
#:url "http://homes.soic.indiana.edu/samth/"))))
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user