From 7fe358bfb11f1cba4ee9237c4ef4b7efc3cfba87 Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 16 Apr 2009 12:14:45 +0200 Subject: added autosave to node edit view. saves every 15 seconds --- public/images/ajax-loader.gif | Bin 0 -> 1737 bytes public/javascripts/admin_interface.js | 14 +++++++++++++- public/stylesheets/admin.css | 28 ++++++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 public/images/ajax-loader.gif (limited to 'public') diff --git a/public/images/ajax-loader.gif b/public/images/ajax-loader.gif new file mode 100644 index 0000000..148005d Binary files /dev/null and b/public/images/ajax-loader.gif differ diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index 5b51dfc..12a3ba6 100644 --- a/public/javascripts/admin_interface.js +++ b/public/javascripts/admin_interface.js @@ -1,5 +1,5 @@ $(document).ready(function () { - $("#metadata").attr("style", "display: none;") + $("#metadata").attr("style", "display: none;"); $("#button").click(function () { $("#metadata").slideToggle("slow"); @@ -11,4 +11,16 @@ $(document).ready(function () { $("#button").attr("class", "unselected"); } }); + + jQuery.ajaxSetup({ + 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} + }) + + jQuery.fn.submitWithAjax = function() { + $("#flash").append(""); + $.post(this.attr("action"), $(this).serialize(), null, "script"); + }; + + + }); \ No newline at end of file diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index c3030d6..0495f65 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -23,6 +23,25 @@ th { width: 899px; } +#flash { + height: 12px; + line-height: 20px; + margin-top: 40px; + margin-bottom: 20px; + margin-left: 5px; +} + +#flash span { + letter-spacing: 1px; + margin-right: 10px; +} + + +#flash img { + height: 12px; + width: 12px; +} + /* Pagination */ div.pagination { @@ -41,7 +60,7 @@ div.pagination span.current, div.pagination a:hover { } #navigation { - margin-left: -5px; + margin-left: 0px; float: left; } @@ -104,6 +123,11 @@ table#node_table td { padding-left: 0px; } +table#node_table .node_id { + padding-left: 10px; + padding-right: 15px; +} + table#node_table tr.header:hover { background-color: #ffffff; } @@ -218,6 +242,6 @@ td.description { } div#page_editor { - margin-top: 40px; + margin-top: 0px; margin-left: 15px; } \ No newline at end of file -- cgit v1.3