[Pkg-mozext-commits] [automatic-save-folder] 25/133: Change : - Remove the right-click feature for Firefox 2, because the installed add-ons can't be detected. ASF need to detect Download Sort Extension to prevent conflict. - Added an alert on the option tab for Firefox 2 users, - Better description to right-click option.

David Prévot taffit at moszumanska.debian.org
Mon Apr 27 20:33:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch wip
in repository automatic-save-folder.

commit aea9b61a8bb985843addfbe7af7e36fa90d9c566
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date:   Mon Nov 2 21:27:40 2009 +0000

    Change :
    - Remove the right-click feature for Firefox 2, because the installed add-ons can't be detected.
      ASF need to detect Download Sort Extension to prevent conflict.
    - Added an alert on the option tab for Firefox 2 users,
    - Better description to right-click option.
    
    git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@25 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
 content/asf.js             | 43 +++++++++++++++------------
 content/asf_right_click.js | 74 ++++++++++++++++++++++++----------------------
 content/options.xul        |  1 +
 locale/en-US/asf.dtd       |  5 ++--
 locale/fr-FR/asf.dtd       |  5 ++--
 locale/it-IT/asf.dtd       |  5 ++--
 6 files changed, 73 insertions(+), 60 deletions(-)

diff --git a/content/asf.js b/content/asf.js
index 3dea3d1..b56ba3c 100644
--- a/content/asf.js
+++ b/content/asf.js
@@ -221,25 +221,27 @@ var automatic_save_folder = {
 				select_list.disabled = false;
 			}
 			
-		// Print informations about Download sort conflict with right-click
-		// And disable the checkbox
-		document.getElementById("asf-rightclickdesc-DSort").hidden = true;
-		var Dsort_installed = this.DownloadSort();	
+		// Check the right-click feature here, and prints text according to Firefox version and active addons
+		// hide all the descriptions box, and unhide the needed one 
+		document.getElementById("asf-rightclickdesc-ff2").hidden = true;     // Firefox 2, Right-click disabled message
+		document.getElementById("asf-rightclickdesc-DSort").hidden = true;   // Download sort conflit alert
+		var Dsort_installed = this.DownloadSort();
 		
-		if (Dsort_installed) // if Download sort is installed, display a message "right click disabled"
+		if (this.firefoxversion == 2)
 		{
-			var asf_rightclick = document.getElementById("asf-rightclick");
-			asf_rightclick.disabled = true;
-			
-			document.getElementById("asf-rightclickdesc").hidden = true;
-			document.getElementById("asf-rightclickdesc-DSort").hidden = false;
+			document.getElementById("asf-rightclick").hidden = true;          // Hide the right-click checkbox
+			document.getElementById("asf-rightclickdesc").hidden = true;      // Hide the right-click description
+			document.getElementById("asf-rightclickdesc-ff2").hidden = false; // Show right-click not working on Firefox 2.0
 		}
-		else
+		if (this.firefoxversion == 3)
 		{
-			if (this.firefoxversion == 2)  // Right-click is always working without header renaming on Firefox 2 (no option for Timeout), let's hide this menu
+			if (Dsort_installed) // if Download sort is installed, display a message "right click disabled"
 			{
-				document.getElementById("asf-rightclick").hidden = true;
+				var asf_rightclick = document.getElementById("asf-rightclick");
+				asf_rightclick.disabled = true;
+				
 				document.getElementById("asf-rightclickdesc").hidden = true;
+				document.getElementById("asf-rightclickdesc-DSort").hidden = false;
 			}
 		}
 		
