Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 7 additions & 28 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,24 @@

addInitEvent(function(){
jQuery(function(){
/**
* Attach diff popup
*/
var diffs = getElementsByClass('sync_popup',document,'a');
for(var i=0; i<diffs.length; i++){
addEvent(diffs[i],'click',function(e){
window.open(this.href,'diff',"width=700,height=500,left=100,top=100,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
jQuery('a[class=sync_popup]').click(function(e){
window.open(jQuery(this).attr("href"),'diff',"width=700,height=500,left=100,top=100,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
e.preventDefault();
e.stopPropagation();
return false;
});
}

/**
* Attach the select all actions
*/
var push = $('sync__push');
if(push){
push.style.cursor = 'pointer';
addEvent(push,'click',function(){ sync_select('push'); });
}
var skip = $('sync__skip');
if(skip){
skip.style.cursor = 'pointer';
addEvent(skip,'click',function(){ sync_select('skip'); });
}
var pull = $('sync__pull');
if(pull){
pull.style.cursor = 'pointer';
addEvent(pull,'click',function(){ sync_select('pull'); });
}

jQuery('#sync__push').click(function(){ sync_select('push'); }).addClass('sync__action');
jQuery('#sync__skip').click(function(){ sync_select('skip'); }).addClass('sync__action');
jQuery('#sync__pull').click(function(){ sync_select('pull'); }).addClass('sync__action');
});

/**
* Check all radio buttons of the given type
*/
function sync_select(type){
var items = getElementsByClass('sync'+type);
for(var i=0; i<items.length; i++){
items[i].checked = 'checked';
}
jQuery('input[class=sync'+type+']').prop('checked',true);
}
3 changes: 3 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ div.dokuwiki ul.sync li.pull_fail {
list-style-image: url(pix/right_fail.png);
}

th.sync__action{
cursor: pointer;
}