Skip to content

Commit

Permalink
Reorganize *all* assets and rename 'hn' to 'hw'
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Mar 18, 2013
1 parent 8402938 commit 5cc5ed4
Show file tree
Hide file tree
Showing 60 changed files with 47 additions and 66 deletions.
52 changes: 27 additions & 25 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,52 @@ module.exports = function(grunt) {
uglify: {
web: {
options: {
sourceMap: 'js/scripts-web.js.map',
sourceMap: 'js/hw-web.min.js.map',
sourceMappingURL: function(path){
return path.replace(/^js\//i, '') + '.map';
},
sourceMapRoot: '../'
}
},
files: {
'js/scripts-web.js': [
'js/libs/ruto.js',
'js/libs/amplify.store.js',
'js/libs/hogan.js',
'js/libs/hnapi.js',
'js/libs/ibento.js',
'js/libs/classList.js',
'js/templates.js'
'js/hw-web.min.js': [
'assets/js/libs/ruto.js',
'assets/js/libs/amplify.store.js',
'assets/js/libs/hogan.js',
'assets/js/libs/hnapi.js',
'assets/js/libs/ibento.js',
'assets/js/libs/classList.js',
'assets/js/templates.js',
'assets/js/hw.js',
'assets/js/hw-web.js'
]
}
},
ios: {
options: {
sourceMap: 'js/scripts-ios.js.map',
sourceMap: 'js/hw-ios.min.js.map',
sourceMappingURL: function(path){
return path.replace(/^js\//i, '') + '.map';
},
sourceMapRoot: '../'
}
},
files: {
'js/scripts-ios.js': [
'js/libs/ruto.js',
'js/libs/amplify.store.js',
'js/libs/hogan.js',
'js/libs/hnapi.js',
'js/libs/tappable.js',
'js/libs/tween.js',
'js/libs/requestanimationframe.js',
'js/templates.js'
'js/hw-ios.min.js': [
'assets/js/libs/ruto.js',
'assets/js/libs/amplify.store.js',
'assets/js/libs/hogan.js',
'assets/js/libs/hnapi.js',
'assets/js/libs/tappable.js',
'assets/js/libs/tween.js',
'assets/js/libs/requestanimationframe.js',
'assets/js/templates.js',
'assets/js/hw.js',
'assets/js/hw-web.js'
]
}
}
},
jshint: {
all: [
'js/*.js',
'js/libs/*.js'
'assets/js/libs/*.js',
'assets/js/*.js'
]
}
});
Expand Down
8 changes: 4 additions & 4 deletions css/hn-ios.css → assets/css/hw-ios.css
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ ol.grouped-tableview-links li>a.disclosure.tappable-active:after{
}

#y-icon{
background: transparent url(../icons/touch-icon.png) no-repeat;
background: transparent url(../../icons/touch-icon.png) no-repeat;
background-size: 57px 57px;
width: 57px;
height: 57px;
Expand All @@ -946,7 +946,7 @@ ol.grouped-tableview-links li>a.disclosure.tappable-active:after{
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
#y-icon{
background-image: url(../icons/touch-icon-114.png);
background-image: url(../../icons/touch-icon-114.png);
}
}
#app-desc{
Expand Down Expand Up @@ -1552,13 +1552,13 @@ ol.grouped-tableview-links li>a.disclosure.tappable-active:after{
width: 72px;
height: 72px;
background-size: 72px 72px;
background-image: url(../icons/touch-icon-72.png);
background-image: url(../../icons/touch-icon-72.png);
border-radius: 12px;
}
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
#y-icon{
background-image: url(../icons/touch-icon-144.png);
background-image: url(../../icons/touch-icon-144.png);
}
}
#app-desc{
Expand Down
2 changes: 1 addition & 1 deletion css/hn-web.css → assets/css/hw-web.css
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ ol.grouped-tableview-links li>a:hover{
}

#y-icon{
background: transparent url(../icons/favicon-144.png) no-repeat;
background: transparent url(../../icons/favicon-144.png) no-repeat;
background-size: 57px 57px;
width: 57px;
height: 57px;
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added assets/images/ios/button-bar-press-indicator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 4 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,11 @@
var head = d.head || d.getElementsByTagName('head')[0];

// Use document.write to prevent FOUC
d.write('<link rel="stylesheet" href="css/hn-' + theme + '.css">');
d.write('<link rel="stylesheet" href="assets/css/hw-' + theme + '.css">');

var scripts = ['scripts-' + theme, 'hn', 'hn-' + theme];
var i = 0, l = scripts.length;
var injectScript = function(){
if (i == l) return;
var script = d.createElement('script');
script.src = 'js/' + scripts[i++] + '.js';
script.onload = script.onreadystatechange = function(e){
if (!script.readyState || /loaded|complete/.test(script.readyState)){
script.onload = script.onreadystatechange = null;
injectScript();
}
};
setTimeout(function(){
head.insertBefore(script, head.lastChild);
}, 1);
};
injectScript();
var script = d.createElement('script');
script.src = 'js/hw-' + theme + '.min.js';
head.insertBefore(script, head.lastChild);

if (typeof _gaq != 'undefined') setTimeout(function(){
_gaq.push(['_trackEvent', 'App', 'Theme', theme]);
Expand Down
3 changes: 3 additions & 0 deletions js/hw-ios.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/hw-ios.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions js/hw-web.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/hw-web.min.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions js/scripts-ios.js

This file was deleted.

1 change: 0 additions & 1 deletion js/scripts-ios.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions js/scripts-web.js

This file was deleted.

1 change: 0 additions & 1 deletion js/scripts-web.js.map

This file was deleted.

8 changes: 0 additions & 8 deletions js/scripts.js

This file was deleted.

8 changes: 4 additions & 4 deletions make-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
var fs = require('fs');
var hogan = require('hogan.js');

fs.readdir('templates', function(e, files){
fs.readdir('assets/templates', function(e, files){
if (e) throw e;

var code = '(function(t){\n'
+ '\tTEMPLATES={\n';

files.forEach(function(file){
if (/\.mustache$/i.test(file)){
var mustache = fs.readFileSync('templates/' + file, 'ascii');
var mustache = fs.readFileSync('assets/templates/' + file, 'ascii');
var key = file.match(/^([^.]+)\./i)[1];
// Clean up some spaces
mustache = mustache.replace(/[\r\n\t]+/g, '');
Expand All @@ -22,7 +22,7 @@ fs.readdir('templates', function(e, files){
code += '\t}\n'
+ '})(Hogan.Template);';

fs.writeFile('js/templates.js', code, function(){
console.log('js/templates.js created.');
fs.writeFile('assets/js/templates.js', code, function(){
console.log('assets/js/templates.js created.');
});
});

0 comments on commit 5cc5ed4

Please sign in to comment.