@@ -555,12 +557,15 @@ var automatic_save_folder = {
 	
 	
 	DownloadSort: function() {	
-		// Check for Download sort add-on, if enabled return true. (works only on 3.x ?)
-		var enabledItems = this.prefManager.getCharPref("extensions.enabledItems");
-		var dsort_GUUID = "{D9808C4D-1CF5-4f67-8DB2-12CF78BBA23F}";
-		var DownloadSort = enabledItems.indexOf(dsort_GUUID,0);
-		
-		if (DownloadSort >= 0) return true;
+		// Check for Download sort add-on, if enabled return true. (works only on 3.x)
+		if (this.firefoxversion == 3)
+		{
+			var enabledItems = this.prefManager.getCharPref("extensions.enabledItems");
+			var dsort_GUUID = "{D9808C4D-1CF5-4f67-8DB2-12CF78BBA23F}";
+			var DownloadSort = enabledItems.indexOf(dsort_GUUID,0);
+			
+			if (DownloadSort >= 0) return true;
+		}
 		return false;	
 	},
 	
diff --git a/content/asf_right_click.js b/content/asf_right_click.js
index f4663ab..61c8c46 100644
--- a/content/asf_right_click.js
+++ b/content/asf_right_click.js
@@ -36,45 +36,49 @@ var automatic_save_folder = {
 		{
 			asf_rightclick_loaded = true;	
 			
-			var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-				
-			//replace original Rightclick menu with ASF Rightclick menu
-			// Not compatible with Download Sort extension (same function modification, it will conflict).
-			// Detect if Download Sort is installed and enabled, and activate ASF rightclick only if DSort is not already loaded.
-			var enabledItems = prefs.getCharPref("extensions.enabledItems");
-			var dsort_GUUID = "{D9808C4D-1CF5-4f67-8DB2-12CF78BBA23F}";
-			var DownloadSort = enabledItems.indexOf(dsort_GUUID,0);
-			
-			if ( (DownloadSort == -1) && (automatic_save_folder.versionChecker.compare(automatic_save_folder.appInfo.version, "2.0") >= 0) ) // Download Sort is not enabled, load ASF rightclick replacement && Firefox 2.0 min
-			{			
-				// Not working like I would like :(
-				/*
-				// Replace first line of ORIGinal firefox rightclick function, to add ASF function to it. might Works with every firefox version :) 
-				var asf_getTargetFile = ORIG_getTargetFile.toString().replace("const prefSvcContractID","automatic_save_folder.rightclick_setdir(aFpP);const prefSvcContractID");
-				asf_getTargetFile = new Function("aFpP","aSkipPrompt", asf_getTargetFile);
-				alert(asf_getTargetFile);
-				window.getTargetFile = asf_getTargetFile;
-				*/
-				
-				// replace the ORIGinal firefox function with the custom one. (original from Firefox 3.5.4) 
-				// (Firefox 2.x doesn't know Cc"@mozilla.org/privatebrowsing;1" and returns a warning in the console, but right-click filtering is working.)
-				window.getTargetFile = automatic_save_folder.asf_getTargetFile;
+			// Right-click feature doesn't work on Firefox 2 (Can't detect installed add-on and prevent conflict with Download Sort)
+			if (automatic_save_folder.versionChecker.compare(automatic_save_folder.appInfo.version, "3.0") >= 0)
+			{
+				var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+					
+				//replace original Rightclick menu with ASF Rightclick menu
+				// Not compatible with Download Sort extension (same function modification, it will conflict).
+				// Detect if Download Sort is installed and enabled, and activate ASF rightclick only if DSort is not already loaded.
+				var enabledItems = prefs.getCharPref("extensions.enabledItems");
+				var dsort_GUUID = "{D9808C4D-1CF5-4f67-8DB2-12CF78BBA23F}";
+				var DownloadSort = enabledItems.indexOf(dsort_GUUID,0);
 				
-				if (automatic_save_folder.versionChecker.compare(automatic_save_folder.appInfo.version, "3.0") >= 0)
+				if (DownloadSort == -1)  // Download Sort is not enabled, load ASF rightclick replacement && Firefox 2.0 min
 				{
-					// Starting from firefox 3.0 there is a timeout when downloading with right-click to read header(Content-Disposition:) to rename the file in the file_explorer suggested filename.
-					// When timeout is set to 1000 ms (default), ASF right-click filtering is not working.
-					// When timeout is set to 0ms, ASF right-click filtering is working, but header renaming is not working anymore.
-					// And when set to ~8ms, Header renaming is working but ASF is filtering on the previous filename (before the renaming).
+					// Not working like I would like :(
+					/*
+					// Replace first line of ORIGinal firefox rightclick function, to add ASF function to it. might Works with every firefox version :) 
+					var asf_getTargetFile = ORIG_getTargetFile.toString().replace("const prefSvcContractID","automatic_save_folder.rightclick_setdir(aFpP);const prefSvcContractID");
+					asf_getTargetFile = new Function("aFpP","aSkipPrompt", asf_getTargetFile);
+					alert(asf_getTargetFile);
+					window.getTargetFile = asf_getTargetFile;
+					*/
 					
-					// Set to 0 only when the user want to use it
-					// and set it back to 1000 (default) when exiting Firefox
-					// to prevent blocking the user to 0 if add-on is removed without reseting the timeout first.
-					var asf_rightclick = prefs.getBoolPref("extensions.asf.rightclick");
-					prefs.setIntPref("browser.download.saveLinkAsFilenameTimeout", asf_rightclick == true ? 0 : 1000);
+					// replace the ORIGinal firefox function with the custom one. (original from Firefox 3.5.4) 
+					// (Firefox 2.x doesn't know Cc"@mozilla.org/privatebrowsing;1" and returns a warning in the console, but right-click filtering is working.)
+					window.getTargetFile = automatic_save_folder.asf_getTargetFile;
 					
-					var obsSvc = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
-					obsSvc.addObserver(automatic_save_folder.asf_quitObserver, "quit-application-requested", false);
+					if (automatic_save_folder.versionChecker.compare(automatic_save_folder.appInfo.version, "3.0") >= 0)
+					{
+						// Starting from firefox 3.0 there is a timeout when downloading with right-click to read header(Content-Disposition:) to rename the file in the file_explorer suggested filename.
+						// When timeout is set to 1000 ms (default), ASF right-click filtering is not working.
+						// When timeout is set to 0ms, ASF right-click filtering is working, but header renaming is not working anymore.
+						// And when set to ~8ms, Header renaming is working but ASF is filtering on the previous filename (before the renaming).
+						
+						// Set to 0 only when the user want to use it
+						// and set it back to 1000 (default) when exiting Firefox
+						// to prevent blocking the user to 0 if add-on is removed without reseting the timeout first.
+						var asf_rightclick = prefs.getBoolPref("extensions.asf.rightclick");
+						prefs.setIntPref("browser.download.saveLinkAsFilenameTimeout", asf_rightclick == true ? 0 : 1000);
+						
+						var obsSvc = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
+						obsSvc.addObserver(automatic_save_folder.asf_quitObserver, "quit-application-requested", false);
+					}
 				}
 			}
 		}
diff --git a/content/options.xul b/content/options.xul
index adb1989..5077ab5 100644
--- a/content/options.xul
+++ b/content/options.xul
@@ -121,6 +121,7 @@
 			<checkbox id="asf-rightclick" preference="asf_rightclick" label="&asf.rightclick.bool;" oncommand="automatic_save_folder.toggle_rightclick();"/>
 			<description id="asf-rightclickdesc" style="margin-left:25px;white-space: pre-wrap">&asf.rightclick.label;</description>
 			<description id="asf-rightclickdesc-DSort" style="margin-left:25px;white-space:pre-wrap;color:red;">&asf.rightclick.DSort.label;</description>
+			<description id="asf-rightclickdesc-ff2" style="margin-left:25px;white-space:pre-wrap;color:red;">&asf.rightclick.ff2.label;</description>
 		</groupbox>
 	</vbox>
 	<vbox id="asf-tab-dynamics" hidden="true" flex="1000">
diff --git a/locale/en-US/asf.dtd b/locale/en-US/asf.dtd
index fd84876..11f6653 100644
--- a/locale/en-US/asf.dtd
+++ b/locale/en-US/asf.dtd
@@ -40,8 +40,9 @@
 <!ENTITY asf.viewpathselect.bool "View the list of folders">
 <!ENTITY asf.viewpathselect.label "Activate a drop-down menu with all the filter's path.">
 <!ENTITY asf.dialogaccept.bool "Automatically accept the "What should Firefox do with this file" dialog windows.">
-<!ENTITY asf.rightclick.bool "Activate the filtering on the Right-Click menu 'Save link as...'">
-<!ENTITY asf.rightclick.label "Note: Activating the filtering on this menu prevent Firefox to read the file's target name if it is from a redirection download.&#xA;Temporarily disable this feature if you want Firefox to read the filename provided by the header. Only files from a redirection download have this problem, for direct download links leave this option checked.&#xA;&#xA;This option doesn't disable the filtering on the menus 'Save image as...' nor 'Save as... (Ctrl+S)'.">
+<!ENTITY asf.rightclick.bool "Remove the timing delay and activate the filtering on the right-click menu 'Save link as...'">
+<!ENTITY asf.rightclick.label "Note: Removing the timing delay prevent Firefox to read the file's target name if it is from a redirection download.&#xA;Temporarily disable this feature if you want Firefox to read the filename provided by the header. Only files from a download script with file redirection have this problem, saving a file from a direct download using right-click is working fine.&#xA;&#xA;This option doesn't affect the menus 'Save image as...' nor 'Save as... (Ctrl+S)'.">
+<!ENTITY asf.rightclick.ff2.label "The Automatic Save Folder's right-click feature is not available on Firefox 2. If you want to use the filters on your downloads using the right-click menu 'Save link as', you should update your Firefox version to 3.0 minimum (recommended version 3.5 or more)">
 <!ENTITY asf.rightclick.DSort.label "Download sort extension has been detected. &#xA;Automatic Save Folder's right-click feature will not work until you disable Download Sort in your Extension manager.">
 <!ENTITY asf.usecurrenturl.bool "Use the current website URL to verify the filter's domain if the hosted domain doesn't match.">
 
diff --git a/locale/fr-FR/asf.dtd b/locale/fr-FR/asf.dtd
index 0223768..b2f46f6 100644
--- a/locale/fr-FR/asf.dtd
+++ b/locale/fr-FR/asf.dtd
@@ -40,8 +40,9 @@
 <!ENTITY asf.viewpathselect.bool "Afficher la liste des filtres">
 <!ENTITY asf.viewpathselect.label "Active le menu déroulant contenant le chemin de chaque filtre.">
 <!ENTITY asf.dialogaccept.bool "Valider automatiquement la fenêtre 'Que doit faire Firefox avec ce fichier ?'.">
-<!ENTITY asf.rightclick.bool "Activer le filtrage sur le menu clic-droit 'Enregistrer la cible du lien sous...'.">
-<!ENTITY asf.rightclick.label "Note : Activer le filtrage sur ce menu empêche Firefox de récupérer le nom du fichier cible lors d'un téléchargement avec redirection.&#xA;Désactivez temporairement cette option si vous souhaitez que Firefox lise correctement le nom du fichier fourni par l'entête. Seuls les redirections de fichiers ont ce problème, pour les liens directs laissez la case cochée. &#xA;&#xA;Cette option ne désactive pas le filtrage sur les menus 'Enregistrer l'image sous...' n [...]
+<!ENTITY asf.rightclick.bool "Supprimer la temporisation et activer les filtres sur le menu clic-droit 'Enregistrer la cible du lien sous...'.">
+<!ENTITY asf.rightclick.label "Note : Supprimer la temporisation empêche Firefox de récupérer le nom du fichier cible lors d'un téléchargement avec redirection.&#xA;Désactivez temporairement cette option si vous souhaitez que Firefox lise correctement le nom du fichier fourni par l'entête. Seuls les scripts de téléchargement avec redirection de fichier ont ce problème, l'enregistrement par clic-droit sur les liens directs fonctionne correctement si la case est cochée. &#xA;&#xA;Cette opt [...]
+<!ENTITY asf.rightclick.ff2.label "La fonction clic-droit d'automatic save folder n'est pas compatible avec Firefox 2. Si vous souhaitez utiliser le filtres sur les téléchargements en utilisant le menu clic-droit 'Enregistrer la cible du lien sous...', vous devrez utiliser au minimum Firefox version 3.0 (Version 3.5 ou plus conseillée).">
 <!ENTITY asf.rightclick.DSort.label "L'extension Download Sort à été détectée. &#xA;La fonction clic-droit d'Automatic Save Folder est temporairement indisponible. Désactivez l'extension Download Sort dans le menu 'Outils/Modules complémentaires...' afin de pouvoir utiliser le clic-droit avec Automatic Save Folder.">
 <!ENTITY asf.usecurrenturl.bool "Utiliser l'adresse du site courant pour comparer le domaine du filtre si le domaine d'hébergement ne correspond pas.">
 
diff --git a/locale/it-IT/asf.dtd b/locale/it-IT/asf.dtd
index 73f2fc3..e63f9dc 100644
--- a/locale/it-IT/asf.dtd
+++ b/locale/it-IT/asf.dtd
@@ -40,8 +40,9 @@
 <!ENTITY asf.viewpathselect.bool "Vedi la lista dei filtri">
 <!ENTITY asf.viewpathselect.label "Visualizza un menu con la lista di tutti i percorsi dei filtri.">
 <!ENTITY asf.dialogaccept.bool "Automatically accept the "What should Firefox do with this file" dialog windows.">
-<!ENTITY asf.rightclick.bool "Activate the filtering on the Right-Click menu 'Save link as...'">
-<!ENTITY asf.rightclick.label "Note: Activating the filtering on this menu prevent Firefox to read the file's target name if it is from a redirection download.&#xA;Temporarily disable this feature if you want Firefox to read the filename provided by the header. Only files from a redirection download have this problem, for direct download links leave this option checked.&#xA;&#xA;This option doesn't disable the filtering on the menus 'Save image as...' nor 'Save as... (Ctrl+S)'.">
+<!ENTITY asf.rightclick.bool "Remove the timing delay and activate the filtering on the right-click menu 'Save link as...'">
+<!ENTITY asf.rightclick.label "Note: Removing the timing delay prevent Firefox to read the file's target name if it is from a redirection download.&#xA;Temporarily disable this feature if you want Firefox to read the filename provided by the header. Only files from a download script with file redirection have this problem, saving a file from a direct download using right-click is working fine.&#xA;&#xA;This option doesn't affect the menus 'Save image as...' nor 'Save as... (Ctrl+S)'.">
+<!ENTITY asf.rightclick.ff2.label "The Automatic Save Folder's right-click feature is not available on Firefox 2. If you want to use the filters on your downloads using the right-click menu 'Save link as', you should update your Firefox version to 3.0 minimum (recommended version 3.5 or more)">
 <!ENTITY asf.rightclick.DSort.label "Download sort extension has been detected. &#xA;Automatic Save Folder's right-click feature will not work until you disable Download Sort in your Add-on manager.">
 <!ENTITY asf.usecurrenturl.bool "Use the current website URL to verify the filter's domain if the hosted domain doesn't match.">
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/automatic-save-folder.git



More information about the Pkg-mozext-commits mailing list