Permalink
Browse files

Merge branch 'hotfix/cache'

  • Loading branch information...
2 parents 6681644 + 5ce0a3d commit 0fc7ba856ab44df09852a7df9a322faf112662ba @szabgab committed Sep 14, 2011
Showing with 21 additions and 13 deletions.
  1. +3 −0 Changes
  2. +1 −1 lib/Dwimmer.pm
  3. +1 −1 lib/Dwimmer/Admin.pm
  4. +1 −1 lib/Dwimmer/Client.pm
  5. +1 −1 lib/Dwimmer/Tools.pm
  6. +14 −9 public/javascripts/dwimmer.js
View
@@ -1,3 +1,6 @@
+
+ Eliminate cache from the Ajax get requests as IE (both 8 and 9) would cache by default.
+
v0.11 2011.09.10
Release of the first interesting version.
View
@@ -3,7 +3,7 @@ use Dancer ':syntax';
use 5.008005;
-our $VERSION = '0.11';
+our $VERSION = '0.1101';
use Dwimmer::DB;
use Dwimmer::Tools qw(_get_db _get_site);
View
@@ -3,7 +3,7 @@ use Dancer ':syntax';
use 5.008005;
-our $VERSION = '0.11';
+our $VERSION = '0.1101';
use Data::Dumper qw(Dumper);
use Email::Valid ();
View
@@ -8,7 +8,7 @@ has host => (is => 'ro', isa => 'Str', required => 1);
has mech => (is => 'rw', isa => 'WWW::Mechanize', default => sub { WWW::Mechanize->new } );
-our $VERSION = '0.11';
+our $VERSION = '0.1101';
sub login {
my ($self, $username, $password) = @_;
View
@@ -9,7 +9,7 @@ use YAML;
use Dwimmer::DB;
-our $VERSION = '0.11';
+our $VERSION = '0.1101';
our @EXPORT_OK = qw(sha1_base64 _get_db _get_site save_page create_site);
@@ -2,6 +2,12 @@ var username;
var userid;
var original_content; // to make editor cancellation quick
+function _url(url) {
+ url = url + '?cache=' + new Date().getTime();
+ //alert(url);
+ return url;
+}
+
$(document).ready(function() {
$('#content').show();
$('#logged_in_bar').hide();
@@ -10,7 +16,7 @@ var original_content; // to make editor cancellation quick
$('#manage-bar > div').hide();
$('#admin').height(0);
- $.getJSON('/_dwimmer/session.json', function(resp) {
+ $.getJSON(_url('/_dwimmer/session.json'), function(resp) {
if (resp["logged_in"] == 1) {
$('#admin').height("35px");
$('#logged_in_bar').show();
@@ -52,8 +58,7 @@ var original_content; // to make editor cancellation quick
$('.logout').click(function(){
- var url = '/_dwimmer/logout.json';
- $.get(url, function(resp) {
+ $.getJSON(_url('/_dwimmer/logout.json'), function(resp) {
$("#logged-in").html('');
$('#logged_in_bar').hide();
$('#manage-bar').hide();
@@ -73,7 +78,7 @@ var original_content; // to make editor cancellation quick
$(".list_users").click(function(){
manage_bar();
- $.getJSON('/_dwimmer/list_users.json', function(resp) {
+ $.getJSON(_url('/_dwimmer/list_users.json'), function(resp) {
var html = '<ul>';
for(var i=0; i < resp["users"].length; i++) {
html += '<li><a href="" value="' + resp["users"][i]["id"] + '">' + resp["users"][i]["name"] + '</li>';
@@ -144,7 +149,7 @@ var original_content; // to make editor cancellation quick
$(".list_pages").click(function(){
manage_bar();
- $.getJSON('/_dwimmer/get_pages.json', function(resp) {
+ $.getJSON(_url('/_dwimmer/get_pages.json'), function(resp) {
var html = '<ul>';
for(var i=0; i < resp["rows"].length; i++) {
html += '<li><a href="' + resp["rows"][i]["filename"] + '">' + resp["rows"][i]["title"] + '</li>';
@@ -159,7 +164,7 @@ var original_content; // to make editor cancellation quick
$(".show_history").click(function(){
manage_bar();
- var url = '/_dwimmer/history.json?filename=' + $(location).attr('pathname');
+ var url = _url('/_dwimmer/history.json') + '&filename=' + $(location).attr('pathname');
$.getJSON(url, function(resp) {
//$('#admin-editor').show();
var html = '<ul>';
@@ -171,7 +176,7 @@ var original_content; // to make editor cancellation quick
$('#manage-display').html(html);
$(".show_page_rev").click(function() {
- var url = $(this).attr('href');
+ var url = _url( $(this).attr('href') );
$.getJSON(url, function(resp) {
var body = resp["page"]["body"];
var revision = resp["page"]["revision"];
@@ -192,7 +197,7 @@ var original_content; // to make editor cancellation quick
$(".edit_this_page").click(function() {
manage_bar();
original_content = $('#content').html();
- var url = '/_dwimmer/page.json?filename=' + $(location).attr('pathname');
+ var url = _url('/_dwimmer/page.json') + '&filename=' + $(location).attr('pathname');
$.getJSON(url, function(resp) {
$('#admin-editor').show();
$('#admin-editor-filename').hide();
@@ -253,7 +258,7 @@ var original_content; // to make editor cancellation quick
});
function get_and_show_user (value) {
- $.getJSON('/_dwimmer/get_user.json?id=' + value, function(resp) {
+ $.getJSON(_url('/_dwimmer/get_user.json') + '&id=' + value, function(resp) {
manage_bar();
var html = '<ul>';
html += '<li>id = ' + resp["id"] + '</li>';

0 comments on commit 0fc7ba8

Please sign in to comment.