diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/common.js releases/unplug-2.046/source/chrome/content/common.js 10c10 < * Copyright (C) 2010 David Batley --- > * Copyright (C) 2010, 2011 David Batley 142,143c142,143 < version : 2.045, < codename : "newyork", --- > version : 2.046, > codename : "beyoglu", 146c146 < revision : 201103182323, --- > revision : 201103242306, diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/config/config.js releases/unplug-2.046/source/chrome/content/config/config.js 10c10 < * Copyright (C) 2010 David Batley --- > * Copyright (C) 2010, 2011 David Batley diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/config/config.xul releases/unplug-2.046/source/chrome/content/config/config.xul 19c19 < * Copyright (C) 2010 David Batley --- > * Copyright (C) 2010, 2011 David Batley diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/config/extern.js releases/unplug-2.046/source/chrome/content/config/extern.js 10c10 < * Copyright (C) 2010 David Batley --- > * Copyright (C) 2010, 2011 David Batley diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/config/extern.xul releases/unplug-2.046/source/chrome/content/config/extern.xul 19c19 < * Copyright (C) 2010 David Batley --- > * Copyright (C) 2010, 2011 David Batley diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/display/download.js releases/unplug-2.046/source/chrome/content/display/download.js 10c10 < * Copyright (C) 2010 David Batley --- > * Copyright (C) 2010, 2011 David Batley 67,68c67,69 < /* button_names: < * returns the button names, in order of preference (ie, the most obscure last) --- > /* methods_for_result: > * returns the button names (methods), in order of preference (ie, > * the most obscure last) 70,71c71,87 < button_names : (function () { < return this._button_names; --- > methods_for_result : (function (result) { > var that = this; > return this._button_names.filter(function (val) { > return that._button_lookup[val].avail(result); > }); > }), > > /* methods_for_result_multiple: > * returns the names of all buttons (methods) available for > * exec_multiple, in order of preference (ie: the most obscure last) > */ > methods_for_result_multiple : (function (result) { > var that = this; > return this.methods_for_result(result).filter(function (val) { > var info = that._button_lookup[val]; > return (info.exec_fp || info.exec_fp_multiple || info.signal_get_argv); > }); 72a89 > 82a100 > 85a104 > 97,100c116,155 < exec : (function (name, result) { < var data = this._button_lookup[name]; < if (!data) { < throw "Unknown button name " + name; --- > exec : (function (method, result) { > // This function is called when clicking to download an individual item > > // Sometimes the concept of a name is not valid, for example > // when opening in a new tab. In these cases, the > // DownloadMethod implements only exec() > var info = this._button_lookup[method]; > if (!info) { > throw "Invalid DownloadMethod " + method; > } > if (info.exec) { > return info.exec(result); > } > > // Otherwise share code with exec_multiple > var file = this._save_as_box(result.details.name, result.details.file_ext); > return this.exec_multiple_fp(method, [[result, file]]); > }), > > folder_picker : (function () { > const nsIFilePicker = Components.interfaces.nsIFilePicker; > const nsifile = Components.interfaces.nsIFile; > var filepicker = Components.classes["@mozilla.org/filepicker;1"] > .createInstance(nsIFilePicker); > filepicker.init(window, UnPlug2.str("save_to_directory"), nsIFilePicker.modeGetFolder); > > // default directory > var path = UnPlug2.get_pref("savepath"); > if (!path) { > path = Components.classes["@mozilla.org/download-manager;1"] > .getService(Components.interfaces.nsIDownloadManager) > .defaultDownloadsDirectory.path; > } > if (path) { > var f = Components.classes["@mozilla.org/file/local;1"] > .createInstance(Components.interfaces.nsILocalFile); > f.initWithPath(path); > if (f.exists() && f.isDirectory()) { > filepicker.displayDirectory = f; > } 102,103c157,160 < if (!data.avail(result)) { < throw "Cannot use DownloadMethod " + name + " with " + result.toSource(); --- > > var ret = filepicker.show(); > if (ret !== nsIFilePicker.returnOK) { > return null; 105c162,210 < if (data.signal_get_argv) { --- > UnPlug2.set_pref("savepath", filepicker.file.path); > return filepicker.file; > }), > > exec_multiple : (function (method, result_list, folder) { > const nsifile = Components.interfaces.nsIFile; > if (folder === null) { > return; > } > > var info = this._button_lookup[method]; > var result_file_pairs = []; > for (var i = 0; i < result_list.length; ++i) { > var res = result_list[i]; > if (!info.avail(res)) { > UnPlug2.log("Not doing save-all (is unavailable) for " + method + " result " + res.toSource()); > continue; > } > /* we create the file, then over-write it > * because calling exec() does not always create the > * file immediately (so testing file.exists() is not > * sufficient). > */ > var filename = folder.clone(); > filename.append(res.details.name + "." + res.details.file_ext); > filename.createUnique(nsifile.NORMAL_FILE_TYPE, 0600); > result_file_pairs.push([res, filename]); > } > > this.exec_multiple_fp(method, result_file_pairs); > }), > > exec_multiple_fp : (function (method, result_file_pairs) { > var info = this._button_lookup[method]; > if (!info) { > throw "Invalid DownloadMethod " + method; > } > > if (info.exec_fp_multiple) { > // DownloadMethod supports multiple downloads at the same time > info.exec_fp_multiple(result_file_pairs); > } else if (info.exec_fp) { > // DownloadMethod supports downloads one at a time > for (var i = 0; i < result_file_pairs.length; ++i) { > info.exec_fp(result_file_pairs[i][0], result_file_pairs[i][1]); > } > } else if (info.signal_get_argv) { > // DownloadMethod uses extern.xul to run an external process > 116c221 < var exec_file = UnPlug2.get_pref("dmethod." + name); --- > var exec_file = UnPlug2.get_pref("dmethod." + method); 118c223 < window.openDialog("chrome://unplug/content/config/extern.xul", "chrome,modal", "unplug_extern", name); --- > window.openDialog("chrome://unplug/content/config/extern.xul", "chrome,modal", "unplug_extern", method); 123,132c228,231 < result: result, < name : name }); < } else if (data.exec_fp) { < // if a method implements exec_fp, it wishes to use the "normal" file-picker code < // and we'll pass them the appropriate file object in the arguments < var file = this._save_as_box(result.details.name, result.details.file_ext); < if (!file) { < return; < } < data.exec_fp(result, file); --- > result_list : result_file_pairs.map((function (pair) { > return { result : pair[0], dest_file : pair[1].path, description : pair[1].leafName }; > })), > method : method }); 134c233,236 < data.exec(result); --- > // DownloadMethod does none of these > var msg = "Unable to download file with method " + method; > alert(msg); > throw msg; 144,148c246,248 < * Currently this shows a save-as dialog, but future versions < * may start a download without asking. In practice this means < * data may be saved to an arbitary location on disk, so this < * should only be called based on a response from priviliged < * code. --- > * This will start a download, without asking, and save data > * to an arbitary location on disk, so this should only be > * called based on a response from priviliged code. 150c250 < var data = this._button_lookup[signal.name]; --- > var data = this._button_lookup[signal.method]; 152c252 < throw "Unknown button name " + signal.name; --- > throw "Unknown method for exec_from_signal " + signal.method; 154,156c254,286 < var file = this._save_as_box(signal.result.details.name, signal.result.details.file_ext); < if (!file) { < return null; --- > > var process_list = []; > for (var i = 0; i < signal.result_list.length; ++i) { > var result = signal.result_list[i]; > > var dest_file = Components.classes["@mozilla.org/file/local;1"] > .createInstance(Components.interfaces.nsILocalFile); > dest_file.initWithPath(result.dest_file); > > var exec_file = UnPlug2.get_pref("dmethod." + signal.method); > exec_file = this._nsifile_if_exec(exec_file); > if (!exec_file) { > throw "UnPlug display - this is not an exec_file" > } > var argv = data.signal_get_argv(result.result, dest_file); > var process = Components.classes["@mozilla.org/process/util;1"] > .createInstance(Components.interfaces.nsIProcess); > process.init(exec_file); > // we use runwAsync and use utf-16 strings, otherwise you get junk for > // filenames due to the unicode encoding conversions > if (!process.runwAsync) { > alert("Firefox 4 required"); > throw "nsIProcess.runwAsync is not implemented"; > } > UnPlug2.log("Running external program " + exec_file.path + " with arguments " + argv.toSource()); > process.runwAsync( > argv, > argv.length, > null, // TODO: we could use an nsIObserver here, but we'll just poll process.isRunning for now > false ); > process_list.push({ > process : process, > file : dest_file }) 158,181c288 < < var exec_file = UnPlug2.get_pref("dmethod." + signal.name); < exec_file = this._nsifile_if_exec(exec_file); < if (!exec_file) { < throw "UnPlug display - this is not an exec_file" < } < var argv = data.signal_get_argv(signal.result, file); < var process = Components.classes["@mozilla.org/process/util;1"] < .createInstance(Components.interfaces.nsIProcess); < process.init(exec_file); < // we use runwAsync and use utf-16 strings, otherwise you get junk for < // filenames due to the unicode encoding conversions < if (!process.runwAsync) { < alert("Firefox 4 required"); < throw "nsIProcess.runwAsync is not implemented"; < } < process.runwAsync( < argv, < argv.length, < null, // we could use an nsIObserver here, but we'll just poll process.isRunning for now < false ); < return { < process : process, < file : file.file } --- > return process_list; 186c293 < * return { file : nsIFile?, fileURL : nsIFileURL? }, or null for cancel. --- > * return an nsILocalFile, or null for cancel. 212c319 < filepicker.init(window, "Save as", nsIFilePicker.modeSave); --- > filepicker.init(window, UnPlug2.str("save_to_file"), nsIFilePicker.modeSave); 238c345 < return { "file" : filepicker.file, "fileURL" : filepicker.fileURL }; --- > return filepicker.file; 309c416 < target : file.fileURL, --- > target : io_service.newFileURI(file), 338a446 > // downthemall 351,371c459,488 < exec_fp : (function (res, fileobj) { < var file = fileobj.file; < if (file.leafName.indexOf("*") >= 0) { < // we use the renaming mask, which treats *name*, etc as special. < throw "Filename contains star"; < } < < // IMPORTANT: call String() explicitly as DTA alters string < link = { < "url" : res.download.url, // string < "postData" : null, < "referrer" : String(res.download.referer || ""), // an object with toURL < "dirSave" : String(file.parent.path), // an object with addFinalSlash < < // mask is the only reliable way of renaming: the other < // methods clear the file name following a http 3xx redirect < "mask" : String(file.leafName), // string. renaming mask == file name < < // these other file naming methods are less useful: < "fileName" : String(file.leafName), // string < "description" : String(file.leafName) } // string --- > exec_fp_multiple : (function (result_file_pairs) { > var links = []; > for (var i = 0; i < result_file_pairs.length; ++i) { > var res = result_file_pairs[i][0]; > var file = result_file_pairs[i][1]; > > // downthemall doesn't like to overwrite any existing files, so we clean them up here. > // (note: we created empty files while determining what names were available) > file.remove(false); > > if (file.leafName.indexOf("*") >= 0) { > // we use the renaming mask, which treats *name*, etc as special. > throw "Filename contains star"; > } > > // IMPORTANT: call String() explicitly as DTA alters string > links.push({ > "url" : res.download.url, // string > "postData" : null, > "referrer" : String(res.download.referer || ""), // an object with toURL > "dirSave" : String(file.parent.path), // an object with addFinalSlash > > // mask is the only reliable way of renaming: the other > // methods clear the file name following a http 3xx redirect > "mask" : String(file.leafName), // string. renaming mask == file name > > // these other file naming methods are less useful: > "fileName" : String(file.leafName), // string > "description" : String(file.leafName) }) // string > } 373c490 < UnPlug2.log("Hello DTA, I'm sending you: " + link.toSource()); --- > UnPlug2.log("Hello DTA, I'm sending you: " + links.toSource()); 376c493 < DTA.sendLinksToManager(window, true, [link]); --- > DTA.sendLinksToManager(window, true, links); 379c496 < window.opener.DTA_AddingFunctions.sendToDown(true, [link]); --- > window.opener.DTA_AddingFunctions.sendToDown(true, link); 398c515 < exec : (function (res) { --- > exec_fp : (function (res, destfile) { 402d518 < var name = res.details.name + "." + res.details.file_ext; 405,406c521,522 < description: name, < fname : name, --- > description: res.details.name, > fname : destfile.leafName, 410,412c526,531 < links.document = window.document; // origWindow XXX TODO should not be from chrome < links.browserWindow = flashgot_service.getBrowserWindow(links.document); < flashgot_service.download(links); --- > links.folder = destfile.parent.path; > > // links.document = window.document; // origWindow, but should not be from chrome! > // links.browserWindow = flashgot_service.getBrowserWindow(links.document); > > // flashgot_service.download(links); 433c552 < "--flv", savefile.file.path ]; --- > "--flv", savefile.path ]; 524c643 < ":demuxdump-file=" + savefile.file.path, --- > ":demuxdump-file=" + savefile.path, diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/display/extern/extern.js releases/unplug-2.046/source/chrome/content/display/extern/extern.js 10c10 < * Copyright (C) 2010 David Batley --- > * Copyright (C) 2010, 2011 David Batley 70,72c70,73 < var rtn = UnPlug2DownloadMethods.exec_from_signal(msg); < if (rtn) { < rtn.node = extern.add_program_box(msg.name, rtn.file.leafName); --- > var process_list = UnPlug2DownloadMethods.exec_from_signal(msg); > for (var i = 0; i < process_list.length; ++i) { > var rtn = process_list[i]; > rtn.node = extern.add_program_box(msg.method, rtn.file.leafName); diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/display/pop/pop.js releases/unplug-2.046/source/chrome/content/display/pop/pop.js 10c10 < * Copyright (C) 2010 David Batley --- > * Copyright (C) 2010, 2011 David Batley 48a49,50 > > this.selected_methods_excluded = []; 56a59,60 > this.main_group.signal_user_change_checkbox = UnPlug2SearchPage.refresh_selected_methods; > 58a63,66 > document.getElementById("notfound_button").addEventListener("click", UnPlug2SearchPage.send_nothing_found_msg, false); > document.getElementById("views").value = UnPlug2.get_pref("view"); > document.getElementById("views").addEventListener("command", UnPlug2SearchPage.updated_view_setting, false); > UnPlug2SearchPage.updated_view_setting(); 61a70,75 > done_load : (function () { > // now start the search automatically > UnPlug2SearchPage.do_search(); > document.getElementById("download_all").focus(); > }), > 66,68d79 < document.getElementById("dynamic_download").value = UnPlug2.str("search_busy"); < document.getElementById("dynamic_results").value = UnPlug2.str("search_no_results_yet"); < 76a88,115 > /* clicked "save all" button */ > do_saveall : (function () { > var solution = UnPlug2SearchPage.selected_methods_solution(); > var folder = UnPlug2DownloadMethods.folder_picker(); > if (!folder) { > return; > } > for (var i = 0; i < solution["method_names"].length; ++i) { > var method = solution["method_names"][i]; > var resultitem_list = solution["result_item_by_method"][method]; > var result_list = resultitem_list.map((function (x) { return x.result; })); > UnPlug2DownloadMethods.exec_multiple(method, result_list, folder); > } > > // if opening extern.xul window, we don't want to do window.close imediately > // because that will destroy extern_window.addEventListener("load", ...) callback > // TODO - need to do this better (some sort of "all done" or "allow/deny close" system?) > window.setTimeout((function () { > window.close(); > }), 1000); > }), > > updated_view_setting : (function () { > var view_setting = document.getElementById("views").value; > document.getElementById("unplug_search_window").className = "view-" + view_setting; > UnPlug2.set_pref("view", view_setting); > }), > 82d120 < UnPlug2.log("callback: " + obj.toSource()); 89c127 < UnPlug2.log("Callback function got a " + result.type + " (not a result)!"); --- > UnPlug2.log("Callback function got a " + obj.type + " (not a result)! Full value: " + obj.toSource()); 97d134 < var status_label = document.getElementById("dynamic_download"); 101d137 < status_label.value = UnPlug2.str("search_done"); 103d138 < var num_results = UnPlug2SearchPage.results_lookup_length; 105,112c140,141 < if (num_results == 0) { < document.getElementById("dynamic_results").value = UnPlug2.str("search_no_results"); < document.getElementById("dynamic_results").className = "failed"; < } else if (num_results == 1) { < document.getElementById("dynamic_results").value = UnPlug2.str("search_1_result"); < } else { < document.getElementById("dynamic_results").value = UnPlug2.str("search_n_results").replace("#", num_results); < } --- > document.getElementById("search_active_buttons").collapsed = true; > document.getElementById("search_finished_buttons").collapsed = false; 114,120d142 < if (info.downloads == 1){ < status_label.value.value = UnPlug2.str("search_1_active_download"); < } else { < // note: info.downloads can be zero if we've downloaded the last page, < // but there are items which have been marked "defer" scheduled to be run. < status_label.value.value = UnPlug2.str("search_n_active_downloads").replace("#", info.downloads); < } 130,131d151 < var e = document.getElementById("dynamic_results"); < e.value = "Have errors"; 140a161 > UnPlug2.log("Found result: " + result.toSource()); 151a173 > UnPlug2SearchPage.refresh_selected_methods(); 210c232,341 < --- > > refresh_selected_methods : (function () { > var enabled_container = document.getElementById("selected_methods_enabled"); > var disabled_container = document.getElementById("selected_methods_disabled"); > var solution = UnPlug2SearchPage.selected_methods_solution(); > > while (enabled_container.firstChild) { > enabled_container.removeChild(enabled_container.firstChild); > } > while (disabled_container.firstChild) { > disabled_container.removeChild(disabled_container.firstChild); > } > > var can_download_all = false; > var new_checkbox = (function (container, method, count) { > var elem = document.createElement("checkbox"); > var label = UnPlug2.str("dmethod." + name); > if (count) { > label += " (" + UnPlug2.str("n_files").replace("%s", count) + ")"; > checked = true; > } else { > checked = false; > } > elem.setAttribute("label", label); > elem.setAttribute("accesskey", UnPlug2.str("dmethod." + name + ".a")); > elem.setAttribute("tooltiptext", UnPlug2.str("dmethod." + name + ".tip")); > elem.setAttribute("checked", checked); > container.appendChild(elem); > return elem; > }); > > for (var i = 0; i < solution["method_names"].length; ++i) { > var name = solution["method_names"][i]; > var result_items_enabled = solution["result_item_by_method"][name]; > var count = result_items_enabled.length; > if (name === null) { > var elem = document.createElement("label"); > elem.setAttribute("value", UnPlug2.str("plus_n_extra_results").replace("%s", count)); > enabled_container.appendChild(elem); > } else { > can_download_all = true; > new_checkbox(enabled_container, name, count).addEventListener("command", (function (name) { > return (function (evt) { > if (UnPlug2SearchPage.selected_methods_excluded.indexOf(name) < 0) { > UnPlug2SearchPage.selected_methods_excluded.push(name); > } > UnPlug2SearchPage.refresh_selected_methods(); > }); > })(name), false); > } > for (var j = 0; j < result_items_enabled.length; ++j) { > result_items_enabled[j].style_will_download(name !== null); > } > } > > for (var i = 0; i < UnPlug2SearchPage.selected_methods_excluded.length; ++i) { > var name = UnPlug2SearchPage.selected_methods_excluded[i]; > new_checkbox(disabled_container, name, null).addEventListener("command", (function (name) { > return (function (evt) { > var idx = UnPlug2SearchPage.selected_methods_excluded.indexOf(name); > if (idx >= 0) { > UnPlug2SearchPage.selected_methods_excluded.splice(idx, 1); > } > UnPlug2SearchPage.refresh_selected_methods(); > }); > })(name), false); > } > > if (can_download_all) { > document.getElementById("download_all").removeAttribute("disabled"); > } else { > document.getElementById("download_all").setAttribute("disabled", true); > } > }), > > selected_methods_solution : (function () { > var solution = { > "result_item_by_method" : {}, > "method_names" : [] > }; > var resultitem_list = UnPlug2SearchPage.main_group.list_checked_items(); > for (var i = 0; i < resultitem_list.length; ++i) { > var methods = UnPlug2DownloadMethods.methods_for_result_multiple(resultitem_list[i].result); > var best_method = null; > for (var j = 0; j < methods.length; ++j) { > if (UnPlug2SearchPage.selected_methods_excluded.indexOf(methods[j]) < 0) { > best_method = methods[j]; > break; > } > } > if (solution["method_names"].indexOf(best_method) < 0) { > solution["method_names"].push(best_method); > solution["result_item_by_method"][best_method] = []; > } > solution["result_item_by_method"][best_method].push(resultitem_list[i]) > } > > solution["method_names"].sort((function (a, b) { > if (a === null) { > return +1; > } else if (b === null) { > return -1; > } else { > return solution["result_item_by_method"][b].length - solution["result_item_by_method"][a].length; > } > })); > > return solution; > }), > 251a383 > this.update_auto_ticked(); // sort doesn't always call this 267c399,427 < return this.root(); --- > return this.parent.root(); > } > }), > > list_checked_items : (function () { > var rtn = []; > for (var i = 0; i < this.children.length; ++i) { > if (this.children[i].list_checked_items) { > rtn = rtn.concat(this.children[i].list_checked_items()); > } else if (this.children[i].is_checked()) { > rtn.push(this.children[i]); > } > } > return rtn; > }), > > update_auto_ticked : (function () { > // assumes .sort() has been called and ignore subgroups > for (var i = 0; i < this.children.length; ++i) { > if (this.children[i].update_auto_ticked) { > return; // leave it alone > } > if (!this.children[i].auto_checked) { > return; // user edited checkboxes > } > } > for (var i = 0; i < this.children.length; ++i) { > // XXX also check for certainty value > this.children[i].set_checked(i == 0 && this.children[i].certainty >= 10); // assumes sorted results 315a476 > this.update_auto_ticked(); 341a503 > this.auto_checked = true; 359c521,534 < var downloadbutton = this.element.getElementsByTagName("toolbarbutton")[1]; --- > > var callback = (function (that) { > return (function (evt) { > that.auto_checked = false; > that.element.className = that.basic_css; > var f = that.root().signal_user_change_checkbox; > if (f) { > window.setTimeout(f, 10); // tickbox change hasn't been applied at this point > } > }); > }); > this.element.getElementsByTagName("checkbox")[0].addEventListener("click", callback(this), false); > > var downloadbutton = this.element.getElementsByTagName("toolbarbutton")[0]; 375c550 < var button_names = UnPlug2DownloadMethods.button_names(); --- > var button_names = UnPlug2DownloadMethods.methods_for_result(this.result); 395,405c570,572 < if (info.avail(this.result)) { < if (prev_elem_group != info.group && avail_elements.length != 0) { < popup.appendChild( < document.createElement("menuseparator")); < } < prev_elem_group = info.group; < avail_elements.push(name); < prev_elem_is_spacer = false; < var elem = make_elem("dmethod." + name, UnPlug2DownloadMethods.callback(name, this.result)) < elem.className = "menuitem-iconic " + info.css; < popup.appendChild(elem); --- > if (prev_elem_group != info.group && avail_elements.length != 0) { > popup.appendChild( > document.createElement("menuseparator")); 406a574,583 > prev_elem_group = info.group; > avail_elements.push(name); > var elem = document.createElement("menuitem"); > prev_elem_is_spacer = false; > elem.setAttribute("accesskey", UnPlug2.str("dmethod." + name + ".a")) > elem.setAttribute("label", UnPlug2.str("dmethod." + name)); > elem.setAttribute("tooltiptext", UnPlug2.str("dmethod." + name + ".tip")); > elem.className = "menuitem-iconic " + info.css; > elem.addEventListener("command", UnPlug2DownloadMethods.callback(name, this.result), false); > popup.appendChild(elem); 415,428c592 < var copy_button = this.element.getElementsByTagName("toolbarbutton")[0]; < copy_button.setAttribute("label", UnPlug2.str("dmethod.copyurl")); < copy_button.setAttribute("accesskey", UnPlug2.str("dmethod.copyurl.a")); < copy_button.setAttribute("tooltiptext", UnPlug2.str("dmethod.copyurl.tip")); < < var copy_info = UnPlug2DownloadMethods.getinfo("copyurl"); < if (copy_info && copy_info.avail(this.result)) { < copy_button.addEventListener("command", UnPlug2DownloadMethods.callback("copyurl", this.result), false); < copy_button.setAttribute("disabled", false); < } else { < copy_button.setAttribute("disabled", true); < } < < var main_button = this.element.getElementsByTagName("toolbarbutton")[1]; --- > var main_button = this.element.getElementsByTagName("toolbarbutton")[0]; 436d599 < main_button.setAttribute("disabled", false); 471c634 < this.element.className = [ --- > this.basic_css = [ 474a638,642 > this.element.className = this.basic_css; > }), > > style_will_download : (function (yesno) { > this.element.className = this.basic_css + (yesno ? " will-download" : " will-not-download"); 488c656,672 < return this.root(); --- > return this.parent.root(); > } > }), > > is_checked : (function () { > return this.element.getElementsByTagName("checkbox")[0].checked; > }), > > set_checked : (function (yesno) { > var elem = this.element.getElementsByTagName("checkbox")[0]; > if (yesno == elem.hasAttribute("checked")) { > return; // no change > } > if (yesno) { > elem.setAttribute("checked", true); > } else { > elem.removeAttribute("checked"); 489a674 > this.element.className = this.basic_css; diff --new-file --recursive --suppress-common-lines --exclude changes.txt --exclude diff.txt releases/unplug-2.045/source/chrome/content/display/pop/pop.xul releases/unplug-2.046/source/chrome/content/display/pop/pop.xul 4c4 < --- > * Copyright (C) 2010, 2011 David Batley 37c37 < onload="UnPlug2SearchPage.done_load();" 52a46,47 > > style="padding: 0.5em;" 67,74c62,86 < < < < < --- > > > > > > > > > > > > > > > > > > > > > > > > > 76,78c88,102 <