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
| The JSON: | |
| {"markers": [ | |
| {"title":"Varisia", "lat":74.37118, "lng":-49.61677, "type":"region", "info":"Varisia (region): Bibbity <strong>Boo!</strong>"} | |
| ] | |
| } | |
| function loadMarkers(url) { | |
| $.getJSON(url, function(data) { | |
| $.each(data, function(index, entry) { | |
| console.log(index); |
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
| // Create our test array. | |
| var arr = [ "one", "one", "one" ] | |
| var foo = function(){ | |
| var curr = 0 | |
| , bar = function(){ | |
| console.log(arr[curr]) | |
| curr += 1 | |
| if ( curr < arr.length ) setTimeout(bar, 3000) | |
| } |
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
| function Obiekt(z,y,t) { | |
| this.start = setInterval(this.ruch.bind(this), 5000) | |
| this.ruch = function() { | |
| ..... |
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.addEventListener("load", function(){ | |
| var player = {}; | |
| var america = {}; | |
| player.hp = 100; | |
| player.money = 50000; | |
| player.inventorySpace = 100; | |
| player.location = america; | |
| player.inventory = {weed:0, cocaine:0, pharms:0, lsd:0, mushrooms:0, meth:0, peyote:0, nitrous:0, heroin:0, growSupplies:0, chemSupplies:0, fuel:0, medpack:0, explosives:0}; | |
| player.cellPhone = 0; | |
| player.IDs = {}; |
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
| function Agent() {} | |
| Agent.prototype.configuration = function() { | |
| // something | |
| }; | |
| Agent.prototype.alarms = function() { | |
| // something | |
| }; |
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
| void function(root){ | |
| function georender(can, obj){ | |
| renderFunctions[obj.type](can,obj); | |
| } | |
| var renderFunctions = georender.fn = { | |
| // handle actual rendering here | |
| point: function(can, obj){}, |
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
| function generateBlob(keyName, encodedData) { | |
| //Append the file format prefix: | |
| var saveString = "EMULATOR_DATA"; | |
| var consoleID = "GameBoy"; | |
| //Figure out the length: | |
| var totalLength = (saveString.length + 4 + (1 + consoleID.length)) + ((1 + keyName.length) + (4 + encodedData.length)); | |
| //Append the total length in bytes: | |
| saveString += to_little_endian_dword(totalLength); | |
| //Append the console ID text's length: | |
| saveString += to_byte(consoleID.length); |
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
| function selectStoreValues(fromElementID,toElementID) | |
| { | |
| var fileToTableObj = document.getElementById('ImportexportFilesSelected'); | |
| var fileToTable = fileToTableObj.options[fileToTableObj.selectedIndex].value; | |
| var txtSelectedValuesObj = document.getElementById(toElementID); | |
| var selectedArray = new Array(); | |
| var selObj = document.getElementById(fromElementID); | |
| var i; | |
| var count = 0; | |
| for (i=0; i<selObj.options.length; 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
| void function(){ | |
| var InstM=jQuery('#InstitutionalM'); | |
| var SolutM=jQuery('#SolutionsM'); | |
| var DevM=jQuery('#DevelopersM'); | |
| InstM.subname=jQuery('#InstitutionalSM'); | |
| SolutM.subname=jQuery('#SolutionsSM'); | |
| DevM.subname=jQuery('#DevelopersSM'); | |
| var AllSubMenu=jQuery('#InstitutionalM,#SolutionsM,#DevelopersM'); |
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
| What I want: Load a number of images and fire a callback once all are loaded. The image objects of all images need to be available, this is *not* just for caching. | |
| Example use: | |
| var loader = new ImageLoader(); | |
| var img1 = loader.addImage('someurl'); | |
| var img2 = loader.addImage('anotherurl'); | |
| loader.beginLoading(function() { | |
| /* do something with the loaded images img1 and img2, which are Image objects | |
| }); |