#A simple Slideshow module wrapped in a Backbone View
- Dependencies ** underscore.js ** backbone.js
Viewable in action in this jsfiddle
# | |
# Replaces Backbone.History with support for HTML5 history API if browser supports it. | |
# To use, setup your controllers as usual and try it with a browser that supports the HTML5 history API. | |
# For browsers that don't support the HTML5 API, this will fall back to using the default Backbone hash routing. | |
# | |
# I have only tested this on my project in Firefox, Safari and Chrome so let me know. | |
# | |
pushSupport = window.history? and window.history.pushState? | |
if pushSupport and Backbone? and Backbone.History? | |
rootUrl = document.location.protocol+'//'+(document.location.host or document.location.hostname) |
// browser history with HTML5 support | |
(function() { | |
var loc = window.location, | |
pushSupport = !!(window.history && window.history.pushState), | |
hashStrip = /^#*/; | |
// add HTML5 support to Backbone.history, drop the old IE stuff | |
_.extend(Backbone.History.prototype, { | |
getFragment : function(l) { |
#A simple Slideshow module wrapped in a Backbone View
Viewable in action in this jsfiddle
/** | |
* localStorage with expire wrapper | |
*/ | |
var myStorage = (function() { | |
var self = {}; | |
/** | |
* Method unsets value in localStorage | |
*/ | |
self.unset = function(key) { |
/*jshint browser:true */ | |
/*global jQuery */ | |
/* | |
jquery.scrollpane-startstop.js | |
Custom start and stop scrolling events for jScrollPane | |
https://gist.github.com/1963544 | |
Usage: |
define([ | |
'marionette', | |
'handlebars', | |
'modules/accountsData/views/pie', | |
'modules/accountsData/views/table', | |
'text!modules/accountsData/templates/wrapper.html', | |
], | |
function(Marionette, Handlebars, pie, table, tmpl) { |
app.filter('daterange', function() { | |
return function(items, startDate, endDate) { | |
var filteredResult = []; | |
// Parse from the filter format 'dd/mm/yyyy' (Turkish culture) | |
function parseDateFromFilter(strDate) { | |
var parts = strDate.split('/'); | |
return new Date(parts[2], parts[1] - 1, parts[0]); | |
} |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('/service-worker.js'); | |
} | |
const CACHE_PREFIX = 'Client'; | |
const CACHE_VERSION = 'v1'; | |
const CACHE_NAME = `${ CACHE_PREFIX }-${ CACHE_VERSION }`; | |
const CACHE_URLS = [ | |
'/dist/offline.html', | |
'/dist/vendors.js', |