diff --git a/fonts/glyphicons-halflings-regular.eot b/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..423bd5d Binary files /dev/null and b/fonts/glyphicons-halflings-regular.eot differ diff --git a/fonts/glyphicons-halflings-regular.svg b/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..4469488 --- /dev/null +++ b/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/glyphicons-halflings-regular.ttf b/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..a498ef4 Binary files /dev/null and b/fonts/glyphicons-halflings-regular.ttf differ diff --git a/fonts/glyphicons-halflings-regular.woff b/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..d83c539 Binary files /dev/null and b/fonts/glyphicons-halflings-regular.woff differ diff --git a/index.html b/index.html index 4877aa4..e3a325c 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,9 @@ TEST JSON Server + + + @@ -19,10 +22,12 @@
-

${subject}

+

${subject}

+
${date}
+
- + HTML5/CSS3 jQuery CakePHP diff --git a/javascript/main.js b/javascript/main.js index 45c483e..7dced9e 100644 --- a/javascript/main.js +++ b/javascript/main.js @@ -1,14 +1,30 @@ -(function($){ +(function($) { $.ajax({ - dataType: 'json', - header: {'Content-Type': 'application/json'}, - crossDomain: true, - url: 'http://booklog.io/1/post', - success: function(response){ - $('#postTemplate') - .tmpl(response.posts) - .appendTo('#content'); + dataType: 'json', + url: 'http://booklog.io/1/post', + success: function(response, jqXHR, textStatus) { + $('#postTemplate') + .tmpl(response.posts) + .appendTo('#content'); + }, + complete: function(jqXHR, textStatus) { + $('[id=subject]').each(function(index) { + var me = $(this); + + me.on('click', function() { + var id = me.data('id'); + + $.ajax({ + dataType: 'json', + url: 'http://booklog.io/1/post/' + id, + success: function(response, jqXHR, textStatus) { + $('#content').html('

' + + response.post.content + + '

'); + }, + }); + }); + }); } }); - - }) ($); \ No newline at end of file +}) ($); \ No newline at end of file diff --git a/javascript/mainbad.cs b/javascript/mainbad.cs new file mode 100644 index 0000000..7dced9e --- /dev/null +++ b/javascript/mainbad.cs @@ -0,0 +1,30 @@ +(function($) { + $.ajax({ + dataType: 'json', + url: 'http://booklog.io/1/post', + success: function(response, jqXHR, textStatus) { + $('#postTemplate') + .tmpl(response.posts) + .appendTo('#content'); + }, + complete: function(jqXHR, textStatus) { + $('[id=subject]').each(function(index) { + var me = $(this); + + me.on('click', function() { + var id = me.data('id'); + + $.ajax({ + dataType: 'json', + url: 'http://booklog.io/1/post/' + id, + success: function(response, jqXHR, textStatus) { + $('#content').html('

' + + response.post.content + + '

'); + }, + }); + }); + }); + } + }); +}) ($); \ No newline at end of file diff --git a/stylesheets/4-col-portfolio.css b/stylesheets/4-col-portfolio.css new file mode 100644 index 0000000..c07a750 --- /dev/null +++ b/stylesheets/4-col-portfolio.css @@ -0,0 +1,11 @@ +body { + margin-top: 50px; /* 50px is the height of the navbar - change this if the navbarn height changes */ +} + +.portfolio-item { + margin-bottom: 25px; +} + +footer { + margin: 50px 0; +}