summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-07-17 08:46:59 +0000
committeralecpl <alec@alec.pl>2009-07-17 08:46:59 +0000
commit91a35ee01200ffa3b8557232514a5673bff04a46 (patch)
treea72270370370bd3bfe954847b0fe2f5b03d705f7
parent77edef7ebd22c0bbd9ee21ae8a65696f39abb9bf (diff)
- use lowercase in html tag names (to make switch to xhtml simpler in the future)
-rw-r--r--plugins/managesieve/managesieve.js4
-rw-r--r--program/js/app.js30
-rw-r--r--program/js/googiespell.js90
-rw-r--r--program/js/list.js14
4 files changed, 70 insertions, 68 deletions
diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js
index 09139d6c5..7ff1acf73 100644
--- a/plugins/managesieve/managesieve.js
+++ b/plugins/managesieve/managesieve.js
@@ -171,9 +171,9 @@ if (window.rcmail) {
if (row)
{
- new_row = parent.document.createElement('TR');
+ new_row = parent.document.createElement('tr');
new_row.id = 'rcmrow'+id;
- td = parent.document.createElement('TD');
+ td = parent.document.createElement('td');
new_row.appendChild(td);
list.insert_row(new_row, false);
diff --git a/program/js/app.js b/program/js/app.js
index 532c900ed..332ee877c 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -418,7 +418,7 @@ function rcube_webmail()
}
// set eventhandler to message icon
- if (row.icon = row.obj.getElementsByTagName('TD')[0].getElementsByTagName('IMG')[0])
+ if (row.icon = row.obj.getElementsByTagName('td')[0].getElementsByTagName('img')[0])
{
var p = this;
row.icon.id = 'msgicn_'+row.uid;
@@ -435,7 +435,7 @@ function rcube_webmail()
}
// set eventhandler to flag icon, if icon found
- if (this.env.flagged_col && (row.flagged_icon = row.obj.getElementsByTagName('TD')[this.env.flagged_col].getElementsByTagName('IMG')[0]))
+ if (this.env.flagged_col && (row.flagged_icon = row.obj.getElementsByTagName('td')[this.env.flagged_col].getElementsByTagName('img')[0]))
{
var p = this;
row.flagged_icon.id = 'flaggedicn_'+row.uid;
@@ -2405,7 +2405,7 @@ function rcube_webmail()
}
else // for standards-compilant browsers
{
- var frame = document.createElement('IFRAME');
+ var frame = document.createElement('iframe');
frame.name = frame_name;
frame.style.border = 'none';
frame.style.width = 0;
@@ -2918,7 +2918,7 @@ function rcube_webmail()
this.subscription_list.addEventListener('dragend', function(o){ p.subscription_move_folder(o); });
this.subscription_list.row_init = function (row)
{
- var anchors = row.obj.getElementsByTagName('A');
+ var anchors = row.obj.getElementsByTagName('a');
if (anchors[0])
anchors[0].onclick = function() { p.rename_folder(row.id); return false; };
if (anchors[1])
@@ -3084,7 +3084,7 @@ function rcube_webmail()
if (id && this.env.subscriptionrows[id] && (row = document.getElementById(id)))
{
var reg = new RegExp('.*['+RegExp.escape(this.env.delimiter)+']');
- this.name_input = document.createElement('INPUT');
+ this.name_input = document.createElement('input');
this.name_input.type = 'text';
this.name_input.value = this.env.subscriptionrows[id][0].replace(reg, '');
@@ -3211,7 +3211,7 @@ function rcube_webmail()
if (!replace)
row.cells[1].innerHTML = '*';
- if (!replace && row.cells[2] && row.cells[2].firstChild.tagName=='INPUT')
+ if (!replace && row.cells[2] && row.cells[2].firstChild.tagName.toLowerCase()=='input')
{
row.cells[2].firstChild.value = name;
row.cells[2].firstChild.checked = true;
@@ -3314,11 +3314,11 @@ function rcube_webmail()
this.clone_table_row = function(row)
{
var cell, td;
- var new_row = document.createElement('TR');
+ var new_row = document.createElement('tr');
for(var n=0; n<row.cells.length; n++)
{
cell = row.cells[n];
- td = document.createElement('TD');
+ td = document.createElement('td');
if (cell.className)
td.className = cell.className;
@@ -3406,7 +3406,7 @@ function rcube_webmail()
if (button.type=='image' && obj)
{
obj.setAttribute('alt', this.get_label(label));
- if ((link = obj.parentNode) && link.tagName == 'A')
+ if ((link = obj.parentNode) && link.tagName.toLowerCase() == 'a')
link.setAttribute('title', this.get_label(label));
}
else if (obj)
@@ -3569,7 +3569,7 @@ function rcube_webmail()
if ((cell = thead.rows[0].cells[n+1]) && (col=='from' || col=='to'))
{
// if we have links for sorting, it's a bit more complicated...
- if (cell.firstChild && cell.firstChild.tagName=='A')
+ if (cell.firstChild && cell.firstChild.tagName.toLowerCase()=='a')
{
cell.firstChild.innerHTML = this.get_label(this.coltypes[n]);
cell.firstChild.onclick = function(){ return rcmail.command('sort', this.__col, this); };
@@ -3615,7 +3615,7 @@ function rcube_webmail()
+ (this.message_list.in_selection(uid) ? ' selected' : '');
// for performance use DOM instead of jQuery here
- var row = document.createElement('TR');
+ var row = document.createElement('tr');
row.id = 'rcmrow'+uid;
row.className = css_class;
@@ -3635,7 +3635,7 @@ function rcube_webmail()
icon = this.env.unreadicon;
// add icon col
- var col = document.createElement('TD');
+ var col = document.createElement('td');
col.className = 'icon';
col.innerHTML = icon ? '<img src="'+icon+'" alt="" />' : '';
row.appendChild(col);
@@ -3643,7 +3643,7 @@ function rcube_webmail()
// add each submitted col
for (var n = 0; n < this.coltypes.length; n++) {
var c = this.coltypes[n];
- col = document.createElement('TD');
+ col = document.createElement('td');
col.className = String(c).toLowerCase();
if (c=='flag') {
@@ -3787,7 +3787,7 @@ function rcube_webmail()
var rowcount = tbody.rows.length;
var even = rowcount%2;
- var row = document.createElement('TR');
+ var row = document.createElement('tr');
row.id = 'rcmrow'+cid;
row.className = 'contact '+(even ? 'even' : 'odd');
@@ -3796,7 +3796,7 @@ function rcube_webmail()
// add each submitted col
for (var c in cols) {
- col = document.createElement('TD');
+ col = document.createElement('td');
col.className = String(c).toLowerCase();
col.innerHTML = cols[c];
row.appendChild(col);
diff --git a/program/js/googiespell.js b/program/js/googiespell.js
index dc26c4503..abd3462ec 100644
--- a/program/js/googiespell.js
+++ b/program/js/googiespell.js
@@ -94,10 +94,10 @@ this.decorateTextarea = function(id) {
if (this.text_area) {
if (!this.spell_container && this.decoration) {
- var table = document.createElement('TABLE');
- var tbody = document.createElement('TBODY');
- var tr = document.createElement('TR');
- var spell_container = document.createElement('TD');
+ var table = document.createElement('table');
+ var tbody = document.createElement('tbody');
+ var tr = document.createElement('tr');
+ var spell_container = document.createElement('td');
var r_width = this.isDefined(this.force_width) ? this.force_width : this.text_area.offsetWidth;
var r_height = this.isDefined(this.force_height) ? this.force_height : 16;
@@ -317,7 +317,7 @@ this.parseResult = function(r_text) {
// Error menu functions
/////
this.createErrorWindow = function() {
- this.error_window = document.createElement('DIV');
+ this.error_window = document.createElement('div');
$(this.error_window).addClass('googie_window').attr('googie_action_btn', '1');
}
@@ -349,8 +349,8 @@ this.saveOldValue = function(elm, old_value) {
}
this.createListSeparator = function() {
- var td = document.createElement('TD');
- var tr = document.createElement('TR');
+ var td = document.createElement('td');
+ var tr = document.createElement('tr');
$(td).html(' ').attr('googie_action_btn', '1')
.css({'cursor': 'default', 'font-size': '3px', 'border-top': '1px solid #ccc', 'padding-top': '3px'});
@@ -395,8 +395,8 @@ this.showErrorWindow = function(elm, id) {
$(this.error_window).css({'visibility': 'visible',
'top': (pos.top+20)+'px', 'left': (pos.left)+'px'}).html('');
- var table = document.createElement('TABLE');
- var list = document.createElement('TBODY');
+ var table = document.createElement('table');
+ var list = document.createElement('tbody');
$(table).addClass('googie_list').attr('googie_action_btn', '1');
@@ -418,9 +418,9 @@ this.showErrorWindow = function(elm, id) {
var len = this.results[id]['attrs']['l'];
if (suggestions.length == 0) {
- var row = document.createElement('TR');
- var item = document.createElement('TD');
- var dummy = document.createElement('SPAN');
+ var row = document.createElement('tr');
+ var item = document.createElement('td');
+ var dummy = document.createElement('span');
$(dummy).text(this.lang_no_suggestions);
$(item).attr('googie_action_btn', '1').css('cursor', 'default');
@@ -431,9 +431,9 @@ this.showErrorWindow = function(elm, id) {
}
for (i=0; i < suggestions.length; i++) {
- var row = document.createElement('TR');
- var item = document.createElement('TD');
- var dummy = document.createElement('SPAN');
+ var row = document.createElement('tr');
+ var item = document.createElement('td');
+ var dummy = document.createElement('span');
$(dummy).html(suggestions[i]);
@@ -449,9 +449,9 @@ this.showErrorWindow = function(elm, id) {
//The element is changed, append the revert
if (elm.is_changed && elm.innerHTML != elm.old_value) {
var old_value = elm.old_value;
- var revert_row = document.createElement('TR');
- var revert = document.createElement('TD');
- var rev_span = document.createElement('SPAN');
+ var revert_row = document.createElement('tr');
+ var revert = document.createElement('td');
+ var rev_span = document.createElement('span');
$(rev_span).addClass('googie_list_revert').html(this.lang_revert + ' ' + old_value);
@@ -469,11 +469,11 @@ this.showErrorWindow = function(elm, id) {
}
//Append the edit box
- var edit_row = document.createElement('TR');
- var edit = document.createElement('TD');
- var edit_input = document.createElement('INPUT');
- var ok_pic = document.createElement('IMG');
- var edit_form = document.createElement('FORM');
+ var edit_row = document.createElement('tr');
+ var edit = document.createElement('td');
+ var edit_input = document.createElement('input');
+ var ok_pic = document.createElement('img');
+ var edit_form = document.createElement('form');
var onsub = function () {
if (edit_input.value != '') {
@@ -515,8 +515,8 @@ this.showErrorWindow = function(elm, id) {
var e_elm = ref.extra_menu_items[i];
if (!e_elm[2] || e_elm[2](elm, ref)) {
- var e_row = document.createElement('TR');
- var e_col = document.createElement('TD');
+ var e_row = document.createElement('tr');
+ var e_col = document.createElement('td');
$(e_col).html(e_elm[0])
.bind('mouseover', ref.item_onmouseover)
@@ -561,10 +561,10 @@ this.showErrorWindow = function(elm, id) {
// Edit layer (the layer where the suggestions are stored)
//////
this.createEditLayer = function(width, height) {
- this.edit_layer = document.createElement('DIV');
+ this.edit_layer = document.createElement('div');
$(this.edit_layer).addClass('googie_edit_layer').width(width-10).height(height);
- if (this.text_area.nodeName != 'INPUT' || $(this.text_area).val() == '') {
+ if (this.text_area.nodeName.toLowerCase() != 'input' || $(this.text_area).val() == '') {
$(this.edit_layer).css('overflow', 'auto').height(height-4);
} else {
$(this.edit_layer).css('overflow', 'hidden');
@@ -613,7 +613,7 @@ this.resumeEditing = function() {
}
this.createErrorLink = function(text, id) {
- var elm = document.createElement('SPAN');
+ var elm = document.createElement('span');
var ref = this;
var d = function (e) {
ref.showErrorWindow(elm, id);
@@ -637,13 +637,13 @@ this.createPart = function(txt_part) {
txt_part = txt_part.replace(/^ /g, "&nbsp;");
txt_part = txt_part.replace(/ $/g, "&nbsp;");
- var span = document.createElement('SPAN');
+ var span = document.createElement('span');
$(span).html(txt_part);
return span;
}
this.showErrorsInIframe = function() {
- var output = document.createElement('DIV')
+ var output = document.createElement('div')
var pointer = 0;
var results = this.results;
@@ -700,22 +700,22 @@ this.showErrorsInIframe = function() {
// Choose language menu
//////
this.createLangWindow = function() {
- this.language_window = document.createElement('DIV');
+ this.language_window = document.createElement('div');
$(this.language_window).addClass('googie_window')
.width(100).attr('googie_action_btn', '1');
//Build up the result list
- var table = document.createElement('TABLE');
- var list = document.createElement('TBODY');
+ var table = document.createElement('table');
+ var list = document.createElement('tbody');
var ref = this;
$(table).addClass('googie_list').width('100%');
this.lang_elms = new Array();
for (i=0; i < this.langlist_codes.length; i++) {
- var row = document.createElement('TR');
- var item = document.createElement('TD');
- var span = document.createElement('SPAN');
+ var row = document.createElement('tr');
+ var item = document.createElement('td');
+ var span = document.createElement('span');
$(span).text(this.lang_to_word[this.langlist_codes[i]]);
this.lang_elms.push(item);
@@ -805,13 +805,13 @@ this.createChangeLangPic = function() {
var img = $('<img>')
.attr({src: this.img_dir + 'change_lang.gif', 'alt': 'Change language', 'googie_action_btn': '1'});
- var switch_lan = document.createElement('SPAN');
+ var switch_lan = document.createElement('span');
var ref = this;
$(switch_lan).addClass('googie_lang_3d_on')
.append(img)
.bind('click', function(e) {
- var elm = this.tagName == 'IMG' ? this.parentNode : this;
+ var elm = this.tagName.toLowerCase() == 'img' ? this.parentNode : this;
if($(elm).hasClass('googie_lang_3d_click')) {
elm.className = 'googie_lang_3d_on';
ref.hideLangWindow();
@@ -826,7 +826,7 @@ this.createChangeLangPic = function() {
}
this.createSpellDiv = function() {
- var span = document.createElement('SPAN');
+ var span = document.createElement('span');
$(span).addClass('googie_check_spelling_link').text(this.lang_chck_spell);
@@ -891,7 +891,7 @@ this.checkSpellingState = function(fire) {
if (this.show_change_lang_pic)
this.switch_lan_pic = this.createChangeLangPic();
else
- this.switch_lan_pic = document.createElement('SPAN');
+ this.switch_lan_pic = document.createElement('span');
var span_chck = this.createSpellDiv();
var ref = this;
@@ -939,12 +939,12 @@ this.createCloseButton = function(c_fn) {
}
this.createButton = function(name, css_class, c_fn) {
- var btn_row = document.createElement('TR');
- var btn = document.createElement('TD');
+ var btn_row = document.createElement('tr');
+ var btn = document.createElement('td');
var spn_btn;
if (css_class) {
- spn_btn = document.createElement('SPAN');
+ spn_btn = document.createElement('span');
$(spn_btn).addClass(css_class).html(name);
} else {
spn_btn = document.createTextNode(name);
@@ -972,7 +972,7 @@ this.appendIndicator = function(elm) {
if (window.rcmail)
rcmail.set_busy(true, 'checking');
/*
- this.indicator = document.createElement('IMG');
+ this.indicator = document.createElement('img');
$(this.indicator).attr('src', this.img_dir + 'indicator.gif')
.css({'margin-right': '5px', 'text-decoration': 'none'}).width(16).height(16);
@@ -984,7 +984,7 @@ this.appendIndicator = function(elm) {
}
this.createFocusLink = function(name) {
- var link = document.createElement('A');
+ var link = document.createElement('a');
$(link).attr({'href': 'javascript:;', 'name': name});
return link;
}
diff --git a/program/js/list.js b/program/js/list.js
index 193e4670d..01ad5f3c1 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -127,7 +127,7 @@ init_row: function(row)
*/
clear: function(sel)
{
- var tbody = document.createElement('TBODY');
+ var tbody = document.createElement('tbody');
this.list.insertBefore(tbody, this.list.tBodies[0]);
this.list.removeChild(this.list.tBodies[1]);
this.rows = new Array();
@@ -217,7 +217,8 @@ drag_row: function(e, id)
{
// don't do anything (another action processed before)
var evtarget = rcube_event.get_target(e);
- if (this.dont_select || (evtarget && (evtarget.tagName == 'INPUT' || evtarget.tagName == 'IMG')))
+ var tagname = evtarget.tagName.toLowerCase();
+ if (this.dont_select || (evtarget && (tagname == 'input' || tagname == 'img')))
return true;
// accept right-clicks
@@ -241,7 +242,7 @@ drag_row: function(e, id)
rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
// add listener for iframes
- var iframes = document.getElementsByTagName('IFRAME');
+ var iframes = document.getElementsByTagName('iframe');
this.iframe_events = Object();
for (var n in iframes)
{
@@ -283,8 +284,9 @@ click_row: function(e, id)
var now = new Date().getTime();
var mod_key = rcube_event.get_modifier(e);
var evtarget = rcube_event.get_target(e);
+ var tagname = evtarget.tagName.toLowerCase();
- if ((evtarget && (evtarget.tagName == 'INPUT' || evtarget.tagName == 'IMG')))
+ if ((evtarget && (tagname == 'input' || tagname == 'img')))
return true;
// don't do anything (another action processed before)
@@ -835,7 +837,7 @@ drag_mouse_up: function(e)
rcube_event.remove_listener({element:document, event:'mousemove', object:this, method:'drag_mouse_move'});
rcube_event.remove_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
- var iframes = document.getElementsByTagName('IFRAME');
+ var iframes = document.getElementsByTagName('iframe');
for (var n in iframes) {
var iframedoc;
@@ -869,7 +871,7 @@ drag_mouse_up: function(e)
set_background_mode: function(flag)
{
if (flag) {
- this.background = document.createElement('TBODY');
+ this.background = document.createElement('tbody');
} else if (this.background) {
this.list.replaceChild(this.background, this.list.tBodies[0]);
this.background = null;