2 * Copyright 2007 Jesse Andrews, Manish Singh, Ian Fischer
4 * This file may be used under the terms of of the
5 * GNU General Public License Version 2 or later (the "GPL"),
6 * http://www.gnu.org/licenses/gpl.html
8 * Software distributed under the License is distributed on an "AS IS" basis,
9 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10 * for the specific language governing rights and limitations under the
14 function Grid(container) {
15 container.className = 'grid';
17 var ul = document.createElement('ul');
18 container.appendChild(ul);
20 this.start = function() {
24 this.finish = function() {}
26 this.add = function(tab) {
27 var box = document.createElement('li');
28 box.innerHTML = '<div title="'+tab.title+'"><span class="delete" title="delete taboo"></span><span class="title"><nobr>' +
29 tab.title + '</nobr></span><span class="url" title="'+ tab.url +'">' +
30 tab.url + '</span><img class="preview" src="' + tab.thumbURL + '" /></div>';
32 box.onclick = function(event) {
33 if (event.originalTarget.className == 'delete') {
34 controller.tabDelete(tab, box);
37 SVC.open(tab.url, whereToOpenLink(event));
44 function GridTrash(container) {
46 container.className = 'grid';
50 var div = document.createElement('div');
51 div.style.textAlign = 'center';
52 div.style.marginLeft = 'auto';
53 div.style.marginRight = 'auto';
54 div.style.width = '255px';
56 var text = document.createElement('div');
57 text.style.background = '#ee2';
58 text.style.width = '255px';
59 div.appendChild(text);
61 var a = document.createElement('a');
62 a.innerHTML = 'Click here to delete all of these taboos.';
64 a.onclick = function() {
65 for (var i in deleted) {
66 controller.tabFinalDelete(deleted[i].tab, deleted[i].el);
70 document.getElementById('content').appendChild(div);
72 var ul = document.createElement('ul');
73 container.appendChild(ul);
75 this.start = function() {
79 this.finish = function() {}
81 this.add = function(tab) {
82 var box = document.createElement('li');
83 box.innerHTML = '<div title="'+tab.title+'"><span class="delete" title="delete taboo"></span><span class="title"><nobr>' +
84 tab.title + '</nobr></span><span class="url" title="'+ tab.url +'">' +
85 tab.url + '</span><img class="preview" src="' + tab.imageURL + '" /></div>';
87 box.onclick = function(event) {
88 if (event.originalTarget.className == 'delete') {
89 controller.tabFinalDelete(tab, box);
92 controller.tabUndelete(tab);
93 box.style.display = 'none';
97 deleted.push({'tab':tab, 'el':box});