From 0c2c4631fe55f092047d282e5d7e6060a6164706 Mon Sep 17 00:00:00 2001 From: Uvis Grinfelds Date: Wed, 5 Nov 2014 11:55:46 +0100 Subject: [PATCH] added grunt-includes, and seprated html files --- Gruntfile.js | 32 +- package.json | 2 + transfersh-server/static/404.html | 2 +- transfersh-server/static/download.html | 129 +- transfersh-server/static/download.image.html | 2 +- transfersh-server/static/download.md.html | 121 ++ transfersh-server/static/includes/footer.html | 7 + transfersh-server/static/includes/head.html | 12 + transfersh-server/static/includes/js.html | 2 + transfersh-server/static/index.html | 95 +- transfersh-server/static/scripts/main.js | 6 +- transfersh-server/static/styles/main.css | 2 +- transfersh-web/download.html | 122 +- transfersh-web/includes/footer.html | 47 + transfersh-web/includes/head.html | 14 + transfersh-web/includes/js.html | 8 + transfersh-web/includes/navigation.html | 15 + transfersh-web/index.html | 82 +- transfersh-web/scripts/typewriter-bundle.js | 1490 +++++++++++++++++ 19 files changed, 1964 insertions(+), 226 deletions(-) create mode 100644 transfersh-server/static/download.md.html create mode 100644 transfersh-server/static/includes/footer.html create mode 100644 transfersh-server/static/includes/head.html create mode 100644 transfersh-server/static/includes/js.html create mode 100644 transfersh-web/includes/footer.html create mode 100644 transfersh-web/includes/head.html create mode 100644 transfersh-web/includes/js.html create mode 100644 transfersh-web/includes/navigation.html create mode 100644 transfersh-web/scripts/typewriter-bundle.js diff --git a/Gruntfile.js b/Gruntfile.js index 944237e..dca2f64 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,6 +28,10 @@ module.exports = function (grunt) { gruntfile: { files: ['Gruntfile.js'] }, + includes: { + files: ['<%= yeoman.app %>/*.html', '.tmp/*.html'], + tasks: ['includes:server'] + }, livereload: { options: { livereload: '<%= connect.options.livereload %>' @@ -37,7 +41,8 @@ module.exports = function (grunt) { '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css', '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js', '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' - ] + ], + tasks: ['includes:server'] } }, connect: { @@ -112,6 +117,27 @@ module.exports = function (grunt) { } } }, + + includes: { + build: { + cwd: '<%= yeoman.app %>', + src: ['*.html', 'includes/*.html'], + dest: '<%= yeoman.dist %>', + options: { + flatten: true, + banner: '' + } + }, + server: { + cwd: '<%= yeoman.app %>', + src: ['*.html', 'includes/*.html'], + dest: '.tmp/', + options: { + flatten: true, + banner: '' + } + } + }, // not used since Uglify task does concat, // but still available if needed /*concat: { @@ -240,6 +266,7 @@ module.exports = function (grunt) { grunt.task.run([ 'clean:server', 'less', + 'includes:server', 'copy:server', 'connect:livereload', 'watch' @@ -263,6 +290,7 @@ module.exports = function (grunt) { 'copy:server', 'useminPrepare', 'concurrent', + 'includes:build', 'cssmin', 'concat', 'uglify', @@ -275,4 +303,4 @@ module.exports = function (grunt) { 'test', 'build' ]); -}; +}; \ No newline at end of file diff --git a/package.json b/package.json index ea7bf74..860d013 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ "grunt-contrib-less": "~0.11.4", "grunt-contrib-uglify": "~0.6.0", "grunt-contrib-watch": "~0.6.1", + "grunt-include-replace": "^2.0.0", + "grunt-includes": "^0.4.5", "grunt-rev": "~0.1.0", "grunt-svgmin": "1.0.0", "grunt-usemin": "~2.4.0", diff --git a/transfersh-server/static/404.html b/transfersh-server/static/404.html index 73397ed..0446544 100644 --- a/transfersh-server/static/404.html +++ b/transfersh-server/static/404.html @@ -154,4 +154,4 @@ - \ No newline at end of file + diff --git a/transfersh-server/static/download.html b/transfersh-server/static/download.html index 23211d8..8f24990 100644 --- a/transfersh-server/static/download.html +++ b/transfersh-server/static/download.html @@ -1,7 +1,124 @@ - + + + + + + + -{{.ContentType}} -{{.ContentLength}} -{{.Filename}} -Download - \ No newline at end of file + + + + transfer.sh - Easy and fast file sharing from the command-line. + + + + + + + + + + + + + + + + +
+
+

+ {{.Filename}}

+ +
+
+
+ +
+
+
+
+
+
+ + + +
+
+ + + + + + + + + + + + + + diff --git a/transfersh-server/static/download.image.html b/transfersh-server/static/download.image.html index 23211d8..9c6389f 100644 --- a/transfersh-server/static/download.image.html +++ b/transfersh-server/static/download.image.html @@ -4,4 +4,4 @@ {{.ContentLength}} {{.Filename}} Download - \ No newline at end of file + diff --git a/transfersh-server/static/download.md.html b/transfersh-server/static/download.md.html new file mode 100644 index 0000000..8f7231c --- /dev/null +++ b/transfersh-server/static/download.md.html @@ -0,0 +1,121 @@ + + + + + + + + + + + + {{.Filename}} - transfer.sh + + + + + + + + + + + + + + + + +
+
+

+ {{.Filename}}

+ +
+
+
+ +
+
+
+
+ + + +
+
+ + + + + + + + + + + + + + + diff --git a/transfersh-server/static/includes/footer.html b/transfersh-server/static/includes/footer.html new file mode 100644 index 0000000..cee2364 --- /dev/null +++ b/transfersh-server/static/includes/footer.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/transfersh-server/static/includes/head.html b/transfersh-server/static/includes/head.html new file mode 100644 index 0000000..cb86962 --- /dev/null +++ b/transfersh-server/static/includes/head.html @@ -0,0 +1,12 @@ + + + + transfer.sh - Easy and fast file sharing from the command-line. + + + + + + + + \ No newline at end of file diff --git a/transfersh-server/static/includes/js.html b/transfersh-server/static/includes/js.html new file mode 100644 index 0000000..2e4f11f --- /dev/null +++ b/transfersh-server/static/includes/js.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/transfersh-server/static/index.html b/transfersh-server/static/index.html index 15014de..e4d5ed5 100644 --- a/transfersh-server/static/index.html +++ b/transfersh-server/static/index.html @@ -11,18 +11,17 @@ transfer.sh - Easy and fast file sharing from the command-line. - + - - - - + + - + + - + + + + - \ No newline at end of file + diff --git a/transfersh-server/static/scripts/main.js b/transfersh-server/static/scripts/main.js index 837eb42..ef6e2fe 100644 --- a/transfersh-server/static/scripts/main.js +++ b/transfersh-server/static/scripts/main.js @@ -1,5 +1,5 @@ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=a.length,c=_.type(a);return"function"===c||_.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(hb.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=ob[a]={};return _.each(a.match(nb)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+Math.random()}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ub,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:tb.test(c)?_.parseJSON(c):c}catch(e){}sb.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Kb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)rb.set(a[c],"globalEval",!b||rb.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(rb.hasData(a)&&(f=rb.access(a),g=rb.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sb.hasData(a)&&(h=sb.access(a),i=_.extend({},h),sb.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&yb.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Ob[a];return c||(c=t(a,b),"none"!==c&&c||(Nb=(Nb||_("