Index: openacs-4/packages/forums/www/message-post.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/forums/www/message-post.tcl 13 Dec 2007 14:22:54 -0000 1.36 +++ openacs-4/packages/forums/www/message-post.tcl 12 Mar 2008 05:26:43 -0000 1.37 @@ -68,10 +68,10 @@ set lang [ad_conn language] template::head::add_css -href /resources/forums/forums.css -media all -lang $lang -template::head::add_css -alternate -href /resources/forums/flat.css -media all -lang $lang -title "flat" -template::head::add_css -alternate -href /resources/forums/flat-collapse.css -media all -lang $lang -title "flat-collapse" -template::head::add_css -alternate -href /resources/forums/collapse.css -media all -lang $lang -title "collapse" -template::head::add_css -alternate -href /resources/forums/expand.css -media all -lang $lang -title "expand" +#template::head::add_css -alternate -href /resources/forums/flat.css -media all -lang $lang -title "flat" +#template::head::add_css -alternate -href /resources/forums/flat-collapse.css -media all -lang $lang -title "flat-collapse" +#template::head::add_css -alternate -href /resources/forums/collapse.css -media all -lang $lang -title "collapse" +#template::head::add_css -alternate -href /resources/forums/expand.css -media all -lang $lang -title "expand" if {![string equal [template::form::get_button message] "preview"]} { set context [list [list "./forum-view?forum_id=$forum_id" [ad_quotehtml $forum(name)]]] Index: openacs-4/packages/forums/www/message-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view.tcl,v diff -u -r1.43 -r1.44 --- openacs-4/packages/forums/www/message-view.tcl 22 Feb 2008 07:17:42 -0000 1.43 +++ openacs-4/packages/forums/www/message-view.tcl 12 Mar 2008 05:26:43 -0000 1.44 @@ -111,11 +111,23 @@ template::head::add_css -href /resources/forums/forums.css -media all -lang $lang #template::head::add_css -alternate -href /resources/forums/collapse.css -media all -lang $lang -title "collapse" #template::head::add_css -alternate -href /resources/forums/expand.css -media all -lang $lang -title "expand" -template::head::add_css -alternate -href /resources/forums/print.css -media print -lang $lang +#template::head::add_css -alternate -href /resources/forums/print.css -media print -lang $lang # js scripts template::head::add_script -type "text/javascript" -src "/resources/forums/forums.js" template::head::add_script -type "text/javascript" -src "/resources/forums/dynamic-comments.js" template::head::add_script -type "text/javascript" -script $dynamic_script +# cookie handling for the expand/collpase +set onunload_script { + saveMsgsState(); +} + +set onload_script { + loadMsgsState(); +} + +template::add_body_handler -event onunload -script $onunload_script +template::add_body_handler -event onload -script $onload_script + set page_title "#forums.Thread_title#" Index: openacs-4/packages/forums/www/resources/forums.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/resources/forums.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/forums/www/resources/forums.js 28 Feb 2008 06:51:49 -0000 1.4 +++ openacs-4/packages/forums/www/resources/forums.js 12 Mar 2008 05:26:43 -0000 1.5 @@ -140,18 +140,13 @@ return null; } -window.onload = function(e) { +function loadMsgsState() { var cookie = readCookie("style"); - if (cookie == 'null') var title = getPreferredStyleSheet(); + var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title); } -window.onunload = function(e) { +function saveMsgsState() { var title = getActiveStyleSheet(); createCookie("style", title, 365); } - -var cookie = readCookie("style"); -if (cookie == 'null') var title = getPreferredStyleSheet(); -setActiveStyleSheet(title); -