Hacking Gmail

(Grace) #1

106 Part II — Getting Inside Gmail


Listing 6-2(continued)

//it was suggested by a user that ‘Apaga’ is more proper
for this language
case ‘pt-BR’: buttonText=’Apaga’; break;
case ‘de’: buttonText=’Löschen’; break;
case ‘bg’:
buttonText=’Изтрий’;
break;
case ‘ru’:
buttonText=’Удалить’
; break;
case ‘pl’: buttonText=’Usuń’; break;
case ‘ja’:
buttonText=’\u30b4\u30df\u7bb1\u3078\u79fb\u52d5’; break;
case ‘hu’: buttonText=’Töröl’; break;
}

delete_button.innerHTML=’<b>’+buttonText+’</b>’;
return delete_button;
}

function _gd_insert_button(insert_container, id) {
if (!insert_container) return false;
if (_gd_element(‘_gd_delete_button’+id)) {
return false;
}

//get the elements
var spacer, delete_button;
delete_button=_gd_make_dom_button(id);

spacer=insert_container.firstChild.nextSibling.cloneNode(false
);

//pick the right place to put them
var insert_point=insert_container.firstChild; //this is
default
if (2==id || 3==id) {
// 2 and 3 are inside the message and go at a
different place
insert_point=insert_point.nextSibling.nextSibling;
}
if (window.document.location.search.match(/search=query/))
{
//inside the search page we go yet different places
with different spacers
Free download pdf