Closed
Bug 226209
Opened 21 years ago
Closed 19 years ago
Cleanup calendar code
Categories
(Calendar :: General, defect)
Calendar
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mostafah, Unassigned)
Details
Attachments
(11 files, 5 obsolete files)
16.21 KB,
patch
|
Details | Diff | Splinter Review | |
7.47 KB,
patch
|
Details | Diff | Splinter Review | |
10.54 KB,
patch
|
Details | Diff | Splinter Review | |
60.04 KB,
patch
|
Details | Diff | Splinter Review | |
204.15 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
14.23 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
10.65 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
4.24 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
2.18 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
6.44 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
28.48 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
General bug for cleaning up code.
-Remove extra linefeeds
-Remove extra whitespace
-Replace tabs with 4 spaces.
-Fix indenting to be 4 spaces.
-Remove temporary debug code.
...
Reporter | ||
Comment 1•21 years ago
|
||
Reporter | ||
Comment 2•21 years ago
|
||
Attachment #135920 [details] [diff] checked into CVS.
Thanks Eric.
Status: NEW → ASSIGNED
Comment 3•21 years ago
|
||
This is a good idea. Just to clarify: indent 4 spaces? (I'm going to have to get
a wider monitor...)
Reporter | ||
Comment 4•21 years ago
|
||
For Control Structures please use the guideline at:
http://www.mozilla.org/hacking/mozilla-style-guide.html#Visual
For indenting please use 4 spaces in all languages. The rule is
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
for js/xul/css/xbl and
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
for C++
Reporter | ||
Comment 5•21 years ago
|
||
From the newsgroup:
> Hi Mostafa and Jussi,
> I also vote for 2 spaces. I always found that 4 in too much.
> The mozilla guideline
(http://www.mozilla.org/hacking/mozilla-style-guide.html#Visual) also suggest to use
> /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: -*- */
With that vote "2 spaces" is in majority now :)
So, we'll settle with
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: -*- */
in js/xul/css/xbl for now. Feel free to fix indenting for the file you intend to
work on.
However before this finalizes please avoid a major sweep of files not related to
your work.
C++ will remain:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
Comment 6•21 years ago
|
||
Hi Mostafa,
A comment just to add a missing 2 :
js/xul/css/xbl :
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
or
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
C++:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
Comment 7•21 years ago
|
||
Im going to transfer my day view changes into week view soon, so I decided to
go through weekview.js.
It turned out to be little disappointing: I ended up touching probably half of
the lines, and I didn't even change the indents (3 spaces consistently)! I'm
not sure if it's worth it for you to go through the file, I just posted it
because it was already done...
Another option is that I'll do my improvements, and then give you two diffs,
the first being a clean-up diff for the functions I changed, and the second the
actual changes.
Your choice really, I'm content either way.
Comment 8•21 years ago
|
||
(In reply to comment #7)
> Another option is that I'll do my improvements, and then give you two diffs,
> the first being a clean-up diff for the functions I changed, and the second the
> actual changes.
Just to clarify myself: I _am_ going to post the changes in multiple parts.
Learned something from last time ;)
Reporter | ||
Comment 9•21 years ago
|
||
Comment on attachment 146205 [details] [diff] [review]
weekview clean-up
The patch doesn't apply. Jussi: Can you attach the actual weekView.js file
instead? I think I can use that
Comment 10•21 years ago
|
||
Attachment #146205 -
Attachment is obsolete: true
Reporter | ||
Comment 11•21 years ago
|
||
Comment on attachment 146208 [details]
cleaned weekview.js
I've used this attachment to clean up the current weekView.js file. The file
itself could not be checked in because it wasn't compatible with the current
CVS.
Please cvs update and if the file still needs cleaning please provide a new
patch.
To clarify indenting is 2 spaces.
Attachment #146208 -
Attachment is obsolete: true
Comment 12•21 years ago
|
||
Thanks (my checkout was before bzbarskys nodelist fixes, should have noticed
that).
> To clarify indenting is 2 spaces.
It's just that the file is pretty consistently indented with three spaces, and
I think it's fine (as long as it's consistent). If there was no clear style for
the file I'd change it to 2.
In fact I'd like to change even the remining 50 or so lines to indent 3 (it
happens to be the exact function I'll be changing with the coming fixes...). Is
this ok?
Reporter | ||
Comment 13•21 years ago
|
||
Comment on attachment 146270 [details] [diff] [review]
weekview, take 2 ( checked in )
Patch checked in.
It's ok to make all indents 3 spaces for consistency.
Attachment #146270 -
Attachment description: weekview, take 2 → weekview, take 2 ( checked in )
Comment 14•21 years ago
|
||
Strangely the diff showed the WHOLE file as being new...(all lines - all lines
+)
so instead of a twice-as-large file, I just attached converted.
re-formats mozilla\calendar\resources\content\CalPrintEngine.js
Comment 15•21 years ago
|
||
Comment on attachment 146394 [details]
calPrintEngine.js
Index: calPrintEngine.js
===================================================================
RCS file: /cvsroot/mozilla/calendar/resources/content/calPrintEngine.js,v
retrieving revision 1.1
diff -u -r1.1 calPrintEngine.js
--- calPrintEngine.js 7 Nov 2003 15:10:44 -0000 1.1
+++ calPrintEngine.js 18 Apr 2004 04:36:08 -0000
@@ -1,656 +1,638 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is OEone Calendar Code, released October 31st, 2001.
- *
- * The Initial Developer of the Original Code is
- * OEone Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Garth Smedley <garths@oeone.com>
- * Mike Potter <mikep@oeone.com>
- * Colin Phillips <colinp@oeone.com>
- * Chris Charabaruk <ccharabaruk@meldstar.com>
- * ArentJan Banck <ajbanck@planet.nl>
- * Chris Allen
- * Eric Belhaire <belhaire@ief.u-psud.fr>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-/*-----------------------------------------------------------------
-* W I N D O W V A R I A B L E S
-*/
-
-
-
-this.dateStringBundle = document.getElementById("bundle_date");
-
-var monthNames=new Array(12);
-monthNames[0]=this.dateStringBundle.getString("month.1.name" );
-monthNames[1]=this.dateStringBundle.getString("month.2.name" );
-monthNames[2]=this.dateStringBundle.getString("month.3.name" );
-monthNames[3]=this.dateStringBundle.getString("month.4.name" );
-monthNames[4]=this.dateStringBundle.getString("month.5.name" );
-monthNames[5]=this.dateStringBundle.getString("month.6.name" );
-monthNames[6]=this.dateStringBundle.getString("month.7.name" );
-monthNames[7]=this.dateStringBundle.getString("month.8.name" );
-monthNames[8]=this.dateStringBundle.getString("month.9.name" );
-monthNames[9]=this.dateStringBundle.getString("month.10.name" );
-monthNames[10]=this.dateStringBundle.getString("month.11.name" );
-monthNames[11]=this.dateStringBundle.getString("month.12.name" );
-
-
-var eventSource; // event source sent by opener
-var weeksInView;
-var prevWeeksInView;
-var startOfWeek;
-var gMyTitle;
-var gShowprivate ;
-var gCalendarWindow ;
-var gHtmlDocument ;
-
-var gPrintSettingsAreGlobal = true;
-var gSavePrintSettings = true;
-var gPrintSettings = null;
-var gWebProgress = null;
-/*-----------------------------------------------------------------
-* W I N D O W F U N C T I O N S
-*/
-
-function getWebNavigation()
-{
- try {
- return gContent.webNavigation;
- } catch (e) {
- return null;
- }
-}
-
-function BrowserPrintPreview()
-{
- var ifreq;
- var webBrowserPrint;
- try {
- ifreq =
_content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- webBrowserPrint =
ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
- gPrintSettings = GetPrintSettings();
-
- } catch (e) {
- // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
- // causing an exception to be thrown which we catch here.
- // Unfortunately this will also consume helpful failures, so add a
- // dump(e); // if you need to debug
- }
- gWebProgress = new Object();
-
- var printPreviewParams = new Object();
- var notifyOnOpen = new Object();
- var printingPromptService =
Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
-
.getService(Components.interfaces.nsIPrintingPromptService);
- if (printingPromptService) {
- FinishPrintPreview();
- }
-}
-
-function FinishPrintPreview()
-{
- try {
- var ifreq =
_content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- var webBrowserPrint =
ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
- if (webBrowserPrint) {
- gPrintSettings = GetPrintSettings();
- webBrowserPrint.printPreview(gPrintSettings, null, gWebProgress.value);
- }
- showPrintPreviewToolbar();
-
- _content.focus();
- } catch (e) {
- // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
- // causing an exception to be thrown which we catch here.
- // Unfortunately this will also consume helpful failures, so add a
- // dump(e); // if you need to debug
- }
-}
-
-/**
-* Called when the dialog is loaded.
-*/
-function OnLoadPrintEngine(){
- gContent = document.getElementById("content") ;
-
- if ( window.arguments && window.arguments[0] != null ) {
- HTMLViewFunction = window.arguments[0] ;
- HTMLFunctionArgs = window.arguments[1] ;
- gMyTitle = window.arguments[2] ;
- gShowprivate = window.arguments[3] ;
- gArgs = window.arguments[4] ;
- gCalendarWindow = window.arguments[5] ;
- eventSource=gArgs.eventSource;
- weeksInView=gArgs.weeksInView;
- prevWeeksInView=gArgs.prevWeeksInView;
- startOfWeek=gArgs.startOfWeek;
-
- gHtmlDocument = window._content.document ;
- initHTMLView();
- eval(HTMLViewFunction)(HTMLFunctionArgs);
- finishHTMLView() ;
- }
- BrowserPrintPreview();
-}
-
-function OnUnloadPrintEngine()
-{
-}
-
-function showPrintPreviewToolbar()
-{
- const kXULNS =
- "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
- var printPreviewTB = document.createElementNS(kXULNS, "toolbar");
- printPreviewTB.setAttribute("printpreview", true);
- printPreviewTB.setAttribute("id", "print-preview-toolbar");
-
- gContent.parentNode.insertBefore(printPreviewTB, gContent);
-}
-
-function BrowserExitPrintPreview()
-{
- window.close();
-}
-
-function initHTMLView()
-{
- //printwindow.document.open();
- gHtmlDocument.write("<html><head><title>"+windowTitle+"</title></head><body
style='font-size:11px;'>");
- if (gMyTitle.length > 0)
- {
-// gHtmlDocument.write("<tr><td colspan=3 align=center
style='font-size:26px;font-weight:bold;'>>");
-// gHtmlDocument.write("<tr><td colspan=2 align=center
style='font-size:26px;font-weight:bold;'>");
-// gHtmlDocument.write(mytitle);
-// gHtmlDocument.write("</td></tr>");
-
- gHtmlDocument.write("<table border=0 width=100%
style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>");
- gHtmlDocument.write(gMyTitle);
- gHtmlDocument.write("</td></tr></table>");
- }
- return gHtmlDocument ;
-}
-
-function finishHTMLView()
-{
- gHtmlDocument.write("</body></html>");
- gHtmlDocument.close();
-}
-
-function printMultiWeekView(currentDate) {
-
-var dayStart=currentDate.getDate();
-var dowStart = (startOfWeek <= currentDate.getDay()) ?
currentDate.getDay()-startOfWeek : 7-startOfWeek;
-var weekStart=new Date(currentDate.getFullYear(), currentDate.getMonth(),
dayStart - dowStart - (prevWeeksInView*7));
-
-var weekNumber = DateUtils.getWeekNumber(currentDate) ;
-
-gHtmlDocument.write("<table border=0 width=100%
style='font-size:26px;font-weight:bold;'><tr ><td align=center
valign=bottom>Week "+weekNumber+"</td></tr></table>");
-gHtmlDocument.write("<table style='border:1px solid black;' width=100%>")
-gHtmlDocument.write("<tr>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[weekStart.getDay()]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+1 >6) ?
weekStart.getDay()+1-7:weekStart.getDay()+1]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+2 >6) ?
weekStart.getDay()+2-7:weekStart.getDay()+2]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+3 >6) ?
weekStart.getDay()+3-7:weekStart.getDay()+3]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+4 >6) ?
weekStart.getDay()+4-7:weekStart.getDay()+4]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+5 >6) ?
weekStart.getDay()+5-7:weekStart.getDay()+5]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+6 >6) ?
weekStart.getDay()+6-7:weekStart.getDay()+6]+"</td>");
-gHtmlDocument.write("</tr>");
-// content here
-dayToStart=weekStart.getDate();
-monthToStart=weekStart.getMonth();
-yearToStart=weekStart.getFullYear();
-
-for (var w=0; w<weeksInView; w++)
-{
-gHtmlDocument.write("<tr>");
-for (var i=0; i<7; i++)
-{
- var thisDaysDate=new Date(yearToStart, monthToStart, dayToStart+i+(w*7));
- gHtmlDocument.write("<td style='border:1px solid black;' valign=top
width=14%>");
- gHtmlDocument.write("<table valign=top height=100 width=100% border=0>");
- gHtmlDocument.write("<tr valign=top><td colspan=2 align=center valign=top
>");
- gHtmlDocument.write(monthNames[thisDaysDate.getMonth()].substring(0,3)+"
"+thisDaysDate.getDate());
- gHtmlDocument.write("</td></tr>");
- gHtmlDocument.write("<tr valign=top><td valign=top width=20%></td><td
valign=top width=80%></td></tr>");
- var calendarEventDisplay
- // add each calendarEvent
- dayEventList = eventSource.getEventsForDay( thisDaysDate );
-
- for( var eventIndex = 0; eventIndex < dayEventList.length; eventIndex++ )
- {
- calendarEventDisplay = dayEventList[ eventIndex ];
- var listpriv=true;
- if (calendarEventDisplay.event.privateEvent)
- if (! gShowprivate.checked)
- listpriv=false;
- if (listpriv)
- {
- eventTitle=calendarEventDisplay.event.title;
- var eventStartTime = new Date(
calendarEventDisplay.event.start.getTime() ) ;
- var formattedStartTime=returnTime(eventStartTime);
- var eventEndTime = new Date(
calendarEventDisplay.event.end.getTime() ) ;
- var formattedEndTime=returnTime(eventEndTime);
- var
formattedTime=formattedStartTime+"-"+formattedEndTime;
- if (calendarEventDisplay.event.allDay)
- formattedTime=''; // all day event
- if (calendarEventDisplay.event.allDay)
- gHtmlDocument.write("<tr valign=top><td valign=top
colspan=2 style='font-size:11px;'>");
- else
- gHtmlDocument.write("<tr valign=top><td valign=top
colspan=2 style='font-size:11px;'>"+formattedTime+"</td></tr><tr><td></td><td
valign=top style='font-size:11px;'>");
- gHtmlDocument.write(eventTitle);
- if (calendarEventDisplay.event.location)
- gHtmlDocument.write("</td></tr><tr
valign=top><td></td><td valign=top style='font-size:11px;'>"+locationTag+":
"+calendarEventDisplay.event.location);
- if (calendarEventDisplay.event.url)
- gHtmlDocument.write("</td></tr><tr
valign=top><td></td><td valign=top style='font-size:11px;'>"+uriTag+":
"+calendarEventDisplay.event.url);
- gHtmlDocument.write("</td></tr>");
- }
- }
- gHtmlDocument.write("</table>");
-
-}
-gHtmlDocument.write("</tr>");
-} // end of all weeks
-gHtmlDocument.write("</table>")
-}
-
-
-function printWeekView(currentDate) {
-var dayStart=currentDate.getDate();
-var dowStart = (startOfWeek <= currentDate.getDay()) ?
currentDate.getDay()-startOfWeek : 7-startOfWeek;
-var weekStart=new Date(currentDate.getFullYear(), currentDate.getMonth(),
dayStart - dowStart);
-var weekNumber = DateUtils.getWeekNumber(currentDate) ;
-
-gHtmlDocument.write("<table border=0 width=100%
style='font-size:26px;font-weight:bold;'><tr ><td align=center
valign=bottom>Week "+weekNumber+"</td></tr></table>");
-gHtmlDocument.write("<table style='border:1px solid black;' width=100%>")
-gHtmlDocument.write("<tr>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[weekStart.getDay()]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+1 >6) ?
weekStart.getDay()+1-7:weekStart.getDay()+1]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+2 >6) ?
weekStart.getDay()+2-7:weekStart.getDay()+2]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+3 >6) ?
weekStart.getDay()+3-7:weekStart.getDay()+3]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+4 >6) ?
weekStart.getDay()+4-7:weekStart.getDay()+4]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+5 >6) ?
weekStart.getDay()+5-7:weekStart.getDay()+5]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+6 >6) ?
weekStart.getDay()+6-7:weekStart.getDay()+6]+"</td>");
-gHtmlDocument.write("</tr>");
-// content here
-dayToStart=weekStart.getDate();
-monthToStart=weekStart.getMonth();
-yearToStart=weekStart.getFullYear();
-
-gHtmlDocument.write("<tr>");
-for (var i=0; i<7; i++)
-{
- var thisDaysDate=new Date(yearToStart, monthToStart, dayToStart+i);
- gHtmlDocument.write("<td style='border:1px solid black;' valign=top
width=14% height=500>");
- gHtmlDocument.write("<table valign=top width=100 border=0>"); // to force
uniform width
- gHtmlDocument.write("<tr valign=top><td valign=top colspan=2
align=center>");
- gHtmlDocument.write(monthNames[thisDaysDate.getMonth()].substring(0,3)+"
"+thisDaysDate.getDate());
- gHtmlDocument.write("</td></tr>");
- gHtmlDocument.write("<tr><td width=20%></td><td width=80%></td></tr>");
- var calendarEventDisplay
- // add each calendarEvent
- dayEventList = eventSource.getEventsForDay( thisDaysDate );
-
- for( var eventIndex = 0; eventIndex < dayEventList.length; eventIndex++ )
- {
- calendarEventDisplay = dayEventList[ eventIndex ];
- var listpriv=true;
- if (calendarEventDisplay.event.privateEvent)
- if (! gShowprivate.checked)
- listpriv=false;
- if (listpriv)
- {
- eventTitle=calendarEventDisplay.event.title;
- var eventStartTime = new Date(
calendarEventDisplay.event.start.getTime() ) ;
- var formattedStartTime=returnTime(eventStartTime);
- var eventEndTime = new Date(
calendarEventDisplay.event.end.getTime() ) ;
- var formattedEndTime=returnTime(eventEndTime);
- var
formattedTime=formattedStartTime+"-"+formattedEndTime;
- if (calendarEventDisplay.event.allDay)
- gHtmlDocument.write("<tr valign=top><td valign=top
colspan=2 style='font-size:11px;'>");
- else
- gHtmlDocument.write("<tr valign=top><td valign=top
colspan=2 style='font-size:11px;'>"+formattedTime+"</td></tr><tr><td></td><td
valign=top style='font-size:11px;'>");
- gHtmlDocument.write(eventTitle);
- if (calendarEventDisplay.event.location)
- gHtmlDocument.write("</td></tr><tr
valign=top><td></td><td valign=top style='font-size:11px;'>"+locationTag+":
"+calendarEventDisplay.event.location);
- if (calendarEventDisplay.event.url)
- gHtmlDocument.write("</td></tr><tr
valign=top><td></td><td valign=top style='font-size:11px;'>"+uriTag+":
"+calendarEventDisplay.event.url);
- gHtmlDocument.write("</td></tr>");
- }
- }
- gHtmlDocument.write("</table>");
-
-}
-gHtmlDocument.write("</tr>");
-
-gHtmlDocument.write("</table>")
-}
-
-function printDayView(currentDate) {
-var dayStart = currentDate.getDate();
-
-var mydateshow="";
-mydateshow+=ArrayOfDayNames[currentDate.getDay()];
-mydateshow+=", ";
-mydateshow+=monthNames[currentDate.getMonth()]+" "+currentDate.getDate()+"
"+currentDate.getFullYear();
-gHtmlDocument.write("<tr ><td colspan=2 align=center
style='font-size:26px;font-weight:bold;border-bottom:1px solid black;'>");
-gHtmlDocument.write(mydateshow);
-gHtmlDocument.write("</td></tr>");
-gHtmlDocument.write("<tr><td width=20% style='border-bottom:1px solid
black;'>Time</td><td width=80% style='border-bottom:1px solid
black;'>Event</td></tr>");
-gHtmlDocument.write("<tr style='height=20px;'><td colspan=2
style='border-bottom:1px solid black;'> </td></tr>"); // for entering a new
appt
-var calendarEventDisplay
- // add each calendarEvent
-dayEventList = eventSource.getEventsForDay( currentDate );
-
-for( var eventIndex = 0; eventIndex < dayEventList.length; eventIndex++ )
- {
- calendarEventDisplay = dayEventList[ eventIndex ];
-
- var listpriv=true;
- if (calendarEventDisplay.event.privateEvent)
- if (! gShowprivate.checked)
- listpriv=false;
- if (listpriv)
- {
- gHtmlDocument.write("<tr style='height=20px;'><td valign=top
style='border-bottom:1px solid black;'>");
- var eventStartTime = new Date(
calendarEventDisplay.event.start.getTime() ) ;
- var formattedStartTime=returnTime(eventStartTime);
- var eventEndTime = new Date(
calendarEventDisplay.event.end.getTime() ) ;
- var formattedEndTime=returnTime(eventEndTime);
- var formattedTime=formattedStartTime+"-"+formattedEndTime;
- if (calendarEventDisplay.event.allDay)
- formattedTime=''; // all day event
- gHtmlDocument.write(formattedTime);
- gHtmlDocument.write("</td><td valign=top style='border-bottom:1px
solid black;'>"+calendarEventDisplay.event.title);
- if (calendarEventDisplay.event.description)
- gHtmlDocument.write("<br>"+descriptionTag+":
"+calendarEventDisplay.event.description);
- if (calendarEventDisplay.event.location)
- gHtmlDocument.write("<br>"+locationTag+":
"+calendarEventDisplay.event.location);
- if (calendarEventDisplay.event.url)
- gHtmlDocument.write("<br>"+uriTag+":
"+calendarEventDisplay.event.url);
- var mystat='Cancelled';
- if (calendarEventDisplay.event.status == 10029)
- mystat='Tentative';
- if (calendarEventDisplay.event.status == 10030)
- mystat='Confirmed';
- gHtmlDocument.write("<br>Status: "+mystat);
- gHtmlDocument.write("</td></tr>");
- gHtmlDocument.write("<tr style='height=20px;'><td colspan=2
style='border-bottom:1px solid black;'> </td></tr>"); // for entering a new
appt
- }
- }
-
-gHtmlDocument.write("</table>");
-}
-
-function printEventArray( calendarEventArray)
-{
- gHtmlDocument.write("<tr><td width=20%>Starts</td><td
width=20%>Ends</td><td width=60%>Event</td></tr>");
- for (i in calendarEventArray)
- {
- var calEvent=calendarEventArray[i];
- var useit=true;
-
- if (calEvent.privateEvent)
- if (! gShowprivate.checked)
- useit=false;
- if (useit)
- {
- gHtmlDocument.write("<tr><td valign=top>");
- if (calEvent.allDay)
- {
- gHtmlDocument.write("All Day");
- gHtmlDocument.write("</td><td>");
- }
- else
- {
- gHtmlDocument.write(calEvent.start);
- gHtmlDocument.write("</td><td valign=top>");
- gHtmlDocument.write(calEvent.end);
- }
- gHtmlDocument.write("</td><td valign=top>");
- gHtmlDocument.write(calEvent.title);
- if (calEvent.description)
- gHtmlDocument.write("<br>"+descriptionTag+":
"+calEvent.description);
- if (calEvent.location)
- gHtmlDocument.write("<br>"+locationTag+": "+calEvent.location);
- if (calEvent.url)
- gHtmlDocument.write("<br>"+uriTag+": "+calEvent.url);
- var mystat='Cancelled';
- if (calEvent.status == 10029)
- mystat='Tentative';
- if (calEvent.status == 10030)
- mystat='Confirmed';
-
- gHtmlDocument.write("<br>Status: "+mystat);
- gHtmlDocument.write("</td></tr>");
- }
- }
- gHtmlDocument.write("</table>");
-}
-
-
-
-function printMonthView(currentDate) {
-// ok first let's get the array of events for this month.
-var calDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
-var dayFirst = calDate.getDay();
-var dowStart = (startOfWeek <= dayFirst) ? dayFirst-startOfWeek :
7-startOfWeek;
-var weekStart=new Date(calDate.getFullYear(),calDate.getMonth(),1-dowStart);
-var startOfMonthDate = new Date(currentDate.getFullYear(),
currentDate.getMonth(), 1);
-var endOfMonthDate = new Date(currentDate.getFullYear(),
currentDate.getMonth()+1, 0);
-var daysInMonth = endOfMonthDate.getDate();
-
-gHtmlDocument.write("<table border=0 width=100%
style='font-size:26px;font-weight:bold;'><tr ><td align=center
valign=bottom>"+monthNames[currentDate.getMonth()]+"
"+currentDate.getFullYear()+"</td></tr></table>");
-gHtmlDocument.write("<table style='border:1px solid black;' width=100%>")
-gHtmlDocument.write("<tr>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[weekStart.getDay()]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+1 >6) ?
weekStart.getDay()+1-7:weekStart.getDay()+1]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+2 >6) ?
weekStart.getDay()+2-7:weekStart.getDay()+2]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+3 >6) ?
weekStart.getDay()+3-7:weekStart.getDay()+3]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+4 >6) ?
weekStart.getDay()+4-7:weekStart.getDay()+4]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+5 >6) ?
weekStart.getDay()+5-7:weekStart.getDay()+5]+"</td>");
-gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+6 >6) ?
weekStart.getDay()+6-7:weekStart.getDay()+6]+"</td>");
-gHtmlDocument.write("</tr>");
-
-
-dayToStart=weekStart.getDate();
-monthToStart=weekStart.getMonth();
-yearToStart=weekStart.getFullYear();
-var inMonth=true;
-var thisDaysDate=new Date(yearToStart, monthToStart, dayToStart);
-
-for (var w=0; w<6; w++)
-{
- if (inMonth)
- {
- gHtmlDocument.write("<tr>");
- for (var i=0; i<7; i++)
- {
- gHtmlDocument.write("<td align=left valign=top style='border:1px solid
black;vertical-alignment:top;' >");
- gHtmlDocument.write("<table valign=top height=100 width=100
style='font-size:10px;'><tr valign=top><td valign=top width=20%>");
- if (thisDaysDate.getMonth()==currentDate.getMonth())
- gHtmlDocument.write(thisDaysDate.getDate());
- gHtmlDocument.write("</td><td width=80% valign=top></td></tr>");
- if (thisDaysDate.getMonth()==currentDate.getMonth())
- {
- dayEventList = eventSource.getEventsForDay( thisDaysDate );
- var calendarEventDisplay
- // add each calendarEvent
- for( var eventIndex = 0; eventIndex < dayEventList.length;
eventIndex++ )
- {
- calendarEventDisplay = dayEventList[ eventIndex ];
- var listpriv=true;
- if (calendarEventDisplay.event.privateEvent)
- if (! gShowprivate.checked)
- listpriv=false;
- if (listpriv)
- {
- eventTitle=calendarEventDisplay.event.title;
- var eventStartTime = new Date(
calendarEventDisplay.event.start.getTime() ) ;
- var formattedStartTime=returnTime(eventStartTime);
- if (calendarEventDisplay.event.allDay)
- gHtmlDocument.write("<tr><td valign=top colspan=2
style='font-size:11px;'>");
- else
- gHtmlDocument.write("<tr><td valign=top align=right
style='font-size:11px;'>"+formattedStartTime+"</td><td valign=top
style='font-size:11px;'>");
- gHtmlDocument.write(eventTitle);
- gHtmlDocument.write("</td></tr>");
- }
- } //end of events
- } // if it was in the month
- gHtmlDocument.write("</table>");
- gHtmlDocument.write("</td>")
- //advance to the next day
- thisDaysDate.setDate(thisDaysDate.getDate()+1);
- } //end of each day
- gHtmlDocument.write("</tr>");
- } // ok it was in the month
- if((thisDaysDate.getMonth() > currentDate.getMonth())||
- (thisDaysDate.getFullYear() > currentDate.getFullYear()) )
- inMonth=false;
-} // end of each week
-
-gHtmlDocument.write("</table>")
-}
-
-function returnTime(timeval) {
- retval= gCalendarWindow.dateFormater.getFormatedTime( timeval );
- if (retval.indexOf("AM")>-1)
- retval=retval.substring(0,retval.indexOf("AM")-1)+'a';
- if (retval.indexOf("PM")>-1)
- retval=retval.substring(0,retval.indexOf("PM")-1)+'p';
- if (retval=='12:00p')
- retval='Noon';
- return retval;
-}
-
-
-function getWeekNumberOfMonth()
-{
- //get the day number for today.
- var startTime = document.getElementById( "start-date-picker" ).value;
-
- var oldStartTime = startTime;
-
- var thisMonth = startTime.getMonth();
-
- var monthToCompare = thisMonth;
-
- var weekNumber = 0;
-
- while( monthToCompare == thisMonth )
- {
- startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 )
);
-
- monthToCompare = startTime.getMonth();
-
- weekNumber++;
- }
-
- return( weekNumber );
-}
-
-function isLastDayOfWeekOfMonth()
-{
- //get the day number for today.
- var startTime = document.getElementById( "start-date-picker" ).value;
-
- var oldStartTime = startTime;
-
- var thisMonth = startTime.getMonth();
-
- var monthToCompare = thisMonth;
-
- var weekNumber = 0;
-
- while( monthToCompare == thisMonth )
- {
- startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 )
);
-
- monthToCompare = startTime.getMonth();
-
- weekNumber++;
- }
-
- if( weekNumber > 3 )
- {
- var nextWeek = new Date( oldStartTime.getTime() + ( 1000 * 60 * 60 * 24
* 7 ) );
-
- if( nextWeek.getMonth() != thisMonth )
- {
- //its the last week of the month
- return( true );
- }
- }
-
- return( false );
-}
-
-
-function getWeekNumberText( weekNumber )
-{
- switch( weekNumber )
- {
- case 1:
- return( "First" );
- case 2:
- return( "Second" );
- case 3:
- return( "Third" );
- case 4:
- return( "Fourth" );
- case 5:
- return( "Last" );
- default:
- return( false );
- }
-
-}
-
-
-/**
-* Take a Date object and return a displayable date string i.e.: May 5, 1959
-* :TODO: This should be moved into DateFormater and made to use some kind of
-* locale or user date format preference.
-*/
-
-function formatDate( date )
-{
- return( gCalendarWindow.dateFormater.getFormatedDate( date ) );
-}
-
-
-function debug( Text )
-{
- dump( "\ncalPrintEngine.js :"+ Text + "\n");
-
-}
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is OEone Calendar Code, released October 31st, 2001.
+ *
+ * The Initial Developer of the Original Code is
+ * OEone Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2001
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Garth Smedley <garths@oeone.com>
+ * Mike Potter <mikep@oeone.com>
+ * Colin Phillips <colinp@oeone.com>
+ * Chris Charabaruk <ccharabaruk@meldstar.com>
+ * ArentJan Banck <ajbanck@planet.nl>
+ * Chris Allen
+ * Eric Belhaire <belhaire@ief.u-psud.fr>
+ * Justin Wood <Videolego@aol.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+/*-----------------------------------------------------------------
+ * W I N D O W V A R I A B L E S
+ */
+
+
+
+this.dateStringBundle = document.getElementById("bundle_date");
+
+var monthNames=new Array(12);
+monthNames[0] = this.dateStringBundle.getString( "month.1.name" );
+monthNames[1] = this.dateStringBundle.getString( "month.2.name" );
+monthNames[2] = this.dateStringBundle.getString( "month.3.name" );
+monthNames[3] = this.dateStringBundle.getString( "month.4.name" );
+monthNames[4] = this.dateStringBundle.getString( "month.5.name" );
+monthNames[5] = this.dateStringBundle.getString( "month.6.name" );
+monthNames[6] = this.dateStringBundle.getString( "month.7.name" );
+monthNames[7] = this.dateStringBundle.getString( "month.8.name" );
+monthNames[8] = this.dateStringBundle.getString( "month.9.name" );
+monthNames[9] = this.dateStringBundle.getString( "month.10.name" );
+monthNames[10]= this.dateStringBundle.getString( "month.11.name" );
+monthNames[11]= this.dateStringBundle.getString( "month.12.name" );
+
+
+var eventSource; // event source sent by opener
+var weeksInView;
+var prevWeeksInView;
+var startOfWeek;
+var gMyTitle;
+var gShowprivate ;
+var gCalendarWindow ;
+var gHtmlDocument ;
+
+var gPrintSettingsAreGlobal = true;
+var gSavePrintSettings = true;
+var gPrintSettings = null;
+var gWebProgress = null;
+
+/*-----------------------------------------------------------------
+ * W I N D O W F U N C T I O N S
+ */
+
+function getWebNavigation()
+{
+ try {
+ return gContent.webNavigation;
+ } catch (e) {
+ return null;
+ }
+}
+
+function BrowserPrintPreview()
+{
+ var ifreq;
+ var webBrowserPrint;
+ try {
+ ifreq =
_content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
+ webBrowserPrint =
ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
+ gPrintSettings = GetPrintSettings();
+
+ } catch (e) {
+ // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
+ // causing an exception to be thrown which we catch here.
+ // Unfortunately this will also consume helpful failures, so add a
+ // dump(e); // if you need to debug
+ }
+ gWebProgress = new Object();
+
+ var printPreviewParams = new Object();
+ var notifyOnOpen = new Object();
+ var printingPromptService =
Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
+
.getService(Components.interfaces.nsIPrintingPromptService);
+ if (printingPromptService) {
+ FinishPrintPreview();
+ }
+}
+
+function FinishPrintPreview()
+{
+ try {
+ var ifreq =
_content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
+ var webBrowserPrint =
ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
+ if (webBrowserPrint) {
+ gPrintSettings = GetPrintSettings();
+ webBrowserPrint.printPreview(gPrintSettings, null, gWebProgress.value);
+ }
+ showPrintPreviewToolbar();
+
+ _content.focus();
+ } catch (e) {
+ // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
+ // causing an exception to be thrown which we catch here.
+ // Unfortunately this will also consume helpful failures, so add a
+ // dump(e); // if you need to debug
+ }
+}
+
+/*-----------------------------------------------------------------
+ * Called when the dialog is loaded.
+ */
+
+function OnLoadPrintEngine(){
+ gContent = document.getElementById("content") ;
+
+ if ( window.arguments && window.arguments[0] != null ) {
+ HTMLViewFunction = window.arguments[0] ;
+ HTMLFunctionArgs = window.arguments[1] ;
+ gMyTitle = window.arguments[2] ;
+ gShowprivate = window.arguments[3] ;
+ gArgs = window.arguments[4] ;
+ gCalendarWindow = window.arguments[5] ;
+ eventSource=gArgs.eventSource;
+ weeksInView=gArgs.weeksInView;
+ prevWeeksInView=gArgs.prevWeeksInView;
+ startOfWeek=gArgs.startOfWeek;
+
+ gHtmlDocument = window._content.document ;
+ initHTMLView();
+ eval(HTMLViewFunction)(HTMLFunctionArgs);
+ finishHTMLView() ;
+ }
+ BrowserPrintPreview();
+}
+
+function OnUnloadPrintEngine()
+{
+}
+
+function showPrintPreviewToolbar()
+{
+ const kXULNS =
+ "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+
+ var printPreviewTB = document.createElementNS(kXULNS, "toolbar");
+ printPreviewTB.setAttribute("printpreview", true);
+ printPreviewTB.setAttribute("id", "print-preview-toolbar");
+
+ gContent.parentNode.insertBefore(printPreviewTB, gContent);
+}
+
+function BrowserExitPrintPreview()
+{
+ window.close();
+}
+
+function initHTMLView()
+{
+ //printwindow.document.open();
+ gHtmlDocument.write("<html><head><title>"+windowTitle+"</title></head><body
style='font-size:11px;'>");
+ if (gMyTitle.length > 0)
+ {
+// gHtmlDocument.write("<tr><td colspan=3 align=center
style='font-size:26px;font-weight:bold;'>>");
+// gHtmlDocument.write("<tr><td colspan=2 align=center
style='font-size:26px;font-weight:bold;'>");
+// gHtmlDocument.write(mytitle);
+// gHtmlDocument.write("</td></tr>");
+
+ gHtmlDocument.write("<table border=0 width=100%
style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>");
+ gHtmlDocument.write(gMyTitle);
+ gHtmlDocument.write("</td></tr></table>");
+ }
+ return gHtmlDocument;
+}
+
+function finishHTMLView()
+{
+ gHtmlDocument.write("</body></html>");
+ gHtmlDocument.close();
+}
+
+function printMultiWeekView(currentDate)
+{
+ var dayStart=currentDate.getDate();
+ var dowStart = (startOfWeek <= currentDate.getDay()) ?
currentDate.getDay()-startOfWeek : 7-startOfWeek;
+ var weekStart=new Date(currentDate.getFullYear(), currentDate.getMonth(),
dayStart - dowStart - (prevWeeksInView*7));
+
+ var weekNumber = DateUtils.getWeekNumber(currentDate) ;
+
+ gHtmlDocument.write("<table border=0 width=100%
style='font-size:26px;font-weight:bold;'><tr ><td align=center
valign=bottom>Week "+weekNumber+"</td></tr></table>");
+ gHtmlDocument.write("<table style='border:1px solid black;' width=100%>")
+ gHtmlDocument.write("<tr>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[weekStart.getDay()]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+1 >6) ?
weekStart.getDay()+1-7:weekStart.getDay()+1]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+2 >6) ?
weekStart.getDay()+2-7:weekStart.getDay()+2]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+3 >6) ?
weekStart.getDay()+3-7:weekStart.getDay()+3]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+4 >6) ?
weekStart.getDay()+4-7:weekStart.getDay()+4]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+5 >6) ?
weekStart.getDay()+5-7:weekStart.getDay()+5]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+6 >6) ?
weekStart.getDay()+6-7:weekStart.getDay()+6]+"</td>");
+ gHtmlDocument.write("</tr>");
+
+ // content here
+ dayToStart=weekStart.getDate();
+ monthToStart=weekStart.getMonth();
+ yearToStart=weekStart.getFullYear();
+
+ for (var w=0; w<weeksInView; w++)
+ {
+ gHtmlDocument.write("<tr>");
+ for (var i=0; i<7; i++)
+ {
+ var thisDaysDate=new Date(yearToStart, monthToStart,
dayToStart+i+(w*7));
+ gHtmlDocument.write("<td style='border:1px solid black;' valign=top
width=14%>");
+ gHtmlDocument.write("<table valign=top height=100 width=100%
border=0>");
+ gHtmlDocument.write("<tr valign=top><td colspan=2 align=center
valign=top >");
+ gHtmlDocument.write(monthNames[thisDaysDate.getMonth()].substring(0,3)+"
"+thisDaysDate.getDate());
+ gHtmlDocument.write("</td></tr>");
+ gHtmlDocument.write("<tr valign=top><td valign=top width=20%></td><td
valign=top width=80%></td></tr>");
+ var calendarEventDisplay
+ // add each calendarEvent
+ dayEventList = eventSource.getEventsForDay( thisDaysDate );
+
+ for( var eventIndex = 0; eventIndex < dayEventList.length; eventIndex++
)
+ {
+ calendarEventDisplay = dayEventList[ eventIndex ];
+ var listpriv=true;
+ if (calendarEventDisplay.event.privateEvent)
+ if (! gShowprivate.checked)
+ listpriv=false;
+ if (listpriv)
+ {
+ eventTitle=calendarEventDisplay.event.title;
+ var eventStartTime = new Date(
calendarEventDisplay.event.start.getTime() ) ;
+ var formattedStartTime=returnTime(eventStartTime);
+ var eventEndTime = new Date(
calendarEventDisplay.event.end.getTime() ) ;
+ var formattedEndTime=returnTime(eventEndTime);
+ var formattedTime=formattedStartTime+"-"+formattedEndTime;
+ if (calendarEventDisplay.event.allDay)
+ formattedTime=''; // all day event
+ if (calendarEventDisplay.event.allDay)
+ gHtmlDocument.write("<tr valign=top><td valign=top colspan=2
style='font-size:11px;'>");
+ else
+ gHtmlDocument.write("<tr valign=top><td valign=top colspan=2
style='font-size:11px;'>"+formattedTime+"</td></tr><tr><td></td><td valign=top
style='font-size:11px;'>");
+ gHtmlDocument.write(eventTitle);
+ if (calendarEventDisplay.event.location)
+ gHtmlDocument.write("</td></tr><tr valign=top><td></td><td
valign=top style='font-size:11px;'>"+locationTag+":
"+calendarEventDisplay.event.location);
+ if (calendarEventDisplay.event.url)
+ gHtmlDocument.write("</td></tr><tr valign=top><td></td><td
valign=top style='font-size:11px;'>"+uriTag+":
"+calendarEventDisplay.event.url);
+ gHtmlDocument.write("</td></tr>");
+ }
+ }
+ gHtmlDocument.write("</table>");
+ }
+ gHtmlDocument.write("</tr>");
+ } // end of all weeks
+ gHtmlDocument.write("</table>")
+}
+
+function printWeekView(currentDate)
+{
+ var dayStart=currentDate.getDate();
+ var dowStart = (startOfWeek <= currentDate.getDay()) ?
currentDate.getDay()-startOfWeek : 7-startOfWeek;
+ var weekStart=new Date(currentDate.getFullYear(), currentDate.getMonth(),
dayStart - dowStart);
+ var weekNumber = DateUtils.getWeekNumber(currentDate) ;
+
+ gHtmlDocument.write("<table border=0 width=100%
style='font-size:26px;font-weight:bold;'><tr ><td align=center
valign=bottom>Week "+weekNumber+"</td></tr></table>");
+ gHtmlDocument.write("<table style='border:1px solid black;' width=100%>")
+ gHtmlDocument.write("<tr>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[weekStart.getDay()]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+1 >6) ?
weekStart.getDay()+1-7:weekStart.getDay()+1]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+2 >6) ?
weekStart.getDay()+2-7:weekStart.getDay()+2]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+3 >6) ?
weekStart.getDay()+3-7:weekStart.getDay()+3]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+4 >6) ?
weekStart.getDay()+4-7:weekStart.getDay()+4]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+5 >6) ?
weekStart.getDay()+5-7:weekStart.getDay()+5]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+6 >6) ?
weekStart.getDay()+6-7:weekStart.getDay()+6]+"</td>");
+ gHtmlDocument.write("</tr>");
+ // content here
+ dayToStart=weekStart.getDate();
+ monthToStart=weekStart.getMonth();
+ yearToStart=weekStart.getFullYear();
+
+ gHtmlDocument.write("<tr>");
+ for (var i=0; i<7; i++)
+ {
+ var thisDaysDate=new Date(yearToStart, monthToStart, dayToStart+i);
+ gHtmlDocument.write("<td style='border:1px solid black;' valign=top
width=14% height=500>");
+ gHtmlDocument.write("<table valign=top width=100 border=0>"); // to force
uniform width
+ gHtmlDocument.write("<tr valign=top><td valign=top colspan=2
align=center>");
+ gHtmlDocument.write(monthNames[thisDaysDate.getMonth()].substring(0,3)+"
"+thisDaysDate.getDate());
+ gHtmlDocument.write("</td></tr>");
+ gHtmlDocument.write("<tr><td width=20%></td><td width=80%></td></tr>");
+ var calendarEventDisplay
+ // add each calendarEvent
+ dayEventList = eventSource.getEventsForDay( thisDaysDate );
+
+ for( var eventIndex = 0; eventIndex < dayEventList.length; eventIndex++ )
+ {
+ calendarEventDisplay = dayEventList[ eventIndex ];
+ var listpriv=true;
+ if (calendarEventDisplay.event.privateEvent)
+ if (! gShowprivate.checked)
+ listpriv=false;
+ if (listpriv)
+ {
+ eventTitle=calendarEventDisplay.event.title;
+ var eventStartTime = new Date(
calendarEventDisplay.event.start.getTime() ) ;
+ var formattedStartTime=returnTime(eventStartTime);
+ var eventEndTime = new Date( calendarEventDisplay.event.end.getTime()
) ;
+ var formattedEndTime=returnTime(eventEndTime);
+ var formattedTime=formattedStartTime+"-"+formattedEndTime;
+ if (calendarEventDisplay.event.allDay)
+ gHtmlDocument.write("<tr valign=top><td valign=top colspan=2
style='font-size:11px;'>");
+ else
+ gHtmlDocument.write("<tr valign=top><td valign=top colspan=2
style='font-size:11px;'>"+formattedTime+"</td></tr><tr><td></td><td valign=top
style='font-size:11px;'>");
+ gHtmlDocument.write(eventTitle);
+ if (calendarEventDisplay.event.location)
+ gHtmlDocument.write("</td></tr><tr valign=top><td></td><td
valign=top style='font-size:11px;'>"+locationTag+":
"+calendarEventDisplay.event.location);
+ if (calendarEventDisplay.event.url)
+ gHtmlDocument.write("</td></tr><tr valign=top><td></td><td
valign=top style='font-size:11px;'>"+uriTag+":
"+calendarEventDisplay.event.url);
+ gHtmlDocument.write("</td></tr>");
+ }
+ }
+ gHtmlDocument.write("</table>");
+
+ }
+ gHtmlDocument.write("</tr>");
+
+ gHtmlDocument.write("</table>")
+}
+
+function printDayView(currentDate) {
+ var dayStart = currentDate.getDate();
+
+ var mydateshow="";
+ mydateshow+=ArrayOfDayNames[currentDate.getDay()];
+ mydateshow+=", ";
+ mydateshow+=monthNames[currentDate.getMonth()]+" "+currentDate.getDate()+"
"+currentDate.getFullYear();
+ gHtmlDocument.write("<tr ><td colspan=2 align=center
style='font-size:26px;font-weight:bold;border-bottom:1px solid black;'>");
+ gHtmlDocument.write(mydateshow);
+ gHtmlDocument.write("</td></tr>");
+ gHtmlDocument.write("<tr><td width=20% style='border-bottom:1px solid
black;'>Time</td><td width=80% style='border-bottom:1px solid
black;'>Event</td></tr>");
+ gHtmlDocument.write("<tr style='height=20px;'><td colspan=2
style='border-bottom:1px solid black;'> </td></tr>"); // for entering a new
appt
+ var calendarEventDisplay
+ // add each calendarEvent
+ dayEventList = eventSource.getEventsForDay( currentDate );
+
+ for( var eventIndex = 0; eventIndex < dayEventList.length; eventIndex++ )
+ {
+ calendarEventDisplay = dayEventList[ eventIndex ];
+
+ var listpriv=true;
+ if (calendarEventDisplay.event.privateEvent)
+ if (! gShowprivate.checked)
+ listpriv=false;
+ if (listpriv)
+ {
+ gHtmlDocument.write("<tr style='height=20px;'><td valign=top
style='border-bottom:1px solid black;'>");
+ var eventStartTime = new Date(
calendarEventDisplay.event.start.getTime() ) ;
+ var formattedStartTime=returnTime(eventStartTime);
+ var eventEndTime = new Date( calendarEventDisplay.event.end.getTime() )
;
+ var formattedEndTime=returnTime(eventEndTime);
+ var formattedTime=formattedStartTime+"-"+formattedEndTime;
+ if (calendarEventDisplay.event.allDay)
+ formattedTime=''; // all day event
+ gHtmlDocument.write(formattedTime);
+ gHtmlDocument.write("</td><td valign=top style='border-bottom:1px solid
black;'>"+calendarEventDisplay.event.title);
+ if (calendarEventDisplay.event.description)
+ gHtmlDocument.write("<br>"+descriptionTag+":
"+calendarEventDisplay.event.description);
+ if (calendarEventDisplay.event.location)
+ gHtmlDocument.write("<br>"+locationTag+":
"+calendarEventDisplay.event.location);
+ if (calendarEventDisplay.event.url)
+ gHtmlDocument.write("<br>"+uriTag+":
"+calendarEventDisplay.event.url);
+ var mystat='Cancelled';
+ if (calendarEventDisplay.event.status == 10029)
+ mystat='Tentative';
+ if (calendarEventDisplay.event.status == 10030)
+ mystat='Confirmed';
+ gHtmlDocument.write("<br>Status: "+mystat);
+ gHtmlDocument.write("</td></tr>");
+ gHtmlDocument.write("<tr style='height=20px;'><td colspan=2
style='border-bottom:1px solid black;'> </td></tr>"); // for entering a new
appt
+ }
+ }
+
+ gHtmlDocument.write("</table>");
+}
+
+function printEventArray( calendarEventArray)
+{
+ gHtmlDocument.write("<tr><td width=20%>Starts</td><td width=20%>Ends</td><td
width=60%>Event</td></tr>");
+ for (i in calendarEventArray)
+ {
+ var calEvent=calendarEventArray[i];
+ var useit=true;
+
+ if (calEvent.privateEvent)
+ if (! gShowprivate.checked)
+ useit=false;
+ if (useit)
+ {
+ gHtmlDocument.write("<tr><td valign=top>");
+ if (calEvent.allDay)
+ {
+ gHtmlDocument.write("All Day");
+ gHtmlDocument.write("</td><td>");
+ } else {
+ gHtmlDocument.write(calEvent.start);
+ gHtmlDocument.write("</td><td valign=top>");
+ gHtmlDocument.write(calEvent.end);
+ }
+ gHtmlDocument.write("</td><td valign=top>");
+ gHtmlDocument.write(calEvent.title);
+ if (calEvent.description)
+ gHtmlDocument.write("<br>"+descriptionTag+": "+calEvent.description);
+ if (calEvent.location)
+ gHtmlDocument.write("<br>"+locationTag+": "+calEvent.location);
+ if (calEvent.url)
+ gHtmlDocument.write("<br>"+uriTag+": "+calEvent.url);
+ var mystat='Cancelled';
+ if (calEvent.status == 10029)
+ mystat='Tentative';
+ if (calEvent.status == 10030)
+ mystat='Confirmed';
+
+ gHtmlDocument.write("<br>Status: "+mystat);
+ gHtmlDocument.write("</td></tr>");
+ }
+ }
+ gHtmlDocument.write("</table>");
+}
+
+function printMonthView(currentDate) {
+ // ok first let's get the array of events for this month.
+ var calDate = new Date(currentDate.getFullYear(), currentDate.getMonth(),
1);
+ var dayFirst = calDate.getDay();
+ var dowStart = (startOfWeek <= dayFirst) ? dayFirst-startOfWeek :
7-startOfWeek;
+ var weekStart=new Date(calDate.getFullYear(),calDate.getMonth(),1-dowStart);
+ var startOfMonthDate = new Date(currentDate.getFullYear(),
currentDate.getMonth(), 1);
+ var endOfMonthDate = new Date(currentDate.getFullYear(),
currentDate.getMonth()+1, 0);
+ var daysInMonth = endOfMonthDate.getDate();
+
+ gHtmlDocument.write("<table border=0 width=100%
style='font-size:26px;font-weight:bold;'><tr ><td align=center
valign=bottom>"+monthNames[currentDate.getMonth()]+"
"+currentDate.getFullYear()+"</td></tr></table>");
+ gHtmlDocument.write("<table style='border:1px solid black;' width=100%>")
+ gHtmlDocument.write("<tr>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[weekStart.getDay()]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+1 >6) ?
weekStart.getDay()+1-7:weekStart.getDay()+1]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+2 >6) ?
weekStart.getDay()+2-7:weekStart.getDay()+2]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+3 >6) ?
weekStart.getDay()+3-7:weekStart.getDay()+3]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+4 >6) ?
weekStart.getDay()+4-7:weekStart.getDay()+4]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+5 >6) ?
weekStart.getDay()+5-7:weekStart.getDay()+5]+"</td>");
+ gHtmlDocument.write("<td align=center style='border:1px solid
black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT:
bold'>"+ArrayOfDayNames[(weekStart.getDay()+6 >6) ?
weekStart.getDay()+6-7:weekStart.getDay()+6]+"</td>");
+ gHtmlDocument.write("</tr>");
+
+ dayToStart=weekStart.getDate();
+ monthToStart=weekStart.getMonth();
+ yearToStart=weekStart.getFullYear();
+ var inMonth=true;
+ var thisDaysDate=new Date(yearToStart, monthToStart, dayToStart);
+
+ for (var w=0; w<6; w++)
+ {
+ if (inMonth)
+ {
+ gHtmlDocument.write("<tr>");
+ for (var i=0; i<7; i++)
+ {
+ gHtmlDocument.write("<td align=left valign=top style='border:1px solid
black;vertical-alignment:top;' >");
+ gHtmlDocument.write("<table valign=top height=100 width=100
style='font-size:10px;'><tr valign=top><td valign=top width=20%>");
+ if (thisDaysDate.getMonth()==currentDate.getMonth())
+ gHtmlDocument.write(thisDaysDate.getDate());
+ gHtmlDocument.write("</td><td width=80% valign=top></td></tr>");
+ if (thisDaysDate.getMonth()==currentDate.getMonth())
+ {
+ dayEventList = eventSource.getEventsForDay( thisDaysDate );
+ var calendarEventDisplay
+ // add each calendarEvent
+ for( var eventIndex = 0; eventIndex < dayEventList.length;
eventIndex++ )
+ {
+ calendarEventDisplay = dayEventList[ eventIndex ];
+ var listpriv=true;
+ if (calendarEventDisplay.event.privateEvent)
+ if (! gShowprivate.checked)
+ listpriv=false;
+ if (listpriv)
+ {
+ eventTitle=calendarEventDisplay.event.title;
+ var eventStartTime = new Date(
calendarEventDisplay.event.start.getTime() ) ;
+ var formattedStartTime=returnTime(eventStartTime);
+ if (calendarEventDisplay.event.allDay)
+ gHtmlDocument.write("<tr><td valign=top colspan=2
style='font-size:11px;'>");
+ else
+ gHtmlDocument.write("<tr><td valign=top align=right
style='font-size:11px;'>"+formattedStartTime+"</td><td valign=top
style='font-size:11px;'>");
+ gHtmlDocument.write(eventTitle);
+ gHtmlDocument.write("</td></tr>");
+ }
+ } //end of events
+ } // if it was in the month
+ gHtmlDocument.write("</table>");
+ gHtmlDocument.write("</td>")
+ //advance to the next day
+ thisDaysDate.setDate(thisDaysDate.getDate()+1);
+ } //end of each day
+ gHtmlDocument.write("</tr>");
+ } // ok it was in the month
+ if ( ( thisDaysDate.getMonth() > currentDate.getMonth() ) ||
+ ( thisDaysDate.getFullYear() > currentDate.getFullYear() ) )
+ inMonth=false;
+ } // end of each week
+
+ gHtmlDocument.write("</table>")
+}
+
+function returnTime(timeval) {
+ retval= gCalendarWindow.dateFormater.getFormatedTime( timeval );
+ if (retval.indexOf("AM") > -1)
+ retval=retval.substring(0,retval.indexOf("AM")-1)+'a';
+ if (retval.indexOf("PM") > -1)
+ retval=retval.substring(0,retval.indexOf("PM")-1)+'p';
+ if (retval=='12:00p')
+ retval='Noon';
+ return retval;
+}
+
+function getWeekNumberOfMonth()
+{
+ //get the day number for today.
+ var startTime = document.getElementById( "start-date-picker" ).value;
+ var oldStartTime = startTime;
+ var thisMonth = startTime.getMonth();
+ var monthToCompare = thisMonth;
+ var weekNumber = 0;
+
+ while( monthToCompare == thisMonth )
+ {
+ startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 ) );
+ monthToCompare = startTime.getMonth();
+ weekNumber++;
+ }
+
+ return( weekNumber );
+}
+
+function isLastDayOfWeekOfMonth()
+{
+ //get the day number for today.
+ var startTime = document.getElementById( "start-date-picker" ).value;
+ var oldStartTime = startTime;
+ var thisMonth = startTime.getMonth();
+ var monthToCompare = thisMonth;
+ var weekNumber = 0;
+
+ while( monthToCompare == thisMonth )
+ {
+ startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 ) );
+ monthToCompare = startTime.getMonth();
+ weekNumber++;
+ }
+
+ if( weekNumber > 3 )
+ {
+ var nextWeek = new Date( oldStartTime.getTime() + ( 1000 * 60 * 60 * 24 *
7 ) );
+ if( nextWeek.getMonth() != thisMonth )
+ {
+ //its the last week of the month
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+function getWeekNumberText( weekNumber )
+{
+ switch( weekNumber )
+ {
+ case 1:
+ return( "First" );
+ case 2:
+ return( "Second" );
+ case 3:
+ return( "Third" );
+ case 4:
+ return( "Fourth" );
+ case 5:
+ return( "Last" );
+ default:
+ return( false );
+ }
+}
+
+/*-----------------------------------------------------------------
+ * Take a Date object and return a displayable date string i.e.: May 5, 1959
+ * :TODO: This should be moved into DateFormater and made to use some kind of
+ * locale or user date format preference.
+ */
+
+function formatDate( date )
+{
+ return( gCalendarWindow.dateFormater.getFormatedDate( date ) );
+}
+
+//Is this function Needed in this file?
+//No calls to it in this file.
+function debug( Text )
+{
+ dump( "\ncalPrintEngine.js :"+ Text + "\n");
+}
Attachment #146394 -
Attachment is patch: true
Attachment #146394 -
Flags: first-review?(mostafah)
Updated•21 years ago
|
Attachment #146394 -
Attachment is patch: false
Comment 16•21 years ago
|
||
Comment on attachment 146394 [details]
calPrintEngine.js
sorry for that spam, Bugzilla being weird for me, hope your not annoyed with me
Attachment #146394 -
Flags: first-review?(mostafah)
Comment 17•21 years ago
|
||
Comment 18•21 years ago
|
||
another go at attaching correctly
Attachment #146394 -
Attachment is obsolete: true
Reporter | ||
Comment 19•21 years ago
|
||
Comment on attachment 146396 [details] [diff] [review]
calPrintEngine (second)
The patch looks good.
However, I would like to ask your permission to postpone adding the name to the
contributors list after the actual contribution you've kindly proposed has
begun.
Reporter | ||
Comment 20•21 years ago
|
||
Comment on attachment 146395 [details] [diff] [review]
printDialog.js ( checked in )
The indenting is not consistent throughout the file after applying the patch.
Attachment #146395 -
Attachment is obsolete: true
Reporter | ||
Comment 21•21 years ago
|
||
Comment on attachment 146395 [details] [diff] [review]
printDialog.js ( checked in )
I'm staring at the file and wondering why I said that...
Thanks for the patch
Attachment #146395 -
Attachment description: printDialog.js → printDialog.js ( checked in )
Attachment #146395 -
Attachment is obsolete: false
Comment 22•21 years ago
|
||
Go ahead and remove my name from contributors until my changes, forgot I even
put it there to begin with yet, I didnt add it in the other file.
Comment 23•21 years ago
|
||
This patch addresses Mostafah's comment about me in contributers (sp?) list
Attachment #146396 -
Attachment is obsolete: true
Comment 24•21 years ago
|
||
Comment on attachment 146619 [details] [diff] [review]
calPrintEngine (third) ( checked in )
checked in by jst, on my request so I can get to working on it quicker.
Attachment #146619 -
Attachment description: calPrintEngine (third) → calPrintEngine (third) ( checked in )
Comment 25•21 years ago
|
||
This patch adds "key" to many options in each locale (ie: Cut, Copy, Paste),
adds entities for the new Mac OS X "Window" menu, aligns all the values, cleans
up whitespace, and removes dumb line-endings where found.
Updated•21 years ago
|
Attachment #162497 -
Flags: first-review?(mostafah)
Reporter | ||
Comment 26•20 years ago
|
||
Comment on attachment 162497 [details] [diff] [review]
rev0 - trunk - patch adds "key" to many options in locales, and does other cleanup(checked in)
Checked in with some tweaks.Thanks
Attachment #162497 -
Attachment description: rev0 - trunk - patch adds "key" to many options in locales, and does other cleanup → rev0 - trunk - patch adds "key" to many options in locales, and does other cleanup(checked in)
Attachment #162497 -
Flags: first-review?(mostafah) → first-review+
Comment 27•20 years ago
|
||
Updated•20 years ago
|
Attachment #164223 -
Flags: first-review?(mostafah)
Comment 28•20 years ago
|
||
Updated•20 years ago
|
Attachment #164225 -
Flags: first-review?(mostafah)
Reporter | ||
Comment 29•20 years ago
|
||
Comment on attachment 164223 [details] [diff] [review]
rev0 - patch fixes spacing, removes tabs, etc on pref stuff ( checked in )
Checked in. Thank
Attachment #164223 -
Attachment description: rev0 - patch fixes spacing, removes tabs, etc on pref stuff → rev0 - patch fixes spacing, removes tabs, etc on pref stuff ( checked in )
Attachment #164223 -
Flags: first-review?(mostafah) → first-review+
Reporter | ||
Comment 30•20 years ago
|
||
Comment on attachment 164225 [details] [diff] [review]
rev0 - patch fixes spacing, removes tabs, etc., and fixes misnamed window( checked in )
Checked in. Thanks
Attachment #164225 -
Attachment description: rev0 - patch fixes spacing, removes tabs, etc., and fixes misnamed window → rev0 - patch fixes spacing, removes tabs, etc., and fixes misnamed window( checked in )
Attachment #164225 -
Flags: first-review?(mostafah) → first-review+
Comment 31•20 years ago
|
||
Updated•20 years ago
|
Attachment #164745 -
Flags: first-review?(mostafah)
Reporter | ||
Updated•20 years ago
|
Attachment #164745 -
Attachment description: rev0 - trunk - fixes unifinder.js dumps that have no or erroneously place \n's making debug output unreadable → rev0 - trunk - fixes unifinder.js dumps that have no or erroneously place \n's making debug output unreadable ( checked in )
Attachment #164745 -
Flags: first-review?(mostafah) → first-review+
Comment 32•20 years ago
|
||
Updated•20 years ago
|
Attachment #165335 -
Flags: first-review?(mvl)
Updated•20 years ago
|
Attachment #165335 -
Flags: first-review?(mvl) → first-review?(mostafah)
Comment 33•20 years ago
|
||
Working hard at separating "cleanup" patches from bug fixes...
This needs to be checked in before my bug 231674 patch.
Updated•20 years ago
|
Attachment #165595 -
Flags: first-review?(mostafah)
Reporter | ||
Updated•20 years ago
|
Attachment #165335 -
Attachment description: Patch moves \n to end of dump lines in day/month/multiweekView.js → Patch moves \n to end of dump lines in day/month/multiweekView.js ( checked in )
Attachment #165335 -
Flags: first-review?(mostafah) → first-review+
Reporter | ||
Updated•20 years ago
|
Attachment #165595 -
Attachment description: removes DOS line endings and adds MPL tri-license block → removes DOS line endings and adds MPL tri-license block( checked in )
Attachment #165595 -
Flags: first-review?(mostafah) → first-review+
Comment 34•20 years ago
|
||
Attachment #169842 -
Flags: first-review?(pavlov)
Comment 35•20 years ago
|
||
Comment on attachment 169842 [details] [diff] [review]
Cleanup of eventDialog.js
holding off on this for now per pavlov
Attachment #169842 -
Attachment is obsolete: true
Attachment #169842 -
Flags: first-review?(pavlov)
Comment 36•20 years ago
|
||
Since all the new JS for the backend stuff is 4 space indent and the code I've
been doing for the frontend I've been making 4 spaces, I think we should go with
4 space indent for everything instead of 2 as was mentioned previously in this
bug. I'm against going back and changing existing files that are all
consistently 2 space indented to change, but moving forward I think
changes/files should be 4.
Comment 37•20 years ago
|
||
More indentation makes long lines more likely to overflow or wrap, so it uses
screen space less efficiently, especially when doing side-by-side comparisons.
[Four spaces also produces the ugly if problem, where the body indentation is
the same as the tests.
if (line1ForTest() &&
line2ForTest())
line1ForBody();
Two space indent doesn't have that problem
if (line1ForTest() &&
line2ForTest())
line1ForBody();
]
Comment 38•20 years ago
|
||
Attachment #169861 -
Flags: first-review?(pavlov)
Comment 39•20 years ago
|
||
If you are cleaning up whitespace, we also need to decide on bracket usage.
calendar uses |if( foo ){|, while most other mozilla code uses |if (foo) {|. I
like the seccond better.
Also, you could remove code that is commented out. It will be available in cvs
history anyway.
Comment 40•20 years ago
|
||
I like the second as well (|if (foo) {|). I've been slowly removing the extra
spaces as I whack the calendar code.
Updated•20 years ago
|
Attachment #169861 -
Flags: first-review?(pavlov) → first-review?(mostafah)
Reporter | ||
Updated•20 years ago
|
Attachment #169861 -
Flags: first-review?(mostafah) → first-review+
Updated•20 years ago
|
Attachment #169861 -
Attachment description: rev0 - cleans up dragDrop.js → rev0 - cleans up dragDrop.js (checked in)
Updated•20 years ago
|
QA Contact: gurganbl → general
Comment 41•19 years ago
|
||
Reassigning all automatically assigned bugs from Mostafa to nobody@m.o
Bugspam filter: TorontoMostafaMove
Assignee: mostafah → nobody
Status: ASSIGNED → NEW
Comment 42•19 years ago
|
||
I'm closing this bug as fixed. There are still a few files that are crufty, but merely cleaning them up completely borks cvs blame. Let's do cleanup in the context of actual fixes.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•