'
@@ -435,7 +391,7 @@ function updateCurrentMval(meta_struct_id, HighlightValue, vocabularyId)
}
$('#ZTextMultiValued_values', p4.edit.editBox).html(t);
- $('#ZTextMultiValued_values .add_all', p4.edit.editBox).unbind('click').bind('click', function(){
+ $('#ZTextMultiValued_values .add_all', p4.edit.editBox).unbind('click').bind('click', function () {
var container = $(this).closest('div');
var span = $('span.value', container)
@@ -447,7 +403,7 @@ function updateCurrentMval(meta_struct_id, HighlightValue, vocabularyId)
updateFieldDisplay();
return false;
});
- $('#ZTextMultiValued_values .remove_all', p4.edit.editBox).unbind('click').bind('click', function(){
+ $('#ZTextMultiValued_values .remove_all', p4.edit.editBox).unbind('click').bind('click', function () {
var container = $(this).closest('div');
var span = $('span.value', container)
@@ -467,8 +423,7 @@ function updateCurrentMval(meta_struct_id, HighlightValue, vocabularyId)
// ---------------------------------------------------------------------------
// on a clique sur une des multi-valeurs dans la liste
// ---------------------------------------------------------------------------
-function edit_clkmval(mvaldiv, ival)
-{
+function edit_clkmval(mvaldiv, ival) {
$(mvaldiv).parent().find('.hilighted').removeClass('hilighted');
$(mvaldiv).addClass('hilighted');
reveal_mval(p4.edit.T_mval[ival].getValue(), p4.edit.T_mval[ival].getVocabularyId());
@@ -479,44 +434,38 @@ function edit_clkmval(mvaldiv, ival)
// highlight la valeur en cours de saisie dans la liste des multi-valeurs
// appele par le onkeyup
// ---------------------------------------------------------------------------
-function reveal_mval(value, vocabularyId)
-{
- if(typeof vocabularyId === 'undefined')
+function reveal_mval(value, vocabularyId) {
+ if (typeof vocabularyId === 'undefined')
vocabularyId = null;
var textZone = $('#EditTextMultiValued');
- if(p4.edit.T_fields[p4.edit.curField].tbranch)
- {
- if(value != "")
+ if (p4.edit.T_fields[p4.edit.curField].tbranch) {
+ if (value != "")
ETHSeeker.search(value);
}
- if(value != "")
- {
+ if (value != "") {
// var nsel = 0;
- for(rec_i in p4.edit.T_records)
- {
- if(p4.edit.T_records[rec_i].fields[p4.edit.curField].hasValue(value, vocabularyId))
- {
- $("#idEditDiaButtonsP_"+rec_i).hide();
- var talt = $.sprintf(language.editDelSimple,value);
- $("#idEditDiaButtonsM_"+rec_i).show()
+ for (rec_i in p4.edit.T_records) {
+ if (p4.edit.T_records[rec_i].fields[p4.edit.curField].hasValue(value, vocabularyId)) {
+ $("#idEditDiaButtonsP_" + rec_i).hide();
+ var talt = $.sprintf(language.editDelSimple, value);
+ $("#idEditDiaButtonsM_" + rec_i).show()
.attr('alt', talt)
.attr('Title', talt)
- .unbind('click').bind('click', function(){
+ .unbind('click').bind('click', function () {
var indice = $(this).attr('id').split('_').pop();
edit_diabutton(indice, 'del', value, vocabularyId);
});
}
- else
- {
- $("#idEditDiaButtonsM_"+rec_i).hide();
- $("#idEditDiaButtonsP_"+rec_i).show();
- var talt = $.sprintf(language.editAddSimple,value);
- $("#idEditDiaButtonsP_"+rec_i).show().attr('alt', talt)
+ else {
+ $("#idEditDiaButtonsM_" + rec_i).hide();
+ $("#idEditDiaButtonsP_" + rec_i).show();
+ var talt = $.sprintf(language.editAddSimple, value);
+ $("#idEditDiaButtonsP_" + rec_i).show().attr('alt', talt)
.attr('Title', talt)
- .unbind('click').bind('click', function(){
+ .unbind('click').bind('click', function () {
var indice = $(this).attr('id').split('_').pop();
edit_diabutton(indice, 'add', value, vocabularyId);
});
@@ -529,16 +478,13 @@ function reveal_mval(value, vocabularyId)
return(true);
}
-function edit_diabutton(record_indice, act, value, vocabularyId)
-{
+function edit_diabutton(record_indice, act, value, vocabularyId) {
var meta_struct_id = p4.edit.curField; // le champ en cours d'editing
- if(act == 'del')
- {
+ if (act == 'del') {
p4.edit.T_records[record_indice].fields[meta_struct_id].removeValue(value, vocabularyId);
}
- if(act=='add')
- {
+ if (act == 'add') {
p4.edit.T_records[record_indice].fields[meta_struct_id].addValue(value, false, vocabularyId);
}
updateCurrentMval(meta_struct_id, value, vocabularyId);
@@ -549,14 +495,12 @@ function edit_diabutton(record_indice, act, value, vocabularyId)
// ---------------------------------------------------------------------------
// on a clique sur le bouton 'ajouter' un mot dans le multi-val
// ---------------------------------------------------------------------------
-function edit_addmval(value, VocabularyId)
-{
+function edit_addmval(value, VocabularyId) {
var meta_struct_id = p4.edit.curField; // le champ en cours d'editing
// on ajoute le mot dans tous les records selectionnes
- for(var r=0; r= $('.diapo',cache).length)
+ else if (i >= $('.diapo', cache).length)
i = 0;
edit_clk_editimg(evt, i);
}
-function edit_select_all()
-{
+function edit_select_all() {
$('#EDIT_FILM2 .diapo', p4.edit.editBox).addClass('selected');
- for(i in p4.edit.T_records)
+ for (i in p4.edit.T_records)
p4.edit.T_records[i]._selected = true;
- p4.edit.lastClickId = 1 ;
+ p4.edit.lastClickId = 1;
updateEditSelectedRecords(null); // null : no evt available
}
@@ -676,89 +608,77 @@ function edit_select_all()
// ---------------------------------------------------------------------------
// on a clique sur une thumbnail
// ---------------------------------------------------------------------------
-function edit_clk_editimg(evt, i)
-{
- if(p4.edit.curField >= 0)
- {
- if(p4.edit.textareaIsDirty && edit_validField(evt, "ask_ok")==false)
+function edit_clk_editimg(evt, i) {
+ if (p4.edit.curField >= 0) {
+ if (p4.edit.textareaIsDirty && edit_validField(evt, "ask_ok") == false)
return;
}
// guideline : si on mousedown sur une selection, c'est qu'on risque de draguer, donc on ne desectionne pas
- if(evt && evt.type=="mousedown" && p4.edit.T_records[i]._selected)
+ if (evt && evt.type == "mousedown" && p4.edit.T_records[i]._selected)
return;
- if( evt && is_shift_key(evt) && p4.edit.lastClickId != null )
- {
+ if (evt && is_shift_key(evt) && p4.edit.lastClickId != null) {
// shift donc on sel du p4.edit.lastClickId a ici
var pos_from = p4.edit.T_pos[p4.edit.lastClickId];
- var pos_to = p4.edit.T_pos[i];
- if( pos_from > pos_to )
- {
- var tmp = pos_from;
+ var pos_to = p4.edit.T_pos[i];
+ if (pos_from > pos_to) {
+ var tmp = pos_from;
pos_from = pos_to;
- pos_to = tmp;
+ pos_to = tmp;
}
var pos;
- for(pos=pos_from; pos<=pos_to; pos++ )
- {
+ for (pos = pos_from; pos <= pos_to; pos++) {
var id = p4.edit.T_id[pos];
- if(!p4.edit.T_records[id]._selected) // toutes les fiches selectionnees
+ if (!p4.edit.T_records[id]._selected) // toutes les fiches selectionnees
{
p4.edit.T_records[id]._selected = true;
- $("#idEditDiapo_"+id, p4.edit.editBox).addClass('selected');
+ $("#idEditDiapo_" + id, p4.edit.editBox).addClass('selected');
}
}
}
- else
- {
- if( !evt || !is_ctrl_key(evt) )
- {
+ else {
+ if (!evt || !is_ctrl_key(evt)) {
// on deselectionne tout avant
var id;
- for(id in p4.edit.T_records)
- {
- if(p4.edit.T_records[id]._selected) // toutes les fiches selectionnees
+ for (id in p4.edit.T_records) {
+ if (p4.edit.T_records[id]._selected) // toutes les fiches selectionnees
{
p4.edit.T_records[id]._selected = false;
- $("#idEditDiapo_"+id, p4.edit.editBox).removeClass('selected');
+ $("#idEditDiapo_" + id, p4.edit.editBox).removeClass('selected');
}
}
}
- if(i >= 0)
- {
+ if (i >= 0) {
p4.edit.T_records[i]._selected = !p4.edit.T_records[i]._selected;
- if(p4.edit.T_records[i]._selected)
- $("#idEditDiapo_"+i, p4.edit.editBox).addClass('selected');
+ if (p4.edit.T_records[i]._selected)
+ $("#idEditDiapo_" + i, p4.edit.editBox).addClass('selected');
else
- $("#idEditDiapo_"+i, p4.edit.editBox).removeClass('selected');
+ $("#idEditDiapo_" + i, p4.edit.editBox).removeClass('selected');
}
}
$('#TH_Opreview .PNB10').empty();
var selected = $('#EDIT_FILM2 .diapo.selected');
- if(selected.length == 1)
- {
+ if (selected.length == 1) {
var r = selected.attr('id').split('_').pop();
previewEdit(r);
}
- p4.edit.lastClickId = i ;
+ p4.edit.lastClickId = i;
updateEditSelectedRecords(evt);
}
// ---------------------------------------------------------------------------
// on a clique sur une checkbow de status
// ---------------------------------------------------------------------------
-function edit_clkstatus(evt, bit, val)
-{
- var ck0 = $("#idCheckboxStatbit0_"+bit);
- var ck1 = $("#idCheckboxStatbit1_"+bit);
- switch(val)
- {
+function edit_clkstatus(evt, bit, val) {
+ var ck0 = $("#idCheckboxStatbit0_" + bit);
+ var ck1 = $("#idCheckboxStatbit1_" + bit);
+ switch (val) {
case 0:
ck0.attr('class', "gui_ckbox_1");
ck1.attr('class', "gui_ckbox_0");
@@ -769,11 +689,10 @@ function edit_clkstatus(evt, bit, val)
break;
}
var id;
- for(id in p4.edit.T_records)
- {
- if(p4.edit.T_records[id]._selected) // toutes les fiches selectionnees
+ for (id in p4.edit.T_records) {
+ if (p4.edit.T_records[id]._selected) // toutes les fiches selectionnees
{
- if($('#idEditDiapo_'+id).hasClass('nostatus'))
+ if ($('#idEditDiapo_' + id).hasClass('nostatus'))
continue;
p4.edit.T_records[id].statbits[bit].value = val;
@@ -782,31 +701,27 @@ function edit_clkstatus(evt, bit, val)
}
}
-function updateEditSelectedRecords(evt)
-{
+function updateEditSelectedRecords(evt) {
$(".editDiaButtons", p4.edit.editBox).hide();
- for(n in p4.edit.T_statbits) // tous les statusbits de la base
+ for (n in p4.edit.T_statbits) // tous les statusbits de la base
{
p4.edit.T_statbits[n]._value = "-1"; // val unknown
- for(i in p4.edit.T_records)
- {
- if(!p4.edit.T_records[i]._selected)
+ for (i in p4.edit.T_records) {
+ if (!p4.edit.T_records[i]._selected)
continue;
- if(p4.edit.T_records[i].statbits.length === 0)
+ if (p4.edit.T_records[i].statbits.length === 0)
continue;
- if(p4.edit.T_statbits[n]._value == "-1")
+ if (p4.edit.T_statbits[n]._value == "-1")
p4.edit.T_statbits[n]._value = p4.edit.T_records[i].statbits[n].value;
- else
- if(p4.edit.T_statbits[n]._value != p4.edit.T_records[i].statbits[n].value)
+ else if (p4.edit.T_statbits[n]._value != p4.edit.T_records[i].statbits[n].value)
p4.edit.T_statbits[n]._value = "2";
}
- var ck0 = $("#idCheckboxStatbit0_"+n);
- var ck1 = $("#idCheckboxStatbit1_"+n);
+ var ck0 = $("#idCheckboxStatbit0_" + n);
+ var ck1 = $("#idCheckboxStatbit1_" + n);
- switch(p4.edit.T_statbits[n]._value)
- {
+ switch (p4.edit.T_statbits[n]._value) {
case "0":
case 0:
ck0.removeClass('gui_ckbox_0 gui_ckbox_2').addClass("gui_ckbox_1");
@@ -829,86 +744,71 @@ function updateEditSelectedRecords(evt)
var status_box = $('#ZTextStatus');
$('.nostatus, .somestatus, .displaystatus', status_box).hide();
- if(nostatus == 0)
- {
+ if (nostatus == 0) {
$('.displaystatus', status_box).show();
}
- else
- {
+ else {
var yesstatus = $('.diapo.selected', p4.edit.editBox).length;
- if(nostatus == yesstatus)
- {
+ if (nostatus == yesstatus) {
$('.nostatus', status_box).show();
}
- else
- {
+ else {
$('.somestatus, .displaystatus', status_box).show();
}
}
// calcul des valeurs suggerees COMMUNES aux records (collections) selectionnes //
- for(f in p4.edit.T_fields) // tous les champs de la base
+ for (f in p4.edit.T_fields) // tous les champs de la base
p4.edit.T_fields[f]._sgval = [];
var t_lsgval = {};
var t_selcol = {}; // les bases (coll) dont au - une thumb est selectionnee
var ncolsel = 0;
var nrecsel = 0;
- for(i in p4.edit.T_records)
- {
- if(!p4.edit.T_records[i]._selected)
+ for (i in p4.edit.T_records) {
+ if (!p4.edit.T_records[i]._selected)
continue;
nrecsel++;
- var bid = "b"+p4.edit.T_records[i].bid;
- if(t_selcol[bid])
+ var bid = "b" + p4.edit.T_records[i].bid;
+ if (t_selcol[bid])
continue;
t_selcol[bid] = 1;
ncolsel++;
- for(f in p4.edit.T_sgval[bid])
- {
- if(!t_lsgval[f])
+ for (f in p4.edit.T_sgval[bid]) {
+ if (!t_lsgval[f])
t_lsgval[f] = {};
- for(ivs in p4.edit.T_sgval[bid][f])
- {
+ for (ivs in p4.edit.T_sgval[bid][f]) {
vs = p4.edit.T_sgval[bid][f][ivs];
- if(!t_lsgval[f][vs])
+ if (!t_lsgval[f][vs])
t_lsgval[f][vs] = 0;
t_lsgval[f][vs]++;
}
}
}
var t_sgval = {};
- for(f in t_lsgval)
- {
- for(sv in t_lsgval[f])
- {
- if(t_lsgval[f][sv] == ncolsel)
- {
- p4.edit.T_fields[f]._sgval.push( {
- label:sv,
- onclick: function(menuItem, menu, e, label)
- {
- if(p4.edit.T_fields[p4.edit.curField].multi)
- {
+ for (f in t_lsgval) {
+ for (sv in t_lsgval[f]) {
+ if (t_lsgval[f][sv] == ncolsel) {
+ p4.edit.T_fields[f]._sgval.push({
+ label: sv,
+ onclick: function (menuItem, menu, e, label) {
+ if (p4.edit.T_fields[p4.edit.curField].multi) {
$("#EditTextMultiValued", p4.edit.editBox).val(label);
$('#EditTextMultiValued').trigger('keyup.maxLength');
edit_addmval($('#EditTextMultiValued', p4.edit.editBox).val(), null);
}
- else
- {
- if(is_ctrl_key(e))
- {
+ else {
+ if (is_ctrl_key(e)) {
var t = $("#idEditZTextArea", p4.edit.editBox).val();
- $("#idEditZTextArea", p4.edit.editBox).val(t + (t?" ; ":"") + label);
+ $("#idEditZTextArea", p4.edit.editBox).val(t + (t ? " ; " : "") + label);
}
- else
- {
+ else {
$("#idEditZTextArea", p4.edit.editBox).val(label);
}
$('#idEditZTextArea').trigger('keyup.maxLength');
p4.edit.textareaIsDirty = true;
- if(p4.edit.T_fields[p4.edit.curField]._status != 2)
+ if (p4.edit.T_fields[p4.edit.curField]._status != 2)
edit_validField(evt, "ask_ok");
}
}
@@ -916,91 +816,77 @@ function updateEditSelectedRecords(evt)
);
}
}
- if(p4.edit.T_fields[f]._sgval.length > 0)
- {
- $("#editSGtri_"+f, p4.edit.editBox).css("visibility", "visible");
- $("#editSGtri_"+f, p4.edit.editBox).unbind();
- $("#editSGtri_"+f, p4.edit.editBox).contextMenu(
+ if (p4.edit.T_fields[f]._sgval.length > 0) {
+ $("#editSGtri_" + f, p4.edit.editBox).css("visibility", "visible");
+ $("#editSGtri_" + f, p4.edit.editBox).unbind();
+ $("#editSGtri_" + f, p4.edit.editBox).contextMenu(
p4.edit.T_fields[f]._sgval,
{
- theme:'vista',
- openEvt:"click",
- beforeShow:function(a,b,c,d)
- {
+ theme: 'vista',
+ openEvt: "click",
+ beforeShow: function (a, b, c, d) {
var fid = this.target.getAttribute('id').substr(10);
- if(!p4.edit.textareaIsDirty || edit_validField(null, "ask_ok")==true)
- {
+ if (!p4.edit.textareaIsDirty || edit_validField(null, "ask_ok") == true) {
editField(null, fid);
return(true);
}
- else
- {
+ else {
return(false);
}
}
}
);
}
- else
- {
- $("#editSGtri_"+f, p4.edit.editBox).css("visibility", "hidden");
+ else {
+ $("#editSGtri_" + f, p4.edit.editBox).css("visibility", "hidden");
}
}
- $('#idFrameE .ww_status', p4.edit.editBox).html( nrecsel + " record(s) selected for editing");
+ $('#idFrameE .ww_status', p4.edit.editBox).html(nrecsel + " record(s) selected for editing");
updateFieldDisplay();
- if(p4.edit.curField == -1)
+ if (p4.edit.curField == -1)
editStatus(evt);
else
editField(evt, p4.edit.curField);
}
-function updateFieldDisplay()
-{
- for(f in p4.edit.T_fields) // tous les champs de la base
+function updateFieldDisplay() {
+ for (f in p4.edit.T_fields) // tous les champs de la base
{
p4.edit.T_fields[f]._status = 0; // val unknown
- for(i in p4.edit.T_records)
- {
- if(!p4.edit.T_records[i]._selected)
+ for (i in p4.edit.T_records) {
+ if (!p4.edit.T_records[i]._selected)
continue;
- if(p4.edit.T_records[i].fields[f].isEmpty())
- {
+ if (p4.edit.T_records[i].fields[f].isEmpty()) {
var v = "";
}
- else
- {
+ else {
// le champ existe dans la fiche
- if(p4.edit.T_fields[f].multi)
- {
+ if (p4.edit.T_fields[f].multi) {
// champ multi : on compare la concat des valeurs
var v = p4.edit.T_records[i].fields[f].getSerializedValues()
}
- else
- {
+ else {
var v = p4.edit.T_records[i].fields[f].getValue().getValue();
}
}
- if(p4.edit.T_fields[f]._status == 0)
- {
- p4.edit.T_fields[f]._value = v;
+ if (p4.edit.T_fields[f]._status == 0) {
+ p4.edit.T_fields[f]._value = v;
p4.edit.T_fields[f]._status = 1;
}
- else if(p4.edit.T_fields[f]._status == 1 && p4.edit.T_fields[f]._value != v)
- {
- p4.edit.T_fields[f]._value = "*****";
+ else if (p4.edit.T_fields[f]._status == 1 && p4.edit.T_fields[f]._value != v) {
+ p4.edit.T_fields[f]._value = "*****";
p4.edit.T_fields[f]._status = 2;
break; // plus la peine de verifier le champ sur les autres records
}
}
- if(o = document.getElementById("idEditField_"+f))
- {
- if(p4.edit.T_fields[f]._status == 2) // mixed
+ if (o = document.getElementById("idEditField_" + f)) {
+ if (p4.edit.T_fields[f]._status == 2) // mixed
o.innerHTML = "xxxxx";
else
o.innerHTML = cleanTags(p4.edit.T_fields[f]._value).replace(/\n/gm, "¶ ");
@@ -1008,15 +894,14 @@ function updateFieldDisplay()
}
}
-function SortCompareMetas(a, b)
-{
- if(typeof(a) != 'object')
+function SortCompareMetas(a, b) {
+ if (typeof(a) != 'object')
return(-1);
- if(typeof(b) != 'object')
+ if (typeof(b) != 'object')
return(1);
var na = a.getValue().toUpperCase();
var nb = b.getValue().toUpperCase();
- if(na == nb)
+ if (na == nb)
return(0);
return(na < nb ? -1 : 1);
}
@@ -1024,75 +909,70 @@ function SortCompareMetas(a, b)
//---------------------------------------------------------------------
//nettoie
//---------------------------------------------------------------------
-function cleanTags(string)
-{
- var chars2replace = [ {
- f:"&",
- t:"&"
- }, {
- 'f':"<",
- 't':"<"
- }, {
- 'f':">",
- 't':">"
- } ];
- for(c in chars2replace)
- string = string.replace(RegExp(chars2replace[c].f,"g") ,chars2replace[c].t);
+function cleanTags(string) {
+ var chars2replace = [
+ {
+ f: "&",
+ t: "&"
+ },
+ {
+ 'f': "<",
+ 't': "<"
+ },
+ {
+ 'f': ">",
+ 't': ">"
+ }
+ ];
+ for (c in chars2replace)
+ string = string.replace(RegExp(chars2replace[c].f, "g"), chars2replace[c].t);
return string;
}
-function check_required(id_r, id_f)
-{
+function check_required(id_r, id_f) {
var required_fields = false;
- if(typeof id_r == 'undefined')
+ if (typeof id_r == 'undefined')
id_r = false;
- if(typeof id_f == 'undefined')
+ if (typeof id_f == 'undefined')
id_f = false;
- for(f in p4.edit.T_fields)
- {
- if(id_f !== false && f != id_f)
+ for (f in p4.edit.T_fields) {
+ if (id_f !== false && f != id_f)
continue;
var name = p4.edit.T_fields[f].name;
- if(!p4.edit.T_fields[f].required)
+ if (!p4.edit.T_fields[f].required)
continue;
- for(r in p4.edit.T_records)
- {
- if(id_r !== false && r != id_r)
+ for (r in p4.edit.T_records) {
+ if (id_r !== false && r != id_r)
continue;
- var elem = $('#idEditDiapo_'+r+' .require_alert');
+ var elem = $('#idEditDiapo_' + r + ' .require_alert');
elem.hide();
- if(!p4.edit.T_records[r].fields[f])
- {
+ if (!p4.edit.T_records[r].fields[f]) {
elem.show();
required_fields = true;
}
- else
- {
+ else {
var check_required = '';
// le champ existe dans la fiche
- if(p4.edit.T_fields[f].multi)
- {
+ if (p4.edit.T_fields[f].multi) {
// champ multi : on compare la concat des valeurs
check_required = $.trim(p4.edit.T_records[r].fields[f].getSerializedValues())
}
- else if(p4.edit.T_records[r].fields[f].getValue())
- {
+ else if (p4.edit.T_records[r].fields[f].getValue()) {
check_required = $.trim(p4.edit.T_records[r].fields[f].getValue().getValue());
}
- if(check_required == '')
- {
+ if (check_required == '') {
elem.show();
required_fields = true;
}
@@ -1106,20 +986,18 @@ function check_required(id_r, id_f)
// ----------------------------------------------------------------------------------
// on a clique sur le 'ok' general : save
// ----------------------------------------------------------------------------------
-function edit_applyMultiDesc(evt)
-{
+function edit_applyMultiDesc(evt) {
var sendorder = "";
var sendChuOrder = "";
var t = [];
- if(p4.edit.textareaIsDirty && edit_validField(evt, "ask_ok")==false)
+ if (p4.edit.textareaIsDirty && edit_validField(evt, "ask_ok") == false)
return(false);
var required_fields = check_required();
- if(required_fields)
- {
+ if (required_fields) {
alert(language.some_required_fields);
return;
}
@@ -1128,21 +1006,18 @@ function edit_applyMultiDesc(evt)
$("#EDIT_WORKING", p4.edit.editBox).show();
- for(r in p4.edit.T_records)
- {
+ for (r in p4.edit.T_records) {
var record_datas = {
- record_id : p4.edit.T_records[r].rid,
- metadatas : [],
- edit : 0,
- status : null
+ record_id: p4.edit.T_records[r].rid,
+ metadatas: [],
+ edit: 0,
+ status: null
};
var editDirty = false;
- for(f in p4.edit.T_records[r].fields)
- {
- if(!p4.edit.T_records[r].fields[f].isDirty())
- {
+ for (f in p4.edit.T_records[r].fields) {
+ if (!p4.edit.T_records[r].fields[f].isDirty()) {
continue;
}
@@ -1155,22 +1030,19 @@ function edit_applyMultiDesc(evt)
}
// les statbits
- var tsb = [];
- for(var n=0; n<64; n++)
+ var tsb = [];
+ for (var n = 0; n < 64; n++)
tsb[n] = 'x';
sb_dirty = false;
- for(var n in p4.edit.T_records[r].statbits)
- {
- if(p4.edit.T_records[r].statbits[n].dirty)
- {
- tsb[63-n] = p4.edit.T_records[r].statbits[n].value;
+ for (var n in p4.edit.T_records[r].statbits) {
+ if (p4.edit.T_records[r].statbits[n].dirty) {
+ tsb[63 - n] = p4.edit.T_records[r].statbits[n].value;
sb_dirty = true;
}
}
- if(sb_dirty || editDirty)
- {
- if(sb_dirty === true)
+ if (sb_dirty || editDirty) {
+ if (sb_dirty === true)
record_datas.status = tsb.join("");
t.push(record_datas);
@@ -1178,38 +1050,35 @@ function edit_applyMultiDesc(evt)
}
var options = {
- mds:t,
- sbid : p4.edit.sbas_id,
- act:'WORK',
- lst:$('#edit_lst').val(),
- act_option:'SAVE'+p4.edit.what,
- regbasprid:p4.edit.regbasprid,
+ mds: t,
+ sbid: p4.edit.sbas_id,
+ act: 'WORK',
+ lst: $('#edit_lst').val(),
+ act_option: 'SAVE' + p4.edit.what,
+ regbasprid: p4.edit.regbasprid,
// newrepresent:p4.edit.newrepresent,
- ssel:p4.edit.ssel
+ ssel: p4.edit.ssel
};
- if(p4.edit.newrepresent != false)
+ if (p4.edit.newrepresent != false)
options.newrepresent = p4.edit.newrepresent;
// options.mds = t;
$.ajax({
- url :"../prod/records/edit/apply/"
- ,
- data : options
+ url: "../prod/records/edit/apply/",
+ data: options
// ,dataType:'json'
,
- type:'POST'
- ,
- success : function(data){
- if(p4.edit.what == 'GRP' || p4.edit.what == 'SSEL')
- {
+ type: 'POST',
+ success: function (data) {
+ if (p4.edit.what == 'GRP' || p4.edit.what == 'SSEL') {
p4.WorkZone.refresh('current');
}
$("#Edit_copyPreset_dlg").remove();
$('#EDITWINDOW').hide();
hideOverlay(2);
- if(p4.preview.open)
+ if (p4.preview.open)
reloadPreview();
return;
}
@@ -1217,46 +1086,40 @@ function edit_applyMultiDesc(evt)
}
-function edit_cancelMultiDesc(evt)
-{
+function edit_cancelMultiDesc(evt) {
var dirty = false;
evt.cancelBubble = true;
- if(evt.stopPropagation)
+ if (evt.stopPropagation)
evt.stopPropagation();
- if(p4.edit.curField >= 0)
- {
- if(p4.edit.textareaIsDirty && edit_validField(evt, "ask_ok")==false)
+ if (p4.edit.curField >= 0) {
+ if (p4.edit.textareaIsDirty && edit_validField(evt, "ask_ok") == false)
return;
}
- for(r in p4.edit.T_records)
- {
- for(f in p4.edit.T_records[r].fields)
- {
- if( (dirty |= p4.edit.T_records[r].fields[f].isDirty()) )
+ for (r in p4.edit.T_records) {
+ for (f in p4.edit.T_records[r].fields) {
+ if ((dirty |= p4.edit.T_records[r].fields[f].isDirty()))
break;
}
- for(var n in p4.edit.T_records[r].statbits)
- {
- if( (dirty |= p4.edit.T_records[r].statbits[n].dirty) )
+ for (var n in p4.edit.T_records[r].statbits) {
+ if ((dirty |= p4.edit.T_records[r].statbits[n].dirty))
break;
}
}
- if(!dirty || confirm(language.confirm_abandon))
- {
+ if (!dirty || confirm(language.confirm_abandon)) {
$("#Edit_copyPreset_dlg").remove();
$('#idFrameE .ww_content', p4.edit.editBox).empty();
// on reaffiche tous les thesaurus
- for(i in p4.thesau.thlist) // tous les thesaurus
+ for (i in p4.thesau.thlist) // tous les thesaurus
{
var bid = p4.thesau.thlist[i].sbas_id;
- var e = document.getElementById('TH_T.'+bid+'.T');
- if(e)
+ var e = document.getElementById('TH_T.' + bid + '.T');
+ if (e)
e.style.display = "";
}
self.setTimeout("$('#EDITWINDOW').fadeOut();hideOverlay(2);", 100);
@@ -1271,14 +1134,12 @@ function edit_cancelMultiDesc(evt)
function edit_clickThesaurus(event) // onclick dans le thesaurus
{
// on cherche ou on a clique
- for(e=event.srcElement ? event.srcElement : event.target; e && ((!e.tagName) || (!e.id)); e=e.parentNode)
+ for (e = event.srcElement ? event.srcElement : event.target; e && ((!e.tagName) || (!e.id)); e = e.parentNode)
;
- if(e)
- {
- switch(e.id.substr(0,4))
- {
+ if (e) {
+ switch (e.id.substr(0, 4)) {
case "TH_P": // +/- de deploiement de mot
- js = "edit_thesaurus_ow('"+e.id.substr(5)+"')";
+ js = "edit_thesaurus_ow('" + e.id.substr(5) + "')";
self.setTimeout(js, 10);
break;
}
@@ -1288,24 +1149,19 @@ function edit_clickThesaurus(event) // onclick dans le thesaurus
function edit_dblclickThesaurus(event) // ondblclick dans le thesaurus
{
- for(e=event.srcElement ? event.srcElement : event.target; e && ((!e.tagName) || (!e.id)); e=e.parentNode)
+ for (e = event.srcElement ? event.srcElement : event.target; e && ((!e.tagName) || (!e.id)); e = e.parentNode)
;
- if(e)
- {
- switch(e.id.substr(0,4))
- {
+ if (e) {
+ switch (e.id.substr(0, 4)) {
case "TH_W":
- if(p4.edit.curField >= 0)
- {
+ if (p4.edit.curField >= 0) {
var w = $(e).text();
- if(p4.edit.T_fields[p4.edit.curField].multi)
- {
+ if (p4.edit.T_fields[p4.edit.curField].multi) {
$("#EditTextMultiValued", p4.edit.editBox).val(w);
$('#EditTextMultiValued').trigger('keyup.maxLength');
edit_addmval($('#EditTextMultiValued', p4.edit.editBox).val(), null);
}
- else
- {
+ else {
$("#idEditZTextArea", p4.edit.editBox).val(w);
$('#idEditZTextArea').trigger('keyup.maxLength');
p4.edit.textareaIsDirty = true;
@@ -1319,27 +1175,25 @@ function edit_dblclickThesaurus(event) // ondblclick dans le thesaurus
function edit_thesaurus_ow(id) // on ouvre ou ferme une branche de thesaurus
{
- var o = document.getElementById("TH_K."+id);
- if(o.className=="o")
- {
+ var o = document.getElementById("TH_K." + id);
+ if (o.className == "o") {
// on ferme
o.className = "c";
- document.getElementById("TH_P."+id).innerHTML = "+";
- document.getElementById("TH_K."+id).innerHTML = language.loading;
+ document.getElementById("TH_P." + id).innerHTML = "+";
+ document.getElementById("TH_K." + id).innerHTML = language.loading;
}
- else if(o.className=="c" || o.className=="h")
- {
+ else if (o.className == "c" || o.className == "h") {
// on ouvre
o.className = "o";
- document.getElementById("TH_P."+id).innerHTML = "-";
+ document.getElementById("TH_P." + id).innerHTML = "-";
var t_id = id.split(".");
var sbas_id = t_id[0];
t_id.shift();
var thid = t_id.join(".");
var url = "/xmlhttp/getterm_prod.x.php";
- var parms = "bid=" + sbas_id;
- parms += "&lng="+p4.lng;
+ var parms = "bid=" + sbas_id;
+ parms += "&lng=" + p4.lng;
parms += "&sortsy=1";
parms += "&id=" + thid;
parms += "&typ=TH";
@@ -1349,40 +1203,38 @@ function edit_thesaurus_ow(id) // on ouvre ou ferme une branche de thesaurus
return(false);
}
-function EditThesaurusSeeker(sbas_id)
-{
+function EditThesaurusSeeker(sbas_id) {
this.jq = null;
this.sbas_id = sbas_id;
- var zid = (""+sbas_id).replace(new RegExp("\\.", "g"), "\\.") + "\\.T";
+ var zid = ("" + sbas_id).replace(new RegExp("\\.", "g"), "\\.") + "\\.T";
this.TH_P_node = $("#TH_P\\." + zid, p4.edit.editBox);
this.TH_K_node = $("#TH_K\\." + zid, p4.edit.editBox);
this._ctimer = null;
- this.search = function(txt) {
- if(this._ctimer)
+ this.search = function (txt) {
+ if (this._ctimer)
clearTimeout(this._ctimer);
- var js = "ETHSeeker.search_delayed('"+txt.replace("'", "\\'")+"');" ;
+ var js = "ETHSeeker.search_delayed('" + txt.replace("'", "\\'") + "');";
this._ctimer = setTimeout(js, 125);
};
- this.search_delayed = function(txt) {
- if(this.jq && typeof this.jq.abort == "function")
- {
+ this.search_delayed = function (txt) {
+ if (this.jq && typeof this.jq.abort == "function") {
this.jq.abort();
this.jq = null;
}
txt = txt.replace("'", "\\'");
var url = "/xmlhttp/openbranches_prod.h.php";
- var parms = {
- bid:this.sbas_id,
- lng:p4.lng,
- t:txt,
- mod:"TREE",
- u:Math.random()
+ var parms = {
+ bid: this.sbas_id,
+ lng: p4.lng,
+ t: txt,
+ mod: "TREE",
+ u: Math.random()
};
var me = this;
@@ -1390,52 +1242,49 @@ function EditThesaurusSeeker(sbas_id)
this.jq = $.ajax({
url: url,
data: parms,
- type:'POST',
- success: function(ret)
- {
+ type: 'POST',
+ success: function (ret) {
me.TH_P_node.html("...");
me.TH_K_node.attr("class", "h").html(ret);
me.jq = null;
},
- error:function(){
+ error: function () {
},
- timeout:function(){
+ timeout: function () {
}
});
};
- this.openBranch = function(id, thid) {
- if(this.jq)
- {
+ this.openBranch = function (id, thid) {
+ if (this.jq) {
this.jq.abort();
this.jq = null;
}
var url = "/xmlhttp/getterm_prod.h.php";
- var parms = {
- bid:this.sbas_id,
- lng:p4.lng,
- sortsy:1,
- id:thid,
- typ:"TH"
- } ;
+ var parms = {
+ bid: this.sbas_id,
+ lng: p4.lng,
+ sortsy: 1,
+ id: thid,
+ typ: "TH"
+ };
var me = this;
this.jq = $.ajax({
url: url,
data: parms,
- success: function(ret)
- {
+ success: function (ret) {
var zid = "#TH_K\\." + id.replace(new RegExp("\\.", "g"), "\\."); // escape les '.' pour jquery
$(zid, p4.edit.editBox).html(ret);
me.jq = null;
},
- error:function(){
+ error: function () {
},
- timeout:function(){
+ timeout: function () {
}
});
@@ -1443,50 +1292,42 @@ function EditThesaurusSeeker(sbas_id)
}
-
-function replace()
-{
- var field = $("#EditSRField", p4.edit.editBox).val();
- var search = $("#EditSearch", p4.edit.editBox).val();
+function replace() {
+ var field = $("#EditSRField", p4.edit.editBox).val();
+ var search = $("#EditSearch", p4.edit.editBox).val();
var replace = $("#EditReplace", p4.edit.editBox).val();
- var where = $("[name=EditSR_Where]:checked", p4.edit.editBox).val();
- var commut = "";
- var rgxp = $("#EditSROptionRX", p4.edit.editBox).attr('checked') ? true : false;
+ var where = $("[name=EditSR_Where]:checked", p4.edit.editBox).val();
+ var commut = "";
+ var rgxp = $("#EditSROptionRX", p4.edit.editBox).attr('checked') ? true : false;
var r_search;
- if(rgxp)
- {
+ if (rgxp) {
r_search = search;
- commut = ($("#EditSR_RXG", p4.edit.editBox).attr('checked') ? "g" : "")
- + ($("#EditSR_RXI", p4.edit.editBox).attr('checked') ? "i" : "") ;
+ commut = ($("#EditSR_RXG", p4.edit.editBox).attr('checked') ? "g" : "")
+ + ($("#EditSR_RXI", p4.edit.editBox).attr('checked') ? "i" : "");
}
- else
- {
- commut = $("#EditSR_case", p4.edit.editBox).attr('checked') ? "g" : "gi";
+ else {
+ commut = $("#EditSR_case", p4.edit.editBox).attr('checked') ? "g" : "gi";
r_search = "";
- for(i=0; i 0 && zoomable.hasClass('zoomed'))
+ if (zoomable.length > 0 && zoomable.hasClass('zoomed'))
return;
// var datas = p4.edit.T_records[id].preview;
@@ -1712,14 +1518,13 @@ function setPreviewEdit()
// var h = parseInt(datas.height);
// var w = parseInt(datas.width);
// }
- var t=0;
+ var t = 0;
var de = 0;
var margX = 0;
var margY = 0;
- if($('img.record.record_audio', container).length > 0)
- {
+ if ($('img.record.record_audio', container).length > 0) {
var margY = 100;
de = 60;
}
@@ -1756,17 +1561,16 @@ function setPreviewEdit()
// }
t = Math.round((dheight - h - de) / 2);
var l = Math.round((dwidth - w) / 2);
- $('.record',container).css({
+ $('.record', container).css({
width: w,
height: h,
top: t,
left: l
- }).attr('width',w).attr('height',h);
+ }).attr('width', w).attr('height', h);
}
-function previewEdit(r)
-{
+function previewEdit(r) {
$('#TH_Opreview .PNB10').empty().append(p4.edit.T_records[r].preview);
@@ -1814,27 +1618,23 @@ function previewEdit(r)
// }
// }
- if($('img.PREVIEW_PIC.zoomable').length > 0)
- {
+ if ($('img.PREVIEW_PIC.zoomable').length > 0) {
$('img.PREVIEW_PIC.zoomable').draggable();
}
setPreviewEdit();
}
-function startThisEditing(sbas_id,what,regbasprid,ssel)
-{
+function startThisEditing(sbas_id, what, regbasprid, ssel) {
p4.edit.sbas_id = sbas_id;
p4.edit.what = what;
p4.edit.regbasprid = regbasprid;
p4.edit.ssel = ssel;
- for(r in p4.edit.T_records)
- {
+ for (r in p4.edit.T_records) {
var fields = {};
- for(f in p4.edit.T_records[r].fields)
- {
+ for (f in p4.edit.T_records[r].fields) {
var meta_struct_id = p4.edit.T_records[r].fields[f].meta_struct_id;
var name = p4.edit.T_fields[meta_struct_id].name;
@@ -1851,23 +1651,22 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
var vocabularyRestricted = p4.edit.T_fields[meta_struct_id].vocabularyRestricted;
var fieldOptions = {
- multi:multi,
- required:required,
- readonly:readonly,
- maxLength:maxLength,
- minLength:minLength,
- type:type,
- separator:separator,
- vocabularyControl:vocabularyControl,
- vocabularyRestricted:vocabularyRestricted
+ multi: multi,
+ required: required,
+ readonly: readonly,
+ maxLength: maxLength,
+ minLength: minLength,
+ type: type,
+ separator: separator,
+ vocabularyControl: vocabularyControl,
+ vocabularyRestricted: vocabularyRestricted
};
var databoxField = new p4.databoxField(name, label, meta_struct_id, fieldOptions);
var values = [];
- for(v in p4.edit.T_records[r].fields[f].values)
- {
+ for (v in p4.edit.T_records[r].fields[f].values) {
var meta_id = p4.edit.T_records[r].fields[f].values[v].meta_id;
var value = p4.edit.T_records[r].fields[f].values[v].value;
var vocabularyId = p4.edit.T_records[r].fields[f].values[v].vocabularyId;
@@ -1883,48 +1682,47 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
}
- $('#EditTextMultiValued').bind('keyup', function(){
+ $('#EditTextMultiValued').bind('keyup', function () {
reveal_mval($(this).val());
});
$('#EDIT_MID_R .tabs').tabs();
$('#divS div.edit_field:odd').addClass('odd');
- $('#divS div').bind('mouseover',function(){
+ $('#divS div').bind('mouseover',function () {
$(this).addClass('hover');
- }).bind('mouseout',function(){
+ }).bind('mouseout', function () {
$(this).removeClass('hover');
});
$('#editcontextwrap').remove();
- if($('#editcontextwrap').length == 0)
+ if ($('#editcontextwrap').length == 0)
$('body').append('');
self.setTimeout("edit_select_all();", 100);
$('.previewTips, .DCESTips, .fieldTips', p4.edit.editBox).tooltip({
- fixable:true,
- fixableIndex:1200
+ fixable: true,
+ fixableIndex: 1200
});
$('.infoTips', p4.edit.editBox).tooltip();
- if(p4.edit.what == 'GRP')
- {
+ if (p4.edit.what == 'GRP') {
$('#EDIT_FILM2 .reg_opts').show();
- $.each($('#EDIT_FILM2 .contextMenuTrigger'),function(){
+ $.each($('#EDIT_FILM2 .contextMenuTrigger'), function () {
- var id = $(this).attr('id').split('_').slice(1,3).join('_');
- $(this).contextMenu('#editContext_'+id+'',{
- appendTo:'#editcontextwrap',
- openEvt:'click',
- dropDown:true,
- theme:'vista',
- dropDown:true,
- showTransition:'slideDown',
- hideTransition:'hide',
- shadow:false
+ var id = $(this).attr('id').split('_').slice(1, 3).join('_');
+ $(this).contextMenu('#editContext_' + id + '', {
+ appendTo: '#editcontextwrap',
+ openEvt: 'click',
+ dropDown: true,
+ theme: 'vista',
+ dropDown: true,
+ showTransition: 'slideDown',
+ hideTransition: 'hide',
+ shadow: false
});
});
}
@@ -1934,13 +1732,13 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
vsplit1();
$('#EDIT_TOP', p4.edit.editBox).resizable({
- handles : 's',
- minHeight:100,
- resize:function(){
+ handles: 's',
+ minHeight: 100,
+ resize: function () {
hsplit1();
setPreviewEdit();
},
- stop:function(){
+ stop: function () {
hsplit1();
setPref('editing_top_box', Math.floor($('#EDIT_TOP').height() * 100 / $('#EDIT_ALL').height()) + '%');
setSizeLimits();
@@ -1948,13 +1746,13 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
});
$('#divS_wrapper', p4.edit.editBox).resizable({
- handles : 'e',
- minWidth:200,
- resize:function(){
+ handles: 'e',
+ minWidth: 200,
+ resize: function () {
vsplit1();
setPreviewEdit();
},
- stop:function(){
+ stop: function () {
setPref('editing_right_box', Math.floor($('#divS').width() * 100 / $('#EDIT_MID_L').width()) + '%');
vsplit1();
setSizeLimits();
@@ -1964,13 +1762,13 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
$('#EDIT_MID_R')
.css('left', $('#EDIT_MID_L').position().left + $('#EDIT_MID_L').width() + 15)
.resizable({
- handles : 'w',
- minWidth:200,
- resize:function(){
+ handles: 'w',
+ minWidth: 200,
+ resize: function () {
vsplit2();
setPreviewEdit();
},
- stop:function(){
+ stop: function () {
setPref('editing_left_box', Math.floor($('#EDIT_MID_R').width() * 100 / $('#EDIT_MID').width()) + '%');
vsplit2();
setSizeLimits();
@@ -1978,78 +1776,69 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
});
$('#EDIT_ZOOMSLIDER', p4.edit.editBox).slider({
- min:60,
- max:300,
- value:p4.edit.diapoSize,
- slide:function(event,ui)
- {
+ min: 60,
+ max: 300,
+ value: p4.edit.diapoSize,
+ slide: function (event, ui) {
var v = $(ui.value)[0];
$('#EDIT_FILM2 .diapo', p4.edit.editBox).width(v).height(v);
},
- change:function(event,ui)
- {
+ change: function (event, ui) {
p4.edit.diapoSize = $(ui.value)[0];
setPref("editing_images_size", p4.edit.diapoSize);
}
});
var buttons = {};
- buttons[language.valider] = function(e)
- {
+ buttons[language.valider] = function (e) {
$(this).dialog("close");
edit_applyMultiDesc(e);
};
- buttons[language.annuler] = function(e)
- {
+ buttons[language.annuler] = function (e) {
$(this).dialog("close");
edit_cancelMultiDesc(e);
};
$("#EDIT_CLOSEDIALOG", p4.edit.editBox).dialog({
autoOpen: false,
- closeOnEscape:true,
- resizable:false,
- draggable:false,
- modal:true,
+ closeOnEscape: true,
+ resizable: false,
+ draggable: false,
+ modal: true,
buttons: buttons
});
var buttons = {};
- buttons[language.valider] = function()
- {
+ buttons[language.valider] = function () {
var form = $("#Edit_copyPreset_dlg FORM");
var jtitle = $(".EDIT_presetTitle", form);
- if(jtitle.val() == '')
- {
+ if (jtitle.val() == '') {
alert(language.needTitle);
jtitle[0].focus();
return;
}
var p = {
- "act":"SAVE",
- "sbas":p4.edit.sbas_id,
- "title":jtitle.val(),
- "f":{}
+ "act": "SAVE",
+ "sbas": p4.edit.sbas_id,
+ "title": jtitle.val(),
+ "f": {}
};
var f = {};
var x = "";
$(":checkbox", form).each(
- function(idx, elem)
- {
- if(elem.checked)
- {
- var i = 0|elem.value;
+ function (idx, elem) {
+ if (elem.checked) {
+ var i = 0 | elem.value;
var f;
- if(p4.edit.T_fields[i].multi)
+ if (p4.edit.T_fields[i].multi)
f = p4.edit.T_fields[i]._value.split(";");
else
f = [ p4.edit.T_fields[i]._value ];
- for(j in f)
- {
- x += "<"+p4.edit.T_fields[i].name+">"
- + cleanTags(f[j])
- + ""+p4.edit.T_fields[i].name+">";
+ for (j in f) {
+ x += "<" + p4.edit.T_fields[i].name + ">"
+ + cleanTags(f[j])
+ + "" + p4.edit.T_fields[i].name + ">";
}
}
}
@@ -2063,8 +1852,7 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
url: "/xmlhttp/editing_presets.j.php",
data: p,
dataType: 'json',
- success: function(data, textStatus)
- {
+ success: function (data, textStatus) {
preset_paint(data);
if ($("#Edit_copyPreset_dlg").data("ui-dialog")) {
@@ -2073,40 +1861,37 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
}
});
};
- buttons[language.annuler] = function()
- {
+ buttons[language.annuler] = function () {
$(this).dialog("close");
};
$("#Edit_copyPreset_dlg", p4.edit.editBox).dialog({
- stack:true,
- closeOnEscape:true,
- resizable:false,
- draggable:false,
- autoOpen:false,
- modal:true,
- width:600,
- title:language.newPreset,
- close: function(event,ui) {
+ stack: true,
+ closeOnEscape: true,
+ resizable: false,
+ draggable: false,
+ autoOpen: false,
+ modal: true,
+ width: 600,
+ title: language.newPreset,
+ close: function (event, ui) {
$(this).dialog("widget").css("z-index", "auto");
},
- open:function(event, ui) {
+ open: function (event, ui) {
$(this).dialog("widget").css("z-index", "5000");
$(".EDIT_presetTitle")[0].focus();
},
- buttons:buttons
+ buttons: buttons
});
$('#idEditDateZone', p4.edit.editBox).datepicker({
changeYear: true,
- changeMonth:true,
+ changeMonth: true,
dateFormat: 'yy/mm/dd',
- onSelect: function(dateText, inst)
- {
+ onSelect: function (dateText, inst) {
var lval = $('#idEditZTextArea', p4.edit.editBox).val();
- if(lval != dateText)
- {
+ if (lval != dateText) {
fieldLastValue = lval;
$('#idEditZTextArea', p4.edit.editBox).val(dateText);
$('#idEditZTextArea').trigger('keyup.maxLength');
@@ -2121,43 +1906,39 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
setSizeLimits();
var p = {
- "act":"LIST",
- "sbas":p4.edit.sbas_id
+ "act": "LIST",
+ "sbas": p4.edit.sbas_id
};
$.getJSON(
"/xmlhttp/editing_presets.j.php",
p,
- function(data, textStatus)
- {
+ function (data, textStatus) {
preset_paint(data);
}
);
check_required();
- $('#TH_Opresets button.adder').bind('click', function(){
+ $('#TH_Opresets button.adder').bind('click', function () {
preset_copy();
});
- try{
+ try {
$('#divS .edit_field:first').trigger('mousedown');
}
- catch(err)
- {
+ catch (err) {
}
}
-
-function setRegDefault(n,record_id)
-{
+function setRegDefault(n, record_id) {
p4.edit.newrepresent = record_id;
- var src = $('#idEditDiapo_'+n).find('img.edit_IMGT').attr('src');
- var style = $('#idEditDiapo_'+n).find('img.edit_IMGT').attr('style');
+ var src = $('#idEditDiapo_' + n).find('img.edit_IMGT').attr('src');
+ var style = $('#idEditDiapo_' + n).find('img.edit_IMGT').attr('style');
- $('#EDIT_GRPDIAPO .edit_IMGT').attr('src',src).attr('style',style);
+ $('#EDIT_GRPDIAPO .edit_IMGT').attr('src', src).attr('style', style);
}
diff --git a/www/skins/prod/jquery.main-prod.js b/www/skins/prod/jquery.main-prod.js
index f495fd70a5..3077e9ee74 100644
--- a/www/skins/prod/jquery.main-prod.js
+++ b/www/skins/prod/jquery.main-prod.js
@@ -2,28 +2,28 @@ document.getElementById('loader_bar').style.width = '30%';
var p4 = p4 || {};
-var baskAjax,baskAjaxrunning;
+var baskAjax, baskAjaxrunning;
baskAjaxrunning = false;
-var answAjax,answAjaxrunning;
+var answAjax, answAjaxrunning;
answAjaxrunning = false;
-var searchAjax,searchAjaxRunning;
+var searchAjax, searchAjaxRunning;
searchAjaxRunning = false;
var language = {};
var bodySize = {
- x:0,
- y:0
+ x: 0,
+ y: 0
};
-function resizePreview(){
+function resizePreview() {
p4.preview.height = $('#PREVIEWIMGCONT').height();
p4.preview.width = $('#PREVIEWIMGCONT').width();
setPreview();
}
-function getHome(cas, page){
+function getHome(cas, page) {
- if(typeof(page) === 'undefined')
+ if (typeof(page) === 'undefined')
page = 0;
switch (cas) {
@@ -38,23 +38,23 @@ function getHome(cas, page){
data: {
page: page
},
- beforeSend: function(){
+ beforeSend: function () {
if (answAjaxrunning && answAjax.abort)
answAjax.abort();
- if(page === 0)
+ if (page === 0)
clearAnswers();
answAjaxrunning = true;
$('#answers').addClass('loading');
},
- error: function(){
+ error: function () {
answAjaxrunning = false;
$('#answers').removeClass('loading');
},
- timeout: function(){
+ timeout: function () {
answAjaxrunning = false;
$('#answers').removeClass('loading');
},
- success: function(data){
+ success: function (data) {
answAjaxrunning = false;
var answers = $('#answers');
@@ -67,11 +67,10 @@ function getHome(cas, page){
});
afterSearch();
- if(page > 0)
- {
+ if (page > 0) {
answers.stop().animate({
- scrollTop:answers.scrollTop()+answers.height()
- },700);
+ scrollTop: answers.scrollTop() + answers.height()
+ }, 700);
}
return;
}
@@ -86,22 +85,22 @@ function getHome(cas, page){
data: {
type: cas
},
- beforeSend: function(){
+ beforeSend: function () {
if (answAjaxrunning && answAjax.abort)
answAjax.abort();
clearAnswers();
answAjaxrunning = true;
$('#answers').addClass('loading');
},
- error: function(){
+ error: function () {
answAjaxrunning = false;
$('#answers').removeClass('loading');
},
- timeout: function(){
+ timeout: function () {
answAjaxrunning = false;
$('#answers').removeClass('loading');
},
- success: function(data){
+ success: function (data) {
answAjaxrunning = false;
$('#answers').append(data);
afterSearch();
@@ -117,71 +116,63 @@ function getHome(cas, page){
}
}
-function getLanguage(){
+function getLanguage() {
$.ajax({
type: "GET",
url: "../prod/language/",
dataType: 'json',
- success: function(data){
+ success: function (data) {
language = data;
return;
}
});
}
-function is_ctrl_key(event)
-{
- if(event.altKey)
+function is_ctrl_key(event) {
+ if (event.altKey)
return true;
- if(event.ctrlKey)
+ if (event.ctrlKey)
return true;
- if(event.metaKey) // apple key opera
+ 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;
}
-function is_shift_key(event)
-{
- if(event.shiftKey)
+function is_shift_key(event) {
+ if (event.shiftKey)
return true;
return false;
}
-
-
-function checkBases(bool)
-{
- $('form.phrasea_query .sbas_list').each(function(){
+function checkBases(bool) {
+ $('form.phrasea_query .sbas_list').each(function () {
var id = $(this).find('input[name=reference]:first').val();
- if(bool)
- $(this).find(':checkbox').attr('checked','checked');
+ if (bool)
+ $(this).find(':checkbox').attr('checked', 'checked');
else
$(this).find(':checkbox').removeAttr('checked');
infoSbas(false, id, true, false);
});
- if(bool)
- {
+ if (bool) {
$('.sbascont label').addClass('selected');
}
- else
- {
+ else {
$('.sbascont label').removeClass('selected');
}
checkFilters(true);
}
-function checkFilters(save)
-{
+function checkFilters(save) {
var danger = false;
var search = {
bases: {},
@@ -212,7 +203,7 @@ function checkFilters(save)
var nbSelectedColls = 0;
- $.each($('.sbascont', adv_box), function(){
+ $.each($('.sbascont', adv_box), function () {
var $this = $(this);
var sbas_id = $this.parent().find('input[name="reference"]').val();
@@ -220,19 +211,19 @@ function checkFilters(save)
var bas_ckbox = $this.find('.checkbas');
- if(bas_ckbox.filter(':not(:checked)').length > 0) {
+ if (bas_ckbox.filter(':not(:checked)').length > 0) {
danger = 'medium';
}
var checked = bas_ckbox.filter(':checked');
- if(checked.length>0) {
+ if (checked.length > 0) {
var sbas_fields = $('.field_' + sbas_id, container).removeClass("hidden");
sbas_fields.filter('option').show().filter('.was').removeClass('was').attr('selected', 'selected').selected(true);
- sbas_fields.filter(':checkbox').parent().show().find('.was').attr('checked','checked').removeClass('was');
+ sbas_fields.filter(':checkbox').parent().show().find('.was').attr('checked', 'checked').removeClass('was');
}
- checked.each(function(){
+ checked.each(function () {
nbSelectedColls++;
search.bases[sbas_id].push($(this).val());
});
@@ -246,84 +237,80 @@ function checkFilters(save)
var reset_field = false;
- $.each(search.fields, function(i,n){
- if(n === 'phraseanet--all--fields')
+ $.each(search.fields, function (i, n) {
+ if (n === 'phraseanet--all--fields')
reset_field = true;
});
- if(reset_field)
- {
+ if (reset_field) {
$('select[name="fields[]"] option:selected', container).removeAttr('selected').selected(false);
search.fields = new Array;
}
- if(!reset_field && search.fields.length>0)
- {
+ if (!reset_field && search.fields.length > 0) {
danger = true;
$('.field_filter', adv_box).addClass('danger');
}
- $('.status_filter :checkbox[checked]').each(function(){
+ $('.status_filter :checkbox[checked]').each(function () {
var n = $(this).attr('n');
search.status[n] = $(this).val().split('_');
danger = true;
- $('.status_filter', adv_box) .addClass('danger');
+ $('.status_filter', adv_box).addClass('danger');
});
- search.dates.minbound = $('.date_filter input[name=date_min]', adv_box).val();
- search.dates.maxbound = $('.date_filter input[name=date_max]', adv_box).val();
- search.dates.field = $('.date_filter select[name=date_field]', adv_box).val();
+ search.dates.minbound = $('.date_filter input[name=date_min]', adv_box).val();
+ search.dates.maxbound = $('.date_filter input[name=date_max]', adv_box).val();
+ search.dates.field = $('.date_filter select[name=date_field]', adv_box).val();
- if($.trim(search.dates.minbound) || $.trim(search.dates.maxbound))
- {
+ if ($.trim(search.dates.minbound) || $.trim(search.dates.maxbound)) {
danger = true;
$('.date_filter', adv_box).addClass('danger');
}
fieldsSelect.scrollTop(scroll);
- if(save===true)
- setPref('search',JSON.stringify(search));
+ 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');
}
-function toggleFilter(filter,ele)
-{
- var el = $('#'+filter);
- if(el.is(':hidden'))
+function toggleFilter(filter, ele) {
+ var el = $('#' + filter);
+ if (el.is(':hidden'))
$(ele).parent().addClass('open');
else
$(ele).parent().removeClass('open');
- $('#'+filter).slideToggle('fast');
+ $('#' + filter).slideToggle('fast');
}
-function setVisible(el){
+function setVisible(el) {
el.style.visibility = 'visible';
}
-function resize(){
+function resize() {
bodySize.y = $('#mainContainer').height();
bodySize.x = $('#mainContainer').width();
- if(false)
+ if (false)
$('.overlay').height(bodySize.y).width(bodySize.x);
var headBlockH = $('#headBlock').outerHeight();
- var bodyY = bodySize.y - headBlockH-2;
- var bodyW = bodySize.x-2;
+ var bodyY = bodySize.y - headBlockH - 2;
+ var bodyW = bodySize.x - 2;
//$('#desktop').height(bodyY).width(bodyW);
- if(p4.preview.open)
+ if (p4.preview.open)
resizePreview();
if ($('#idFrameC').data('ui-resizable')) {
- $('#idFrameC').resizable('option', 'maxWidth',(bodySize.x-670));
- $('#idFrameC').resizable('option', 'minWidth',265);
+ $('#idFrameC').resizable('option', 'maxWidth', (bodySize.x - 670));
+ $('#idFrameC').resizable('option', 'minWidth', 265);
}
answerSizer();
@@ -333,14 +320,13 @@ function resize(){
}
-function clearAnswers(){
+function clearAnswers() {
$('#formAnswerPage').val('');
$('#searchForm input[name="nba"]').val('');
$('#answers, #dyn_tool').empty();
}
-function reset_adv_search()
-{
+function reset_adv_search() {
$('#sbasfiltercont select[name="sort"]').val($('#sbasfiltercont select[name="sort"] option.default-selection').attr('value'));
$('#sbasfiltercont input:checkbox.field_switch').removeAttr('checked');
$('#sbasfiltercont .datepicker').val('');
@@ -348,14 +334,12 @@ function reset_adv_search()
checkBases(true);
}
-function search_doubles()
-{
+function search_doubles() {
$('#EDIT_query').val('sha256=sha256');
newSearch();
}
-function newSearch()
-{
+function newSearch() {
$('#proposals').empty();
p4.Results.Selection.empty();
@@ -363,12 +347,11 @@ function newSearch()
var val = $('#searchForm input[name="qry"]').val();
var histo = $('#history-queries ul');
- histo.prepend(''+val+'');
+ histo.prepend('' + val + '');
- var lis = $('li',histo);
- if(lis.length > 25)
- {
- $('li:last',histo).remove();
+ var lis = $('li', histo);
+ if (lis.length > 25) {
+ $('li:last', histo).remove();
}
$('#idFrameC li.proposals_WZ').removeClass('active');
@@ -377,8 +360,7 @@ function newSearch()
return false;
}
-function beforeSearch()
-{
+function beforeSearch() {
if (answAjaxrunning)
return;
answAjaxrunning = true;
@@ -391,77 +373,75 @@ function beforeSearch()
$('#answercontextwrap').remove();
}
-function afterSearch()
-{
- if($('#answercontextwrap').length === 0)
+function afterSearch() {
+ if ($('#answercontextwrap').length === 0)
$('body').append('');
- $.each($('#answers .contextMenuTrigger'),function(){
+ $.each($('#answers .contextMenuTrigger'), function () {
- var id = $(this).closest('.IMGT').attr('id').split('_').slice(1,3).join('_');
+ var id = $(this).closest('.IMGT').attr('id').split('_').slice(1, 3).join('_');
- $(this).contextMenu('#IMGT_'+id+' .answercontextmenu',{
- appendTo:'#answercontextwrap',
- openEvt:'click',
- dropDown:true,
- theme:'vista',
- showTransition:'slideDown',
- hideTransition:'hide',
- shadow:false
+ $(this).contextMenu('#IMGT_' + id + ' .answercontextmenu', {
+ appendTo: '#answercontextwrap',
+ openEvt: 'click',
+ dropDown: true,
+ theme: 'vista',
+ showTransition: 'slideDown',
+ hideTransition: 'hide',
+ shadow: false
});
});
answAjaxrunning = false;
$('#answers').removeClass('loading');
$('.captionTips, .captionRolloverTips, .infoTips').tooltip({
- delay:0
+ delay: 0
});
$('.previewTips').tooltip({
- fixable:true
+ fixable: true
});
$('.thumb .rollovable').hover(
- function(){
- $('.rollover-gif-hover',this).show();
- $('.rollover-gif-out',this).hide();
+ function () {
+ $('.rollover-gif-hover', this).show();
+ $('.rollover-gif-out', this).hide();
},
- function(){
- $('.rollover-gif-hover',this).hide();
- $('.rollover-gif-out',this).show();
+ function () {
+ $('.rollover-gif-hover', this).hide();
+ $('.rollover-gif-out', this).show();
}
);
viewNbSelect();
$('#answers div.IMGT').draggable({
- helper : function(){
- $('body').append(''+p4.Results.Selection.length()+' ');
+ helper: function () {
+ $('body').append('' + p4.Results.Selection.length() + ' ');
return $('#dragDropCursor');
},
- scope:"objects",
- distance : 20,
- scroll : false,
+ scope: "objects",
+ distance: 20,
+ scroll: false,
cursorAt: {
- top:-10,
- left:-20
+ top: -10,
+ left: -20
},
- start:function(event, ui)
- {
- if(!$(this).hasClass('selected'))
+ start: function (event, ui) {
+ if (!$(this).hasClass('selected'))
return false;
}
});
linearize();
}
-function initAnswerForm(){
+function initAnswerForm() {
var searchForm = $('#searchForm');
- $('button[type="submit"]', searchForm).bind('click', function(){
+ $('button[type="submit"]', searchForm).bind('click', function () {
newSearch();
$('searchForm').trigger('submit');
return false;
});
- searchForm.unbind('submit').bind('submit',function(){
+ searchForm.unbind('submit').bind('submit', function () {
var $this = $(this),
method = $this.attr('method') ? $this.attr('method') : 'POST';
@@ -470,21 +450,21 @@ function initAnswerForm(){
type: method,
url: $this.attr('action'),
data: $this.serialize(),
- dataType:'json',
- beforeSend: function(formData){
- if(answAjaxrunning && answAjax.abort)
+ dataType: 'json',
+ beforeSend: function (formData) {
+ if (answAjaxrunning && answAjax.abort)
answAjax.abort();
beforeSearch();
},
- error: function(){
+ error: function () {
answAjaxrunning = false;
$('#answers').removeClass('loading');
},
- timeout: function(){
+ timeout: function () {
answAjaxrunning = false;
$('#answers').removeClass('loading');
},
- success: function(datas){
+ success: function (datas) {
$('#answers').empty().append(datas.results).removeClass('loading');
@@ -495,12 +475,11 @@ function initAnswerForm(){
$('#tool_results').empty().append(datas.infos);
$('#tool_navigate').empty().append(datas.navigation);
- $.each(p4.Results.Selection.get(), function(i, el){
+ $.each(p4.Results.Selection.get(), function (i, el) {
$('#IMGT_' + el).addClass('selected');
});
- if(datas.phrasea_props && $.trim(datas.phrasea_props) !== '')
- {
+ if (datas.phrasea_props && $.trim(datas.phrasea_props) !== '') {
$('#proposals').empty().append(datas.phrasea_props);
$('#idFrameC li.proposals_WZ').addClass('active');
}
@@ -508,25 +487,21 @@ function initAnswerForm(){
p4.tot_options = datas.form;
p4.tot_query = datas.query;
- if(datas.next_page)
- {
- $("#NEXT_PAGE").bind('click',function(){
+ if (datas.next_page) {
+ $("#NEXT_PAGE").bind('click', function () {
gotopage(datas.next_page);
});
}
- else
- {
+ else {
$("#NEXT_PAGE").unbind('click');
}
- if(datas.prev_page)
- {
- $("#PREV_PAGE").bind('click',function(){
+ if (datas.prev_page) {
+ $("#PREV_PAGE").bind('click', function () {
gotopage(datas.prev_page);
});
}
- else
- {
+ else {
$("#PREV_PAGE").unbind('click');
}
@@ -535,107 +510,95 @@ function initAnswerForm(){
});
return false;
});
- if(searchForm.hasClass('triggerAfterInit'))
- {
+ if (searchForm.hasClass('triggerAfterInit')) {
searchForm.removeClass('triggerAfterInit').trigger('submit');
}
}
-function answerSizer()
-{
+function answerSizer() {
var el = $('#idFrameC').outerWidth();
- if(!$.support.cssFloat)
- {
+ if (!$.support.cssFloat) {
$('#idFrameC .insidebloc').width(el - 56);
}
- var widthA = Math.round(bodySize.x-el-10);
+ var widthA = Math.round(bodySize.x - el - 10);
$('#rightFrame').width(widthA);
}
-function linearize()
-{
+function linearize() {
var list = $('#answers .list');
- if(list.length>0)
- {
+ if (list.length > 0) {
var fllWidth = $('#answers').innerWidth();
fllWidth -= 16;
var stdWidth = 460;
- var diff=28;
- var n = Math.round(fllWidth/(stdWidth));
- var w = Math.floor(fllWidth/n)-diff;
- if(w<360 && n>1)
- w = Math.floor(fllWidth/(n-1))-diff;
+ var diff = 28;
+ var n = Math.round(fllWidth / (stdWidth));
+ var w = Math.floor(fllWidth / n) - diff;
+ if (w < 360 && n > 1)
+ w = Math.floor(fllWidth / (n - 1)) - diff;
$('#answers .list').width(w);
}
- else
- {
+ else {
var margin = 0;
var el = $('#answers .diapo:first');
var brdrWidth = el.css('border-width');
- var stdWidth = el.outerWidth()+10;
+ var stdWidth = el.outerWidth() + 10;
var fllWidth = $('#answers').innerWidth();
fllWidth -= 16;
- var n = Math.floor(fllWidth/(stdWidth));
+ var n = Math.floor(fllWidth / (stdWidth));
- margin = Math.floor((fllWidth % stdWidth)/(2*n));
- $('#answers .diapo').css('margin','5px '+(5+margin)+'px');
+ margin = Math.floor((fllWidth % stdWidth) / (2 * n));
+ $('#answers .diapo').css('margin', '5px ' + (5 + margin) + 'px');
}
}
-
-function initLook()
-{
+function initLook() {
$('#nperpage_slider').slider({
- value:parseInt($('#nperpage_value').val()),
- min:10,
- max:100,
- step:10,
- slide:function(event,ui){
+ value: parseInt($('#nperpage_value').val()),
+ min: 10,
+ max: 100,
+ step: 10,
+ slide: function (event, ui) {
$('#nperpage_value').val(ui.value);
},
- stop:function(event,ui){
- setPref('images_per_page',$('#nperpage_value').val());
+ stop: function (event, ui) {
+ setPref('images_per_page', $('#nperpage_value').val());
}
});
$('#sizeAns_slider').slider({
- value:parseInt($('#sizeAns_value').val()),
- min:90,
- max:270,
- step:10,
- slide:function(event,ui){
+ value: parseInt($('#sizeAns_value').val()),
+ min: 90,
+ max: 270,
+ step: 10,
+ slide: function (event, ui) {
$('#sizeAns_value').val(ui.value);
},
- stop:function(event,ui){
- setPref('images_size',$('#sizeAns_value').val());
+ stop: function (event, ui) {
+ setPref('images_size', $('#sizeAns_value').val());
}
});
}
-function acceptCgus(name,value)
-{
- setPref(name,value);
+function acceptCgus(name, value) {
+ setPref(name, value);
}
-function cancelCgus(id)
-{
+function cancelCgus(id) {
$.ajax({
type: "POST",
url: "../prod/TOU/deny/" + id + "/",
- dataType:'json',
- success: function(data){
- if(data.success)
- {
+ dataType: 'json',
+ success: function (data) {
+ if (data.success) {
alert(language.cgusRelog);
self.location.replace(self.location.href);
}
- else
- {
+ else {
humane.error(data.message);
}
}
@@ -643,73 +606,70 @@ function cancelCgus(id)
}
-function activateCgus()
-{
+function activateCgus() {
var $this = $('.cgu-dialog:first');
$this.dialog({
- autoOpen : true,
- closeOnEscape:false,
- draggable:false,
- modal:true,
- resizable:false,
- width:800,
- height:500,
- open:function() {
+ autoOpen: true,
+ closeOnEscape: false,
+ draggable: false,
+ modal: true,
+ resizable: false,
+ width: 800,
+ height: 500,
+ open: function () {
$this.parents(".ui-dialog:first").find(".ui-dialog-titlebar-close").remove();
- $('.cgus-accept',$(this)).bind('click',function(){
- acceptCgus($('.cgus-accept',$this).attr('id'),$('.cgus-accept',$this).attr('date'));
+ $('.cgus-accept', $(this)).bind('click', function () {
+ acceptCgus($('.cgus-accept', $this).attr('id'), $('.cgus-accept', $this).attr('date'));
$this.dialog('close').remove();
activateCgus();
});
- $('.cgus-cancel',$(this)).bind('click',function(){
- if(confirm(language.warningDenyCgus))
- {
- cancelCgus($('.cgus-cancel',$this).attr('id').split('_').pop());
+ $('.cgus-cancel', $(this)).bind('click', function () {
+ if (confirm(language.warningDenyCgus)) {
+ cancelCgus($('.cgus-cancel', $this).attr('id').split('_').pop());
}
});
}
});
}
-$(document).ready(function(){
+$(document).ready(function () {
humane.forceNew = true;
activateCgus();
});
-function triggerShortcuts()
-{
+function triggerShortcuts() {
- $('#keyboard-stop').bind('click', function(){
+ $('#keyboard-stop').bind('click', function () {
var display = $(this).get(0).checked ? '0' : '1';
- setPref('keyboard_infos',display);
+ setPref('keyboard_infos', display);
});
var buttons = {};
- buttons[language.fermer] = function() {
+ buttons[language.fermer] = function () {
$("#keyboard-dialog").dialog('close');
};
$('#keyboard-dialog').dialog({
- closeOnEscape:false,
- resizable:false,
- draggable:false,
- modal:true,
- width:600,
- height:400,
+ closeOnEscape: false,
+ resizable: false,
+ draggable: false,
+ modal: true,
+ width: 600,
+ height: 400,
overlay: {
backgroundColor: '#000',
opacity: 0.7
},
- open: function(event, ui) {
+ open: function (event, ui) {
$(this).dialog("widget").css("z-index", "1400");
},
- close : function(){
+ close: function () {
$(this).dialog("widget").css("z-index", "auto");
- if($('#keyboard-stop').get(0).checked) {
+ if ($('#keyboard-stop').get(0).checked) {
var dialog = $('#keyboard-dialog');
if (dialog.data("ui-dialog")) {
dialog.dialog('destroy');
@@ -717,20 +677,18 @@ function triggerShortcuts()
dialog.remove();
}
}
- }).dialog('option','buttons',buttons).dialog('open');
+ }).dialog('option', 'buttons', buttons).dialog('open');
$('#keyboard-dialog').scrollTop(0);
return false;
}
-function activeZoning()
-{
- $('#idFrameC, #rightFrame').bind('mousedown',function(event){
+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');
}
@@ -739,23 +697,23 @@ function activeZoning()
$('#rightFrame').trigger('mousedown');
}
-function RGBtoHex(R,G,B) {
- return toHex(R)+toHex(G)+toHex(B);
+function RGBtoHex(R, G, B) {
+ return toHex(R) + toHex(G) + toHex(B);
}
function toHex(N) {
if (N === null) return "00";
- N=parseInt(N);
+ N = parseInt(N);
if (N === 0 || isNaN(N)) return "00";
- N=Math.max(0,N);
- N=Math.min(N,255);
- N=Math.round(N);
- return "0123456789ABCDEF".charAt((N-N%16)/16)
- + "0123456789ABCDEF".charAt(N%16);
+ N = Math.max(0, N);
+ N = Math.min(N, 255);
+ N = Math.round(N);
+ return "0123456789ABCDEF".charAt((N - N % 16) / 16)
+ + "0123456789ABCDEF".charAt(N % 16);
}
function hsl2rgb(h, s, l) {
var m1, m2, hue;
var r, g, b;
- s /=100;
+ s /= 100;
l /= 100;
if (s === 0)
r = g = b = (l * 255);
@@ -766,9 +724,9 @@ function hsl2rgb(h, s, l) {
m2 = l + s - l * s;
m1 = l * 2 - m2;
hue = h / 360;
- r = HueToRgb(m1, m2, hue + 1/3);
+ r = HueToRgb(m1, m2, hue + 1 / 3);
g = HueToRgb(m1, m2, hue);
- b = HueToRgb(m1, m2, hue - 1/3);
+ b = HueToRgb(m1, m2, hue - 1 / 3);
}
return {
r: r,
@@ -789,22 +747,22 @@ function HueToRgb(m1, m2, hue) {
else if (2 * hue < 1)
v = m2;
else if (3 * hue < 2)
- v = m1 + (m2 - m1) * (2/3 - hue) * 6;
+ v = m1 + (m2 - m1) * (2 / 3 - hue) * 6;
else
v = m1;
return 255 * v;
}
-$(document).ready(function(){
+$(document).ready(function () {
- $('.adv_search_button').live('click', function(){
+ $('.adv_search_button').live('click', function () {
var searchForm = $('#searchForm');
var parent = searchForm.parent();
var options = {
- loading:false,
- closeCallback: function(dialog){
+ loading: false,
+ closeCallback: function (dialog) {
var datas = dialog.find('form.phrasea_query').appendTo(parent);//.clone();
@@ -820,7 +778,7 @@ $(document).ready(function(){
$dialog.getDomElement().find('.adv_options').show();
$dialog.getDomElement().find('.adv_trigger').hide();
- $dialog.getDomElement().find('form').bind('submit.conbo', function(){
+ $dialog.getDomElement().find('form').bind('submit.conbo', function () {
$(this).unbind('submit.conbo');
$dialog.Close();
return false;
@@ -830,12 +788,11 @@ $(document).ready(function(){
return false;
});
- $(document).bind('contextmenu', function(event){
+ $(document).bind('contextmenu', function (event) {
var targ;
if (event.target)
targ = event.target;
- else
- if (event.srcElement)
+ else if (event.srcElement)
targ = event.srcElement;
if (targ.nodeType === 3)// safari bug
targ = targ.parentNode;
@@ -843,30 +800,28 @@ $(document).ready(function(){
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).is(':checkbox'))
+ if (targ_name === 'input') {
+ if ($(targ).is(':checkbox'))
gogo = false;
}
return gogo;
});
- $('.basket_refresher').live('click', function(){
+ $('.basket_refresher').live('click', function () {
return p4.WorkZone.refresh('current');
return false;
});
$('#loader_bar').stop().animate({
- width:'70%'
- },450);
+ width: '70%'
+ }, 450);
p4.preview = {
- open:false,
- current:false
+ open: false,
+ current: false
};
p4.currentViewMode = 'classic';
p4.nbNoview = 0;
@@ -875,7 +830,7 @@ $(document).ready(function(){
p4.baskSel = [];
p4.edit = {};
p4.thesau = {
- tabs:null
+ tabs: null
};
p4.active_zone = false;
p4.next_bask_scroll = false;
@@ -883,23 +838,20 @@ $(document).ready(function(){
$('#backcolorpickerHolder').ColorPicker({
flat: true,
- color:'404040',
- livePreview:false,
- eventName:'mouseover',
- onSubmit: function(hsb, hex, rgb, el){
+ color: '404040',
+ livePreview: false,
+ eventName: 'mouseover',
+ onSubmit: function (hsb, hex, rgb, el) {
var back_hex = '';
var unactive = '';
-
- if(hsb.b >=50)
- {
+ if (hsb.b >= 50) {
back_hex = '000000';
var sim_b = 0.1 * hsb.b;
}
- else
- {
+ else {
back_hex = 'FFFFFF';
var sim_b = 100 - 0.1 * (100 - hsb.b);
@@ -908,7 +860,7 @@ $(document).ready(function(){
var sim_b = 0.1 * hsb.b;
var sim_rgb = hsl2rgb(hsb.h, hsb.s, sim_b);
- var sim_hex = RGBtoHex(sim_rgb.r,sim_rgb.g,sim_rgb.b);
+ var sim_hex = RGBtoHex(sim_rgb.r, sim_rgb.g, sim_rgb.b);
setPref('background-selection', hex);
setPref('background-selection-disabled', sim_hex);
@@ -917,30 +869,30 @@ $(document).ready(function(){
$('style[title=color_selection]').empty();
var datas = '.diapo.selected,#reorder_box .diapo.selected, #EDIT_ALL .diapo.selected, .list.selected, .list.selected .diapo' +
- '{'+
- ' COLOR: #'+back_hex+';'+
- ' BACKGROUND-COLOR: #'+hex+';'+
+ '{' +
+ ' COLOR: #' + back_hex + ';' +
+ ' BACKGROUND-COLOR: #' + hex + ';' +
'}';
$('style[title=color_selection]').empty().text(datas);
}
});
- $('#backcolorpickerHolder').find('.colorpicker_submit').append($('#backcolorpickerHolder .submiter')).bind('click',function(){
+ $('#backcolorpickerHolder').find('.colorpicker_submit').append($('#backcolorpickerHolder .submiter')).bind('click', function () {
$(this).highlight('#CCCCCC');
});
- $('#answers .see_more a').live('click', function(event){
+ $('#answers .see_more a').live('click', function (event) {
$see_more = $(this).closest('.see_more');
$see_more.addClass('loading');
});
- $('#answers .feed .entry').live('mouseover', function(){
+ $('#answers .feed .entry').live('mouseover', function () {
$(this).addClass('hover');
});
- $('#answers .feed .entry').live('mouseout', function(){
+ $('#answers .feed .entry').live('mouseout', function () {
$(this).removeClass('hover');
});
- $('a.ajax_answers').live('click', function(event){
+ $('a.ajax_answers').live('click', function (event) {
event.stopPropagation();
var $this = $(this);
@@ -948,23 +900,20 @@ $(document).ready(function(){
var no_scroll = $this.hasClass('no_scroll');
$.ajax({
- type:"GET",
- url : $this.attr('href'),
+ type: "GET",
+ url: $this.attr('href'),
dataType: 'html',
- success : function(data){
+ success: function (data) {
var $answers = $('#answers');
- if(!append)
- {
+ if (!append) {
$answers.empty();
- if(!no_scroll)
- {
+ if (!no_scroll) {
$answers.scrollTop(0);
}
$answers.append(data);
}
- else
- {
+ else {
$('.see_more.loading', $answers).remove();
$answers.append(data);
@@ -972,10 +921,9 @@ $(document).ready(function(){
container: $answers
});
- if(!no_scroll)
- {
+ if (!no_scroll) {
$answers.animate({
- 'scrollTop':($answers.scrollTop()+$answers.innerHeight()-80)
+ 'scrollTop': ($answers.scrollTop() + $answers.innerHeight() - 80)
});
}
}
@@ -987,24 +935,23 @@ $(document).ready(function(){
});
-
- $('a.subscribe_rss').live('click',function(event){
+ $('a.subscribe_rss').live('click', function (event) {
var $this = $(this);
- if(typeof(renew) === 'undefined')
+ if (typeof(renew) === 'undefined')
renew = 'false';
else
renew = renew ? 'true' : 'false';
var buttons = {};
- buttons[language.renewRss] = function() {
+ buttons[language.renewRss] = function () {
$this.trigger({
- type:'click',
- renew:true
+ type: 'click',
+ renew: true
});
};
- buttons[language.fermer] = function() {
+ buttons[language.fermer] = function () {
$('#DIALOG').empty().dialog('destroy');
};
@@ -1012,27 +959,26 @@ $(document).ready(function(){
var $this = $(this);
$.ajax({
- type:"GET",
- url : $this.attr('href')+(event.renew === true ? '?renew=true' : ''),
+ type: "GET",
+ url: $this.attr('href') + (event.renew === true ? '?renew=true' : ''),
dataType: 'json',
- success : function(data){
- if(data.texte !== false && data.titre !== false)
- {
+ success: function (data) {
+ if (data.texte !== false && data.titre !== false) {
if ($("#DIALOG").data("ui-dialog")) {
$("#DIALOG").dialog('destroy');
}
- $("#DIALOG").attr('title',data.titre)
+ $("#DIALOG").attr('title', data.titre)
.empty()
.append(data.texte)
.dialog({
- autoOpen:false,
- closeOnEscape:true,
- resizable:false,
- draggable:false,
- modal:true,
- buttons:buttons,
- width:650,
- height:250,
+ autoOpen: false,
+ closeOnEscape: true,
+ resizable: false,
+ draggable: false,
+ modal: true,
+ buttons: buttons,
+ width: 650,
+ height: 250,
overlay: {
backgroundColor: '#000',
opacity: 0.7
@@ -1046,13 +992,13 @@ $(document).ready(function(){
return false;
});
- $('#search_submit').live('mousedown',function(event){
+ $('#search_submit').live('mousedown', function (event) {
return false;
});
- $('#history-queries ul li').live('mouseover',function(){
+ $('#history-queries ul li').live('mouseover',function () {
$(this).addClass('hover');
- }).live('mouseout',function(){
+ }).live('mouseout', function () {
$(this).removeClass('hover');
});
@@ -1061,44 +1007,43 @@ $(document).ready(function(){
activeZoning();
- $('.shortcuts-trigger').bind('click',function(){
+ $('.shortcuts-trigger').bind('click', function () {
triggerShortcuts();
});
$('#idFrameC').resizable({
- handles : 'e',
- resize:function(){
+ handles: 'e',
+ resize: function () {
answerSizer();
linearize();
},
- stop:function(){
+ stop: function () {
var el = $('.SSTT.active').next().find('div:first');
var w = el.find('div.chim-wrapper:first').outerWidth();
var iw = el.innerWidth();
- var diff = $('#idFrameC').width() - el.outerWidth();
- var n = Math.floor(iw/w);
+ var diff = $('#idFrameC').width() - el.outerWidth();
+ var n = Math.floor(iw / w);
$('#idFrameC').height('auto');
- var nwidth = (n)*w+diff+n;
- if(isNaN(nwidth))
- {
+ var nwidth = (n) * w + diff + n;
+ if (isNaN(nwidth)) {
saveWindows();
return;
}
- if(nwidth<265)
+ if (nwidth < 265)
nwidth = 265;
- if(el.find('div.chim-wrapper:first').hasClass('valid') && nwidth<410)
+ if (el.find('div.chim-wrapper:first').hasClass('valid') && nwidth < 410)
nwidth = 410;
$('#idFrameC').stop().animate({
- width : nwidth
+ width: nwidth
},
300,
'linear',
- function(){
+ function () {
answerSizer();
linearize();
saveWindows();
@@ -1106,7 +1051,7 @@ $(document).ready(function(){
}
});
- $('#idFrameC .escamote').bind('click', function(event){
+ $('#idFrameC .escamote').bind('click', function (event) {
event.stopImmediatePropagation();
p4.WorkZone.close();
return false;
@@ -1116,20 +1061,20 @@ $(document).ready(function(){
resize();
- $(window).bind('resize', function(){
+ $(window).bind('resize', function () {
resize();
});
$('body').append('');
$('body').append('');
- $('#basket_menu_trigger').contextMenu('#basket_menu',{
- openEvt:'click',
- dropDown:true,
- theme:'vista',
- showTransition:'slideDown',
- hideTransition:'hide',
- shadow:false
+ $('#basket_menu_trigger').contextMenu('#basket_menu', {
+ openEvt: 'click',
+ dropDown: true,
+ theme: 'vista',
+ showTransition: 'slideDown',
+ hideTransition: 'hide',
+ shadow: false
});
$('#basket_menu_trigger').trigger("click");
@@ -1137,41 +1082,39 @@ $(document).ready(function(){
$('.datepicker').datepicker({
changeYear: true,
- changeMonth:true,
- dateFormat:'yy/mm/dd'
+ changeMonth: true,
+ dateFormat: 'yy/mm/dd'
});
$.ajaxSetup({
- error: function(jqXHR, textStatus, errorThrown) {
+ error: function (jqXHR, textStatus, errorThrown) {
//Request is aborted
if (errorThrown === 'abort') {
return false;
} else {
- showModal('error',{
+ showModal('error', {
title: language.errorAjaxRequest + ' ' + jqXHR.responseText
});
}
},
- timeout: function(){
- showModal('timeout',{
- title:'Server not responding'
+ timeout: function () {
+ showModal('timeout', {
+ title: 'Server not responding'
});
}
});
- $('.tools .answer_selector').bind('click',function(){
+ $('.tools .answer_selector').bind('click',function () {
selector($(this));
- }).bind('mouseover',function(event){
- if(is_ctrl_key(event))
- {
+ }).bind('mouseover',function (event) {
+ if (is_ctrl_key(event)) {
$(this).addClass('add_selector');
}
- else
- {
+ else {
$(this).removeClass('add_selector');
}
- }).bind('mouseout',function(){
+ }).bind('mouseout', function () {
$(this).removeClass('add_selector');
});
@@ -1185,27 +1128,21 @@ $(document).ready(function(){
setTimeout("sessionactive();", 30000);
- $(this).bind('keydown',function(event)
- {
+ $(this).bind('keydown', function (event) {
var cancelKey = false;
var shortCut = false;
- if ($('#MODALDL').is(':visible'))
- {
- switch(event.keyCode)
- {
+ if ($('#MODALDL').is(':visible')) {
+ switch (event.keyCode) {
case 27:
hideDwnl();
break;
}
}
- else
- {
- if($('#EDITWINDOW').is(':visible'))
- {
+ else {
+ if ($('#EDITWINDOW').is(':visible')) {
- switch(event.keyCode)
- {
+ switch (event.keyCode) {
case 9: // tab ou shift-tab
edit_chgFld(event, is_shift_key(event) ? -1 : 1);
cancelKey = shortCut = true;
@@ -1216,25 +1153,22 @@ $(document).ready(function(){
break;
case 33: // pg up
- if(!p4.edit.textareaIsDirty || edit_validField(event, "ask_ok"))
+ 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"))
+ if (!p4.edit.textareaIsDirty || edit_validField(event, "ask_ok"))
skipImage(event, -1);
cancelKey = true;
break;
}
}
- else
- {
- if(p4.preview.open)
- {
+ else {
+ if (p4.preview.open) {
if (($('#dialog_dwnl:visible').length === 0 && $('#DIALOG1').length === 0 && $('#DIALOG2').length === 0)) {
- switch(event.keyCode)
- {
+ switch (event.keyCode) {
case 39:
getNext();
cancelKey = shortCut = true;
@@ -1247,7 +1181,7 @@ $(document).ready(function(){
closePreview();
break;
case 32:
- if(p4.slideShow)
+ if (p4.slideShow)
stopSlide();
else
startSlide();
@@ -1256,49 +1190,43 @@ $(document).ready(function(){
}
}
}
- else
- {
- if($('#EDIT_query').hasClass('focused'))
+ else {
+ if ($('#EDIT_query').hasClass('focused'))
return true;
- if($('.overlay').is(':visible'))
+ if ($('.overlay').is(':visible'))
return true;
- if($('.ui-widget-overlay').is(':visible'))
+ if ($('.ui-widget-overlay').is(':visible'))
return true;
- switch(p4.active_zone)
- {
+ switch (p4.active_zone) {
case 'rightFrame':
- switch(event.keyCode)
- {
+ switch (event.keyCode) {
case 65: // a
- if(is_ctrl_key(event))
- {
+ if (is_ctrl_key(event)) {
$('.tools .answer_selector.all_selector').trigger('click');
cancelKey = shortCut = true;
}
break;
case 80://P
- if(is_ctrl_key(event))
- {
- printThis("lst="+p4.Results.Selection.serialize());
+ if (is_ctrl_key(event)) {
+ printThis("lst=" + p4.Results.Selection.serialize());
cancelKey = shortCut = true;
}
break;
case 69://e
- if(is_ctrl_key(event))
- {
- editThis('IMGT',p4.Results.Selection.serialize());
+ if (is_ctrl_key(event)) {
+ editThis('IMGT', p4.Results.Selection.serialize());
cancelKey = shortCut = true;
}
break;
case 40: // down arrow
- $('#answers').scrollTop($('#answers').scrollTop()+30);
+ $('#answers').scrollTop($('#answers').scrollTop() + 30);
cancelKey = shortCut = true;
break;
case 38: // down arrow
- $('#answers').scrollTop($('#answers').scrollTop()-30);
+ $('#answers').scrollTop($('#answers').scrollTop() - 30);
cancelKey = shortCut = true;
break;
case 37://previous page
@@ -1310,8 +1238,7 @@ $(document).ready(function(){
shortCut = true;
break;
case 9://tab
- if(!is_ctrl_key(event) && !$('.ui-widget-overlay').is(':visible') && !$('.overlay_box').is(':visible'))
- {
+ if (!is_ctrl_key(event) && !$('.ui-widget-overlay').is(':visible') && !$('.overlay_box').is(':visible')) {
document.getElementById('EDIT_query').focus();
cancelKey = shortCut = true;
}
@@ -1321,26 +1248,22 @@ $(document).ready(function(){
case 'idFrameC':
- switch(event.keyCode)
- {
+ switch (event.keyCode) {
case 65: // a
- if(is_ctrl_key(event))
- {
+ if (is_ctrl_key(event)) {
p4.WorkZone.Selection.selectAll();
cancelKey = shortCut = true;
}
break;
case 80://P
- if(is_ctrl_key(event))
- {
- printThis("lst="+p4.WorkZone.Selection.serialize());
+ if (is_ctrl_key(event)) {
+ printThis("lst=" + p4.WorkZone.Selection.serialize());
cancelKey = shortCut = true;
}
break;
case 69://e
- if(is_ctrl_key(event))
- {
- editThis('IMGT',p4.WorkZone.Selection.serialize());
+ if (is_ctrl_key(event)) {
+ editThis('IMGT', p4.WorkZone.Selection.serialize());
cancelKey = shortCut = true;
}
break;
@@ -1349,11 +1272,11 @@ $(document).ready(function(){
// cancelKey = true;
// break;
case 40: // down arrow
- $('#baskets div.bloc').scrollTop($('#baskets div.bloc').scrollTop()+30);
+ $('#baskets div.bloc').scrollTop($('#baskets div.bloc').scrollTop() + 30);
cancelKey = shortCut = true;
break;
case 38: // down arrow
- $('#baskets div.bloc').scrollTop($('#baskets div.bloc').scrollTop()-30);
+ $('#baskets div.bloc').scrollTop($('#baskets div.bloc').scrollTop() - 30);
cancelKey = shortCut = true;
break;
// case 37://previous page
@@ -1363,8 +1286,7 @@ $(document).ready(function(){
// $('#NEXT_PAGE').trigger('click');
// break;
case 9://tab
- if(!is_ctrl_key(event) && !$('.ui-widget-overlay').is(':visible') && !$('.overlay_box').is(':visible'))
- {
+ if (!is_ctrl_key(event) && !$('.ui-widget-overlay').is(':visible') && !$('.overlay_box').is(':visible')) {
document.getElementById('EDIT_query').focus();
cancelKey = shortCut = true;
}
@@ -1388,18 +1310,15 @@ $(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)
- {
+ if ($('#keyboard-dialog.auto').length > 0 && shortCut) {
triggerShortcuts();
}
}
- if(cancelKey)
- {
+ if (cancelKey) {
event.cancelBubble = true;
- if(event.stopPropagation)
+ if (event.stopPropagation)
event.stopPropagation();
return(false);
}
@@ -1407,10 +1326,9 @@ $(document).ready(function(){
});
-
- $('#EDIT_query').bind('focus',function(){
+ $('#EDIT_query').bind('focus',function () {
$(this).addClass('focused');
- }).bind('blur',function(){
+ }).bind('blur', function () {
$(this).removeClass('focused');
});
@@ -1419,8 +1337,8 @@ $(document).ready(function(){
});
$('#idFrameC .tabs').tabs({
- activate: function(event, ui){
- if(ui.newTab.context.hash == "#thesaurus_tab") {
+ activate: function (event, ui) {
+ if (ui.newTab.context.hash == "#thesaurus_tab") {
thesau_show();
}
p4.WorkZone.open();
@@ -1428,12 +1346,11 @@ $(document).ready(function(){
});
$('#PREVIEWBOX .gui_vsplitter', p4.edit.editBox).draggable({
- axis:'x',
- containment:'parent',
- drag:function(event,ui){
+ axis: 'x',
+ containment: 'parent',
+ drag: function (event, ui) {
var x = $(ui.position.left)[0];
- if(x<330 || x>(bodySize.x-400))
- {
+ if (x < 330 || x > (bodySize.x - 400)) {
return false;
}
var v = $(ui.position.left)[0];
@@ -1443,44 +1360,43 @@ $(document).ready(function(){
}
});
- $('input.input_select_copy').live('focus', function(){
+ $('input.input_select_copy').live('focus', function () {
$(this).select();
});
- $('input.input_select_copy').live('blur', function(){
+ $('input.input_select_copy').live('blur', function () {
$(this).deselect();
});
- $('input.input_select_copy').live('click', function(){
+ $('input.input_select_copy').live('click', function () {
$(this).select();
});
- $('#answers .feed .entry a.options').live('click', function(){
+ $('#answers .feed .entry a.options').live('click', function () {
var $this = $(this);
$.ajax({
- type:"GET",
- url : $this.attr('href'),
+ type: "GET",
+ url: $this.attr('href'),
dataType: 'html',
- success : function(data){
+ success: function (data) {
return set_up_feed_box(data);
}
});
return false;
});
- $('#answers .feed .entry a.feed_delete').live('click', function(){
- if(!confirm('etes vous sur de vouloir supprimer cette entree ?'))
+ $('#answers .feed .entry a.feed_delete').live('click', function () {
+ if (!confirm('etes vous sur de vouloir supprimer cette entree ?'))
return false;
var $this = $(this);
$.ajax({
- type:"POST",
- url : $this.attr('href'),
+ type: "POST",
+ url: $this.attr('href'),
dataType: 'json',
- success : function(data){
- if(data.error === false)
- {
+ success: function (data) {
+ if (data.error === false) {
var $entry = $this.closest('.entry');
$entry.animate({
- height:0,
- opacity:0
- }, function(){
+ height: 0,
+ opacity: 0
+ }, function () {
$entry.remove();
});
}
@@ -1493,9 +1409,9 @@ $(document).ready(function(){
$('#loader_bar').stop().animate({
- width:'100%'
- }, 450, function(){
- $('#loader').parent().fadeOut('slow',function(){
+ width: '100%'
+ }, 450, function () {
+ $('#loader').parent().fadeOut('slow', function () {
$(this).remove();
});
});
@@ -1504,8 +1420,7 @@ $(document).ready(function(){
});
-function editThis(type,value)
-{
+function editThis(type, value) {
$('#idFrameE').empty().addClass('loading');
showOverlay(2);
@@ -1513,12 +1428,12 @@ function editThis(type,value)
$('#EDITWINDOW').show();
var options = {
- lst:'',
- ssel:'',
- act:''
+ lst: '',
+ ssel: '',
+ act: ''
};
- switch(type){
+ switch (type) {
case "IMGT":
options.lst = value;
break;
@@ -1537,14 +1452,14 @@ function editThis(type,value)
type: "POST",
dataType: "html",
data: options,
- success: function(data){
+ success: function (data) {
initializeEdit();
$('#idFrameE').removeClass('loading').empty().html(data);
$('#tooltip').hide();
return;
},
- error: function(XHR, textStatus, errorThrown){
- if(XHR.status === 0){
+ error: function (XHR, textStatus, errorThrown) {
+ if (XHR.status === 0) {
return false;
}
}
@@ -1553,60 +1468,57 @@ function editThis(type,value)
return;
}
-(function($) {
+(function ($) {
$.fn.extend({
- highlight: function(color) {
- if($(this).hasClass('animating'))
- {
+ highlight: function (color) {
+ if ($(this).hasClass('animating')) {
return;
}
color = typeof color !== 'undefined' ? color : 'red';
var oldColor = $(this).css('backgroundColor');
return $(this).addClass('animating').stop().animate({
backgroundColor: color
- }, 50, 'linear', function(){
+ }, 50, 'linear', function () {
$(this).stop().animate({
backgroundColor: oldColor
- }, 450, 'linear',function(){
+ }, 450, 'linear', function () {
$(this).removeClass('animating');
- } );
+ });
});
}
});
})(jQuery);
-(function($) {
+(function ($) {
$.fn.extend({
- flash: function(color) {
- if($(this).hasClass('animating'))
- {
+ flash: function (color) {
+ if ($(this).hasClass('animating')) {
return true;
}
color = typeof color !== 'undefined' ? color : 'red';
var pos = $(this).offset();
- if(!pos)
- {
+ if (!pos) {
pos = {
- top:0,
- left:0
+ top: 0,
+ left: 0
};
}
var h = $(this).height();
var w = $(this).width();
- $('body').append('');
+ $('body').append('');
$(this).addClass('animating');
var el = $(this);
$('#flashing').stop().animate({
- top:(pos.top+(h/4)),
- left:(pos.left+(w/4)),
- opacity:0,
- width:($(this).width()/2),
- height:($(this).height()/2)
- },700,function(){
+ top: (pos.top + (h / 4)),
+ left: (pos.left + (w / 4)),
+ opacity: 0,
+ width: ($(this).width() / 2),
+ height: ($(this).height() / 2)
+ }, 700, function () {
$('#flashing').remove();
$(el).removeClass('animating');
});
@@ -1615,25 +1527,21 @@ function editThis(type,value)
})(jQuery);
-function toggleRemoveReg(el)
-{
+function toggleRemoveReg(el) {
var state = !el.checked;
- setPref('reg_delete', (state?'1':'0'));
+ setPref('reg_delete', (state ? '1' : '0'));
p4.reg_delete = state;
}
-
-
-function deleteThis(lst)
-{
- if(lst.split(';').length === 0 ) {
+function deleteThis(lst) {
+ if (lst.split(';').length === 0) {
alert(language.nodocselected);
return false;
}
var $dialog = p4.Dialog.Create({
- size:'Small',
+ size: 'Small',
title: language.deleteRecords
});
@@ -1642,7 +1550,7 @@ function deleteThis(lst)
url: "../prod/records/delete/what/",
dataType: 'html',
data: {lst: lst},
- success: function(data){
+ success: function (data) {
$dialog.setContent(data);
}
});
@@ -1650,69 +1558,66 @@ function deleteThis(lst)
return false;
}
-function chgCollThis(datas)
-{
+function chgCollThis(datas) {
$dialog = p4.Dialog.Create({
- size:'Small',
+ size: 'Small',
title: language.move,
- closeButton:true
+ closeButton: true
});
$.ajax({
type: "POST",
url: "../prod/records/movecollection/",
data: datas,
- success: function(data){
+ success: function (data) {
$dialog.setContent(data);
}
});
}
-function pushThis(sstt_id, lst, story)
-{
+function pushThis(sstt_id, lst, story) {
$dialog = p4.Dialog.Create({
- size:'Full',
- title:language.push
+ size: 'Full',
+ title: language.push
});
$.post("../prod/push/sendform/", {
- lst : lst,
- ssel : sstt_id,
- story : story
- }, function(data){
+ lst: lst,
+ ssel: sstt_id,
+ story: story
+ }, function (data) {
$dialog.setContent(data);
return;
});
}
-function feedbackThis(sstt_id, lst, story)
-{
+function feedbackThis(sstt_id, lst, story) {
/* disable push closeonescape as an over dialog may exist (add user) */
$dialog = p4.Dialog.Create({
- size:'Full',
- title:language.feedback
+ size: 'Full',
+ title: language.feedback
});
$.post("../prod/push/validateform/", {
- lst : lst,
- ssel : sstt_id,
- story : story
- }, function(data){
+ lst: lst,
+ ssel: sstt_id,
+ story: story
+ }, function (data) {
$dialog.setContent(data);
return;
});
}
-function toolREFACTOR(datas){
+function toolREFACTOR(datas) {
var dialog = p4.Dialog.Create({
- size:'Medium',
- title:language.toolbox,
+ size: 'Medium',
+ title: language.toolbox,
loading: true
});
$.get("../prod/tools/"
, datas
- , function(data){
+ , function (data) {
dialog.setContent(data);
return;
}
@@ -1720,293 +1625,231 @@ function toolREFACTOR(datas){
}
-function activeIcons()
-{
- $('.TOOL_print_btn').live('click', function(){
- var value="";
+function activeIcons() {
+ $('.TOOL_print_btn').live('click', function () {
+ var value = "";
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0)
value = "lst=" + p4.Results.Selection.serialize();
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0)
value = "lst=" + p4.WorkZone.Selection.serialize();
else
- value = "SSTTID=" + $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ value = "SSTTID=" + $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
- value = "SSTTID=" + $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ if ($(this).hasClass('basket_element')) {
+ value = "SSTTID=" + $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
value = "lst=" + p4.WorkZone.Selection.serialize();
}
- else
- {
- value = "story=" + $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ value = "story=" + $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
}
}
- if(value !== '')
- {
+ if (value !== '') {
printThis(value);
}
- else
- {
+ else {
alert(language.nodocselected);
}
});
- $('.TOOL_bridge_btn').live('click', function(){
+ $('.TOOL_bridge_btn').live('click', function () {
var datas = {};
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0)
datas.lst = p4.Results.Selection.serialize();
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0)
datas.lst = p4.WorkZone.Selection.serialize();
else
- datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
- datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ if ($(this).hasClass('basket_element')) {
+ datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
datas.lst = p4.WorkZone.Selection.serialize();
}
- else
- {
- datas.story = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ datas.story = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
}
}
- if(datas.ssel || datas.lst || datas.story)
- {
+ if (datas.ssel || datas.lst || datas.story) {
init_publicator(datas);
}
- else
- {
+ else {
alert(language.nodocselected);
}
});
-
- $('.TOOL_trash_btn').live('click', function(){
- var type="";
+ $('.TOOL_trash_btn').live('click', function () {
+ var type = "";
var el = false;
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0)
type = 'IMGT';
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0)
type = 'CHIM';
- else{
+ else {
type = 'SSTT';
el = $('.SSTT.active');
}
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
type = 'CHIM';
}
- else
- {
+ else {
type = 'STORY';
el = $(this).find('input[name=story_key]');
}
}
}
}
- if(type !== '')
- {
+ if (type !== '') {
checkDeleteThis(type, el);
}
- else
- {
+ else {
alert(language.nodocselected);
}
});
- $('.TOOL_ppen_btn').live('click', function(){
- var value="";
+ $('.TOOL_ppen_btn').live('click', function () {
+ var value = "";
var type = "";
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
- {
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0) {
type = 'IMGT';
value = p4.Results.Selection.serialize();
}
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
type = 'IMGT';
value = p4.WorkZone.Selection.serialize();
}
- else
- {
+ else {
type = 'SSTT';
- value = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ value = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
+ else {
+ if ($(this).hasClass('basket_element')) {
type = 'SSTT';
- value = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ value = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
type = 'IMGT';
value = p4.WorkZone.Selection.serialize();
}
- else
- {
+ else {
type = 'STORY';
- value = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ value = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
}
}
- if(value !== '')
- {
- editThis(type,value);
+ if (value !== '') {
+ editThis(type, value);
}
- else
- {
+ else {
alert(language.nodocselected);
}
});
- $('.TOOL_publish_btn').live('click', function(){
- var value="";
+ $('.TOOL_publish_btn').live('click', function () {
+ var value = "";
var type = "";
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
- {
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0) {
type = 'IMGT';
value = p4.Results.Selection.serialize();
}
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
type = 'IMGT';
value = p4.WorkZone.Selection.serialize();
}
- else
- {
+ else {
type = 'SSTT';
- value = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ value = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
+ else {
+ if ($(this).hasClass('basket_element')) {
type = 'SSTT';
- value = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ value = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
type = 'IMGT';
value = p4.WorkZone.Selection.serialize();
}
- else
- {
+ else {
type = 'STORY';
- value = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ value = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
}
}
- if(value !== '')
- {
- feedThis(type,value);
+ if (value !== '') {
+ feedThis(type, value);
}
- else
- {
+ else {
alert(language.nodocselected);
}
});
- function feedThis(type,value)
- {
+ function feedThis(type, value) {
var $feed_box = $('#modal_feed');
var options = {
- lst:'',
- ssel:'',
- act:''
+ lst: '',
+ ssel: '',
+ act: ''
};
- switch(type){
+ switch (type) {
case "IMGT":
case "CHIM":
options.lst = value;
@@ -2022,7 +1865,7 @@ function activeIcons()
$.post("../prod/feeds/requestavailable/"
, options
- , function(data){
+ , function (data) {
return set_up_feed_box(data);
});
@@ -2030,40 +1873,31 @@ function activeIcons()
return;
}
- $('.TOOL_chgcoll_btn').live('click', function(){
+ $('.TOOL_chgcoll_btn').live('click', function () {
var value = {};
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0)
value.lst = p4.Results.Selection.serialize();
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0)
value.lst = p4.WorkZone.Selection.serialize();
else
- value.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ value.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
- value.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ if ($(this).hasClass('basket_element')) {
+ value.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
value.lst = p4.WorkZone.Selection.serialize();
}
- else
- {
- value.story = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ value.story = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
@@ -2073,15 +1907,14 @@ function activeIcons()
/**
* if works, then the object is not empty
*/
- for(i in value)
- {
+ for (i in value) {
return chgCollThis(value);
}
alert(language.nodocselected);
});
- $('.TOOL_chgstatus_btn').live('click', function(){
+ $('.TOOL_chgstatus_btn').live('click', function () {
var params = {};
var $this = $(this);
@@ -2094,17 +1927,17 @@ function activeIcons()
if (p4.WorkZone.Selection.length() > 0) {
params.lst = p4.WorkZone.Selection.serialize();
} else {
- params.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ params.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
} else {
if ($this.hasClass('basket_element')) {
- params.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ params.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
} else {
if ($this.hasClass('story_window')) {
if (p4.WorkZone.Selection.length() > 0) {
params.lst = p4.WorkZone.Selection.serialize();
} else {
- params.story = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ params.story = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
@@ -2119,203 +1952,157 @@ function activeIcons()
}
});
- $('.TOOL_pushdoc_btn').live('click', function(){
- var value="",type="",sstt_id="", story ="";
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
+ $('.TOOL_pushdoc_btn').live('click', function () {
+ var value = "", type = "", sstt_id = "", story = "";
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0)
value = p4.Results.Selection.serialize();
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0)
value = p4.WorkZone.Selection.serialize();
else
- sstt_id = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ sstt_id = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
- sstt_id = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ if ($(this).hasClass('basket_element')) {
+ sstt_id = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
value = p4.WorkZone.Selection.serialize();
}
- else
- {
- story = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ story = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
}
}
- if(value !== '' || sstt_id !== '' || story !== '')
- {
+ if (value !== '' || sstt_id !== '' || story !== '') {
pushThis(sstt_id, value, story);
}
- else
- {
+ else {
alert(language.nodocselected);
}
});
- $('.TOOL_feedback_btn').live('click', function(){
- var value="",type="",sstt_id="", story='';
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
+ $('.TOOL_feedback_btn').live('click', function () {
+ var value = "", type = "", sstt_id = "", story = '';
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0)
value = p4.Results.Selection.serialize();
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0)
value = p4.WorkZone.Selection.serialize();
else
- sstt_id = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ sstt_id = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
- sstt_id = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ if ($(this).hasClass('basket_element')) {
+ sstt_id = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
value = p4.WorkZone.Selection.serialize();
}
- else
- {
- story = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ story = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
}
}
- if(value !== '' || sstt_id !== '' || story !== '')
- {
+ if (value !== '' || sstt_id !== '' || story !== '') {
feedbackThis(sstt_id, value, story);
}
- else
- {
+ else {
alert(language.nodocselected);
}
});
- $('.TOOL_imgtools_btn').live('click', function(){
+ $('.TOOL_imgtools_btn').live('click', function () {
var datas = {};
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0)
datas.lst = p4.Results.Selection.serialize();
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0)
datas.lst = p4.WorkZone.Selection.serialize();
else
- datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
- datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ if ($(this).hasClass('basket_element')) {
+ datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
datas.lst = p4.WorkZone.Selection.serialize();
}
- else
- {
- datas.story = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ datas.story = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
}
}
- if(!$.isEmptyObject(datas))
- {
+ if (!$.isEmptyObject(datas)) {
toolREFACTOR(datas);
}
- else
- {
+ else {
alert(language.nodocselected);
}
});
- $('.TOOL_disktt_btn').live('click', function(){
+ $('.TOOL_disktt_btn').live('click', function () {
var datas = {};
- if($(this).hasClass('results_window'))
- {
- if(p4.Results.Selection.length() > 0)
- {
+ if ($(this).hasClass('results_window')) {
+ if (p4.Results.Selection.length() > 0) {
datas.lst = p4.Results.Selection.serialize();
}
}
- else
- {
- if($(this).hasClass('basket_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('basket_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
datas.lst = p4.WorkZone.Selection.serialize();
}
- else
- {
- datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
- else
- {
- if($(this).hasClass('basket_element'))
- {
- datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ if ($(this).hasClass('basket_element')) {
+ datas.ssel = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
- else
- {
- if($(this).hasClass('story_window'))
- {
- if(p4.WorkZone.Selection.length() > 0)
- {
+ else {
+ if ($(this).hasClass('story_window')) {
+ if (p4.WorkZone.Selection.length() > 0) {
datas.lst = p4.WorkZone.Selection.serialize();
}
- else
- {
- datas.story = $('.SSTT.active').attr('id').split('_').slice(1,2).pop();
+ else {
+ datas.story = $('.SSTT.active').attr('id').split('_').slice(1, 2).pop();
}
}
}
}
}
- for(var i in datas)
- {
+ for (var i in datas) {
return downloadThis(datas);
}
@@ -2325,11 +2112,9 @@ function activeIcons()
}
-function checkDeleteThis(type, el)
-{
+function checkDeleteThis(type, el) {
el = $(el);
- switch(type){
-
+ switch (type) {
case "IMGT":
@@ -2337,9 +2122,9 @@ function checkDeleteThis(type, el)
var lst = '';
- if(type === 'IMGT')
+ if (type === 'IMGT')
lst = p4.Results.Selection.serialize();
- if(type === 'CHIM')
+ if (type === 'CHIM')
lst = p4.WorkZone.Selection.serialize();
deleteThis(lst);
@@ -2351,17 +2136,16 @@ function checkDeleteThis(type, el)
case "SSTT":
var buttons = {};
- buttons[language.valider]= function(e)
- {
+ buttons[language.valider] = function (e) {
deleteBasket(el);
};
$('#DIALOG').empty().append(language.confirmDel).attr('title', language.attention).dialog({
- autoOpen:false,
- resizable:false,
- modal:true,
- draggable:false
- }).dialog('open').dialog('option','buttons',buttons);
+ autoOpen: false,
+ resizable: false,
+ modal: true,
+ draggable: false
+ }).dialog('open').dialog('option', 'buttons', buttons);
$('#tooltip').hide();
return;
break;
@@ -2373,32 +2157,30 @@ function checkDeleteThis(type, el)
}
}
-function shareThis(bas,rec)
-{
+function shareThis(bas, rec) {
var dialog = p4.Dialog.Create({
title: language['share']
});
- dialog.load("../prod/share/record/"+bas+"/"+rec+ "/","GET");
+ dialog.load("../prod/share/record/" + bas + "/" + rec + "/", "GET");
}
-function printThis(value)
-{
+function printThis(value) {
if ($("#DIALOG").data("ui-dialog")) {
$("#DIALOG").dialog('destroy');
}
$('#DIALOG').attr('title', language.print)
.empty().addClass('loading')
.dialog({
- resizable:false,
- closeOnEscape:true,
- modal:true,
- width:'800',
- height:'500',
- open: function(event, ui) {
+ resizable: false,
+ closeOnEscape: true,
+ modal: true,
+ width: '800',
+ height: '500',
+ open: function (event, ui) {
$(this).dialog("widget").css("z-index", "1999");
},
- close: function(event, ui) {
+ close: function (event, ui) {
$(this).dialog("widget").css("z-index", "auto");
}
})
@@ -2406,12 +2188,12 @@ function printThis(value)
$.ajax({
type: "POST",
- url: '../prod/printer/?'+value,
+ url: '../prod/printer/?' + value,
dataType: 'html',
- beforeSend:function(){
+ beforeSend: function () {
},
- success: function(data){
+ success: function (data) {
$('#DIALOG').removeClass('loading').empty()
.append(data);
return;
@@ -2420,17 +2202,16 @@ function printThis(value)
}
-function downloadThis(datas)
-{
+function downloadThis(datas) {
var dialog = p4.Dialog.Create({title: language['export']});
- $.post("../prod/export/multi-export/", datas, function(data) {
+ $.post("../prod/export/multi-export/", datas, function (data) {
dialog.setContent(data);
$('.tabs', dialog.getDomElement()).tabs();
- $('.close_button', dialog.getDomElement()).bind('click',function(){
+ $('.close_button', dialog.getDomElement()).bind('click', function () {
dialog.Close();
});
@@ -2439,55 +2220,39 @@ function downloadThis(datas)
}
-
-function viewNbSelect()
-{
+function viewNbSelect() {
$("#nbrecsel").empty().append(p4.Results.Selection.length());
}
-function selector(el)
-{
- if(el.hasClass('all_selector'))
- {
+function selector(el) {
+ if (el.hasClass('all_selector')) {
p4.Results.Selection.selectAll();
}
- else
- {
- if(el.hasClass('none_selector'))
- {
+ else {
+ if (el.hasClass('none_selector')) {
p4.Results.Selection.empty();
}
- else
- {
- if(el.hasClass('starred_selector'))
- {
+ else {
+ if (el.hasClass('starred_selector')) {
}
- else
- {
- if(el.hasClass('video_selector'))
- {
+ else {
+ if (el.hasClass('video_selector')) {
p4.Results.Selection.empty();
p4.Results.Selection.select('.type-video');
}
- else
- {
- if(el.hasClass('image_selector'))
- {
+ else {
+ if (el.hasClass('image_selector')) {
p4.Results.Selection.empty();
p4.Results.Selection.select('.type-image');
}
- else
- {
- if(el.hasClass('document_selector'))
- {
+ else {
+ if (el.hasClass('document_selector')) {
p4.Results.Selection.empty();
p4.Results.Selection.select('.type-document');
}
- else
- {
- if(el.hasClass('audio_selector'))
- {
+ else {
+ if (el.hasClass('audio_selector')) {
p4.Results.Selection.empty();
p4.Results.Selection.select('.type-audio');
}
@@ -2499,30 +2264,26 @@ function selector(el)
}
}
-function evt_dwnl(value)
-{
- downloadThis("lst="+value);
+function evt_dwnl(value) {
+ downloadThis("lst=" + value);
}
-function evt_print(value)
-{
- printThis("lst="+value);
+function evt_print(value) {
+ printThis("lst=" + value);
}
-function evt_add_in_chutier(sbas_id, record_id,event, singleSelection)
-{
+function evt_add_in_chutier(sbas_id, record_id, event, singleSelection) {
var singleSelection = singleSelection || false;
p4.WorkZone.addElementToBasket(sbas_id, record_id, event, singleSelection);
}
-function remove_from_basket(el, confirm)
-{
+function remove_from_basket(el, confirm) {
var confirm = confirm || false;
p4.WorkZone.removeElementFromBasket(el, confirm);
}
-function doSpecialSearch(qry, allbase){
+function doSpecialSearch(qry, allbase) {
if (allbase) {
checkBases(true);
}
@@ -2530,7 +2291,7 @@ function doSpecialSearch(qry, allbase){
newSearch();
}
-function clktri(id){
+function clktri(id) {
var o = $('#TOPIC_UL' + id);
if ($('#TOPIC_UL' + id).hasClass('closed'))
$('#TOPIC_TRI' + id + ' ,#TOPIC_UL' + id).removeClass('closed').addClass('opened');
@@ -2540,14 +2301,13 @@ function clktri(id){
// ---------------------- fcts du thesaurus
-function chgProp(path, v, k)
-{
+function chgProp(path, v, k) {
var q2;
- if(!k)
+ if (!k)
k = "*";
//if(k!=null)
- v = v+" ["+k+"]";
- $("#thprop_a_"+path).html('"'+ v + '"');
+ v = v + " [" + k + "]";
+ $("#thprop_a_" + path).html('"' + v + '"');
// q = document.getElementById("thprop_q").innerText;
// if(!q )
// if(document.getElementById("thprop_q") && document.getElementById("thprop_q").textContent)
@@ -2555,8 +2315,8 @@ function chgProp(path, v, k)
q = $("#thprop_q").text();
q2 = "";
- for(i=0; i 0)
- {
+ if (stories.length > 0) {
p4.WorkZone.refresh();
}
- else
- {
+ else {
p4.WorkZone.Selection.remove(n);
}
});
@@ -2614,19 +2371,17 @@ function doDelete(lst)
});
}
-function archiveBasket(basket_id)
-{
+function archiveBasket(basket_id) {
$.ajax({
type: "POST",
url: "../prod/baskets/" + basket_id + "/archive/?archive=1",
- dataType:'json',
- beforeSend:function(){
+ dataType: 'json',
+ beforeSend: function () {
},
- success: function(data){
- if(data.success)
- {
- var basket = $('#SSTT_'+basket_id);
+ success: function (data) {
+ if (data.success) {
+ var basket = $('#SSTT_' + basket_id);
var next = basket.next();
if (next.data("ui-droppable")) {
@@ -2641,12 +2396,11 @@ function archiveBasket(basket_id)
basket.slideUp().remove();
- if($('#baskets .SSTT').length === 0) {
+ if ($('#baskets .SSTT').length === 0) {
return p4.WorkZone.refresh(false);
}
}
- else
- {
+ else {
alert(data.message);
}
return;
@@ -2655,24 +2409,22 @@ function archiveBasket(basket_id)
}
-function deleteBasket(item)
-{
+function deleteBasket(item) {
if ($("#DIALOG").data("ui-dialog")) {
$("#DIALOG").dialog('destroy');
}
- var k = $(item).attr('id').split('_').slice(1,2).pop(); // id de chutier
+ var k = $(item).attr('id').split('_').slice(1, 2).pop(); // id de chutier
$.ajax({
type: "POST",
- url: "../prod/baskets/"+k+'/delete/',
- dataType:'json',
- beforeSend:function(){
+ url: "../prod/baskets/" + k + '/delete/',
+ dataType: 'json',
+ beforeSend: function () {
},
- success: function(data){
- if(data.success)
- {
- var basket = $('#SSTT_'+k);
+ success: function (data) {
+ if (data.success) {
+ var basket = $('#SSTT_' + k);
var next = basket.next();
if (next.data("ui-droppable")) {
@@ -2687,12 +2439,11 @@ function deleteBasket(item)
basket.slideUp().remove();
- if($('#baskets .SSTT').length === 0) {
+ if ($('#baskets .SSTT').length === 0) {
return p4.WorkZone.refresh(false);
}
}
- else
- {
+ else {
alert(data.message);
}
return;
@@ -2700,83 +2451,70 @@ function deleteBasket(item)
});
}
-function clksbas(num, el)
-{
+function clksbas(num, el) {
var bool = true;
- if(el.attr('checked'))
- {
+ if (el.attr('checked')) {
bool = false;
- $('.sbasChkr_'+num).removeAttr('checked');
+ $('.sbasChkr_' + num).removeAttr('checked');
}
- else
- {
- $('.sbasChkr_'+num).attr('checked','checked');
+ else {
+ $('.sbasChkr_' + num).attr('checked', 'checked');
}
- $.each($('.sbascont_'+num+' :checkbox'),function(){
+ $.each($('.sbascont_' + num + ' :checkbox'), function () {
this.checked = bool;
});
- if(bool)
- {
- $('.sbascont_'+num+' label').addClass('selected');
+ if (bool) {
+ $('.sbascont_' + num + ' label').addClass('selected');
}
- else
- {
- $('.sbascont_'+num+' label').removeClass('selected');
+ else {
+ $('.sbascont_' + num + ' label').removeClass('selected');
}
infoSbas(false, num, false, false);
}
-function cancelEvent(event)
-{
- if(event.stopPropagation)
+function cancelEvent(event) {
+ if (event.stopPropagation)
event.stopPropagation();
- if(event.preventDefault)
+ if (event.preventDefault)
event.preventDefault();
event.cancelBubble = true;
return false;
}
-function infoSbas(el,num,donotfilter, event)
-{
- if(event)
+function infoSbas(el, num, donotfilter, event) {
+ if (event)
cancelEvent(event);
- if(el)
- {
- var item = $('input.ck_'+$(el).val());
- var label = $('label.ck_'+$(el).val());
+ if (el) {
+ var item = $('input.ck_' + $(el).val());
+ var label = $('label.ck_' + $(el).val());
- if($(el).attr('checked'))
- {
+ if ($(el).attr('checked')) {
label.removeClass('selected');
item.removeAttr('checked');
}
- else
- {
+ else {
label.addClass('selected');
- item.attr('checked','checked');
+ item.attr('checked', 'checked');
}
}
- $('.infos_sbas_'+num).empty().append($('.basChild_'+num+':first .checkbas:checked').length+'/'+$('.basChild_'+num+':first .checkbas').length);
+ $('.infos_sbas_' + num).empty().append($('.basChild_' + num + ':first .checkbas:checked').length + '/' + $('.basChild_' + num + ':first .checkbas').length);
- if(donotfilter !== true)
+ if (donotfilter !== true)
checkFilters(true);
}
-function advSearch(event)
-{
+function advSearch(event) {
event.cancelBubble = true;
// alternateSearch(false);
$('#idFrameC .tabs a.adv_search').trigger('click');
}
-function start_page_selector()
-{
+function start_page_selector() {
var el = $('#look_box_settings select[name=start_page]');
- switch(el.val())
- {
+ switch (el.val()) {
case "LAST_QUERY":
case "PUBLI":
case "HELP":
@@ -2788,37 +2526,33 @@ function start_page_selector()
}
}
-function set_start_page()
-{
+function set_start_page() {
var el = $('#look_box_settings select[name=start_page]');
var val = el.val();
var start_page_query = $('#look_box_settings input[name=start_page_value]').val();
- if(val === 'QUERY')
- {
- if($.trim(start_page_query) === '')
- {
+ if (val === 'QUERY') {
+ if ($.trim(start_page_query) === '') {
alert(language.start_page_query_error);
return;
}
- setPref('start_page_query',start_page_query);
+ setPref('start_page_query', start_page_query);
}
- setPref('start_page',val);
+ setPref('start_page', val);
}
-function basketPrefs()
-{
+function basketPrefs() {
$('#basket_preferences').dialog({
- closeOnEscape:true,
- resizable:false,
- width:450,
- height:500,
- modal:true,
- draggable:false,
+ closeOnEscape: true,
+ resizable: false,
+ width: 450,
+ height: 500,
+ modal: true,
+ draggable: false,
overlay: {
backgroundColor: '#000',
opacity: 0.7
@@ -2826,15 +2560,14 @@ function basketPrefs()
}).dialog('open');
}
-function lookBox(el,event)
-{
+function lookBox(el, event) {
$("#look_box").dialog({
- closeOnEscape:true,
- resizable:false,
- width:450,
- height:500,
- modal:true,
- draggable:false,
+ closeOnEscape: true,
+ resizable: false,
+ width: 450,
+ height: 500,
+ modal: true,
+ draggable: false,
overlay: {
backgroundColor: '#000',
opacity: 0.7
@@ -2842,74 +2575,62 @@ function lookBox(el,event)
}).dialog('open');
}
-function showAnswer(p)
-{
+function showAnswer(p) {
var o;
- if(p ==='Results')
- {
+ if (p === 'Results') {
// on montre les results
- if(o = document.getElementById("AnswerExplain"))
+ if (o = document.getElementById("AnswerExplain"))
o.style.visibility = "hidden";
- if(o = document.getElementById("AnswerResults"))
- {
+ if (o = document.getElementById("AnswerResults")) {
o.style.visibility = "";
o.style.display = "block";
}
// on montre explain
- if(document.getElementById("divpage"))
- document.getElementById("divpage").style.visibility = visibilityDivPage;
+ if (document.getElementById("divpage"))
+ document.getElementById("divpage").style.visibility = visibilityDivPage;
- if(document.getElementById("explainResults") )
+ if (document.getElementById("explainResults"))
document.getElementById("explainResults").style.display = "none";
}
- else
- {
+ else {
// on montre explain
- if(document.getElementById("divpage"))
- {
+ if (document.getElementById("divpage")) {
visibilityDivPage = "visible";
- document.getElementById("divpage").style.visibility = "hidden" ;
+ document.getElementById("divpage").style.visibility = "hidden";
}
- if(document.getElementById("explainResults") )
+ if (document.getElementById("explainResults"))
document.getElementById("explainResults").style.display = "block";
- if(o = document.getElementById("AnswerResults"))
- {
+ if (o = document.getElementById("AnswerResults")) {
o.style.visibility = "hidden";
o.style.display = "none";
}
- if(o = document.getElementById("AnswerExplain"))
+ if (o = document.getElementById("AnswerExplain"))
o.style.visibility = "";
- if(o = document.getElementById("AnswerExplain"))
- {
+ if (o = document.getElementById("AnswerExplain")) {
o.style.display = "none";
- setTimeout('document.getElementById("AnswerExplain").style.display = "block";',200);
+ setTimeout('document.getElementById("AnswerExplain").style.display = "block";', 200);
}
}
}
/** FROM INDEX.php **/
-function saveeditPbar(idesc, ndesc)
-{
+function saveeditPbar(idesc, ndesc) {
document.getElementById("saveeditPbarI").innerHTML = idesc;
document.getElementById("saveeditPbarN").innerHTML = ndesc;
}
-function getSelText()
-{
+function getSelText() {
var txt = '';
- if (window.getSelection)
- {
+ if (window.getSelection) {
txt = window.getSelection();
}
- else if (document.getSelection)
- {
+ else if (document.getSelection) {
txt = document.getSelection();
}
- else if (document.selection)
- {
+ else if (document.selection) {
txt = document.selection.createRange().text;
}
else
@@ -2917,87 +2638,77 @@ function getSelText()
return txt;
}
-function getWinPosAsXML()
-{
- var ret = '';
+function getWinPosAsXML() {
+ var ret = '';
- if($('#idFrameE').is(':visible') && $('#EDITWINDOW').is(':visible'))
- ret += '';
+ if ($('#idFrameE').is(':visible') && $('#EDITWINDOW').is(':visible'))
+ ret += '';
return ret;
}
-function saveWindows()
-{
+function saveWindows() {
var key = '';
var value = '';
- if($('#idFrameE').is(':visible') && $('#EDITWINDOW').is(':visible'))
- {
+ if ($('#idFrameE').is(':visible') && $('#EDITWINDOW').is(':visible')) {
key = 'edit_window';
- value = $('#idFrameE').outerWidth()/$('#EDITWINDOW').innerWidth();
+ value = $('#idFrameE').outerWidth() / $('#EDITWINDOW').innerWidth();
}
- else
- {
+ else {
key = 'search_window';
- value = $('#idFrameC').outerWidth()/bodySize.x;
+ value = $('#idFrameC').outerWidth() / bodySize.x;
}
setPref(key, value);
}
-function gotopage(pag)
-{
+function gotopage(pag) {
$('#searchForm input[name="sel"]').val(p4.Results.Selection.serialize());
$('#formAnswerPage').val(pag);
$('#searchForm').submit();
}
-function addFilterMulti(filter,link,sbasid)
-{
- var clone = $('#filter_multi_'+sbasid+'_'+filter);
+function addFilterMulti(filter, link, sbasid) {
+ var clone = $('#filter_multi_' + sbasid + '_' + filter);
var orig = clone;
- if(!$('#filter_multi_'+sbasid+'_'+filter).is(':visible'))
- {
+ if (!$('#filter_multi_' + sbasid + '_' + filter).is(':visible')) {
clone = orig.clone(true);
var par = orig.parent();
orig.remove();
par.append(clone);
- clone.slideDown('fast',function(){
+ clone.slideDown('fast', function () {
$(this);
});
$(link).addClass('filterActive');
}
- else
- {
+ else {
clone.slideUp();
$(link).removeClass('filterActive');
}
return false;
}
-function autoorder()
-{
+function autoorder() {
var val = $.trim($('#auto_order').val());
- if(val === '')
+ if (val === '')
return;
var sorter = new Array();
- $('#reorder_box .diapo form').each(function(i,n){
+ $('#reorder_box .diapo form').each(function (i, n) {
- var id = $('input[name=id]',n).val();
+ var id = $('input[name=id]', n).val();
- switch(val)
- {
+ switch (val) {
case 'title':
default:
- var data = $('input[name=title]',n).val();
+ var data = $('input[name=title]', n).val();
break;
case 'default':
- var data = $('input[name=default]',n).val();
+ var data = $('input[name=default]', n).val();
break;
}
@@ -3006,8 +2717,7 @@ function autoorder()
var data_type = 'string';
- switch(val)
- {
+ switch (val) {
case 'default':
var data_type = 'integer';
break;
@@ -3017,15 +2727,12 @@ function autoorder()
var last_moved = false;
- for(i in sorter)
- {
- var elem = $('#ORDER_'+i);
- if(last_moved)
- {
+ for (i in sorter) {
+ var elem = $('#ORDER_' + i);
+ if (last_moved) {
elem.insertAfter(last_moved);
}
- else
- {
+ else {
$('#reorder_box').prepend(elem);
}
last_moved = elem;
@@ -3033,59 +2740,54 @@ function autoorder()
}
-function set_up_feed_box(data)
-{
+function set_up_feed_box(data) {
var $feed_box = $('#modal_feed');
$feed_box.empty().append(data).dialog({
- modal:true,
- width:800,
- height:500,
- resizable:false,
- draggable:false
+ modal: true,
+ width: 800,
+ height: 500,
+ resizable: false,
+ draggable: false
});
var $feeds_item = $('.feeds .feed', $feed_box);
var $form = $('form.main_form', $feed_box);
- $feeds_item.bind('click', function(){
+ $feeds_item.bind('click',function () {
$feeds_item.removeClass('selected');
$(this).addClass('selected');
$('input[name="feed_id"]', $form).val($('input', this).val());
- }).hover(function(){
+ }).hover(function () {
$(this).addClass('hover');
- },function(){
+ }, function () {
$(this).removeClass('hover');
});
- $form.bind('submit', function(){
+ $form.bind('submit', function () {
return false;
});
- $('button.valid_form').bind('click', function(){
+ $('button.valid_form').bind('click', function () {
var error = false;
- $('.required_text', $form).each(function(i, el){
- if($.trim($(el).val()) === '')
- {
+ $('.required_text', $form).each(function (i, el) {
+ if ($.trim($(el).val()) === '') {
$(el).addClass('error');
error = true;
}
});
- if(error)
- {
+ if (error) {
alert(language.feed_require_fields);
}
- if($('input[name="feed_id"]', $form).val() === '')
- {
+ if ($('input[name="feed_id"]', $form).val() === '') {
alert(language.feed_require_feed);
error = true;
}
- if(error)
- {
+ if (error) {
return false;
}
@@ -3093,28 +2795,26 @@ function set_up_feed_box(data)
type: 'POST',
url: $form.attr('action'),
data: $form.serializeArray(),
- dataType:'json',
- beforeSend:function(){
+ dataType: 'json',
+ beforeSend: function () {
$('button', $feed_box).attr('disabled', 'disabled');
},
- error:function(){
+ error: function () {
$('button', $feed_box).removeAttr('disabled');
},
- timeout:function(){
+ timeout: function () {
$('button', $feed_box).removeAttr('disabled');
},
- success: function(data){
+ success: function (data) {
$('button', $feed_box).removeAttr('disabled');
- if(data.error === true)
- {
+ if (data.error === true) {
alert(data.message);
return;
}
- 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 container = $('#entry_'+id);
+ var container = $('#entry_' + id);
container.replaceWith(data.datas);
@@ -3134,8 +2834,8 @@ function set_up_feed_box(data)
});
return false;
});
- $('button.close_dialog').bind('click', function(){
- if($feed_box.data("ui-dialog")) {
+ $('button.close_dialog').bind('click', function () {
+ if ($feed_box.data("ui-dialog")) {
$feed_box.dialog('destroy');
}
diff --git a/www/skins/prod/publicator.js b/www/skins/prod/publicator.js
index 6b805c8ed9..bfd162c2fb 100644
--- a/www/skins/prod/publicator.js
+++ b/www/skins/prod/publicator.js
@@ -1,16 +1,13 @@
-
-function publicator_reload_publicator()
-{
+function publicator_reload_publicator() {
var options = $('#dialog_publicator form[name="current_datas"]').serializeArray();
var dialog = p4.Dialog.get(1);
dialog.load('/prod/bridge/manager/', 'POST', options);
}
-function init_publicator(datas)
-{
+function init_publicator(datas) {
var dialog = p4.Dialog.Create({
- size:'Full',
- title:'Bridge',
+ size: 'Full',
+ title: 'Bridge',
loading: false
});
diff --git a/www/skins/report/report.js b/www/skins/report/report.js
index 990d97dfc5..c0faced736 100644
--- a/www/skins/report/report.js
+++ b/www/skins/report/report.js
@@ -38,19 +38,19 @@ $(document).ready(function () {
configure_dash();
bindEvents();
- $("a.select-all").bind("click", function(e) {
+ $("a.select-all").bind("click", function (e) {
$("ul.multiselect .coll-checkbox", $(this).closest('.form2')).attr("checked", true);
});
- $("a.deselect-all").bind("click", function(e) {
+ $("a.deselect-all").bind("click", function (e) {
$("ul.multiselect .coll-checkbox", $(this).closest('.form2')).attr("checked", false);
});
- $(".multiselect-group").toggle(function() {
+ $(".multiselect-group").toggle(function () {
var $this = $(this);
var groupId = $this.data('group-id');
$(".checkbox-" + groupId, $this.closest('.form2')).attr("checked", true);
- }, function() {
+ }, function () {
var $this = $(this);
var groupId = $this.data('group-id');
$(".checkbox-" + groupId, $this.closest('.form2')).attr("checked", false);
diff --git a/www/skins/thesaurus/sprintf.js b/www/skins/thesaurus/sprintf.js
index 3c0773938b..cbf4abf928 100644
--- a/www/skins/thesaurus/sprintf.js
+++ b/www/skins/thesaurus/sprintf.js
@@ -1,46 +1,39 @@
//////////////////////////////////////////////////////////////////////////////
// sprintf function for javascript
-function sprintf()
-{
- if (!arguments || arguments.length < 1 || !RegExp)
- {
+function sprintf() {
+ if (!arguments || arguments.length < 1 || !RegExp) {
return '';
}
str = arguments[0];
- while((newstr = str.replace("\n", "\x01")) != str)
+ while ((newstr = str.replace("\n", "\x01")) != str)
str = newstr;
// var re = /([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)/;
var re = new RegExp("^([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)$", "m");
re["$*"] = true;
var a = b = [], numSubstitutions = 0, numMatches = 0;
a = re.exec(str);
- while (a)
- {
+ while (a) {
var leftpart = a[1], pPad = a[2], pJustify = a[3], pMinLength = a[4];
- var pPrecision = a[5], pType = a[6], rightPart = a[7]; numMatches++;
+ var pPrecision = a[5], pType = a[6], rightPart = a[7];
+ numMatches++;
// alert("str:"+str + "\nl:"+leftpart + "\nr:"+rightPart);
- if (pType == '%')
- {
+ if (pType == '%') {
subst = '%';
}
- else
- {
+ else {
numSubstitutions++;
- if (numSubstitutions >= arguments.length)
- {
+ if (numSubstitutions >= arguments.length) {
alert('Error! Not enough function arguments (' + (arguments.length - 1) + ', excluding the string)\n' + 'for the number of substitution parameters in string (' + numSubstitutions + ' so far).');
}
var param = arguments[numSubstitutions];
var pad = '';
- if (pPad && pPad.substr(0,1) == "'")
- {
- pad = leftpart.substr(1,1);
+ if (pPad && pPad.substr(0, 1) == "'") {
+ pad = leftpart.substr(1, 1);
}
- else if (pPad)
- {
+ else if (pPad) {
pad = pPad;
}
var justifyRight = true;
@@ -50,13 +43,11 @@ function sprintf()
if (pMinLength)
minLength = parseInt(pMinLength);
var precision = -1;
- if (pPrecision && pType == 'f')
- {
+ if (pPrecision && pType == 'f') {
precision = parseInt(pPrecision.substring(1));
}
var subst = param;
- switch (pType)
- {
+ switch (pType) {
case 'b':
subst = parseInt(param).toString(2);
break;
@@ -64,7 +55,7 @@ function sprintf()
subst = String.fromCharCode(parseInt(param));
break;
case 'd':
- subst = parseInt(param)? parseInt(param) : 0;
+ subst = parseInt(param) ? parseInt(param) : 0;
break;
case 'u':
subst = Math.abs(param);
@@ -89,20 +80,18 @@ function sprintf()
}
var padLeft = minLength - subst.toString().length;
var padding;
- if (padLeft > 0)
- {
- var arrTmp = new Array(padLeft+1);
- padding = arrTmp.join(pad?pad:" ");
+ if (padLeft > 0) {
+ var arrTmp = new Array(padLeft + 1);
+ padding = arrTmp.join(pad ? pad : " ");
}
- else
- {
+ else {
padding = "";
}
}
str = leftpart + padding + subst + rightPart;
a = re.exec(str);
}
- while((newstr = str.replace("\x01", "\n")) != str)
+ while ((newstr = str.replace("\x01", "\n")) != str)
str = newstr;
return(str);
}
diff --git a/www/skins/thesaurus/thesaurus.js b/www/skins/thesaurus/thesaurus.js
index 3e93a69a7b..6c7e846efb 100644
--- a/www/skins/thesaurus/thesaurus.js
+++ b/www/skins/thesaurus/thesaurus.js
@@ -1,26 +1,21 @@
-
-function loadXMLDoc(url, post_parms, asxml)
-{
- if(typeof(asxml)=="undefined")
+function loadXMLDoc(url, post_parms, asxml) {
+ if (typeof(asxml) == "undefined")
asxml = false;
out = null;
xmlhttp = null;
// code for Mozilla, etc.
if (window.XMLHttpRequest)
- xmlhttp=new XMLHttpRequest();
+ xmlhttp = new XMLHttpRequest();
else if (window.ActiveXObject)
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
- if (xmlhttp)
- {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ if (xmlhttp) {
// xmlhttp.onreadystatechange=state_Change
- if(post_parms)
- {
+ if (post_parms) {
xmlhttp.open("POST", url, false);
- xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
+ xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send(post_parms);
}
- else
- {
+ else {
xmlhttp.open("GET", url, false);
xmlhttp.send(null);
}
@@ -30,25 +25,22 @@ function loadXMLDoc(url, post_parms, asxml)
}
-function showFound2(term, lterm, branch, depth)
-{
+function showFound2(term, lterm, branch, depth) {
var c;
var ret = 0;
var thb = branch.firstChild.nextSibling.nextSibling;
// branch est un
- if(thb)
- {
- for(c=thb.firstChild; c; c=c.nextSibling) // THE, les SY ou les TA
+ if (thb) {
+ for (c = thb.firstChild; c; c = c.nextSibling) // THE, les SY ou les TA
{
- if(c.nodeName=="DIV")
- ret += showFound2(term, lterm, c, depth+1); // on descend uniquement les THE_yyy
+ if (c.nodeName == "DIV")
+ ret += showFound2(term, lterm, c, depth + 1); // on descend uniquement les THE_yyy
}
}
- if(branch.firstChild.nextSibling.nodeValue.substr(0, lterm)==term)
- {
+ if (branch.firstChild.nextSibling.nodeValue.substr(0, lterm) == term) {
ret = 1;
// alert(branch.firstChild.nextSibling.nodeValue + " : " + thb.id);
}
@@ -56,13 +48,11 @@ function showFound2(term, lterm, branch, depth)
// if(ret > 0)
// if(depth > 0)
// {
- if(ret > 0)
- {
+ if (ret > 0) {
//eventObj.Src0.innerHTML = "+";
thb.className = "OB";
}
- else
- {
+ else {
//eventObj.Src0.innerHTML = "+";
thb.className = "ob";
}
@@ -81,24 +71,20 @@ function showFound2(term, lterm, branch, depth)
return(ret);
}
-function showAll(branch, depth)
-{
+function showAll(branch, depth) {
depth = parseInt(depth);
var c;
- for(c=branch.firstChild; c; c=c.nextSibling)
- {
- if(c.nodeType==1 && c.nodeName=="DIV") // 1=XML_ELEMENT_NODE
- showAll(c, depth+1);
+ for (c = branch.firstChild; c; c = c.nextSibling) {
+ if (c.nodeType == 1 && c.nodeName == "DIV") // 1=XML_ELEMENT_NODE
+ showAll(c, depth + 1);
}
- if(depth > 0)
+ if (depth > 0)
branch.style.display = "";
- if(depth===0)
- {
- document.getElementById("WT1").style.visibility="hidden";
- if(document.forms["fTh"].textT1.value!=="")
- {
+ if (depth === 0) {
+ document.getElementById("WT1").style.visibility = "hidden";
+ if (document.forms["fTh"].textT1.value !== "") {
// oups! le mot a changé durant le traitement, on recommence
evt_kup_T1();
}
@@ -106,33 +92,28 @@ function showAll(branch, depth)
}
-
-function scanTerms(inputName, zTerm, showhide)
-{
+function scanTerms(inputName, zTerm, showhide) {
showhide = !!showhide;
var lTerm = zTerm.length;
- var zTable = document.getElementById("L"+inputName);
+ var zTable = document.getElementById("L" + inputName);
var zTr = zTable.childNodes; // TR's
var l = zTr.length;
var found = null;
- for(var i=0; i ");
+ if (n) {
+ if (n.nodeType == 1) {
+ alert(msg + " : <" + n.nodeName + " id='" + n.id + "'>");
}
- else
- {
- alert(msg + " : nodeType="+n.nodeType);
+ else {
+ alert(msg + " : nodeType=" + n.nodeType);
}
}
- else
- {
+ else {
alert(msg + " : NULL");
}
}
-function appendTerm(inputName, new_term, id)
-{
+function appendTerm(inputName, new_term, id) {
var tr = document.createElement("TR");
- tr.id = inputName + "_"+id;
+ tr.id = inputName + "_" + id;
tr.className = "s_";
var td = tr.appendChild(document.createElement("TD"));
td.appendChild(document.createTextNode(new_term));
td = tr.appendChild(document.createElement("TD"));
- td.innerHTML = " ";
+ td.innerHTML = " ";
td = tr.appendChild(document.createElement("TD"));
td.appendChild(document.createTextNode(" "));
- var zTable = document.getElementById("L"+inputName);
+ var zTable = document.getElementById("L" + inputName);
return(zTable.appendChild(tr));
}
diff --git a/www/skins/thesaurus/win.js b/www/skins/thesaurus/win.js
index ae8e3cd81d..4d30c99781 100644
--- a/www/skins/thesaurus/win.js
+++ b/www/skins/thesaurus/win.js
@@ -1,33 +1,31 @@
-var clickObj = { X:0, Y:0, lastClickX:-1, lastClickY:-1, Src:null, Src0:null };
-var balloonObj = { X:0, Y:0, Src:null, Src0:null };
-var dragObj = { objCursor:null, dragging:0, X:0, Y:0, lastClickX:-1, lastClickY:-1, Src:null, Src0:null, Target:null, Target0:null, idTarget:null, callBack:null } ;
+var clickObj = { X: 0, Y: 0, lastClickX: -1, lastClickY: -1, Src: null, Src0: null };
+var balloonObj = { X: 0, Y: 0, Src: null, Src0: null };
+var dragObj = { objCursor: null, dragging: 0, X: 0, Y: 0, lastClickX: -1, lastClickY: -1, Src: null, Src0: null, Target: null, Target0: null, idTarget: null, callBack: null };
debuglog = "";
-function ww_setDragObj(obj)
-{
- if(dragObj.objCursor)
+function ww_setDragObj(obj) {
+ if (dragObj.objCursor)
dragObj.objCursor.style.visibility = "hidden";
dragObj.objCursor = obj ? obj : document.getElementById("dragDropCursor");
obj.style.visibility = "visible";
}
-function evt_dblclk_doc(event, gui)
-{
+function evt_dblclk_doc(event, gui) {
var gui = eval(gui);
var button;
- if(typeof(event.which) != 'undefined')
- button = gui.firefoxButtons["b"+event.which];
+ if (typeof(event.which) != 'undefined')
+ button = gui.firefoxButtons["b" + event.which];
else
button = event.button;
- if(!dragObj.objCursor)
+ if (!dragObj.objCursor)
dragObj.objCursor = document.getElementById("dragDropCursor");
dragObj.Src0 = dragObj.Src = dragObj.Target = dragObj.Target0 = null;
dragObj.dragging = 0;
var srcElement = (event.target) ? event.target : event.srcElement;
var src0;
- for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode)
+ for (src0 = srcElement; src0 && !src0.id; src0 = src0.parentNode)
;
// src0 = (event.srcElement.tagName) ? event.srcElement : null; // correction safari pour le srcElement
// alert("<"+src0.tagName + " id='"+src0.id+"'>");
@@ -37,38 +35,34 @@ function evt_dblclk_doc(event, gui)
var ymouse = parseInt(event.clientY);
var acceptClick = true;
var e;
- for(e=src0; e && acceptClick && (!e.tagName || !clickfound); e=e.parentNode)
- {
- if(e && e.clickable)
- {
+ for (e = src0; e && acceptClick && (!e.tagName || !clickfound); e = e.parentNode) {
+ if (e && e.clickable) {
clickObj.X = xmouse;
clickObj.Y = ymouse;
clickObj.Src = e;
clickObj.Src0 = src0;
clickfound = true;
- if(e.clickCallback)
+ if (e.clickCallback)
(e.clickCallback)(event, "DBLCLICK", clickObj);
}
}
}
-var iiii=0;
+var iiii = 0;
-function ww_evt_mdwn_doc(gui, evt)
-{
+function ww_evt_mdwn_doc(gui, evt) {
var gui = eval(gui);
- if(gui.elemBalloon)
+ if (gui.elemBalloon)
gui.elemBalloon.style.visibility = "hidden";
- if(timer_ballon)
- {
+ if (timer_ballon) {
clearTimeout(timer_ballon);
timer_ballon = null;
}
var button;
- if(typeof(evt.which) != 'undefined')
- button = gui.firefoxButtons["b"+evt.which];
+ if (typeof(evt.which) != 'undefined')
+ button = gui.firefoxButtons["b" + evt.which];
else
button = evt.button;
@@ -78,39 +72,36 @@ function ww_evt_mdwn_doc(gui, evt)
var srcElement = evt.srcElement ? evt.srcElement : evt.target;
// for(src0=srcElement; src0 && (!src0.tagName); src0=src0.parentNode)
- for(src0=srcElement; src0 && (!src0.tagName || src0.tagName=='APPLET' || src0.tagName=='OBJECT' || !src0.id); src0=src0.parentNode)
+ for (src0 = srcElement; src0 && (!src0.tagName || src0.tagName == 'APPLET' || src0.tagName == 'OBJECT' || !src0.id); src0 = src0.parentNode)
;
- if(src0.className == 'hslider')
- {
+ if (src0.className == 'hslider') {
var x;
var wslider = parseInt(src0.style.width);
- var posmax = parseInt(src0.parentNode.style.width)-wslider;
- var min=0, max=posmax;
- if( (x = src0.getAttribute('min')) != "")
+ var posmax = parseInt(src0.parentNode.style.width) - wslider;
+ var min = 0, max = posmax;
+ if ((x = src0.getAttribute('min')) != "")
min = parseInt(x);
- if( (x = src0.getAttribute('max')) != "")
+ if ((x = src0.getAttribute('max')) != "")
max = parseInt(x);
var pos = parseInt(src0.style.left);
- var val = min + (((max-min) * pos) / posmax);
+ var val = min + (((max - min) * pos) / posmax);
// var pos = (int)(((val-min) * divmax) / (max-min));
var cb = null;
- if( (x=src0.getAttribute('callback')) != "")
+ if ((x = src0.getAttribute('callback')) != "")
cb = eval(x);
- gui.sliding = { 'obj':src0, 'dir':"H", 'posmax':posmax, 'opos':pos, 'pos':pos, 'min':min, 'max':max, 'val':val, 'callback':cb };
+ gui.sliding = { 'obj': src0, 'dir': "H", 'posmax': posmax, 'opos': pos, 'pos': pos, 'min': min, 'max': max, 'val': val, 'callback': cb };
return(false);
}
- if(src0.className == 'hsplitter')
- {
+ if (src0.className == 'hsplitter') {
src0.setAttribute('otop', parseInt(src0.style.top));
src0.setAttribute('ozindex', parseInt(src0.style.zIndex));
src0.style.zIndex = 999;
gui.splitting = src0;
return(false);
}
- if(src0.className == 'vsplitter')
- {
+ if (src0.className == 'vsplitter') {
src0.setAttribute('oleft', parseInt(src0.style.left));
src0.setAttribute('ozindex', parseInt(src0.style.zIndex));
src0.style.zIndex = 999;
@@ -124,12 +115,10 @@ function ww_evt_mdwn_doc(gui, evt)
var ymouse = parseInt(evt.clientY);
var acceptClick = true;
var e;
- for(var e=src0; e && acceptClick && (!e.tagName || !dragfound || !clickfound); e=e.parentNode)
- {
+ for (var e = src0; e && acceptClick && (!e.tagName || !dragfound || !clickfound); e = e.parentNode) {
- if(e && e.clickable)
- {
+ if (e && e.clickable) {
clickObj.X = xmouse;
clickObj.Y = ymouse;
clickObj.Src = e;
@@ -143,17 +132,15 @@ function ww_evt_mdwn_doc(gui, evt)
// alert("dT :" + dT);
clickfound = true;
- if(e.clickCallback)
- {
- if(button == 1) // && !event.altKey) // left button
+ if (e.clickCallback) {
+ if (button == 1) // && !event.altKey) // left button
acceptClick = (e.clickCallback)(evt, evt.ctrlKey ? "RMOUSEDOWN" : "MOUSEDOWN", clickObj);
- else
- if(button == 2 && !evt.ctrlKey) // right button
+ else if (button == 2 && !evt.ctrlKey) // right button
acceptClick = (e.clickCallback)(evt, "RMOUSEDOWN", clickObj);
}
}
- if(acceptClick && e && e.draggable) // && (!src0.draggable || src0.draggable!=-1))
+ if (acceptClick && e && e.draggable) // && (!src0.draggable || src0.draggable!=-1))
{
// alert(e.draggable);
dragObj.lastClickX = xmouse;
@@ -278,15 +265,13 @@ function ww_evt_mdwn_doc(gui, evt)
}
*/
-function ww_evt_mmov_doc(gui, evt)
-{
+function ww_evt_mmov_doc(gui, evt) {
var gui = eval(gui);
var button, xmouse, ymouse;
- if(gui.elemBalloon)
+ if (gui.elemBalloon)
gui.elemBalloon.style.visibility = "hidden";
- if(timer_ballon)
- {
+ if (timer_ballon) {
clearTimeout(timer_ballon);
timer_ballon = null;
}
@@ -295,87 +280,73 @@ function ww_evt_mmov_doc(gui, evt)
//window.status = xmouse + '-' + ymouse;
under_ballon = (evt.target) ? evt.target : evt.srcElement;
- if(under_ballon.id)
- {
- js = "timeout_ballon('"+under_ballon.id+"', "+xmouse+", "+ymouse+");";
+ if (under_ballon.id) {
+ js = "timeout_ballon('" + under_ballon.id + "', " + xmouse + ", " + ymouse + ");";
timer_ballon = setTimeout(js, 300);
}
xmouse = parseInt(evt.clientX);
ymouse = parseInt(evt.clientY);
- if(dragObj.Src)
- {
- if(dragObj.dragging == 1)
- {
+ if (dragObj.Src) {
+ if (dragObj.dragging == 1) {
dx = xmouse - dragObj.lastClickX;
dy = ymouse - dragObj.lastClickY;
- if(Math.abs(dx)>4 || Math.abs(dy)>4)
- {
- if(dragObj.objCursor)
- {
+ if (Math.abs(dx) > 4 || Math.abs(dy) > 4) {
+ if (dragObj.objCursor) {
dragObj.objCursor.style.visibility = "visible";
}
dragObj.dragging = 2;
- if(dragObj.Src.ondragstart)
- {
+ if (dragObj.Src.ondragstart) {
// alert("gui is calling ondragstart");
(dragObj.Src.ondragstart)();
}
- if(dragObj.Src.dragCallback)
- {
+ if (dragObj.Src.dragCallback) {
var r = (dragObj.Src.dragCallback)(evt, "DRAGSTART", dragObj);
- if(!r)
- {
+ if (!r) {
dragObj.dragging = 0;
dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null;
- if(dragObj.objCursor)
+ if (dragObj.objCursor)
dragObj.objCursor.style.visibility = "hidden";
}
}
}
}
- if(dragObj.dragging == 2)
- {
- if(dragObj.objCursor)
- {
+ if (dragObj.dragging == 2) {
+ if (dragObj.objCursor) {
// window.status = xmouse + '-' + ymouse;
- dragObj.objCursor.style.left = (xmouse+8)+"px";
- dragObj.objCursor.style.top = (ymouse+8)+"px";
+ dragObj.objCursor.style.left = (xmouse + 8) + "px";
+ dragObj.objCursor.style.top = (ymouse + 8) + "px";
}
var srcElement = (evt.target) ? evt.target : evt.srcElement;
var src0;
var e;
- for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode)
+ for (src0 = srcElement; src0 && !src0.id; src0 = src0.parentNode)
;
- for(e=src0; e && (!e.tagName || !e.droppable); e=e.parentNode)
+ for (e = src0; e && (!e.tagName || !e.droppable); e = e.parentNode)
;
- if(src0)
- {
+ if (src0) {
dragObj.Target0 = src0;
- if(dragObj.Target && e != dragObj.Target) // && src0 != e)
+ if (dragObj.Target && e != dragObj.Target) // && src0 != e)
{
- if(dragObj.Target.ondragleave)
+ if (dragObj.Target.ondragleave)
(dragObj.Target.ondragleave)();
- if(dragObj.Target.dropCallback)
+ if (dragObj.Target.dropCallback)
(dragObj.Target.dropCallback)(evt, "DRAGLEAVE", dragObj);
dragObj.Target = null;
}
- if(e)
- {
- if(!dragObj.Target)
- {
+ if (e) {
+ if (!dragObj.Target) {
dragObj.Target = e;
- if(e.ondragenter)
+ if (e.ondragenter)
(e.ondragenter)();
- if(dragObj.Target.dropCallback)
+ if (dragObj.Target.dropCallback)
(dragObj.Target.dropCallback)(evt, "DRAGENTER", dragObj);
}
- else
- {
- if(dragObj.Src.dragCallback)
+ else {
+ if (dragObj.Src.dragCallback)
(dragObj.Src.dragCallback)(evt, "DRAG", dragObj);
- if(dragObj.Target.dropCallback)
+ if (dragObj.Target.dropCallback)
(dragObj.Target.dropCallback)(evt, "DRAGOVER", dragObj);
}
}
@@ -580,72 +551,61 @@ function ww_evt_mmov_doc(gui, evt)
dragObj.objCursor.style.visibility = "hidden";
}
*/
-function ww_evt_mup_doc(gui, evt)
-{
+function ww_evt_mup_doc(gui, evt) {
var gui = eval(gui);
var srcElement = (evt.target) ? evt.target : evt.srcElement;
var src0;
- for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode)
+ for (src0 = srcElement; src0 && !src0.id; src0 = src0.parentNode)
;
var button;
- if(typeof(evt.which) != 'undefined')
- button = gui.firefoxButtons["b"+evt.which];
+ if (typeof(evt.which) != 'undefined')
+ button = gui.firefoxButtons["b" + evt.which];
else
button = evt.button;
var xmouse = parseInt(evt.clientX);
var ymouse = parseInt(evt.clientY);
var e;
var clickfound = false;
- for(e=src0; e && (!e.tagName || !clickfound); e=e.parentNode)
- {
- if(e && e.clickable)
- {
+ for (e = src0; e && (!e.tagName || !clickfound); e = e.parentNode) {
+ if (e && e.clickable) {
clickObj.X = xmouse;
clickObj.Y = ymouse;
clickObj.Src = e;
clickObj.Src0 = src0;
clickfound = true;
- if(e.clickCallback)
- {
- if(button == 1 && !evt.ctrlKey) // left button
+ if (e.clickCallback) {
+ if (button == 1 && !evt.ctrlKey) // left button
acceptClick = (e.clickCallback)(evt, evt.ctrlKey ? "RMOUSEUP" : "MOUSEUP", clickObj);
- else
- if(button == 2 && !evt.ctrlKey) // right button
+ else if (button == 2 && !evt.ctrlKey) // right button
acceptClick = (e.clickCallback)(evt, "RMOUSEUP", clickObj);
}
}
}
- if(!dragObj.Src)
- {
- if(dragObj.objCursor)
+ if (!dragObj.Src) {
+ if (dragObj.objCursor)
dragObj.objCursor.style.visibility = "hidden";
}
- else
- {
- if(dragObj.dragging==2)
- {
- for(e=src0; e && (!e.tagName || !e.droppable); e=e.parentNode)
- {
+ else {
+ if (dragObj.dragging == 2) {
+ for (e = src0; e && (!e.tagName || !e.droppable); e = e.parentNode) {
;
}
- if(e)
- {
- if(dragObj.Target && e == dragObj.Target)
- {
- if(dragObj.Target.ondrop)
+ if (e) {
+ if (dragObj.Target && e == dragObj.Target) {
+ if (dragObj.Target.ondrop)
(dragObj.Target.ondrop)();
- if(dragObj.Target.dropCallback)
+ if (dragObj.Target.dropCallback)
(dragObj.Target.dropCallback)(evt, "DROP", dragObj);
}
}
}
- if(dragObj.Src.dropCallback)
+ if (dragObj.Src.dropCallback)
(dragObj.Src.dropCallback)(evt, "DRAGEND", dragObj);
dragObj.dragging = 0;
dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null;
- if(dragObj.objCursor)
+ if (dragObj.objCursor)
dragObj.objCursor.style.visibility = "hidden";
}
/*
@@ -679,28 +639,25 @@ function ww_evt_mup_doc(gui, evt)
}
-
-function ww_evt_kon_doc(gui, evt)
-{
+function ww_evt_kon_doc(gui, evt) {
var gui = eval(gui);
- if(gui.elemBalloon)
+ if (gui.elemBalloon)
gui.elemBalloon.style.visibility = "hidden";
- if(timer_ballon)
- {
+ if (timer_ballon) {
clearTimeout(timer_ballon);
timer_ballon = null;
}
- if(!dragObj.objCursor)
+ if (!dragObj.objCursor)
dragObj.objCursor = document.getElementById("dragDropCursor");
dragObj.Src0 = dragObj.Src = dragObj.Target = dragObj.Target0 = null;
dragObj.dragging = 0;
var srcElement = (evt.target) ? evt.target : evt.srcElement;
var src0;
- for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode)
+ for (src0 = srcElement; src0 && !src0.id; src0 = src0.parentNode)
;
var dragfound = false;
@@ -709,17 +666,14 @@ function ww_evt_kon_doc(gui, evt)
var ymouse = parseInt(evt.clientY);
var acceptClick = true;
var e;
- for(var e=src0; e && acceptClick && (!e.tagName || !dragfound || !clickfound); e=e.parentNode)
- {
- if(e && e.clickable)
- {
+ for (var e = src0; e && acceptClick && (!e.tagName || !dragfound || !clickfound); e = e.parentNode) {
+ if (e && e.clickable) {
clickObj.X = xmouse;
clickObj.Y = ymouse;
clickObj.Src = e;
clickObj.Src0 = src0;
clickfound = true;
- if(e.clickCallback)
- {
+ if (e.clickCallback) {
// var js = "cbDD_T0('CONTEXTMENU', '"+src0.id+"')";
// self.setTimeout(js, 3000);
// (js)();
@@ -794,22 +748,18 @@ function ww_evt_kon_doc(gui, evt)
var timer_ballon = null;
var under_ballon = null;
-function timeout_ballon(id, xmouse, ymouse)
-{
+function timeout_ballon(id, xmouse, ymouse) {
var src0;
- if(src0 = document.getElementById(id))
- {
+ if (src0 = document.getElementById(id)) {
var clickfound = false;
- for(var e=src0; e && (!e.tagName || !clickfound); e=e.parentNode)
- {
- if(e && e.clickable)
- {
+ for (var e = src0; e && (!e.tagName || !clickfound); e = e.parentNode) {
+ if (e && e.clickable) {
balloonObj.X = xmouse;
balloonObj.Y = ymouse;
balloonObj.Src = e;
balloonObj.Src0 = src0;
clickfound = true;
- if(e.clickCallback)
+ if (e.clickCallback)
(e.clickCallback)(null, "BALLOON", balloonObj);
}
}
@@ -818,15 +768,12 @@ function timeout_ballon(id, xmouse, ymouse)
timer_ballon = null;
}
-function ww_evt_balloon(msg)
-{
+function ww_evt_balloon(msg) {
// for(var i=0; i<24; i++)
// msg += " \n"+i;
- var measurediv=0;
- if(measurediv)
- {
- if(!this.elemMeasureBalloon)
- {
+ var measurediv = 0;
+ if (measurediv) {
+ if (!this.elemMeasureBalloon) {
var div = this.document.createElement("div");
div.style.position = "absolute";
div.style.top = div.style.left = "0px";
@@ -838,9 +785,8 @@ function ww_evt_balloon(msg)
}
}
- var k=7;
- if(!this.elemBalloon)
- {
+ var k = 7;
+ if (!this.elemBalloon) {
var div = this.document.createElement("div");
div.style.overflow = "visible";
div.style.position = "absolute";
@@ -849,16 +795,15 @@ function ww_evt_balloon(msg)
div.style.backgroundColor = "#ff8800";
div.style.zIndex = 999;
- for(var i=1; ialert('loaded');";
var msg_h = this.elemMeasureBalloon.clientHeight;
var msg_w = this.elemMeasureBalloon.clientWidth;
@@ -889,15 +833,13 @@ function ww_evt_balloon(msg)
// var msg_sbox = this.elemBalloon.firstChild;
// var msg_tbox = this.elemBalloon.children.item(k<1 ? 0 : k-1);
- var msg_tbox = this.elemBalloon.childNodes[k<1 ? 0 : k-1];
- if(measurediv)
- {
+ var msg_tbox = this.elemBalloon.childNodes[k < 1 ? 0 : k - 1];
+ if (measurediv) {
msg_tbox.innerHTML = msg;
- msg_tbox.style.width = (msg_w+0)+"px";
- msg_tbox.style.height = (msg_h+0)+"px";
+ msg_tbox.style.width = (msg_w + 0) + "px";
+ msg_tbox.style.height = (msg_h + 0) + "px";
}
- else
- {
+ else {
// this.elemBalloon.style.visibility = "visible";
this.elemBalloon.style.top = "0px";
this.elemBalloon.style.left = "0px";
@@ -906,28 +848,25 @@ function ww_evt_balloon(msg)
msg_tbox.innerHTML = msg;
var msg_h = this.elemBalloon.clientHeight;
var msg_w = this.elemBalloon.clientWidth;
- msg_tbox.style.width = (msg_w-4)+"px";
- msg_tbox.style.height = (msg_h-4)+"px";
+ msg_tbox.style.width = (msg_w - 4) + "px";
+ msg_tbox.style.height = (msg_h - 4) + "px";
}
- var ymouse = 0+balloonObj.Y;
- var xmouse = 0+balloonObj.X;
+ var ymouse = 0 + balloonObj.Y;
+ var xmouse = 0 + balloonObj.X;
var body_h = document.documentElement.clientHeight;
var msg_t;
msg_t = ymouse + 5; // en dessous
- if(msg_t + msg_h > body_h)
- {
+ if (msg_t + msg_h > body_h) {
// tiens pas en dessous
msg_t = ymouse - msg_h - 3; // au dessus
- if(msg_t < 3)
- {
+ if (msg_t < 3) {
// tiens pas au dessus
msg_t = body_h - msg_h - 10; // colle en bas
- if(msg_t < 3)
- {
+ if (msg_t < 3) {
// tiens pas colle en bas
msg_t = 3; // colle en haut, tant pis si ea deborde en bas
}
@@ -936,45 +875,36 @@ function ww_evt_balloon(msg)
var msg_l;
msg_l = xmouse + 3;
- this.elemBalloon.style.top = msg_t+"px";
- this.elemBalloon.style.left = msg_l+"px";
+ this.elemBalloon.style.top = msg_t + "px";
+ this.elemBalloon.style.left = msg_l + "px";
this.elemBalloon.style.visibility = "visible";
}
-function evt_false()
-{
+function evt_false() {
return false;
}
-function evt_true()
-{
+function evt_true() {
return true;
}
-function ww_mdwn_win(idx)
-{
+function ww_mdwn_win(idx) {
wf = this.frontWindow();
- if(wf.modal && this.twin[idx] != wf)
- {
+ if (wf.modal && this.twin[idx] != wf) {
wf.blink();
return(false);
}
- if(o = document.getElementById(this.varname+"w"+idx))
- {
+ if (o = document.getElementById(this.varname + "w" + idx)) {
e = window.event;
z = o.style.zIndex;
- if(z != 99)
- {
+ if (z != 99) {
o.style.zIndex = this.twin[idx].properties["z-index"] = this.maxdepth;
- for(i=0; i z && z2 != 99)
- {
+ if (z2 > z && z2 != 99) {
z2--;
o2.style.zIndex = this.twin[i].properties["z-index"] = z2;
}
@@ -982,7 +912,7 @@ function ww_mdwn_win(idx)
}
}
- this.w_active=idx;
+ this.w_active = idx;
this.new_t = this.t0 = o.offsetTop;
this.new_l = this.l0 = o.offsetLeft;
@@ -996,16 +926,13 @@ function ww_mdwn_win(idx)
}
return false;
}
-function ww_evt_mdwn_window(idx)
-{
+function ww_evt_mdwn_window(idx) {
this.mdwn_win(idx);
}
-function ww_evt_mdwn_title(idx)
-{
- if(!this.twin[idx] || this.twin[idx].moveable<=0)
+function ww_evt_mdwn_title(idx) {
+ if (!this.twin[idx] || this.twin[idx].moveable <= 0)
return;
- if(this.mdwn_win(idx))
- {
+ if (this.mdwn_win(idx)) {
// this.twin[idx].hide();
/* for(w in this.twin)
{
@@ -1019,48 +946,43 @@ function ww_evt_mdwn_title(idx)
/*
*/
window.event.cancelBubble = true;
- if(window.event.stopPropagation)
+ if (window.event.stopPropagation)
window.event.stopPropagation();
}
}
-function ww_evt_mdwn_sizer(idx)
-{
- if(!this.twin[idx] || this.twin[idx].sizeable<=0)
+function ww_evt_mdwn_sizer(idx) {
+ if (!this.twin[idx] || this.twin[idx].sizeable <= 0)
return;
- if(this.mdwn_win(idx))
+ if (this.mdwn_win(idx))
this.sizing = true;
window.event.cancelBubble = true;
- if(window.event.stopPropagation)
+ if (window.event.stopPropagation)
window.event.stopPropagation();
}
-function ww_evt_mdwn_reducer(idx)
-{
+function ww_evt_mdwn_reducer(idx) {
// alert("recucer");
- if(o = document.getElementById(this.varname+"w"+idx))
- {
- if(this.twin[idx].reduced)
- {
+ if (o = document.getElementById(this.varname + "w" + idx)) {
+ if (this.twin[idx].reduced) {
// restore
// o.style.clip = "rect(auto auto auto auto)";
// alert(this.twin[idx].oldheight);
- this.twin[idx].setProperties({height:this.twin[idx].oldheight+"px"});
+ this.twin[idx].setProperties({height: this.twin[idx].oldheight + "px"});
//o.style.height = (this.twin[idx].oldheight + "px");
this.twin[idx].reduced = false;
}
- else
- {
+ else {
// reduce
// o.style.clip = "rect(0px auto 17px auto)";
this.twin[idx].oldheight = parseInt(o.style.height);
- tith = (document.getElementById(this.varname+"tbar"+idx).clientHeight) + "px";
+ tith = (document.getElementById(this.varname + "tbar" + idx).clientHeight) + "px";
- this.twin[idx].setProperties({height:tith});
+ this.twin[idx].setProperties({height: tith});
this.twin[idx].reduced = true;
}
}
window.event.cancelBubble = true;
- if(window.event.stopPropagation)
+ if (window.event.stopPropagation)
window.event.stopPropagation();
//if(!this.twin[idx] || this.twin[idx].sizeable<=0)
// return;
@@ -1068,18 +990,15 @@ function ww_evt_mdwn_reducer(idx)
// this.sizing = true;
}
-function ww_evt_mdwn_closer(idx)
-{
- if(o = document.getElementById(this.varname+"w"+idx))
- {
+function ww_evt_mdwn_closer(idx) {
+ if (o = document.getElementById(this.varname + "w" + idx)) {
// alert(this.twin[idx].onclose);
- if(!this.twin[idx].onclose || (this.twin[idx].onclose)(this.twin[idx])==true)
- {
+ if (!this.twin[idx].onclose || (this.twin[idx].onclose)(this.twin[idx]) == true) {
this.twin[idx].hide();
// o.style.visibility = "hidden";
}
window.event.cancelBubble = true;
- if(window.event.stopPropagation)
+ if (window.event.stopPropagation)
window.event.stopPropagation();
}
}
@@ -1142,30 +1061,27 @@ function ww_evt_mdwn_closer(idx)
return false;
}
*/
-function ww_setProperties(properties)
-{
+function ww_setProperties(properties) {
style = "";
- for(p in this.properties)
- {
- if(properties[p])
+ for (p in this.properties) {
+ if (properties[p])
this.properties[p] = properties[p];
- style += p + ":" + this.properties[p] + ";" ;
+ style += p + ":" + this.properties[p] + ";";
}
// if(this.reduced)
// style += "clip:rect(0px auto 17px auto);" ;
- document.getElementById(this.varname+"w"+this.idx).style.cssText = style;
+ document.getElementById(this.varname + "w" + this.idx).style.cssText = style;
// alert("ww_setProperties : style="+style);
- tith = document.getElementById(this.varname+"tbar"+this.idx).clientHeight;
+ tith = document.getElementById(this.varname + "tbar" + this.idx).clientHeight;
// alert("tith=" + tith);
tv = false;
win_w = parseInt(this.properties.width);
win_h = parseInt(this.properties.height);
- o_h = win_h-tith-2;
- if(o_h < 0)
+ o_h = win_h - tith - 2;
+ if (o_h < 0)
o_h = 0;
- if(this.twoviews && (o = document.getElementById(this.varname+"e"+this.idx).style))
- {
+ if (this.twoviews && (o = document.getElementById(this.varname + "e" + this.idx).style)) {
/*
if(this.hasscroll)
o.overflow = "scroll";
@@ -1173,32 +1089,30 @@ function ww_setProperties(properties)
o.overflow = "hiddden";
*/
tv = true;
- o.height = (o_h) + "px" ;
- o.width = (Math.round(win_w*.25)-2) + "px" ;
+ o.height = (o_h) + "px";
+ o.width = (Math.round(win_w * .25) - 2) + "px";
// document.getElementById(this.varname+"e"+this.idx).style.cssText = style;
}
- if(o = document.getElementById(this.varname+"c"+this.idx).style)
- {
+ if (o = document.getElementById(this.varname + "c" + this.idx).style) {
/*
if(this.hasscroll)
o.style.overflow = "scroll";
else
o.style.overflow = "hiddden";
*/
- o.height = (o_h) + "px" ;
- if(tv)
- o.width = (Math.round(win_w*.75)-2) + "px" ;
+ o.height = (o_h) + "px";
+ if (tv)
+ o.width = (Math.round(win_w * .75) - 2) + "px";
else
- o.width = (Math.round(win_w*1)-2) + "px" ;
+ o.width = (Math.round(win_w * 1) - 2) + "px";
// style += "width:" + document.getElementById(this.varname+"c"+this.idx).style.width+";";
// alert("ww_setProperties : style=" + style);
// document.getElementById(this.varname+"c"+this.idx).style.cssText = style;
}
- if(o = document.getElementById(this.varname+"r"+this.idx))
- {
- t = "top:" + (parseInt(this.properties.height)-18) + "px; left:" + (parseInt(this.properties.width)-18) + "px;" ;
+ if (o = document.getElementById(this.varname + "r" + this.idx)) {
+ t = "top:" + (parseInt(this.properties.height) - 18) + "px; left:" + (parseInt(this.properties.width) - 18) + "px;";
o.style.cssText = t;
}
}
@@ -1219,19 +1133,17 @@ function ww_setProperties(properties)
return true;
}
*/
-function ww_repaint()
-{
+function ww_repaint() {
w = parseInt(this.gui.twin[this.idx].properties.width);
h = parseInt(this.gui.twin[this.idx].properties.height);
- this.gui.twin[this.idx].setProperties( { width:(w)+"px", height:(h)+"px" } );
+ this.gui.twin[this.idx].setProperties({ width: (w) + "px", height: (h) + "px" });
}
-function ww_sizeto(w, h)
-{
- if(w == -1)
+function ww_sizeto(w, h) {
+ if (w == -1)
w = parseInt(this.gui.twin[this.idx].properties.width);
- if(h == -1)
+ if (h == -1)
h = parseInt(this.gui.twin[this.idx].properties.height);
- this.gui.twin[this.idx].setProperties( { width:(w)+"px", height:(h)+"px" } );
+ this.gui.twin[this.idx].setProperties({ width: (w) + "px", height: (h) + "px" });
/*
if(w != -1 && h != -1)
this.gui.twin[this.idx].setProperties( { width:(w)+"px", height:(h)+"px" } );
@@ -1242,55 +1154,44 @@ function ww_sizeto(w, h)
if(h != -1)
this.gui.twin[this.idx].setProperties( { height:(h)+"px" } );
*/
- if(this.gui.twin[this.idx].onresized)
+ if (this.gui.twin[this.idx].onresized)
(this.gui.twin[this.idx].onresized)(parseInt(this.gui.twin[this.idx].properties.top)
, parseInt(this.gui.twin[this.idx].properties.left), w, h);
}
-function ww_moveto(t, l)
-{
- this.gui.twin[this.idx].setProperties( { top:(t)+"px", left:(l)+"px" } );
+function ww_moveto(t, l) {
+ this.gui.twin[this.idx].setProperties({ top: (t) + "px", left: (l) + "px" });
}
-function ww_setTitle(t)
-{
- document.getElementById(this.varname+"t"+this.idx).innerHTML = " "+t;
+function ww_setTitle(t) {
+ document.getElementById(this.varname + "t" + this.idx).innerHTML = " " + t;
}
-function ww_setContent(t, view)
-{
- if(!view || !this.twoviews || view != "e")
+function ww_setContent(t, view) {
+ if (!view || !this.twoviews || view != "e")
view = "c";
- document.getElementById(this.varname+view+this.idx).innerHTML = t;
+ document.getElementById(this.varname + view + this.idx).innerHTML = t;
}
-function ww_show()
-{
+function ww_show() {
this.properties.visibility = "visible";
- document.getElementById(this.varname+"w"+this.idx).style.visibility = "visible";
+ document.getElementById(this.varname + "w" + this.idx).style.visibility = "visible";
}
-function ww_toFront()
-{
+function ww_toFront() {
wf = this.gui.frontWindow();
- if(wf.modal && this != wf)
- {
+ if (wf.modal && this != wf) {
wf.blink();
return(false);
}
var o;
- if(o = document.getElementById(this.varname+"w"+this.idx))
- {
+ if (o = document.getElementById(this.varname + "w" + this.idx)) {
e = window.event;
z = o.style.zIndex;
- if(z != 99)
- {
+ if (z != 99) {
o.style.zIndex = this.gui.twin[this.idx].properties["z-index"] = this.gui.maxdepth;
- for(i=0; i z && z2 != 99)
- {
+ if (z2 > z && z2 != 99) {
z2--;
o2.style.zIndex = this.gui.twin[i].properties["z-index"] = z2;
}
@@ -1299,7 +1200,7 @@ function ww_toFront()
// this.gui.frontWindow = this.idx;
}
- this.gui.w_active=this.idx;
+ this.gui.w_active = this.idx;
this.gui.new_t = this.gui.t0 = o.offsetTop;
this.gui.new_l = this.gui.l0 = o.offsetLeft;
@@ -1309,71 +1210,59 @@ function ww_toFront()
}
return false;
}
-function ww_hide()
-{
+function ww_hide() {
this.properties.visibility = "hidden";
- document.getElementById(this.varname+"w"+this.idx).style.visibility = "hidden";
+ document.getElementById(this.varname + "w" + this.idx).style.visibility = "hidden";
}
-function ww_blink()
-{
- if(o = document.getElementById(this.varname+"t"+this.idx))
- {
+function ww_blink() {
+ if (o = document.getElementById(this.varname + "t" + this.idx)) {
o.className = "ww_title_blink";
- window.setTimeout("ww_noblink('"+this.varname+"t"+this.idx+"');", 500);
+ window.setTimeout("ww_noblink('" + this.varname + "t" + this.idx + "');", 500);
}
}
-function ww_noblink(titleid)
-{
- if(o = document.getElementById(titleid))
+function ww_noblink(titleid) {
+ if (o = document.getElementById(titleid))
o.className = "ww_title";
}
-function ww_getClientSize(view)
-{
- if(!view || !this.twoviews || view != "e")
+function ww_getClientSize(view) {
+ if (!view || !this.twoviews || view != "e")
view = "c";
- if(o = document.getElementById(this.varname+view+this.idx))
- {
+ if (o = document.getElementById(this.varname + view + this.idx)) {
// alert("ww_getClientSize : o.style.width="+o.style.width + " o.style.height="+o.style.height );
// return({w:(o.clientWidth-20), h:(o.clientHeight-2)});
- return({w:(parseInt(o.style.width)-2), h:(parseInt(o.style.height)-2)});
+ return({w: (parseInt(o.style.width) - 2), h: (parseInt(o.style.height) - 2)});
}
return(null);
}
-function ww_autoMove()
-{
+function ww_autoMove() {
// alert("ww_autoMove");
var moved = false;
var sized = false;
- if(o = document.getElementById(this.varname+"w"+this.idx).style)
- {
+ if (o = document.getElementById(this.varname + "w" + this.idx).style) {
wgui = document.getElementById(this.gui.desktop).clientWidth;
hgui = document.getElementById(this.gui.desktop).clientHeight;
twin = parseInt(o.top);
lwin = parseInt(o.left);
wwin = parseInt(o.width);
hwin = parseInt(o.height);
- bwin = twin+hwin;
- if(lwin > wgui-wwin)
- {
- lwin = wgui-wwin;
+ bwin = twin + hwin;
+ if (lwin > wgui - wwin) {
+ lwin = wgui - wwin;
moved = true;
}
- if(lwin < 0)
- {
+ if (lwin < 0) {
lwin = 0;
wwin = wgui;
moved = true;
sized = true;
}
- if(twin > hgui-hwin)
- {
- twin = hgui-hwin;
+ if (twin > hgui - hwin) {
+ twin = hgui - hwin;
moved = true;
}
- if(twin < 0)
- {
+ if (twin < 0) {
twin = 0;
hwin = hgui;
moved = true;
@@ -1381,9 +1270,9 @@ function ww_autoMove()
}
// o.top = twin+"px";
// o.left = lwin+"px";
- if(moved)
+ if (moved)
this.moveto(twin, lwin);
- if(sized)
+ if (sized)
this.sizeto(wwin, hwin);
// this.setProperties( {top:twin+"px", left:lwin+"px" } );
}
@@ -1391,16 +1280,15 @@ function ww_autoMove()
*/
}
-function ww_Window(gui, anchor, varname, idx, properties)
-{
- if(!document.getElementById(anchor))
+function ww_Window(gui, anchor, varname, idx, properties) {
+ if (!document.getElementById(anchor))
return;
oldContent = document.getElementById(anchor).innerHTML;
this.gui = gui;
this.varname = varname;
this.idx = idx;
this.anchor = anchor;
- this.properties = { top:"0px", left:"0px", width:"200px", height:"200px", "z-index":"0", visibility:"visible" };
+ this.properties = { top: "0px", left: "0px", width: "200px", height: "200px", "z-index": "0", visibility: "visible" };
// this.evt_mdwn_window = ww_evt_mdwn_window;
// this.evt_mdwn_title = ww_evt_mdwn_title;
@@ -1420,26 +1308,25 @@ function ww_Window(gui, anchor, varname, idx, properties)
this.blink = ww_blink;
this.getClientSize = ww_getClientSize;
// this.mdwn_win = ww_mdwn_win;
- this.modal = (properties.modal && properties.modal>0);
- this.twoviews = (properties.twoviews && properties.twoviews>0);
- this.hasscroll = (properties.scroll && properties.scroll>0);
- this.closeable = (properties.closeable && properties.closeable>0);
- this.moveable = (properties.moveable && properties.moveable>0);
- this.sizeable = (properties.sizeable && properties.sizeable>0);
- this.visibility = (properties.visibility && properties.visibility=="hidden") ? "hidden":"visible";
- this.ontop = (properties.ontop && properties.ontop>0);
- this.minwidth = (properties.minwidth && properties.minwidth>0) ? properties.minwidth : 50;
- this.maxwidth = (properties.maxwidth && properties.maxwidth>0) ? properties.maxwidth : 20000;
- this.minheight = (properties.minheight && properties.minheight>0) ? properties.minheight : 40;
- this.maxheight = (properties.maxheight && properties.maxheight>0) ? properties.maxheight : 20000;
+ this.modal = (properties.modal && properties.modal > 0);
+ this.twoviews = (properties.twoviews && properties.twoviews > 0);
+ this.hasscroll = (properties.scroll && properties.scroll > 0);
+ this.closeable = (properties.closeable && properties.closeable > 0);
+ this.moveable = (properties.moveable && properties.moveable > 0);
+ this.sizeable = (properties.sizeable && properties.sizeable > 0);
+ this.visibility = (properties.visibility && properties.visibility == "hidden") ? "hidden" : "visible";
+ this.ontop = (properties.ontop && properties.ontop > 0);
+ this.minwidth = (properties.minwidth && properties.minwidth > 0) ? properties.minwidth : 50;
+ this.maxwidth = (properties.maxwidth && properties.maxwidth > 0) ? properties.maxwidth : 20000;
+ this.minheight = (properties.minheight && properties.minheight > 0) ? properties.minheight : 40;
+ this.maxheight = (properties.maxheight && properties.maxheight > 0) ? properties.maxheight : 20000;
this.onresized = properties.onresized;
this.oncreated = properties.oncreated;
this.onclose = properties.onclose;
this.reduced = false;
this.oldheight = -1;
- if(!this.ontop)
- {
+ if (!this.ontop) {
// gui.frontWindow = this;
this.properties["z-index"] = ++gui.maxdepth;
}
@@ -1448,40 +1335,35 @@ function ww_Window(gui, anchor, varname, idx, properties)
s = "";
style = "";
- for(p in this.properties)
- {
- if(properties[p])
- {
- if(p=="height")
- {
- if(parseInt(properties[p])<60)
+ for (p in this.properties) {
+ if (properties[p]) {
+ if (p == "height") {
+ if (parseInt(properties[p]) < 60)
properties[p] = "60px";
}
this.properties[p] = properties[p];
}
- style += p + ":" + this.properties[p] + ";" ;
+ style += p + ":" + this.properties[p] + ";";
}
- s += "\n";
+ s += " \n";
// s += " ";
// s += " ";
// s += " ";
s += " ";
- s += " \n";
+ s += " \n";
s += " ";
s += " ";
s += "  | ";
- if(properties.title)
- {
+ if (properties.title) {
// s += " " + properties.title + " | ";
- s += " " + properties.title + " | ";
+ s += " " + properties.title + " | ";
}
else
s += " | ";
- if(properties.title2)
- {
- s += ""+properties.title2+" | \n";
+ if (properties.title2) {
+ s += "" + properties.title2 + " | \n";
s += " | \n";
}
@@ -1494,9 +1376,9 @@ function ww_Window(gui, anchor, varname, idx, properties)
s += "\n";
- s += "  ";
- if(this.closeable)
- s += "  \n";
+ s += "  ";
+ if (this.closeable)
+ s += "  \n";
//else
// s += " ";
s += " \n";
@@ -1505,29 +1387,26 @@ function ww_Window(gui, anchor, varname, idx, properties)
//s += "";
style = "";
- if(this.hasscroll)
+ if (this.hasscroll)
style += "overflow:scroll;";
else
style += "overflow:hidden;";
- if(properties.width)
- style += "width" + ":" + (parseInt(this.properties["width"])-2) + "px;" ;
- if(properties.heigth)
- style += "heigth" + ":" + (parseInt(this.properties["heigth"])-20) + "px;" ;
+ if (properties.width)
+ style += "width" + ":" + (parseInt(this.properties["width"]) - 2) + "px;";
+ if (properties.heigth)
+ style += "heigth" + ":" + (parseInt(this.properties["heigth"]) - 20) + "px;";
- if(this.twoviews)
- {
- s += " \n";
- s += " " + oldContent + " \n";
+ if (this.twoviews) {
+ s += " \n";
+ s += " " + oldContent + " \n";
}
- else
- {
- s += " "+oldContent+" \n";
+ else {
+ s += " " + oldContent + " \n";
}
- if(this.sizeable)
- {
- s += " \n";
+ if (this.sizeable) {
+ s += " \n";
}
// alert("ww_Window : style=" + style);
//s += " \n";
@@ -1537,28 +1416,25 @@ function ww_Window(gui, anchor, varname, idx, properties)
// alert(s);
// document.write(s);
document.getElementById(anchor).innerHTML = s;
- this.setProperties( this.properties );
- if(this.oncreated)
+ this.setProperties(this.properties);
+ if (this.oncreated)
(this.oncreated)();
return this;
}
-function ww_createWindow(anchor, properties)
-{
+function ww_createWindow(anchor, properties) {
this.twin[this.nwin] = new ww_Window(this, anchor, this.varname, this.nwin, properties);
//this.nwin++;
return(this.twin[this.nwin++]);
}
-function ww_getWinPosAsXML()
-{
- var t="";
+function ww_getWinPosAsXML() {
+ var t = "";
// t += "<"++"?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\r\n";
- for(w in this.twin)
- {
+ for (w in this.twin) {
t += " z && z2 != 99)
- {
+ if (z2 > z && z2 != 99) {
z = z2;
idx = i;
}
@@ -1589,8 +1461,7 @@ function ww_frontWindow()
return(idx >= 0 ? this.twin[idx] : null);
}
-function ww_openCenterWindow(zurl, w, h, name, params)
-{
+function ww_openCenterWindow(zurl, w, h, name, params) {
p = new Array();
p.directories = "no";
p.location = "no";
@@ -1599,37 +1470,32 @@ function ww_openCenterWindow(zurl, w, h, name, params)
p.help = "no";
p.status = "no";
p.resizable = "no";
- for(cc in params)
- {
- if(p[params[cc].n])
+ for (cc in params) {
+ if (p[params[cc].n])
p[params[cc].n] = params[cc].v;
}
- t = ((document.getElementById(this.desktop).clientHeight - h)/2) + self.screenTop;
- l = ((document.getElementById(this.desktop).clientWidth - w)/2) + self.screenLeft;
- if(t<10)
+ t = ((document.getElementById(this.desktop).clientHeight - h) / 2) + self.screenTop;
+ l = ((document.getElementById(this.desktop).clientWidth - w) / 2) + self.screenLeft;
+ if (t < 10)
t = 10;
- if(l<10)
+ if (l < 10)
l = 10;
- s = "top="+t+", left="+l+", width="+w+", height="+h;
- for(cc in p)
+ s = "top=" + t + ", left=" + l + ", width=" + w + ", height=" + h;
+ for (cc in p)
s += "," + cc + "=" + p[cc];
return(window.open(zurl, name, s, true));
}
-function ww_select(obj)
-{
+function ww_select(obj) {
this.unselect();
- if(obj)
- {
+ if (obj) {
obj.className = obj.className.replace("s_", "S_");
this.selectedObject = obj;
}
}
-function ww_unselect()
-{
- if(this.selectedObject)
- {
+function ww_unselect() {
+ if (this.selectedObject) {
var cn = this.selectedObject.className;
cn = cn.replace("S_", "s_");
this.selectedObject.className = cn;
@@ -1637,18 +1503,16 @@ function ww_unselect()
}
}
-function ww_runAsMenu(event, backparm)
-{
+function ww_runAsMenu(event, backparm) {
// alert(event);
this.backparm = backparm;
- if(this.gui.activeMenu != null)
- {
+ if (this.gui.activeMenu != null) {
this.gui.activeMenu.style.visibility = "hidden";
this.gui.activeMenu = null;
}
- if(typeof(event.which) != 'undefined')
- button = this.gui.firefoxButtons["b"+event.which]; // safari aussi ???
+ if (typeof(event.which) != 'undefined')
+ button = this.gui.firefoxButtons["b" + event.which]; // safari aussi ???
else
button = event.button;
xmouse = parseInt(event.clientX);
@@ -1661,71 +1525,61 @@ function ww_runAsMenu(event, backparm)
var bodyH = document.documentElement.clientHeight;
- if(ymouse+this.clientHeight < bodyH)
- {
+ if (ymouse + this.clientHeight < bodyH) {
// menu en dessous
- this.style.top = (ymouse-3)+"px";
- this.style.left = (xmouse-3)+"px";
+ this.style.top = (ymouse - 3) + "px";
+ this.style.left = (xmouse - 3) + "px";
}
- else
- {
+ else {
// menu au dessus
- this.style.top = (ymouse+0-this.clientHeight)+"px";
- this.style.left = (xmouse-3)+"px";
+ this.style.top = (ymouse + 0 - this.clientHeight) + "px";
+ this.style.left = (xmouse - 3) + "px";
}
this.style.visibility = "visible";
this.gui.activeMenu = this;
}
-function ww_dieMenu(mid)
-{
+function ww_dieMenu(mid) {
var m = document.getElementById(mid);
- if(m.gui.activeMenu)
- {
+ if (m.gui.activeMenu) {
m.style.visibility = "hidden";
m.gui.activeMenu = null;
(m.menuCallback)("DIE", m.backparm, null);
}
}
-function ww_evt_mouseout_menu()
-{
- this.dieMenuTimer = self.setTimeout("ww_dieMenu('"+this.id+"');", 500);
+function ww_evt_mouseout_menu() {
+ this.dieMenuTimer = self.setTimeout("ww_dieMenu('" + this.id + "');", 500);
}
-function ww_evt_mousemove_menu()
-{
+function ww_evt_mousemove_menu() {
// var str=''; for (var k in event) {str+='event.'+k+'='+event[k]+' \n'}
// document.getElementById("debug").innerHTML = "MOVE "+(iiii++)+" \n" + str ;
- if(this.dieMenuTimer)
- {
+ if (this.dieMenuTimer) {
clearTimeout(this.dieMenuTimer);
this.dieMenuTimer = null;
}
}
-function ww_evt_click_menu(e)
-{
- if(this.dieMenuTimer)
- {
+function ww_evt_click_menu(e) {
+ if (this.dieMenuTimer) {
clearTimeout(this.dieMenuTimer);
this.dieMenuTimer = null;
}
- if(!e)
+ if (!e)
e = window.event;
var tg = (e.target) ? e.target : e.srcElement;
- while(tg && (tg.nodeType!=1 || !tg.id))
+ while (tg && (tg.nodeType != 1 || !tg.id))
tg = tg.parentNode;
- if(tg.className=="disabled")
+ if (tg.className == "disabled")
return;
this.style.visibility = "hidden";
this.gui.activeMenu = null;
(this.menuCallback)("SELECT", this.backparm, tg.id);
}
-function ww_setAsMenu(id, callback)
-{
- o=this.document.getElementById(id);
- o.ismenu=1;
- o.gui=this;
- o.runAsMenu=ww_runAsMenu;
+function ww_setAsMenu(id, callback) {
+ o = this.document.getElementById(id);
+ o.ismenu = 1;
+ o.gui = this;
+ o.runAsMenu = ww_runAsMenu;
o.menuCallback = callback;
o.onmouseout = ww_evt_mouseout_menu;
o.onmousemove = ww_evt_mousemove_menu;
@@ -1733,21 +1587,20 @@ function ww_setAsMenu(id, callback)
}
-function GUI(varname, idbody, skin)
-{
- this.firefoxButtons = {"b65536":0, "b1":1, "b2":4, "b3":2};
- if(!skin)
+function GUI(varname, idbody, skin) {
+ this.firefoxButtons = {"b65536": 0, "b1": 1, "b2": 4, "b3": 2};
+ if (!skin)
skin = "FR";
this.skin = skin;
this.document = document;
- this.sizing=false,
- this.dragging=false,
+ this.sizing = false,
+ this.dragging = false,
this.w_active = -1,
this.varname = varname;
- this.t0=0, this.l0=0, // le top/left initial de la win
- this.w0=0, this.h0=0, // le width/height
- this.x0=0, this.y0=0, // la pos de la souris
- this.new_t=0, this.new_l=0, this.new_w=0, this.new_h=0;
+ this.t0 = 0, this.l0 = 0, // le top/left initial de la win
+ this.w0 = 0, this.h0 = 0, // le width/height
+ this.x0 = 0, this.y0 = 0, // la pos de la souris
+ this.new_t = 0, this.new_l = 0, this.new_w = 0, this.new_h = 0;
this.nwin = 0;
this.twin = new Array(); // le tableau des win
this.maxdepth = 0; // le zindex de la win au premier plan (hors win 'ontop')
@@ -1759,11 +1612,11 @@ function GUI(varname, idbody, skin)
this.createWindow = ww_createWindow;
this.frontWindow = ww_frontWindow;
this.evt_mdwn_window = ww_evt_mdwn_window;
- this.evt_mdwn_title = ww_evt_mdwn_title;
- this.evt_mdwn_sizer = ww_evt_mdwn_sizer;
- this.evt_mdwn_reducer = ww_evt_mdwn_reducer;
- this.evt_mdwn_closer = ww_evt_mdwn_closer;
- this.showBalloon = ww_evt_balloon;
+ this.evt_mdwn_title = ww_evt_mdwn_title;
+ this.evt_mdwn_sizer = ww_evt_mdwn_sizer;
+ this.evt_mdwn_reducer = ww_evt_mdwn_reducer;
+ this.evt_mdwn_closer = ww_evt_mdwn_closer;
+ this.showBalloon = ww_evt_balloon;
this.mdwn_win = ww_mdwn_win;
this.getWinPosAsXML = ww_getWinPosAsXML;
this.openCenterWindow = ww_openCenterWindow;
@@ -1773,7 +1626,7 @@ function GUI(varname, idbody, skin)
var node;
node = document.createElement("div");
- node.id = this.varname+"wb";
+ node.id = this.varname + "wb";
node.className = "ww_winborder";
this.windowBorder = desk.appendChild(node);
// this.windowBorder = document.getElementById("winborder");
@@ -1788,38 +1641,54 @@ function GUI(varname, idbody, skin)
node.src = "cursors/nodrop01.gif";
dragObj.objCursor = desk.appendChild(node);
- desk.onmousemove = function (e) {ww_evt_mmov_doc(varname, (e ? e : window.event));};
+ desk.onmousemove = function (e) {
+ ww_evt_mmov_doc(varname, (e ? e : window.event));
+ };
desk.onmousedown = function (e) {
var evt = e ? e : window.event;
// ---- prevent selection into ff
var srcElement = evt.srcElement ? evt.srcElement : evt.target;
- if (typeof evt.preventDefault != 'undefined' && (srcElement.tagName!="INPUT" && srcElement.tagName!="SELECT" && srcElement.tagName!="TEXTAREA"))
- {
+ if (typeof evt.preventDefault != 'undefined' && (srcElement.tagName != "INPUT" && srcElement.tagName != "SELECT" && srcElement.tagName != "TEXTAREA")) {
evt.preventDefault();
}
// ----
ww_evt_mdwn_doc(varname, evt);
};
- desk.onmouseup = function (e) {ww_evt_mup_doc(varname, (e ? e : window.event));};
+ desk.onmouseup = function (e) {
+ ww_evt_mup_doc(varname, (e ? e : window.event));
+ };
- if(typeof(document.onselectstart) != "undefined")
- {
+ if (typeof(document.onselectstart) != "undefined") {
// ie
document.onselectstart = evt_select_doc;
}
// on interdit les menus contextuels de explorer
// document.oncontextmenu = function (e) { if(e){e.returnValue=false}else{window.event.returnValue=false}; return false; };
- document.oncontextmenu = function (e) {ww_evt_kon_doc(varname, (e ? e : window.event));};
+ document.oncontextmenu = function (e) {
+ ww_evt_kon_doc(varname, (e ? e : window.event));
+ };
- this.setClickable = function(id, clickCallback){o=this.document.getElementById(id); o.clickable=1; o.clickCallback=clickCallback; };
- this.setDraggable = function(id, dragCallback){o=this.document.getElementById(id); o.draggable=1; o.dragCallback=dragCallback; };
- this.setDroppable = function(id, dropCallback){o=this.document.getElementById(id); o.droppable=1; o.dropCallback=dropCallback; };
+ this.setClickable = function (id, clickCallback) {
+ o = this.document.getElementById(id);
+ o.clickable = 1;
+ o.clickCallback = clickCallback;
+ };
+ this.setDraggable = function (id, dragCallback) {
+ o = this.document.getElementById(id);
+ o.draggable = 1;
+ o.dragCallback = dragCallback;
+ };
+ this.setDroppable = function (id, dropCallback) {
+ o = this.document.getElementById(id);
+ o.droppable = 1;
+ o.dropCallback = dropCallback;
+ };
this.activeMenu = null;
// this.setAsMenu = function(id){o=this.document.getElementById(id); o.ismenu=1; o.gui=this; o.runAsMenu=ww_runAsMenu};
- this.setAsMenu = ww_setAsMenu;
+ this.setAsMenu = ww_setAsMenu;
this.selectedObject = null;
this.select = ww_select;
@@ -1870,47 +1739,43 @@ function GUI(varname, idbody, skin)
*/
}
-function evt_select_doc(evt)
-{
+function evt_select_doc(evt) {
evt = evt ? evt : window.event;
var srcElement = evt.srcElement ? evt.srcElement : evt.target;
- return(srcElement.tagName=="INPUT" || srcElement.tagName=="TEXTAREA");
+ return(srcElement.tagName == "INPUT" || srcElement.tagName == "TEXTAREA");
}
-function w2md(e)
-{
- if(!e)
+function w2md(e) {
+ if (!e)
e = window.event;
// var str=''; for (var k in e) {str+='event.'+k+'='+e[k]+' \n'}
// document.getElementById("debug").innerHTML = "DOWN "+(iiii++)+" \n" + str ;
- document.getElementById("debug").innerHTML += "DOWN " ;
- e.cancelBubble=true;
- e.returnValue=false;
+ document.getElementById("debug").innerHTML += "DOWN ";
+ e.cancelBubble = true;
+ e.returnValue = false;
// e.stopPropagation();
return(false);
}
-function w2mu(e)
-{
- if(!e)
+function w2mu(e) {
+ if (!e)
e = window.event;
// var str=''; for (var k in e) {str+='event.'+k+'='+e[k]+' \n'}
// document.getElementById("debug").innerHTML = "UP "+(iiii++)+" \n" + str ;
- document.getElementById("debug").innerHTML += "UP " ;
- e.cancelBubble=true;
- e.returnValue=false;
+ document.getElementById("debug").innerHTML += "UP ";
+ e.cancelBubble = true;
+ e.returnValue = false;
// e.stopPropagation();
return(false);
}
-function w2k(e)
-{
- if(!e)
+function w2k(e) {
+ if (!e)
e = window.event;
// var str=''; for (var k in e) {str+='event.'+k+'='+e[k]+' \n'}
// document.getElementById("debug").innerHTML = "KON "+(iiii++)+" \n" + str ;
- document.getElementById("debug").innerHTML += "KON " ;
+ document.getElementById("debug").innerHTML += "KON ";
// e.cancelBubble=true;
// e.returnValue=false;
// e.stopPropagation();
@@ -1918,26 +1783,23 @@ function w2k(e)
}
-function ww_selectStart()
-{
- return(window.event.srcElement.tagName=="INPUT" || window.event.srcElement.tagName=="TEXTAREA");
+function ww_selectStart() {
+ return(window.event.srcElement.tagName == "INPUT" || window.event.srcElement.tagName == "TEXTAREA");
}
escapeCharString = "*+@-/";
-escapeCharCodes = new Array( 42,43,64,45,47 );
-function fullEscape(s)
-{
- var s2,ret,i,x,c;
+escapeCharCodes = new Array(42, 43, 64, 45, 47);
+function fullEscape(s) {
+ var s2, ret, i, x, c;
s2 = escape(s);
ret = "";
- for(i=0; i |