diff --git a/www/include/jquery.common.js b/www/include/jquery.common.js index 1a03f7fef9..de02e23ad7 100644 --- a/www/include/jquery.common.js +++ b/www/include/jquery.common.js @@ -1,82 +1,82 @@ var p4 = p4 || {}; $(document).ready(function(){ - $('input.input-button').hover( - function(){$(this).addClass('hover');}, - function(){$(this).removeClass('hover');} - ); + $('input.input-button').hover( + function(){$(this).addClass('hover');}, + function(){$(this).removeClass('hover');} + ); - var locale = $.cookie('locale'); + var locale = $.cookie('locale'); - var jq_date = p4.lng = typeof locale !== "undefined" ? locale.split('_').reverse().pop() : 'en'; + var jq_date = p4.lng = typeof locale !== "undefined" ? locale.split('_').reverse().pop() : 'en'; - if(jq_date == 'en') - { - jq_date = 'en-GB'; - } + if(jq_date == 'en') + { + jq_date = 'en-GB'; + } - $.datepicker.setDefaults({showMonthAfterYear: false}); - $.datepicker.setDefaults($.datepicker.regional[jq_date]); + $.datepicker.setDefaults({showMonthAfterYear: false}); + $.datepicker.setDefaults($.datepicker.regional[jq_date]); - $('a.infoDialog,div.infoDialog').live('click',function(event){ - console.log("click"); - infoDialog($(this)); - }); + $('a.infoDialog,div.infoDialog').live('click',function(event){ + console.log("click"); + infoDialog($(this)); + }); - var cache = $('#mainMenu .helpcontextmenu'); - $('.context-menu-item',cache).hover(function(){$(this).addClass('context-menu-item-hover');},function(){$(this).removeClass('context-menu-item-hover');}); + var cache = $('#mainMenu .helpcontextmenu'); + $('.context-menu-item',cache).hover(function(){$(this).addClass('context-menu-item-hover');},function(){$(this).removeClass('context-menu-item-hover');}); - $('#help-trigger').contextMenu('#mainMenu .helpcontextmenu',{openEvt:'click',dropDown:true,theme:'vista', dropDown:true, - showTransition:'slideDown', - hideTransition:'hide', - shadow:false - }); + $('#help-trigger').contextMenu('#mainMenu .helpcontextmenu',{openEvt:'click',dropDown:true,theme:'vista', dropDown:true, + showTransition:'slideDown', + hideTransition:'hide', + shadow:false + }); - $('#notification_trigger').bind('mousedown',function(event){ - event.stopPropagation(); - var box = $('#notification_box'); - if($(this).hasClass('open')) - { - box.hide(); - $(this).removeClass('open'); - clear_notifications(); - } - else - { - box.show(); + $('#notification_trigger').bind('mousedown',function(event){ + event.stopPropagation(); + var box = $('#notification_box'); + if($(this).hasClass('open')) + { + box.hide(); + $(this).removeClass('open'); + clear_notifications(); + } + else + { + box.show(); - fix_notification_height(); + fix_notification_height(); - $(this).addClass('open'); - read_notifications(); - } - }); + $(this).addClass('open'); + read_notifications(); + } + }); - $(this).bind('mousedown',function(){ - var not_trigger = $('#notification_trigger'); - if(not_trigger.hasClass('open')) - not_trigger.trigger('click'); - }); - $('#notification_box').bind('mousedown',function(event){ - event.stopPropagation(); - }); + $(this).bind('mousedown',function(){ + var not_trigger = $('#notification_trigger'); + if(not_trigger.hasClass('open')) + not_trigger.trigger('click'); + }); + $('#notification_box').bind('mousedown',function(event){ + event.stopPropagation(); + }); - $('#notification_box div.notification').live('mouseover',function(){$(this).addClass('hover');}); - $('#notification_box div.notification').live('mouseout',function(){$(this).removeClass('hover');}); + $('#notification_box div.notification').live('mouseover',function(){$(this).addClass('hover');}); + $('#notification_box div.notification').live('mouseout',function(){$(this).removeClass('hover');}); - $(this).bind('mousedown',function(){ - var box = $('#notification_box'); - if($('#notification_trigger').hasClass('open')) - { - box.hide(); - $('#notification_trigger').removeClass('open'); - clear_notifications(); - } - }); + $(this).bind('mousedown',function(){ + var box = $('#notification_box'); + if($('#notification_trigger').hasClass('open')) + { + box.hide(); + $('#notification_trigger').removeClass('open'); + clear_notifications(); + } + }); - set_notif_position(); + set_notif_position(); }); @@ -84,149 +84,149 @@ $(document).ready(function(){ function login(what) { - if (confirm(language.confirmRedirectAuth)) { - if(what != undefined) - { - EcrireCookie('last_act',what,null,'/'); - } - self.location.replace('/login/?postlog=1'); - } - return false; + if (confirm(language.confirmRedirectAuth)) { + if(what != undefined) + { + EcrireCookie('last_act',what,null,'/'); + } + self.location.replace('/login/?postlog=1'); + } + return false; } function EcrireCookie(nom, valeur) { - var argv=EcrireCookie.arguments; - var argc=EcrireCookie.arguments.length; - var expires=(argc > 2) ? argv[2] : null; - var path=(argc > 3) ? argv[3] : null; - var domain=(argc > 4) ? argv[4] : null; - var secure=(argc > 5) ? argv[5] : false; - var cook = nom+"="+escape(valeur)+ - ((expires===null) ? "" : ("; expires="+expires.toGMTString()))+ - ((path===null) ? "" : ("; path="+path))+ - ((domain===null) ? "" : ("; domain="+domain))+ - ((secure===true) ? "; secure" : ""); - document.cookie = cook; + var argv=EcrireCookie.arguments; + var argc=EcrireCookie.arguments.length; + var expires=(argc > 2) ? argv[2] : null; + var path=(argc > 3) ? argv[3] : null; + var domain=(argc > 4) ? argv[4] : null; + var secure=(argc > 5) ? argv[5] : false; + var cook = nom+"="+escape(valeur)+ + ((expires===null) ? "" : ("; expires="+expires.toGMTString()))+ + ((path===null) ? "" : ("; path="+path))+ + ((domain===null) ? "" : ("; domain="+domain))+ + ((secure===true) ? "; secure" : ""); + document.cookie = cook; } function fix_notification_height() { - var box = $('#notification_box'); - var not = $('.notification',box); - var n = not.length; - var not_t = $('.notification_title',box); - var n_t = not_t.length; + var box = $('#notification_box'); + var not = $('.notification',box); + var n = not.length; + var not_t = $('.notification_title',box); + var n_t = not_t.length; - h = not.outerHeight() * n + not_t.outerHeight() * n_t; - h = h > 350 ? 350 : h; + h = not.outerHeight() * n + not_t.outerHeight() * n_t; + h = h > 350 ? 350 : h; - box.stop().animate({height:h}); + box.stop().animate({height:h}); } function set_notif_position() { - var trigger = $('#notification_trigger'); - if(trigger.length === 0) - return; - $('#notification_box').css({ - 'left':Math.round(trigger.offset().left - 1) - }); + var trigger = $('#notification_trigger'); + if(trigger.length === 0) + return; + $('#notification_box').css({ + 'left':Math.round(trigger.offset().left - 1) + }); } $(window).bind('resize', function(){ - set_notif_position(); + set_notif_position(); }); function print_notifications(page) { - page = parseInt(page); - var buttons = {}; + page = parseInt(page); + var buttons = {}; - buttons[language.fermer] = function(){ - $('#notifications-dialog').dialog('close'); - }; + buttons[language.fermer] = function(){ + $('#notifications-dialog').dialog('close'); + }; - if($('#notifications-dialog').length === 0) - $('body').append('
'); + if($('#notifications-dialog').length === 0) + $('body').append('
'); - $('#notifications-dialog') - .dialog({ - title:language.notifications, - autoOpen:false, - closeOnEscape:true, - resizable:false, - draggable:false, - modal:true, - width:500, - height:400, - overlay: { - backgroundColor: '#000', - opacity: 0.7 - }, - close:function(event,ui) - { - $('#notifications-dialog').dialog('destroy').remove(); - } - }).dialog('option','buttons',buttons) - .dialog('open'); + $('#notifications-dialog') + .dialog({ + title:language.notifications, + autoOpen:false, + closeOnEscape:true, + resizable:false, + draggable:false, + modal:true, + width:500, + height:400, + overlay: { + backgroundColor: '#000', + opacity: 0.7 + }, + close:function(event,ui) + { + $('#notifications-dialog').dialog('destroy').remove(); + } + }).dialog('option','buttons',buttons) + .dialog('open'); - $.ajax({ - type: "GET", - url: "/user/notifications/", - dataType : 'json', - data: { - page:page - }, - error: function(data){ - $('#notifications-dialog').removeClass('loading'); - }, - timeout: function(data){ - $('#notifications-dialog').removeClass('loading'); - }, - success: function(data){ - $('#notifications-dialog').removeClass('loading'); - var cont = $('#notifications-dialog'); + $.ajax({ + type: "GET", + url: "/user/notifications/", + dataType : 'json', + data: { + page:page + }, + error: function(data){ + $('#notifications-dialog').removeClass('loading'); + }, + timeout: function(data){ + $('#notifications-dialog').removeClass('loading'); + }, + success: function(data){ + $('#notifications-dialog').removeClass('loading'); + var cont = $('#notifications-dialog'); - if(page === 0) - cont.empty(); - else - $('.notification_next',cont).remove(); + if(page === 0) + cont.empty(); + else + $('.notification_next',cont).remove(); - for (i in data.notifications) - { - var id = 'notif_date_'+i; - var date_cont = $('#'+id); - if(date_cont.length === 0) - { - cont.append('
'+data.notifications[i].display+'
'); - date_cont = $('#'+id); - } + for (i in data.notifications) + { + var id = 'notif_date_'+i; + var date_cont = $('#'+id); + if(date_cont.length === 0) + { + cont.append('
'+data.notifications[i].display+'
'); + date_cont = $('#'+id); + } - for (j in data.notifications[i].notifications) - { - var loc_dat = data.notifications[i].notifications[j]; - var html = '
'+ - '
'+ - loc_dat.icon+ - ''+ - '
'+ - loc_dat.text+' '+loc_dat.time+'
'+ - '
'+ - '
'; - date_cont.append(html); - } - } + for (j in data.notifications[i].notifications) + { + var loc_dat = data.notifications[i].notifications[j]; + var html = '
'+ + '
'+ + loc_dat.icon+ + ''+ + '
'+ + loc_dat.text+' '+loc_dat.time+'
'+ + '
'+ + '
'; + date_cont.append(html); + } + } - var next_ln = $.trim(data.next); + var next_ln = $.trim(data.next); - if(next_ln !== '') - { - cont.append('
'+next_ln+'
'); - } + if(next_ln !== '') + { + cont.append('
'+next_ln+'
'); + } // '
'. // '"; + s += "
'. @@ -238,40 +238,40 @@ function print_notifications(page) // '' - } - }); + } + }); } function read_notifications() { - var notifications = []; + var notifications = []; - $('#notification_box .unread').each(function(){ - notifications.push($(this).attr('id').split('_').pop()); - }); + $('#notification_box .unread').each(function(){ + notifications.push($(this).attr('id').split('_').pop()); + }); - $.ajax({ - type: "POST", - url: "/user/notifications/read/", - data: { - notifications:notifications.join('_') - }, - success: function(data){ - $('#notification_trigger .counter').css('visibility','hidden').empty(); - } - }); + $.ajax({ + type: "POST", + url: "/user/notifications/read/", + data: { + notifications:notifications.join('_') + }, + success: function(data){ + $('#notification_trigger .counter').css('visibility','hidden').empty(); + } + }); } function clear_notifications() { - var unread = $('#notification_box .unread'); + var unread = $('#notification_box .unread'); - if(unread.length === 0) - return; + if(unread.length === 0) + return; - unread.removeClass('unread'); - $('#notification_trigger .counter').css('visibility','hidden').empty(); + unread.removeClass('unread'); + $('#notification_trigger .counter').css('visibility','hidden').empty(); } @@ -283,254 +283,254 @@ function clear_notifications() function getMyRss(renew) { - $.ajax({ - type: "POST", - url: "/prod/prodFeedBack.php", - dataType: 'json', - data: datas, - success: function(data){ - } - }); + $.ajax({ + type: "POST", + url: "/prod/prodFeedBack.php", + dataType: 'json', + data: datas, + success: function(data){ + } + }); } function setPref(name,value) { - if(jQuery.data['pref_'+name] && jQuery.data['pref_'+name].abort) - { - jQuery.data['pref_'+name].abort(); - jQuery.data['pref_'+name] = false; - } + if(jQuery.data['pref_'+name] && jQuery.data['pref_'+name].abort) + { + jQuery.data['pref_'+name].abort(); + jQuery.data['pref_'+name] = false; + } - jQuery.data['pref_'+name] = $.ajax({ - type: "POST", - url: "/user/preferences/", - data: { - prop:name, - value:value - }, - dataType:'json', - timeout: function(){ - jQuery.data['pref_'+name] = false; - }, - error: function(){ - jQuery.data['pref_'+name] = false; - }, - success: function(data){ - if(data.success) - { - humane.info(data.message); - } - else - { - humane.error(data.message); - } - jQuery.data['pref_'+name] = false; - return; - } - }); + jQuery.data['pref_'+name] = $.ajax({ + type: "POST", + url: "/user/preferences/", + data: { + prop:name, + value:value + }, + dataType:'json', + timeout: function(){ + jQuery.data['pref_'+name] = false; + }, + error: function(){ + jQuery.data['pref_'+name] = false; + }, + success: function(data){ + if(data.success) + { + humane.info(data.message); + } + else + { + humane.error(data.message); + } + jQuery.data['pref_'+name] = false; + return; + } + }); } function infoDialog(el) { - $("#DIALOG").attr('title','') - .empty() - .append(el.attr('infos')) - .dialog({ + $("#DIALOG").attr('title','') + .empty() + .append(el.attr('infos')) + .dialog({ - autoOpen:false, - closeOnEscape:true, - resizable:false, - draggable:false, - width:600, - height:400, - modal:true, - overlay: { - backgroundColor: '#000', - opacity: 0.7 - } - }).dialog('open').css({'overflow-x':'auto','overflow-y':'auto'}); + autoOpen:false, + closeOnEscape:true, + resizable:false, + draggable:false, + width:600, + height:400, + modal:true, + overlay: { + backgroundColor: '#000', + opacity: 0.7 + } + }).dialog('open').css({'overflow-x':'auto','overflow-y':'auto'}); } function manageSession(data, showMessages) { - if(typeof(showMessages) == "undefined") - showMessages = false; + if(typeof(showMessages) == "undefined") + showMessages = false; - if(data.status == 'disconnected' || data.status == 'session') - { - disconnected(); - return false; - } - if(showMessages) - { - var box = $('#notification_box'); - box.empty().append(data.notifications); + if(data.status == 'disconnected' || data.status == 'session') + { + disconnected(); + return false; + } + if(showMessages) + { + var box = $('#notification_box'); + box.empty().append(data.notifications); - if(box.is(':visible')) - fix_notification_height(); + if(box.is(':visible')) + fix_notification_height(); - if($('.notification.unread',box).length > 0) - { - var trigger = $('#notification_trigger') ; - $('.counter',trigger) - .empty() - .append($('.notification.unread',box).length); - $('.counter',trigger).css('visibility','visible'); + if($('.notification.unread',box).length > 0) + { + var trigger = $('#notification_trigger') ; + $('.counter',trigger) + .empty() + .append($('.notification.unread',box).length); + $('.counter',trigger).css('visibility','visible'); - } - else - $('#notification_trigger .counter').css('visibility','hidden').empty(); + } + else + $('#notification_trigger .counter').css('visibility','hidden').empty(); - if(data.changed.length > 0) - { - var current_open = $('.SSTT.ui-state-active'); - var current_sstt = current_open.length > 0 ? current_open.attr('id').split('_').pop() : false; + if(data.changed.length > 0) + { + var current_open = $('.SSTT.ui-state-active'); + var current_sstt = current_open.length > 0 ? current_open.attr('id').split('_').pop() : false; - var main_open = false; - for(var i=0; i!=data.changed.length; i++) - { - var sstt = $('#SSTT_'+data.changed[i]); - if(sstt.size() === 0) + var main_open = false; + for(var i=0; i!=data.changed.length; i++) { - if(main_open === false) - { - $('#baskets .bloc').animate({'top':30}, function(){$('#baskets .alert_datas_changed:first').show()}); - main_open = true; - } + var sstt = $('#SSTT_'+data.changed[i]); + if(sstt.size() === 0) + { + if(main_open === false) + { + $('#baskets .bloc').animate({'top':30}, function(){$('#baskets .alert_datas_changed:first').show()}); + main_open = true; + } + } + else + { + if(!sstt.hasClass('active')) + sstt.addClass('unread'); + else + { + $('.alert_datas_changed', $('#SSTT_content_'+data.changed[i])).show(); + } + } } - else - { - if(!sstt.hasClass('active')) - sstt.addClass('unread'); - else - { - $('.alert_datas_changed', $('#SSTT_content_'+data.changed[i])).show(); - } - } - } - } - if('' !== $.trim(data.message)) - { - if($('#MESSAGE').length === 0) - $('body').append('
'); - $('#MESSAGE') - .empty() - .append(data.message+'
'+language.hideMessage+'
') - .attr('title','Global Message') - .dialog({ - autoOpen:false, - closeOnEscape:true, - resizable:false, - draggable:false, - modal:true, - close:function() - { - if($('.dialog_remove:checked',$(this)).length > 0) - setTemporaryPref('message',0); - } - }) - .dialog('open'); - } - } - return true; + } + if('' !== $.trim(data.message)) + { + if($('#MESSAGE').length === 0) + $('body').append('
'); + $('#MESSAGE') + .empty() + .append(data.message+'
'+language.hideMessage+'
') + .attr('title','Global Message') + .dialog({ + autoOpen:false, + closeOnEscape:true, + resizable:false, + draggable:false, + modal:true, + close:function() + { + if($('.dialog_remove:checked',$(this)).length > 0) + setTemporaryPref('message',0); + } + }) + .dialog('open'); + } + } + return true; } function disconnected() { - showModal('disconnected',{title:'Disconnection'}); + showModal('disconnected',{title:'Disconnection'}); } function showModal(cas, options){ - var content = ''; - var callback = null; - var button = { - "OK": function(e) - { - hideOverlay(3); - $(this).dialog("close"); - return; - }}; - var escape = true; - var onClose = function(){}; + var content = ''; + var callback = null; + var button = { + "OK": function(e) + { + hideOverlay(3); + $(this).dialog("close"); + return; + }}; + var escape = true; + var onClose = function(){}; - switch (cas) { - case 'timeout': - content = language.serverTimeout; - break; - case 'error': - content = language.serverError; - break; - case 'disconnected': - content = language.serverDisconnected; - escape=false; - callback = function(e){ self.location.replace(self.location.href)}; - break; - default: - break; - } + switch (cas) { + case 'timeout': + content = language.serverTimeout; + break; + case 'error': + content = language.serverError; + break; + case 'disconnected': + content = language.serverDisconnected; + escape=false; + callback = function(e){ self.location.replace(self.location.href)}; + break; + default: + break; + } - p4.Alerts(options.title, content, callback); + p4.Alerts(options.title, content, callback); - return; + return; } function showOverlay(n,appendto,callback, zIndex){ - var div ="OVERLAY"; - if(typeof(n)!="undefined") - div+=n; - if($('#'+div).length === 0) - { - if(typeof(appendto)=='undefined') - appendto = 'body'; - $(appendto).append(''); - } + var div ="OVERLAY"; + if(typeof(n)!="undefined") + div+=n; + if($('#'+div).length === 0) + { + if(typeof(appendto)=='undefined') + appendto = 'body'; + $(appendto).append(''); + } - var css = { - display: 'block', - opacity: 0, - right:0, - bottom:0, - position:'absolute', - top:0, - zIndex:zIndex, - left:0 - }; + var css = { + display: 'block', + opacity: 0, + right:0, + bottom:0, + position:'absolute', + top:0, + zIndex:zIndex, + left:0 + }; - if(parseInt(zIndex) > 0) - css['zIndex'] = parseInt(zIndex); + if(parseInt(zIndex) > 0) + css['zIndex'] = parseInt(zIndex); - if(typeof(callback) != 'function') - callback = function(){}; - $('#'+div).css(css).addClass('overlay').fadeTo(500, 0.7).bind('click',function(){(callback)();}); - if ($.browser.msie && $.browser.version == '6.0') { - $('select').css({ - visibility: 'hidden' - }); - } + if(typeof(callback) != 'function') + callback = function(){}; + $('#'+div).css(css).addClass('overlay').fadeTo(500, 0.7).bind('click',function(){(callback)();}); + if ($.browser.msie && $.browser.version == '6.0') { + $('select').css({ + visibility: 'hidden' + }); + } } function hideDwnl(){ - hideOverlay(2); - $('#MODALDL').css({ - 'display': 'none' - }); + hideOverlay(2); + $('#MODALDL').css({ + 'display': 'none' + }); } function hideOverlay(n){ - if ($.browser.msie && $.browser.version == '6.0') { - $('select').css({ - visibility: 'visible' - }); - } - var div = "OVERLAY"; - if(typeof(n)!="undefined") - div+=n; - $('#'+div).hide().remove(); + if ($.browser.msie && $.browser.version == '6.0') { + $('select').css({ + visibility: 'visible' + }); + } + var div = "OVERLAY"; + if(typeof(n)!="undefined") + div+=n; + $('#'+div).hide().remove(); } diff --git a/www/include/jquery.image_enhancer.js b/www/include/jquery.image_enhancer.js index f47bd89f56..f10c5f247a 100644 --- a/www/include/jquery.image_enhancer.js +++ b/www/include/jquery.image_enhancer.js @@ -1,249 +1,249 @@ (function( $ ){ - var methods = { - init : function( options ) { - var settings = { - 'zoomable' : false, - 'display_full_screen' : false - }; - return this.each(function() { + var methods = { + init : function( options ) { + var settings = { + 'zoomable' : false, + 'display_full_screen' : false + }; + return this.each(function() { - var $this = $(this), data = $(this).data('image_enhance'); + var $this = $(this), data = $(this).data('image_enhance'); - if ( ! data ) - { - if ( options ) { - $.extend( settings, options ); - } + if ( ! data ) + { + if ( options ) { + $.extend( settings, options ); + } - var wrapper = $('.thumb_wrapper', $(this)); - var $image =$('img', $this); + var wrapper = $('.thumb_wrapper', $(this)); + var $image =$('img', $this); - wrapper.css('position','relative'); + wrapper.css('position','relative'); - reset_position($this); + reset_position($this); - if(settings.display_full_screen) - { - $image.parent() - .append('"; + if(p4.edit.T_fields[i]._status == 1) + { + if (p4.edit.T_fields[i].readonly) { + continue; + } + var c = p4.edit.T_fields[i]._value === "" ? "" : "checked=\"1\""; + var v = p4.edit.T_fields[i]._value; + html += "
"; + html += cleanTags(p4.edit.T_fields[i]._value) + "
"; + } + } + $("#Edit_copyPreset_dlg FORM DIV").html(html); + var $dialog = $("#Edit_copyPreset_dlg"); + if ($dialog.data("ui-dialog")) { + // to show dialog on top of edit window + $dialog.dialog("widget").css("z-index", 1300); + $dialog.dialog("open"); } - } - $("#Edit_copyPreset_dlg FORM DIV").html(html); - var $dialog = $("#Edit_copyPreset_dlg"); - if ($dialog.data("ui-dialog")) { - // to show dialog on top of edit window - $dialog.dialog("widget").css("z-index", 1300); - $dialog.dialog("open"); - } } function preset_paint(data) { - $(".EDIT_presets_list", p4.edit.editBox).html(data.html); - $(".EDIT_presets_list A.triangle").click( - function() - { - $(this).parent().parent().toggleClass("opened"); - return false; - } + $(".EDIT_presets_list", p4.edit.editBox).html(data.html); + $(".EDIT_presets_list A.triangle").click( + function() + { + $(this).parent().parent().toggleClass("opened"); + return false; + } ); - $(".EDIT_presets_list A.title").dblclick( - function() - { - var preset_id = $(this).parent().parent().attr("id"); - if(preset_id.substr(0, 12)=="EDIT_PRESET_") - preset_load(preset_id.substr(12)); - return false; - } + $(".EDIT_presets_list A.title").dblclick( + function() + { + var preset_id = $(this).parent().parent().attr("id"); + if(preset_id.substr(0, 12)=="EDIT_PRESET_") + preset_load(preset_id.substr(12)); + return false; + } ); - $(".EDIT_presets_list A.delete").click( - function() - { - var li = $(this).closest("LI"); - var preset_id = li.attr("id"); - var title = $(this).parent().children(".title").html(); - if(preset_id.substr(0, 12)=="EDIT_PRESET_" && confirm("supprimer le preset '" + title + "' ?")) - { - preset_delete(preset_id.substr(12), li); - } - return false; - } + $(".EDIT_presets_list A.delete").click( + function() + { + var li = $(this).closest("LI"); + var preset_id = li.attr("id"); + var title = $(this).parent().children(".title").html(); + if(preset_id.substr(0, 12)=="EDIT_PRESET_" && confirm("supprimer le preset '" + title + "' ?")) + { + preset_delete(preset_id.substr(12), li); + } + return false; + } ); } function preset_delete(preset_id, li) { - var p = { - "act":"DELETE", - "presetid":preset_id - }; - $.ajax({ - type: 'POST', - url: "/xmlhttp/editing_presets.j.php", - data: p, - dataType: 'json', - success: function(data, textStatus){ - li.remove(); - } - }); + var p = { + "act":"DELETE", + "presetid":preset_id + }; + $.ajax({ + type: 'POST', + url: "/xmlhttp/editing_presets.j.php", + data: p, + dataType: 'json', + success: function(data, textStatus){ + li.remove(); + } + }); } function preset_load(preset_id) { - var p = { - "act":"LOAD", - "presetid":preset_id - }; + var p = { + "act":"LOAD", + "presetid":preset_id + }; - $.getJSON( - "/xmlhttp/editing_presets.j.php", - p, - function(data, textStatus) - { - if ($("#Edit_copyPreset_dlg").data("ui-dialog")) { - $("#Edit_copyPreset_dlg").dialog("close"); - } - - for(i in p4.edit.T_fields) - { - p4.edit.T_fields[i].preset = null; - if(typeof(data.fields[p4.edit.T_fields[i].name]) != "undefined") + $.getJSON( + "/xmlhttp/editing_presets.j.php", + p, + function(data, textStatus) { - p4.edit.T_fields[i].preset = data.fields[p4.edit.T_fields[i].name]; - } - } - for(var r=0; r 0 && zoomable.hasClass('zoomed')) - return; - - // var datas = p4.edit.T_records[id].preview; - - var h = parseInt($('input[name=height]', container).val()); - var w = parseInt($('input[name=width]', container).val()); - - // if(datas.doctype == 'video') - // { - // var h = parseInt(datas.height); - // var w = parseInt(datas.width); - // } - var t=0; - var de = 0; - - var margX = 0; - var margY = 0; - - if($('img.record.record_audio', container).length > 0) - { - var margY = 100; - de = 60; - } - - var display_box = $('#TH_Opreview .PNB10'); - var dwidth = display_box.width(); - var dheight = display_box.height(); - - - // if(datas.doctype != 'flash') - // { - var ratioP = w / h; - var ratioD = dwidth / dheight; - - if (ratioD > ratioP) { - //je regle la hauteur d'abord - if ((parseInt(h) + margY) > dheight) { - h = Math.round(dheight - margY); - w = Math.round(h * ratioP); + if(selected.length != 1) + { + return; } - } - else { - if ((parseInt(w) + margX) > dwidth) { - w = Math.round(dwidth - margX); - h = Math.round(w / ratioP); + + var id = selected.attr('id').split('_').pop(); + + var container = $('#TH_Opreview'); + var zoomable = $('img.record.zoomable', container); + + if(zoomable.length > 0 && zoomable.hasClass('zoomed')) + return; + + // var datas = p4.edit.T_records[id].preview; + + var h = parseInt($('input[name=height]', container).val()); + var w = parseInt($('input[name=width]', container).val()); + + // if(datas.doctype == 'video') + // { + // var h = parseInt(datas.height); + // var w = parseInt(datas.width); + // } + var t=0; + var de = 0; + + var margX = 0; + var margY = 0; + + if($('img.record.record_audio', container).length > 0) + { + var margY = 100; + de = 60; } - } - // } - // else - // { - // - // h = Math.round(dheight - margY); - // w = Math.round(dwidth - margX); - // } - t = Math.round((dheight - h - de) / 2); - var l = Math.round((dwidth - w) / 2); - $('.record',container).css({ - width: w, - height: h, - top: t, - left: l - }).attr('width',w).attr('height',h); + + var display_box = $('#TH_Opreview .PNB10'); + var dwidth = display_box.width(); + var dheight = display_box.height(); + + + // if(datas.doctype != 'flash') + // { + var ratioP = w / h; + var ratioD = dwidth / dheight; + + if (ratioD > ratioP) { + //je regle la hauteur d'abord + if ((parseInt(h) + margY) > dheight) { + h = Math.round(dheight - margY); + w = Math.round(h * ratioP); + } + } + else { + if ((parseInt(w) + margX) > dwidth) { + w = Math.round(dwidth - margX); + h = Math.round(w / ratioP); + } + } + // } + // else + // { + // + // h = Math.round(dheight - margY); + // w = Math.round(dwidth - margX); + // } + t = Math.round((dheight - h - de) / 2); + var l = Math.round((dwidth - w) / 2); + $('.record',container).css({ + width: w, + height: h, + top: t, + left: l + }).attr('width',w).attr('height',h); } function previewEdit(r) { - $('#TH_Opreview .PNB10').empty().append(p4.edit.T_records[r].preview); + $('#TH_Opreview .PNB10').empty().append(p4.edit.T_records[r].preview); - // var data = p4.edit.T_records[r].preview; + // var data = p4.edit.T_records[r].preview; - // if ((data.doctype == 'video' || data.doctype == 'audio' || data.doctype == 'flash')) { - // if(data.doctype != 'video' && data.flashcontent.url) - // { - // var flashvars = false; - // var params = { - // menu: "false", - // flashvars: data.flashcontent.flashVars, - // movie: data.flashcontent.url, - // allowFullScreen :"true", - // wmode: "transparent" - // }; - // var attributes = false; - // if (data.doctype != 'audio') { - // attributes = { - // styleclass: "PREVIEW_PIC" - // }; - // } - // swfobject.embedSWF(data.flashcontent.url, "FLASHPREVIEW", data.flashcontent.width, data.flashcontent.height, "9.0.0", false, flashvars, params, attributes); - // } - // else - // { - // flowplayer("FLASHPREVIEW", '/include/flowplayer/flowplayer-3.2.2.swf',{ - // clip: { - // autoPlay: true, - // autoBuffering:true, - // provider: 'h264streaming', - // metadata: false, - // scaling:'fit', - // url: data.flashcontent.flv - // }, - // onError:function(code,message){ - // getNewVideoToken(p4.edit.T_records[r].sbas_id, p4.edit.T_records[r].rid, this); - // }, - // plugins: { - // h264streaming: { - // url: '/include/flowplayer/flowplayer.pseudostreaming-3.2.2.swf' - // } - // } - // }); - // } - // } + // if ((data.doctype == 'video' || data.doctype == 'audio' || data.doctype == 'flash')) { + // if(data.doctype != 'video' && data.flashcontent.url) + // { + // var flashvars = false; + // var params = { + // menu: "false", + // flashvars: data.flashcontent.flashVars, + // movie: data.flashcontent.url, + // allowFullScreen :"true", + // wmode: "transparent" + // }; + // var attributes = false; + // if (data.doctype != 'audio') { + // attributes = { + // styleclass: "PREVIEW_PIC" + // }; + // } + // swfobject.embedSWF(data.flashcontent.url, "FLASHPREVIEW", data.flashcontent.width, data.flashcontent.height, "9.0.0", false, flashvars, params, attributes); + // } + // else + // { + // flowplayer("FLASHPREVIEW", '/include/flowplayer/flowplayer-3.2.2.swf',{ + // clip: { + // autoPlay: true, + // autoBuffering:true, + // provider: 'h264streaming', + // metadata: false, + // scaling:'fit', + // url: data.flashcontent.flv + // }, + // onError:function(code,message){ + // getNewVideoToken(p4.edit.T_records[r].sbas_id, p4.edit.T_records[r].rid, this); + // }, + // plugins: { + // h264streaming: { + // url: '/include/flowplayer/flowplayer.pseudostreaming-3.2.2.swf' + // } + // } + // }); + // } + // } - if($('img.PREVIEW_PIC.zoomable').length > 0) - { - $('img.PREVIEW_PIC.zoomable').draggable(); - } - setPreviewEdit(); + if($('img.PREVIEW_PIC.zoomable').length > 0) + { + $('img.PREVIEW_PIC.zoomable').draggable(); + } + setPreviewEdit(); } 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; + 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) - { - var fields = {}; - - for(f in p4.edit.T_records[r].fields) + for(r in p4.edit.T_records) { - var meta_struct_id = p4.edit.T_records[r].fields[f].meta_struct_id; + var fields = {}; - var name = p4.edit.T_fields[meta_struct_id].name; - var label = p4.edit.T_fields[meta_struct_id].label; + for(f in p4.edit.T_records[r].fields) + { + var meta_struct_id = p4.edit.T_records[r].fields[f].meta_struct_id; - var multi = p4.edit.T_fields[meta_struct_id].multi; - var required = p4.edit.T_fields[meta_struct_id].required; - var readonly = p4.edit.T_fields[meta_struct_id].readonly; - var maxLength = p4.edit.T_fields[meta_struct_id].maxLength; - var minLength = p4.edit.T_fields[meta_struct_id].minLength; - var type = p4.edit.T_fields[meta_struct_id].type; - var separator = p4.edit.T_fields[meta_struct_id].separator; - var vocabularyControl = p4.edit.T_fields[meta_struct_id].vocabularyControl; - var vocabularyRestricted = p4.edit.T_fields[meta_struct_id].vocabularyRestricted; + var name = p4.edit.T_fields[meta_struct_id].name; + var label = p4.edit.T_fields[meta_struct_id].label; - var fieldOptions = { - multi:multi, - required:required, - readonly:readonly, - maxLength:maxLength, - minLength:minLength, - type:type, - separator:separator, - vocabularyControl:vocabularyControl, - vocabularyRestricted:vocabularyRestricted - }; + var multi = p4.edit.T_fields[meta_struct_id].multi; + var required = p4.edit.T_fields[meta_struct_id].required; + var readonly = p4.edit.T_fields[meta_struct_id].readonly; + var maxLength = p4.edit.T_fields[meta_struct_id].maxLength; + var minLength = p4.edit.T_fields[meta_struct_id].minLength; + var type = p4.edit.T_fields[meta_struct_id].type; + var separator = p4.edit.T_fields[meta_struct_id].separator; + var vocabularyControl = p4.edit.T_fields[meta_struct_id].vocabularyControl; + var vocabularyRestricted = p4.edit.T_fields[meta_struct_id].vocabularyRestricted; - var databoxField = new p4.databoxField(name, label, meta_struct_id, fieldOptions); + var fieldOptions = { + multi:multi, + required:required, + readonly:readonly, + maxLength:maxLength, + minLength:minLength, + type:type, + separator:separator, + vocabularyControl:vocabularyControl, + vocabularyRestricted:vocabularyRestricted + }; - var values = []; + var databoxField = new p4.databoxField(name, label, meta_struct_id, fieldOptions); - 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; + var values = []; - values.push(new p4.recordFieldValue(meta_id, value, vocabularyId)); - } + 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; + + values.push(new p4.recordFieldValue(meta_id, value, vocabularyId)); + } + + fields[f] = new p4.recordField(databoxField, values); + } + + p4.edit.T_records[r].fields = fields; + p4.edit.fields = fields; - fields[f] = new p4.recordField(databoxField, values); } - p4.edit.T_records[r].fields = fields; - p4.edit.fields = fields; - - } - - $('#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(){ - $(this).addClass('hover'); - }).bind('mouseout',function(){ - $(this).removeClass('hover'); - }); - - $('#editcontextwrap').remove(); - - if($('#editcontextwrap').length == 0) - $('body').append('
'); - - self.setTimeout("edit_select_all();", 100); - - $('.previewTips, .DCESTips, .fieldTips', p4.edit.editBox).tooltip({ - fixable:true, - fixableIndex:1200 - }); - $('.infoTips', p4.edit.editBox).tooltip(); - - if(p4.edit.what == 'GRP') - { - $('#EDIT_FILM2 .reg_opts').show(); - - $.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 - }); + $('#EditTextMultiValued').bind('keyup', function(){ + reveal_mval($(this).val()); }); - } - hsplit1(); - vsplit2() - vsplit1(); + $('#EDIT_MID_R .tabs').tabs(); - $('#EDIT_TOP', p4.edit.editBox).resizable({ - handles : 's', - minHeight:100, - resize:function(){ - hsplit1(); - setPreviewEdit(); - }, - stop:function(){ - hsplit1(); - setPref('editing_top_box', Math.floor($('#EDIT_TOP').height() * 100 / $('#EDIT_ALL').height()) + '%'); - setSizeLimits(); + $('#divS div.edit_field:odd').addClass('odd'); + $('#divS div').bind('mouseover',function(){ + $(this).addClass('hover'); + }).bind('mouseout',function(){ + $(this).removeClass('hover'); + }); + + $('#editcontextwrap').remove(); + + if($('#editcontextwrap').length == 0) + $('body').append('
'); + + self.setTimeout("edit_select_all();", 100); + + $('.previewTips, .DCESTips, .fieldTips', p4.edit.editBox).tooltip({ + fixable:true, + fixableIndex:1200 + }); + $('.infoTips', p4.edit.editBox).tooltip(); + + if(p4.edit.what == 'GRP') + { + $('#EDIT_FILM2 .reg_opts').show(); + + $.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 + }); + }); } - }); - $('#divS_wrapper', p4.edit.editBox).resizable({ - handles : 'e', - minWidth:200, - resize:function(){ - vsplit1(); - setPreviewEdit(); - }, - stop:function(){ - setPref('editing_right_box', Math.floor($('#divS').width() * 100 / $('#EDIT_MID_L').width()) + '%'); - vsplit1(); - setSizeLimits(); - } - }); + hsplit1(); + vsplit2() + vsplit1(); -$('#EDIT_MID_R') - .css('left', $('#EDIT_MID_L').position().left + $('#EDIT_MID_L').width() + 15) - .resizable({ - handles : 'w', - minWidth:200, + $('#EDIT_TOP', p4.edit.editBox).resizable({ + handles : 's', + minHeight:100, resize:function(){ - vsplit2(); - setPreviewEdit(); + hsplit1(); + setPreviewEdit(); }, stop:function(){ - setPref('editing_left_box', Math.floor($('#EDIT_MID_R').width() * 100 / $('#EDIT_MID').width()) + '%'); - vsplit2(); - setSizeLimits(); + hsplit1(); + setPref('editing_top_box', Math.floor($('#EDIT_TOP').height() * 100 / $('#EDIT_ALL').height()) + '%'); + setSizeLimits(); } }); - $('#EDIT_ZOOMSLIDER', p4.edit.editBox).slider({ - 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) - { - p4.edit.diapoSize = $(ui.value)[0]; - setPref("editing_images_size", p4.edit.diapoSize); - } - }); + $('#divS_wrapper', p4.edit.editBox).resizable({ + handles : 'e', + minWidth:200, + resize:function(){ + vsplit1(); + setPreviewEdit(); + }, + stop:function(){ + setPref('editing_right_box', Math.floor($('#divS').width() * 100 / $('#EDIT_MID_L').width()) + '%'); + vsplit1(); + setSizeLimits(); + } + }); - var buttons = {}; - buttons[language.valider] = function(e) - { - $(this).dialog("close"); - edit_applyMultiDesc(e); - }; - buttons[language.annuler] = function(e) - { - $(this).dialog("close"); - edit_cancelMultiDesc(e); - }; + $('#EDIT_MID_R') + .css('left', $('#EDIT_MID_L').position().left + $('#EDIT_MID_L').width() + 15) + .resizable({ + handles : 'w', + minWidth:200, + resize:function(){ + vsplit2(); + setPreviewEdit(); + }, + stop:function(){ + setPref('editing_left_box', Math.floor($('#EDIT_MID_R').width() * 100 / $('#EDIT_MID').width()) + '%'); + vsplit2(); + setSizeLimits(); + } + }); - $("#EDIT_CLOSEDIALOG", p4.edit.editBox).dialog({ - autoOpen: false, - closeOnEscape:true, - resizable:false, - draggable:false, - modal:true, - buttons: buttons - }); + $('#EDIT_ZOOMSLIDER', p4.edit.editBox).slider({ + 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) + { + p4.edit.diapoSize = $(ui.value)[0]; + setPref("editing_images_size", p4.edit.diapoSize); + } + }); - var buttons = {}; - buttons[language.valider] = function() - { - var form = $("#Edit_copyPreset_dlg FORM"); - var jtitle = $(".EDIT_presetTitle", form); - if(jtitle.val() == '') + var buttons = {}; + buttons[language.valider] = function(e) { - alert(language.needTitle); - jtitle[0].focus(); - return; - } + $(this).dialog("close"); + edit_applyMultiDesc(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, + buttons: buttons + }); + + var buttons = {}; + buttons[language.valider] = function() + { + var form = $("#Edit_copyPreset_dlg FORM"); + var jtitle = $(".EDIT_presetTitle", form); + if(jtitle.val() == '') + { + alert(language.needTitle); + jtitle[0].focus(); + return; + } + + var p = { + "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; + var f; + 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]) + + ""; + } + } + } + ); + + x += ""; + p["f"] = x; + + $.ajax({ + type: 'POST', + url: "/xmlhttp/editing_presets.j.php", + data: p, + dataType: 'json', + success: function(data, textStatus) + { + preset_paint(data); + + if ($("#Edit_copyPreset_dlg").data("ui-dialog")) { + $("#Edit_copyPreset_dlg").dialog("close"); + } + } + }); + }; + 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) { + $(this).dialog("widget").css("z-index", "auto"); + }, + open:function(event, ui) { + $(this).dialog("widget").css("z-index", "5000"); + $(".EDIT_presetTitle")[0].focus(); + }, + buttons:buttons + }); + + $('#idEditDateZone', p4.edit.editBox).datepicker({ + changeYear: true, + changeMonth:true, + dateFormat: 'yy/mm/dd', + onSelect: function(dateText, inst) + { + var lval = $('#idEditZTextArea', p4.edit.editBox).val(); + if(lval != dateText) + { + fieldLastValue = lval; + $('#idEditZTextArea', p4.edit.editBox).val(dateText); + $('#idEditZTextArea').trigger('keyup.maxLength'); + textareaIsDirty = true; + edit_validField(null, 'ok'); + } + } + }); + + ETHSeeker = new EditThesaurusSeeker(p4.edit.sbas_id); + + setSizeLimits(); var p = { - "act":"SAVE", - "sbas":p4.edit.sbas_id, - "title":jtitle.val(), - "f":{} + "act":"LIST", + "sbas":p4.edit.sbas_id }; - var f = {}; - var x = ""; - $(":checkbox", form).each( - function(idx, elem) - { - if(elem.checked) + $.getJSON( + "/xmlhttp/editing_presets.j.php", + p, + function(data, textStatus) { - var i = 0|elem.value; - var f; - 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]) - + ""; - } + preset_paint(data); } - } - ); - - x += ""; - p["f"] = x; - - $.ajax({ - type: 'POST', - url: "/xmlhttp/editing_presets.j.php", - data: p, - dataType: 'json', - success: function(data, textStatus) - { - preset_paint(data); - - if ($("#Edit_copyPreset_dlg").data("ui-dialog")) { - $("#Edit_copyPreset_dlg").dialog("close"); - } - } - }); - }; - 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) { - $(this).dialog("widget").css("z-index", "auto"); - }, - open:function(event, ui) { - $(this).dialog("widget").css("z-index", "5000"); - $(".EDIT_presetTitle")[0].focus(); - }, - buttons:buttons - }); - - $('#idEditDateZone', p4.edit.editBox).datepicker({ - changeYear: true, - changeMonth:true, - dateFormat: 'yy/mm/dd', - onSelect: function(dateText, inst) - { - var lval = $('#idEditZTextArea', p4.edit.editBox).val(); - if(lval != dateText) - { - fieldLastValue = lval; - $('#idEditZTextArea', p4.edit.editBox).val(dateText); - $('#idEditZTextArea').trigger('keyup.maxLength'); - textareaIsDirty = true; - edit_validField(null, 'ok'); - } - } - }); - - ETHSeeker = new EditThesaurusSeeker(p4.edit.sbas_id); - - setSizeLimits(); - - var p = { - "act":"LIST", - "sbas":p4.edit.sbas_id - }; - $.getJSON( - "/xmlhttp/editing_presets.j.php", - p, - function(data, textStatus) - { - preset_paint(data); - } ); - check_required(); + check_required(); - $('#TH_Opresets button.adder').bind('click', function(){ - preset_copy(); - }); + $('#TH_Opresets button.adder').bind('click', function(){ + preset_copy(); + }); - try{ - $('#divS .edit_field:first').trigger('mousedown'); - } - catch(err) - { + try{ + $('#divS .edit_field:first').trigger('mousedown'); + } + catch(err) + { - } + } } function setRegDefault(n,record_id) { - p4.edit.newrepresent = 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 e7e03f5265..f495fd70a5 100644 --- a/www/skins/prod/jquery.main-prod.js +++ b/www/skins/prod/jquery.main-prod.js @@ -428,7 +428,7 @@ function afterSearch() $('.rollover-gif-hover',this).hide(); $('.rollover-gif-out',this).show(); } - ); + ); viewNbSelect(); $('#answers div.IMGT').draggable({ helper : function(){ @@ -464,7 +464,7 @@ function initAnswerForm(){ searchForm.unbind('submit').bind('submit',function(){ var $this = $(this), - method = $this.attr('method') ? $this.attr('method') : 'POST'; + method = $this.attr('method') ? $this.attr('method') : 'POST'; answAjax = $.ajax({ type: method, @@ -750,7 +750,7 @@ function toHex(N) { N=Math.min(N,255); N=Math.round(N); return "0123456789ABCDEF".charAt((N-N%16)/16) - + "0123456789ABCDEF".charAt(N%16); + + "0123456789ABCDEF".charAt(N%16); } function hsl2rgb(h, s, l) { var m1, m2, hue; @@ -917,10 +917,10 @@ $(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); } }); @@ -1022,22 +1022,22 @@ $(document).ready(function(){ $("#DIALOG").dialog('destroy'); } $("#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, - overlay: { - backgroundColor: '#000', - opacity: 0.7 - } - }).dialog('open'); + .empty() + .append(data.texte) + .dialog({ + autoOpen:false, + closeOnEscape:true, + resizable:false, + draggable:false, + modal:true, + buttons:buttons, + width:650, + height:250, + overlay: { + backgroundColor: '#000', + opacity: 0.7 + } + }).dialog('open'); } } @@ -1053,8 +1053,8 @@ $(document).ready(function(){ $('#history-queries ul li').live('mouseover',function(){ $(this).addClass('hover'); }).live('mouseout',function(){ - $(this).removeClass('hover'); - }); + $(this).removeClass('hover'); + }); startThesaurus(); checkFilters(); @@ -1094,15 +1094,15 @@ $(document).ready(function(){ $('#idFrameC').stop().animate({ - width : nwidth - }, - 300, - 'linear', - function(){ - answerSizer(); - linearize(); - saveWindows(); - }); + width : nwidth + }, + 300, + 'linear', + function(){ + answerSizer(); + linearize(); + saveWindows(); + }); } }); @@ -1163,17 +1163,17 @@ $(document).ready(function(){ $('.tools .answer_selector').bind('click',function(){ selector($(this)); }).bind('mouseover',function(event){ - if(is_ctrl_key(event)) - { - $(this).addClass('add_selector'); - } - else - { + if(is_ctrl_key(event)) + { + $(this).addClass('add_selector'); + } + else + { + $(this).removeClass('add_selector'); + } + }).bind('mouseout',function(){ $(this).removeClass('add_selector'); - } - }).bind('mouseout',function(){ - $(this).removeClass('add_selector'); - }); + }); getLanguage(); @@ -1233,27 +1233,27 @@ $(document).ready(function(){ if(p4.preview.open) { if (($('#dialog_dwnl:visible').length === 0 && $('#DIALOG1').length === 0 && $('#DIALOG2').length === 0)) { - switch(event.keyCode) - { - case 39: - getNext(); - cancelKey = shortCut = true; - break; - case 37: - getPrevious(); - cancelKey = shortCut = true; - break; - case 27://escape - closePreview(); - break; - case 32: - if(p4.slideShow) - stopSlide(); - else - startSlide(); - cancelKey = shortCut = true; - break; - } + switch(event.keyCode) + { + case 39: + getNext(); + cancelKey = shortCut = true; + break; + case 37: + getPrevious(); + cancelKey = shortCut = true; + break; + case 27://escape + closePreview(); + break; + case 32: + if(p4.slideShow) + stopSlide(); + else + startSlide(); + cancelKey = shortCut = true; + break; + } } } else @@ -1411,8 +1411,8 @@ $(document).ready(function(){ $('#EDIT_query').bind('focus',function(){ $(this).addClass('focused'); }).bind('blur',function(){ - $(this).removeClass('focused'); - }); + $(this).removeClass('focused'); + }); $('.basketTips').tooltip({ delay: 200 @@ -1716,7 +1716,7 @@ function toolREFACTOR(datas){ dialog.setContent(data); return; } - ); + ); } @@ -2071,8 +2071,8 @@ function activeIcons() } /** - * if works, then the object is not empty - */ + * if works, then the object is not empty + */ for(i in value) { return chgCollThis(value); @@ -2098,7 +2098,7 @@ function activeIcons() } } 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) { @@ -2388,21 +2388,21 @@ function printThis(value) $("#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) { - $(this).dialog("widget").css("z-index", "1999"); - }, - close: function(event, ui) { - $(this).dialog("widget").css("z-index", "auto"); - } - }) - .dialog('open'); + .empty().addClass('loading') + .dialog({ + 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) { + $(this).dialog("widget").css("z-index", "auto"); + } + }) + .dialog('open'); $.ajax({ type: "POST", @@ -2413,7 +2413,7 @@ function printThis(value) }, success: function(data){ $('#DIALOG').removeClass('loading').empty() - .append(data); + .append(data); return; } }); @@ -2432,7 +2432,7 @@ function downloadThis(datas) $('.close_button', dialog.getDomElement()).bind('click',function(){ dialog.Close(); - }); + }); return false; }); @@ -2581,8 +2581,8 @@ function doDelete(lst) $.each(data,function(i,n){ var imgt = $('#IMGT_'+n), - chim = $('.CHIM_'+n), - stories = $('.STORY_'+n); + chim = $('.CHIM_'+n), + stories = $('.STORY_'+n); $('.doc_infos', imgt).remove(); imgt.unbind("click").removeAttr("ondblclick").removeClass("selected").removeClass("IMGT").find("img").unbind(); @@ -3053,10 +3053,10 @@ function set_up_feed_box(data) $(this).addClass('selected'); $('input[name="feed_id"]', $form).val($('input', this).val()); }).hover(function(){ - $(this).addClass('hover'); - },function(){ - $(this).removeClass('hover'); - }); + $(this).addClass('hover'); + },function(){ + $(this).removeClass('hover'); + }); $form.bind('submit', function(){ return false; diff --git a/www/skins/prod/publicator.js b/www/skins/prod/publicator.js index 59ac86a776..6b805c8ed9 100644 --- a/www/skins/prod/publicator.js +++ b/www/skins/prod/publicator.js @@ -8,11 +8,11 @@ function publicator_reload_publicator() function init_publicator(datas) { - var dialog = p4.Dialog.Create({ - size:'Full', - title:'Bridge', - loading: false - }); + var dialog = p4.Dialog.Create({ + size:'Full', + title:'Bridge', + loading: false + }); dialog.load('/prod/bridge/manager/', 'POST', datas); } diff --git a/www/skins/report/report.js b/www/skins/report/report.js index 099901c164..990d97dfc5 100644 --- a/www/skins/report/report.js +++ b/www/skins/report/report.js @@ -101,8 +101,8 @@ function bindEvents() { }, text: false }).unbind("click").bind("click", function () { - showMenu(); - }); + showMenu(); + }); $("#liste_dash").find("em").unbind("click").bind("click", function () { id = $(this).attr('id').substr(3); diff --git a/www/skins/thesaurus/sprintf.js b/www/skins/thesaurus/sprintf.js index c139aa414e..3c0773938b 100644 --- a/www/skins/thesaurus/sprintf.js +++ b/www/skins/thesaurus/sprintf.js @@ -1,108 +1,108 @@ -////////////////////////////////////////////////////////////////////////////// -// sprintf function for javascript +////////////////////////////////////////////////////////////////////////////// +// sprintf function for javascript function sprintf() -{ - if (!arguments || arguments.length < 1 || !RegExp) - { - return ''; - } - - str = arguments[0]; - 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) - { - var leftpart = a[1], pPad = a[2], pJustify = a[3], pMinLength = a[4]; - var pPrecision = a[5], pType = a[6], rightPart = a[7]; numMatches++; - -// alert("str:"+str + "\nl:"+leftpart + "\nr:"+rightPart); - - if (pType == '%') - { - subst = '%'; - } - else - { - numSubstitutions++; - 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); - } - else if (pPad) - { - pad = pPad; - } - var justifyRight = true; - if (pJustify && pJustify === "-") - justifyRight = false; - var minLength = -1; - if (pMinLength) - minLength = parseInt(pMinLength); - var precision = -1; - if (pPrecision && pType == 'f') - { - precision = parseInt(pPrecision.substring(1)); - } - var subst = param; - switch (pType) - { - case 'b': - subst = parseInt(param).toString(2); - break; - case 'c': - subst = String.fromCharCode(parseInt(param)); - break; - case 'd': - subst = parseInt(param)? parseInt(param) : 0; - break; - case 'u': - subst = Math.abs(param); - break; - case 'f': - subst = (precision > -1) ? Math.round(parseFloat(param) * Math.pow(10, precision)) / Math.pow(10, precision) : parseFloat(param); - break; - case 'o': - subst = parseInt(param).toString(8); - break; - case 's': - subst = param; - break; - case 'x': - subst = ('' + parseInt(param).toString(16)).toLowerCase(); - break; - case 'X': - subst = ('' + parseInt(param).toString(16)).toUpperCase(); - break; - default: - break; - } - var padLeft = minLength - subst.toString().length; - var padding; - if (padLeft > 0) - { - var arrTmp = new Array(padLeft+1); - padding = arrTmp.join(pad?pad:" "); - } - else - { - padding = ""; - } - } - str = leftpart + padding + subst + rightPart; +{ + if (!arguments || arguments.length < 1 || !RegExp) + { + return ''; + } + + str = arguments[0]; + 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((newstr = str.replace("\x01", "\n")) != str) - str = newstr; - return(str); -} + 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++; + +// alert("str:"+str + "\nl:"+leftpart + "\nr:"+rightPart); + + if (pType == '%') + { + subst = '%'; + } + else + { + numSubstitutions++; + 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); + } + else if (pPad) + { + pad = pPad; + } + var justifyRight = true; + if (pJustify && pJustify === "-") + justifyRight = false; + var minLength = -1; + if (pMinLength) + minLength = parseInt(pMinLength); + var precision = -1; + if (pPrecision && pType == 'f') + { + precision = parseInt(pPrecision.substring(1)); + } + var subst = param; + switch (pType) + { + case 'b': + subst = parseInt(param).toString(2); + break; + case 'c': + subst = String.fromCharCode(parseInt(param)); + break; + case 'd': + subst = parseInt(param)? parseInt(param) : 0; + break; + case 'u': + subst = Math.abs(param); + break; + case 'f': + subst = (precision > -1) ? Math.round(parseFloat(param) * Math.pow(10, precision)) / Math.pow(10, precision) : parseFloat(param); + break; + case 'o': + subst = parseInt(param).toString(8); + break; + case 's': + subst = param; + break; + case 'x': + subst = ('' + parseInt(param).toString(16)).toLowerCase(); + break; + case 'X': + subst = ('' + parseInt(param).toString(16)).toUpperCase(); + break; + default: + break; + } + var padLeft = minLength - subst.toString().length; + var padding; + if (padLeft > 0) + { + var arrTmp = new Array(padLeft+1); + padding = arrTmp.join(pad?pad:" "); + } + else + { + padding = ""; + } + } + str = leftpart + padding + subst + rightPart; + a = re.exec(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 7d67465046..3e93a69a7b 100644 --- a/www/skins/thesaurus/thesaurus.js +++ b/www/skins/thesaurus/thesaurus.js @@ -1,422 +1,422 @@ 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(); - else if (window.ActiveXObject) - xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); - if (xmlhttp) - { - // xmlhttp.onreadystatechange=state_Change - if(post_parms) - { - xmlhttp.open("POST", url, false); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); - xmlhttp.send(post_parms); - } - else - { - xmlhttp.open("GET", url, false); - xmlhttp.send(null); - } - out = asxml ? xmlhttp.responseXML : xmlhttp.responseText; - } - return(out); + if(typeof(asxml)=="undefined") + asxml = false; + out = null; + xmlhttp = null; + // code for Mozilla, etc. + if (window.XMLHttpRequest) + xmlhttp=new XMLHttpRequest(); + else if (window.ActiveXObject) + xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); + if (xmlhttp) + { + // xmlhttp.onreadystatechange=state_Change + if(post_parms) + { + xmlhttp.open("POST", url, false); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); + xmlhttp.send(post_parms); + } + else + { + xmlhttp.open("GET", url, false); + xmlhttp.send(null); + } + out = asxml ? xmlhttp.responseXML : xmlhttp.responseText; + } + return(out); } 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(c.nodeName=="DIV") - ret += showFound2(term, lterm, c, depth+1); // on descend uniquement les THE_yyy - } - } + 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(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) - { - ret = 1; + if(branch.firstChild.nextSibling.nodeValue.substr(0, lterm)==term) + { + ret = 1; // alert(branch.firstChild.nextSibling.nodeValue + " : " + thb.id); - } + } -// if(ret > 0) +// if(ret > 0) // if(depth > 0) // { - if(ret > 0) - { - //eventObj.Src0.innerHTML = "+"; - thb.className = "OB"; - } - else - { - //eventObj.Src0.innerHTML = "+"; - thb.className = "ob"; - } + if(ret > 0) + { + //eventObj.Src0.innerHTML = "+"; + thb.className = "OB"; + } + else + { + //eventObj.Src0.innerHTML = "+"; + thb.className = "ob"; + } // } -/* - if(depth == 0) - { - document.getElementById("WT1").style.visibility="hidden"; - if(document.forms["fTh"].textT1.value!=term) - { - // oups! le mot a changé durant le traitement, on recommence - evt_kup_T1(); - } - } -*/ - return(ret); + /* + if(depth == 0) + { + document.getElementById("WT1").style.visibility="hidden"; + if(document.forms["fTh"].textT1.value!=term) + { + // oups! le mot a changé durant le traitement, on recommence + evt_kup_T1(); + } + } + */ + return(ret); } 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); - } + 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); + } - if(depth > 0) - branch.style.display = ""; + if(depth > 0) + branch.style.display = ""; - 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(); - } - } + 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(); + } + } } function scanTerms(inputName, zTerm, showhide) { - showhide = !!showhide; - var lTerm = zTerm.length; - var zTable = document.getElementById("L"+inputName); - var zTr = zTable.childNodes; // TR's - var l = zTr.length; - var found = null; - for(var i=0; i"); - } - else - { - alert(msg + " : nodeType="+n.nodeType); - } - } - else - { - alert(msg + " : NULL"); - } + if(typeof(msg)=="undefined") + msg = ""; + if(n) + { + if(n.nodeType==1) + { + alert(msg + " : <"+n.nodeName+" id='"+n.id+"'>"); + } + else + { + alert(msg + " : nodeType="+n.nodeType); + } + } + else + { + alert(msg + " : NULL"); + } } function appendTerm(inputName, new_term, id) { - var tr = document.createElement("TR"); - 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 = tr.appendChild(document.createElement("TD")); - td.appendChild(document.createTextNode(" ")); + var tr = document.createElement("TR"); + 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 = tr.appendChild(document.createElement("TD")); + td.appendChild(document.createTextNode(" ")); - var zTable = document.getElementById("L"+inputName); - return(zTable.appendChild(tr)); + 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 35dde01227..ae8e3cd81d 100644 --- a/www/skins/thesaurus/win.js +++ b/www/skins/thesaurus/win.js @@ -5,788 +5,788 @@ debuglog = ""; function ww_setDragObj(obj) { - if(dragObj.objCursor) - dragObj.objCursor.style.visibility = "hidden"; - dragObj.objCursor = obj ? obj : document.getElementById("dragDropCursor"); - obj.style.visibility = "visible"; + 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) { - var gui = eval(gui); - var button; - if(typeof(event.which) != 'undefined') - button = gui.firefoxButtons["b"+event.which]; - else - button = event.button; + var gui = eval(gui); + var button; + if(typeof(event.which) != 'undefined') + button = gui.firefoxButtons["b"+event.which]; + else + button = event.button; - if(!dragObj.objCursor) - dragObj.objCursor = document.getElementById("dragDropCursor"); - dragObj.Src0 = dragObj.Src = dragObj.Target = dragObj.Target0 = null; - dragObj.dragging = 0; + 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) - ; + var srcElement = (event.target) ? event.target : event.srcElement; + var src0; + 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+"'>"); - var clickfound = false; - var xmouse = parseInt(event.clientX); - 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) - { - clickObj.X = xmouse; - clickObj.Y = ymouse; - clickObj.Src = e; - clickObj.Src0 = src0; + var clickfound = false; + var xmouse = parseInt(event.clientX); + 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) + { + clickObj.X = xmouse; + clickObj.Y = ymouse; + clickObj.Src = e; + clickObj.Src0 = src0; - clickfound = true; - if(e.clickCallback) - (e.clickCallback)(event, "DBLCLICK", clickObj); - } - } + clickfound = true; + if(e.clickCallback) + (e.clickCallback)(event, "DBLCLICK", clickObj); + } + } } var iiii=0; - function ww_evt_mdwn_doc(gui, evt) - { - var gui = eval(gui); - - if(gui.elemBalloon) - gui.elemBalloon.style.visibility = "hidden"; - if(timer_ballon) - { - clearTimeout(timer_ballon); - timer_ballon = null; - } - var button; - if(typeof(evt.which) != 'undefined') - button = gui.firefoxButtons["b"+evt.which]; - else - button = evt.button; +function ww_evt_mdwn_doc(gui, evt) +{ + var gui = eval(gui); - dragObj.objCursor = document.getElementById("dragDropCursor"); - dragObj.dragSrc0 = dragObj.dragSrc = dragObj.dragTarget = null; - dragObj.dragging = 0; - - var srcElement = evt.srcElement ? evt.srcElement : evt.target; + if(gui.elemBalloon) + gui.elemBalloon.style.visibility = "hidden"; + if(timer_ballon) + { + clearTimeout(timer_ballon); + timer_ballon = null; + } + var button; + if(typeof(evt.which) != 'undefined') + button = gui.firefoxButtons["b"+evt.which]; + else + button = evt.button; + + dragObj.objCursor = document.getElementById("dragDropCursor"); + dragObj.dragSrc0 = dragObj.dragSrc = dragObj.dragTarget = null; + dragObj.dragging = 0; + + 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) - ; - - 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')) != "") - min = parseInt(x); - if( (x = src0.getAttribute('max')) != "") - max = parseInt(x); - var pos = parseInt(src0.style.left); - var val = min + (((max-min) * pos) / posmax); - // var pos = (int)(((val-min) * divmax) / (max-min)); - var cb = null; - if( (x=src0.getAttribute('callback')) != "") - cb = eval(x); + for(src0=srcElement; src0 && (!src0.tagName || src0.tagName=='APPLET' || src0.tagName=='OBJECT' || !src0.id); src0=src0.parentNode) + ; - 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') - { - 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') - { - src0.setAttribute('oleft', parseInt(src0.style.left)); - src0.setAttribute('ozindex', parseInt(src0.style.zIndex)); - src0.style.zIndex = 999; - gui.splitting = src0; - return(false); - } - - var dragfound = false; - var clickfound = false; - var xmouse = parseInt(evt.clientX); - 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) - { - clickObj.X = xmouse; - clickObj.Y = ymouse; - clickObj.Src = e; - clickObj.Src0 = src0; - - // d = new Date(); - // dT = d.getTime() - clickObj.lastClickT; - // clickObj.lastClickT = d.getTime(); - - // if(dT<5000) - // alert("dT :" + dT); - - clickfound = true; - 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 - acceptClick = (e.clickCallback)(evt, "RMOUSEDOWN", clickObj); - } - } - - if(acceptClick && e && e.draggable) // && (!src0.draggable || src0.draggable!=-1)) - { - // alert(e.draggable); - dragObj.lastClickX = xmouse; - dragObj.lastClickY = ymouse; - dragObj.Src = e; - dragObj.Src0 = src0; - // alert("<" + src0.tagName + " id='" + src0.id + "'>"); - dragObj.dragging = 1; - //alert("src0:<"+src0.tagName+" id="+src0.id+" "+src0.draggable+"> \ne:<"+e.tagName+" id="+e.id+" "+e.draggable+">"); - dragfound = true; - } - } - evt.cancelBubble = true; - evt.returnValue = false; - } + 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')) != "") + min = parseInt(x); + if( (x = src0.getAttribute('max')) != "") + max = parseInt(x); + var pos = parseInt(src0.style.left); + var val = min + (((max-min) * pos) / posmax); + // var pos = (int)(((val-min) * divmax) / (max-min)); + var cb = null; + if( (x=src0.getAttribute('callback')) != "") + cb = eval(x); -/* -function unused_evt_mmov_doc(event, gui) -{ - var gui = eval(gui); - var button, xmouse, ymouse; - - if(gui.elemBalloon) - gui.elemBalloon.style.visibility = "hidden"; - if(timer_ballon) - { - clearTimeout(timer_ballon); - timer_ballon = null; - } - dragObj.X = xmouse = parseInt(event.clientX); - dragObj.Y = ymouse = parseInt(event.clientY); - window.status = xmouse + '-' + ymouse; + 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') + { + 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') + { + src0.setAttribute('oleft', parseInt(src0.style.left)); + src0.setAttribute('ozindex', parseInt(src0.style.zIndex)); + src0.style.zIndex = 999; + gui.splitting = src0; + return(false); + } - under_ballon = (event.target) ? event.target : event.srcElement; - if(under_ballon.id) - { - js = "timeout_ballon('"+under_ballon.id+"', "+xmouse+", "+ymouse+");" - timer_ballon = setTimeout(js, 300); - } + var dragfound = false; + var clickfound = false; + var xmouse = parseInt(evt.clientX); + var ymouse = parseInt(evt.clientY); + var acceptClick = true; + var e; + for(var e=src0; e && acceptClick && (!e.tagName || !dragfound || !clickfound); e=e.parentNode) + { - if(!dragObj.Src) - { - if(dragObj.objCursor) - dragObj.objCursor.style.visibility = "hidden"; - return; - } - if(dragObj.dragging == 1) - { - var dx = xmouse - dragObj.lastClickX; - var dy = ymouse - dragObj.lastClickY; - if(Math.abs(dx)>4 || Math.abs(dy)>4) - { - if(dragObj.objCursor) - { - dragObj.objCursor.style.visibility = "visible"; - } - dragObj.dragging = 2; - if(dragObj.Src.ondragstart) - { - // alert("gui is calling ondragstart"); - (dragObj.Src.ondragstart)(); - } - if(dragObj.Src.dragCallback) - { - var r = (dragObj.Src.dragCallback)(event, "DRAGSTART", dragObj); - if(!r) - { - dragObj.dragging = 0; - dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null; - if(dragObj.objCursor) - dragObj.objCursor.style.visibility = "hidden"; - } - } - } - } - if(dragObj.dragging == 2) - { - if(dragObj.objCursor) - { - dragObj.objCursor.style.pixelLeft = xmouse+8; - dragObj.objCursor.style.pixelTop = ymouse+8; - } - var srcElement = (event.target) ? event.target : event.srcElement; - var src0; - var e; - for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode) - ; - for(e=src0; e && (!e.tagName || !e.droppable); e=e.parentNode) - ; - if(src0) - { - dragObj.Target0 = src0; - if(dragObj.Target && e != dragObj.Target) // && src0 != e) - { - if(dragObj.Target.ondragleave) - (dragObj.Target.ondragleave)(); - if(dragObj.Target.dropCallback) - (dragObj.Target.dropCallback)(event, "DRAGLEAVE", dragObj); - dragObj.Target = null; - } - if(e) - { - if(!dragObj.Target) - { - dragObj.Target = e; - if(e.ondragenter) - (e.ondragenter)(); - if(dragObj.Target.dropCallback) - (dragObj.Target.dropCallback)(event, "DRAGENTER", dragObj); - } - else - { - if(dragObj.Src.dragCallback) - (dragObj.Src.dragCallback)(event, "DRAG", dragObj); - if(dragObj.Target.dropCallback) - (dragObj.Target.dropCallback)(event, "DRAGOVER", dragObj); - } - } - } - } + if(e && e.clickable) + { + clickObj.X = xmouse; + clickObj.Y = ymouse; + clickObj.Src = e; + clickObj.Src0 = src0; + + // d = new Date(); + // dT = d.getTime() - clickObj.lastClickT; + // clickObj.lastClickT = d.getTime(); + + // if(dT<5000) + // alert("dT :" + dT); + + clickfound = true; + 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 + acceptClick = (e.clickCallback)(evt, "RMOUSEDOWN", clickObj); + } + } + + if(acceptClick && e && e.draggable) // && (!src0.draggable || src0.draggable!=-1)) + { + // alert(e.draggable); + dragObj.lastClickX = xmouse; + dragObj.lastClickY = ymouse; + dragObj.Src = e; + dragObj.Src0 = src0; + // alert("<" + src0.tagName + " id='" + src0.id + "'>"); + dragObj.dragging = 1; + //alert("src0:<"+src0.tagName+" id="+src0.id+" "+src0.draggable+"> \ne:<"+e.tagName+" id="+e.id+" "+e.draggable+">"); + dragfound = true; + } + } + evt.cancelBubble = true; + evt.returnValue = false; } -*/ - - function ww_evt_mmov_doc(gui, evt) - { - var gui = eval(gui); - var button, xmouse, ymouse; - - if(gui.elemBalloon) - gui.elemBalloon.style.visibility = "hidden"; - if(timer_ballon) - { - clearTimeout(timer_ballon); - timer_ballon = null; - } - dragObj.X = xmouse = parseInt(evt.clientX); - dragObj.Y = ymouse = parseInt(evt.clientY); + +/* + function unused_evt_mmov_doc(event, gui) + { + var gui = eval(gui); + var button, xmouse, ymouse; + + if(gui.elemBalloon) + gui.elemBalloon.style.visibility = "hidden"; + if(timer_ballon) + { + clearTimeout(timer_ballon); + timer_ballon = null; + } + dragObj.X = xmouse = parseInt(event.clientX); + dragObj.Y = ymouse = parseInt(event.clientY); + window.status = xmouse + '-' + ymouse; + + under_ballon = (event.target) ? event.target : event.srcElement; + if(under_ballon.id) + { + js = "timeout_ballon('"+under_ballon.id+"', "+xmouse+", "+ymouse+");" + timer_ballon = setTimeout(js, 300); + } + + if(!dragObj.Src) + { + if(dragObj.objCursor) + dragObj.objCursor.style.visibility = "hidden"; + return; + } + if(dragObj.dragging == 1) + { + var dx = xmouse - dragObj.lastClickX; + var dy = ymouse - dragObj.lastClickY; + if(Math.abs(dx)>4 || Math.abs(dy)>4) + { + if(dragObj.objCursor) + { + dragObj.objCursor.style.visibility = "visible"; + } + dragObj.dragging = 2; + if(dragObj.Src.ondragstart) + { + // alert("gui is calling ondragstart"); + (dragObj.Src.ondragstart)(); + } + if(dragObj.Src.dragCallback) + { + var r = (dragObj.Src.dragCallback)(event, "DRAGSTART", dragObj); + if(!r) + { + dragObj.dragging = 0; + dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null; + if(dragObj.objCursor) + dragObj.objCursor.style.visibility = "hidden"; + } + } + } + } + if(dragObj.dragging == 2) + { + if(dragObj.objCursor) + { + dragObj.objCursor.style.pixelLeft = xmouse+8; + dragObj.objCursor.style.pixelTop = ymouse+8; + } + var srcElement = (event.target) ? event.target : event.srcElement; + var src0; + var e; + for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode) + ; + for(e=src0; e && (!e.tagName || !e.droppable); e=e.parentNode) + ; + + if(src0) + { + dragObj.Target0 = src0; + if(dragObj.Target && e != dragObj.Target) // && src0 != e) + { + if(dragObj.Target.ondragleave) + (dragObj.Target.ondragleave)(); + if(dragObj.Target.dropCallback) + (dragObj.Target.dropCallback)(event, "DRAGLEAVE", dragObj); + dragObj.Target = null; + } + if(e) + { + if(!dragObj.Target) + { + dragObj.Target = e; + if(e.ondragenter) + (e.ondragenter)(); + if(dragObj.Target.dropCallback) + (dragObj.Target.dropCallback)(event, "DRAGENTER", dragObj); + } + else + { + if(dragObj.Src.dragCallback) + (dragObj.Src.dragCallback)(event, "DRAG", dragObj); + if(dragObj.Target.dropCallback) + (dragObj.Target.dropCallback)(event, "DRAGOVER", dragObj); + } + } + } + } + } + */ + +function ww_evt_mmov_doc(gui, evt) +{ + var gui = eval(gui); + var button, xmouse, ymouse; + + if(gui.elemBalloon) + gui.elemBalloon.style.visibility = "hidden"; + if(timer_ballon) + { + clearTimeout(timer_ballon); + timer_ballon = null; + } + dragObj.X = xmouse = parseInt(evt.clientX); + dragObj.Y = ymouse = parseInt(evt.clientY); //window.status = xmouse + '-' + ymouse; - - under_ballon = (evt.target) ? evt.target : evt.srcElement; - 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) - { - dx = xmouse - dragObj.lastClickX; - dy = ymouse - dragObj.lastClickY; - if(Math.abs(dx)>4 || Math.abs(dy)>4) - { - if(dragObj.objCursor) - { - dragObj.objCursor.style.visibility = "visible"; - } - dragObj.dragging = 2; - if(dragObj.Src.ondragstart) - { - // alert("gui is calling ondragstart"); - (dragObj.Src.ondragstart)(); - } - if(dragObj.Src.dragCallback) - { - var r = (dragObj.Src.dragCallback)(evt, "DRAGSTART", dragObj); - if(!r) - { - dragObj.dragging = 0; - dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null; - if(dragObj.objCursor) - dragObj.objCursor.style.visibility = "hidden"; - } - } - } - } - if(dragObj.dragging == 2) - { - if(dragObj.objCursor) - { + under_ballon = (evt.target) ? evt.target : evt.srcElement; + 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) + { + dx = xmouse - dragObj.lastClickX; + dy = ymouse - dragObj.lastClickY; + if(Math.abs(dx)>4 || Math.abs(dy)>4) + { + if(dragObj.objCursor) + { + dragObj.objCursor.style.visibility = "visible"; + } + dragObj.dragging = 2; + if(dragObj.Src.ondragstart) + { + // alert("gui is calling ondragstart"); + (dragObj.Src.ondragstart)(); + } + if(dragObj.Src.dragCallback) + { + var r = (dragObj.Src.dragCallback)(evt, "DRAGSTART", dragObj); + if(!r) + { + dragObj.dragging = 0; + dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null; + if(dragObj.objCursor) + dragObj.objCursor.style.visibility = "hidden"; + } + } + } + } + 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"; - } - var srcElement = (evt.target) ? evt.target : evt.srcElement; - var src0; - var e; - for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode) - ; - for(e=src0; e && (!e.tagName || !e.droppable); e=e.parentNode) - ; - - if(src0) - { - dragObj.Target0 = src0; - if(dragObj.Target && e != dragObj.Target) // && src0 != e) - { - if(dragObj.Target.ondragleave) - (dragObj.Target.ondragleave)(); - if(dragObj.Target.dropCallback) - (dragObj.Target.dropCallback)(evt, "DRAGLEAVE", dragObj); - dragObj.Target = null; - } - if(e) - { - if(!dragObj.Target) - { - dragObj.Target = e; - if(e.ondragenter) - (e.ondragenter)(); - if(dragObj.Target.dropCallback) - (dragObj.Target.dropCallback)(evt, "DRAGENTER", dragObj); - } - else - { - if(dragObj.Src.dragCallback) - (dragObj.Src.dragCallback)(evt, "DRAG", dragObj); - if(dragObj.Target.dropCallback) - (dragObj.Target.dropCallback)(evt, "DRAGOVER", dragObj); - } - } - } - } - return; // if drag/drop, don't care about moving windows - } -/* - dragObj.objCursor.style.visibility = "hidden"; - - // msg("" + (e.clientX) + " - " + (e.clientY) ); - if(gui.w_active != -1 && (gui.sizing || gui.dragging || gui.splitting || gui.sliding)) - { - t = ""; - var wwin = parseInt(gui.twin[gui.w_active].properties.width); - var hwin = parseInt(gui.twin[gui.w_active].properties.height); - var wgui = document.getElementById("idBody").clientWidth; - var hgui = document.getElementById("idBody").clientHeight; - - if(gui.sliding) - { - //gui.sliding = { 'obj':src0, 'dir':"H", 'divmax':divmax, 'pos':pos, 'min':min, 'max':max, 'val':val }; - if(gui.sliding.dir == "H") - { - var opos = gui.sliding.opos; - var npos = opos + (xmouse - gui.x0); -// self.status = "otop=" + otop + " ntop="+ntop; - if(npos < 0) - npos = 0; - else if(npos > gui.sliding.posmax ) - npos = gui.sliding.posmax; - if(npos != opos) - { - var val = (gui.sliding.min + (((gui.sliding.max-gui.sliding.min) * npos) / gui.sliding.posmax)); - npos = Math.round(((val-gui.sliding.min) * gui.sliding.posmax) / (gui.sliding.max-gui.sliding.min)); - if(npos != opos) - { - gui.sliding.val = val; - gui.sliding.pos = npos; - gui.sliding.obj.style.left = npos+"px"; - var cb; - if(cb = gui.sliding.callback) - (cb)('HSLIDING', gui.sliding.pbj, val); - } - } - } - } - if(gui.splitting) - { - if(gui.splitting.className == "hsplitter") - { - var otop = parseInt(gui.splitting.getAttribute('otop')); - var ntop = otop + (ymouse - gui.y0); -// self.status = "otop=" + otop + " ntop="+ntop; - if(ntop > 40 && ntop < hwin-40 ) - gui.splitting.style.top = ntop+"px"; - } - else if(gui.splitting.className == "vsplitter") - { - var oleft = parseInt(gui.splitting.getAttribute('oleft')); - var nleft = oleft + (xmouse - gui.x0); -// self.status = "otop=" + otop + " ntop="+ntop; - if(nleft > 40 && nleft < wwin-40 ) - gui.splitting.style.left = nleft+"px"; - } - } - - if(gui.dragging) - { - gui.new_t = gui.t0 + (ymouse - gui.y0); - gui.new_l = gui.l0 + (xmouse - gui.x0); - var magnetic = {T:"-", L:"-", B:"-", R:"-" }; - if(gui.new_l < 20) - { - gui.new_l = 0; - magnetic.L = "L"; - } - if(magnetic.L=="-" && gui.new_l + wwin > wgui-20) - { - gui.new_l = wgui-wwin; - magnetic.R = "R"; - } - if(gui.new_t < 20) - { - gui.new_t = 0; - magnetic.T = "T"; - } - if(magnetic.T=="-" && gui.new_t + hwin > hgui-20) - { - gui.new_t = hgui-hwin; - magnetic.B = "B"; - } - gui.twin[gui.w_active].magnetic = magnetic.T + magnetic.L + magnetic.B + magnetic.R; + 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(e=src0; e && (!e.tagName || !e.droppable); e=e.parentNode) + ; - t = "top:" + (gui.new_t) + "px; left:" + (gui.new_l) + "px; width:" + (gui.w0-4) + "px; height:" + (gui.h0-4) + "px; visibility:visible;" ; + if(src0) + { + dragObj.Target0 = src0; + if(dragObj.Target && e != dragObj.Target) // && src0 != e) + { + if(dragObj.Target.ondragleave) + (dragObj.Target.ondragleave)(); + if(dragObj.Target.dropCallback) + (dragObj.Target.dropCallback)(evt, "DRAGLEAVE", dragObj); + dragObj.Target = null; + } + if(e) + { + if(!dragObj.Target) + { + dragObj.Target = e; + if(e.ondragenter) + (e.ondragenter)(); + if(dragObj.Target.dropCallback) + (dragObj.Target.dropCallback)(evt, "DRAGENTER", dragObj); + } + else + { + if(dragObj.Src.dragCallback) + (dragObj.Src.dragCallback)(evt, "DRAG", dragObj); + if(dragObj.Target.dropCallback) + (dragObj.Target.dropCallback)(evt, "DRAGOVER", dragObj); + } + } + } + } + return; // if drag/drop, don't care about moving windows + } + /* + dragObj.objCursor.style.visibility = "hidden"; - gui.windowBorder.style.top = (gui.new_t)+"px"; - gui.windowBorder.style.left = (gui.new_l)+"px"; - } - if(gui.sizing) - { - gui.new_h = gui.h0 + (ymouse - gui.y0); - gui.new_w = gui.w0 + (xmouse - gui.x0); - if(gui.new_w < gui.twin[gui.w_active].minwidth) - gui.new_w = gui.twin[gui.w_active].minwidth; - else - if(gui.new_w > gui.twin[gui.w_active].maxwidth) - gui.new_w = gui.twin[gui.w_active].maxwidth; - - if(gui.new_h < gui.twin[gui.w_active].minheight) - gui.new_h = gui.twin[gui.w_active].minheight; - else - if(gui.new_h > gui.twin[gui.w_active].maxheight) - gui.new_h = gui.twin[gui.w_active].maxheight; - - t = "top:" + (gui.t0) + "px; left:" + (gui.l0) + "px; width:" + (gui.new_w-4) + "px; height:" + (gui.new_h-4) + "px; visibility:visible" ; + // msg("" + (e.clientX) + " - " + (e.clientY) ); + if(gui.w_active != -1 && (gui.sizing || gui.dragging || gui.splitting || gui.sliding)) + { + t = ""; + var wwin = parseInt(gui.twin[gui.w_active].properties.width); + var hwin = parseInt(gui.twin[gui.w_active].properties.height); + var wgui = document.getElementById("idBody").clientWidth; + var hgui = document.getElementById("idBody").clientHeight; - gui.windowBorder.style.width = (gui.new_w-4)+"px"; - gui.windowBorder.style.height = (gui.new_h-4)+"px"; - } -t += "z-index:999; display:block; background-color:#FFFF00; position:absolute;" -// self.status = t; + if(gui.sliding) + { + //gui.sliding = { 'obj':src0, 'dir':"H", 'divmax':divmax, 'pos':pos, 'min':min, 'max':max, 'val':val }; + if(gui.sliding.dir == "H") + { + var opos = gui.sliding.opos; + var npos = opos + (xmouse - gui.x0); + // self.status = "otop=" + otop + " ntop="+ntop; + if(npos < 0) + npos = 0; + else if(npos > gui.sliding.posmax ) + npos = gui.sliding.posmax; + if(npos != opos) + { + var val = (gui.sliding.min + (((gui.sliding.max-gui.sliding.min) * npos) / gui.sliding.posmax)); + npos = Math.round(((val-gui.sliding.min) * gui.sliding.posmax) / (gui.sliding.max-gui.sliding.min)); + if(npos != opos) + { + gui.sliding.val = val; + gui.sliding.pos = npos; + gui.sliding.obj.style.left = npos+"px"; + var cb; + if(cb = gui.sliding.callback) + (cb)('HSLIDING', gui.sliding.pbj, val); + } + } + } + } + if(gui.splitting) + { + if(gui.splitting.className == "hsplitter") + { + var otop = parseInt(gui.splitting.getAttribute('otop')); + var ntop = otop + (ymouse - gui.y0); + // self.status = "otop=" + otop + " ntop="+ntop; + if(ntop > 40 && ntop < hwin-40 ) + gui.splitting.style.top = ntop+"px"; + } + else if(gui.splitting.className == "vsplitter") + { + var oleft = parseInt(gui.splitting.getAttribute('oleft')); + var nleft = oleft + (xmouse - gui.x0); + // self.status = "otop=" + otop + " ntop="+ntop; + if(nleft > 40 && nleft < wwin-40 ) + gui.splitting.style.left = nleft+"px"; + } + } - // gui.twin[gui.w_active].hide(); - // document.getElementById(gui.varname+"w"+gui.w_active).style.display = "none"; - // document.getElementById(gui.varname+"wb").style.cssText = t; -// gui.windowBorder.style.cssText = t; - } -*/ - return false; - } + if(gui.dragging) + { + gui.new_t = gui.t0 + (ymouse - gui.y0); + gui.new_l = gui.l0 + (xmouse - gui.x0); + var magnetic = {T:"-", L:"-", B:"-", R:"-" }; + if(gui.new_l < 20) + { + gui.new_l = 0; + magnetic.L = "L"; + } + if(magnetic.L=="-" && gui.new_l + wwin > wgui-20) + { + gui.new_l = wgui-wwin; + magnetic.R = "R"; + } + if(gui.new_t < 20) + { + gui.new_t = 0; + magnetic.T = "T"; + } + if(magnetic.T=="-" && gui.new_t + hwin > hgui-20) + { + gui.new_t = hgui-hwin; + magnetic.B = "B"; + } + gui.twin[gui.w_active].magnetic = magnetic.T + magnetic.L + magnetic.B + magnetic.R; -/* + t = "top:" + (gui.new_t) + "px; left:" + (gui.new_l) + "px; width:" + (gui.w0-4) + "px; height:" + (gui.h0-4) + "px; visibility:visible;" ; -function unused_evt_mup_doc(event, gui) -{ - var gui = eval(gui); - var srcElement = (event.target) ? event.target : event.srcElement; - var src0; - for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode) - ; - - var button; - if(typeof(event.which) != 'undefined') - button = gui.firefoxButtons["b"+event.which]; - else - button = event.button; - var xmouse = parseInt(event.clientX); - var ymouse = parseInt(event.clientY); - var e; - var clickfound = false; - 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; + gui.windowBorder.style.top = (gui.new_t)+"px"; + gui.windowBorder.style.left = (gui.new_l)+"px"; + } + if(gui.sizing) + { + gui.new_h = gui.h0 + (ymouse - gui.y0); + gui.new_w = gui.w0 + (xmouse - gui.x0); + if(gui.new_w < gui.twin[gui.w_active].minwidth) + gui.new_w = gui.twin[gui.w_active].minwidth; + else + if(gui.new_w > gui.twin[gui.w_active].maxwidth) + gui.new_w = gui.twin[gui.w_active].maxwidth; - clickfound = true; - if(e.clickCallback) - { - if(button == 1 && !event.ctrlKey) // left button - acceptClick = (e.clickCallback)(event, event.ctrlKey ? "RMOUSEUP" : "MOUSEUP", clickObj); - else - if(button == 2 && !event.ctrlKey) // right button - acceptClick = (e.clickCallback)(event, "RMOUSEUP", clickObj); - } - } - } - - if(!dragObj.Src) - { - if(dragObj.objCursor) - dragObj.objCursor.style.visibility = "hidden"; - return; - } - - 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) - (dragObj.Target.ondrop)(); - if(dragObj.Target.dropCallback) - (dragObj.Target.dropCallback)(event, "DROP", dragObj); - } - } - } - if(dragObj.Src.dropCallback) - (dragObj.Src.dropCallback)(event, "DRAGEND", dragObj); - dragObj.dragging = 0; - dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null; - if(dragObj.objCursor) - dragObj.objCursor.style.visibility = "hidden"; + if(gui.new_h < gui.twin[gui.w_active].minheight) + gui.new_h = gui.twin[gui.w_active].minheight; + else + if(gui.new_h > gui.twin[gui.w_active].maxheight) + gui.new_h = gui.twin[gui.w_active].maxheight; + + t = "top:" + (gui.t0) + "px; left:" + (gui.l0) + "px; width:" + (gui.new_w-4) + "px; height:" + (gui.new_h-4) + "px; visibility:visible" ; + + gui.windowBorder.style.width = (gui.new_w-4)+"px"; + gui.windowBorder.style.height = (gui.new_h-4)+"px"; + } + t += "z-index:999; display:block; background-color:#FFFF00; position:absolute;" + // self.status = t; + + // gui.twin[gui.w_active].hide(); + // document.getElementById(gui.varname+"w"+gui.w_active).style.display = "none"; + // document.getElementById(gui.varname+"wb").style.cssText = t; + // gui.windowBorder.style.cssText = t; + } + */ + return false; +} + +/* + + function unused_evt_mup_doc(event, gui) + { + var gui = eval(gui); + var srcElement = (event.target) ? event.target : event.srcElement; + var src0; + for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode) + ; + + var button; + if(typeof(event.which) != 'undefined') + button = gui.firefoxButtons["b"+event.which]; + else + button = event.button; + var xmouse = parseInt(event.clientX); + var ymouse = parseInt(event.clientY); + var e; + var clickfound = false; + 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 && !event.ctrlKey) // left button + acceptClick = (e.clickCallback)(event, event.ctrlKey ? "RMOUSEUP" : "MOUSEUP", clickObj); + else + if(button == 2 && !event.ctrlKey) // right button + acceptClick = (e.clickCallback)(event, "RMOUSEUP", clickObj); + } + } + } + + if(!dragObj.Src) + { + if(dragObj.objCursor) + dragObj.objCursor.style.visibility = "hidden"; + return; + } + + 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) + (dragObj.Target.ondrop)(); + if(dragObj.Target.dropCallback) + (dragObj.Target.dropCallback)(event, "DROP", dragObj); + } + } + } + if(dragObj.Src.dropCallback) + (dragObj.Src.dropCallback)(event, "DRAGEND", dragObj); + dragObj.dragging = 0; + dragObj.Src0 = dragObj.Src = dragObj.Target0 = dragObj.Target = null; + if(dragObj.objCursor) + dragObj.objCursor.style.visibility = "hidden"; + } + */ +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) + ; + + var button; + 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) + { + clickObj.X = xmouse; + clickObj.Y = ymouse; + clickObj.Src = e; + clickObj.Src0 = src0; + + clickfound = true; + 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 + acceptClick = (e.clickCallback)(evt, "RMOUSEUP", clickObj); + } + } + } + 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) + { + ; + } + if(e) + { + if(dragObj.Target && e == dragObj.Target) + { + if(dragObj.Target.ondrop) + (dragObj.Target.ondrop)(); + if(dragObj.Target.dropCallback) + (dragObj.Target.dropCallback)(evt, "DROP", dragObj); + } + } + } + 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) + dragObj.objCursor.style.visibility = "hidden"; + } + /* + if(gui.sliding) + { + gui.sliding = null; + } + + if(gui.splitting) + { + gui.splitting.style.zIndex = parseInt(gui.splitting.getAttribute('ozindex')); + gui.splitting = null; + } + + if((gui.w_active != -1) && (gui.dragging || gui.sizing)) + { + // document.getElementById(gui.varname+"wb").style.visibility = "hidden"; + gui.windowBorder.style.visibility = "hidden"; + + gui.twin[gui.w_active].setProperties( { top:(gui.new_t)+"px", left:(gui.new_l)+"px", width:(gui.new_w)+"px", height:(gui.new_h)+"px" } ); + // alert("ww_evt_mup_doc : new_w="+gui.new_w + " new_h="+gui.new_h); + // document.getElementById(gui.varname+"w"+gui.w_active).style.zIndex = 1; + if(gui.sizing && gui.twin[gui.w_active].onresized) + (gui.twin[gui.w_active].onresized)(gui.new_t, gui.new_l, gui.new_w, gui.new_h); + + gui.dragging = gui.sizing = false; + // eval(gui.twin[gui.w_active].onresized); + } + */ + return true; } -*/ - 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) - ; - - var button; - 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) - { - clickObj.X = xmouse; - clickObj.Y = ymouse; - clickObj.Src = e; - clickObj.Src0 = src0; - - clickfound = true; - 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 - acceptClick = (e.clickCallback)(evt, "RMOUSEUP", clickObj); - } - } - } - 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) - { - ; - } - if(e) - { - if(dragObj.Target && e == dragObj.Target) - { - if(dragObj.Target.ondrop) - (dragObj.Target.ondrop)(); - if(dragObj.Target.dropCallback) - (dragObj.Target.dropCallback)(evt, "DROP", dragObj); - } - } - } - 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) - dragObj.objCursor.style.visibility = "hidden"; - } -/* - if(gui.sliding) - { - gui.sliding = null; - } - - if(gui.splitting) - { - gui.splitting.style.zIndex = parseInt(gui.splitting.getAttribute('ozindex')); - gui.splitting = null; - } - - if((gui.w_active != -1) && (gui.dragging || gui.sizing)) - { - // document.getElementById(gui.varname+"wb").style.visibility = "hidden"; - gui.windowBorder.style.visibility = "hidden"; - - gui.twin[gui.w_active].setProperties( { top:(gui.new_t)+"px", left:(gui.new_l)+"px", width:(gui.new_w)+"px", height:(gui.new_h)+"px" } ); - // alert("ww_evt_mup_doc : new_w="+gui.new_w + " new_h="+gui.new_h); - // document.getElementById(gui.varname+"w"+gui.w_active).style.zIndex = 1; - if(gui.sizing && gui.twin[gui.w_active].onresized) - (gui.twin[gui.w_active].onresized)(gui.new_t, gui.new_l, gui.new_w, gui.new_h); - - gui.dragging = gui.sizing = false; - // eval(gui.twin[gui.w_active].onresized); - } -*/ - return true; - } function ww_evt_kon_doc(gui, evt) { - var gui = eval(gui); - - if(gui.elemBalloon) - gui.elemBalloon.style.visibility = "hidden"; - if(timer_ballon) - { - clearTimeout(timer_ballon); - timer_ballon = null; - } - - if(!dragObj.objCursor) - dragObj.objCursor = document.getElementById("dragDropCursor"); - dragObj.Src0 = dragObj.Src = dragObj.Target = dragObj.Target0 = null; - dragObj.dragging = 0; + var gui = eval(gui); - var srcElement = (evt.target) ? evt.target : evt.srcElement; - var src0; - for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode) - ; + if(gui.elemBalloon) + gui.elemBalloon.style.visibility = "hidden"; + if(timer_ballon) + { + clearTimeout(timer_ballon); + timer_ballon = null; + } - var dragfound = false; - var clickfound = false; - var xmouse = parseInt(evt.clientX); - 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) - { - clickObj.X = xmouse; - clickObj.Y = ymouse; - clickObj.Src = e; - clickObj.Src0 = src0; - clickfound = true; - if(e.clickCallback) - { - // var js = "cbDD_T0('CONTEXTMENU', '"+src0.id+"')"; - // self.setTimeout(js, 3000); - // (js)(); - acceptClick = (e.clickCallback)(evt, "CONTEXTMENU", clickObj); - } - } - } - evt.cancelBubble = true; // for firefox - evt.returnValue = false; // for others + 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) + ; + + var dragfound = false; + var clickfound = false; + var xmouse = parseInt(evt.clientX); + 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) + { + clickObj.X = xmouse; + clickObj.Y = ymouse; + clickObj.Src = e; + clickObj.Src0 = src0; + clickfound = true; + if(e.clickCallback) + { + // var js = "cbDD_T0('CONTEXTMENU', '"+src0.id+"')"; + // self.setTimeout(js, 3000); + // (js)(); + acceptClick = (e.clickCallback)(evt, "CONTEXTMENU", clickObj); + } + } + } + evt.cancelBubble = true; // for firefox + evt.returnValue = false; // for others // return(false); } /* -function disabled_evt_kon_doc(event, gui) -{ -// var str=''; for (var k in event) {str+='event.'+k+'='+event[k]+'
\n'} -// document.getElementById("debug").innerHTML = "KON "+(iiii++)+"
\n" + str ; + function disabled_evt_kon_doc(event, gui) + { + // var str=''; for (var k in event) {str+='event.'+k+'='+event[k]+'
\n'} + // document.getElementById("debug").innerHTML = "KON "+(iiii++)+"
\n" + str ; - var gui = eval(gui); - - if(gui.elemBalloon) - gui.elemBalloon.style.visibility = "hidden"; - if(timer_ballon) - { - clearTimeout(timer_ballon); - timer_ballon = null; - } - - if(!dragObj.objCursor) - dragObj.objCursor = document.getElementById("dragDropCursor"); - dragObj.Src0 = dragObj.Src = dragObj.Target = dragObj.Target0 = null; - dragObj.dragging = 0; + var gui = eval(gui); - var srcElement = (event.target) ? event.target : event.srcElement; - var src0; - for(src0=srcElement; src0 && !src0.id; src0=src0.parentNode) - ; + if(gui.elemBalloon) + gui.elemBalloon.style.visibility = "hidden"; + if(timer_ballon) + { + clearTimeout(timer_ballon); + timer_ballon = null; + } - var dragfound = false; - var clickfound = false; - var xmouse = parseInt(event.clientX); - var ymouse = parseInt(event.clientY); - var acceptClick = true; - var e; - 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) - { - // var js = "cbDD_T0('CONTEXTMENU', '"+src0.id+"')"; - // self.setTimeout(js, 3000); - // (js)(); - acceptClick = (e.clickCallback)(event, "CONTEXTMENU", clickObj); - } - } - } - event.cancelBubble = true; - event.returnValue = false; -// document.getElementById("debug").innerHTML = "src0:("+src0.tagName+" id="+src0.id+" "+src0.draggable+")
e:("+e.tagName+" id="+e.id+" "+e.draggable+") --- "+dragObj.dragging; -} -*/ + 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) + ; + + var dragfound = false; + var clickfound = false; + var xmouse = parseInt(event.clientX); + var ymouse = parseInt(event.clientY); + var acceptClick = true; + var e; + 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) + { + // var js = "cbDD_T0('CONTEXTMENU', '"+src0.id+"')"; + // self.setTimeout(js, 3000); + // (js)(); + acceptClick = (e.clickCallback)(event, "CONTEXTMENU", clickObj); + } + } + } + event.cancelBubble = true; + event.returnValue = false; + // document.getElementById("debug").innerHTML = "src0:("+src0.tagName+" id="+src0.id+" "+src0.draggable+")
e:("+e.tagName+" id="+e.id+" "+e.draggable+") --- "+dragObj.dragging; + } + */ // ------------------------------------------------------------------------------------------------------ @@ -796,1148 +796,1148 @@ var timer_ballon = null; var under_ballon = null; function timeout_ballon(id, xmouse, ymouse) { - var src0; - if(src0 = document.getElementById(id)) - { - var clickfound = false; - 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) - (e.clickCallback)(null, "BALLOON", balloonObj); - } - } - } - // alert("uballon " + id); - timer_ballon = null; + var src0; + if(src0 = document.getElementById(id)) + { + var clickfound = false; + 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) + (e.clickCallback)(null, "BALLOON", balloonObj); + } + } + } + // alert("uballon " + id); + timer_ballon = null; } function ww_evt_balloon(msg) { // for(var i=0; i<24; i++) // msg += "
\n"+i; - 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"; - div.style.width = div.style.height = "auto"; - div.style.backgroundColor = "#80ff80"; - div.style.zIndex = 998; - div.innerHTML = "HELLO"; - this.elemMeasureBalloon = this.body.appendChild(div); - } - } - - var k=7; - if(!this.elemBalloon) - { - var div = this.document.createElement("div"); - div.style.overflow = "visible"; - div.style.position = "absolute"; - div.style.width = "auto"; - div.style.height = "auto"; - 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; - if(measurediv) - { - this.elemMeasureBalloon.innerHTML = msg; // + ""; - var msg_h = this.elemMeasureBalloon.clientHeight; - var msg_w = this.elemMeasureBalloon.clientWidth; - // alert(msg_w + " " + msg_h ); - - } - + + } + // 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) - { - msg_tbox.innerHTML = msg; - msg_tbox.style.width = (msg_w+0)+"px"; - msg_tbox.style.height = (msg_h+0)+"px"; - } - else - { - // this.elemBalloon.style.visibility = "visible"; - this.elemBalloon.style.top = "0px"; - this.elemBalloon.style.left = "0px"; - msg_tbox.style.width = "auto"; - msg_tbox.style.height = "auto"; - 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"; - } + 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"; + } + else + { + // this.elemBalloon.style.visibility = "visible"; + this.elemBalloon.style.top = "0px"; + this.elemBalloon.style.left = "0px"; + msg_tbox.style.width = "auto"; + msg_tbox.style.height = "auto"; + 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"; + } - 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) - { - // tiens pas en dessous - msg_t = ymouse - msg_h - 3; // au dessus - if(msg_t < 3) - { - // tiens pas au dessus - msg_t = body_h - msg_h - 10; // colle en bas - if(msg_t < 3) - { - // tiens pas colle en bas - msg_t = 3; // colle en haut, tant pis si ea deborde en bas - } - } - } - var msg_l; - msg_l = xmouse + 3; - - this.elemBalloon.style.top = msg_t+"px"; - this.elemBalloon.style.left = msg_l+"px"; + var body_h = document.documentElement.clientHeight; - this.elemBalloon.style.visibility = "visible"; + var msg_t; + + msg_t = ymouse + 5; // en dessous + if(msg_t + msg_h > body_h) + { + // tiens pas en dessous + msg_t = ymouse - msg_h - 3; // au dessus + if(msg_t < 3) + { + // tiens pas au dessus + msg_t = body_h - msg_h - 10; // colle en bas + if(msg_t < 3) + { + // tiens pas colle en bas + msg_t = 3; // colle en haut, tant pis si ea deborde en bas + } + } + } + var msg_l; + msg_l = xmouse + 3; + + this.elemBalloon.style.top = msg_t+"px"; + this.elemBalloon.style.left = msg_l+"px"; + + this.elemBalloon.style.visibility = "visible"; } function evt_false() { - return false; + return false; } function evt_true() { - return true; + return true; } function ww_mdwn_win(idx) { - wf = this.frontWindow(); - if(wf.modal && this.twin[idx] != wf) - { - wf.blink(); - return(false); - } + wf = this.frontWindow(); + if(wf.modal && this.twin[idx] != wf) + { + wf.blink(); + return(false); + } - if(o = document.getElementById(this.varname+"w"+idx)) - { - e = window.event; - z = o.style.zIndex; - if(z != 99) - { - o.style.zIndex = this.twin[idx].properties["z-index"] = this.maxdepth; - for(i=0; i z && z2 != 99) - { - z2--; - o2.style.zIndex = this.twin[i].properties["z-index"] = z2; - } - } - } - } + if(o = document.getElementById(this.varname+"w"+idx)) + { + e = window.event; + z = o.style.zIndex; + if(z != 99) + { + o.style.zIndex = this.twin[idx].properties["z-index"] = this.maxdepth; + for(i=0; i z && z2 != 99) + { + z2--; + o2.style.zIndex = this.twin[i].properties["z-index"] = z2; + } + } + } + } - this.w_active=idx; + this.w_active=idx; - this.new_t = this.t0 = o.offsetTop; - this.new_l = this.l0 = o.offsetLeft; - this.new_w = this.w0 = o.clientWidth; - this.new_h = this.h0 = o.clientHeight; + this.new_t = this.t0 = o.offsetTop; + this.new_l = this.l0 = o.offsetLeft; + this.new_w = this.w0 = o.clientWidth; + this.new_h = this.h0 = o.clientHeight; - // alert("ww_mdwn_win : w0="+this.w0 + " h0="+this.h0); - this.x0 = e.clientX; - this.y0 = e.clientY; - return true; - } - return false; + // alert("ww_mdwn_win : w0="+this.w0 + " h0="+this.h0); + this.x0 = e.clientX; + this.y0 = e.clientY; + return true; + } + return false; } function ww_evt_mdwn_window(idx) { - this.mdwn_win(idx); + this.mdwn_win(idx); } function ww_evt_mdwn_title(idx) { - if(!this.twin[idx] || this.twin[idx].moveable<=0) - return; - if(this.mdwn_win(idx)) - { - // this.twin[idx].hide(); - /* for(w in this.twin) - { - // this.twin[w].kontent = document.getElementById(this.varname+"w"+w).innerHTML; - n = document.getElementById(this.varname+"w"+w); - n.removeChild(this.twin[w].kontent = n.firstChild); - // document.getElementById(this.varname+"w"+w).innerHTML = "beuark"; - } - */ - this.dragging = true; - /* - */ - window.event.cancelBubble = true; - if(window.event.stopPropagation) - window.event.stopPropagation(); - } + if(!this.twin[idx] || this.twin[idx].moveable<=0) + return; + if(this.mdwn_win(idx)) + { + // this.twin[idx].hide(); + /* for(w in this.twin) + { + // this.twin[w].kontent = document.getElementById(this.varname+"w"+w).innerHTML; + n = document.getElementById(this.varname+"w"+w); + n.removeChild(this.twin[w].kontent = n.firstChild); + // document.getElementById(this.varname+"w"+w).innerHTML = "beuark"; + } + */ + this.dragging = true; + /* + */ + window.event.cancelBubble = true; + if(window.event.stopPropagation) + window.event.stopPropagation(); + } } function ww_evt_mdwn_sizer(idx) { - if(!this.twin[idx] || this.twin[idx].sizeable<=0) - return; - if(this.mdwn_win(idx)) - this.sizing = true; - window.event.cancelBubble = true; - if(window.event.stopPropagation) - window.event.stopPropagation(); + if(!this.twin[idx] || this.twin[idx].sizeable<=0) + return; + if(this.mdwn_win(idx)) + this.sizing = true; + window.event.cancelBubble = true; + if(window.event.stopPropagation) + window.event.stopPropagation(); } function ww_evt_mdwn_reducer(idx) { // alert("recucer"); - 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"}); - //o.style.height = (this.twin[idx].oldheight + "px"); - this.twin[idx].reduced = false; - } - else - { - // reduce - // o.style.clip = "rect(0px auto 17px auto)"; - this.twin[idx].oldheight = parseInt(o.style.height); + 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"}); + //o.style.height = (this.twin[idx].oldheight + "px"); + this.twin[idx].reduced = false; + } + 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].reduced = true; - } - } - window.event.cancelBubble = true; - if(window.event.stopPropagation) - window.event.stopPropagation(); - //if(!this.twin[idx] || this.twin[idx].sizeable<=0) - // return; - //if(this.mdwn_win(idx)) - // this.sizing = true; + this.twin[idx].setProperties({height:tith}); + this.twin[idx].reduced = true; + } + } + window.event.cancelBubble = true; + if(window.event.stopPropagation) + window.event.stopPropagation(); + //if(!this.twin[idx] || this.twin[idx].sizeable<=0) + // return; + //if(this.mdwn_win(idx)) + // this.sizing = true; } 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) - { - this.twin[idx].hide(); + 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) + { + this.twin[idx].hide(); // o.style.visibility = "hidden"; - } - window.event.cancelBubble = true; - if(window.event.stopPropagation) - window.event.stopPropagation(); - } + } + window.event.cancelBubble = true; + if(window.event.stopPropagation) + window.event.stopPropagation(); + } } /* -function ww_evt_mdwn_doc(gui) -{ -// gui = eval(gui); -// if(window.event.srcElement.id == gui.desktop) -// { - // on a clique sur le bureau - if(window.event.srcElement.onMenu && (window.event.altKey || window.event.button==2)) - { - eval(window.event.srcElement.onMenu); - window.event.returnValue = false; - return(false); - } -// } -} -*/ + function ww_evt_mdwn_doc(gui) + { + // gui = eval(gui); + // if(window.event.srcElement.id == gui.desktop) + // { + // on a clique sur le bureau + if(window.event.srcElement.onMenu && (window.event.altKey || window.event.button==2)) + { + eval(window.event.srcElement.onMenu); + window.event.returnValue = false; + return(false); + } + // } + } + */ /* -function ww_evt_mmov_doc(gui) -{ - gui = eval(gui); - e = window.event; - // msg("" + (e.clientX) + " - " + (e.clientY) ); - if(gui.w_active != -1 && (gui.sizing || gui.dragging)) - { - t = ""; - if(gui.dragging) - { - gui.new_t = gui.t0 + (e.clientY - gui.y0); - gui.new_l = gui.l0 + (e.clientX - gui.x0); - t = "top:" + (gui.new_t) + "px; left:" + (gui.new_l) + "px; width:" + (gui.w0-4) + "px; height:" + (gui.h0-4) + "px; visibility:visible;" ; - // t = "top:" + (gui.new_t) + "px; left:" + (gui.new_l) + "px; visibility:visible;" ; - } - if(gui.sizing) - { - gui.new_h = gui.h0 + (e.clientY - gui.y0); - gui.new_w = gui.w0 + (e.clientX - gui.x0); - if(gui.new_w < gui.twin[gui.w_active].minwidth) - gui.new_w = gui.twin[gui.w_active].minwidth; - else - if(gui.new_w > gui.twin[gui.w_active].maxwidth) - gui.new_w = gui.twin[gui.w_active].maxwidth; + function ww_evt_mmov_doc(gui) + { + gui = eval(gui); + e = window.event; + // msg("" + (e.clientX) + " - " + (e.clientY) ); + if(gui.w_active != -1 && (gui.sizing || gui.dragging)) + { + t = ""; + if(gui.dragging) + { + gui.new_t = gui.t0 + (e.clientY - gui.y0); + gui.new_l = gui.l0 + (e.clientX - gui.x0); + t = "top:" + (gui.new_t) + "px; left:" + (gui.new_l) + "px; width:" + (gui.w0-4) + "px; height:" + (gui.h0-4) + "px; visibility:visible;" ; + // t = "top:" + (gui.new_t) + "px; left:" + (gui.new_l) + "px; visibility:visible;" ; + } + if(gui.sizing) + { + gui.new_h = gui.h0 + (e.clientY - gui.y0); + gui.new_w = gui.w0 + (e.clientX - gui.x0); + if(gui.new_w < gui.twin[gui.w_active].minwidth) + gui.new_w = gui.twin[gui.w_active].minwidth; + else + if(gui.new_w > gui.twin[gui.w_active].maxwidth) + gui.new_w = gui.twin[gui.w_active].maxwidth; - if(gui.new_h < gui.twin[gui.w_active].minheight) - gui.new_h = gui.twin[gui.w_active].minheight; - else - if(gui.new_h > gui.twin[gui.w_active].maxheight) - gui.new_h = gui.twin[gui.w_active].maxheight; + if(gui.new_h < gui.twin[gui.w_active].minheight) + gui.new_h = gui.twin[gui.w_active].minheight; + else + if(gui.new_h > gui.twin[gui.w_active].maxheight) + gui.new_h = gui.twin[gui.w_active].maxheight; - t = "top:" + (gui.t0) + "px; left:" + (gui.l0) + "px; width:" + (gui.new_w-4) + "px; height:" + (gui.new_h-4) + "px; visibility:visible" ; - } - // gui.twin[gui.w_active].hide(); - // document.getElementById(gui.varname+"w"+gui.w_active).style.display = "none"; - document.getElementById(gui.varname+"wb").style.cssText = t; - } - return false; -} -*/ + t = "top:" + (gui.t0) + "px; left:" + (gui.l0) + "px; width:" + (gui.new_w-4) + "px; height:" + (gui.new_h-4) + "px; visibility:visible" ; + } + // gui.twin[gui.w_active].hide(); + // document.getElementById(gui.varname+"w"+gui.w_active).style.display = "none"; + document.getElementById(gui.varname+"wb").style.cssText = t; + } + return false; + } + */ function ww_setProperties(properties) { - style = ""; - for(p in this.properties) - { - if(properties[p]) - this.properties[p] = properties[p]; - style += p + ":" + this.properties[p] + ";" ; - } + style = ""; + for(p in this.properties) + { + if(properties[p]) + this.properties[p] = 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 = 0; - if(this.twoviews && (o = document.getElementById(this.varname+"e"+this.idx).style)) - { - /* - if(this.hasscroll) - o.overflow = "scroll"; - else - o.overflow = "hiddden"; - */ - tv = true; - 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(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" ; - else - o.width = (Math.round(win_w*1)-2) + "px" ; - // style += "width:" + document.getElementById(this.varname+"c"+this.idx).style.width+";"; + 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 = 0; + if(this.twoviews && (o = document.getElementById(this.varname+"e"+this.idx).style)) + { + /* + if(this.hasscroll) + o.overflow = "scroll"; + else + o.overflow = "hiddden"; + */ + tv = true; + 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(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" ; + else + 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; - } + // 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;" ; - o.style.cssText = t; - } + 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; + } } /* -function ww_evt_mup_doc(gui) -{ - gui = eval(gui); - if((gui.w_active != -1) && (gui.dragging || gui.sizing)) - { - document.getElementById(gui.varname+"wb").style.visibility = "hidden"; + function ww_evt_mup_doc(gui) + { + gui = eval(gui); + if((gui.w_active != -1) && (gui.dragging || gui.sizing)) + { + document.getElementById(gui.varname+"wb").style.visibility = "hidden"; - gui.twin[gui.w_active].setProperties( { top:(gui.new_t)+"px", left:(gui.new_l)+"px", width:(gui.new_w)+"px", height:(gui.new_h)+"px" } ); - if(gui.sizing && gui.twin[gui.w_active].onresized) - (gui.twin[gui.w_active].onresized)(gui.new_t, gui.new_l, gui.new_w, gui.new_h); + gui.twin[gui.w_active].setProperties( { top:(gui.new_t)+"px", left:(gui.new_l)+"px", width:(gui.new_w)+"px", height:(gui.new_h)+"px" } ); + if(gui.sizing && gui.twin[gui.w_active].onresized) + (gui.twin[gui.w_active].onresized)(gui.new_t, gui.new_l, gui.new_w, gui.new_h); - gui.dragging = gui.sizing = false; - } - return true; -} -*/ + gui.dragging = gui.sizing = false; + } + return true; + } + */ 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" } ); + 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" } ); } function ww_sizeto(w, h) { - if(w == -1) - w = parseInt(this.gui.twin[this.idx].properties.width); - if(h == -1) - h = parseInt(this.gui.twin[this.idx].properties.height); - 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" } ); - else - if(w != -1) - this.gui.twin[this.idx].setProperties( { width:(w)+"px" } ); - else - if(h != -1) - this.gui.twin[this.idx].setProperties( { height:(h)+"px" } ); -*/ - 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); + if(w == -1) + w = parseInt(this.gui.twin[this.idx].properties.width); + if(h == -1) + h = parseInt(this.gui.twin[this.idx].properties.height); + 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" } ); + else + if(w != -1) + this.gui.twin[this.idx].setProperties( { width:(w)+"px" } ); + else + if(h != -1) + this.gui.twin[this.idx].setProperties( { height:(h)+"px" } ); + */ + 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" } ); + 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; + document.getElementById(this.varname+"t"+this.idx).innerHTML = " "+t; } function ww_setContent(t, view) { - if(!view || !this.twoviews || view != "e") - view = "c"; - document.getElementById(this.varname+view+this.idx).innerHTML = t; + if(!view || !this.twoviews || view != "e") + view = "c"; + document.getElementById(this.varname+view+this.idx).innerHTML = t; } function ww_show() { - this.properties.visibility = "visible"; - document.getElementById(this.varname+"w"+this.idx).style.visibility = "visible"; + this.properties.visibility = "visible"; + document.getElementById(this.varname+"w"+this.idx).style.visibility = "visible"; } function ww_toFront() { - wf = this.gui.frontWindow(); - if(wf.modal && this != wf) - { - wf.blink(); - return(false); - } - var o; - if(o = document.getElementById(this.varname+"w"+this.idx)) - { - e = window.event; - z = o.style.zIndex; - if(z != 99) - { - o.style.zIndex = this.gui.twin[this.idx].properties["z-index"] = this.gui.maxdepth; - for(i=0; i z && z2 != 99) - { - z2--; - o2.style.zIndex = this.gui.twin[i].properties["z-index"] = z2; - } - } - } - // this.gui.frontWindow = this.idx; - } + wf = this.gui.frontWindow(); + if(wf.modal && this != wf) + { + wf.blink(); + return(false); + } + var o; + if(o = document.getElementById(this.varname+"w"+this.idx)) + { + e = window.event; + z = o.style.zIndex; + if(z != 99) + { + o.style.zIndex = this.gui.twin[this.idx].properties["z-index"] = this.gui.maxdepth; + for(i=0; i z && z2 != 99) + { + z2--; + o2.style.zIndex = this.gui.twin[i].properties["z-index"] = z2; + } + } + } + // 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; - this.gui.new_w = this.gui.w0 = o.clientWidth; - this.gui.new_h = this.gui.h0 = o.clientHeight; - return true; - } - return false; + this.gui.new_t = this.gui.t0 = o.offsetTop; + this.gui.new_l = this.gui.l0 = o.offsetLeft; + this.gui.new_w = this.gui.w0 = o.clientWidth; + this.gui.new_h = this.gui.h0 = o.clientHeight; + return true; + } + return false; } function ww_hide() { - this.properties.visibility = "hidden"; - document.getElementById(this.varname+"w"+this.idx).style.visibility = "hidden"; + this.properties.visibility = "hidden"; + document.getElementById(this.varname+"w"+this.idx).style.visibility = "hidden"; } 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); - } + if(o = document.getElementById(this.varname+"t"+this.idx)) + { + o.className = "ww_title_blink"; + window.setTimeout("ww_noblink('"+this.varname+"t"+this.idx+"');", 500); + } } function ww_noblink(titleid) { - if(o = document.getElementById(titleid)) - o.className = "ww_title"; + if(o = document.getElementById(titleid)) + o.className = "ww_title"; } function ww_getClientSize(view) { - if(!view || !this.twoviews || view != "e") - view = "c"; - 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(null); + if(!view || !this.twoviews || view != "e") + view = "c"; + 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(null); } function ww_autoMove() { - // alert("ww_autoMove"); - var moved = false; - var sized = false; - 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; - moved = true; - } - if(lwin < 0) - { - lwin = 0; - wwin = wgui; - moved = true; - sized = true; - } - if(twin > hgui-hwin) - { - twin = hgui-hwin; - moved = true; - } - if(twin < 0) - { - twin = 0; - hwin = hgui; - moved = true; - sized = true; - } - // o.top = twin+"px"; - // o.left = lwin+"px"; - if(moved) - this.moveto(twin, lwin); - if(sized) - this.sizeto(wwin, hwin); + // alert("ww_autoMove"); + var moved = false; + var sized = false; + 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; + moved = true; + } + if(lwin < 0) + { + lwin = 0; + wwin = wgui; + moved = true; + sized = true; + } + if(twin > hgui-hwin) + { + twin = hgui-hwin; + moved = true; + } + if(twin < 0) + { + twin = 0; + hwin = hgui; + moved = true; + sized = true; + } + // o.top = twin+"px"; + // o.left = lwin+"px"; + if(moved) + this.moveto(twin, lwin); + if(sized) + this.sizeto(wwin, hwin); // this.setProperties( {top:twin+"px", left:lwin+"px" } ); - } -/* -*/ + } + /* + */ } 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" }; + 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.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.sizeto = ww_sizeto; - this.moveto = ww_moveto; - this.repaint = ww_repaint; - this.setTitle = ww_setTitle; - this.setContent = ww_setContent; - this.setProperties = ww_setProperties; - this.show = ww_show; - this.hide = ww_hide; - this.toFront = ww_toFront; - this.autoMove = ww_autoMove; - this.blink = ww_blink; - this.getClientSize = ww_getClientSize; + // this.evt_mdwn_closer = ww_evt_mdwn_closer; + this.sizeto = ww_sizeto; + this.moveto = ww_moveto; + this.repaint = ww_repaint; + this.setTitle = ww_setTitle; + this.setContent = ww_setContent; + this.setProperties = ww_setProperties; + this.show = ww_show; + this.hide = ww_hide; + this.toFront = ww_toFront; + this.autoMove = ww_autoMove; + 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.onresized = properties.onresized; - this.oncreated = properties.oncreated; - this.onclose = properties.onclose; - this.reduced = false; - this.oldheight = -1; + 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) - { - // gui.frontWindow = this; - this.properties["z-index"] = ++gui.maxdepth; - } - else - this.properties["z-index"] = 99; + if(!this.ontop) + { + // gui.frontWindow = this; + this.properties["z-index"] = ++gui.maxdepth; + } + else + this.properties["z-index"] = 99; - s = ""; - style = ""; - 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] + ";" ; - } - s += "
\n"; + s = ""; + style = ""; + 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] + ";" ; + } + s += "
\n"; // s += "
"; // s += "
"; // s += "
"; - s += "
"; - s += "
\n"; + s += "
"; + s += "
\n"; - s += ""; - s += " "; - s += " "; - if(properties.title) - { + s += "
\"\"
"; + s += " "; + s += " "; + if(properties.title) + { // s += " "; - s += " "; - } - else - s += " "; + s += " "; + } + else + s += " "; - if(properties.title2) - { - s += "\n"; - s += "\n"; - } + if(properties.title2) + { + s += "\n"; + s += "\n"; + } - s += " "; - s += "
\"\"
" + properties.title + "
" + properties.title + " " + properties.title + " "+properties.title2+" "+properties.title2+" 
"; - //if(properties.title) - // s += "
 " + properties.title + "
\n"; - s += " "; + s += "
"; + //if(properties.title) + // s += "
 " + properties.title + "
\n"; + s += " "; - s += "
\n"; + s += "
\n"; - s += ""; - if(this.closeable) - s += "\n"; - //else - // s += " "; - s += "
\n"; + s += ""; + if(this.closeable) + s += "\n"; + //else + // s += " "; + s += "
\n"; - s += "
\n"; + s += " \n"; - //s += "
"; - style = ""; - if(this.hasscroll) - style += "overflow:scroll;"; - else - style += "overflow:hidden;"; + //s += "
"; + style = ""; + 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"; - } - else - { - s += "
"+oldContent+"
\n"; - } - if(this.sizeable) - { - s += "
\n"; - } + if(this.twoviews) + { + s += "
\n"; + s += "
" + oldContent + "
\n"; + } + else + { + s += "
"+oldContent+"
\n"; + } + if(this.sizeable) + { + s += "
\n"; + } // alert("ww_Window : style=" + style); - //s += "
\n"; - s += "
\n"; - s += "\n"; + //s += "\n"; + s += "\n"; + s += "\n"; // alert(s); // document.write(s); - document.getElementById(anchor).innerHTML = s; - this.setProperties( this.properties ); - if(this.oncreated) - (this.oncreated)(); - return this; + document.getElementById(anchor).innerHTML = s; + this.setProperties( this.properties ); + if(this.oncreated) + (this.oncreated)(); + return this; } 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++]); + 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=""; + var t=""; // t += "<"++"?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\r\n"; - for(w in this.twin) - { - t += " z && z2 != 99) - { - z = z2; - idx = i; - } - } - } - return(idx >= 0 ? this.twin[idx] : null); + idx = -1; + z = -1; + for(i=0; i z && z2 != 99) + { + z = z2; + idx = i; + } + } + } + return(idx >= 0 ? this.twin[idx] : null); } function ww_openCenterWindow(zurl, w, h, name, params) { - p = new Array(); - p.directories = "no"; - p.location = "no"; - p.menubar = "no"; - p.toolbar = "no"; - p.help = "no"; - p.status = "no"; - p.resizable = "no"; - 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 = 10; - if(l<10) - l = 10; - s = "top="+t+", left="+l+", width="+w+", height="+h; - for(cc in p) - s += "," + cc + "=" + p[cc]; - return(window.open(zurl, name, s, true)); + p = new Array(); + p.directories = "no"; + p.location = "no"; + p.menubar = "no"; + p.toolbar = "no"; + p.help = "no"; + p.status = "no"; + p.resizable = "no"; + 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 = 10; + if(l<10) + l = 10; + 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) { - this.unselect(); - if(obj) - { - obj.className = obj.className.replace("s_", "S_"); - this.selectedObject = obj; - } + this.unselect(); + if(obj) + { + obj.className = obj.className.replace("s_", "S_"); + this.selectedObject = obj; + } } function ww_unselect() { - if(this.selectedObject) - { - var cn = this.selectedObject.className; - cn = cn.replace("S_", "s_"); - this.selectedObject.className = cn; - this.selectedObject = null; - } + if(this.selectedObject) + { + var cn = this.selectedObject.className; + cn = cn.replace("S_", "s_"); + this.selectedObject.className = cn; + this.selectedObject = null; + } } function ww_runAsMenu(event, backparm) { - // alert(event); - this.backparm = backparm; - 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 ??? - else - button = event.button; - xmouse = parseInt(event.clientX); - ymouse = parseInt(event.clientY); + // alert(event); + this.backparm = backparm; + if(this.gui.activeMenu != null) + { + this.gui.activeMenu.style.visibility = "hidden"; + this.gui.activeMenu = null; + } - (this.menuCallback)("INIT", this.backparm, null); - - // this.style.top = (ymouse-3)+"px"; - // this.style.left = (xmouse-3)+"px"; - - var bodyH = document.documentElement.clientHeight; + if(typeof(event.which) != 'undefined') + button = this.gui.firefoxButtons["b"+event.which]; // safari aussi ??? + else + button = event.button; + xmouse = parseInt(event.clientX); + ymouse = parseInt(event.clientY); - if(ymouse+this.clientHeight < bodyH) - { - // menu en dessous - this.style.top = (ymouse-3)+"px"; - this.style.left = (xmouse-3)+"px"; - } - else - { - // menu au dessus - this.style.top = (ymouse+0-this.clientHeight)+"px"; - this.style.left = (xmouse-3)+"px"; - } - - this.style.visibility = "visible"; - this.gui.activeMenu = this; + (this.menuCallback)("INIT", this.backparm, null); + + // this.style.top = (ymouse-3)+"px"; + // this.style.left = (xmouse-3)+"px"; + + var bodyH = document.documentElement.clientHeight; + + if(ymouse+this.clientHeight < bodyH) + { + // menu en dessous + this.style.top = (ymouse-3)+"px"; + this.style.left = (xmouse-3)+"px"; + } + else + { + // menu au dessus + 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) { - var m = document.getElementById(mid); - if(m.gui.activeMenu) - { - m.style.visibility = "hidden"; - m.gui.activeMenu = null; - (m.menuCallback)("DIE", m.backparm, null); - } + var m = document.getElementById(mid); + 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); + this.dieMenuTimer = self.setTimeout("ww_dieMenu('"+this.id+"');", 500); } 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) - { - clearTimeout(this.dieMenuTimer); - this.dieMenuTimer = null; - } + if(this.dieMenuTimer) + { + clearTimeout(this.dieMenuTimer); + this.dieMenuTimer = null; + } } function ww_evt_click_menu(e) { - if(this.dieMenuTimer) - { - clearTimeout(this.dieMenuTimer); - this.dieMenuTimer = null; - } - if(!e) - e = window.event; - var tg = (e.target) ? e.target : e.srcElement; - while(tg && (tg.nodeType!=1 || !tg.id)) - tg = tg.parentNode; - if(tg.className=="disabled") - return; - this.style.visibility = "hidden"; - this.gui.activeMenu = null; - (this.menuCallback)("SELECT", this.backparm, tg.id); + if(this.dieMenuTimer) + { + clearTimeout(this.dieMenuTimer); + this.dieMenuTimer = null; + } + if(!e) + e = window.event; + var tg = (e.target) ? e.target : e.srcElement; + while(tg && (tg.nodeType!=1 || !tg.id)) + tg = tg.parentNode; + 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; - o.menuCallback = callback; - o.onmouseout = ww_evt_mouseout_menu; - o.onmousemove = ww_evt_mousemove_menu; - o.onclick = ww_evt_click_menu; + 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; + o.onclick = ww_evt_click_menu; } 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.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.nwin = 0; - this.twin = new Array(); // le tableau des win - this.maxdepth = 0; // le zindex de la win au premier plan (hors win 'ontop') - // this.frontWindow = null; // la win au premier plan (hors win 'ontop') - this.body = document.getElementById(idbody); - - this.elemBalloon = null; + 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.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.nwin = 0; + this.twin = new Array(); // le tableau des win + this.maxdepth = 0; // le zindex de la win au premier plan (hors win 'ontop') + // this.frontWindow = null; // la win au premier plan (hors win 'ontop') + this.body = document.getElementById(idbody); - 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.mdwn_win = ww_mdwn_win; - this.getWinPosAsXML = ww_getWinPosAsXML; - this.openCenterWindow = ww_openCenterWindow; - - var desk = document.getElementById(idbody); - - var node; - - node = document.createElement("div"); - node.id = this.varname+"wb"; - node.className = "ww_winborder"; - this.windowBorder = desk.appendChild(node); + this.elemBalloon = null; + + 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.mdwn_win = ww_mdwn_win; + this.getWinPosAsXML = ww_getWinPosAsXML; + this.openCenterWindow = ww_openCenterWindow; + + var desk = document.getElementById(idbody); + + var node; + + node = document.createElement("div"); + node.id = this.varname+"wb"; + node.className = "ww_winborder"; + this.windowBorder = desk.appendChild(node); // this.windowBorder = document.getElementById("winborder"); - - node = document.createElement("img"); - node.id = "dragDropCursor"; - node.style.position = "absolute"; - node.style.top = "50px"; - node.style.left = "50px"; - node.style.zIndex = 99; - node.style.visibility = "hidden"; - node.src = "cursors/nodrop01.gif"; - dragObj.objCursor = desk.appendChild(node); - 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")) - { - evt.preventDefault(); - } - // ---- - ww_evt_mdwn_doc(varname, evt); - }; - desk.onmouseup = function (e) {ww_evt_mup_doc(varname, (e ? e : window.event));}; + node = document.createElement("img"); + node.id = "dragDropCursor"; + node.style.position = "absolute"; + node.style.top = "50px"; + node.style.left = "50px"; + node.style.zIndex = 99; + node.style.visibility = "hidden"; + node.src = "cursors/nodrop01.gif"; + dragObj.objCursor = desk.appendChild(node); - if(typeof(document.onselectstart) != "undefined") - { - // ie - document.onselectstart = evt_select_doc; - } - - // on interdit les menus contextuels de explorer + 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")) + { + evt.preventDefault(); + } + // ---- + ww_evt_mdwn_doc(varname, evt); + }; + desk.onmouseup = function (e) {ww_evt_mup_doc(varname, (e ? e : window.event));}; + + 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.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.selectedObject = null; - this.select = ww_select; - this.unselect = ww_unselect; - this.setDragObj = ww_setDragObj; -/* - s = "
"; - s += ""; - document.write(s); + 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; }; - // on enregistre des handlers sur le document pour le drag & drop - document.onselectstart = ww_selectStart; + 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; - var o = document.getElementById("desktop"); - o.onmouseover = evt_movr_doc; + this.selectedObject = null; + this.select = ww_select; + this.unselect = ww_unselect; - var old = (document.onmousemove) ? document.onmousemove : function () {}; - document.onmousemove = function(e){if(e){old(e, varname); return(evt_mmov_doc(e, varname));}else{old(window.event, varname); return(evt_mmov_doc(window.event, varname));}}; + this.setDragObj = ww_setDragObj; + /* + s = "
"; + s += ""; + document.write(s); - var old = (document.onmousedown) ? document.onmousedown : function () {}; - document.onmousedown = function(e){if(e){old(e, varname); return(evt_mdwn_doc(e, varname));}else{old(window.event, varname); return(evt_mdwn_doc(window.event, varname));}}; + // on enregistre des handlers sur le document pour le drag & drop + document.onselectstart = ww_selectStart; - var old = (document.ondblclick) ? document.ondblclick : function () {}; - document.ondblclick = function(e){if(e){old(e, varname); return(evt_dblclk_doc(e, varname));}else{old(window.event, varname); return(evt_dblclk_doc(window.event, varname));}}; + var o = document.getElementById("desktop"); + o.onmouseover = evt_movr_doc; - var old = (document.onmouseup) ? document.onmouseup : function () {}; - document.onmouseup = function(e){if(e){old(e, varname); return(evt_mup_doc(e, varname));}else{old(window.event, varname); return(evt_mup_doc(window.event, varname));} }; + var old = (document.onmousemove) ? document.onmousemove : function () {}; + document.onmousemove = function(e){if(e){old(e, varname); return(evt_mmov_doc(e, varname));}else{old(window.event, varname); return(evt_mmov_doc(window.event, varname));}}; - // on interdit les menus contextuels de explorer... ? - // 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 -// var old = (document.oncontextmenu) ? document.oncontextmenu : function () {}; + var old = (document.onmousedown) ? document.onmousedown : function () {}; + document.onmousedown = function(e){if(e){old(e, varname); return(evt_mdwn_doc(e, varname));}else{old(window.event, varname); 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));}}; + var old = (document.ondblclick) ? document.ondblclick : function () {}; + document.ondblclick = function(e){if(e){old(e, varname); return(evt_dblclk_doc(e, varname));}else{old(window.event, varname); return(evt_dblclk_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));} }; + var old = (document.onmouseup) ? document.onmouseup : function () {}; + document.onmouseup = function(e){if(e){old(e, varname); return(evt_mup_doc(e, varname));}else{old(window.event, varname); return(evt_mup_doc(window.event, varname));} }; -// document.onmousedown = w2md; -// document.onmouseup = w2mu; + // on interdit les menus contextuels de explorer... ? + // 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 + // var old = (document.oncontextmenu) ? document.oncontextmenu : function () {}; - document.oncontextmenu = function(e){if(!e) e=window.event; e.returnValue=false; - if(e.stopPropagation) e.stopPropagation(); - if(e.preventDefault) e.preventDefault(); - return true; - }; -*/ + // 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); return(evt_kon_doc(e, varname));}else{old(window.event, varname); return(evt_kon_doc(window.event, varname));} }; + + // document.onmousedown = w2md; + // document.onmouseup = w2mu; + + document.oncontextmenu = function(e){if(!e) e=window.event; e.returnValue=false; + if(e.stopPropagation) e.stopPropagation(); + if(e.preventDefault) e.preventDefault(); + return true; + }; + */ } 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"); + evt = evt ? evt : window.event; + var srcElement = evt.srcElement ? evt.srcElement : evt.target; + return(srcElement.tagName=="INPUT" || srcElement.tagName=="TEXTAREA"); } - + function w2md(e) { - if(!e) - e = window.event; + 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); + return(false); } function w2mu(e) { - if(!e) - e = window.event; + 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); + return(false); } function w2k(e) { - if(!e) - e = window.event; + 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(); - return(false); + return(false); } function ww_selectStart() { - return(window.event.srcElement.tagName=="INPUT" || window.event.srcElement.tagName=="TEXTAREA"); + 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; - s2 = escape(s); - ret = ""; - for(i=0; i