This file contains 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
class CustomElement extends HTMLElement { | |
constructor() { | |
super(); | |
} | |
attachedCallback() { | |
this.bindEvents(); | |
} | |
detachedCallback() { |
This file contains 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
foo bar | |
baz | |
qux | |
last line (there may or may not be a trailing newline after this line) |
This file contains 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
// outer IIFE - gives us $ === jQuery!, also, makes every var/function inside "private"! | |
window.MYAPI = (function($) { | |
function processSiteRequest( data ) { | |
var sites = data.response.sites; | |
// loop through each site given back for the paginated result set | |
$.each( sites || [], function(index, site) { | |
debugPrint("Site: " + site.name); |
This file contains 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
$(document).ready(function(){ | |
function stopprop( event ) { event.stopPropagation(); } | |
function starhover( event ) { | |
console.log( event.type ); | |
this.src = ( event.type === "mouseenter" ) ? 'images/stardown.png' : 'images/starup.png'; | |
} | |
$('#leftTab').on({ | |
// When hovered |
This file contains 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
//based on https://gist.github.com/07a297472f182f7a7132/79d3dea1e3dc7ce2d065a42316b83ec820671634 | |
;(function($, undefined) { | |
$.notify = function(options) { | |
if(options.timeOut > 0) | |
{ | |
//add the timer to the message | |
console.log($(options.message).find('.countDown')); | |
if($(options.message).find('.countDown').length > 0){ |
This file contains 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
fetchCurrentPosition() | |
.then(updateLocationDisplay) | |
.pipe(fetchWeatherAtThisLocation) | |
.then(updateWeatherDisplay) | |
.pipe(determineWeatherType) | |
.then(updateRecommendations) | |
.then(updateAppTile); | |
function fetchCurrentPosition() | |
{ |
This file contains 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
$(document).ready(function(){ | |
function rem(e){ | |
alert("asdfasdf"); | |
}; | |
$("#remove").click(rem); | |
}); |