diff --git a/Makefile b/Makefile index 6a2af46..10cd56e 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,8 @@ sinclude GNUmakefile.local DATABASE = metadata.db OBJS = db.o json.o main.o -HTMLS = index.html -JSMINS = index.min.js +HTMLS = index.html book.html +JSMINS = index.min.js book.min.js EXTJS = externals/vue.min.js CSS = externals/bootstrap.min.css FONTS = externals/fonts/* diff --git a/book.html b/book.html new file mode 100644 index 0000000..9dfea22 --- /dev/null +++ b/book.html @@ -0,0 +1,20 @@ + + + + Livre + + + + + + + + + +
+

Livre

+
+ + + + diff --git a/book.js b/book.js new file mode 100644 index 0000000..892abac --- /dev/null +++ b/book.js @@ -0,0 +1,27 @@ +var app = new Vue({ + el: '#app', + data: { + urlParams: {}, + book: {} + }, + methods: { + urlParse: function() { + var match, + pl = /\+/g, // Regex for replacing addition symbol with a space + search = /([^&=]+)=?([^&]*)/g, + decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, + query = window.location.search.substring(1); + while (match = search.exec(query)) + this.urlParams[decode(match[1])] = decode(match[2]); + }, + loadBook: function() { + console.log(this.urlParams.id); + } + }, + created: function() { + this.urlParse(); + }, + mounted: function() { + this.loadBook(); + } +})