Skip to content

Commit

Permalink
Merge branch 'hotfix/cache'
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Sep 14, 2011
2 parents 6681644 + 5ce0a3d commit 0fc7ba8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -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 v0.11 2011.09.10


Release of the first interesting version. Release of the first interesting version.
Expand Down
2 changes: 1 addition & 1 deletion lib/Dwimmer.pm
Expand Up @@ -3,7 +3,7 @@ use Dancer ':syntax';


use 5.008005; use 5.008005;


our $VERSION = '0.11'; our $VERSION = '0.1101';


use Dwimmer::DB; use Dwimmer::DB;
use Dwimmer::Tools qw(_get_db _get_site); use Dwimmer::Tools qw(_get_db _get_site);
Expand Down
2 changes: 1 addition & 1 deletion lib/Dwimmer/Admin.pm
Expand Up @@ -3,7 +3,7 @@ use Dancer ':syntax';


use 5.008005; use 5.008005;


our $VERSION = '0.11'; our $VERSION = '0.1101';


use Data::Dumper qw(Dumper); use Data::Dumper qw(Dumper);
use Email::Valid (); use Email::Valid ();
Expand Down
2 changes: 1 addition & 1 deletion lib/Dwimmer/Client.pm
Expand Up @@ -8,7 +8,7 @@ has host => (is => 'ro', isa => 'Str', required => 1);
has mech => (is => 'rw', isa => 'WWW::Mechanize', default => sub { WWW::Mechanize->new } ); has mech => (is => 'rw', isa => 'WWW::Mechanize', default => sub { WWW::Mechanize->new } );




our $VERSION = '0.11'; our $VERSION = '0.1101';


sub login { sub login {
my ($self, $username, $password) = @_; my ($self, $username, $password) = @_;
Expand Down
2 changes: 1 addition & 1 deletion lib/Dwimmer/Tools.pm
Expand Up @@ -9,7 +9,7 @@ use YAML;


use Dwimmer::DB; 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); our @EXPORT_OK = qw(sha1_base64 _get_db _get_site save_page create_site);


Expand Down
23 changes: 14 additions & 9 deletions public/javascripts/dwimmer.js
Expand Up @@ -2,6 +2,12 @@ var username;
var userid; var userid;
var original_content; // to make editor cancellation quick var original_content; // to make editor cancellation quick


function _url(url) {
url = url + '?cache=' + new Date().getTime();
//alert(url);
return url;
}

$(document).ready(function() { $(document).ready(function() {
$('#content').show(); $('#content').show();
$('#logged_in_bar').hide(); $('#logged_in_bar').hide();
Expand All @@ -10,7 +16,7 @@ var original_content; // to make editor cancellation quick
$('#manage-bar > div').hide(); $('#manage-bar > div').hide();
$('#admin').height(0); $('#admin').height(0);


$.getJSON('/_dwimmer/session.json', function(resp) { $.getJSON(_url('/_dwimmer/session.json'), function(resp) {
if (resp["logged_in"] == 1) { if (resp["logged_in"] == 1) {
$('#admin').height("35px"); $('#admin').height("35px");
$('#logged_in_bar').show(); $('#logged_in_bar').show();
Expand Down Expand Up @@ -52,8 +58,7 @@ var original_content; // to make editor cancellation quick




$('.logout').click(function(){ $('.logout').click(function(){
var url = '/_dwimmer/logout.json'; $.getJSON(_url('/_dwimmer/logout.json'), function(resp) {
$.get(url, function(resp) {
$("#logged-in").html(''); $("#logged-in").html('');
$('#logged_in_bar').hide(); $('#logged_in_bar').hide();
$('#manage-bar').hide(); $('#manage-bar').hide();
Expand All @@ -73,7 +78,7 @@ var original_content; // to make editor cancellation quick


$(".list_users").click(function(){ $(".list_users").click(function(){
manage_bar(); manage_bar();
$.getJSON('/_dwimmer/list_users.json', function(resp) { $.getJSON(_url('/_dwimmer/list_users.json'), function(resp) {
var html = '<ul>'; var html = '<ul>';
for(var i=0; i < resp["users"].length; i++) { for(var i=0; i < resp["users"].length; i++) {
html += '<li><a href="" value="' + resp["users"][i]["id"] + '">' + resp["users"][i]["name"] + '</li>'; html += '<li><a href="" value="' + resp["users"][i]["id"] + '">' + resp["users"][i]["name"] + '</li>';
Expand Down Expand Up @@ -144,7 +149,7 @@ var original_content; // to make editor cancellation quick


$(".list_pages").click(function(){ $(".list_pages").click(function(){
manage_bar(); manage_bar();
$.getJSON('/_dwimmer/get_pages.json', function(resp) { $.getJSON(_url('/_dwimmer/get_pages.json'), function(resp) {
var html = '<ul>'; var html = '<ul>';
for(var i=0; i < resp["rows"].length; i++) { for(var i=0; i < resp["rows"].length; i++) {
html += '<li><a href="' + resp["rows"][i]["filename"] + '">' + resp["rows"][i]["title"] + '</li>'; html += '<li><a href="' + resp["rows"][i]["filename"] + '">' + resp["rows"][i]["title"] + '</li>';
Expand All @@ -159,7 +164,7 @@ var original_content; // to make editor cancellation quick


$(".show_history").click(function(){ $(".show_history").click(function(){
manage_bar(); 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) { $.getJSON(url, function(resp) {
//$('#admin-editor').show(); //$('#admin-editor').show();
var html = '<ul>'; var html = '<ul>';
Expand All @@ -171,7 +176,7 @@ var original_content; // to make editor cancellation quick
$('#manage-display').html(html); $('#manage-display').html(html);


$(".show_page_rev").click(function() { $(".show_page_rev").click(function() {
var url = $(this).attr('href'); var url = _url( $(this).attr('href') );
$.getJSON(url, function(resp) { $.getJSON(url, function(resp) {
var body = resp["page"]["body"]; var body = resp["page"]["body"];
var revision = resp["page"]["revision"]; var revision = resp["page"]["revision"];
Expand All @@ -192,7 +197,7 @@ var original_content; // to make editor cancellation quick
$(".edit_this_page").click(function() { $(".edit_this_page").click(function() {
manage_bar(); manage_bar();
original_content = $('#content').html(); 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) { $.getJSON(url, function(resp) {
$('#admin-editor').show(); $('#admin-editor').show();
$('#admin-editor-filename').hide(); $('#admin-editor-filename').hide();
Expand Down Expand Up @@ -253,7 +258,7 @@ var original_content; // to make editor cancellation quick
}); });


function get_and_show_user (value) { 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(); manage_bar();
var html = '<ul>'; var html = '<ul>';
html += '<li>id = ' + resp["id"] + '</li>'; html += '<li>id = ' + resp["id"] + '</li>';
Expand Down

0 comments on commit 0fc7ba8

Please sign in to comment.