diff --git a/chrome/content/scrapbook/output.js b/chrome/content/scrapbook/output.js index 66230799..d228ff81 100644 --- a/chrome/content/scrapbook/output.js +++ b/chrome/content/scrapbook/output.js @@ -524,15 +524,13 @@ var sbOutputService = { + ' "re": false,\n' + ' "default": this.config["default_field"]\n' + ' };\n' - + ' keyStr.replace(/(\\-?[A-Za-z]+:|\\-)(?:"((?:\\\\"|[^"])*)"|([^ "\\u3000]*))|(?:"((?:""|[^"])*)"|([^ "\\u3000]+))/g, function(match, cmd, qterm, term, qterm2, term2){\n' + + ' keyStr.replace(/(-?[A-Za-z]+:|-)(?:"((?:""|[^"])*)"|([^"\\s]*))|(?:"((?:""|[^"])*)"|([^"\\s]+))/g, function(match, cmd, qterm, term, qterm2, term2){\n' + ' if (cmd) {\n' - + ' var term = qterm ? qterm.replace(/""/g, \'"\') : term;\n' + + ' var term = (qterm !== undefined) ? qterm.replace(/""/g, \'"\') : term;\n' + ' }\n' + ' else {\n' - + ' var term = qterm2 ? qterm2.replace(/""/g, \'"\') : term2;\n' + + ' var term = (qterm2 !== undefined) ? qterm2.replace(/""/g, \'"\') : term2;\n' + ' }\n' - + ' // commands that don\'t require a term\n' - + ' // the term will then be reguarded as a "tcc include"\n' + ' switch (cmd) {\n' + ' case "mc:":\n' + ' key.mc = true;\n' @@ -546,87 +544,78 @@ var sbOutputService = { + ' case "-re:":\n' + ' key.re = false;\n' + ' break;\n' - + ' case "type:":\n' - + ' addRule("type", "include", term);\n' - + ' term = false;\n' - + ' break;\n' - + ' case "-type:":\n' - + ' addRule("type", "exclude", term);\n' - + ' term = false;\n' - + ' break;\n' + ' case "sort:":\n' + ' addSort(term, 1);\n' - + ' term = false;\n' + ' break;\n' + ' case "-sort:":\n' + ' addSort(term, -1);\n' - + ' term = false;\n' + ' break;\n' - + ' }\n' - + ' // commands that require a term\n' - + ' if (term) {\n' - + ' switch (cmd) {\n' - + ' case "id:":\n' - + ' addRule("id", "include", parseStr(term));\n' - + ' break;\n' - + ' case "-id:":\n' - + ' addRule("id", "exclude", parseStr(term));\n' - + ' break;\n' - + ' case "file:":\n' - + ' addRule("file", "include", parseStr(term));\n' - + ' break;\n' - + ' case "-file:":\n' - + ' addRule("file", "exclude", parseStr(term));\n' - + ' break;\n' - + ' case "source:":\n' - + ' addRule("source", "include", parseStr(term));\n' - + ' break;\n' - + ' case "-source:":\n' - + ' addRule("source", "exclude", parseStr(term));\n' - + ' break;\n' - + ' case "tcc:":\n' - + ' addRule("tcc", "include", parseStr(term));\n' - + ' break;\n' - + ' case "-tcc:":\n' - + ' addRule("tcc", "exclude", parseStr(term));\n' - + ' break;\n' - + ' case "title:":\n' - + ' addRule("title", "include", parseStr(term));\n' - + ' break;\n' - + ' case "-title:":\n' - + ' addRule("title", "exclude", parseStr(term));\n' - + ' break;\n' - + ' case "comment:":\n' - + ' addRule("comment", "include", parseStr(term));\n' - + ' break;\n' - + ' case "-comment:":\n' - + ' addRule("comment", "exclude", parseStr(term));\n' - + ' break;\n' - + ' case "content:":\n' - + ' addRule("content", "include", parseStr(term));\n' - + ' break;\n' - + ' case "-content:":\n' - + ' addRule("content", "exclude", parseStr(term));\n' - + ' break;\n' - + ' case "create:":\n' - + ' addRule("create", "include", parseDate(term));\n' - + ' break;\n' - + ' case "-create:":\n' - + ' addRule("create", "exclude", parseDate(term));\n' - + ' break;\n' - + ' case "modify:":\n' - + ' addRule("modify", "include", parseDate(term));\n' - + ' break;\n' - + ' case "-modify:":\n' - + ' addRule("modify", "exclude", parseDate(term));\n' - + ' break;\n' - + ' case "-":\n' - + ' addRule(key["default"], "exclude", parseStr(term));\n' - + ' break;\n' - + ' default:\n' - + ' addRule(key["default"], "include", parseStr(term));\n' - + ' break;\n' - + ' }\n' + + ' case "type:":\n' + + ' addRule("type", "include", parseStr(term, true));\n' + + ' break;\n' + + ' case "-type:":\n' + + ' addRule("type", "exclude", parseStr(term, true));\n' + + ' break;\n' + + ' case "id:":\n' + + ' addRule("id", "include", parseStr(term));\n' + + ' break;\n' + + ' case "-id:":\n' + + ' addRule("id", "exclude", parseStr(term));\n' + + ' break;\n' + + ' case "file:":\n' + + ' addRule("file", "include", parseStr(term));\n' + + ' break;\n' + + ' case "-file:":\n' + + ' addRule("file", "exclude", parseStr(term));\n' + + ' break;\n' + + ' case "source:":\n' + + ' addRule("source", "include", parseStr(term));\n' + + ' break;\n' + + ' case "-source:":\n' + + ' addRule("source", "exclude", parseStr(term));\n' + + ' break;\n' + + ' case "tcc:":\n' + + ' addRule("tcc", "include", parseStr(term));\n' + + ' break;\n' + + ' case "-tcc:":\n' + + ' addRule("tcc", "exclude", parseStr(term));\n' + + ' break;\n' + + ' case "title:":\n' + + ' addRule("title", "include", parseStr(term));\n' + + ' break;\n' + + ' case "-title:":\n' + + ' addRule("title", "exclude", parseStr(term));\n' + + ' break;\n' + + ' case "comment:":\n' + + ' addRule("comment", "include", parseStr(term));\n' + + ' break;\n' + + ' case "-comment:":\n' + + ' addRule("comment", "exclude", parseStr(term));\n' + + ' break;\n' + + ' case "content:":\n' + + ' addRule("content", "include", parseStr(term));\n' + + ' break;\n' + + ' case "-content:":\n' + + ' addRule("content", "exclude", parseStr(term));\n' + + ' break;\n' + + ' case "create:":\n' + + ' addRule("create", "include", parseDate(term));\n' + + ' break;\n' + + ' case "-create:":\n' + + ' addRule("create", "exclude", parseDate(term));\n' + + ' break;\n' + + ' case "modify:":\n' + + ' addRule("modify", "include", parseDate(term));\n' + + ' break;\n' + + ' case "-modify:":\n' + + ' addRule("modify", "exclude", parseDate(term));\n' + + ' break;\n' + + ' case "-":\n' + + ' addRule(key["default"], "exclude", parseStr(term));\n' + + ' break;\n' + + ' default:\n' + + ' addRule(key["default"], "include", parseStr(term));\n' + + ' break;\n' + ' }\n' + ' return "";\n' + '\n' @@ -647,7 +636,7 @@ var sbOutputService = { + ' key.error.push(msg);\n' + ' }\n' + '\n' - + ' function parseStr(term) {\n' + + ' function parseStr(term, exactMatch) {\n' + ' var options = key.mc ? "m" : "im";\n' + ' if (key.re) {\n' + ' try {\n' @@ -658,7 +647,9 @@ var sbOutputService = { + ' }\n' + ' }\n' + ' else {\n' - + ' var regex = new RegExp(that.escapeRegExp(term), options);\n' + + ' var q = that.escapeRegExp(term);\n' + + ' if (exactMatch) q = "^" + q + "$";\n' + + ' var regex = new RegExp(q, options);\n' + ' }\n' + ' return regex;\n' + ' }\n' @@ -722,16 +713,16 @@ var sbOutputService = { + ' },\n' + '\n' + ' _match_type: function(keyitem, data) {\n' - + ' var type = data.item.type;\n' + + ' var text = data.item.type;\n' + ' for (var i=0, len=keyitem.exclude.length; i - + @@ -68,7 +68,7 @@ - + @@ -194,7 +194,7 @@ - + @@ -404,7 +404,7 @@ - + diff --git a/chrome/skin/classic/scrapbook/output.css b/chrome/skin/classic/scrapbook/output.css index 7c3bd2a9..31e4b3f2 100644 --- a/chrome/skin/classic/scrapbook/output.css +++ b/chrome/skin/classic/scrapbook/output.css @@ -18,6 +18,12 @@ div#header a { color: #666666; } +/* ::::: root ::::: */ + +ul#container-root { + margin-left: 10px; +} + /* ::::: list ::::: */ ul { margin-left: 0px; @@ -27,7 +33,7 @@ ul { /* ::::: list items ::::: */ li { list-style-type: none; - margin: 2px 20px; + margin: 2px 10px; white-space: nowrap; } diff --git a/doc/releases/1.14.5.txt b/doc/releases/1.14.5.txt new file mode 100644 index 00000000..7e17aa68 --- /dev/null +++ b/doc/releases/1.14.5.txt @@ -0,0 +1,23 @@ +Scrapbook X 1.14.5 +================== + +Changes since v1.14.4 +--------------------- + + * Fixed and reworked search query processing: + + * Fixed an issue that escaping a double quote by doubling it in a + quoted search term of a search command does not work. + + * Fixed an issue that a non-quoted term is not separated at a + space-like char (e.g. tab). + + * The term of command "type:" is now used as the key for full text + matching if and only if RegExp mode is off. + + * The term of command "mc:" or "re:" is now ignored. + + * Decreased the indentation of the index page generated by "Output + HTML tree". + +Also includes some localization improvements. diff --git a/install.rdf b/install.rdf index 8505e030..fe483a83 100644 --- a/install.rdf +++ b/install.rdf @@ -6,7 +6,7 @@ scrapbookx@addons.mozilla.org 2 - 1.14.4 + 1.14.5 false false false