-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from superKalo/config/es5-transpiler
[WIP] Config / ES5 Compiler and Browser Support Matix
- Loading branch information
Showing
7 changed files
with
717 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Created by https://www.gitignore.io/api/sublimetext | ||
|
||
### SublimeText ### | ||
# cache files for sublime text | ||
*.tmlanguage.cache | ||
*.tmPreferences.cache | ||
*.stTheme.cache | ||
|
||
# workspace files are user-specific | ||
*.sublime-workspace | ||
|
||
# project files should be checked into the repository, unless a significant | ||
# proportion of contributors will probably not be using SublimeText | ||
# *.sublime-project | ||
|
||
# sftp configuration file | ||
sftp-config.json | ||
|
||
# Package control specific files | ||
Package Control.last-run | ||
Package Control.ca-list | ||
Package Control.ca-bundle | ||
Package Control.system-ca-bundle | ||
Package Control.cache/ | ||
Package Control.ca-certs/ | ||
Package Control.merged-ca-bundle | ||
Package Control.user-ca-bundle | ||
oscrypto-ca-bundle.crt | ||
bh_unicode_properties.cache | ||
|
||
# Sublime-github package stores a github token in this file | ||
# https://packagecontrol.io/packages/sublime-github | ||
GitHub.sublime-settings | ||
|
||
# End of https://www.gitignore.io/api/sublimetext | ||
|
||
|
||
# Project-specific | ||
src/ | ||
bower.json | ||
examples/ |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>SuperRepo IE11 Example Usage</title> | ||
</head> | ||
|
||
<body> | ||
|
||
<p>Open the source code and check it out.</p> | ||
|
||
<button id="get" type="button">Get data</button> | ||
|
||
<button id="invalidate" type="button">Invalidate data</button> | ||
<button id="clear" type="button">Clear (delete) data</button> | ||
|
||
<button id="sync" type="button">Init Syncer</button> | ||
<button id="stopsync" type="button">Stop Syncer</button> | ||
|
||
<!-- Uncomment for the jQuery $.ajax() example --> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script> | ||
|
||
<!-- Link to the SuperRepo library --> | ||
<script src="../lib/index.js"></script> | ||
|
||
|
||
<script> | ||
|
||
/** | ||
* Define a function responsible for getting data from the server. | ||
* It doesn't matter how, as long as your function returns a Promise. | ||
*/ | ||
var requestWeatherData = function() { return $.ajax({url:'weather.json'}) }; | ||
|
||
var WeatherRepository = new SuperRepo({ | ||
storage: 'LOCAL_STORAGE', // 'LOCAL_STORAGE', 'BROWSER_STORAGE' or 'LOCAL_VARIABLE' | ||
name: 'weather', | ||
request: requestWeatherData, | ||
|
||
// Optional | ||
outOfDateAfter: 30 * 1000, // 30 sec | ||
|
||
// Optional, but recommended | ||
dataModel: { | ||
temperature: 't', | ||
windspeed: 'w', | ||
pressure: 'p' | ||
}, | ||
|
||
// Optional | ||
mapData: function(data) { | ||
// Convert to Fahrenheit | ||
var temperature = (data.temperature * 1.8) + 32; | ||
|
||
// These two sways the same | ||
var windspeed = data.windspeed; | ||
var pressure = data.pressure; | ||
|
||
return { | ||
temperature: temperature, | ||
windspeed: windspeed, | ||
pressure: pressure | ||
}; | ||
} | ||
}); | ||
|
||
|
||
document.getElementById('get').addEventListener('click', function() { | ||
WeatherRepository.getData().then( | ||
function(_r) { console.log('It is ' + _r.temperature + ' degrees Fahrenheit.') } | ||
); | ||
}); | ||
|
||
document.getElementById('invalidate').addEventListener('click', function() { | ||
WeatherRepository.invalidateData().then( function(_response) { | ||
console.log('Previous data', _response.prevData); | ||
console.log('Next data', _response.nextData); | ||
}); | ||
}); | ||
document.getElementById('clear').addEventListener('click', function() { | ||
WeatherRepository.clearData().then( function(_prevData) { | ||
console.log('Previous (just deleted data) data', _prevData); | ||
}); | ||
}); | ||
|
||
document.getElementById('sync').addEventListener('click', function() { | ||
WeatherRepository.initSyncer(); | ||
}); | ||
document.getElementById('stopsync').addEventListener('click', function() { | ||
WeatherRepository.destroySyncer(); | ||
}); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
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
Oops, something went wrong.