[Pkg-mozext-commits] [automatic-save-folder] 05/133: New : + Add a stringbundle with the list of the months names + Add dynamic variable %F% for full months names and %M% for abbreviated names

David Prévot taffit at moszumanska.debian.org
Mon Apr 27 20:33:47 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 7cef64571de68b6e0fe909bde1cd9591168918d8
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date:   Tue Jul 7 22:26:06 2009 +0000

    New :
    + Add a stringbundle with the list of the months names
    + Add dynamic variable %F% for full months names and %M% for abbreviated names
    
    git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@5 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
 content/asf_download.js                | 38 ++++++++++++++++++++++++++++------
 content/overlay_unknownContentType.xul |  4 +++-
 locale/en-US/asf.properties            | 26 ++++++++++++++++++++++-
 locale/en-US/variables.html            |  2 ++
 locale/fr-FR/asf.properties            | 26 ++++++++++++++++++++++-
 locale/fr-FR/variables.html            |  2 ++
 locale/it-IT/asf.properties            | 26 ++++++++++++++++++++++-
 locale/it-IT/variables.html            | 10 +++++++++
 8 files changed, 124 insertions(+), 10 deletions(-)

diff --git a/content/asf_download.js b/content/asf_download.js
index fc03bc1..717b733 100644
--- a/content/asf_download.js
+++ b/content/asf_download.js
@@ -28,7 +28,7 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
                                .getService(Components.interfaces.nsIVersionComparator),
 							   
 	asf_setdir: function () {
-		// I don't understand why "this.function" doesn't work with addEventListener even using "with" method, only onclick from the Xul events works. 
+		// I don't understand why "this".function_name doesn't work with addEventListener even using "with" method, only onclick from the Xul events works. 
 		// So I use this tweak to call functions and properties from its name "automatic_save_folder" instead of "this"
 		
 		// Setting private variables usable in this function
@@ -56,6 +56,13 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		var domain = 		document.getElementById("source").value ;
 		var filename = 		document.getElementById("location").value ;
 		
+		// debug : show the full downloaded link  http://abc.xyz/def/file.ext
+		// Can use this new function to get free from the need of the download window.
+		//var url = dialog.mLauncher.source.spec;
+		//alert(url);
+		
+		
+		
 		
 		// load prefmanager data
 		var savetype = 			prefManager.getIntPref("extensions.asf.savetype");	
@@ -75,6 +82,9 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		if (firefoxversion == "3")   // take the download.lastDir if it's FF3
 		{
 			var folder = ASF.loadUnicodeString("browser.download.lastDir");
+			if (folder == "") 
+			{ // it's when lastDir doesn't exist yet, ff3 bug ?
+			}
 		}
 		else // else if it's not FF3 (it's 1.5 or 2), read Download.dir
 		{
@@ -257,7 +267,21 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		if (!path) return false;
 		if (this.trim(path).length==0) return false;
 		
-		objdate = new Date();
+		var objdate = new Date();
+		
+		// make the array with the month's name in the stringbundle of the locale language path.
+
+		var stringbundle = document.getElementById('automatic_save_folder_bundles');
+
+		var fullmonthname = new Array();
+		var abbrmonthname = new Array();
+		for (var i = 1 ; i<= 12 ; i++)
+		{
+			fullmonthname[i-1] = stringbundle.getString("month"+i+"_full");
+			abbrmonthname[i-1] = stringbundle.getString("month"+i+"_abbr");
+		}
+		
+		
 		const ZERO = "0";  // leading zero
 		
 		// load the domain and the filename of the saved file	
@@ -267,6 +291,10 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		var file_name = filename.replace (/\.(?!.*\.).*$/i, "");  // Trim from the last dot to the end of the file = remove extension
 		var extension = filename.match(/([^\.]*)$/i);  // take out the extension (anything not containing a dot, with an ending line)
 		
+		
+		
+		
+		
 		// check the filter's data
 		var asf_domain = "";
 		var asf_filename = "";		
@@ -389,6 +417,8 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 										// Month
 										.replace(/%m%/g, ((objdate.getMonth()+1) <10) ? (ZERO + (objdate.getMonth()+1)) : objdate.getMonth()+1)  // = number of the month : 01 to 12
 										.replace(/%n%/g, objdate.getMonth()+1)  // 8, 9, 10, (no leading 0)
+										.replace(/%F%/g, fullmonthname[objdate.getMonth()])  // full month name
+										.replace(/%M%/g, abbrmonthname[objdate.getMonth()])  // abbreviated month name
 										// Day
 										.replace(/%d%/g, ((objdate.getDate()) <10) ? (ZERO + (objdate.getDate())) : objdate.getDate())  // = number of the day : 01 to 31
 										.replace(/%j%/g, objdate.getDate())  // = number of the day  1 to 31 (no leading 0)
@@ -479,10 +509,6 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		// alert("first screen : " + screen.width + "x" + screen.height);
 		asf_dloptions.style.maxWidth = screen.width -200 +"px";
 		
-		// debug : show the full downloaded link
-		//var url = dialog.mLauncher.source.spec;
-		//alert(url);
-
 	},
 
 
diff --git a/content/overlay_unknownContentType.xul b/content/overlay_unknownContentType.xul
index 0abdac0..9482691 100644
--- a/content/overlay_unknownContentType.xul
+++ b/content/overlay_unknownContentType.xul
@@ -14,7 +14,9 @@
 <script type="application/x-javascript" src="chrome://asf/content/asf_download.js" />
 
 <vbox id="container"> 
-
+<stringbundleset id="automatic_save_folder_bundleset">
+	<stringbundle id="automatic_save_folder_bundles" src="chrome://asf/locale/asf.properties"/>
+</stringbundleset>
 	<groupbox id="asf_dloptions" style="visibility: collapse;" flex="1">
 	<caption label="Automatic Save Folder"/>
 	<vbox>
diff --git a/locale/en-US/asf.properties b/locale/en-US/asf.properties
index 8db50cb..4b8091b 100644
--- a/locale/en-US/asf.properties
+++ b/locale/en-US/asf.properties
@@ -1 +1,25 @@
-extensions.asf at mangaheart.org.description=Automatically select the destination folder for your download, matching the filename and domain.
\ No newline at end of file
+extensions.asf at mangaheart.org.description=Automatically select the destination folder for your download, matching the filename and domain.
+month1_full=January
+month1_abbr=Jan
+month2_full=February
+month2_abbr=Feb
+month3_full=March
+month3_abbr=Mar
+month4_full=April
+month4_abbr=Apr
+month5_full=May
+month5_abbr=May
+month6_full=June
+month6_abbr=Jun
+month7_full=July
+month7_abbr=Jul
+month8_full=August
+month8_abbr=Aug
+month9_full=September
+month9_abbr=Sep
+month10_full=October
+month10_abbr=Oct
+month11_full=November
+month11_abbr=Nov
+month12_full=December
+month12_abbr=Dec
diff --git a/locale/en-US/variables.html b/locale/en-US/variables.html
index c053656..94cfd70 100644
--- a/locale/en-US/variables.html
+++ b/locale/en-US/variables.html
@@ -19,6 +19,8 @@
 			<u style="font-size:15px">Month</u><br/>
 			<b>%m%</b> = 01 to 12<br/>
 			<b>%n%</b> = 1 to 12<br/>
+			<b>%F%</b> = January<br/>
+			<b>%M%</b> = Jan<br/>
 		</td>
 		<td align="left" valign="top">
 			<u style="font-size:15px">Day</u> :<br/>
diff --git a/locale/fr-FR/asf.properties b/locale/fr-FR/asf.properties
index 12c9878..e5fcb7f 100644
--- a/locale/fr-FR/asf.properties
+++ b/locale/fr-FR/asf.properties
@@ -1 +1,25 @@
-extensions.asf at mangaheart.org.description=Sélectionne automatiquement le dossier d'enregistrement suivant le nom du fichier et le site d'hébergement.
\ No newline at end of file
+extensions.asf at mangaheart.org.description=Sélectionne automatiquement le dossier d'enregistrement suivant le nom du fichier et le site d'hébergement.
+month1_full=Janvier
+month1_abbr=Jan
+month2_full=Février
+month2_abbr=Fev
+month3_full=Mars
+month3_abbr=Mar
+month4_full=Avril
+month4_abbr=Avr
+month5_full=Mai
+month5_abbr=Mai
+month6_full=Juin
+month6_abbr=Jun
+month7_full=Juillet
+month7_abbr=Jul
+month8_full=Août
+month8_abbr=Aoû
+month9_full=Septembre
+month9_abbr=Sep
+month10_full=Octobre
+month10_abbr=Oct
+month11_full=Novembre
+month11_abbr=Nov
+month12_full=Décembre
+month12_abbr=Déc
diff --git a/locale/fr-FR/variables.html b/locale/fr-FR/variables.html
index 21ce470..97d7262 100644
--- a/locale/fr-FR/variables.html
+++ b/locale/fr-FR/variables.html
@@ -19,6 +19,8 @@
 			<u style="font-size:15px">Mois</u><br/>
 			<b>%m%</b> = 01 à 12<br/>
 			<b>%n%</b> = 1 à 12<br/>
+			<b>%F%</b> = Janvier<br/>
+			<b>%M%</b> = Jan<br/>
 		</td>
 		<td align="left" valign="top">
 			<u style="font-size:15px">Jour</u> :<br/>
diff --git a/locale/it-IT/asf.properties b/locale/it-IT/asf.properties
index 2493cbd..b461ff3 100644
--- a/locale/it-IT/asf.properties
+++ b/locale/it-IT/asf.properties
@@ -1 +1,25 @@
-extensions.asf at mangaheart.org.description=Seleziona automaticamente la cartella di destinazione dei tuoi download, in base al nome del file e dominio.
\ No newline at end of file
+extensions.asf at mangaheart.org.description=Seleziona automaticamente la cartella di destinazione dei tuoi download, in base al nome del file e dominio.
+month1_full=January
+month1_abbr=Jan
+month2_full=February
+month2_abbr=Feb
+month3_full=March
+month3_abbr=Mar
+month4_full=April
+month4_abbr=Apr
+month5_full=May
+month5_abbr=May
+month6_full=June
+month6_abbr=Jun
+month7_full=July
+month7_abbr=Jul
+month8_full=August
+month8_abbr=Aug
+month9_full=September
+month9_abbr=Sep
+month10_full=October
+month10_abbr=Oct
+month11_full=November
+month11_abbr=Nov
+month12_full=December
+month12_abbr=Dec
diff --git a/locale/it-IT/variables.html b/locale/it-IT/variables.html
index bbed4f5..632d7eb 100644
--- a/locale/it-IT/variables.html
+++ b/locale/it-IT/variables.html
@@ -19,6 +19,8 @@
 			<u style="font-size:15px">Mese</u><br/>
 			<b>%m%</b> = da 01 a 12<br/>
 			<b>%n%</b> = da 1 a 12<br/>
+			<b>%F%</b> = January<br/>
+			<b>%M%</b> = Jan<br/>
 		</td>
 		<td align="left" valign="top">
 			<u style="font-size:15px">Giorno</u> :<br/>
@@ -56,6 +58,14 @@
 		<td colspan="3" valign="top">
 			<br/>
 			<u style="font-size:15px">Tag speciali - avanzate</u> :<br/>
+							
+				<b>$<number>d</b> = Return the captured data using parentheses in the "domain" filter. <number> refer to the parenthesis number, from 1 to 9.
+				<br/>
+				<br/>
+				<b>$<number>f</b> =  Return the captured data using parentheses in the "file name" filter. <number> refer to the parenthesis number, from 1 to 9.
+					<br/>Example, on this filter:  mozilla_(firefox)_3.5.(exe), <b>$1f</b> will capture firefox, and <b>$2f</b> will capture "exe".
+				<br/>
+				<br/>
 				<b>%asf_rd%</b><u>Espressione regolare</u><b>%asf_rd%</b><br/>
 				Controlla il dominio completo con l'espressione regolare contenuta tra i due tag <b>%asf_rd%</b> e ritorna i dati presi.
 				<br/>

-- 
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