1039
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 1
var sbedit_load = function()
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
+ − 2
{
1039
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 3
if ( !window.jQuery )
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 4
{
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 5
load_component(['jquery', 'jquery-ui']);
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 6
// this seems to be the only way to make the sortables init properly
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 7
// FIXME find out what we're waiting for here, and wait on it the right way
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 8
window.setTimeout(sbedit_load, 200);
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 9
return true;
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 10
}
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
+ − 11
$('.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
+ − 12
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
+ − 13
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
+ − 14
stop: function()
1
+ − 15
{
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
+ − 16
ajaxUpdateSidebarOrder();
1
+ − 17
}
+ − 18
});
1039
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 19
};
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 20
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 21
addOnloadHook(sbedit_load);
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
+ − 22
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
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
+ − 24
{
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
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
+ − 26
var i = 0;
1039
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 27
try
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 28
{
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 29
$('.sbedit-column').each(function(i, e)
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 30
{
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 31
// console.debug(e, ' TOARRAY: ', $(e).sortable('toArray'));
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 32
var arr = $(e).sortable('toArray');
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 33
if ( !arr )
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 34
{
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 35
console.error('Retrieving order failed!');
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 36
throw new Exception();
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 37
}
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 38
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 39
for ( var j = 0; j < arr.length; j++ )
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 40
arr[j] = parseInt(arr[j].replace(/^block:/, ''));
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 41
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 42
i++;
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 43
columns[i] = arr;
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 44
});
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 45
}
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 46
catch ( e )
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 47
{
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 48
return false;
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 49
}
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
+ − 50
return toJSONString(columns);
1
+ − 51
}
+ − 52
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
+ − 53
function sbedit_open_editor(a)
1
+ − 54
{
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
+ − 55
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
+ − 56
{
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
+ − 57
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
+ − 58
ajaxDynamicReauth(function(sid)
1
+ − 59
{
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
+ − 60
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
+ − 61
}, 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
+ − 62
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
+ − 63
}
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
+ − 64
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
+ − 65
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
+ − 66
$(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
+ − 67
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
+ − 68
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
+ − 69
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
+ − 70
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
+ − 71
.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
+ − 72
.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
+ − 73
.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
+ − 74
.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
+ − 75
.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
+ − 76
.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
+ − 77
.css('left', offset.left)
943
+ − 78
.appendTo('body');
+ − 79
var item_id = parseInt($(parent).attr('id').replace(/^block:/, ''));
+ − 80
+ − 81
$(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
+ − 82
.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
+ − 83
{
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
+ − 84
var whitey = whiteOutElement(this);
943
+ − 85
$(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
+ − 86
$(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
+ − 87
$.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
+ − 88
{
943
+ − 89
$('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
+ − 90
$(whitey).remove();
943
+ − 91
+ − 92
$(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
+ − 93
}, '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
+ − 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
.get(0);
1
+ − 96
}
+ − 97
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
+ − 98
function sbedit_edit_save(a)
1
+ − 99
{
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
+ − 100
var box = a.parentNode.parentNode;
943
+ − 101
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
+ − 102
var whitey = whiteOutElement(box);
943
+ − 103
$.post(makeUrlNS('Special', 'EditSidebar', 'noheaders&action=save&id=' + $(box).attr('enano:item_id')), { content: $('textarea', box).attr('value') }, function(response, statustext)
1
+ − 104
{
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
+ − 105
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
+ − 106
setTimeout(function()
1
+ − 107
{
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
+ − 108
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
+ − 109
}, 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
+ − 110
}, '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
+ − 111
}
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
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
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
+ − 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
var box = a.parentNode.parentNode;
943
+ − 116
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
+ − 117
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
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
+ − 119
}
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
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
+ − 122
{
943
+ − 123
if ( !parent )
+ − 124
{
+ − 125
console.warn('Failed to get DOM object for parent, skipping transition effect');
+ − 126
}
+ − 127
+ − 128
if ( jQuery.fx.off || !parent )
+ − 129
{
+ − 130
enlighten(true, 'sbedit-shade');
+ − 131
$('body').get(0).removeChild(box);
+ − 132
return true;
+ − 133
}
+ − 134
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
+ − 135
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
+ − 136
$(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
+ − 137
{
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
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
+ − 139
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
+ − 140
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
+ − 141
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
+ − 142
}, 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
+ − 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
$(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
+ − 145
enlighten(true, 'sbedit-shade');
1
+ − 146
});
+ − 147
}
+ − 148
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
+ − 149
function sbedit_delete_block(a)
1
+ − 150
{
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
+ − 151
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
+ − 152
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
+ − 153
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
+ − 154
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
+ − 155
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
+ − 156
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
+ − 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
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
+ − 159
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
+ − 160
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
+ − 161
{
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
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
+ − 163
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
+ − 164
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
+ − 165
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
+ − 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
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
+ − 168
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
+ − 169
}
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
+ − 170
},
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
{
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
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
+ − 173
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
+ − 174
{
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
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
+ − 176
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
+ − 177
}
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
}
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
});
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
+ − 181
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
+ − 182
}
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
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
+ − 185
{
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
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
+ − 187
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
+ − 188
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
+ − 189
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
$.get(makeUrlNS('Special', 'EditSidebar', 'action=delete&ajax=true&noheaders&id=' + id), function(response, statustext)
1
+ − 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
if ( response == 'GOOD' )
1
+ − 193
{
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
+ − 194
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
+ − 195
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
+ − 196
{
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
$(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
+ − 198
.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
+ − 199
{
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
$(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
+ − 201
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
+ − 202
});
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
}, 1250);
1
+ − 204
}
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
+ − 205
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
+ − 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
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
+ − 208
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
+ − 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
}, 'html');
1
+ − 211
}
+ − 212
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
+ − 213
function sbedit_rename_block(a)
190
+ − 214
{
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
+ − 215
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
+ − 216
$('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
+ − 217
var input = $('div.sbedit-handle > input', parent).show().focus().select().keyup(function(e)
190
+ − 218
{
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
+ − 219
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
+ − 220
{
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 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
+ − 222
// 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
+ − 223
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
+ − 224
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
+ − 225
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
+ − 226
$.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
+ − 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
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
+ − 229
{
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
+ − 230
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
+ − 231
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
+ − 232
{
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
+ − 233
$(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
+ − 234
$('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
+ − 235
}, 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
+ − 236
}
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
+ − 237
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
+ − 238
{
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
+ − 239
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
+ − 240
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
+ − 241
}
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
+ − 242
}, '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
+ − 243
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
+ − 244
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
+ − 245
// 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
+ − 246
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
+ − 247
$(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
+ − 248
$('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
+ − 249
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
+ − 250
}
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
}).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
+ − 252
input.origvalue = input.value;
190
+ − 253
}
+ − 254
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
+ − 255
function sbedit_disenable_block(a)
190
+ − 256
{
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
+ − 257
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
+ − 258
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
+ − 259
$.get(makeUrlNS('Special', 'EditSidebar', 'action=disenable&ajax=true&noheaders&id=' + parseInt($(parent).attr('id').replace(/^block:/, ''))), {}, function(response, statustext)
190
+ − 260
{
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
+ − 261
if ( response == 'GOOD' )
190
+ − 262
{
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
+ − 263
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
+ − 264
$(parent).toggleClass('disabled');
190
+ − 265
}
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
+ − 266
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
+ − 267
{
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
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
+ − 269
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
+ − 270
}
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
}, 'html');
190
+ − 272
}
+ − 273
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
+ − 274
function sbedit_get_parent(a)
190
+ − 275
{
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
+ − 276
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
+ − 277
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
+ − 278
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
+ − 279
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
return o;
190
+ − 281
}
+ − 282
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
+ − 283
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
+ − 284
{
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
+ − 285
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
+ − 286
var ser = serialize_sidebar();
1039
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 287
if ( !ser )
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 288
{
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 289
var msg = document.createElement('div');
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 290
$(msg)
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 291
.addClass('error-box-mini')
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 292
.text('jQuery failure: returned invalid serialized sidebar data')
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 293
.css('position', 'fixed')
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 294
.css('bottom', 1)
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 295
.appendTo('body')
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 296
.css('left', ( getWidth() / 2 ) - ( $(msg).width() / 2 ));
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 297
setTimeout(function()
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 298
{
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 299
$(msg).fadeOut(500, function() { $(this).remove(); });
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 300
}, 1000);
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 301
unsetAjaxLoading();
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 302
return false;
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 303
}
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
+ − 304
$.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
+ − 305
{
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
+ − 306
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
+ − 307
$(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
+ − 308
.addClass('info-box-mini')
1039
4226cedb3bc4
Fixed one unlocalized string in sidebar editor; fixed sidebar editor jQuery init race condition seen under Firefox and Chromium on 64-bit
Dan
diff
changeset
+ − 309
.text($lang.get('sbedit_msg_order_saved'))
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
+ − 310
.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
+ − 311
.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
+ − 312
.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
+ − 313
.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
+ − 314
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
+ − 315
{
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
+ − 316
$(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
+ − 317
}, 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
+ − 318
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
+ − 319
}, '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
+ − 320
}
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
+ − 321