mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Fix #1208 Broken publication reload after rename
This commit is contained in:
@@ -23,7 +23,7 @@ function resizePreview(){
|
|||||||
|
|
||||||
function getHome(cas, page){
|
function getHome(cas, page){
|
||||||
|
|
||||||
if(typeof(page) == 'undefined')
|
if(typeof(page) === 'undefined')
|
||||||
page = 0;
|
page = 0;
|
||||||
|
|
||||||
switch (cas) {
|
switch (cas) {
|
||||||
@@ -41,7 +41,7 @@ function getHome(cas, page){
|
|||||||
beforeSend: function(){
|
beforeSend: function(){
|
||||||
if (answAjaxrunning && answAjax.abort)
|
if (answAjaxrunning && answAjax.abort)
|
||||||
answAjax.abort();
|
answAjax.abort();
|
||||||
if(page == 0)
|
if(page === 0)
|
||||||
clearAnswers();
|
clearAnswers();
|
||||||
answAjaxrunning = true;
|
answAjaxrunning = true;
|
||||||
$('#answers').addClass('loading');
|
$('#answers').addClass('loading');
|
||||||
@@ -137,11 +137,11 @@ function is_ctrl_key(event)
|
|||||||
return true;
|
return true;
|
||||||
if(event.metaKey) // apple key opera
|
if(event.metaKey) // apple key opera
|
||||||
return true;
|
return true;
|
||||||
if(event.keyCode == '17') // apple key opera
|
if(event.keyCode === 17) // apple key opera
|
||||||
return true;
|
return true;
|
||||||
if(event.keyCode == '224') // apple key mozilla
|
if(event.keyCode === 224) // apple key mozilla
|
||||||
return true;
|
return true;
|
||||||
if(event.keyCode == '91') // apple key safari
|
if(event.keyCode === 91) // apple key safari
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -237,11 +237,11 @@ function checkFilters(save)
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
search.fields = (search.fields = $('.field_filter select').val()) != null ? search.fields : new Array;
|
search.fields = (search.fields = $('.field_filter select').val()) !== null ? search.fields : new Array;
|
||||||
|
|
||||||
var reset_field = false;
|
var reset_field = false;
|
||||||
$.each(search.fields, function(i,n){
|
$.each(search.fields, function(i,n){
|
||||||
if(n == 'phraseanet--all--fields')
|
if(n === 'phraseanet--all--fields')
|
||||||
reset_field = true;
|
reset_field = true;
|
||||||
});
|
});
|
||||||
if(reset_field)
|
if(reset_field)
|
||||||
@@ -278,7 +278,7 @@ function checkFilters(save)
|
|||||||
if(save===true)
|
if(save===true)
|
||||||
setPref('search',JSON.stringify(search));
|
setPref('search',JSON.stringify(search));
|
||||||
|
|
||||||
if(danger===true || danger=='medium')
|
if(danger===true || danger === 'medium')
|
||||||
$('#EDIT_query').addClass('danger');
|
$('#EDIT_query').addClass('danger');
|
||||||
else
|
else
|
||||||
$('#EDIT_query').removeClass('danger');
|
$('#EDIT_query').removeClass('danger');
|
||||||
@@ -397,7 +397,6 @@ function afterSearch()
|
|||||||
openEvt:'click',
|
openEvt:'click',
|
||||||
dropDown:true,
|
dropDown:true,
|
||||||
theme:'vista',
|
theme:'vista',
|
||||||
dropDown:true,
|
|
||||||
showTransition:'slideDown',
|
showTransition:'slideDown',
|
||||||
hideTransition:'hide',
|
hideTransition:'hide',
|
||||||
shadow:false
|
shadow:false
|
||||||
@@ -674,8 +673,7 @@ function triggerShortcuts()
|
|||||||
{
|
{
|
||||||
|
|
||||||
$('#keyboard-stop').bind('click', function(){
|
$('#keyboard-stop').bind('click', function(){
|
||||||
|
var display = $(this).get(0).checked ? '0' : '1';
|
||||||
var display = $(this).get(0).checked ? '0' : '1' ;
|
|
||||||
|
|
||||||
setPref('keyboard_infos',display);
|
setPref('keyboard_infos',display);
|
||||||
|
|
||||||
@@ -718,7 +716,7 @@ function activeZoning()
|
|||||||
$('#idFrameC, #rightFrame').bind('mousedown',function(event){
|
$('#idFrameC, #rightFrame').bind('mousedown',function(event){
|
||||||
var old_zone = p4.active_zone;
|
var old_zone = p4.active_zone;
|
||||||
p4.active_zone = $(this).attr('id');
|
p4.active_zone = $(this).attr('id');
|
||||||
if(p4.active_zone != old_zone && p4.active_zone != 'headBlock')
|
if(p4.active_zone !== old_zone && p4.active_zone !== 'headBlock')
|
||||||
{
|
{
|
||||||
$('.effectiveZone.activeZone').removeClass('activeZone');
|
$('.effectiveZone.activeZone').removeClass('activeZone');
|
||||||
$('.effectiveZone', this).addClass('activeZone');//.flash('#555555');
|
$('.effectiveZone', this).addClass('activeZone');//.flash('#555555');
|
||||||
@@ -732,9 +730,9 @@ function RGBtoHex(R,G,B) {
|
|||||||
return toHex(R)+toHex(G)+toHex(B);
|
return toHex(R)+toHex(G)+toHex(B);
|
||||||
}
|
}
|
||||||
function toHex(N) {
|
function toHex(N) {
|
||||||
if (N==null) return "00";
|
if (N === null) return "00";
|
||||||
N=parseInt(N);
|
N=parseInt(N);
|
||||||
if (N==0 || isNaN(N)) return "00";
|
if (N === 0 || isNaN(N)) return "00";
|
||||||
N=Math.max(0,N);
|
N=Math.max(0,N);
|
||||||
N=Math.min(N,255);
|
N=Math.min(N,255);
|
||||||
N=Math.round(N);
|
N=Math.round(N);
|
||||||
@@ -785,8 +783,6 @@ function HueToRgb(m1, m2, hue) {
|
|||||||
return 255 * v;
|
return 255 * v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
$('.adv_search_button').live('click', function(){
|
$('.adv_search_button').live('click', function(){
|
||||||
@@ -828,17 +824,17 @@ $(document).ready(function(){
|
|||||||
else
|
else
|
||||||
if (event.srcElement)
|
if (event.srcElement)
|
||||||
targ = event.srcElement;
|
targ = event.srcElement;
|
||||||
if (targ.nodeType == 3)// safari bug
|
if (targ.nodeType === 3)// safari bug
|
||||||
targ = targ.parentNode;
|
targ = targ.parentNode;
|
||||||
|
|
||||||
var gogo = true;
|
var gogo = true;
|
||||||
var targ_name = targ.nodeName ? targ.nodeName.toLowerCase() : false;
|
var targ_name = targ.nodeName ? targ.nodeName.toLowerCase() : false;
|
||||||
|
|
||||||
if(targ_name != 'input' && targ_name.toLowerCase() != 'textarea')
|
if(targ_name !== 'input' && targ_name.toLowerCase() !== 'textarea')
|
||||||
{
|
{
|
||||||
gogo = false;
|
gogo = false;
|
||||||
}
|
}
|
||||||
if(targ_name == 'input')
|
if(targ_name === 'input')
|
||||||
{
|
{
|
||||||
if($(targ).is(':checkbox'))
|
if($(targ).is(':checkbox'))
|
||||||
gogo = false;
|
gogo = false;
|
||||||
@@ -893,7 +889,7 @@ $(document).ready(function(){
|
|||||||
{
|
{
|
||||||
back_hex = 'FFFFFF';
|
back_hex = 'FFFFFF';
|
||||||
|
|
||||||
var sim_b = 100 - 0.1 * (100 - hsb.b) ;
|
var sim_b = 100 - 0.1 * (100 - hsb.b);
|
||||||
}
|
}
|
||||||
|
|
||||||
var sim_b = 0.1 * hsb.b;
|
var sim_b = 0.1 * hsb.b;
|
||||||
@@ -905,7 +901,7 @@ $(document).ready(function(){
|
|||||||
setPref('background-selection-disabled', sim_hex);
|
setPref('background-selection-disabled', sim_hex);
|
||||||
setPref('fontcolor-selection', back_hex);
|
setPref('fontcolor-selection', back_hex);
|
||||||
|
|
||||||
$('style[title=color_selection]').empty()
|
$('style[title=color_selection]').empty();
|
||||||
|
|
||||||
var datas = '.diapo.selected,#reorder_box .diapo.selected, #EDIT_ALL .diapo.selected, .list.selected, .list.selected .diapo' +
|
var datas = '.diapo.selected,#reorder_box .diapo.selected, #EDIT_ALL .diapo.selected, .list.selected, .list.selected .diapo' +
|
||||||
'{'+
|
'{'+
|
||||||
@@ -922,7 +918,7 @@ $(document).ready(function(){
|
|||||||
$('#answers .see_more a').live('click', function(event){
|
$('#answers .see_more a').live('click', function(event){
|
||||||
$see_more = $(this).closest('.see_more');
|
$see_more = $(this).closest('.see_more');
|
||||||
$see_more.addClass('loading');
|
$see_more.addClass('loading');
|
||||||
})
|
});
|
||||||
|
|
||||||
$('#answers .feed .entry').live('mouseover', function(){
|
$('#answers .feed .entry').live('mouseover', function(){
|
||||||
$(this).addClass('hover');
|
$(this).addClass('hover');
|
||||||
@@ -983,7 +979,7 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
|
||||||
if(typeof(renew)=='undefined')
|
if(typeof(renew) === 'undefined')
|
||||||
renew = 'false';
|
renew = 'false';
|
||||||
else
|
else
|
||||||
renew = renew ? 'true' : 'false';
|
renew = renew ? 'true' : 'false';
|
||||||
@@ -1207,12 +1203,12 @@ $(document).ready(function(){
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 33: // pg up
|
case 33: // pg up
|
||||||
if(!p4.edit.textareaIsDirty || edit_validField(event, "ask_ok")==true)
|
if(!p4.edit.textareaIsDirty || edit_validField(event, "ask_ok"))
|
||||||
skipImage(event, 1);
|
skipImage(event, 1);
|
||||||
cancelKey = true;
|
cancelKey = true;
|
||||||
break;
|
break;
|
||||||
case 34: // pg dn
|
case 34: // pg dn
|
||||||
if(!p4.edit.textareaIsDirty || edit_validField(event, "ask_ok")==true)
|
if(!p4.edit.textareaIsDirty || edit_validField(event, "ask_ok"))
|
||||||
skipImage(event, -1);
|
skipImage(event, -1);
|
||||||
cancelKey = true;
|
cancelKey = true;
|
||||||
break;
|
break;
|
||||||
@@ -1382,7 +1378,7 @@ $(document).ready(function(){
|
|||||||
if(!$('#EDIT_query').hasClass('focused') && event.keyCode !== 17)
|
if(!$('#EDIT_query').hasClass('focused') && event.keyCode !== 17)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($('#keyboard-dialog.auto').length > 0 && shortCut == true)
|
if($('#keyboard-dialog.auto').length > 0 && shortCut)
|
||||||
{
|
{
|
||||||
triggerShortcuts();
|
triggerShortcuts();
|
||||||
}
|
}
|
||||||
@@ -1548,7 +1544,7 @@ function editThis(type,value)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
color = typeof color != 'undefined' ? color : 'red';
|
color = typeof color !== 'undefined' ? color : 'red';
|
||||||
var oldColor = $(this).css('backgroundColor');
|
var oldColor = $(this).css('backgroundColor');
|
||||||
return $(this).addClass('animating').stop().animate({
|
return $(this).addClass('animating').stop().animate({
|
||||||
backgroundColor: color
|
backgroundColor: color
|
||||||
@@ -1570,7 +1566,7 @@ function editThis(type,value)
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
color = typeof color != 'undefined' ? color : 'red';
|
color = typeof color !== 'undefined' ? color : 'red';
|
||||||
|
|
||||||
var pos = $(this).offset();
|
var pos = $(this).offset();
|
||||||
|
|
||||||
@@ -2777,9 +2773,9 @@ function set_start_page()
|
|||||||
|
|
||||||
var start_page_query = $('#look_box_settings input[name=start_page_value]').val();
|
var start_page_query = $('#look_box_settings input[name=start_page_value]').val();
|
||||||
|
|
||||||
if(val == 'QUERY')
|
if(val === 'QUERY')
|
||||||
{
|
{
|
||||||
if($.trim(start_page_query) == '')
|
if($.trim(start_page_query) === '')
|
||||||
{
|
{
|
||||||
alert(language.start_page_query_error);
|
alert(language.start_page_query_error);
|
||||||
return;
|
return;
|
||||||
@@ -2798,7 +2794,6 @@ function basketPrefs()
|
|||||||
resizable:false,
|
resizable:false,
|
||||||
width:450,
|
width:450,
|
||||||
height:500,
|
height:500,
|
||||||
draggable:false,
|
|
||||||
modal:true,
|
modal:true,
|
||||||
draggable:false,
|
draggable:false,
|
||||||
overlay: {
|
overlay: {
|
||||||
@@ -2815,7 +2810,6 @@ function lookBox(el,event)
|
|||||||
resizable:false,
|
resizable:false,
|
||||||
width:450,
|
width:450,
|
||||||
height:500,
|
height:500,
|
||||||
draggable:false,
|
|
||||||
modal:true,
|
modal:true,
|
||||||
draggable:false,
|
draggable:false,
|
||||||
overlay: {
|
overlay: {
|
||||||
@@ -2874,7 +2868,6 @@ function showAnswer(p)
|
|||||||
|
|
||||||
|
|
||||||
/** FROM INDEX.php **/
|
/** FROM INDEX.php **/
|
||||||
|
|
||||||
function saveeditPbar(idesc, ndesc)
|
function saveeditPbar(idesc, ndesc)
|
||||||
{
|
{
|
||||||
document.getElementById("saveeditPbarI").innerHTML = idesc;
|
document.getElementById("saveeditPbarI").innerHTML = idesc;
|
||||||
@@ -2912,12 +2905,8 @@ function getWinPosAsXML()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function saveWindows()
|
function saveWindows()
|
||||||
{
|
{
|
||||||
|
|
||||||
var key = '';
|
var key = '';
|
||||||
var value = '';
|
var value = '';
|
||||||
|
|
||||||
@@ -2969,7 +2958,7 @@ function autoorder()
|
|||||||
{
|
{
|
||||||
var val = $.trim($('#auto_order').val());
|
var val = $.trim($('#auto_order').val());
|
||||||
|
|
||||||
if(val == '')
|
if(val === '')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var sorter = new Array();
|
var sorter = new Array();
|
||||||
@@ -3041,9 +3030,9 @@ function set_up_feed_box(data)
|
|||||||
$(this).addClass('selected');
|
$(this).addClass('selected');
|
||||||
$('input[name="feed_id"]', $form).val($('input', this).val());
|
$('input[name="feed_id"]', $form).val($('input', this).val());
|
||||||
}).hover(function(){
|
}).hover(function(){
|
||||||
$(this).addClass('hover')
|
$(this).addClass('hover');
|
||||||
},function(){
|
},function(){
|
||||||
$(this).removeClass('hover')
|
$(this).removeClass('hover');
|
||||||
});
|
});
|
||||||
|
|
||||||
$form.bind('submit', function(){
|
$form.bind('submit', function(){
|
||||||
@@ -3063,12 +3052,12 @@ function set_up_feed_box(data)
|
|||||||
|
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
alert(language.feed_require_fields)
|
alert(language.feed_require_fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($('input[name="feed_id"]', $form).val() === '')
|
if($('input[name="feed_id"]', $form).val() === '')
|
||||||
{
|
{
|
||||||
alert(language.feed_require_feed)
|
alert(language.feed_require_feed);
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3077,7 +3066,6 @@ function set_up_feed_box(data)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: $form.attr('action'),
|
url: $form.attr('action'),
|
||||||
@@ -3103,8 +3091,17 @@ function set_up_feed_box(data)
|
|||||||
if($('form.main_form', $feed_box).hasClass('entry_update'))
|
if($('form.main_form', $feed_box).hasClass('entry_update'))
|
||||||
{
|
{
|
||||||
var id = $('form input[name="entry_id"]', $feed_box).val();
|
var id = $('form input[name="entry_id"]', $feed_box).val();
|
||||||
$('#entry_'+id).replaceWith(data.datas);
|
var container = $('#entry_'+id);
|
||||||
$('#entry_'+id).hide().fadeIn();
|
|
||||||
|
container.replaceWith(data.datas);
|
||||||
|
|
||||||
|
container.hide().fadeIn();
|
||||||
|
|
||||||
|
var answers = $('#answers');
|
||||||
|
|
||||||
|
answers.find("img.lazyload").lazyload({
|
||||||
|
container: answers
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($feed_box.data("ui-dialog")) {
|
if ($feed_box.data("ui-dialog")) {
|
||||||
|
Reference in New Issue
Block a user