linterna-magica-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linterna-magica-commit] [297] Guess flash plugin name by the filename (


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [297] Guess flash plugin name by the filename (libxyz.so) property in the browser plugin object and show that name in debug logs and toggle plugin button tooltip .
Date: Mon, 23 Jul 2012 18:46:31 +0000

Revision: 297
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=297
Author:   valkov
Date:     2012-07-23 18:46:30 +0000 (Mon, 23 Jul 2012)
Log Message:
-----------
Guess flash plugin name by the filename (libxyz.so) property in the browser 
plugin object and show that name in debug logs and toggle plugin button tooltip.

Modified Paths:
--------------
    trunk/src/lm_detect_flash.js
    trunk/src/lm_interface_toggle_plugin.js

Modified: trunk/src/lm_detect_flash.js
===================================================================
--- trunk/src/lm_detect_flash.js        2012-07-15 17:18:24 UTC (rev 296)
+++ trunk/src/lm_detect_flash.js        2012-07-23 18:46:30 UTC (rev 297)
@@ -51,8 +51,15 @@
 
     if (is_installed)
     {
+       var flash_plugin = nav.plugins["Shockwave Flash"].filename;
+
+       var plugin_name = /gnash/i.test(flash_plugin) ? "Gnash" :
+           /lightpsark/i.test(flash_plugin) ? "Lightspark" :
+           /totem-vegas/i.test(flash_plugin) ? "Totem Vegas" :
+           "a flash plugin";
+
        this.log("LinternaMagica.check_flash_plugin:\n"+
-                "Flash plugin detected.",2);
+                "Flash plugin ("+plugin_name+") detected. ",2);
     }
 
     this.plugin_is_installed = is_installed;

Modified: trunk/src/lm_interface_toggle_plugin.js
===================================================================
--- trunk/src/lm_interface_toggle_plugin.js     2012-07-15 17:18:24 UTC (rev 
296)
+++ trunk/src/lm_interface_toggle_plugin.js     2012-07-23 18:46:30 UTC (rev 
297)
@@ -90,9 +90,38 @@
     }
     else
     {
+       var flash_mime_type = 
navigator.mimeTypes['application/x-shockwave-flash'];
+       var flash_plugin = flash_mime_type.enabledPlugin.filename;
+
+       // TRANSLATORS: The tooltip for the buttons that switch
+       // between LM and a flash plugin.
        var title = this.
            _("Switch between flash plugin and Linterna Mágica");
 
+
+       if (/gnash/i.test(flash_plugin))
+       {
+           // TRANSLATORS: The tooltip for the buttons that switch
+           // between LM and a flash plugin.
+           title = this.
+               _("Switch between the Gnash plugin for flash and Linterna 
Mágica");
+       }
+       else if (/lightpsark/i.test(flash_plugin))
+       {
+           // TRANSLATORS: The tooltip for the buttons that switch
+           // between LM and a flash plugin.
+           title = this.
+               _("Switch between the Lightspark plugin for flash and Linterna 
Mágica");
+       }
+       else if (/totem-vegas/i.test(flash_plugin))
+       {
+           // TRANSLATORS: The tooltip for the buttons that switch
+           // between LM and a flash plugin.
+           title = this.
+               _("Switch between the Totem Vegas plugin for flash and Linterna 
Mágica");
+       }
+
+
        toggle_plugin.setAttribute("title",title);
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]