changeset 90:e4eba42e1678

Moved "Home" link to navigation section on top. Added "JSON" link to history page.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 07 Apr 2013 13:31:20 -0700
parents b03f083c3a29
children 315c32a4ce58
files static/js/wikked/models.js static/tpl/nav.html
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/static/js/wikked/models.js	Sat Apr 06 18:07:31 2013 -0700
+++ b/static/js/wikked/models.js	Sun Apr 07 13:31:20 2013 -0700
@@ -81,7 +81,6 @@
         defaults: function() {
             return {
                 url_extras: [
-                    { name: 'Home', url: '/#/' },
                     { name: 'Special Pages', url: '/#/special' }
                 ]
             };
@@ -271,6 +270,11 @@
     var PageHistoryModel = exports.PageHistoryModel = MasterPageModel.extend({
         urlRoot: '/api/history/',
         action: 'history',
+        initialize: function() {
+            PageHistoryModel.__super__.initialize.apply(this, arguments);
+            var model = this;
+            this.footer.addExtraUrl('JSON', function() { return '/api/history/' + model.id; });
+        },
         doDiff: function(form) {
             var rev1 = $('input[name=rev1]:checked', form).val();
             var rev2 = $('input[name=rev2]:checked', form).val();
--- a/static/tpl/nav.html	Sat Apr 06 18:07:31 2013 -0700
+++ b/static/tpl/nav.html	Sun Apr 07 13:31:20 2013 -0700
@@ -1,4 +1,5 @@
 <section>
+    <a href="/">Home</a>
     {{#ifneq action to='read'}}<a href="{{url_read}}">Read</a>{{/ifneq}}
     {{#ifneq action to='edit'}}<a href="{{url_edit}}">Edit</a>{{/ifneq}}
     {{#ifneq action to='history'}}<a href="{{url_hist}}">History</a>{{/ifneq}}