Skip to content

Commit

Permalink
Item11512: Add md5 keys for remaining topics.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@13941 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Feb 10, 2012
1 parent 19d3756 commit ef3de38
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 3 additions & 3 deletions JQueryPlugin/data/System/JQueryAjaxHelper.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ jQuery(function($){
var $this = $(this),
opts = $.extend({}, $this.metadata());
$this.autocomplete({
source: "%SCRIPTURL{"view"}%/%SYSTEMWEB%/JQueryAjaxHelper?section=topic;skin=text;contenttype=application/json;baseweb="+opts.baseweb+";format="+opts.format,
source: foswiki.getPreference('SCRIPTURL') + 'view/' + foswiki.getPreference('SYSTEMWEB') + "/JQueryAjaxHelper?section=topic;skin=text;contenttype=application/json;baseweb="+opts.baseweb+";format="+opts.format,
select: function(event, ui) {
window.location.href="%SCRIPTURLPATH{"view"}%/"+(opts.global?'':opts.baseweb+'/')+ui.item.value;
window.location.href=foswiki.getPreference('SCRIPTURL') + 'view/'+(opts.global?'':opts.baseweb+'/')+ui.item.value;
}
});
});
Expand Down Expand Up @@ -287,7 +287,7 @@ or later).
<script type=\"text/javascript\">
jQuery(function($){
$(\"#%ID%\").click(function() {
$.get(\"%SCRIPTURL{"view"}%/%SYSTEMWEB%/JQueryAjaxHelper?section=query;source=%SOURCE%;query=%QUERY%;skin=text;contenttype=application/json\",
$.get(foswiki.getPreference('SCRIPTURL') + 'view/' + foswiki.getPreference('SYSTEMWEB') + '/JQueryAjaxHelper?section=query;source=%SOURCE%;query=%QUERY%;skin=text;contenttype=application/json',
function(data) {
// This is the function that will be executed when the
// data is fetched
Expand Down
20 changes: 14 additions & 6 deletions core/data/System/SiteChanges.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
text="<literal><script type='text/javascript'>
(function($) {

// debug the javascript by passing urlparam debugJs=1
var DEBUG = %URLPARAM{"debugJs" default="0"}%;
var DEBUG;

function updateLastTimeCheckedOption (inDate) {
var el = document.getElementById('last_time_checked');
Expand Down Expand Up @@ -133,12 +132,11 @@
}

function init() {

var DEFAULT_OPTION_ID = '24_hours_ago';

var dateLastCheck = foswiki.Pref.getPref('WebChangesForAllWebs_dateLastCheck');
if (dateLastCheck) {
var selectedOption = '%URLPARAM{"sinceReadable"}%';
var selectedOption = $('input[name=\"sinceReadable\"]').val();
if (DEBUG && console) {
console.log('sinceReadable selectedOption:' + selectedOption);
}
Expand All @@ -148,12 +146,21 @@
setOptionSelected(DEFAULT_OPTION_ID);
}
}
var now = '%CALC{"$FORMATTIME($EVAL($TIME()), $year-$month-$day $hour:$minute:$second)"}%';
var d = new Date();
var now = d.getFullYear() + '-' +
(d.getMonth() + 1) + '-' +
d.getDate() + ' ' +
d.getHours() + ':' +
d.getMinutes() + ':' +
d.getSeconds();
now = now.replace(/([-: ])(\d)([-: ]|$)/g, '$1\60$2$3');
if (DEBUG && console) {
console.log('now:' + now);
}
if (now) {
foswiki.Pref.setPref('%WEB%_%TOPIC%_dateLastCheck', now);
foswiki.Pref.setPref(foswiki.getPreference('WEB') +
'_' + foswiki.getPreference('TOPIC') +
'_dateLastCheck', now);
updateLastTimeCheckedOption(now);
}
}
Expand All @@ -165,6 +172,7 @@
}

$(function() {
DEBUG = $(\"input[name='debugJs']\").val();
$('#siteChangesSelect').change(function() {
var $selected = $('option:selected', this);
storeSelectedOption($selected.attr('id'), $selected.attr('value'), document.forms.seeChangesSince.sinceReadable);
Expand Down

0 comments on commit ef3de38

Please sign in to comment.