This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| i = 0; | |
| $("#table tbody tr:first").each(function() { | |
| // store the clone in a variable | |
| var myclone = $(this).clone().attr('id', function(_, id) {return id + i++}); | |
| myclone.find("#cname").text(cname); | |
| myclone.find("#cStart").text(cfrom); | |
| myclone.find("#cEnd").text(cto); | |
| // add the cloned table rows | |
| myclone.prependTo("#table"); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.log = function(){ | |
| log.history = log.history || []; // store logs to an array for reference | |
| log.history.push(arguments); | |
| if(this.console){ | |
| console.log( Array.prototype.slice.call(arguments) ); | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| offset = new Date().getTimezoneOffset() / 60; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var lookup = []; | |
| var i = 0; | |
| for (var name in obj) { | |
| if (obj.hasOwnProperty(name)) { | |
| lookup[i] = obj[name]; | |
| i++; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.expr[":"].econtains = function(obj, index, meta, stack){ | |
| return (obj.textContent || obj.innerText || $(obj).text() || "").toLowerCase() == meta[3].toLowerCase(); | |
| } | |
| $("#select option:econtains(" + thisText + ")").prop("selected", true); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mapOptions = { | |
| zoom: 8, | |
| center: new google.maps.LatLng(43, -85), | |
| mapTypeId: google.maps.MapTypeId.ROADMAP | |
| }; | |
| var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions); | |
| var geocoder = new google.maps.Geocoder(); | |
| $("#search_address").focus().autocomplete({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("form").submit(function(event) { | |
| event.preventDefault(); | |
| console.log(JSON.stringify($("form").serializeObject())); | |
| }); | |
| }); | |
| $.fn.serializeObject = function() | |
| { | |
| var o = {}; | |
| var a = this.serializeArray(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var numLow = 1; | |
| var numHigh = 9999; | |
| var adjustedHigh = (parseFloat(numHigh) - parseFloat(numLow)) + 1; | |
| var numRand = Math.floor(Math.random()*adjustedHigh) + parseFloat(numLow); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| startsWithP = val.indexOf("P") !== -1 |