From: Michael Dale Date: Thu, 30 Jul 2009 17:20:34 +0000 (+0000) Subject: * mvFirefogg refactoring for better reuse X-Git-Tag: 1.31.0-rc.0~40636 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27votes%27%2C%20votes=%27waiting%27%29%20%7D%7D?a=commitdiff_plain;h=d6d9f3c4e2e388ac5642272c1e9645f8bf6cff09;p=lhc%2Fweb%2Fwiklou.git * mvFirefogg refactoring for better reuse --- diff --git a/js2/mwEmbed/libAddMedia/mvFirefogg.js b/js2/mwEmbed/libAddMedia/mvFirefogg.js index eefa41ef5d..5da609420c 100644 --- a/js2/mwEmbed/libAddMedia/mvFirefogg.js +++ b/js2/mwEmbed/libAddMedia/mvFirefogg.js @@ -211,26 +211,32 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface $j( _this.target_use_latest_fox ).show(); } return ; - } - //they have the right version of mozilla provide install link: - var os_link = false; - if(navigator.oscpu){ - if(navigator.oscpu.search('Linux') >= 0) - os_link = firefogg_install_links['linux']; - else if(navigator.oscpu.search('Mac') >= 0) - os_link = firefogg_install_links['macosx']; - else if(navigator.oscpu.search('Win') >= 0) - os_link = firefogg_install_links['win32']; - } + } + //if rewriting form use upload msg text var upMsg = (_this.form_rewrite) ? gM('fogg-for_improved_uplods') : ''; - $j(_this.target_please_install).html( upMsg + gM('fogg-please_install',os_link )).css('padding', '10px').show(); + $j( _this.target_please_install ).html( upMsg + gM('fogg-please_install', _this.getOSlink() )).css('padding', '10px').show(); } //setup the target save local file bindins: $j( _this.target_btn_save_local_file ).unbind().click(function(){ _this.saveLocalFogg(); }); }, + /* + * returns the firefogg link for your os: + */ + getOSlink:function(){ + var os_link = false; + if(navigator.oscpu){ + if(navigator.oscpu.search('Linux') >= 0) + os_link = firefogg_install_links['linux']; + else if(navigator.oscpu.search('Mac') >= 0) + os_link = firefogg_install_links['macosx']; + else if(navigator.oscpu.search('Win') >= 0) + os_link = firefogg_install_links['win32']; + } + return os_link + }, firefoggCheck:function(){ if(typeof(Firefogg) != 'undefined' && Firefogg().version >= this.min_firefogg_version){ this.fogg = new Firefogg();