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