Fix JS code style

This commit is contained in:
Romain Neutron
2013-11-11 11:25:52 +01:00
parent ea6b93b88a
commit dc5c12a592
52 changed files with 11500 additions and 11500 deletions

View File

@@ -32,7 +32,7 @@ define([
ModalView, ModalView,
SaveView, SaveView,
DcFieldView DcFieldView
) { ) {
var expect = chai.expect; var expect = chai.expect;
var assert = chai.assert; var assert = chai.assert;
var should = chai.should(); var should = chai.should();

View File

@@ -12,7 +12,7 @@ define([
FormView, FormView,
InputView, InputView,
ErrorView ErrorView
) { ) {
var expect = chai.expect; var expect = chai.expect;
var assert = chai.assert; var assert = chai.assert;
var should = chai.should(); var should = chai.should();

View File

@@ -71,7 +71,7 @@ function ini_edit_usrs(){
$('#users_rights_form div.switch_right').bind('click', function(event){ $('#users_rights_form div.switch_right').bind('click', function(event){
user_click_box(event, $(this)); user_click_box(event, $(this));
}); });
$('#right-ajax button.users_rights_valid').bind('click', function(){ $('#right-ajax button.users_rights_valid').bind('click', function(){
var datas = { var datas = {
users:$('#users_rights_form input[name="users"]').val(), users:$('#users_rights_form input[name="users"]').val(),
values:$('#users_rights_form').serialize(), values:$('#users_rights_form').serialize(),

View File

@@ -918,18 +918,18 @@ function set_image_position(smooth, image, width, height, container, callback)
{ {
callback = function(){}; callback = function(){};
} }
} }
dimensions.width = parseInt(width); dimensions.width = parseInt(width);
dimensions.height = parseInt(height); dimensions.height = parseInt(height);
// if(smooth) // if(smooth)
// { // {
// $(image).stop().animate(dimensions,500,callback); // $(image).stop().animate(dimensions,500,callback);
// } // }
// else // else
// { // {
$(image).css(dimensions); $(image).css(dimensions);
callback; callback;
// } // }
} }

View File

@@ -4,7 +4,7 @@ $(document).ready(function(){
$('.confirm_report').live('click',function(){ $('.confirm_report').live('click',function(){
var $this = $(this); var $this = $(this);
$('.loader', $this).css({ $('.loader', $this).css({
@@ -39,7 +39,7 @@ $('.confirm_report').live('click',function(){
return; return;
} }
}); });
}); });
$('.agreement_radio').live('vmousedown', function(){ $('.agreement_radio').live('vmousedown', function(){
var sselcont_id = $(this).attr('for').split('_').pop(); var sselcont_id = $(this).attr('for').split('_').pop();

View File

@@ -1961,7 +1961,7 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
} }
}); });
$('#EDIT_MID_R') $('#EDIT_MID_R')
.css('left', $('#EDIT_MID_L').position().left + $('#EDIT_MID_L').width() + 15) .css('left', $('#EDIT_MID_L').position().left + $('#EDIT_MID_L').width() + 15)
.resizable({ .resizable({
handles : 'w', handles : 'w',

View File

@@ -67,7 +67,7 @@ function showFound2(term, lterm, branch, depth)
thb.className = "ob"; thb.className = "ob";
} }
// } // }
/* /*
if(depth == 0) if(depth == 0)
{ {
document.getElementById("WT1").style.visibility="hidden"; document.getElementById("WT1").style.visibility="hidden";
@@ -77,7 +77,7 @@ function showFound2(term, lterm, branch, depth)
evt_kup_T1(); evt_kup_T1();
} }
} }
*/ */
return(ret); return(ret);
} }
@@ -241,8 +241,8 @@ function dirty()
document.getElementById("saveButton").style.display = ""; document.getElementById("saveButton").style.display = "";
} }
/* /*
function delTerm(inputName, zTerm) // inputName = "TS"|"TA"|"SY" function delTerm(inputName, zTerm) // inputName = "TS"|"TA"|"SY"
{ {
if(typeof(zTerm)=="undefined") if(typeof(zTerm)=="undefined")
zTerm = document.forms["fTh"]["text"+inputName].value; zTerm = document.forms["fTh"]["text"+inputName].value;
@@ -330,18 +330,18 @@ function delTerm(inputName, zTerm) // inputName = "TS"|"TA"|"SY"
// alert("Le terme associé '"+newterm+"' n' existe pas."); // alert("Le terme associé '"+newterm+"' n' existe pas.");
} }
evt_kup(inputName); evt_kup(inputName);
} }
*/ */
/* /*
// supprime un terme et tous ses fils (deplace la branche dans '(deleted)' ) // supprime un terme et tous ses fils (deplace la branche dans '(deleted)' )
function deleteBranch(the, thb_deleted) function deleteBranch(the, thb_deleted)
{ {
newdel = thb_deleted.appendChild(the.cloneNode(true)); newdel = thb_deleted.appendChild(the.cloneNode(true));
deleteBranch0(newdel, "R"+thb_deleted.parentNode.id.substr(1)); deleteBranch0(newdel, "R"+thb_deleted.parentNode.id.substr(1));
} }
function deleteBranch0(node, pfxid) function deleteBranch0(node, pfxid)
{ {
if(node.id && node.id.substr(0,2)=="TH") if(node.id && node.id.substr(0,2)=="TH")
{ {
oldid = node.oldid ? node.oldid : node.id.substr(4); oldid = node.oldid ? node.oldid : node.id.substr(4);
@@ -360,8 +360,8 @@ function deleteBranch0(node, pfxid)
{ {
deleteBranch0(node, pfxid); deleteBranch0(node, pfxid);
} }
} }
*/ */
// supprime un terme et tous ses fils (deplace 'e plat') dans '(deleted)' // supprime un terme et tous ses fils (deplace 'e plat') dans '(deleted)'
function deleteBranch(the, thb_deleted) function deleteBranch(the, thb_deleted)
{ {

View File

@@ -55,8 +55,8 @@ function evt_dblclk_doc(event, gui)
var iiii=0; var iiii=0;
function ww_evt_mdwn_doc(gui, evt) function ww_evt_mdwn_doc(gui, evt)
{ {
var gui = eval(gui); var gui = eval(gui);
if(gui.elemBalloon) if(gui.elemBalloon)
@@ -168,11 +168,11 @@ var iiii=0;
} }
evt.cancelBubble = true; evt.cancelBubble = true;
evt.returnValue = false; evt.returnValue = false;
} }
/* /*
function unused_evt_mmov_doc(event, gui) function unused_evt_mmov_doc(event, gui)
{ {
var gui = eval(gui); var gui = eval(gui);
var button, xmouse, ymouse; var button, xmouse, ymouse;
@@ -275,11 +275,11 @@ function unused_evt_mmov_doc(event, gui)
} }
} }
} }
} }
*/ */
function ww_evt_mmov_doc(gui, evt) function ww_evt_mmov_doc(gui, evt)
{ {
var gui = eval(gui); var gui = eval(gui);
var button, xmouse, ymouse; var button, xmouse, ymouse;
@@ -383,7 +383,7 @@ function unused_evt_mmov_doc(event, gui)
} }
return; // if drag/drop, don't care about moving windows return; // if drag/drop, don't care about moving windows
} }
/* /*
dragObj.objCursor.style.visibility = "hidden"; dragObj.objCursor.style.visibility = "hidden";
// msg("" + (e.clientX) + " - " + (e.clientY) ); // msg("" + (e.clientX) + " - " + (e.clientY) );
@@ -402,7 +402,7 @@ function unused_evt_mmov_doc(event, gui)
{ {
var opos = gui.sliding.opos; var opos = gui.sliding.opos;
var npos = opos + (xmouse - gui.x0); var npos = opos + (xmouse - gui.x0);
// self.status = "otop=" + otop + " ntop="+ntop; // self.status = "otop=" + otop + " ntop="+ntop;
if(npos < 0) if(npos < 0)
npos = 0; npos = 0;
else if(npos > gui.sliding.posmax ) else if(npos > gui.sliding.posmax )
@@ -429,7 +429,7 @@ function unused_evt_mmov_doc(event, gui)
{ {
var otop = parseInt(gui.splitting.getAttribute('otop')); var otop = parseInt(gui.splitting.getAttribute('otop'));
var ntop = otop + (ymouse - gui.y0); var ntop = otop + (ymouse - gui.y0);
// self.status = "otop=" + otop + " ntop="+ntop; // self.status = "otop=" + otop + " ntop="+ntop;
if(ntop > 40 && ntop < hwin-40 ) if(ntop > 40 && ntop < hwin-40 )
gui.splitting.style.top = ntop+"px"; gui.splitting.style.top = ntop+"px";
} }
@@ -437,7 +437,7 @@ function unused_evt_mmov_doc(event, gui)
{ {
var oleft = parseInt(gui.splitting.getAttribute('oleft')); var oleft = parseInt(gui.splitting.getAttribute('oleft'));
var nleft = oleft + (xmouse - gui.x0); var nleft = oleft + (xmouse - gui.x0);
// self.status = "otop=" + otop + " ntop="+ntop; // self.status = "otop=" + otop + " ntop="+ntop;
if(nleft > 40 && nleft < wwin-40 ) if(nleft > 40 && nleft < wwin-40 )
gui.splitting.style.left = nleft+"px"; gui.splitting.style.left = nleft+"px";
} }
@@ -496,22 +496,22 @@ function unused_evt_mmov_doc(event, gui)
gui.windowBorder.style.width = (gui.new_w-4)+"px"; gui.windowBorder.style.width = (gui.new_w-4)+"px";
gui.windowBorder.style.height = (gui.new_h-4)+"px"; gui.windowBorder.style.height = (gui.new_h-4)+"px";
} }
t += "z-index:999; display:block; background-color:#FFFF00; position:absolute;" t += "z-index:999; display:block; background-color:#FFFF00; position:absolute;"
// self.status = t; // self.status = t;
// gui.twin[gui.w_active].hide(); // gui.twin[gui.w_active].hide();
// document.getElementById(gui.varname+"w"+gui.w_active).style.display = "none"; // document.getElementById(gui.varname+"w"+gui.w_active).style.display = "none";
// document.getElementById(gui.varname+"wb").style.cssText = t; // document.getElementById(gui.varname+"wb").style.cssText = t;
// gui.windowBorder.style.cssText = t; // gui.windowBorder.style.cssText = t;
} }
*/ */
return false; return false;
} }
/* /*
function unused_evt_mup_doc(event, gui) function unused_evt_mup_doc(event, gui)
{ {
var gui = eval(gui); var gui = eval(gui);
var srcElement = (event.target) ? event.target : event.srcElement; var srcElement = (event.target) ? event.target : event.srcElement;
var src0; var src0;
@@ -578,10 +578,10 @@ function unused_evt_mup_doc(event, gui)
dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null; dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null;
if(dragObj.objCursor) if(dragObj.objCursor)
dragObj.objCursor.style.visibility = "hidden"; dragObj.objCursor.style.visibility = "hidden";
} }
*/ */
function ww_evt_mup_doc(gui, evt) function ww_evt_mup_doc(gui, evt)
{ {
var gui = eval(gui); var gui = eval(gui);
var srcElement = (evt.target) ? evt.target : evt.srcElement; var srcElement = (evt.target) ? evt.target : evt.srcElement;
var src0; var src0;
@@ -648,7 +648,7 @@ function unused_evt_mup_doc(event, gui)
if(dragObj.objCursor) if(dragObj.objCursor)
dragObj.objCursor.style.visibility = "hidden"; dragObj.objCursor.style.visibility = "hidden";
} }
/* /*
if(gui.sliding) if(gui.sliding)
{ {
gui.sliding = null; gui.sliding = null;
@@ -674,9 +674,9 @@ function unused_evt_mup_doc(event, gui)
gui.dragging = gui.sizing = false; gui.dragging = gui.sizing = false;
// eval(gui.twin[gui.w_active].onresized); // eval(gui.twin[gui.w_active].onresized);
} }
*/ */
return true; return true;
} }
@@ -733,10 +733,10 @@ function ww_evt_kon_doc(gui, evt)
} }
/* /*
function disabled_evt_kon_doc(event, gui) function disabled_evt_kon_doc(event, gui)
{ {
// var str=''; for (var k in event) {str+='event.'+k+'='+event[k]+'<br/>\n'} // var str=''; for (var k in event) {str+='event.'+k+'='+event[k]+'<br/>\n'}
// document.getElementById("debug").innerHTML = "KON "+(iiii++)+"<br/>\n" + str ; // document.getElementById("debug").innerHTML = "KON "+(iiii++)+"<br/>\n" + str ;
var gui = eval(gui); var gui = eval(gui);
@@ -784,9 +784,9 @@ function disabled_evt_kon_doc(event, gui)
} }
event.cancelBubble = true; event.cancelBubble = true;
event.returnValue = false; event.returnValue = false;
// document.getElementById("debug").innerHTML = "src0:("+src0.tagName+" id="+src0.id+" "+src0.draggable+")<br/>e:("+e.tagName+" id="+e.id+" "+e.draggable+") --- "+dragObj.dragging; // document.getElementById("debug").innerHTML = "src0:("+src0.tagName+" id="+src0.id+" "+src0.draggable+")<br/>e:("+e.tagName+" id="+e.id+" "+e.draggable+") --- "+dragObj.dragging;
} }
*/ */
// ------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------
@@ -1086,11 +1086,11 @@ function ww_evt_mdwn_closer(idx)
/* /*
function ww_evt_mdwn_doc(gui) function ww_evt_mdwn_doc(gui)
{ {
// gui = eval(gui); // gui = eval(gui);
// if(window.event.srcElement.id == gui.desktop) // if(window.event.srcElement.id == gui.desktop)
// { // {
// on a clique sur le bureau // on a clique sur le bureau
if(window.event.srcElement.onMenu && (window.event.altKey || window.event.button==2)) if(window.event.srcElement.onMenu && (window.event.altKey || window.event.button==2))
{ {
@@ -1098,12 +1098,12 @@ function ww_evt_mdwn_doc(gui)
window.event.returnValue = false; window.event.returnValue = false;
return(false); return(false);
} }
// } // }
} }
*/ */
/* /*
function ww_evt_mmov_doc(gui) function ww_evt_mmov_doc(gui)
{ {
gui = eval(gui); gui = eval(gui);
e = window.event; e = window.event;
// msg("" + (e.clientX) + " - " + (e.clientY) ); // msg("" + (e.clientX) + " - " + (e.clientY) );
@@ -1140,8 +1140,8 @@ function ww_evt_mmov_doc(gui)
document.getElementById(gui.varname+"wb").style.cssText = t; document.getElementById(gui.varname+"wb").style.cssText = t;
} }
return false; return false;
} }
*/ */
function ww_setProperties(properties) function ww_setProperties(properties)
{ {
style = ""; style = "";
@@ -1203,8 +1203,8 @@ function ww_setProperties(properties)
} }
} }
/* /*
function ww_evt_mup_doc(gui) function ww_evt_mup_doc(gui)
{ {
gui = eval(gui); gui = eval(gui);
if((gui.w_active != -1) && (gui.dragging || gui.sizing)) if((gui.w_active != -1) && (gui.dragging || gui.sizing))
{ {
@@ -1217,8 +1217,8 @@ function ww_evt_mup_doc(gui)
gui.dragging = gui.sizing = false; gui.dragging = gui.sizing = false;
} }
return true; return true;
} }
*/ */
function ww_repaint() function ww_repaint()
{ {
w = parseInt(this.gui.twin[this.idx].properties.width); w = parseInt(this.gui.twin[this.idx].properties.width);
@@ -1232,7 +1232,7 @@ function ww_sizeto(w, h)
if(h == -1) if(h == -1)
h = parseInt(this.gui.twin[this.idx].properties.height); 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) if(w != -1 && h != -1)
this.gui.twin[this.idx].setProperties( { width:(w)+"px", height:(h)+"px" } ); this.gui.twin[this.idx].setProperties( { width:(w)+"px", height:(h)+"px" } );
else else
@@ -1241,7 +1241,7 @@ function ww_sizeto(w, h)
else else
if(h != -1) if(h != -1)
this.gui.twin[this.idx].setProperties( { height:(h)+"px" } ); 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) (this.gui.twin[this.idx].onresized)(parseInt(this.gui.twin[this.idx].properties.top)
, parseInt(this.gui.twin[this.idx].properties.left), w, h); , parseInt(this.gui.twin[this.idx].properties.left), w, h);
@@ -1387,8 +1387,8 @@ function ww_autoMove()
this.sizeto(wwin, hwin); this.sizeto(wwin, hwin);
// this.setProperties( {top:twin+"px", left:lwin+"px" } ); // this.setProperties( {top:twin+"px", left:lwin+"px" } );
} }
/* /*
*/ */
} }
function ww_Window(gui, anchor, varname, idx, properties) function ww_Window(gui, anchor, varname, idx, properties)
@@ -1826,7 +1826,7 @@ function GUI(varname, idbody, skin)
this.unselect = ww_unselect; this.unselect = ww_unselect;
this.setDragObj = ww_setDragObj; this.setDragObj = ww_setDragObj;
/* /*
s = "<div id=\""+this.varname+"wb\" class=\"ww_winborder\"></div>"; s = "<div id=\""+this.varname+"wb\" class=\"ww_winborder\"></div>";
s += "<img id=\"dragDropCursor\" style=\"position:absolute; top:50px; left:50px; z-index:99; visibility:hidden\" src=\"/skins/icons/nodrop01.gif\">"; s += "<img id=\"dragDropCursor\" style=\"position:absolute; top:50px; left:50px; z-index:99; visibility:hidden\" src=\"/skins/icons/nodrop01.gif\">";
document.write(s); document.write(s);
@@ -1852,22 +1852,22 @@ function GUI(varname, idbody, skin)
// on interdit les menus contextuels de explorer... ? // on interdit les menus contextuels de explorer... ?
// document.oncontextmenu = function () { window.event.returnValue=false; return false; }; // document.oncontextmenu = function () { window.event.returnValue=false; return false; };
// ... en fait on simule un 'mousedown' pour safari qui ne le fait pas avec les souris 2 bouton // ... en fait on simule un 'mousedown' pour safari qui ne le fait pas avec les souris 2 bouton
// var old = (document.oncontextmenu) ? document.oncontextmenu : function () {}; // var old = (document.oncontextmenu) ? document.oncontextmenu : function () {};
// document.oncontextmenu = function(e){if(e){old(e, varname); window.event.returnValue=false; return(evt_mdwn_doc(e, varname));}else{old(window.event, varname); window.event.returnValue=false; return(evt_mdwn_doc(window.event, varname));}}; // document.oncontextmenu = function(e){if(e){old(e, varname); window.event.returnValue=false; return(evt_mdwn_doc(e, varname));}else{old(window.event, varname); window.event.returnValue=false; return(evt_mdwn_doc(window.event, varname));}};
// document.oncontextmenu = function(e){if(e){old(e, varname); alert('rz'); return(evt_mdwn_doc(e, varname));}else{old(window.event, varname); alert('xc'); return(evt_mdwn_doc(window.event, varname));}}; // document.oncontextmenu = function(e){if(e){old(e, varname); alert('rz'); return(evt_mdwn_doc(e, varname));}else{old(window.event, varname); alert('xc'); return(evt_mdwn_doc(window.event, varname));}};
// document.oncontextmenu = function(e){if(e){old(e, varname); return(evt_kon_doc(e, varname));}else{old(window.event, varname); return(evt_kon_doc(window.event, varname));} }; // document.oncontextmenu = function(e){if(e){old(e, varname); return(evt_kon_doc(e, varname));}else{old(window.event, varname); return(evt_kon_doc(window.event, varname));} };
// document.onmousedown = w2md; // document.onmousedown = w2md;
// document.onmouseup = w2mu; // document.onmouseup = w2mu;
document.oncontextmenu = function(e){if(!e) e=window.event; e.returnValue=false; document.oncontextmenu = function(e){if(!e) e=window.event; e.returnValue=false;
if(e.stopPropagation) e.stopPropagation(); if(e.stopPropagation) e.stopPropagation();
if(e.preventDefault) e.preventDefault(); if(e.preventDefault) e.preventDefault();
return true; return true;
}; };
*/ */
} }
function evt_select_doc(evt) function evt_select_doc(evt)