885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 1
addOnloadHook(function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 2
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 3
load_component(['jquery', 'jquery-ui']);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 4
$('.sbedit-column').sortable({
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 5
handle: '.sbedit-handle',
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 6
connectWith: '.sbedit-column',
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 7
stop: function()
1
+ − 8
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 9
ajaxUpdateSidebarOrder();
1
+ − 10
}
+ − 11
});
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 12
});
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 13
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 14
function serialize_sidebar()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 15
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 16
var columns = {};
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 17
var i = 0;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 18
$('.sbedit-column').each(function(i, e)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 19
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 20
var arr = $(e).sortable('toArray');
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 21
for ( var j = 0; j < arr.length; j++ )
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 22
arr[j] = parseInt(arr[j].replace(/^block:/, ''));
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 23
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 24
i++;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 25
columns[i] = arr;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 26
});
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 27
return toJSONString(columns);
1
+ − 28
}
+ − 29
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 30
function sbedit_open_editor(a)
1
+ − 31
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 32
if ( auth_level < USER_LEVEL_ADMIN )
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 33
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 34
load_component('login');
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 35
ajaxDynamicReauth(function(sid)
1
+ − 36
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 37
sbedit_open_editor(a);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 38
}, USER_LEVEL_ADMIN);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 39
return false;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 40
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 41
load_component(['fadefilter', 'l10n']);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 42
var shade = darken(true, 50, 'sbedit-shade');
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 43
$(shade).css('z-index', 0);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 44
var parent = sbedit_get_parent(a);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 45
var offset = $(parent).offset();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 46
var top = (( getHeight() ) / 2) - 200 + getScrollOffset();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 47
var box = $(parent)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 48
.clone()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 49
.empty()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 50
.attr('id', 'sb_blockedit')
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 51
.addClass('sbedit-float')
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 52
.css('height', $(parent).height())
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 53
.css('top', offset.top)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 54
.css('left', offset.left)
943
+ − 55
.appendTo('body');
+ − 56
var item_id = parseInt($(parent).attr('id').replace(/^block:/, ''));
+ − 57
+ − 58
$(box)
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 59
.animate({ width: 500, height: 400, top: top, left: (getWidth() / 2) - 250 }, 400, function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 60
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 61
var whitey = whiteOutElement(this);
943
+ − 62
$(this).append('<textarea style="width: 98%; height: 360px; margin: 0 auto; display: block;" rows="20" cols="80"></textarea>');
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 63
$(this).append('<p style="text-align: center;"><a href="#" onclick="sbedit_edit_save(this); return false;">' + $lang.get('etc_save_changes') + '</a> | <a href="#" onclick="sbedit_edit_cancel(this); return false;">' + $lang.get('etc_cancel') + '</a></p>');
943
+ − 64
$.get(makeUrlNS('Special', 'EditSidebar', 'action=getsource&noheaders&id=' + item_id), {}, function(response, statustext)
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 65
{
943
+ − 66
$('textarea', box).val(response);
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 67
$(whitey).remove();
943
+ − 68
+ − 69
$(box).attr('enano:item_id', item_id);
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 70
}, 'html');
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 71
})
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 72
.get(0);
1
+ − 73
}
+ − 74
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 75
function sbedit_edit_save(a)
1
+ − 76
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 77
var box = a.parentNode.parentNode;
943
+ − 78
var parent = document.getElementById('block:' + $(box).attr('enano:item_id'));
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 79
var whitey = whiteOutElement(box);
943
+ − 80
$.post(makeUrlNS('Special', 'EditSidebar', 'noheaders&action=save&id=' + $(box).attr('enano:item_id')), { content: $('textarea', box).attr('value') }, function(response, statustext)
1
+ − 81
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 82
whiteOutReportSuccess(whitey);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 83
setTimeout(function()
1
+ − 84
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 85
sbedit_close_editor(parent, box);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 86
}, 1250);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 87
}, 'html');
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 88
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 89
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 90
function sbedit_edit_cancel(a)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 91
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 92
var box = a.parentNode.parentNode;
943
+ − 93
var parent = document.getElementById('block:' + $(box).attr('enano:item_id'));
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 94
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 95
sbedit_close_editor(parent, box);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 96
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 97
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 98
function sbedit_close_editor(parent, box)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 99
{
943
+ − 100
if ( !parent )
+ − 101
{
+ − 102
console.warn('Failed to get DOM object for parent, skipping transition effect');
+ − 103
}
+ − 104
+ − 105
if ( jQuery.fx.off || !parent )
+ − 106
{
+ − 107
enlighten(true, 'sbedit-shade');
+ − 108
$('body').get(0).removeChild(box);
+ − 109
return true;
+ − 110
}
+ − 111
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 112
var offset = $(parent).offset();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 113
$(box).empty().animate(
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 114
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 115
width: $(parent).width(),
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 116
height: $(parent).height(),
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 117
top: offset.top,
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 118
left: offset.left,
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 119
}, 400, function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 120
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 121
$(this).css('background-color', '#f70').fadeOut(1000, function() { $(this).remove(); });
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 122
enlighten(true, 'sbedit-shade');
1
+ − 123
});
+ − 124
}
+ − 125
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 126
function sbedit_delete_block(a)
1
+ − 127
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 128
var parent = sbedit_get_parent(a);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 129
load_component(['messagebox', 'fadefilter', 'flyin', 'l10n']);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 130
var mp = miniPromptMessage({
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 131
title: $lang.get('sbedit_msg_delete_confirm_title'),
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 132
message: $lang.get('sbedit_msg_delete_confirm_body'),
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 133
buttons: [
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 134
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 135
text: $lang.get('sbedit_btn_delete_confirm'),
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 136
color: 'red',
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 137
onclick: function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 138
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 139
var mp = miniPromptGetParent(this);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 140
sbedit_delete_block_s2(mp.target_block);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 141
miniPromptDestroy(this);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 142
return false;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 143
},
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 144
style: {
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 145
fontWeight: 'bold'
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 146
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 147
},
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 148
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 149
text: $lang.get('etc_cancel'),
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 150
onclick: function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 151
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 152
miniPromptDestroy(this);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 153
return false;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 154
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 155
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 156
]
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 157
});
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 158
mp.target_block = parent;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 159
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 160
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 161
function sbedit_delete_block_s2(box)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 162
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 163
var parent = box;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 164
var id = parseInt($(parent).attr('id').replace(/^block:/, ''));
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 165
var whitey = whiteOutElement(parent);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 166
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 167
$.get(makeUrlNS('Special', 'EditSidebar', 'action=delete&ajax=true&noheaders&id=' + id), function(response, statustext)
1
+ − 168
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 169
if ( response == 'GOOD' )
1
+ − 170
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 171
whiteOutReportSuccess(whitey);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 172
setTimeout(function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 173
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 174
$(parent)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 175
.hide('blind', { duration: 500 }, function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 176
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 177
$(this).remove();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 178
ajaxUpdateSidebarOrder();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 179
});
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 180
}, 1250);
1
+ − 181
}
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 182
else
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 183
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 184
whiteOutReportFailure(whitey);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 185
alert(response);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 186
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 187
}, 'html');
1
+ − 188
}
+ − 189
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 190
function sbedit_rename_block(a)
190
+ − 191
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 192
var parent = sbedit_get_parent(a);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 193
$('div.sbedit-handle > span', parent).hide();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 194
var input = $('div.sbedit-handle > input', parent).show().focus().select().keyup(function(e)
190
+ − 195
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 196
switch(e.keyCode)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 197
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 198
case 13:
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 199
// enter
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 200
var whitey = whiteOutElement(this.parentNode);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 201
var me = this;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 202
var id = parseInt($(parent).attr('id').replace(/^block:/, ''));
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 203
$.post(makeUrlNS('Special', 'EditSidebar', 'ajax&noheaders&action=rename&id='+id), { newname: $(this).attr('value') }, function(response, statustext)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 204
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 205
if ( response == 'GOOD' )
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 206
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 207
whiteOutReportSuccess(whitey);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 208
setTimeout(function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 209
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 210
$(me).hide();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 211
$('span', me.parentNode).show().text(me.value);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 212
}, 1250);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 213
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 214
else
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 215
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 216
alert(response);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 217
whiteOutReportFailure(whitey);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 218
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 219
}, 'html');
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 220
break;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 221
case 27:
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 222
// escape
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 223
this.value = this.origvalue;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 224
$(this).hide();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 225
$('span', this.parentNode).show();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 226
break;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 227
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 228
}).get(0);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 229
input.origvalue = input.value;
190
+ − 230
}
+ − 231
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 232
function sbedit_disenable_block(a)
190
+ − 233
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 234
var parent = sbedit_get_parent(a);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 235
var whitey = whiteOutElement(parent);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 236
$.get(makeUrlNS('Special', 'EditSidebar', 'action=disenable&ajax=true&noheaders&id=' + parseInt($(parent).attr('id').replace(/^block:/, ''))), {}, function(response, statustext)
190
+ − 237
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 238
if ( response == 'GOOD' )
190
+ − 239
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 240
whiteOutReportSuccess(whitey);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 241
$(parent).toggleClass('disabled');
190
+ − 242
}
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 243
else
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 244
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 245
whiteOutReportFailure(whitey);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 246
alert(response);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 247
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 248
}, 'html');
190
+ − 249
}
+ − 250
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 251
function sbedit_get_parent(a)
190
+ − 252
{
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 253
var o = a.parentNode;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 254
while ( !$(o).hasClass('sbedit-block') )
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 255
o = o.parentNode;
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 256
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 257
return o;
190
+ − 258
}
+ − 259
885
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 260
function ajaxUpdateSidebarOrder()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 261
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 262
setAjaxLoading();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 263
var ser = serialize_sidebar();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 264
$.post(makeUrlNS('Special', 'EditSidebar', 'update_order'), { order: ser }, function(response, statustext)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 265
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 266
var msg = document.createElement('div');
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 267
$(msg)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 268
.addClass('info-box-mini')
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 269
.text('Sidebar order saved.')
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 270
.css('position', 'fixed')
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 271
.css('bottom', 1)
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 272
.appendTo('body')
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 273
.css('left', ( getWidth() / 2 ) - ( $(msg).width() / 2 ));
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 274
setTimeout(function()
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 275
{
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 276
$(msg).fadeOut(500, function() { $(this).remove(); });
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 277
}, 1000);
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 278
unsetAjaxLoading();
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 279
}, 'json');
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 280
}
a86a69394a95
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
Dan
diff
changeset
+ − 281