From 07c1e865e72bbae58594229507b2a3d831defba1 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 17 Feb 2009 11:24:41 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSformElement=5Furl=20:=20D=C3=A9sactivatio?= =?UTF-8?q?n=20du=20bouton=20JS=20addFavorite=20quand=20le=20=09navigateur?= =?UTF-8?q?=20n'est=20pas=20support=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/js/LSformElement_url.js | 28 ++++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/trunk/includes/js/LSformElement_url.js b/trunk/includes/js/LSformElement_url.js index 3d1bcddd..210ff869 100644 --- a/trunk/includes/js/LSformElement_url.js +++ b/trunk/includes/js/LSformElement_url.js @@ -28,14 +28,16 @@ var LSformElement_url = new Class({ btn_go.addEvent('click',this.onGoBtnClick.bind(this,btn_go)); varLSdefault.addHelpInfo(btn_go,'LSformElement_url','go'); - var btn_fav = new Element('img'); - btn_fav.setProperties({ - src: varLSdefault.imagePath('url_add.png') - }); - btn_fav.addClass('btn'); - btn_fav.injectAfter(btn_go); - btn_fav.addEvent('click',this.onAddFavoriteBtnClick.bind(this,btn_fav)); - varLSdefault.addHelpInfo(btn_fav,'LSformElement_url','fav'); + if (this.isAddFavoriteSupportedBrowser()) { + var btn_fav = new Element('img'); + btn_fav.setProperties({ + src: varLSdefault.imagePath('url_add.png') + }); + btn_fav.addClass('btn'); + btn_fav.injectAfter(btn_go); + btn_fav.addEvent('click',this.onAddFavoriteBtnClick.bind(this,btn_fav)); + varLSdefault.addHelpInfo(btn_fav,'LSformElement_url','fav'); + } }, reinitialize: function(el) { @@ -66,10 +68,14 @@ var LSformElement_url = new Class({ else if(window.external) { window.external.AddFavorite(href,name); } - else { - alert('Fonctionnalité pas encore supportée pour votre navigateur.'); - } } + }, + + isAddFavoriteSupportedBrowser: function() { + if (window.sidebar || window.external) { + return 1; + } + return; } }); window.addEvent(window.ie ? 'load' : 'domready', function() {