latest is a small bash script that fetches the latest version of a JavaScript library from the net and stores it in a local file.
Copy latest to a directory in your path, e.g. /usr/local/bin or ~/bin.
| (function($) { | |
| // Used by dateinput | |
| $.expr = {':': {}}; | |
| // Used by bootstrap | |
| $.support = {}; | |
| // Used by dateinput | |
| $.fn.clone = function(){ | |
| var ret = $(); |
| (function () { | |
| // Mock necessary parts of zepto for fx module | |
| window.Zepto = function () { return $(arguments) } | |
| window.Zepto.isObject = function () { return false } | |
| window.Zepto.each = $.each | |
| window.Zepto.extend = $.extend | |
| window.Zepto.fn = {} | |
| /* |
| <?php | |
| $deviceClass = ""; | |
| $graduateLevelClass = ""; | |
| if (ereg('iPhone',$_SERVER['HTTP_USER_AGENT']) || ereg('iPod',$_SERVER['HTTP_USER_AGENT'])) { | |
| $deviceClass = "ui-iphone"; | |
| } else if (ereg('iPad',$_SERVER['HTTP_USER_AGENT'])) { | |
| $deviceClass = "ui-ipad"; | |
| } else if (ereg('Android',$_SERVER['HTTP_USER_AGENT']) && ereg('Mobile Safari',$_SERVER['HTTP_USER_AGENT'])) { | |
| $deviceClass = "ui-android"; | |
| }; |
| // From Lindsey Simon | |
| /** | |
| * This is a hack to make text input focus work in Android/PhoneGap | |
| * where calling el.focus() doesn't actually have the blinking cursor | |
| * effect = scumbag. | |
| * @param {Zepto} $el A zepto element. | |
| */ | |
| ws.focus = function($el) { | |
| var el = $el.get(0); | |
| el.focus(); |
| (function($){ | |
| $.fn.highest = function() { | |
| var height, highest = 0; | |
| this.each(function() { | |
| height = $(this).height(); | |
| if (height > highest) highest = height; | |
| }); | |
| return highest; | |
| }; | |
| })(window.Zepto || window.jQuery); |
| // Fix to make zepto work with ujs-jquery | |
| $.fn.ajaxSend = function(callback) { | |
| return this.each(function(){ | |
| $(this).on('ajaxBeforeSend', callback); | |
| }); | |
| }; | |
| var jQuery = $; |
| var mapLink = "http://maps.google.com/maps?z=12&t=m&q=loc:" + lat + "+" + lon | |
| if ($.os.ios && navigator.userAgent.match(/iPhone OS 6_/)) mapLink = "Maps://?q=" + lat + "," + lon | |
| if ($.os.android) mapLink = "geo:" + lat + "," + lon + "?z=12&q=" + lat + "," + lon | |
| // assumes you have zepto and zepto.detect loaded | |
| // also you should use target=_blank on your <a> tags |
| // Adds a matchHeight method to jQuery/zepto. | |
| // Takes a jquery/zepto collection and makes them all as tall as the tallest elements | |
| // Ideal for equal column layouts | |
| // ## Paramaters | |
| // * None (run on a zepto collection instead) | |
| // ## Returns | |
| // The collection which it was run on | |
| // ## Example | |
| // $('#myDiv1, #myDiv2').matchHeight(); | |
| // #test |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"/> | |
| <title>title</title> | |
| <script src="https://raw.github.com/madrobby/zepto/v0.7/src/zepto.js"></script> | |
| <script> | |
| $(document).ready(function(){ | |
| console.log('READY IN THE HEAD', document.readyState); | |
| }); |