[Pkg-mozext-commits] [automatic-save-folder] 11/133: New : Add an automated saving feature (auto dialog accept) (user requested)
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 06540b1e85686dd021116bcec4d706f35d85667c
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date: Fri Aug 21 13:33:49 2009 +0000
New :
Add an automated saving feature (auto dialog accept) (user requested)
git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@11 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
content/asf.js | 20 +++++++++-----------
content/asf_download.js | 25 ++++++++++++++++++-------
content/options.xul | 4 +++-
defaults/preferences/asf.js | 3 ++-
locale/en-US/asf.dtd | 1 +
locale/fr-FR/asf.dtd | 1 +
locale/it-IT/asf.dtd | 1 +
7 files changed, 35 insertions(+), 20 deletions(-)
diff --git a/content/asf.js b/content/asf.js
index 0728bd5..c617782 100644
--- a/content/asf.js
+++ b/content/asf.js
@@ -201,7 +201,11 @@ var automatic_save_folder = {
toggle_options: function () {
var select_option = document.getElementById("asf-viewdloption");
var select_list = document.getElementById("asf-viewpathselect");
-
+ var dialogaccept = document.getElementById("asf-dialogaccept");
+
+ // if the option is opened from the saving window, disable the autosave feature (Not working when set from here.)
+ dialogaccept.disabled = (window.opener.location == "chrome://mozapps/content/downloads/unknownContentType.xul") ? true : false ;
+
if (select_option.checked == false)
{
select_list.checked = false;
@@ -543,25 +547,19 @@ var automatic_save_folder = {
asf_savepref: function () {
//save the filters
this.asf_savefilters();
-
+
//save the default folder
var default_folder = document.getElementById("asf-default-folder").value;
this.saveUnicodeString("extensions.asf.defaultfolder", default_folder);
-
- //rescan filters data to update the unknownContentType.xul if it was openned with it.
- if (window.opener.location == "chrome://mozapps/content/downloads/unknownContentType.xul") // if the option is opened from the saving window
- {
- window.opener.automatic_save_folder.asf_setdir(); // rescan the filters to set the good folder
- }
-
+
//close the options
window.close();
if (window.opener.location == "chrome://mozapps/content/downloads/unknownContentType.xul") // if the option is opened from the saving window
- {
+ {
+ window.opener.automatic_save_folder.asf_setdir(); // rescan the filters to set the good folder
window.opener.sizeToContent();
}
window.opener.focus;
-
}
};
\ No newline at end of file
diff --git a/content/asf_download.js b/content/asf_download.js
index eace9db..17014a5 100644
--- a/content/asf_download.js
+++ b/content/asf_download.js
@@ -71,6 +71,7 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
var keeptemp = prefManager.getBoolPref("extensions.asf.keeptemp");
var tempdomain = ASF.loadUnicodeString("extensions.asf.tempdomain");
var variable_mode = prefManager.getBoolPref("extensions.asf.variablemode");
+ var dialogaccept = prefManager.getBoolPref("extensions.asf.dialogaccept");
// If variable/Advanced mode is ON, let's check the variables and replace to create the new defaultfolder
if (variable_mode == true)
@@ -231,17 +232,26 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
if (lastdir == true) // set it for "save as..." on FF1.5 and FF2, on FF3 lastdir is always true
{
ASF.saveUnicodeString("browser.download.lastDir", folder);
- }
+ }
}
// in every case, set the new file hosted domain to tempdomain
ASF.saveUnicodeString("extensions.asf.tempdomain", domain);
- // show or hide the asf option on saving window
- ASF.show_dloptions();
-
+ // Automatic saving when clicking on a link. The save dialog still flash onscreen very quicly.
+ if (dialogaccept)
+ {
+ window.close();
+ return dialog.onOK();
+ }
+ else
+ {
+ // show or hide the asf option on saving window
+ ASF.show_dloptions();
+ }
+
},
-
+
loadUnicodeString: function (pref_place) {
try
@@ -505,7 +515,7 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
- // Set the max width to the size of the screen minus 200px. Added for Mac users with long path choice.
+ // Set the max width to the size of the screen minus 200px. Added for Mac OSX users with long path choice.
// alert("first screen : " + screen.width + "x" + screen.height);
asf_dloptions.style.maxWidth = screen.width -200 +"px";
@@ -686,7 +696,8 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
// Ted Gifford, start block
var res = string.match(test_regexp);
- return res;
+ if (res) return res;
+ return false
// Ted Gifford, end block
},
diff --git a/content/options.xul b/content/options.xul
index 19a1e1c..e8017c8 100644
--- a/content/options.xul
+++ b/content/options.xul
@@ -28,6 +28,7 @@
<preference id="asf_viewpathselect" name="extensions.asf.viewpathselect" type="bool"/>
<preference id="asf_savetype" name="extensions.asf.savetype" type="int"/>
<preference id="asf_variablemode" name="extensions.asf.variablemode" type="bool"/>
+ <preference id="asf_dialogaccept" name="extensions.asf.dialogaccept" type="bool"/>
</preferences>
<stringbundleset id="automatic_save_folder_bundleset">
<stringbundle id="automatic_save_folder_bundles" src="chrome://asf/locale/asf.properties"/>
@@ -106,6 +107,7 @@
<caption label="&asf.options.label;"/>
<separator class="thin"/>
<checkbox id="asf-lasdir" preference="asf_lastdir" label="&asf.lastdir.bool;"/>
+ <checkbox id="asf-dialogaccept" preference="asf_dialogaccept" label="&asf.dialogaccept.bool;"/>
<checkbox id="asf-viewdloption" preference="asf_viewdloption" label="&asf.viewdloption.bool;" oncommand="automatic_save_folder.toggle_options();"/>
<hbox><description value=" " /><description id="asf-viewdloptiondesc" >&asf.viewdloption.label;</description></hbox>
<hbox><description value=" " /><checkbox id="asf-viewpathselect" preference="asf_viewpathselect" label="&asf.viewpathselect.bool;"/></hbox>
@@ -119,7 +121,7 @@
<description value=" " />
<groupbox flex="1" style="padding:0px !important;">
<caption label="&asf.variables.label;"/>
- <iframe flex="1" id="iframe_tab" class="plain" style="padding:0px !important; background-color:transparent; min-height:123px;"
+ <iframe flex="1" id="iframe_tab" class="plain" style="padding:0px !important; background-color:transparent; min-height:90px;"
src="chrome://asf/locale/variables.html"
/>
</groupbox>
diff --git a/defaults/preferences/asf.js b/defaults/preferences/asf.js
index 717efd1..d0e5982 100644
--- a/defaults/preferences/asf.js
+++ b/defaults/preferences/asf.js
@@ -13,4 +13,5 @@ pref("extensions.asf at mangaheart.org.description", "chrome://asf/locale/asf.prope
// See http://developer.mozilla.org/En/Download_Manager_preferences or http://kb.mozillazine.org/About:config_entries
// it make automatic saving to the right folder - 0= desktop, 1= system download dir, 2= user define
// does only affect the user if useDownloadDir = true ---- if "always ask the destination folder" is selected in FF options, it has no effect on the user.
- pref("browser.download.folderList", 2);
\ No newline at end of file
+ pref("browser.download.folderList", 2);
+ pref("extensions.asf.dialogaccept", false);
\ No newline at end of file
diff --git a/locale/en-US/asf.dtd b/locale/en-US/asf.dtd
index 6acddf9..42cd818 100644
--- a/locale/en-US/asf.dtd
+++ b/locale/en-US/asf.dtd
@@ -39,6 +39,7 @@
<!ENTITY asf.viewdloption.label "Allow you to see the last two destination folders and a link to add or edit the filters">
<!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 download (no need to click the 'OK' button).">
<!ENTITY asf.variablemode.bool "Advanced mode :">
<!ENTITY asf.variablemode1.label "Allow you to edit the filters saving path manually and add dynamic variables, like the date of the day ">
<!ENTITY asf.variablemode2.label "or the file name.">
diff --git a/locale/fr-FR/asf.dtd b/locale/fr-FR/asf.dtd
index aa36127..e817148 100644
--- a/locale/fr-FR/asf.dtd
+++ b/locale/fr-FR/asf.dtd
@@ -39,6 +39,7 @@
<!ENTITY asf.viewdloption.label "Permet de voir les deux derniers dossiers d'enregistrement et un lien pour éditer ou ajouter de nouveaux filtres.">
<!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 "Accepter le téléchargement automatiquement (Pas besoin de cliquer sur le bouton 'OK').">
<!ENTITY asf.variablemode.bool "Mode avancé :">
<!ENTITY asf.variablemode1.label "Permet d'éditer le chemin d'enregistrement des filtres manuellement et d'ajouter des variables dynamiques,">
<!ENTITY asf.variablemode2.label "comme la date du jour ou le domaine d'hébergement.">
diff --git a/locale/it-IT/asf.dtd b/locale/it-IT/asf.dtd
index fd1c878..f8a67ee 100644
--- a/locale/it-IT/asf.dtd
+++ b/locale/it-IT/asf.dtd
@@ -39,6 +39,7 @@
<!ENTITY asf.viewdloption.label "(permette di vedere le due ultime cartelle di destinazione e un collegamento per aggiungere o modificare filtri)">
<!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 download (no need to click the 'OK' button).">
<!ENTITY asf.variablemode.bool "Modalità avanzata :">
<!ENTITY asf.variablemode1.label "Permette di editare i percorsi di salvataggi manualmente e aggiungere variabili dinamiche,">
<!ENTITY asf.variablemode2.label "come la data del giorno o il nome del file.">
--
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