Browse files

fix topic model advanced options

  • Loading branch information...
1 parent 4a3474b commit c6cf544b652804cc3353fe640bbbe24911117989 Chris Johnson-Roberson committed Sep 30, 2012
View
2 chrome/content/papermachines/options.xul
@@ -15,6 +15,7 @@
<preference id="pref_lang" name="extensions.papermachines.general.lang" type="unichar"/>
<preference id="pref_extract_pdf" name="extensions.papermachines.general.extract_pdf" type="bool"/>
<preference id="pref_extract_html" name="extensions.papermachines.general.extract_html" type="bool"/>
+ <preference id="pref_extract_txt" name="extensions.papermachines.general.extract_txt" type="bool"/>
<preference id="pref_extract_notes" name="extensions.papermachines.general.extract_notes" type="bool"/>
<preference id="pref_extract_tags" name="extensions.papermachines.general.extract_tags" type="bool"/>
</preferences>
@@ -35,6 +36,7 @@
<caption label="&papermachines.prefs.general.extract;"/>
<checkbox preference="pref_extract_pdf" label="&papermachines.prefs.general.extract_pdf;" id="extract_pdf"/>
<checkbox preference="pref_extract_html" label="&papermachines.prefs.general.extract_html;" id="extract_html"/>
+ <checkbox preference="pref_extract_txt" label="&papermachines.prefs.general.extract_txt;" id="extract_txt"/>
<checkbox preference="pref_extract_notes" label="&papermachines.prefs.general.extract_notes;" id="extract_notes"/>
<checkbox preference="pref_extract_tags" label="&papermachines.prefs.general.extract_tags;" id="extract_tags"/>
</groupbox>
View
3 chrome/content/papermachines/papermachines.js
@@ -853,6 +853,7 @@ Zotero.PaperMachines = {
var gettingTags = Preferences.get("extensions.papermachines.general.extract_tags");
var gettingPDF = Preferences.get("extensions.papermachines.general.extract_pdf");
var gettingHTML = Preferences.get("extensions.papermachines.general.extract_html");
+ var gettingTXT = Preferences.get("extensions.papermachines.general.extract_txt");
var outFile = dir.clone();
outFile.append(Zotero.PaperMachines.getFilenameForItem(item));
@@ -864,7 +865,7 @@ Zotero.PaperMachines = {
var a_item = Zotero.Items.get(attachments[a]);
if ((a_item.attachmentMIMEType == 'application/pdf' && gettingPDF)
|| (a_item.attachmentMIMEType == 'text/html' && gettingHTML)
- || a_item.attachmentMIMEType == 'text/plain') {
+ || (a_item.attachmentMIMEType == 'text/plain' && gettingTXT)) {
var orig_file = a_item.getFile().path;
if (orig_file) {
Zotero.PaperMachines.DB.query("INSERT OR IGNORE INTO files_to_extract (filename, itemID, outfile, collection) VALUES (?,?,?,?)", [orig_file, item.id, outFile.path, dir.leafName]);
View
11 chrome/content/papermachines/process_params_advanced.js
@@ -54,25 +54,28 @@ Zotero_PaperMachines_ProcessParams_Advanced.init = function () {
Zotero_PaperMachines_ProcessParams_Advanced.disclose = function() {
var vbox2 = document.getElementById("zotero-papermachines-adv-params-vbox-extra");
- vbox2.hidden = !vbox2.hidden;
+ vbox2.collapsed = !vbox2.collapsed;
};
Zotero_PaperMachines_ProcessParams_Advanced.acceptSelection = function() {
this.io.dataOut = {};
+ var me = this;
+
var vbox1 = document.getElementById("zotero-papermachines-adv-params-vbox");
var vbox2 = document.getElementById("zotero-papermachines-adv-params-vbox-extra");
- [vbox1, vbox2].forEach(function (vbox) {
+ var vboxes = [vbox1, vbox2];
+ vboxes.forEach(function (vbox) {
while (vbox.hasChildNodes()) {
var obj = vbox.childNodes[0];
var name = obj.getUserData("name");
var type = obj.getUserData("type");
if (name != null) {
if (type == "check") {
- this.io.dataOut[name] = obj.checked;
+ me.io.dataOut[name] = obj.checked;
} else {
- this.io.dataOut[name] = obj.childNodes[1].value;
+ me.io.dataOut[name] = obj.childNodes[1].value;
}
}
vbox.removeChild(obj);
View
2 chrome/content/papermachines/process_params_advanced.xul
@@ -21,6 +21,6 @@
<vbox id="zotero-papermachines-adv-params-container" flex="1">
<label id="zotero-papermachines-adv-params-intro"/>
<vbox id="zotero-papermachines-adv-params-vbox"/>
- <vbox id="zotero-papermachines-adv-params-vbox-extra" hidden="true"/>
+ <vbox id="zotero-papermachines-adv-params-vbox-extra" collapsed="true"/>
</vbox>
</dialog>
View
3 chrome/locale/en-US/papermachines/papermachines.dtd
@@ -58,7 +58,8 @@
<!ENTITY papermachines.prefs.general.lang "Stoplist Language: ">
<!ENTITY papermachines.prefs.general.extract "Data to Extract">
-<!ENTITY papermachines.prefs.general.extract_html "Web Snapshots">
+<!ENTITY papermachines.prefs.general.extract_txt "Plain Text">
+<!ENTITY papermachines.prefs.general.extract_html "Web Snapshots (HTML)">
<!ENTITY papermachines.prefs.general.extract_pdf "PDFs with OCR text">
<!ENTITY papermachines.prefs.general.extract_notes "Notes">
<!ENTITY papermachines.prefs.general.extract_tags "Tags">
View
1 defaults/preferences/defaults.js
@@ -1,5 +1,6 @@
pref("extensions.papermachines.general.lang", "en");
+pref("extensions.papermachines.general.extract_txt", true);
pref("extensions.papermachines.general.extract_pdf", true);
pref("extensions.papermachines.general.extract_html", true);
pref("extensions.papermachines.general.extract_notes", true);

0 comments on commit c6cf544

Please sign in to comment.