rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
document.write( string + "<br>\n"); | DocumentWrite(string); | function writeLineToLog( string ) { string = String(string); string = string.replace(/[<>&]/g, htmlesc); document.write( string + "<br>\n");} |
document.forms[0].text_preview.value = val; | document.frm_help.text_preview.value = val; | function writePreview(val) { // writes a value to the text_preview document.forms[0].text_preview.value = val;} |
function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { | function writeRichText(rte, html, css, width, height, buttons, readOnly) { | function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { if(isRichText){ currentRTE = rte; if(allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; // CM 06/04/05 stops single quotes from messing everything up html=replaceIt(html,'\'','''); // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations if (arguments.length == 6) { fullscreen = false; readOnly = buttons; buttons = height; height = width; width = css; css = ""; } var iconWrapWidth = wrapWidth; if(readOnly) buttons = false; if(fullscreen) { readOnly = false; // fullscreen is not readOnly and must show buttons buttons = true; // resize rte on resize if the option resize_fullsrcreen = true. if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; //adjust maximum table widths findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } var tablewidth = width; } else{ fullscreen = false; iconWrapWidth = iconWrapWidth-25; //adjust minimum table widths if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } var rte_css = ""; if(css.length > 0) { rte_css = css; } else{ rte_css = cssFile; } document.writeln('<span class="rteDiv">'); if(buttons) { document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons1_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); insertBar(); document.writeln('<td><select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:105px;height:20px;margin:1px;">'); document.writeln(lblFormat); document.writeln('</select></td><td>'); document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id)" style="font-size:14px;width:125px;height:20px;margin:1px;">'); document.writeln(lblFont); document.writeln('</select></td><td>'); document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:75px;height:20px;margin:1px;">'); document.writeln(lblSize); document.writeln('</select>'); insertSep(); if(isIE){ insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')"); insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')"); insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')"); } insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')"); insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')"); insertSep(); insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')"); insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')"); insertSep(); insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')"); insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')"); insertSep(); insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')"); insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')"); if(isIE)insertImg(lblSpellCheck,"spellcheck.gif","checkspell()"); document.writeln('</td>'); if(tablewidth < iconWrapWidth){ document.writeln('<td width="100%"></td></tr></tbody></table>'); document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); } insertBar(); insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')"); insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')"); insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')"); insertSep(); insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')"); insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')"); insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')"); insertSep(); insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')"); insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')"); insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')"); insertSep(); insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')"); insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')"); insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')"); insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')"); insertSep(); insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte); insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte); insertSep(); insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')"); insertSep(); insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')"); insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')"); insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')"); insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')"); document.writeln('<td width="100%"></td></tr></tbody></table>'); } document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); if(!readOnly){ document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>'); document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap="nowrap"><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="txtSrc'+rte+'" style="font-family:sans-serif;font-size:12px;color:#555555;CURSOR: default;">'+lblModeHTML+'</span></td>'); document.writeln('<td width="100%" nowrap> </td></tr></table>'); } document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>'); document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">'); if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); document.writeln('</span>'); document.getElementById('hdn'+rte).value = html; enableDesignMode(rte, html, rte_css, readOnly); }} |
fullscreen = false; | function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { if(isRichText){ currentRTE = rte; if(allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; // CM 06/04/05 stops single quotes from messing everything up html=replaceIt(html,'\'','''); // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations if (arguments.length == 6) { fullscreen = false; readOnly = buttons; buttons = height; height = width; width = css; css = ""; } var iconWrapWidth = wrapWidth; if(readOnly) buttons = false; if(fullscreen) { readOnly = false; // fullscreen is not readOnly and must show buttons buttons = true; // resize rte on resize if the option resize_fullsrcreen = true. if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; //adjust maximum table widths findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } var tablewidth = width; } else{ fullscreen = false; iconWrapWidth = iconWrapWidth-25; //adjust minimum table widths if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } var rte_css = ""; if(css.length > 0) { rte_css = css; } else{ rte_css = cssFile; } document.writeln('<span class="rteDiv">'); if(buttons) { document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons1_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); insertBar(); document.writeln('<td><select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:105px;height:20px;margin:1px;">'); document.writeln(lblFormat); document.writeln('</select></td><td>'); document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id)" style="font-size:14px;width:125px;height:20px;margin:1px;">'); document.writeln(lblFont); document.writeln('</select></td><td>'); document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:75px;height:20px;margin:1px;">'); document.writeln(lblSize); document.writeln('</select>'); insertSep(); if(isIE){ insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')"); insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')"); insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')"); } insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')"); insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')"); insertSep(); insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')"); insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')"); insertSep(); insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')"); insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')"); insertSep(); insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')"); insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')"); if(isIE)insertImg(lblSpellCheck,"spellcheck.gif","checkspell()"); document.writeln('</td>'); if(tablewidth < iconWrapWidth){ document.writeln('<td width="100%"></td></tr></tbody></table>'); document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); } insertBar(); insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')"); insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')"); insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')"); insertSep(); insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')"); insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')"); insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')"); insertSep(); insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')"); insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')"); insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')"); insertSep(); insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')"); insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')"); insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')"); insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')"); insertSep(); insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte); insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte); insertSep(); insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')"); insertSep(); insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')"); insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')"); insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')"); insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')"); document.writeln('<td width="100%"></td></tr></tbody></table>'); } document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); if(!readOnly){ document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>'); document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap="nowrap"><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="txtSrc'+rte+'" style="font-family:sans-serif;font-size:12px;color:#555555;CURSOR: default;">'+lblModeHTML+'</span></td>'); document.writeln('<td width="100%" nowrap> </td></tr></table>'); } document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>'); document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">'); if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); document.writeln('</span>'); document.getElementById('hdn'+rte).value = html; enableDesignMode(rte, html, rte_css, readOnly); }} |
|
if(fullscreen) { readOnly = false; buttons = true; if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } | iconWrapWidth = iconWrapWidth-25; if (buttons && (width < minWidth)) width = minWidth; if(isIE){ | function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { if(isRichText){ currentRTE = rte; if(allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; // CM 06/04/05 stops single quotes from messing everything up html=replaceIt(html,'\'','''); // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations if (arguments.length == 6) { fullscreen = false; readOnly = buttons; buttons = height; height = width; width = css; css = ""; } var iconWrapWidth = wrapWidth; if(readOnly) buttons = false; if(fullscreen) { readOnly = false; // fullscreen is not readOnly and must show buttons buttons = true; // resize rte on resize if the option resize_fullsrcreen = true. if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; //adjust maximum table widths findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } var tablewidth = width; } else{ fullscreen = false; iconWrapWidth = iconWrapWidth-25; //adjust minimum table widths if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } var rte_css = ""; if(css.length > 0) { rte_css = css; } else{ rte_css = cssFile; } document.writeln('<span class="rteDiv">'); if(buttons) { document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons1_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); insertBar(); document.writeln('<td><select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:105px;height:20px;margin:1px;">'); document.writeln(lblFormat); document.writeln('</select></td><td>'); document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id)" style="font-size:14px;width:125px;height:20px;margin:1px;">'); document.writeln(lblFont); document.writeln('</select></td><td>'); document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:75px;height:20px;margin:1px;">'); document.writeln(lblSize); document.writeln('</select>'); insertSep(); if(isIE){ insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')"); insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')"); insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')"); } insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')"); insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')"); insertSep(); insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')"); insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')"); insertSep(); insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')"); insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')"); insertSep(); insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')"); insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')"); if(isIE)insertImg(lblSpellCheck,"spellcheck.gif","checkspell()"); document.writeln('</td>'); if(tablewidth < iconWrapWidth){ document.writeln('<td width="100%"></td></tr></tbody></table>'); document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); } insertBar(); insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')"); insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')"); insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')"); insertSep(); insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')"); insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')"); insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')"); insertSep(); insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')"); insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')"); insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')"); insertSep(); insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')"); insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')"); insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')"); insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')"); insertSep(); insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte); insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte); insertSep(); insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')"); insertSep(); insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')"); insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')"); insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')"); insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')"); document.writeln('<td width="100%"></td></tr></tbody></table>'); } document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); if(!readOnly){ document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>'); document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap="nowrap"><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="txtSrc'+rte+'" style="font-family:sans-serif;font-size:12px;color:#555555;CURSOR: default;">'+lblModeHTML+'</span></td>'); document.writeln('<td width="100%" nowrap> </td></tr></table>'); } document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>'); document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">'); if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); document.writeln('</span>'); document.getElementById('hdn'+rte).value = html; enableDesignMode(rte, html, rte_css, readOnly); }} |
fullscreen = false; iconWrapWidth = iconWrapWidth-25; if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } | var tablewidth = width + 4; } | function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { if(isRichText){ currentRTE = rte; if(allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; // CM 06/04/05 stops single quotes from messing everything up html=replaceIt(html,'\'','''); // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations if (arguments.length == 6) { fullscreen = false; readOnly = buttons; buttons = height; height = width; width = css; css = ""; } var iconWrapWidth = wrapWidth; if(readOnly) buttons = false; if(fullscreen) { readOnly = false; // fullscreen is not readOnly and must show buttons buttons = true; // resize rte on resize if the option resize_fullsrcreen = true. if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; //adjust maximum table widths findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } var tablewidth = width; } else{ fullscreen = false; iconWrapWidth = iconWrapWidth-25; //adjust minimum table widths if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } var rte_css = ""; if(css.length > 0) { rte_css = css; } else{ rte_css = cssFile; } document.writeln('<span class="rteDiv">'); if(buttons) { document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons1_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); insertBar(); document.writeln('<td><select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:105px;height:20px;margin:1px;">'); document.writeln(lblFormat); document.writeln('</select></td><td>'); document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id)" style="font-size:14px;width:125px;height:20px;margin:1px;">'); document.writeln(lblFont); document.writeln('</select></td><td>'); document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:75px;height:20px;margin:1px;">'); document.writeln(lblSize); document.writeln('</select>'); insertSep(); if(isIE){ insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')"); insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')"); insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')"); } insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')"); insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')"); insertSep(); insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')"); insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')"); insertSep(); insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')"); insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')"); insertSep(); insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')"); insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')"); if(isIE)insertImg(lblSpellCheck,"spellcheck.gif","checkspell()"); document.writeln('</td>'); if(tablewidth < iconWrapWidth){ document.writeln('<td width="100%"></td></tr></tbody></table>'); document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); } insertBar(); insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')"); insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')"); insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')"); insertSep(); insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')"); insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')"); insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')"); insertSep(); insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')"); insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')"); insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')"); insertSep(); insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')"); insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')"); insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')"); insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')"); insertSep(); insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte); insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte); insertSep(); insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')"); insertSep(); insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')"); insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')"); insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')"); insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')"); document.writeln('<td width="100%"></td></tr></tbody></table>'); } document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); if(!readOnly){ document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>'); document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap="nowrap"><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="txtSrc'+rte+'" style="font-family:sans-serif;font-size:12px;color:#555555;CURSOR: default;">'+lblModeHTML+'</span></td>'); document.writeln('<td width="100%" nowrap> </td></tr></table>'); } document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>'); document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">'); if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); document.writeln('</span>'); document.getElementById('hdn'+rte).value = html; enableDesignMode(rte, html, rte_css, readOnly); }} |
document.writeln('<span class="rteDiv">'); | document.writeln('<span id="rteToolbar">'); | function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { if(isRichText){ currentRTE = rte; if(allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; // CM 06/04/05 stops single quotes from messing everything up html=replaceIt(html,'\'','''); // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations if (arguments.length == 6) { fullscreen = false; readOnly = buttons; buttons = height; height = width; width = css; css = ""; } var iconWrapWidth = wrapWidth; if(readOnly) buttons = false; if(fullscreen) { readOnly = false; // fullscreen is not readOnly and must show buttons buttons = true; // resize rte on resize if the option resize_fullsrcreen = true. if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; //adjust maximum table widths findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } var tablewidth = width; } else{ fullscreen = false; iconWrapWidth = iconWrapWidth-25; //adjust minimum table widths if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } var rte_css = ""; if(css.length > 0) { rte_css = css; } else{ rte_css = cssFile; } document.writeln('<span class="rteDiv">'); if(buttons) { document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons1_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); insertBar(); document.writeln('<td><select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:105px;height:20px;margin:1px;">'); document.writeln(lblFormat); document.writeln('</select></td><td>'); document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id)" style="font-size:14px;width:125px;height:20px;margin:1px;">'); document.writeln(lblFont); document.writeln('</select></td><td>'); document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:75px;height:20px;margin:1px;">'); document.writeln(lblSize); document.writeln('</select>'); insertSep(); if(isIE){ insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')"); insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')"); insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')"); } insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')"); insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')"); insertSep(); insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')"); insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')"); insertSep(); insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')"); insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')"); insertSep(); insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')"); insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')"); if(isIE)insertImg(lblSpellCheck,"spellcheck.gif","checkspell()"); document.writeln('</td>'); if(tablewidth < iconWrapWidth){ document.writeln('<td width="100%"></td></tr></tbody></table>'); document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); } insertBar(); insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')"); insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')"); insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')"); insertSep(); insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')"); insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')"); insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')"); insertSep(); insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')"); insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')"); insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')"); insertSep(); insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')"); insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')"); insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')"); insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')"); insertSep(); insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte); insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte); insertSep(); insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')"); insertSep(); insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')"); insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')"); insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')"); insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')"); document.writeln('<td width="100%"></td></tr></tbody></table>'); } document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); if(!readOnly){ document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>'); document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap="nowrap"><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="txtSrc'+rte+'" style="font-family:sans-serif;font-size:12px;color:#555555;CURSOR: default;">'+lblModeHTML+'</span></td>'); document.writeln('<td width="100%" nowrap> </td></tr></table>'); } document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>'); document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">'); if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); document.writeln('</span>'); document.getElementById('hdn'+rte).value = html; enableDesignMode(rte, html, rte_css, readOnly); }} |
insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); | insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifycenter')"); | function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { if(isRichText){ currentRTE = rte; if(allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; // CM 06/04/05 stops single quotes from messing everything up html=replaceIt(html,'\'','''); // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations if (arguments.length == 6) { fullscreen = false; readOnly = buttons; buttons = height; height = width; width = css; css = ""; } var iconWrapWidth = wrapWidth; if(readOnly) buttons = false; if(fullscreen) { readOnly = false; // fullscreen is not readOnly and must show buttons buttons = true; // resize rte on resize if the option resize_fullsrcreen = true. if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; //adjust maximum table widths findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } var tablewidth = width; } else{ fullscreen = false; iconWrapWidth = iconWrapWidth-25; //adjust minimum table widths if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } var rte_css = ""; if(css.length > 0) { rte_css = css; } else{ rte_css = cssFile; } document.writeln('<span class="rteDiv">'); if(buttons) { document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons1_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); insertBar(); document.writeln('<td><select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:105px;height:20px;margin:1px;">'); document.writeln(lblFormat); document.writeln('</select></td><td>'); document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id)" style="font-size:14px;width:125px;height:20px;margin:1px;">'); document.writeln(lblFont); document.writeln('</select></td><td>'); document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:75px;height:20px;margin:1px;">'); document.writeln(lblSize); document.writeln('</select>'); insertSep(); if(isIE){ insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')"); insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')"); insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')"); } insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')"); insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')"); insertSep(); insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')"); insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')"); insertSep(); insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')"); insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')"); insertSep(); insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')"); insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')"); if(isIE)insertImg(lblSpellCheck,"spellcheck.gif","checkspell()"); document.writeln('</td>'); if(tablewidth < iconWrapWidth){ document.writeln('<td width="100%"></td></tr></tbody></table>'); document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); } insertBar(); insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')"); insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')"); insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')"); insertSep(); insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')"); insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')"); insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')"); insertSep(); insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')"); insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')"); insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')"); insertSep(); insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')"); insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')"); insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')"); insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')"); insertSep(); insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte); insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte); insertSep(); insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')"); insertSep(); insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')"); insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')"); insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')"); insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')"); document.writeln('<td width="100%"></td></tr></tbody></table>'); } document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); if(!readOnly){ document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>'); document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap="nowrap"><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="txtSrc'+rte+'" style="font-family:sans-serif;font-size:12px;color:#555555;CURSOR: default;">'+lblModeHTML+'</span></td>'); document.writeln('<td width="100%" nowrap> </td></tr></table>'); } document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>'); document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">'); if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); document.writeln('</span>'); document.getElementById('hdn'+rte).value = html; enableDesignMode(rte, html, rte_css, readOnly); }} |
document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); | document.writeln('<iframe id="'+rte+'" width="' + (tablewidth - 2) + 'px" height="' + height + 'px" frameborder=0 style="border: 1px solid #d2d2d2" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); | function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { if(isRichText){ currentRTE = rte; if(allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; // CM 06/04/05 stops single quotes from messing everything up html=replaceIt(html,'\'','''); // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations if (arguments.length == 6) { fullscreen = false; readOnly = buttons; buttons = height; height = width; width = css; css = ""; } var iconWrapWidth = wrapWidth; if(readOnly) buttons = false; if(fullscreen) { readOnly = false; // fullscreen is not readOnly and must show buttons buttons = true; // resize rte on resize if the option resize_fullsrcreen = true. if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; //adjust maximum table widths findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } var tablewidth = width; } else{ fullscreen = false; iconWrapWidth = iconWrapWidth-25; //adjust minimum table widths if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } var rte_css = ""; if(css.length > 0) { rte_css = css; } else{ rte_css = cssFile; } document.writeln('<span class="rteDiv">'); if(buttons) { document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons1_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); insertBar(); document.writeln('<td><select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:105px;height:20px;margin:1px;">'); document.writeln(lblFormat); document.writeln('</select></td><td>'); document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id)" style="font-size:14px;width:125px;height:20px;margin:1px;">'); document.writeln(lblFont); document.writeln('</select></td><td>'); document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:75px;height:20px;margin:1px;">'); document.writeln(lblSize); document.writeln('</select>'); insertSep(); if(isIE){ insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')"); insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')"); insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')"); } insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')"); insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')"); insertSep(); insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')"); insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')"); insertSep(); insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')"); insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')"); insertSep(); insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')"); insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')"); if(isIE)insertImg(lblSpellCheck,"spellcheck.gif","checkspell()"); document.writeln('</td>'); if(tablewidth < iconWrapWidth){ document.writeln('<td width="100%"></td></tr></tbody></table>'); document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); } insertBar(); insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')"); insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')"); insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')"); insertSep(); insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')"); insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')"); insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')"); insertSep(); insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')"); insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')"); insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')"); insertSep(); insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')"); insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')"); insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')"); insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')"); insertSep(); insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte); insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte); insertSep(); insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')"); insertSep(); insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')"); insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')"); insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')"); insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')"); document.writeln('<td width="100%"></td></tr></tbody></table>'); } document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); if(!readOnly){ document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>'); document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap="nowrap"><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="txtSrc'+rte+'" style="font-family:sans-serif;font-size:12px;color:#555555;CURSOR: default;">'+lblModeHTML+'</span></td>'); document.writeln('<td width="100%" nowrap> </td></tr></table>'); } document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>'); document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">'); if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); document.writeln('</span>'); document.getElementById('hdn'+rte).value = html; enableDesignMode(rte, html, rte_css, readOnly); }} |
if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); | document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); | function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) { if(isRichText){ currentRTE = rte; if(allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; // CM 06/04/05 stops single quotes from messing everything up html=replaceIt(html,'\'','''); // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations if (arguments.length == 6) { fullscreen = false; readOnly = buttons; buttons = height; height = width; width = css; css = ""; } var iconWrapWidth = wrapWidth; if(readOnly) buttons = false; if(fullscreen) { readOnly = false; // fullscreen is not readOnly and must show buttons buttons = true; // resize rte on resize if the option resize_fullsrcreen = true. if(resize_fullsrcreen) window.onresize = resizeRTE; document.body.style.margin = "0px"; document.body.style.overflow = "hidden"; //adjust maximum table widths findSize(""); width = obj_width; if(width < iconWrapWidth) { height = (obj_height - 83); } else{ height = (obj_height - 55); } if (width < minWidth){ document.body.style.overflow = "auto"; if(isIE){ height = obj_height-22; } else{ height = obj_height-24; } width = minWidth; } var tablewidth = width; } else{ fullscreen = false; iconWrapWidth = iconWrapWidth-25; //adjust minimum table widths if (buttons && (width < minWidth)) width = minWidth; if(isIE){ var tablewidth = width; } else{ var tablewidth = width + 4; } } var rte_css = ""; if(css.length > 0) { rte_css = css; } else{ rte_css = cssFile; } document.writeln('<span class="rteDiv">'); if(buttons) { document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons1_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); insertBar(); document.writeln('<td><select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:105px;height:20px;margin:1px;">'); document.writeln(lblFormat); document.writeln('</select></td><td>'); document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id)" style="font-size:14px;width:125px;height:20px;margin:1px;">'); document.writeln(lblFont); document.writeln('</select></td><td>'); document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);" style="font-size:14px;width:75px;height:20px;margin:1px;">'); document.writeln(lblSize); document.writeln('</select>'); insertSep(); if(isIE){ insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')"); insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')"); insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')"); } insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')"); insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')"); insertSep(); insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')"); insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')"); insertSep(); insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')"); insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')"); insertSep(); insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')"); insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')"); if(isIE)insertImg(lblSpellCheck,"spellcheck.gif","checkspell()"); document.writeln('</td>'); if(tablewidth < iconWrapWidth){ document.writeln('<td width="100%"></td></tr></tbody></table>'); document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">'); document.writeln('<tbody><tr>'); } insertBar(); insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')"); insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')"); insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')"); insertSep(); insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')"); insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')"); insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')"); insertSep(); insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')"); insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifcenter')"); insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')"); insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')"); insertSep(); insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')"); insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')"); insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')"); insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')"); insertSep(); insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte); insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte); insertSep(); insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')"); insertSep(); insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')"); insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')"); insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')"); insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')"); document.writeln('<td width="100%"></td></tr></tbody></table>'); } document.writeln('<iframe id="'+rte+'" frameborder="0" style="border: 1px solid #d2d2d2; width: ' + (tablewidth - 2) + 'px; height: ' + height + 'px;" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>'); if(!readOnly){ document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>'); document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap="nowrap"><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="txtSrc'+rte+'" style="font-family:sans-serif;font-size:12px;color:#555555;CURSOR: default;">'+lblModeHTML+'</span></td>'); document.writeln('<td width="100%" nowrap> </td></tr></table>'); } document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>'); document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">'); if(!fullscreen) document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">'); document.writeln('</span>'); document.getElementById('hdn'+rte).value = html; enableDesignMode(rte, html, rte_css, readOnly); }} |
'Content-Type: text/html; charset=' + this.characterSet + '\n' + | writeToFolder: function() { debug(this.identity + " writing to message folder" + this.feed.name + "\n"); var server = this.feed.server; this.mUnicodeConverter.charset = this.characterSet; // If the sender isn't a valid email address, quote it so it looks nicer. if (this.author && this.author.indexOf('@') == -1) this.author = '<' + this.author + '>'; // Convert the title to UTF-16 before performing our HTML entity replacement // reg expressions. var title = this.title; // the subject may contain HTML entities. // Convert these to their unencoded state. i.e. & becomes '&' title = title.replace(/</g, '<'); title = title.replace(/>/g, '>'); title = title.replace(/&/g, '&'); title = title.replace(/"/g, '"'); // Compress white space in the subject to make it look better. title = title.replace(/[\t\r\n]+/g, " "); this.title = this.mimeEncodeSubject(title, this.characterSet); // If the date looks like it's in W3C-DTF format, convert it into // an IETF standard date. Otherwise assume it's in IETF format. if (this.mDate.search(/^\d\d\d\d/) != -1) this.mDate = W3CToIETFDate(this.mDate); // Escape occurrences of "From " at the beginning of lines of content // per the mbox standard, since "From " denotes a new message, and add // a line break so we know the last line has one. this.content = this.content.replace(/([\r\n]+)(>*From )/g, "$1>$2"); this.content += "\n"; // The opening line of the message, mandated by standards to start with // "From ". It's useful to construct this separately because we not only // need to write it into the message, we also need to use it to calculate // the offset of the X-Mozilla-Status lines from the front of the message // for the statusOffset property of the DB header object. var openingLine = 'From - ' + this.mDate + '\n'; var source = openingLine + 'X-Mozilla-Status: 0000\n' + 'X-Mozilla-Status2: 00000000\n' + 'Date: ' + this.mDate + '\n' + 'Message-Id: <' + this.messageID + '>\n' + 'From: ' + this.author + '\n' + 'MIME-Version: 1.0\n' + 'Subject: ' + this.title + '\n' + 'Content-Type: text/html; charset=' + this.characterSet + '\n' + 'Content-Transfer-Encoding: 8bit\n' + 'Content-Base: ' + this.mURL + '\n' + '\n' + this.content; debug(this.identity + " is " + source.length + " characters long"); // Get the folder and database storing the feed's messages and headers. folder = this.feed.folder.QueryInterface(Components.interfaces.nsIMsgLocalMailFolder); // source is a unicode string, we want to save a char * string in the original charset. So convert back folder.addMessage(this.mUnicodeConverter.ConvertFromUnicode(source)); this.markStored(); } |
|
'Content-Base: ' + this.mURL + '\n' + '\n' + this.content; | 'Content-Base: ' + this.mURL + '\n'; if (this.enclosure && this.enclosure.mFileName) { var boundaryID = source.length + this.enclosure.mLength; source += 'Content-Type: multipart/mixed;\n boundary="' + ENCLOSURE_HEADER_BOUNDARY_PREFIX + boundaryID + '"' + '\n\n' + 'This is a multi-part message in MIME format.\n' + ENCLOSURE_BOUNDARY_PREFIX + boundaryID + '\n' + 'Content-Type: text/html; charset=' + + this.characterSet + '\n' + 'Content-Transfer-Encoding: 8bit\n' + this.content; source += this.enclosure.convertToAttachment(boundaryID); } else { source += 'Content-Type: text/html; charset=' + this.characterSet + '\n' + '\n' + this.content; } | writeToFolder: function() { debug(this.identity + " writing to message folder" + this.feed.name + "\n"); var server = this.feed.server; this.mUnicodeConverter.charset = this.characterSet; // If the sender isn't a valid email address, quote it so it looks nicer. if (this.author && this.author.indexOf('@') == -1) this.author = '<' + this.author + '>'; // Convert the title to UTF-16 before performing our HTML entity replacement // reg expressions. var title = this.title; // the subject may contain HTML entities. // Convert these to their unencoded state. i.e. & becomes '&' title = title.replace(/</g, '<'); title = title.replace(/>/g, '>'); title = title.replace(/&/g, '&'); title = title.replace(/"/g, '"'); // Compress white space in the subject to make it look better. title = title.replace(/[\t\r\n]+/g, " "); this.title = this.mimeEncodeSubject(title, this.characterSet); // If the date looks like it's in W3C-DTF format, convert it into // an IETF standard date. Otherwise assume it's in IETF format. if (this.mDate.search(/^\d\d\d\d/) != -1) this.mDate = W3CToIETFDate(this.mDate); // Escape occurrences of "From " at the beginning of lines of content // per the mbox standard, since "From " denotes a new message, and add // a line break so we know the last line has one. this.content = this.content.replace(/([\r\n]+)(>*From )/g, "$1>$2"); this.content += "\n"; // The opening line of the message, mandated by standards to start with // "From ". It's useful to construct this separately because we not only // need to write it into the message, we also need to use it to calculate // the offset of the X-Mozilla-Status lines from the front of the message // for the statusOffset property of the DB header object. var openingLine = 'From - ' + this.mDate + '\n'; var source = openingLine + 'X-Mozilla-Status: 0000\n' + 'X-Mozilla-Status2: 00000000\n' + 'Date: ' + this.mDate + '\n' + 'Message-Id: <' + this.messageID + '>\n' + 'From: ' + this.author + '\n' + 'MIME-Version: 1.0\n' + 'Subject: ' + this.title + '\n' + 'Content-Type: text/html; charset=' + this.characterSet + '\n' + 'Content-Transfer-Encoding: 8bit\n' + 'Content-Base: ' + this.mURL + '\n' + '\n' + this.content; debug(this.identity + " is " + source.length + " characters long"); // Get the folder and database storing the feed's messages and headers. folder = this.feed.folder.QueryInterface(Components.interfaces.nsIMsgLocalMailFolder); // source is a unicode string, we want to save a char * string in the original charset. So convert back folder.addMessage(this.mUnicodeConverter.ConvertFromUnicode(source)); this.markStored(); } |
var folder = this.feed.folder ? this.feed.folder : server.rootMsgFolder.getChildNamed(this.feed.name); folder = folder.QueryInterface(Components.interfaces.nsIMsgLocalMailFolder); | folder = this.feed.folder.QueryInterface(Components.interfaces.nsIMsgLocalMailFolder); | writeToFolder: function() { debug(this.identity + " writing to message folder" + this.feed.name + "\n"); var server = this.feed.server; this.mUnicodeConverter.charset = this.characterSet; // If the sender isn't a valid email address, quote it so it looks nicer. if (this.author && this.author.indexOf('@') == -1) this.author = '<' + this.author + '>'; // Convert the title to UTF-16 before performing our HTML entity replacement // reg expressions. var title = this.title; // the subject may contain HTML entities. // Convert these to their unencoded state. i.e. & becomes '&' title = title.replace(/</g, '<'); title = title.replace(/>/g, '>'); title = title.replace(/&/g, '&'); title = title.replace(/"/g, '"'); // Compress white space in the subject to make it look better. title = title.replace(/[\t\r\n]+/g, " "); this.title = this.mimeEncodeSubject(title, this.characterSet); // If the date looks like it's in W3C-DTF format, convert it into // an IETF standard date. Otherwise assume it's in IETF format. if (this.mDate.search(/^\d\d\d\d/) != -1) this.mDate = W3CToIETFDate(this.mDate); // Escape occurrences of "From " at the beginning of lines of content // per the mbox standard, since "From " denotes a new message, and add // a line break so we know the last line has one. this.content = this.content.replace(/([\r\n]+)(>*From )/g, "$1>$2"); this.content += "\n"; // The opening line of the message, mandated by standards to start with // "From ". It's useful to construct this separately because we not only // need to write it into the message, we also need to use it to calculate // the offset of the X-Mozilla-Status lines from the front of the message // for the statusOffset property of the DB header object. var openingLine = 'From - ' + this.mDate + '\n'; var source = openingLine + 'X-Mozilla-Status: 0000\n' + 'X-Mozilla-Status2: 00000000\n' + 'Date: ' + this.mDate + '\n' + 'Message-Id: <' + this.mMessageID + '>\n' + 'From: ' + this.author + '\n' + 'MIME-Version: 1.0\n' + 'Subject: ' + this.title + '\n' + 'Content-Type: text/html; charset=' + this.characterSet + '\n' + 'Content-Transfer-Encoding: 8bit\n' + 'Content-Base: ' + this.mURL + '\n' + '\n' + this.content; debug(this.identity + " is " + source.length + " characters long"); // Get the folder and database storing the feed's messages and headers. var folder = this.feed.folder ? this.feed.folder : server.rootMsgFolder.getChildNamed(this.feed.name); folder = folder.QueryInterface(Components.interfaces.nsIMsgLocalMailFolder); // source is a unicode string, we want to save a char * string in the original charset. So convert back folder.addMessage(this.mUnicodeConverter.ConvertFromUnicode(source)); this.markStored(); } |
this.feed.folder.gettingNewMessages = false; | writeToFolder: function() { debug(this.identity + " writing to message folder" + this.feed.name + "\n"); var server = this.feed.server; this.mUnicodeConverter.charset = this.characterSet; // If the sender isn't a valid email address, quote it so it looks nicer. if (this.author && this.author.indexOf('@') == -1) this.author = '<' + this.author + '>'; // Convert the title to UTF-16 before performing our HTML entity replacement // reg expressions. var title = this.title; // the subject may contain HTML entities. // Convert these to their unencoded state. i.e. & becomes '&' title = title.replace(/</g, '<'); title = title.replace(/>/g, '>'); title = title.replace(/"/g, '"'); title = title.replace(/&/g, '&'); // Compress white space in the subject to make it look better. title = title.replace(/[\t\r\n]+/g, " "); this.title = this.mimeEncodeSubject(title, this.characterSet); // If the date looks like it's in W3C-DTF format, convert it into // an IETF standard date. Otherwise assume it's in IETF format. if (this.mDate.search(/^\d\d\d\d/) != -1) this.mDate = W3CToIETFDate(this.mDate); // Escape occurrences of "From " at the beginning of lines of content // per the mbox standard, since "From " denotes a new message, and add // a line break so we know the last line has one. this.content = this.content.replace(/([\r\n]+)(>*From )/g, "$1>$2"); this.content += "\n"; // The opening line of the message, mandated by standards to start with // "From ". It's useful to construct this separately because we not only // need to write it into the message, we also need to use it to calculate // the offset of the X-Mozilla-Status lines from the front of the message // for the statusOffset property of the DB header object. var openingLine = 'From - ' + this.mDate + '\n'; var source = openingLine + 'X-Mozilla-Status: 0000\n' + 'X-Mozilla-Status2: 00000000\n' + 'X-Mozilla-Keys: \n' + 'Date: ' + this.mDate + '\n' + 'Message-Id: <' + this.messageID + '>\n' + 'From: ' + this.author + '\n' + 'MIME-Version: 1.0\n' + 'Subject: ' + this.title + '\n' + 'Content-Transfer-Encoding: 8bit\n' + 'Content-Base: ' + this.mURL + '\n'; if (this.enclosure && this.enclosure.mFileName) { var boundaryID = source.length + this.enclosure.mLength; source += 'Content-Type: multipart/mixed;\n boundary="' + ENCLOSURE_HEADER_BOUNDARY_PREFIX + boundaryID + '"' + '\n\n' + 'This is a multi-part message in MIME format.\n' + ENCLOSURE_BOUNDARY_PREFIX + boundaryID + '\n' + 'Content-Type: text/html; charset=' + this.characterSet + '\n' + 'Content-Transfer-Encoding: 8bit\n' + this.content; source += this.enclosure.convertToAttachment(boundaryID); } else { source += 'Content-Type: text/html; charset=' + this.characterSet + '\n' + '\n' + this.content; } debug(this.identity + " is " + source.length + " characters long"); // Get the folder and database storing the feed's messages and headers. folder = this.feed.folder.QueryInterface(Components.interfaces.nsIMsgLocalMailFolder); // source is a unicode string, we want to save a char * string in the original charset. So convert back folder.addMessage(this.mUnicodeConverter.ConvertFromUnicode(source)); this.markStored(); } |
|
else{if(xajax.responseErrorsForAlert.containsValue(r.status)){var errorString="Error: the server returned the following HTTP status: "+r.status;errorString+="\nReceived:\n"+r.responseText;alert(errorString);} | else{if(ArrayContainsValue(xajax.responseErrorsForAlert,r.status)){var errorString="Error: the server returned the following HTTP status: "+r.status;errorString+="\nReceived:\n"+r.responseText;alert(errorString);} | function Xajax(){this.DebugMessage=function(text){if(text.length > 1000)text=text.substr(0,1000)+"...\n[long response]\n...";try{if(this.debugWindow==undefined||this.debugWindow.closed==true){this.debugWindow=window.open('about:blank','xajax-debug','width=800,height=600,scrollbars=1,resizable,status');this.debugWindow.document.write('<html><head><title>Xajax debug output</title></head><body><h2>Xajax debug output</h2><div id="debugTag"></div></body></html>');}text=text.replace(/&/g,"&")text=text.replace(/</g,"<")text=text.replace(/>/g,">")debugTag=this.debugWindow.document.getElementById('debugTag');debugTag.innerHTML=('<b>'+(new Date()).toString()+'</b>: '+text+'<hr/>')+debugTag.innerHTML;}catch(e){alert("Xajax Debug:\n "+text);}};this.workId='xajaxWork'+new Date().getTime();this.depth=0;this.responseErrorsForAlert=["400","401","402","403","404","500","501","502","503"];this.getRequestObject=function(){if(xajaxDebug)this.DebugMessage("Initializing Request Object..");var req=null;if(typeof XMLHttpRequest!="undefined")req=new XMLHttpRequest();if(!req&&typeof ActiveXObject!="undefined"){try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){try{req=new ActiveXObject("Msxml2.XMLHTTP.4.0");}catch(e3){req=null;}}}}if(!req&&window.createRequest)req=window.createRequest();if(!req)this.DebugMessage("Request Object Instantiation failed.");return req;}this.$=function(sId){if(!sId){return null;}var returnObj=document.getElementById(sId);if(!returnObj&&document.all){returnObj=document.all[sId];}if(xajaxDebug&&!returnObj&&sId!=this.workId){this.DebugMessage("Element with the id \""+sId+"\" not found.");}return returnObj;}this.include=function(sFileName){var objHead=document.getElementsByTagName('head');var objScript=document.createElement('script');objScript.type='text/javascript';objScript.src=sFileName;objHead[0].appendChild(objScript);}this.stripOnPrefix=function(sEventName){sEventName=sEventName.toLowerCase();if(sEventName.indexOf('on')==0){sEventName=sEventName.replace(/on/,'');}return sEventName;}this.addOnPrefix=function(sEventName){sEventName=sEventName.toLowerCase();if(sEventName.indexOf('on')!=0){sEventName='on'+sEventName;}return sEventName;}this.addHandler=function(sElementId,sEvent,sFunctionName){if(window.addEventListener){sEvent=this.stripOnPrefix(sEvent);eval("this.$('"+sElementId+"').addEventListener('"+sEvent+"',"+sFunctionName+",false);");}else{sAltEvent=this.addOnPrefix(sEvent);eval("this.$('"+sElementId+"').attachEvent('"+sAltEvent+"',"+sFunctionName+",false);");}}this.removeHandler=function(sElementId,sEvent,sFunctionName){if(window.addEventListener){sEvent=this.stripOnPrefix(sEvent);eval("this.$('"+sElementId+"').removeEventListener('"+sEvent+"',"+sFunctionName+",false);");}else{sAltEvent=this.addOnPrefix(sEvent);eval("this.$('"+sElementId+"').detachEvent('"+sAltEvent+"',"+sFunctionName+",false);");}}this.create=function(sParentId,sTag,sId){var objParent=this.$(sParentId);objElement=document.createElement(sTag);objElement.setAttribute('id',sId);if(objParent)objParent.appendChild(objElement);}this.insert=function(sBeforeId,sTag,sId){var objSibling=this.$(sBeforeId);objElement=document.createElement(sTag);objElement.setAttribute('id',sId);objSibling.parentNode.insertBefore(objElement,objSibling);}this.insertAfter=function(sAfterId,sTag,sId){var objSibling=this.$(sAfterId);objElement=document.createElement(sTag);objElement.setAttribute('id',sId);objSibling.parentNode.insertBefore(objElement,objSibling.nextSibling);}this.getInput=function(sType,sName,sId){var Obj;if(!window.addEventListener){Obj=document.createElement('<input type="'+sType+'" id="'+sId+'" name="'+sName+'">');}else{Obj=document.createElement('input');Obj.setAttribute('type',sType);Obj.setAttribute('name',sName);Obj.setAttribute('id',sId);}return Obj;}this.createInput=function(sParentId,sType,sName,sId){var objParent=this.$(sParentId);var objElement=this.getInput(sType,sName,sId);if(objParent&&objElement)objParent.appendChild(objElement);}this.insertInput=function(sBeforeId,sType,sName,sId){var objSibling=this.$(sBeforeId);var objElement=this.getInput(sType,sName,sId);if(objElement&&objSibling&&objSibling.parentNode)objSibling.parentNode.insertBefore(objElement,objSibling);}this.insertInputAfter=function(sAfterId,sType,sName,sId){var objSibling=this.$(sAfterId);var objElement=this.getInput(sType,sName,sId);if(objElement&&objSibling&&objSibling.parentNode){objSibling.parentNode.insertBefore(objElement,objSibling.nextSibling);}}this.remove=function(sId){objElement=this.$(sId);if(objElement&&objElement.parentNode&&objElement.parentNode.removeChild){objElement.parentNode.removeChild(objElement);}}this.replace=function(sId,sAttribute,sSearch,sReplace){var bFunction=false;if(sAttribute=="innerHTML")sSearch=this.getBrowserHTML(sSearch);eval("var txt=this.$('"+sId+"')."+sAttribute);if(typeof txt=="function"){txt=txt.toString();bFunction=true;}if(txt.indexOf(sSearch)>-1){var newTxt='';while(txt.indexOf(sSearch)>-1){x=txt.indexOf(sSearch)+sSearch.length+1;newTxt+=txt.substr(0,x).replace(sSearch,sReplace);txt=txt.substr(x,txt.length-x);}newTxt+=txt;if(bFunction){eval('this.$("'+sId+'").'+sAttribute+'=newTxt;');}else if(this.willChange(sId,sAttribute,newTxt)){eval('this.$("'+sId+'").'+sAttribute+'=newTxt;');}}}this.getFormValues=function(frm){var objForm;var submitDisabledElements=false;if(arguments.length > 1&&arguments[1]==true)submitDisabledElements=true;var prefix="";if(arguments.length > 2)prefix=arguments[2];if(typeof(frm)=="string")objForm=this.$(frm);elseobjForm=frm;var sXml="<xjxquery><q>";if(objForm&&objForm.tagName=='FORM'){var formElements=objForm.elements;for(var i=0;i < formElements.length;i++){if(!formElements[i].name)continue;if(formElements[i].name.substring(0,prefix.length)!=prefix)continue;if(formElements[i].type&&(formElements[i].type=='radio'||formElements[i].type=='checkbox')&&formElements[i].checked==false)continue;if(formElements[i].disabled&&formElements[i].disabled==true&&submitDisabledElements==false)continue;var name=formElements[i].name;if(name){if(sXml!='<xjxquery><q>')sXml+='&';if(formElements[i].type=='select-multiple'){for(var j=0;j < formElements[i].length;j++){if(formElements[i].options[j].selected==true)sXml+=name+"="+encodeURIComponent(formElements[i].options[j].value)+"&";}}else{sXml+=name+"="+encodeURIComponent(formElements[i].value);}}}}sXml+="</q></xjxquery>";return sXml;}this.objectToXML=function(obj){var sXml="<xjxobj>";for(i in obj){try{if(i=='constructor')continue;if(obj[i]&&typeof(obj[i])=='function')continue;var key=i;var value=obj[i];if(value&&typeof(value)=="object"&&this.depth <=50){this.depth++;value=this.objectToXML(value);this.depth--;}sXml+="<e><k>"+key+"</k><v>"+value+"</v></e>";}catch(e){if(xajaxDebug)this.DebugMessage(e.name+": "+e.message);}}sXml+="</xjxobj>";return sXml;}this._nodeToObject=function(node){if(node.nodeName=='#cdata-section'){var data="";for(var j=0;j<node.parentNode.childNodes.length;j++){data+=node.parentNode.childNodes[j].data;}return data;}else if(node.nodeName=='xjxobj'){var data=new Array();for(var j=0;j<node.childNodes.length;j++){var child=node.childNodes[j];var key;var value;if(child.nodeName=='e'){for(var k=0;k<child.childNodes.length;k++){if(child.childNodes[k].nodeName=='k'){key=child.childNodes[k].firstChild.data;}else if(child.childNodes[k].nodeName=='v'){value=this._nodeToObject(child.childNodes[k].firstChild);}}if(key!=null&&value!=null){data[key]=value;key=value=null;}}}return data;}}this.loadingFunction=function(){};this.doneLoadingFunction=function(){};var loadingTimeout;this.call=function(sFunction,aArgs,sRequestType){var i,r,postData;if(document.body&&xajaxWaitCursor)document.body.style.cursor='wait';if(xajaxStatusMessages==true)window.status='Sending Request...';clearTimeout(loadingTimeout);loadingTimeout=setTimeout("xajax.loadingFunction();",400);if(xajaxDebug)this.DebugMessage("Starting xajax...");if(sRequestType==null){var xajaxRequestType=xajaxDefinedPost;}else{var xajaxRequestType=sRequestType;}var uri=xajaxRequestUri;var value;switch(xajaxRequestType){case xajaxDefinedGet:{var uriGet=uri.indexOf("?")==-1?"?xajax="+encodeURIComponent(sFunction):"&xajax="+encodeURIComponent(sFunction);if(aArgs){for(i=0;i<aArgs.length;i++){value=aArgs[i];if(typeof(value)=="object")value=this.objectToXML(value);uriGet+="&xajaxargs[]="+encodeURIComponent(value);}}uriGet+="&xajaxr="+new Date().getTime();uri+=uriGet;postData=null;}break;case xajaxDefinedPost:{postData="xajax="+encodeURIComponent(sFunction);postData+="&xajaxr="+new Date().getTime();if(aArgs){for(i=0;i <aArgs.length;i++){value=aArgs[i];if(typeof(value)=="object")value=this.objectToXML(value);postData=postData+"&xajaxargs[]="+encodeURIComponent(value);}}}break;default:alert("Illegal request type: "+xajaxRequestType);return false;break;}r=this.getRequestObject();if(!r)return false;r.open(xajaxRequestType==xajaxDefinedGet?"GET":"POST",uri,true);if(xajaxRequestType==xajaxDefinedPost){try{r.setRequestHeader("Method","POST "+uri+" HTTP/1.1");r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}catch(e){alert("Your browser does not appear to support asynchronous requests using POST.");return false;}}r.onreadystatechange=function(){if(r.readyState!=4)return;if(r.status==200){if(xajaxDebug)xajax.DebugMessage("Received:\n"+r.responseText);if(r.responseXML&&r.responseXML.documentElement)xajax.processResponse(r.responseXML);else{var errorString="Error: the XML response that was returned from the server is invalid.";errorString+="\nReceived:\n"+r.responseText;trimmedResponseText=r.responseText.replace(/^\s+/g,"");trimmedResponseText=trimmedResponseText.replace(/\s+$/g,"");if(trimmedResponseText!=r.responseText)errorString+="\nYou have whitespace in your response.";alert(errorString);document.body.style.cursor='default';if(xajaxStatusMessages==true)window.status='Invalid XML response error';}}else{if(xajax.responseErrorsForAlert.containsValue(r.status)){var errorString="Error: the server returned the following HTTP status: "+r.status;errorString+="\nReceived:\n"+r.responseText;alert(errorString);}document.body.style.cursor='default';if(xajaxStatusMessages==true)window.status='Invalid XML response error';}delete r;r=null;}if(xajaxDebug)this.DebugMessage("Calling "+sFunction+" uri="+uri+" (post:"+postData+")");r.send(postData);if(xajaxStatusMessages==true)window.status='Waiting for data...';delete r;return true;}this.getBrowserHTML=function(html){tmpXajax=this.$(this.workId);if(!tmpXajax){tmpXajax=document.createElement("div");tmpXajax.setAttribute('id',this.workId);tmpXajax.style.display="none";tmpXajax.style.visibility="hidden";document.body.appendChild(tmpXajax);}tmpXajax.innerHTML=html;var browserHTML=tmpXajax.innerHTML;tmpXajax.innerHTML='';return browserHTML;}this.willChange=function(element,attribute,newData){if(!document.body){return true;}if(attribute=="innerHTML"){newData=this.getBrowserHTML(newData);}elementObject=this.$(element);if(elementObject){var oldData;eval("oldData=this.$('"+element+"')."+attribute);if(newData!==oldData)return true;}return false;}this.viewSource=function(){return "<html>"+document.getElementsByTagName("HTML")[0].innerHTML+"</html>";}this.processResponse=function(xml){clearTimeout(loadingTimeout);this.doneLoadingFunction();if(xajaxStatusMessages==true)window.status='Processing...';var tmpXajax=null;xml=xml.documentElement;if(xml==null)return;var skipCommands=0;for(var i=0;i<xml.childNodes.length;i++){if(skipCommands > 0){skipCommands--;continue;}if(xml.childNodes[i].nodeName=="cmd"){var cmd;var id;var property;var data;var search;var type;var before;var objElement=null;for(var j=0;j<xml.childNodes[i].attributes.length;j++){if(xml.childNodes[i].attributes[j].name=="n"){cmd=xml.childNodes[i].attributes[j].value;}else if(xml.childNodes[i].attributes[j].name=="t"){id=xml.childNodes[i].attributes[j].value;}else if(xml.childNodes[i].attributes[j].name=="p"){property=xml.childNodes[i].attributes[j].value;}else if(xml.childNodes[i].attributes[j].name=="c"){type=xml.childNodes[i].attributes[j].value;}}if(xml.childNodes[i].childNodes.length > 1&&xml.childNodes[i].firstChild.nodeName=="#cdata-section"){data="";for(var j=0;j<xml.childNodes[i].childNodes.length;j++){data+=xml.childNodes[i].childNodes[j].data;}}else if(xml.childNodes[i].firstChild&&xml.childNodes[i].firstChild.nodeName=='xjxobj'){data=this._nodeToObject(xml.childNodes[i].firstChild);objElement="XJX_SKIP";}else if(xml.childNodes[i].childNodes.length > 1){for(var j=0;j<xml.childNodes[i].childNodes.length;j++){if(xml.childNodes[i].childNodes[j].childNodes.length > 1&&xml.childNodes[i].childNodes[j].firstChild.nodeName=="#cdata-section"){var internalData="";for(var k=0;k<xml.childNodes[i].childNodes[j].childNodes.length;k++){internalData+=xml.childNodes[i].childNodes[j].childNodes[k].nodeValue;}}else{var internalData=xml.childNodes[i].childNodes[j].firstChild.nodeValue;}if(xml.childNodes[i].childNodes[j].nodeName=="s"){search=internalData;}if(xml.childNodes[i].childNodes[j].nodeName=="r"){data=internalData;}}}else if(xml.childNodes[i].firstChild)data=xml.childNodes[i].firstChild.nodeValue;elsedata="";if(objElement!="XJX_SKIP")objElement=this.$(id);var cmdFullname;try{if(cmd=="cc"){cmdFullname="addConfirmCommands";var confirmResult=confirm(data);if(!confirmResult){skipCommands=id;}}if(cmd=="al"){cmdFullname="addAlert";alert(data);}else if(cmd=="js"){cmdFullname="addScript/addRedirect";eval(data);}else if(cmd=="jc"){cmdFullname="addScriptCall";var scr=id+'(';if(data[0]!=null){scr+='data[0]';for(var l=1;l<data.length;l++){scr+=',data['+l+']';}}scr+=');';eval(scr);}else if(cmd=="in"){cmdFullname="addIncludeScript";this.include(data);}else if(cmd=="as"){cmdFullname="addAssign/addClear";if(this.willChange(id,property,data)){eval("objElement."+property+"=data;");}}else if(cmd=="ap"){cmdFullname="addAppend";eval("objElement."+property+"+=data;");}else if(cmd=="pp"){cmdFullname="addPrepend";eval("objElement."+property+"=data+objElement."+property);}else if(cmd=="rp"){cmdFullname="addReplace";this.replace(id,property,search,data)}else if(cmd=="rm"){cmdFullname="addRemove";this.remove(id);}else if(cmd=="ce"){cmdFullname="addCreate";this.create(id,data,property);}else if(cmd=="ie"){cmdFullname="addInsert";this.insert(id,data,property);}else if(cmd=="ia"){cmdFullname="addInsertAfter";this.insertAfter(id,data,property);}else if(cmd=="ci"){cmdFullname="addCreateInput";this.createInput(id,type,data,property);}else if(cmd=="ii"){cmdFullname="addInsertInput";this.insertInput(id,type,data,property);}else if(cmd=="iia"){cmdFullname="addInsertInputAfter";this.insertInputAfter(id,type,data,property);}else if(cmd=="ev"){cmdFullname="addEvent";property=this.addOnPrefix(property);eval("this.$('"+id+"')."+property+"= function(){"+data+";}");}else if(cmd=="ah"){cmdFullname="addHandler";this.addHandler(id,property,data);}else if(cmd=="rh"){cmdFullname="addRemoveHandler";this.removeHandler(id,property,data);}}catch(e){if(xajaxDebug)alert("While trying to '"+cmdFullname+"' (command number "+i+"), the following error occured:\n"+e.name+": "+e.message+"\n"+(id&&!objElement?"Object with id='"+id+"' wasn't found.\n":""));}delete objElement;delete cmd;delete cmdFullname;delete id;delete property;delete search;delete data;delete type;delete before;delete internalData;delete j;delete k;}}delete xml;delete i;document.body.style.cursor='default';if(xajaxStatusMessages==true)window.status='Done';}} |
function XHTMLHandler(processor, isAtom) { | function XHTMLHandler(processor, isAtom, waiPrefixes) { | function XHTMLHandler(processor, isAtom) { this._buf = ""; this._processor = processor; this._depth = 0; this._isAtom = isAtom;} |
this._inScopeNS = []; this._waiPrefixes = waiPrefixes; | function XHTMLHandler(processor, isAtom) { this._buf = ""; this._processor = processor; this._depth = 0; this._isAtom = isAtom;} |
|
$.triggerAJAX( $.httpData(xml) ); | $.xmlActive--; if ($.xmlActive <= 0) { if ($.xmlDestroy) $.xmlDestroy(); } | $.xml = function( type, url, data, ret ) { var xml = new XMLHttpRequest(); if ( xml ) { xml.open(type || "GET", url, true); if ( data ) xml.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xml.onreadystatechange = function() { if ( xml.readyState == 4 ) { if ( ret ) ret(xml); $.triggerAJAX( $.httpData(xml) ); } }; xml.send(data) }}; |
(navigator.userAgent.toLowerCase().indexOf("msie 5") >= 0) ? | navigator.userAgent.indexOf("MSIE 5") >= 0 ? | XMLHttpRequest = function(){ return new ActiveXObject( (navigator.userAgent.toLowerCase().indexOf("msie 5") >= 0) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP" ); }; |
(navigator.userAgent.toLowerCase().indexOf('msie 5') >= 0) ? | (navigator.userAgent.toLowerCase().indexOf("msie 5") >= 0) ? | XMLHttpRequest = function(){ return new ActiveXObject( (navigator.userAgent.toLowerCase().indexOf('msie 5') >= 0) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP" ); }; |
this.data = '<?xml version="1.0" encoding="ISO-8859-1"?>\n'; | this.data = '<?xml version="1.0" encoding="ISO-8859-1"?>'; | function XMLWriter() { // We assume for now that all data is already in ISO-8859-1. this.data = '<?xml version="1.0" encoding="ISO-8859-1"?>\n';} |
var rowIndex = this.tree.selection.currentIndex; | rowIndex = this.tree.selection.currentIndex; | function xtv_rkeypress (event){ var rec; if ("onRowCommand" in this && (event.keyCode == 13 || event.charCode == 32)) { if (!this.selection) return; var rowIndex = this.tree.selection.currentIndex; if (rowIndex == -1 || rowIndex > this.rowCount) return; rec = this.childData.locateChildByVisualRow(rowIndex); if (!rec) { ASSERT (0, "bogus row index " + rowIndex); return; } this.onRowCommand(rec, event); } else if ("onKeyPress" in this) { var rowIndex = this.tree.selection.currentIndex; if (rowIndex != -1 && rowIndex < this.rowCount) { var rec = this.childData.locateChildByVisualRow(rowIndex); if (!rec) { ASSERT (0, "bogus row index " + rowIndex); return; } } else { rec = null; } this.onKeyPress(rec, event); }} |
var rec = this.childData.locateChildByVisualRow(rowIndex); | rec = this.childData.locateChildByVisualRow(rowIndex); | function xtv_rkeypress (event){ var rec; if ("onRowCommand" in this && (event.keyCode == 13 || event.charCode == 32)) { if (!this.selection) return; var rowIndex = this.tree.selection.currentIndex; if (rowIndex == -1 || rowIndex > this.rowCount) return; rec = this.childData.locateChildByVisualRow(rowIndex); if (!rec) { ASSERT (0, "bogus row index " + rowIndex); return; } this.onRowCommand(rec, event); } else if ("onKeyPress" in this) { var rowIndex = this.tree.selection.currentIndex; if (rowIndex != -1 && rowIndex < this.rowCount) { var rec = this.childData.locateChildByVisualRow(rowIndex); if (!rec) { ASSERT (0, "bogus row index " + rowIndex); return; } } else { rec = null; } this.onKeyPress(rec, event); }} |
name = name.split("").filter(function (el) { return chars.indexOf(el) != -1; }).join(""); | var asciiBytes = aBytes.filter(function (n) {return !(0x80 & n);}); | name = name.split("").filter(function (el) { return chars.indexOf(el) != -1; }).join(""); |
return arguments.callee.__parent__ == global; | return arguments.callee.__parent__ == GLOBAL; | return function () { return arguments.callee.__parent__ == global; }; |
setTimeout( function(firstTextBox) { firstTextBox.focus(); }, 0, firstName ); | setTimeout( function(firstTextBox) { firstTextBox.focus(); }, 0, focus ); | setTimeout( function(firstTextBox) { firstTextBox.focus(); }, 0, firstName ); |
actual = (function (){return Array.concat.apply([], arguments)})(1,2,3); | actual = (function (){return Array.concat.apply([], arguments)})(1,2,3).toString(); | actual = (function (){return Array.concat.apply([], arguments)})(1,2,3); |
reportCompare(expect, actual, summary); exitFunc ('test'); } | } | (function() { <y/>.(<x/>.(false), (yield 3)) })().next(); reportCompare(expect, actual, summary); exitFunc ('test');} |
setTimeout(function(aTabElt) { getBrowser().selectedTab = aTabElt; }, 0, getBrowser().addTab(url)); | gBrowser.addEventListener("load", function(evt) { setTimeout(loadEventHandlers, 0, evt); }, true); | setTimeout(function(aTabElt) { getBrowser().selectedTab = aTabElt; }, 0, getBrowser().addTab(url)); |
var x = [function() {return "Hello";}]; | x = [function() {return "Hello";}]; | var x = [function() {return "Hello";}]; |
WINDOW_ATTRIBUTES.forEach(function(aAttr) { winData[aAttr] = this._getWindowDimension(aWindow, aAttr); }, this); | this._forEachBrowserWindow(function(aWindow) { if (aWindow != window) { aWindow.close(); } }); | WINDOW_ATTRIBUTES.forEach(function(aAttr) { winData[aAttr] = this._getWindowDimension(aWindow, aAttr); }, this); |
this.loadTimer=setTimeout(function () {thisHack.onDragLoadTarget(targetToBeLoaded)}, this.springLoadedMenuDelay); | setTimeout(function(aTabElt) { getBrowser().selectedTab = aTabElt; }, 0, getBrowser().addTab(url)); | this.loadTimer=setTimeout(function () {thisHack.onDragLoadTarget(targetToBeLoaded)}, this.springLoadedMenuDelay); |
alert("point not found"); | suggest(aLoc); | gcoder.getLatLng(aLoc, function (point) { if (!point) { //mapHelper.suggest(aLoc); alert("point not found"); } else { map.setZoom(10); map.panTo(point); map.removeOverlay(marker); marker = new GMarker(point, {draggable: true}); map.addOverlay(marker); //GEvent.addListener(marker, "dragend", function() { mapHelper.onDragEnd(); }); } }); |
this_.log( "error: " + exc ); | this_.logError( exc ); | function( subComp ) { try { var tzCal = getIcsService().createIcalComponent( "VCALENDAR" ); subComp = subComp.clone(); tzCal.addSubcomponent( subComp ); getIcsService().addTimezone( tzCal, "", "" ); tzids.push( subComp.getFirstProperty("TZID").value ); } catch (exc) { // ignore errors: this_.log( "error: " + exc ); } } ); |
this.closeTimer=setTimeout(function () {thisHack.onDragCloseTarget()}, this.springLoadedMenuDelay); | this.loadTimer=setTimeout(function () {thisHack.onDragLoadTarget(targetToBeLoaded)}, this.springLoadedMenuDelay); | this.closeTimer=setTimeout(function () {thisHack.onDragCloseTarget()}, this.springLoadedMenuDelay); |
switch (a.length) { case 0: return new this(); case 1: return new this(a[0]); case 2: return new this(a[0], a[1]); case 3: return new this(a[0], a[1], a[2]); case 4: return new this(a[0], a[1], a[2], a[3]); case 5: return new this(a[0], a[1], a[2], a[3], a[4]); case 6: return new this(a[0], a[1], a[2], a[3], a[4], a[5]); case 7: return new this(a[0], a[1], a[2], a[3], a[4], a[5], a[6]); } throw "PANIC: too many arguments to constructor"; | a = Array.prototype.splice.call(a, 0, a.length); return this.__applyConstructor__(a); | Fp.__defineProperty__('__construct__', function (a, x) { switch (a.length) { case 0: return new this(); case 1: return new this(a[0]); case 2: return new this(a[0], a[1]); case 3: return new this(a[0], a[1], a[2]); case 4: return new this(a[0], a[1], a[2], a[3]); case 5: return new this(a[0], a[1], a[2], a[3], a[4]); case 6: return new this(a[0], a[1], a[2], a[3], a[4], a[5]); case 7: return new this(a[0], a[1], a[2], a[3], a[4], a[5], a[6]); } throw "PANIC: too many arguments to constructor"; }, true, true, true); |
GEvent.addListener(marker, "dragend", function() { onDragEnd(); }); | GDownloadUrl("/cake/js/suggest.php?s=" + loc, function(data, responseCode) { var xml = GXml.parse(data); var sug = xml.documentElement.getElementsByTagName("string"); if (sug[0].getAttribute('value') !== 0) { document.getElementById('locerrlink').innerHTML = sug[0].getAttribute('value'); document.getElementById('locerr').setAttribute('style', ''); } }); | GEvent.addListener(marker, "dragend", function() { onDragEnd(); }); |
setTimeout(function () { if (thisHack.mCurrentDragOverTarget) {thisHack.onDragRemoveFeedBack(thisHack.mCurrentDragOverTarget); thisHack.mCurrentDragOverTarget=null} thisHack.loadTimer=null; thisHack.onDragCloseTarget() }, 0); | this.closeTimer=setTimeout(function () {thisHack.onDragCloseTarget()}, this.springLoadedMenuDelay); | setTimeout(function () { if (thisHack.mCurrentDragOverTarget) {thisHack.onDragRemoveFeedBack(thisHack.mCurrentDragOverTarget); thisHack.mCurrentDragOverTarget=null} thisHack.loadTimer=null; thisHack.onDragCloseTarget() }, 0); |
(this_.m_sessionId == null || | (!this_.m_sessionId || | function() { if (!this_.m_bNoLoginsAnymore && (this_.m_sessionId == null || this_.m_sessionId == timedOutSessionId)) { if (timedOutSessionId != null) { this_.m_sessionId = null; this_.log( "session timeout; " + "prompting to reconnect." ); var prompt =getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); if (!prompt.confirm( bundle.GetStringFromName( "reconnectConfirmation.label"), bundle.formatStringFromName( "reconnectConfirmation.text", [this_.uri.hostPort], 1 ) )) { this_.m_bNoLoginsAnymore = true; } } if (!this_.m_bNoLoginsAnymore) this_.getSessionId_(); if (this_.m_sessionId != null) { this_.getSupportedTimezones(true /* refresh */); this_.getServerTimeDiff(true /* refresh */); // preread calprops for subscribed calendars: var cals = this_.getSubscribedCalendars({}); for each ( cal in cals ) { cal.getCalProps_(true /* async */); } } } } ); |
if (timedOutSessionId != null) { | try { | function() { if (!this_.m_bNoLoginsAnymore && (this_.m_sessionId == null || this_.m_sessionId == timedOutSessionId)) { if (timedOutSessionId != null) { this_.m_sessionId = null; this_.log( "session timeout; " + "prompting to reconnect." ); var prompt =getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); if (!prompt.confirm( bundle.GetStringFromName( "reconnectConfirmation.label"), bundle.formatStringFromName( "reconnectConfirmation.text", [this_.uri.hostPort], 1 ) )) { this_.m_bNoLoginsAnymore = true; } } if (!this_.m_bNoLoginsAnymore) this_.getSessionId_(); if (this_.m_sessionId != null) { this_.getSupportedTimezones(true /* refresh */); this_.getServerTimeDiff(true /* refresh */); // preread calprops for subscribed calendars: var cals = this_.getSubscribedCalendars({}); for each ( cal in cals ) { cal.getCalProps_(true /* async */); } } } } ); |
this_.log( "session timeout; " + "prompting to reconnect." ); var prompt =getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); if (!prompt.confirm( bundle.GetStringFromName( "reconnectConfirmation.label"), bundle.formatStringFromName( "reconnectConfirmation.text", [this_.uri.hostPort], 1 ) )) { this_.m_bNoLoginsAnymore = true; | if (timedOutSessionId != null) { this_.log( "session timeout; " + "prompting to reconnect." ); var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); if (!prompt.confirm( bundle.GetStringFromName( "reconnectConfirmation.label"), bundle.formatStringFromName( "reconnectConfirmation.text", [this_.uri.hostPort], 1 ) )) { this.log( "reconnect cancelled." ); throw new Components.Exception( "Login failed. Invalid session ID.", Components.interfaces. calIWcapErrors.WCAP_LOGIN_FAILED ); } | function() { if (!this_.m_bNoLoginsAnymore && (this_.m_sessionId == null || this_.m_sessionId == timedOutSessionId)) { if (timedOutSessionId != null) { this_.m_sessionId = null; this_.log( "session timeout; " + "prompting to reconnect." ); var prompt =getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); if (!prompt.confirm( bundle.GetStringFromName( "reconnectConfirmation.label"), bundle.formatStringFromName( "reconnectConfirmation.text", [this_.uri.hostPort], 1 ) )) { this_.m_bNoLoginsAnymore = true; } } if (!this_.m_bNoLoginsAnymore) this_.getSessionId_(); if (this_.m_sessionId != null) { this_.getSupportedTimezones(true /* refresh */); this_.getServerTimeDiff(true /* refresh */); // preread calprops for subscribed calendars: var cals = this_.getSubscribedCalendars({}); for each ( cal in cals ) { cal.getCalProps_(true /* async */); } } } } ); |
if (!this_.m_bNoLoginsAnymore) this_.getSessionId_(); | catch (exc) { this_.m_bNoLoginsAnymore = true; this_.logError( exc ); this_.log( "no logins anymore." ); throw exc; } | function() { if (!this_.m_bNoLoginsAnymore && (this_.m_sessionId == null || this_.m_sessionId == timedOutSessionId)) { if (timedOutSessionId != null) { this_.m_sessionId = null; this_.log( "session timeout; " + "prompting to reconnect." ); var prompt =getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); if (!prompt.confirm( bundle.GetStringFromName( "reconnectConfirmation.label"), bundle.formatStringFromName( "reconnectConfirmation.text", [this_.uri.hostPort], 1 ) )) { this_.m_bNoLoginsAnymore = true; } } if (!this_.m_bNoLoginsAnymore) this_.getSessionId_(); if (this_.m_sessionId != null) { this_.getSupportedTimezones(true /* refresh */); this_.getServerTimeDiff(true /* refresh */); // preread calprops for subscribed calendars: var cals = this_.getSubscribedCalendars({}); for each ( cal in cals ) { cal.getCalProps_(true /* async */); } } } } ); |
if (this_.m_sessionId != null) { this_.getSupportedTimezones(true ); this_.getServerTimeDiff(true ); var cals = this_.getSubscribedCalendars({}); for each ( cal in cals ) { cal.getCalProps_(true ); } | this_.getSupportedTimezones(true ); this_.getServerTimeDiff(true ); var cals = this_.getSubscribedCalendars({}); for each ( cal in cals ) { cal.getCalProps_(true ); | function() { if (!this_.m_bNoLoginsAnymore && (this_.m_sessionId == null || this_.m_sessionId == timedOutSessionId)) { if (timedOutSessionId != null) { this_.m_sessionId = null; this_.log( "session timeout; " + "prompting to reconnect." ); var prompt =getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); if (!prompt.confirm( bundle.GetStringFromName( "reconnectConfirmation.label"), bundle.formatStringFromName( "reconnectConfirmation.text", [this_.uri.hostPort], 1 ) )) { this_.m_bNoLoginsAnymore = true; } } if (!this_.m_bNoLoginsAnymore) this_.getSessionId_(); if (this_.m_sessionId != null) { this_.getSupportedTimezones(true /* refresh */); this_.getServerTimeDiff(true /* refresh */); // preread calprops for subscribed calendars: var cals = this_.getSubscribedCalendars({}); for each ( cal in cals ) { cal.getCalProps_(true /* async */); } } } } ); |
GEvent.addListener(mark, "click", function() { mark.openInfoWindowHtml(aTxt); }); | GEvent.addListener(marker, "dragend", function() { onDragEnd(); }); | GEvent.addListener(mark, "click", function() { mark.openInfoWindowHtml(aTxt); }); |
setTimeout(function(loc, aloc) { gURLBar.value = loc; SetPageProxyState("valid", aloc);}, 0, location, aLocation); | setTimeout(function () { if (thisHack.mCurrentDragOverTarget) {thisHack.onDragRemoveFeedBack(thisHack.mCurrentDragOverTarget); thisHack.mCurrentDragOverTarget=null} thisHack.loadTimer=null; thisHack.onDragCloseTarget() }, 0); | setTimeout(function(loc, aloc) { gURLBar.value = loc; SetPageProxyState("valid", aloc);}, 0, location, aLocation); |
aElm.addEventListener("command", ClickAndHoldStopEvent, false); aElm.addEventListener("click", ClickAndHoldStopEvent, false); | function _addClickAndHoldListenersOnElement(aElm) { aElm.addEventListener("mousedown", ClickAndHoldMouseDown, false); aElm.addEventListener("mouseup", MayStopClickAndHoldTimer, false); aElm.addEventListener("mouseout", MayStopClickAndHoldTimer, false); } |
|
if (selectElem.data != 'addr_newsgroups' && selectElem.data != 'addr_followup') inputElem.disableAutocomplete = false; else | if (selectElem.value != 'addr_newsgroups' && selectElem.value != 'addr_followup') inputElem.disableAutocomplete = false; else | function _awSetAutoComplete(selectElem, inputElem){ if (selectElem.data != 'addr_newsgroups' && selectElem.data != 'addr_followup') inputElem.disableAutocomplete = false; else inputElem.disableAutocomplete = true;} |
input[0].value = inputValue; | function _awSetInputAndPopup(inputValue, popupValue, parentNode, templateNode){ // remove leading spaces while (inputValue[0] == " " ) inputValue = inputValue.substring(1, inputValue.length); top.MAX_RECIPIENTS++; var newNode = templateNode.cloneNode(true); parentNode.appendChild(newNode); // we need to insert the new node before we set the value of the select element! var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { //We need to set the value using both setAttribute and .value else we will // loose the content when the field is not visible. See bug 37435 input[0].setAttribute("value", inputValue); input[0].value = inputValue; input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) { select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(popupValue)]; select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); if (input) _awDisableAutoComplete(select[0], input[0]); }} |
|
if (input) _awDisableAutoComplete(select[0], input[0]); | function _awSetInputAndPopup(inputValue, popupValue, parentNode, templateNode){ // remove leading spaces while (inputValue[0] == " " ) inputValue = inputValue.substring(1, inputValue.length); top.MAX_RECIPIENTS++; var newNode = templateNode.cloneNode(true); parentNode.appendChild(newNode); // we need to insert the new node before we set the value of the select element! var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { //We need to set the value using both setAttribute and .value else we will // loose the content when the field is not visible. See bug 37435 input[0].setAttribute("value", inputValue); input[0].value = inputValue; input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) { select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(popupValue)]; select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); }} |
|
for (var i = 0; i < select[0].childNodes[0].childNodes.length; i ++) if (select[0].childNodes[0].childNodes[i].getAttribute("data") == popupValue) { select[0].selectedItem = select[0].childNodes[0].childNodes[i]; break; } | select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(popupValue)]; | function _awSetInputAndPopup(inputValue, popupValue, parentNode, templateNode){ // remove leading spaces while (inputValue[0] == " " ) inputValue = inputValue.substring(1, inputValue.length); top.MAX_RECIPIENTS++; var newNode = templateNode.cloneNode(true); parentNode.appendChild(newNode); // we need to insert the new node before we set the value of the select element! var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { input[0].setAttribute("value", inputValue); input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) {//Doesn't work! select[0].setAttribute("value", popupValue); for (var i = 0; i < select[0].childNodes[0].childNodes.length; i ++) if (select[0].childNodes[0].childNodes[i].getAttribute("data") == popupValue) { select[0].selectedItem = select[0].childNodes[0].childNodes[i]; break; } select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); }} |
select[0].value = popupValue; | for (var i = 0; i < select[0].childNodes[0].childNodes.length; i ++) if (select[0].childNodes[0].childNodes[i].getAttribute("data") == popupValue) { select[0].selectedItem = select[0].childNodes[0].childNodes[i]; break; } | function _awSetInputAndPopup(inputValue, popupValue, parentNode, templateNode){ // remove leading spaces while (inputValue[0] == " " ) inputValue = inputValue.substring(1, inputValue.length); top.MAX_RECIPIENTS++; var newNode = templateNode.cloneNode(true); parentNode.appendChild(newNode); // we need to insert the new node before we set the value of the select element! var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { input[0].setAttribute("value", inputValue); input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) {//Doesn't work! select[0].setAttribute("value", popupValue); select[0].value = popupValue; select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); }} |
var width = this._image.width * this._monitor.boxObject.width / screen.width; var height = this._image.height * this._monitor.boxObject.height / screen.height; | var width = this._image.naturalWidth * this._monitor.boxObject.width / screen.width; var height = this._image.naturalHeight * this._monitor.boxObject.height / screen.height; | _centerImage: function () { this.updateColor(this._backgroundColor); var img = this._createImage(); var width = this._image.width * this._monitor.boxObject.width / screen.width; var height = this._image.height * this._monitor.boxObject.height / screen.height; img.width = Math.floor(width); img.height = Math.floor(height); this._monitor.appendChild(img); } |
var messageKey = "tabs.openWarningMultiple"; | var messageKey = "tabs.openWarningMultipleBranded"; | _confirmOpenTabs: function(numTabsToOpen) { var pref = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); const kWarnOnOpenPref = "browser.tabs.warnOnOpen"; var reallyOpen = true; if (pref.getBoolPref(kWarnOnOpenPref)) { if (numTabsToOpen >= pref.getIntPref("browser.tabs.maxOpenBeforeWarn")) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); // default to true: if it were false, we wouldn't get this far var warnOnOpen = { value: true }; var messageKey = "tabs.openWarningMultiple"; var openKey = "tabs.openButtonMultiple"; var strings = document.getElementById("placeBundle"); var buttonPressed = promptService.confirmEx(window, strings.getString("tabs.openWarningTitle"), strings.getFormattedString(messageKey, [numTabsToOpen]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), strings.getString(openKey), null, null, strings.getString("tabs.openWarningPromptMe"), warnOnOpen); reallyOpen = (buttonPressed == 0); // don't set the pref unless they press OK and it's false if (reallyOpen && !warnOnOpen.value) pref.setBoolPref(kWarnOnOpenPref, false); } } return reallyOpen; }, |
strings.getFormattedString(messageKey, [numTabsToOpen]), | strings.getFormattedString(messageKey, [numTabsToOpen, brandShortName]), | _confirmOpenTabs: function(numTabsToOpen) { var pref = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); const kWarnOnOpenPref = "browser.tabs.warnOnOpen"; var reallyOpen = true; if (pref.getBoolPref(kWarnOnOpenPref)) { if (numTabsToOpen >= pref.getIntPref("browser.tabs.maxOpenBeforeWarn")) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); // default to true: if it were false, we wouldn't get this far var warnOnOpen = { value: true }; var messageKey = "tabs.openWarningMultiple"; var openKey = "tabs.openButtonMultiple"; var strings = document.getElementById("placeBundle"); var buttonPressed = promptService.confirmEx(window, strings.getString("tabs.openWarningTitle"), strings.getFormattedString(messageKey, [numTabsToOpen]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), strings.getString(openKey), null, null, strings.getString("tabs.openWarningPromptMe"), warnOnOpen); reallyOpen = (buttonPressed == 0); // don't set the pref unless they press OK and it's false if (reallyOpen && !warnOnOpen.value) pref.setBoolPref(kWarnOnOpenPref, false); } } return reallyOpen; }, |
strings.getString("tabs.openWarningPromptMe"), | strings.getFormattedString("tabs.openWarningPromptMeBranded", [brandShortName]), | _confirmOpenTabs: function(numTabsToOpen) { var pref = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); const kWarnOnOpenPref = "browser.tabs.warnOnOpen"; var reallyOpen = true; if (pref.getBoolPref(kWarnOnOpenPref)) { if (numTabsToOpen >= pref.getIntPref("browser.tabs.maxOpenBeforeWarn")) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); // default to true: if it were false, we wouldn't get this far var warnOnOpen = { value: true }; var messageKey = "tabs.openWarningMultiple"; var openKey = "tabs.openButtonMultiple"; var strings = document.getElementById("placeBundle"); var buttonPressed = promptService.confirmEx(window, strings.getString("tabs.openWarningTitle"), strings.getFormattedString(messageKey, [numTabsToOpen]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), strings.getString(openKey), null, null, strings.getString("tabs.openWarningPromptMe"), warnOnOpen); reallyOpen = (buttonPressed == 0); // don't set the pref unless they press OK and it's false if (reallyOpen && !warnOnOpen.value) pref.setBoolPref(kWarnOnOpenPref, false); } } return reallyOpen; }, |
var messageKey = "tabs.openWarningMultiple"; | var messageKey = "tabs.openWarningMultipleBranded"; | _confirmOpenTabs: function(numTabsToOpen) { var reallyOpen = true; const kWarnOnOpenPref = "browser.tabs.warnOnOpen"; if (PREF.getBoolPref(kWarnOnOpenPref)) { if (numTabsToOpen >= PREF.getIntPref("browser.tabs.maxOpenBeforeWarn")) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); // default to true: if it were false, we wouldn't get this far var warnOnOpen = { value: true }; var messageKey = "tabs.openWarningMultiple"; var openKey = "tabs.openButtonMultiple"; var buttonPressed = promptService.confirmEx(window, BookmarksUtils.getLocaleString("tabs.openWarningTitle"), BookmarksUtils.getLocaleString(messageKey, [numTabsToOpen]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), BookmarksUtils.getLocaleString(openKey), null, null, BookmarksUtils.getLocaleString("tabs.openWarningPromptMe"), warnOnOpen); reallyOpen = (buttonPressed == 0); // don't set the pref unless they press OK and it's false if (reallyOpen && !warnOnOpen.value) PREF.setBoolPref(kWarnOnOpenPref, false); } } return reallyOpen; }, |
BookmarksUtils.getLocaleString(messageKey, [numTabsToOpen]), | BookmarksUtils.getLocaleString(messageKey, [numTabsToOpen, BookmarksUtils._brandShortName]), | _confirmOpenTabs: function(numTabsToOpen) { var reallyOpen = true; const kWarnOnOpenPref = "browser.tabs.warnOnOpen"; if (PREF.getBoolPref(kWarnOnOpenPref)) { if (numTabsToOpen >= PREF.getIntPref("browser.tabs.maxOpenBeforeWarn")) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); // default to true: if it were false, we wouldn't get this far var warnOnOpen = { value: true }; var messageKey = "tabs.openWarningMultiple"; var openKey = "tabs.openButtonMultiple"; var buttonPressed = promptService.confirmEx(window, BookmarksUtils.getLocaleString("tabs.openWarningTitle"), BookmarksUtils.getLocaleString(messageKey, [numTabsToOpen]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), BookmarksUtils.getLocaleString(openKey), null, null, BookmarksUtils.getLocaleString("tabs.openWarningPromptMe"), warnOnOpen); reallyOpen = (buttonPressed == 0); // don't set the pref unless they press OK and it's false if (reallyOpen && !warnOnOpen.value) PREF.setBoolPref(kWarnOnOpenPref, false); } } return reallyOpen; }, |
BookmarksUtils.getLocaleString("tabs.openWarningPromptMe"), | BookmarksUtils.getLocaleString("tabs.openWarningPromptMeBranded", [BookmarksUtils._brandShortName]), | _confirmOpenTabs: function(numTabsToOpen) { var reallyOpen = true; const kWarnOnOpenPref = "browser.tabs.warnOnOpen"; if (PREF.getBoolPref(kWarnOnOpenPref)) { if (numTabsToOpen >= PREF.getIntPref("browser.tabs.maxOpenBeforeWarn")) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); // default to true: if it were false, we wouldn't get this far var warnOnOpen = { value: true }; var messageKey = "tabs.openWarningMultiple"; var openKey = "tabs.openButtonMultiple"; var buttonPressed = promptService.confirmEx(window, BookmarksUtils.getLocaleString("tabs.openWarningTitle"), BookmarksUtils.getLocaleString(messageKey, [numTabsToOpen]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), BookmarksUtils.getLocaleString(openKey), null, null, BookmarksUtils.getLocaleString("tabs.openWarningPromptMe"), warnOnOpen); reallyOpen = (buttonPressed == 0); // don't set the pref unless they press OK and it's false if (reallyOpen && !warnOnOpen.value) PREF.setBoolPref(kWarnOnOpenPref, false); } } return reallyOpen; }, |
var pref = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); | var pref = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefBranch); | _confirmOpenTabs: function(numTabsToOpen) { var pref = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); const kWarnOnOpenPref = "browser.tabs.warnOnOpen"; var reallyOpen = true; if (pref.getBoolPref(kWarnOnOpenPref)) { if (numTabsToOpen >= pref.getIntPref("browser.tabs.maxOpenBeforeWarn")) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); // default to true: if it were false, we wouldn't get this far var warnOnOpen = { value: true }; var messageKey = "tabs.openWarningMultipleBranded"; var openKey = "tabs.openButtonMultiple"; var strings = document.getElementById("placeBundle"); var brandBundle = document.getElementById("bundle_brand"); var brandShortName = brandBundle.getString("brandShortName"); var buttonPressed = promptService.confirmEx(window, strings.getString("tabs.openWarningTitle"), strings.getFormattedString(messageKey, [numTabsToOpen, brandShortName]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), strings.getString(openKey), null, null, strings.getFormattedString("tabs.openWarningPromptMeBranded", [brandShortName]), warnOnOpen); reallyOpen = (buttonPressed == 0); // don't set the pref unless they press OK and it's false if (reallyOpen && !warnOnOpen.value) pref.setBoolPref(kWarnOnOpenPref, false); } } return reallyOpen; }, |
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); | var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]. getService(Ci.nsIPromptService); | _confirmOpenTabs: function(numTabsToOpen) { var pref = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); const kWarnOnOpenPref = "browser.tabs.warnOnOpen"; var reallyOpen = true; if (pref.getBoolPref(kWarnOnOpenPref)) { if (numTabsToOpen >= pref.getIntPref("browser.tabs.maxOpenBeforeWarn")) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); // default to true: if it were false, we wouldn't get this far var warnOnOpen = { value: true }; var messageKey = "tabs.openWarningMultipleBranded"; var openKey = "tabs.openButtonMultiple"; var strings = document.getElementById("placeBundle"); var brandBundle = document.getElementById("bundle_brand"); var brandShortName = brandBundle.getString("brandShortName"); var buttonPressed = promptService.confirmEx(window, strings.getString("tabs.openWarningTitle"), strings.getFormattedString(messageKey, [numTabsToOpen, brandShortName]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), strings.getString(openKey), null, null, strings.getFormattedString("tabs.openWarningPromptMeBranded", [brandShortName]), warnOnOpen); reallyOpen = (buttonPressed == 0); // don't set the pref unless they press OK and it's false if (reallyOpen && !warnOnOpen.value) pref.setBoolPref(kWarnOnOpenPref, false); } } return reallyOpen; }, |
updatesView.appendChild(element); | this._updatesView.appendChild(element); | _createAndInsertItem: function(update, state) { var element = document.createElementNS(XMLNS_XUL, "update"); updatesView.appendChild(element); element.setUpdate(update); return element; }, |
var img = document.createElementNS(kXULNS, "image"); | var img = document.createElementNS(kXUL_NS, "image"); | _createImage: function () { var img = document.createElementNS(kXULNS, "image"); img.setAttribute("src", this._image.src); return img; }, |
osvr.removeObserver(this, "profile-after-change"); | osvr.removeObserver(this, "final-ui-startup"); | _dispose: function() { // observer removal const osvr = Components.classes['@mozilla.org/observer-service;1'] .getService(Components.interfaces.nsIObserverService); osvr.removeObserver(this, "profile-change-teardown"); osvr.removeObserver(this, "xpcom-shutdown"); osvr.removeObserver(this, "profile-after-change"); }, |
}, | } | _formatDate: function(seconds) { var sdf = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]. getService(Components.interfaces.nsIScriptableDateFormat); var date = new Date(seconds); return sdf.FormatDateTime("", sdf.dateFormatLong, sdf.timeFormatSeconds, date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()); }, |
format = this._statusFormatUnknownKB; | format = this._progressFormatUnknownKB; | _formatKBytes: function(currentKB, totalKB) { var progressHasMB = parseInt(currentKB / 1024) > 0; var totalHasMB = parseInt(totalKB / 1024) > 0; var format = ""; if (!progressHasMB && !totalHasMB) { if (!totalKB) { format = this._statusFormatUnknownKB; format = this._replaceInsert(format, 1, currentKB); } else { format = this._statusFormatKBKB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, totalKB); } } else if (progressHasMB && totalHasMB) { format = this._statusFormatMBMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (totalHasMB && !progressHasMB) { format = this._statusFormatKBMB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (progressHasMB && !totalHasMB) { format = this._statusFormatUnknownMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); } return format; }, |
format = this._statusFormatKBKB; | format = this._progressFormatKBKB; | _formatKBytes: function(currentKB, totalKB) { var progressHasMB = parseInt(currentKB / 1024) > 0; var totalHasMB = parseInt(totalKB / 1024) > 0; var format = ""; if (!progressHasMB && !totalHasMB) { if (!totalKB) { format = this._statusFormatUnknownKB; format = this._replaceInsert(format, 1, currentKB); } else { format = this._statusFormatKBKB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, totalKB); } } else if (progressHasMB && totalHasMB) { format = this._statusFormatMBMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (totalHasMB && !progressHasMB) { format = this._statusFormatKBMB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (progressHasMB && !totalHasMB) { format = this._statusFormatUnknownMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); } return format; }, |
format = this._statusFormatMBMB; | format = this._progressFormatMBMB; | _formatKBytes: function(currentKB, totalKB) { var progressHasMB = parseInt(currentKB / 1024) > 0; var totalHasMB = parseInt(totalKB / 1024) > 0; var format = ""; if (!progressHasMB && !totalHasMB) { if (!totalKB) { format = this._statusFormatUnknownKB; format = this._replaceInsert(format, 1, currentKB); } else { format = this._statusFormatKBKB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, totalKB); } } else if (progressHasMB && totalHasMB) { format = this._statusFormatMBMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (totalHasMB && !progressHasMB) { format = this._statusFormatKBMB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (progressHasMB && !totalHasMB) { format = this._statusFormatUnknownMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); } return format; }, |
format = this._statusFormatKBMB; | format = this._progressFormatKBMB; | _formatKBytes: function(currentKB, totalKB) { var progressHasMB = parseInt(currentKB / 1024) > 0; var totalHasMB = parseInt(totalKB / 1024) > 0; var format = ""; if (!progressHasMB && !totalHasMB) { if (!totalKB) { format = this._statusFormatUnknownKB; format = this._replaceInsert(format, 1, currentKB); } else { format = this._statusFormatKBKB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, totalKB); } } else if (progressHasMB && totalHasMB) { format = this._statusFormatMBMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (totalHasMB && !progressHasMB) { format = this._statusFormatKBMB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (progressHasMB && !totalHasMB) { format = this._statusFormatUnknownMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); } return format; }, |
format = this._statusFormatUnknownMB; | format = this._progressFormatUnknownMB; | _formatKBytes: function(currentKB, totalKB) { var progressHasMB = parseInt(currentKB / 1024) > 0; var totalHasMB = parseInt(totalKB / 1024) > 0; var format = ""; if (!progressHasMB && !totalHasMB) { if (!totalKB) { format = this._statusFormatUnknownKB; format = this._replaceInsert(format, 1, currentKB); } else { format = this._statusFormatKBKB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, totalKB); } } else if (progressHasMB && totalHasMB) { format = this._statusFormatMBMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (totalHasMB && !progressHasMB) { format = this._statusFormatKBMB; format = this._replaceInsert(format, 1, currentKB); format = this._replaceInsert(format, 2, (totalKB / 1024).toFixed(1)); } else if (progressHasMB && !totalHasMB) { format = this._statusFormatUnknownMB; format = this._replaceInsert(format, 1, (currentKB / 1024).toFixed(1)); } return format; }, |
#ifdef XP_MACOSX var lfm = aFile.QueryInterface(Components.interfaces.nsILocalFileMac); try { return lfm.bundleDisplayName; } catch (e) { } #endif | _getDisplayNameForFile: function (aFile) {#ifdef XP_WIN if (aFile instanceof Components.interfaces.nsILocalFileWin) { try { return aFile.getVersionInfoField("FileDescription"); } catch (e) { // fall through to the filename } }#endif // XXXben - Read the bundle name on OS X. var ios = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var url = ios.newFileURI(aFile).QueryInterface(Components.interfaces.nsIURL); return url.fileName; }, |
|
if (aFile instanceof Components.interfaces.nsILocalFileWin) return aFile.getVersionInfoField("FileDescription"); #else | if (aFile instanceof Components.interfaces.nsILocalFileWin) { try { return aFile.getVersionInfoField("FileDescription"); } catch (e) { } } #endif | _getDisplayNameForFile: function (aFile) {#ifdef XP_WIN if (aFile instanceof Components.interfaces.nsILocalFileWin) return aFile.getVersionInfoField("FileDescription"); #else // XXXben - Read the bundle name on OS X. var ios = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var url = ios.newFileURI(aFile).QueryInterface(Components.interfaces.nsIURL); return url.fileName;#endif }, |
#endif | _getDisplayNameForFile: function (aFile) {#ifdef XP_WIN if (aFile instanceof Components.interfaces.nsILocalFileWin) return aFile.getVersionInfoField("FileDescription"); #else // XXXben - Read the bundle name on OS X. var ios = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var url = ios.newFileURI(aFile).QueryInterface(Components.interfaces.nsIURL); return url.fileName;#endif }, |
|
return file.exists() ? file : null; | if (file.exists()) return file; file = getFile(KEY_APPDIR); file.append("updates"); file.append("last-update.log"); if (file.exists()) return file; return null; | _getUpdateLogFile: function() { var file = getFile(KEY_APPDIR); file.append("updates"); file.append("0"); file.append("update.log"); return file.exists() ? file : null; }, |
osvr.addObserver(this, "profile-after-change", false); | osvr.addObserver(this, "final-ui-startup", false); | _init: function() { // observer registration const osvr = Components.classes['@mozilla.org/observer-service;1'] .getService(Components.interfaces.nsIObserverService); osvr.addObserver(this, "profile-change-teardown", false); osvr.addObserver(this, "xpcom-shutdown", false); osvr.addObserver(this, "profile-after-change", false); }, |
this._convertOldPrefs(); | _init: function() { engineMetadataService.init(); engineUpdateService.init(); this._addObservers(); var fileLocator = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); var locations = fileLocator.get(NS_APP_SEARCH_DIR_LIST, Ci.nsISimpleEnumerator); while (locations.hasMoreElements()) { var location = locations.getNext().QueryInterface(Ci.nsIFile); this._loadEngines(location); } this._convertOldPrefs(); // Now that all engines are loaded, build the sorted engine list this._buildSortedEngineList(); selectedEngineName = getLocalizedPref(BROWSER_SEARCH_PREF + "selectedEngine"); this._currentEngine = this.getEngineByName(selectedEngineName) || this.defaultEngine; }, |
|
var appRow = this.element("selectedApplicationListitem"); | _initFeedReaders: function() { this.updateSelectedApplicationInfo(); var wccr = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"]. getService(Ci.nsIWebContentConverterService); var handlers = wccr.getContentHandlers(TYPE_MAYBE_FEED, {}); if (handlers.length == 0) return; var appRow = this.element("selectedApplicationListitem"); var ios = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService); for (var i = 0; i < handlers.length; ++i) { var row = document.createElementNS(kXULNS, "listitem"); row.className = "listitem-iconic"; row.setAttribute("label", handlers[i].name); row.setAttribute("webhandlerurl", handlers[i].uri); var uri = ios.newURI(handlers[i].uri, null, null); row.setAttribute("image", uri.prePath + "/favicon.ico"); appRow.parentNode.appendChild(row); } }, |
|
appRow.parentNode.appendChild(row); | readersList.appendChild(row); | _initFeedReaders: function() { this.updateSelectedApplicationInfo(); var wccr = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"]. getService(Ci.nsIWebContentConverterService); var handlers = wccr.getContentHandlers(TYPE_MAYBE_FEED, {}); if (handlers.length == 0) return; var appRow = this.element("selectedApplicationListitem"); var ios = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService); for (var i = 0; i < handlers.length; ++i) { var row = document.createElementNS(kXULNS, "listitem"); row.className = "listitem-iconic"; row.setAttribute("label", handlers[i].name); row.setAttribute("webhandlerurl", handlers[i].uri); var uri = ios.newURI(handlers[i].uri, null, null); row.setAttribute("image", uri.prePath + "/favicon.ico"); appRow.parentNode.appendChild(row); } }, |
#ifdef HAVE_SHELL_SERVICE }, | } | _launchExternalUrl: function(aURL) { var extProtocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].getService(Components.interfaces.nsIExternalProtocolService); if (extProtocolSvc) extProtocolSvc.loadUrl(aURL);#ifdef HAVE_SHELL_SERVICE }, |
else { var ssEnabled = true; var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { ssEnabled = prefBranch.getBoolPref("browser.sessionstore.enabled"); } catch (ex) {} if (ssEnabled) { try { var ss = Components.classes["@mozilla.org/browser/sessionstore;1"] .getService(Components.interfaces.nsISessionStore); ss.init(); } catch(ex) { dump("nsSessionStore could not be initialized: " + ex); } } } | _onProfileStartup: function() { this.Sanitizer.onStartup(); // check if we're in safe mode var app = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo) .QueryInterface(Components.interfaces.nsIXULRuntime); if (app.inSafeMode) { var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher); ww.openWindow(null, "chrome://browser/content/safeMode.xul", "_blank", "chrome,centerscreen,modal,resizable=no", null); } }, |
|
else { var ssEnabled = true; var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { ssEnabled = prefBranch.getBoolPref("browser.sessionstore.enabled"); } catch (ex) {} if (ssEnabled) { try { var ss = Components.classes["@mozilla.org/browser/sessionstore;1"] .getService(Components.interfaces.nsISessionStore); ss.init(); } catch(ex) { dump("nsSessionStore could not be initialized: " + ex); } } } | _onProfileStartup: function() { this.Sanitizer.onStartup(); // check if we're in safe mode var app = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo) .QueryInterface(Components.interfaces.nsIXULRuntime); if (app.inSafeMode) { var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher); ww.openWindow(null, "chrome://browser/content/safeMode.xul", "_blank", "chrome,centerscreen,modal,resizable=no", null); } else { // initialize the session-restore service var ssEnabled = true; var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { ssEnabled = prefBranch.getBoolPref("browser.sessionstore.enabled"); } catch (ex) {} if (ssEnabled) { try { var ss = Components.classes["@mozilla.org/browser/sessionstore;1"] .getService(Components.interfaces.nsISessionStore); ss.init(); } catch(ex) { dump("nsSessionStore could not be initialized: " + ex); } } } }, |
|
_valueStack = []; _currValue = null; _cdata = null; | this._valueStack = []; this._currValue = null; this._cdata = null; this._foundFault = false; | _parseResponse: function(stream, length) { debug('Creating parser ... '); var parser = new SimpleXMLParser(stream, length); parser.setDocumentHandler(this); // Make sure state is clean _valueStack = []; _currValue = null; _cdata = null; debug('Cranking up the parser'); parser.parse(length); if (this._fault) { try { this._fault = createInstance(XMLRPCFAULT_PROGID, 'nsIXmlRpcFault'); this._fault.init(this._result.getValue('faultCode').data, this._result.getValue('faultString').data); this._result = null; } catch(e) { this._fault = null; this._result = null; throw Components.Exception('Could not parse response'); } } }, |
if (this._fault) { | if (this._foundFault) { | _parseResponse: function(stream, length) { debug('Creating parser ... '); var parser = new SimpleXMLParser(stream, length); parser.setDocumentHandler(this); // Make sure state is clean _valueStack = []; _currValue = null; _cdata = null; debug('Cranking up the parser'); parser.parse(length); if (this._fault) { try { this._fault = createInstance(XMLRPCFAULT_PROGID, 'nsIXmlRpcFault'); this._fault.init(this._result.getValue('faultCode').data, this._result.getValue('faultString').data); this._result = null; } catch(e) { this._fault = null; this._result = null; throw Components.Exception('Could not parse response'); } } }, |
_rgbToHex(aR, aG, aB) | _rgbToHex: function(aR, aG, aB) | _rgbToHex(aR, aG, aB) { var rHex = aR.toString(16).toUpperCase(); var gHex = aG.toString(16).toUpperCase(); var bHex = aB.toString(16).toUpperCase(); if (rHex.length == 1) rHex ='0' + rHex; if (gHex.length == 1) gHex ='0' + gHex; if (bHex.length == 1) bHex ='0' + bHex; return '#' + rHex + gHex + bHex; }, |
var msg = Bundle.GetStringFromName("documentDonePrefix") + elapsed + Bundle.GetStringFromName("documentDonePostfix"); | var msg = gMessengerBundle.getString("documentDonePrefix") + elapsed + gMessengerBundle.getString("documentDonePostfix"); | _stopMeteors : function() { this.ensureStatusFields(); // Record page loading time. var elapsed = ( (new Date()).getTime() - this.startTime ) / 1000; var msg = Bundle.GetStringFromName("documentDonePrefix") + elapsed + Bundle.GetStringFromName("documentDonePostfix"); this.showStatusString(msg); defaultStatus = msg; this.throbber.setAttribute("busy", false); // Turn progress meter off. this.statusBar.setAttribute("mode","normal"); this.statusBar.value = 0; // be sure to clear the progress bar this.statusBar.progresstext = ""; this.stopButton.setAttribute("disabled", true); this.stopMenu.setAttribute("disabled", true); this.meteorsSpinning = false; this.stopTimeoutID = null; }, |
var msg = gMessengerBundle.getString("documentDone"); this.showStatusString(msg); defaultStatus = msg; | this.showStatusString(defaultStatus); | _stopMeteors : function() { if(gTimelineEnabled){ gTimelineService.stopTimer("FolderLoading"); gTimelineService.markTimer("FolderLoading"); gTimelineService.resetTimer("FolderLoading"); } this.ensureStatusFields(); var msg = gMessengerBundle.getString("documentDone"); this.showStatusString(msg); defaultStatus = msg; // stop the throbber if (this.throbber) this.throbber.setAttribute("busy", false); // Turn progress meter off. this.statusBar.setAttribute("mode","normal"); this.statusBar.value = 0; // be sure to clear the progress bar this.statusBar.label = ""; if (this.progressMeterVisible) { this.progressMeterContainer.collapsed = true; this.progressMeterVisible = false; } if (this.stopCmd) this.stopCmd.setAttribute("disabled", "true"); this.meteorsSpinning = false; this.stopTimeoutID = null; }, |
if(gTimelineEnabled){ gTimelineService.stopTimer("FolderLoading"); gTimelineService.markTimer("FolderLoading"); gTimelineService.resetTimer("FolderLoading"); } | _stopMeteors : function() { this.ensureStatusFields(); // Record page loading time. var elapsed = ( (new Date()).getTime() - this.startTime ) / 1000; var msg = gMessengerBundle.getFormattedString("documentDoneTime", [ elapsed ]); this.showStatusString(msg); defaultStatus = msg; this.throbber.setAttribute("busy", false); // Turn progress meter off. this.statusBar.setAttribute("mode","normal"); this.statusBar.value = 0; // be sure to clear the progress bar this.statusBar.label = ""; this.stopButton.setAttribute("disabled", true); this.stopMenu.setAttribute("disabled", true); this.meteorsSpinning = false; this.stopTimeoutID = null; }, |
|
this.statusBar.progresstext = ""; this.stopButton.setAttribute("disabled", true); this.stopMenu.setAttribute("disabled", true); | this.statusBar.label = ""; this.stopButton.setAttribute("disabled", true); this.stopMenu.setAttribute("disabled", true); | _stopMeteors : function() { this.ensureStatusFields(); // Record page loading time. var elapsed = ( (new Date()).getTime() - this.startTime ) / 1000; var msg = gMessengerBundle.getFormattedString("documentDoneTime", [ elapsed ]); this.showStatusString(msg); defaultStatus = msg; this.throbber.setAttribute("busy", false); // Turn progress meter off. this.statusBar.setAttribute("mode","normal"); this.statusBar.value = 0; // be sure to clear the progress bar this.statusBar.progresstext = ""; this.stopButton.setAttribute("disabled", true); this.stopMenu.setAttribute("disabled", true); this.meteorsSpinning = false; this.stopTimeoutID = null; }, |
var text = document.createElementNS(kXULNS, "label"); | var text = document.createElementNS(kXUL_NS, "label"); | _tileImage: function () { var bundle = document.getElementById("backgroundBundle"); this._monitor.style.backgroundColor = "white"; var text = document.createElementNS(kXULNS, "label"); text.setAttribute("id", "noPreviewAvailable"); text.setAttribute("value", bundle.getString("DesktopBackgroundNoPreview")); this._monitor.appendChild(text); }, |
var attr = " " + a.localName + '="' + unicodeToEntity(a.nodeValue) + '"'; | var attr = " " + a.localName + '="' + InsUtil.unicodeToEntity(a.nodeValue) + '"'; | _toXML: function(aNode, aLevel) { if (!aNode) return ""; var s = ""; var indent = ""; for (var i = 0; i < aLevel; ++i) indent += " "; var line = indent; if (aNode.nodeType == Node.ELEMENT_NODE) { line += "<" + aNode.localName; var attrIndent = ""; for (i = 0; i < line.length; ++i) attrIndent += " "; for (i = 0; i < aNode.attributes.length; ++i) { var a = aNode.attributes[i]; var attr = " " + a.localName + '="' + unicodeToEntity(a.nodeValue) + '"'; if (line.length + attr.length > 80) { s += line + (i < aNode.attributes.length-1 ? "\n"+attrIndent : ""); line = ""; } line += attr; } s += line; if (aNode.childNodes.length == 0) s += "/>\n"; else { s += ">\n"; for (i = 0; i < aNode.childNodes.length; ++i) s += this._toXML(aNode.childNodes[i], aLevel+1); s += indent + "</" + aNode.localName + ">\n"; } } else if (aNode.nodeType == Node.TEXT_NODE) { s += unicodeToEntity(aNode.data); } else if (aNode.nodeType == Node.COMMENT_NODE) { s += line + "<!--" + unicodeToEntity(aNode.data) + "-->\n"; } return s; }, |
s += unicodeToEntity(aNode.data); | s += InsUtil.unicodeToEntity(aNode.data); | _toXML: function(aNode, aLevel) { if (!aNode) return ""; var s = ""; var indent = ""; for (var i = 0; i < aLevel; ++i) indent += " "; var line = indent; if (aNode.nodeType == Node.ELEMENT_NODE) { line += "<" + aNode.localName; var attrIndent = ""; for (i = 0; i < line.length; ++i) attrIndent += " "; for (i = 0; i < aNode.attributes.length; ++i) { var a = aNode.attributes[i]; var attr = " " + a.localName + '="' + unicodeToEntity(a.nodeValue) + '"'; if (line.length + attr.length > 80) { s += line + (i < aNode.attributes.length-1 ? "\n"+attrIndent : ""); line = ""; } line += attr; } s += line; if (aNode.childNodes.length == 0) s += "/>\n"; else { s += ">\n"; for (i = 0; i < aNode.childNodes.length; ++i) s += this._toXML(aNode.childNodes[i], aLevel+1); s += indent + "</" + aNode.localName + ">\n"; } } else if (aNode.nodeType == Node.TEXT_NODE) { s += unicodeToEntity(aNode.data); } else if (aNode.nodeType == Node.COMMENT_NODE) { s += line + "<!--" + unicodeToEntity(aNode.data) + "-->\n"; } return s; }, |
s += line + "<!--" + unicodeToEntity(aNode.data) + "-->\n"; | s += line + "<!--" + InsUtil.unicodeToEntity(aNode.data) + "-->\n"; | _toXML: function(aNode, aLevel) { if (!aNode) return ""; var s = ""; var indent = ""; for (var i = 0; i < aLevel; ++i) indent += " "; var line = indent; if (aNode.nodeType == Node.ELEMENT_NODE) { line += "<" + aNode.localName; var attrIndent = ""; for (i = 0; i < line.length; ++i) attrIndent += " "; for (i = 0; i < aNode.attributes.length; ++i) { var a = aNode.attributes[i]; var attr = " " + a.localName + '="' + unicodeToEntity(a.nodeValue) + '"'; if (line.length + attr.length > 80) { s += line + (i < aNode.attributes.length-1 ? "\n"+attrIndent : ""); line = ""; } line += attr; } s += line; if (aNode.childNodes.length == 0) s += "/>\n"; else { s += ">\n"; for (i = 0; i < aNode.childNodes.length; ++i) s += this._toXML(aNode.childNodes[i], aLevel+1); s += indent + "</" + aNode.localName + ">\n"; } } else if (aNode.nodeType == Node.TEXT_NODE) { s += unicodeToEntity(aNode.data); } else if (aNode.nodeType == Node.COMMENT_NODE) { s += line + "<!--" + unicodeToEntity(aNode.data) + "-->\n"; } return s; }, |
if (gAbView) gAbView.deleteSelectedCards(); | var types = GetSelectedCardTypes(); if (types == kNothingSelected) return; var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (types != kCardsOnly) { var confirmDeleteMessage; if (types == kListsAndCards) confirmDeleteMessage = gAddressBookBundle.getString("confirmDeleteListsAndCards"); else if (types == kMultipleListsOnly) confirmDeleteMessage = gAddressBookBundle.getString("confirmDeleteMailingLists"); else confirmDeleteMessage = gAddressBookBundle.getString("confirmDeleteMailingList"); if (!promptService.confirm(window, null, confirmDeleteMessage)) return; } gAbView.deleteSelectedCards(); | function AbDelete(){ if (gAbView) gAbView.deleteSelectedCards();} |
Bundle.GetStringFromName("cannotDeleteTitle"), Bundle.GetStringFromName("cannotDeleteMessage")); | gAddressBookBundle.getString("cannotDeleteTitle"), gAddressBookBundle.getString("cannotDeleteMessage")); | function AbDeleteDirectory(){ dump("\AbDeleteDirectory from XUL\n"); var commonDialogsService = Components.classes["@mozilla.org/appshell/commonDialogs;1"].getService(); commonDialogsService = commonDialogsService.QueryInterface(Components.interfaces.nsICommonDialogs); var selArray = dirTree.selectedItems; var count = selArray.length; debugDump("selArray.length = " + count + "\n"); if (count == 0) return; var isPersonalOrCollectedAbsSelectedForDeletion = false; var parentArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); if ( !parentArray ) return (false); for ( var i = 0; i < count; ++i ) { debugDump(" nodeId #" + i + " = " + selArray[i].getAttribute("id") + "\n"); // check to see if personal or collected address books is selected for deletion. // if yes, prompt the user an appropriate message saying these cannot be deleted // if no, mark the selected items for deletion if ((selArray[i].getAttribute("id") != "abdirectory://history.mab") && (selArray[i].getAttribute("id") != "abdirectory://abook.mab")) { var parent = selArray[i].parentNode.parentNode; if (parent) { if (parent == dirTree) var parentId = "abdirectory://"; else var parentId = parent.getAttribute("id"); debugDump(" parentId #" + i + " = " + parentId + "\n"); var dirResource = rdf.GetResource(parentId); var parentDir = dirResource.QueryInterface(Components.interfaces.nsIAbDirectory); parentArray.AppendElement(parentDir); } } else { if (commonDialogsService) { commonDialogsService.Alert(window, Bundle.GetStringFromName("cannotDeleteTitle"), Bundle.GetStringFromName("cannotDeleteMessage")); } isPersonalOrCollectedAbsSelectedForDeletion = true; break; } } if (!isPersonalOrCollectedAbsSelectedForDeletion) { var confirmDeleteAddressbook = Bundle.GetStringFromName("confirmDeleteAddressbook"); if(!window.confirm(confirmDeleteAddressbook)) return; top.addressbook.deleteAddressBooks(dirTree.database, parentArray, dirTree.selectedItems); }} |
Bundle.GetStringFromName("confirmDeleteAddressbook"); | gAddressBookBundle.getString("confirmDeleteAddressbook"); | function AbDeleteDirectory(){ dump("\AbDeleteDirectory from XUL\n"); var commonDialogsService = Components.classes["@mozilla.org/appshell/commonDialogs;1"].getService(); commonDialogsService = commonDialogsService.QueryInterface(Components.interfaces.nsICommonDialogs); var selArray = dirTree.selectedItems; var count = selArray.length; debugDump("selArray.length = " + count + "\n"); if (count == 0) return; var isPersonalOrCollectedAbsSelectedForDeletion = false; var parentArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); if ( !parentArray ) return (false); for ( var i = 0; i < count; ++i ) { debugDump(" nodeId #" + i + " = " + selArray[i].getAttribute("id") + "\n"); // check to see if personal or collected address books is selected for deletion. // if yes, prompt the user an appropriate message saying these cannot be deleted // if no, mark the selected items for deletion if ((selArray[i].getAttribute("id") != "abdirectory://history.mab") && (selArray[i].getAttribute("id") != "abdirectory://abook.mab")) { var parent = selArray[i].parentNode.parentNode; if (parent) { if (parent == dirTree) var parentId = "abdirectory://"; else var parentId = parent.getAttribute("id"); debugDump(" parentId #" + i + " = " + parentId + "\n"); var dirResource = rdf.GetResource(parentId); var parentDir = dirResource.QueryInterface(Components.interfaces.nsIAbDirectory); parentArray.AppendElement(parentDir); } } else { if (commonDialogsService) { commonDialogsService.Alert(window, Bundle.GetStringFromName("cannotDeleteTitle"), Bundle.GetStringFromName("cannotDeleteMessage")); } isPersonalOrCollectedAbsSelectedForDeletion = true; break; } } if (!isPersonalOrCollectedAbsSelectedForDeletion) { var confirmDeleteAddressbook = Bundle.GetStringFromName("confirmDeleteAddressbook"); if(!window.confirm(confirmDeleteAddressbook)) return; top.addressbook.deleteAddressBooks(dirTree.database, parentArray, dirTree.selectedItems); }} |
var confirmDeleteAddressbook = Bundle.GetStringFromName("confirmDeleteAddressbook"); if(!window.confirm(confirmDeleteAddressbook)) return; | function AbDeleteDirectory(){ dump("\AbDeleteDirectory from XUL\n"); var selArray = dirTree.selectedItems; var count = selArray.length; debugDump("selArray.length = " + count + "\n"); if (count == 0) return; var parentArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); if ( !parentArray ) return (false); for ( var i = 0; i < count; ++i ) { var parent = selArray[i].parentNode.parentNode; if (parent) { if (parent == dirTree) var parentId = "abdirectory://"; else var parentId = parent.getAttribute("id"); debugDump(" parentId #" + i + " = " + parentId + "\n"); var dirResource = rdf.GetResource(parentId); var parentDir = dirResource.QueryInterface(Components.interfaces.nsIAbDirectory); parentArray.AppendElement(parentDir); } } top.addressbook.deleteAddressBooks(dirTree.database, parentArray, dirTree.selectedItems);} |
|
var editCardCallback = 0; if ( top.addressbook && top.addressbook.editCardCallback ) editCardCallback = top.addressbook.editCardCallback; | function AbEditCard(){ var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); var resultsTree = document.getElementById('resultsTree'); if ( resultsTree.selectedItems && resultsTree.selectedItems.length == 1 ) { var uri = resultsTree.selectedItems[0].getAttribute('id'); var card = rdf.GetResource(uri); card = card.QueryInterface(Components.interfaces.nsIAbCard); var editCardCallback = 0; if ( top.addressbook && top.addressbook.editCardCallback ) editCardCallback = top.addressbook.editCardCallback; goEditCardDialog(document.getElementById('resultsTree').getAttribute('ref'), card, editCardCallback); }} |
|
card, editCardCallback); | card, top.editCardCallback); | function AbEditCard(){ var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); var resultsTree = document.getElementById('resultsTree'); if ( resultsTree.selectedItems && resultsTree.selectedItems.length == 1 ) { var uri = resultsTree.selectedItems[0].getAttribute('id'); var card = rdf.GetResource(uri); card = card.QueryInterface(Components.interfaces.nsIAbCard); var editCardCallback = 0; if ( top.addressbook && top.addressbook.editCardCallback ) editCardCallback = top.addressbook.editCardCallback; goEditCardDialog(document.getElementById('resultsTree').getAttribute('ref'), card, editCardCallback); }} |
function AbNewCard() | function AbNewCard(abListItem) | function AbNewCard(){ var selectedAB = 0; if (dirTree && dirTree.selectedItems && (dirTree.selectedItems.length == 1)) selectedAB = dirTree.selectedItems[0].getAttribute("id"); goNewCardDialog(selectedAB);} |
var selectedAB = 0; if (dirTree && dirTree.selectedItems && (dirTree.selectedItems.length == 1)) selectedAB = dirTree.selectedItems[0].getAttribute("id"); | var selectedAB = GetSelectedAddressBookDirID(abListItem); | function AbNewCard(){ var selectedAB = 0; if (dirTree && dirTree.selectedItems && (dirTree.selectedItems.length == 1)) selectedAB = dirTree.selectedItems[0].getAttribute("id"); goNewCardDialog(selectedAB);} |
return; | function AbNewList(){ return; var selectedAB = 0; if ( dirTree && dirTree.selectedItems && (dirTree.selectedItems.length == 1) ) selectedAB = dirTree.selectedItems[0].getAttribute('id'); window.openDialog("chrome://messenger/content/addressbook/abMailListDialog.xul", "", "chrome,resizeable=no", {selectedAB:selectedAB});} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.