diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/changes.txt releases/unplug-2.002/changes.txt
1,33d0
< UnPlug 2.001
< ============
<
< 2.001 has bugfixes and minor changes from 2.000 [chiba].
<
< Results
< -------
< * FlashGot added to "downloaders". Dta used by default if you have both - you
< can't select which one you prefer yet.
< * Copy Url added to the "openers" list (although it's not really an
< "opener" :-)
< * Results containing .swf colored gray
<
< SearchPage
< ----------
< * Stop button fixed
<
< Search
< ------
< * no longer fails when "tagname" parameter is given and there is no
< dom object available (if gets applied to the whole page)
< * re-applies all rules
< * ${jsdecode:...} unescapes \xNN javascript escapes
<
< Rules.xml
< ---------
< * google video fixed (this failed due to a bug in 2.000
< * google video search changed to follow the link to the result that's
< currently playing, and apply all rules to that item
< * apple.com trailers for non-hd.
< * crunchyroll.com, darktube.com added
< * tags searched (
< <
< <
< ---
< >
< 103a100,117
< >
< >
< >
< >
< >
< >
< >
< >
< >
< > /playlist/
< >
< >
< >
< >
< >
< >
< >
< >
< 157d170
< <
< 163d175
< <
< 197,216d208
< <
< <
< <
< <
< <
< <
< <
< < (movie|src|href)
< <
< <
< <
< <
< < youtube\.com\/v\/([^&]+)
< <
< <
< < token=([^&]+)&
< < title=([^&]+)&
< <
< <
< <
< 219,225d210
< <
< <
< <
< < addVariable\("content_video",\s*"([^"]+)"\)
< < "unit_long(\d+)"
< <
< <
< 233,238d217
< <
< <
< < video_id%3D%27(\d+)%27
< < media_id%3D%27(\d+)%27
< <
< <
< 332,342d310
< <
< <
< <
< < <div\s+id=["']current\-title["']\s*>([\s\S]*?)</div\s*>
< <
< < href=["'](http://[^"']+)["']
< <
< <
< <
< <
< <
< 396,450d363
< <
< <
< <
< <
< < (addParam|addVariable)\s*\(\s*["'](image|thumbnail)["']\s*,\s*["'](.*?)["']\s*\)
< <
< <
< <
< <
< <
< <
< <
< < intl\.esperanto\.mtvi\.com
< < var uri\s*=\s*"(.*?)"
< <
< <
< <
< <
< <
< <
< <
< <
< <
< <
< <
< <
< < (googleplayer\.swf\?[^"']+)["']
< <
< <
< <
< <
< <
< <
< <
< <
< <
< <
< <
< <
< < /playlist/
< <
< <
< <
< <
< <
< <
< <
< <
< <
< <
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/search.js releases/unplug-2.000/source/chrome/content/search.js
< 276,296d275
< < * Decodes \xNN javascript escape sequences
< < */
< < case "jsdecode":
< < return this._subst_apply_functions(parts).replace(
< < /\\(b|f|n|r|t|v|\'|\"|\\|[0-7]{3}|x[0-9a-fA-F]{2}|u[0-9a-fA-f]{4})/g, function (wholematch, esc, offset, origstring) {
< < switch (esc.charAt(0)) {
< < case "b" : return "\b";
< < case "f" : return "\f";
< < case "n" : return "\n";
< < case "r" : return "\r";
< < case "t" : return "\t";
< < case "v" : return "\v";
< < case "\'" : return "\'";
< < case "\"" : return "\"";
< < case "x": return String.fromCharCode(parseInt(esc.substring(1), 16));
< < case "u": return String.fromCharCode(parseInt(esc.substring(1), 16));
< < case "0": case "1": case "2": case "3": case "4": case "5": case "6": case "7": return String.fromCharCode(parseInt(esc, 8));
< < }
< < throw "Unknown escape in jsdecode " + esc;
< < });
< < /**
< 467,479d445
< < /**
< < * returns an array of css classes for the widget
< < */
< < cssclasses : function () {
< < if (this._is_swf())
< < return ["swf"];
< < return [];
< < },
< <
< < _is_swf : function () {
< < return Boolean(this.url.indexOf(".swf") >= 0);
< < },
< <
< 563,568c529,531
< < for (var i = 0; i < UnPlug2Search._downloads.length; i++) {
< < var d = UnPlug2Search._downloads[i];
< < if (d && d.download) {
< < d.download.cancel()
< < }
< < }
< ---
< > for each ( d in UnPlug2Search._downloads )
< > if (d && d.download)
< > d.cancel()
< 787,791c750
< < if (node.getAttribute("goto") === "*") {
< < referenced_node = UnPlug2Search.get_rules_xml()
< < } else {
< < referenced_node = UnPlug2.get_element(UnPlug2Search.get_rules_xml(), "rule", node.getAttribute("goto"));
< < }
< ---
< > referenced_node = UnPlug2.get_element(UnPlug2Search.get_rules_xml(), "rule", node.getAttribute("goto"));
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/searchpage.js releases/unplug-2.000/source/chrome/content/searchpage.js
< 48,50d47
< < this.capabilities['flashgot'] = (
< < UnPlug2.get_root_pref("extensions.{19503e42-ca3c-4c27-b1e2-9cdb2170ee34}.description")
< < ? true : false )
< 53,56d49
< < // clipboard
< < this._clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
< < .getService(Components.interfaces.nsIClipboardHelper);
< <
< 139d131
< < reselem.setAttribute("class", result.cssclasses().join(" "));
< 184,187d175
< < copy_url : function (reselem) {
< < UnPlug2SearchPage._clipboard.copyString(reselem.getAttribute("url"));
< < },
< <
< 246,250d233
< < download_flashgot : function (reselem) {
< < var fg = UnPlug2SearchPage._gbrowser.gFlashGotService;
< < fg.download(["http://example.com"], fg.OP_ONE);
< < },
< <
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/searchpage.xul releases/unplug-2.000/source/chrome/content/searchpage.xul
< 49c49
< <
< ---
< >
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/widgets/unplug_result.xbl releases/unplug-2.000/source/chrome/content/widgets/unplug_result.xbl
< 55,57d54
< < case "copyurl":
< < default_open = document.getAnonymousElementByAttribute(this, "id", "copy_url");
< < break;
< 83,88d79
< < if (caps['flashgot']) {
< < var el = document.getAnonymousElementByAttribute(this, "id", "dl_flashgot")
< < el.style.display = "block";
< < default_dl = el;
< < }
< <
< 156,163d146
< < id="copy_url"
< < accesskey="©url.accesskey;"
< < label="©url.label;"
< < tooltiptext="©url.tooltip;"
< < class="menuitem-iconic copyurl"
< < oncommand="UnPlug2SearchPage.copy_url(document.getBindingParent(this)); event.stopPropagation();"
< < />
< <
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/locale/en-US/config.dtd releases/unplug-2.000/source/chrome/locale/en-US/config.dtd
< 62d61
< <
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/locale/en-US/searchpage.dtd releases/unplug-2.000/source/chrome/locale/en-US/searchpage.dtd
< 31,32d30
< <
< <
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/locale/en-US/strings.txt releases/unplug-2.000/source/chrome/locale/en-US/strings.txt
< 22c22
< < embedplayer=Embedded object (may be media player, not video)
< ---
< >
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/locale/en-US/unplug_result.dtd releases/unplug-2.000/source/chrome/locale/en-US/unplug_result.dtd
< 40,42d39
< <
< <
< <
< 56,59d52
< <
< <
< <
< <
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/skin/searchpage.css releases/unplug-2.000/source/chrome/skin/searchpage.css
< 25,27c25
< < unplug_result.swf {
< < color: #666666;
< < }
< ---
< >
< 44,58d41
< < toolbarbutton.flashgot,
< < menuitem.flashgot {
< < list-style-image: url("chrome://flashgot/skin/fg1.png");
< < }
< <
< < toolbarbutton.opentab,
< < menuitem.opentab {
< < /* list-style-image: url(""); */
< < }
< <
< < toolbarbutton.copyurl,
< < menuitem.copyurl {
< < list-style-image: url("moz-icon://stock/gtk-copy?size=menu");
< < }
< <
< 73,75d55
< < #stop_button[disabled] {
< < list-style-image: url("moz-icon://stock/gtk-stop?size=menu&state=disabled");
< < }
< diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/install.rdf releases/unplug-2.000/source/install.rdf
< 6c6
< < 2.001
< ---
< > 2.0
< Binary files releases/unplug-2.001/unplug.xpi and releases/unplug-2.000/unplug.xpi differ
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/common.js releases/unplug-2.002/source/chrome/content/common.js
135c135
< version : 2.001,
---
> version : 2.002,
139c139
< revision : 200904051824,
---
> revision : 200904100034,
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/config.xul releases/unplug-2.002/source/chrome/content/config.xul
84a85
>
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/overlay.js releases/unplug-2.002/source/chrome/content/overlay.js
35a36,38
>
> // popup window (if not closed) from last button click
> this._popup_window_ref = null;
44c47,53
< window.openDialog("chrome://unplug/content/searchpage.xul", "unplug_window", "chrome,centerscreen", data );
---
> try {
> UnPlug2Overlay._popup_win_ref.close();
> } catch(e) {
> // pass
> }
> UnPlug2Overlay._popup_win_ref = window.openDialog("chrome://unplug/content/searchpage.xul", "unplug_window", "chrome,centerscreen", data );
> UnPlug2Overlay._popup_win_ref.focus();
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/rules.js releases/unplug-2.002/source/chrome/content/rules.js
64a65,83
> * Executes an ifnot_* statement.
> * statement_name should not begin with "ifnot_"
> * An ifnot_* statement is executes.
> * If there's no if_* statement, the if_* (or each_*) statement is executed, and the opposite is returned. If throws an exception, treats this as being true.
> */
> exec_ifnot : function (statement_name, node, variables, url, text, doc) {
> var rule = UnPlug2Rules.get_rule("ifnot_" + statement_name);
> if (rule) {
> return (UnPlug2Rules.exec_statement(rule, node, variables, url, text, doc) !== false);
> }
>
> try {
> return (!UnPlug2Rules.exec_if(statement_name, node, variables, url, text, doc));
> } catch (e) {
> return true;
> }
> },
>
> /*
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/rules.xml releases/unplug-2.002/source/chrome/content/rules.xml
59a60,79
>
>
>
>
>
>
>
>
>
>
>
> iid\s*:\s*"(\d+)"
> title\s*:\s*"(.*?)"
>
>
>
>
>
>
>
399a420
> * xhamster.com
404,405c425,434
<
<
---
>
>
>
>
>
>
>
> addVariable\('srv','([^']+)'\)
>
>
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/search.js releases/unplug-2.002/source/chrome/content/search.js
698a699
> var exectype = null;
700a702,706
> exectype = "if";
> optional = false;
> } else if (nodetagname.substring(0, 6) == "ifnot_") {
> funcname = nodetagname.substring(6);
> exectype = "ifnot";
703a710
> exectype = "optional";
715,718c722
< if (optional)
< result = UnPlug2Rules.exec_optional(funcname, node, variables, url, text, doc);
< else
< result = UnPlug2Rules.exec_if(funcname, node, variables, url, text, doc);
---
> result = UnPlug2Rules["exec_" + exectype](funcname, node, variables, url, text, doc);
778c782
< if (nodetagname.substring(0, 3) != "if_" && nodetagname.substring(0, 9) != "optional_" && nodetagname.substring(0, 5) != "each_") {
---
> if (nodetagname.substring(0, 3) != "if_" && nodetagname.substring(0, 6) != "ifnot_" && nodetagname.substring(0, 9) != "optional_" && nodetagname.substring(0, 5) != "each_") {
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/searchpage.js releases/unplug-2.002/source/chrome/content/searchpage.js
51a52
> this.capabilities['downloader'] = UnPlug2.get_pref("downloader");
68,69c69
< // TODO - localize
< document.getElementById("dynamic_results").value = "No results yet";
---
> document.getElementById("dynamic_results").value = UnPlug2.str("search_no_results_yet");
93d92
< // TODO - localize
96c95
< document.getElementById("dynamic_results").value = "No results";
---
> document.getElementById("dynamic_results").value = UnPlug2.str("search_no_results");
99c98
< document.getElementById("dynamic_results").value = "1 result";
---
> document.getElementById("dynamic_results").value = UnPlug2.str("search_1_result");
101c100
< document.getElementById("dynamic_results").value = "# results".replace("#", all_results.length);
---
> document.getElementById("dynamic_results").value = UnPlug2.str("search_n_results").replace("#", all_results.length);
133c132
< reselem.setAttribute("type", result.type || "");
---
> reselem.setAttribute("type", result.media_type_hint || "");
172c171,175
< window.open(reselem.getAttribute("url"));
---
> try {
> window.open(reselem.getAttribute("url"));
> } catch(e) {
> UnPlug2.log("newwin " + e);
> }
176,177c179,184
< var t = UnPlug2SearchPage._gbrowser.addTab(reselem.getAttribute("url"));
< UnPlug2SearchPage._gbrowser.selectedTab = t;
---
> try {
> var t = UnPlug2SearchPage._gbrowser.addTab(reselem.getAttribute("url"));
> UnPlug2SearchPage._gbrowser.selectedTab = t;
> } catch(e) {
> UnPlug2.log("newtab " + e);
> }
181c188,192
< UnPlug2SearchPage._win.location = reselem.getAttribute("url");
---
> try {
> UnPlug2SearchPage._win.location = reselem.getAttribute("url");
> } catch(e) {
> UnPlug2.log("overwin " + e);
> }
185c196,200
< UnPlug2SearchPage._clipboard.copyString(reselem.getAttribute("url"));
---
> try {
> UnPlug2SearchPage._clipboard.copyString(reselem.getAttribute("url"));
> } catch(e) {
> UnPlug2.log("copyurl " + e);
> }
189,194c204,214
< var source_url = reselem.getAttribute("url");
< var dest = "/home/user/DELETEME";
< var file = UnPlug2SearchPage._save_as_box();
< if (!file)
< return;
< UnPlug2SearchPage._download_with_downloadmgr(source_url, file);
---
> try {
> var source_url = reselem.getAttribute("url");
> var dest = "/home/user/DELETEME";
> var name = reselem.getAttribute("title", "").replace(RegExp("[^\\w\\s]+", "g"), "_");
> var file = UnPlug2SearchPage._save_as_box(name, reselem.getAttribute("type"));
> if (!file)
> return;
> UnPlug2SearchPage._download_with_downloadmgr(source_url, file);
> } catch(e) {
> UnPlug2.log("saveas " + e);
> }
200c220
< _save_as_box : function () {
---
> _save_as_box : function (name, ext) {
203a224,227
> name = name || "no name";
> ext = ext || "ext";
> filepicker.defaultString = name + "." + ext;
> //filepicker.defaultExtention = ext;
237,243c261,271
< var source_url = reselem.getAttribute("url");
< window.opener.DTA_AddingFunctions.saveSingleLink(
< false, //turbo
< source_url, //url
< String(UnPlug2SearchPage._win.location), // referer
< null, // description
< null) // post data
---
> try {
> var source_url = reselem.getAttribute("url");
> window.opener.DTA_AddingFunctions.saveSingleLink(
> false, //turbo
> source_url, //url
> String(UnPlug2SearchPage._win.location), // referer
> null, // description
> null) // post data
> } catch(e) {
> UnPlug2.log("dta " + e);
> }
247,248c275,280
< var fg = UnPlug2SearchPage._gbrowser.gFlashGotService;
< fg.download(["http://example.com"], fg.OP_ONE);
---
> try {
> var fg = UnPlug2SearchPage._gbrowser.gFlashGotService;
> fg.download(["http://example.com"], fg.OP_ONE);
> } catch(e) {
> UnPlug2.log("flashgot " + e);
> }
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/content/widgets/unplug_result.xbl releases/unplug-2.002/source/chrome/content/widgets/unplug_result.xbl
94a95,98
> if (caps['downloader'] == "saveas") {
> default_dl = document.getAnonymousElementByAttribute(this, "id", "dl_saveas")
> }
>
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/locale/en-US/strings.txt releases/unplug-2.002/source/chrome/locale/en-US/strings.txt
15a16,19
> search_no_results_yet=No results yet
> search_1_result=1 result
> search_n_results=# results
> search_no_results=No results
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/chrome/skin/searchpage.css releases/unplug-2.002/source/chrome/skin/searchpage.css
1d0
<
31c30
< list-style-image: url("moz-icon://stock/gtk-preferences?size=menu");
---
> list-style-image: url("chrome://unplug/skin/tango-16/preferences-system.png");
36c35
< list-style-image: url("moz-icon://stock/gtk-save-as?size=menu");
---
> list-style-image: url("chrome://unplug/skin/tango-16/document-save-as.png");
48a48,52
> toolbarbutton.copyurl,
> menuitem.copyurl {
> list-style-image: url("chrome://unplug/skin/tango-16/edit-copy.png");
> }
>
51c55
< /* list-style-image: url(""); */
---
> list-style-image: url("chrome://unplug/skin/tango-16/tab-new.png");
54,56c58,65
< toolbarbutton.copyurl,
< menuitem.copyurl {
< list-style-image: url("moz-icon://stock/gtk-copy?size=menu");
---
> toolbarbutton.opennew,
> menuitem.opennew {
> list-style-image: url("chrome://unplug/skin/tango-16/window-new.png");
> }
>
> toolbarbutton.openover,
> menuitem.openover {
> list-style-image: url("chrome://unplug/skin/tango-16/window.png");
70c79
< list-style-image: url("moz-icon://stock/gtk-stop?size=menu");
---
> list-style-image: url("chrome://unplug/skin/tango-16/process-stop.png");
74c83,84
< list-style-image: url("moz-icon://stock/gtk-stop?size=menu&state=disabled");
---
> /* greyscale; brightness + 100% */
> list-style-image: url("chrome://unplug/skin/tango-16/process-stop-disabled.png");
Binary files releases/unplug-2.001/source/chrome/skin/tango-16/document-save-as.png and releases/unplug-2.002/source/chrome/skin/tango-16/document-save-as.png differ
Binary files releases/unplug-2.001/source/chrome/skin/tango-16/edit-copy.png and releases/unplug-2.002/source/chrome/skin/tango-16/edit-copy.png differ
Binary files releases/unplug-2.001/source/chrome/skin/tango-16/preferences-system.png and releases/unplug-2.002/source/chrome/skin/tango-16/preferences-system.png differ
Binary files releases/unplug-2.001/source/chrome/skin/tango-16/process-stop-disabled.png and releases/unplug-2.002/source/chrome/skin/tango-16/process-stop-disabled.png differ
Binary files releases/unplug-2.001/source/chrome/skin/tango-16/process-stop.png and releases/unplug-2.002/source/chrome/skin/tango-16/process-stop.png differ
Binary files releases/unplug-2.001/source/chrome/skin/tango-16/tab-new.png and releases/unplug-2.002/source/chrome/skin/tango-16/tab-new.png differ
Binary files releases/unplug-2.001/source/chrome/skin/tango-16/window-new.png and releases/unplug-2.002/source/chrome/skin/tango-16/window-new.png differ
Binary files releases/unplug-2.001/source/chrome/skin/tango-16/window.png and releases/unplug-2.002/source/chrome/skin/tango-16/window.png differ
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/install.rdf releases/unplug-2.002/source/install.rdf
6c6
< 2.001
---
> 2.002
14c14
< 3.1.*
---
> 3.5b4pre
diff --new-file --recursive --suppress-common-lines releases/unplug-2.001/source/todo.txt releases/unplug-2.002/source/todo.txt
4,5d3
< Tell people when menu config is applied next restart.
<
8c6
< More finely-grained optional/required attributes in UnPlug2Rules -- eg Right-click popup on unplug_result widget
10c8,13
< Rules documentation
---
> Better object to send through search.js:_apply_rules_to_document() loop.
> This could contain a way of reading original target, so we can allow file:// links to be downloaded if it's the original target of the page
>
> Tell people when menu config is applied next restart.
>
> More finely-grained optional/required attributes in UnPlug2Rules -- eg Rules documentation (needs more stable rules api)
>
29a35
> Clean up the element situation where some require the dynamic version of the page, and others require a re-downloaded version (for consistency: the dynamic version can be serialized in different ways; and t avoid flashblock, etc). Perhaps group into and (or and ; or something) on the root node.
34c40,42
< , + binary downloads
---
> , + binary downloads + .mov files
>
> Use web workers for evaluating s without DOM nodes (ie in ): https://developer.mozilla.org/En/Using_web_workers
Binary files releases/unplug-2.001/unplug.xpi and releases/unplug-2.002/unplug.xpi differ