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
var touchstartX = 0; | |
var touchstartY = 0; | |
var touchendX = 0; | |
var touchendY = 0; | |
var gesuredZone = document.getElementById('gesuredZone'); | |
gesuredZone.addEventListener('touchstart', function(event) { | |
touchstartX = event.screenX; | |
touchstartY = event.screenY; |
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
/* | |
* Trying to feature-detect (very naive) | |
* CSS Flexbox support. | |
* - Only most modern syntax | |
* | |
* Is this nonsense? | |
*/ | |
(function NaiveFlexBoxSupport(d){ | |
var f = "flex", e = d.createElement('b'); |
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
{ | |
"name": "englishextra", | |
"short_name": "englishextra", | |
"manifest_version": 2, | |
"icons": [{ | |
"src": "/favicon-16x16.png", | |
"sizes": "16x16", | |
"type": "image/png" | |
}, | |
{ |
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
/* This is a small sampling of the various approaches to media queries. The | |
point is: they're all over the board. Part of the "issue" (if you can call | |
it that) may be due to the intended audience of each site/framework. Another | |
may be that it's really difficult to test for a lot of different devices. | |
Regardless, it would be really nice if there was standard baseline that | |
could be used as a starting point for maximum compatibility and coverage. */ | |
/* ========================================================================== | |
Frameworks | |
========================================================================== */ |
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
<!DOCTYPE html> | |
<!-- Edit this and the preview will update automatically. --> | |
<svg xmlns='http://www.w3.org/2000/svg' width='6' height='6'> | |
<rect width='6' height='6' fill='transparent'/> | |
<rect width='2' height='2' fill='#474747'/> | |
</svg> | |
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
<h1>Isotope - packery gutter</h1> | |
<div class="grid"> | |
<div class="grid-item grid-item--width2"></div> | |
<div class="grid-item grid-item--height2"></div> | |
<div class="grid-item"></div> | |
<div class="grid-item"></div> | |
<div class="grid-item grid-item--width2 grid-item--height2"></div> | |
<div class="grid-item grid-item--width2"></div> | |
<div class="grid-item grid-item--width2"></div> |
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
/** | |
* Loads javascript file by url and saves reference to it by name, so it's not loaded again | |
* @param {string} name Name of js library | |
* @param {string} url Url to js library | |
* @return {promise} Resolves when library is loaded | |
* | |
* Based on example by Brad Berger: https://bradb.net/blog/promise-based-js-script-loader/ | |
* Extended w/ global variable to keep track of previously loaded scripts. | |
* Removed support for loading several independent scripts at once via Promise.all() | |
* |
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
function test_jQuery() { jQuery(""); } | |
function success_jQuery() { alert("jQuery is loaded!"); | |
var successfully_loaded = false; | |
function loadOrFallback(scripts,idx) { | |
function testAndFallback() { | |
clearTimeout(fallback_timeout); | |
if (successfully_loaded) return; // already loaded successfully, so just bail | |
try { | |
scripts[idx].test(); |
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
/** | |
* Return a timestamp with the format "m/d/yy h:MM:ss TT" | |
* @type {Date} | |
*/ | |
function timeStamp() { | |
// Create a date object with the current time | |
var now = new Date(); | |
// Create an array with the current month, day and time |
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
module.exports = function (grunt) { | |
grunt.initConfig({ | |
jshint: { | |
all: ['Gruntfile.js', 'diy/libs/spa-englishextra/js/test.js'] | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.registerTask('default', 'jshint'); | |
}; |