2010-05-25 00:32:12 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
2011-06-26 00:01:11 +00:00
|
|
|
// sortable items
|
2010-07-23 20:20:09 +00:00
|
|
|
$('ul#contents-list.sortable').sortable({
|
2011-06-26 00:01:11 +00:00
|
|
|
'handle': 'em',
|
|
|
|
'items': 'li.content',
|
|
|
|
'axis': 'y',
|
|
|
|
'update': function(event, ui) {
|
|
|
|
var params = $(this).sortable('serialize', { 'key': 'children[]' });
|
|
|
|
params += '&_method=put';
|
|
|
|
params += '&' + $('meta[name=csrf-param]').attr('content') + '=' + $('meta[name=csrf-token]').attr('content');
|
|
|
|
|
|
|
|
$.post($(this).attr('data-url'), params, function(data) {
|
|
|
|
var error = typeof(data.error) != 'undefined';
|
|
|
|
$.growl((error ? 'error' : 'success'), (error ? data.error : data.notice));
|
|
|
|
}, 'json');
|
|
|
|
}
|
2010-07-23 20:20:09 +00:00
|
|
|
});
|
|
|
|
|
2010-12-14 17:00:12 +00:00
|
|
|
try {
|
|
|
|
$('textarea.html').tinymce(TinyMceDefaultSettings);
|
|
|
|
} catch (e) { /* tinymce not loaded */ }
|
2010-07-23 20:20:09 +00:00
|
|
|
|
|
|
|
$.datepicker.setDefaults($.datepicker.regional[I18nLocale]);
|
|
|
|
$('input[type=text].date').datepicker($.datepicker.regional[I18nLocale]);
|
|
|
|
});
|