You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(447) |
Nov
(163) |
Dec
(57) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(172) |
Feb
|
Mar
(123) |
Apr
(64) |
May
(1) |
Jun
(278) |
Jul
(89) |
Aug
(97) |
Sep
(62) |
Oct
(53) |
Nov
(119) |
Dec
(60) |
| 2006 |
Jan
(76) |
Feb
(1094) |
Mar
(363) |
Apr
(163) |
May
(57) |
Jun
(43) |
Jul
(39) |
Aug
(15) |
Sep
(33) |
Oct
(62) |
Nov
(8) |
Dec
|
| 2007 |
Jan
(9) |
Feb
(34) |
Mar
(2) |
Apr
(14) |
May
(8) |
Jun
(40) |
Jul
(21) |
Aug
(1) |
Sep
(20) |
Oct
(15) |
Nov
(26) |
Dec
|
| 2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
|
Jul
|
Aug
(3) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: creedon <icr...@us...> - 2005-11-09 23:50:59
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24408 Removed Files: Tag: commercial_suite_project-branch runOpenRecentMenuScript Log Message: have some damn problem with this file --- runOpenRecentMenuScript DELETED --- |
|
From: creedon <icr...@us...> - 2005-11-09 23:09:06
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9478 Added Files: Tag: commercial_suite_project-branch runOpenRecentMenuScript Log Message: mirrored from main branch --- NEW FILE: runOpenRecentMenuScript --- (This appears to be a binary file; contents omitted.) |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:58
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/menuCommands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19362/menuCommands Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/menuCommands added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:53
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/userCallbacks/afterAppInfoInitialized In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19336/afterAppInfoInitialized Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/userCallbacks/afterAppInfoInitialized added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:46
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/userCallbacks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19308/userCallbacks Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/userCallbacks added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:44
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/newTable/appInfo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19278/appInfo Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/newTable/appInfo added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:41
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/newTable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19250/newTable Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/newTable added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:31
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/DuckTapeRootLeftovers/DuckTapeSuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19233/DuckTapeSuite Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/DuckTapeRootLeftovers/DuckTapeSuite added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:27
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/DuckTapeRootLeftovers/DuckTapeInfo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19210/DuckTapeInfo Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/DuckTapeRootLeftovers/DuckTapeInfo added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:25
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/DuckTapeRootLeftovers/DuckTapeData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19185/DuckTapeData Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/DuckTapeRootLeftovers/DuckTapeData added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:14
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/DuckTapeRootLeftovers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19153/DuckTapeRootLeftovers Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/DuckTapeRootLeftovers added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:08
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/commercialSuiteReference/newTable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19126/newTable Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/commercialSuiteReference/newTable added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:06
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/commercialSuiteReference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19099/commercialSuiteReference Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data/commercialSuiteReference added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:04
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/callbacks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19058/callbacks Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/callbacks added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:01
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19076/data Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology/data added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-09 19:32:01
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19040/aeTerminology Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/suites/aeTerminology added to the repository --> Using per-directory sticky tag `commercial_suite_project-branch' |
|
From: creedon <icr...@us...> - 2005-11-07 00:37:05
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20940 Modified Files: init Log Message: moved pike/playlist callback cleanup into if block of finish installation, no need to do it more than once moved menu.addSubMenu call into finish installation bundle and only run once, this is a script-wise workaround for the problem < http://sourceforge.net/tracker/index.php?func=detail&aid=1338735&group_id=120666&atid=687798 > Index: init =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/init,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** init 13 Jun 2005 22:29:05 -0000 1.2 --- init 7 Nov 2005 00:36:54 -0000 1.3 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.init ! ÇChanges Ç11/29/04; 1:17:12 AM by TAC ÇTools menu now installed as a sub menu of the Operations menu Ç11/14/04; 11:14:42 AM by TAC Çadded initialization Frontier.tools.data Ç11/26/01; 5:55:25 PM by JES ÇCreate callback tables at user.tools.callbacks. Right now, there are four callbacks, beforeInstall, beforeUninstall, afterInstall, and afterUninstall. Ç9/19/01; 5:41:45 PM by JES ÇCreate an empty table at system.temp.Frontier.tools, for storing temporary information about Tools. Ç7/1/01; 7:01:01 PM by JES ÇAdded initialization of windowTypes-related items. Ç6/21/01; 1:20:57 AM by JES ÇIf this is Radio, only check to see if user.menus.tools == @playlist.tools.menu, if playlist.tools.menu is defined. Ç04/22/01; 8:58:49 PM by JES ÇBe sure the user.html.callbacks.fileWriters.ftp table exists. Ç4/18/01; 1:20:35 AM by JES ÇCribbed from playlist.tools from Radio.root. on installCallback (adrcode, name, replaceIfEqualsString=nil, adr...@us...) { local (adrtable = @adrCallbacks^.[name]); if not defined (adrtable^) { new (tableType, adrtable)}; local (adrscript = @adrtable^.tools); if replaceIfEqualsString != nil { if defined (adrscript^) { if string (adrscript^) == replaceIfEqualsString { delete (adrscript)}}}; if not defined (adrscript^) { adrscript^ = @adrcode^.[name]}}; bundle { // 11/14/04; 11:14:42 AM by TAC - init Frontier.tools.data if not (defined (Frontier.tools.data)) { new (tableType, @Frontier.tools.data)}; if not (defined (Frontier.tools.data.nodeTypes)) { new (tableType, @Frontier.tools.data.nodeTypes)}}; bundle { //init user.tools if not defined (user.tools) { new (tableType, @user.tools)}; if not defined (user.tools.databases) { new (tableType, @user.tools.databases)}; if not defined (user.tools.prefs) { new (tableType, @user.tools.prefs)}; if system.environment.isPike and defined (playlist.tools.menu) { if user.menus.tools == @playlist.tools.menu { delete (@user.menus.tools)}}; Çif not defined (user.menus.tools) // 11/29/04; 1:16:55 AM by TAC - disabled Çuser.menus.tools = @Frontier.tools.menu menu.addSubMenu (@system.menus.menubar, "", @Frontier.tools.menu)}; // 11/29/04; 1:21:43 AM by TAC bundle { //init temp.Frontier.tools if not defined (system.temp.Frontier) { new (tableType, @system.temp.Frontier)}; if not defined (system.temp.Frontier.tools) { new (tableType, @system.temp.Frontier.tools)}}; bundle { //set up Frontier.tools.thread if not defined (user.scheduler.threads.tools) { user.scheduler.threads.tools = @Frontier.tools.thread}}; bundle { //init user.tools.menus if not defined (user.tools.menus) { new (tabletype, @user.tools.menus)}; if not defined (user.tools.menus.rightClickMenu) { new (menubartype, @user.tools.menus.rightClickMenu)}}; bundle { //init user.tools.nodeTypes if not defined (user.tools.nodeTypes) { new (tabletype, @user.tools.nodeTypes)}}; bundle { //make sure nodeTypes-related callbacks are installed local (adrcode = @Frontier.tools.nodeTypes.callbacks); installCallback (adrcode, "opCollapse", "return (Frontier.tools.opExpandCallback ())"); installCallback (adrcode, "opExpand", "return (Frontier.tools.opExpandCallback ())"); installCallback (adrcode, "opRightClick", "on tools (adrmenu) {\r\treturn (Frontier.tools.opRightClickCallback (adrmenu))}"); Çbundle //old code Çbundle //opCollapse Çlocal (adrtable = @user.callbacks.opCollapse) Çif not defined (adrtable^) Çnew (tableType, adrtable) Çlocal (adrscript = @adrtable^.tools) Çif defined (adrscript^) Çif string (adrscript^) == "return (Frontier.tools.opExpandCallback ())" Çdelete (adrscript) Çif not defined (adrscript^) Çadrscript^ = @adrcode^.opCollapse Çbundle //opExpand Çlocal (adrtable = @user.callbacks.opExpand) Çif not defined (adrtable^) Çnew (tableType, adrtable) Çlocal (adrscript = @adrtable^.tools) Çif defined (adrscript^) Çif string (adrscript^) == "return (Frontier.tools.opExpandCallback ())" Çdelete (adrscript) Çif not defined (adrscript^) Çadrscript^ = @adrcode^.opExpand Çbundle //opRightClick Çlocal (adrtable = @user.callbacks.opRightClick) Çif not defined (adrtable^) Çnew (tableType, adrtable) Çlocal (adrscript = @adrtable^.tools) Çif defined (adrscript^) Çif string (adrscript^) == "on tools (adrmenu) {\r\treturn (Frontier.tools.opRightClickCallback (adrmenu))}" Çdelete (adrscript) Çif not defined (adrscript^) Çadrscript^ = @adrcode^.opRightClick}; bundle { //make sure the html fileWriters callbacks table exists if not defined (user.html.callbacks) { new (tableType, @user.html.callbacks)}; if not defined (user.html.callbacks.fileWriters) { new (tableType, @user.html.callbacks.fileWriters)}; if not defined (user.html.callbacks.fileWriters.ftp) { new (tableType, @user.html.callbacks.fileWriters.ftp)}}; bundle { //init user.tools.windowTypes if not defined (user.tools.windowTypes) { new (tabletype, @user.tools.windowTypes)}}; bundle { //make sure windowTypes-related callbacks are installed local (adrcode = @Frontier.tools.windowTypes.callbacks); ÇBuiltin callbacks installCallback (adrcode, "closeWindow"); installCallback (adrcode, "openWindow"); installCallback (adrcode, "saveWindow"); ÇOutline callbacks installCallback (adrcode, "opReturnKey"); installCallback (adrcode, "opCursorMoved"); }; bundle { //install commandCallbacks, and create user.tools.callbacks tables on sureTable (adrparent, name) { if not defined (adrparent^.[name]) { new (tableType, @adrparent^.[name])}}; local (adrcallbacks = @user.tools.commandCallbacks); if not defined (adrcallbacks^) { new (tableType, adrcallbacks)}; sureTable (adrcallbacks, "isMenuItemEnabled"); sureTable (adrcallbacks, "close"); sureTable (adrcallbacks, "new"); sureTable (adrcallbacks, "open"); sureTable (adrcallbacks, "openUrl"); sureTable (adrcallbacks, "revert"); sureTable (adrcallbacks, "save"); sureTable (adrcallbacks, "saveAs"); sureTable (adrcallbacks, "saveAsHtml"); sureTable (adrcallbacks, "saveAsPlainText"); sureTable (adrcallbacks, "viewInBrowser"); adrcallbacks = @user.tools.callbacks; if not defined (adrcallbacks^) { new (tableType, adrcallbacks)}; sureTable (adrcallbacks, "beforeInstall"); sureTable (adrcallbacks, "afterInstall"); sureTable (adrcallbacks, "beforeUninstall"); sureTable (adrcallbacks, "afterUninstall")}; Çbundle //init manila windowTypes, nodeTypes and editResponder // 11/14/04; 10:56:38 AM by TAC - don't install Manila Çif defined (manila.windowTypes) Çmanila.windowTypes.init () Çif defined (manila.nodeTypes) Çmanila.nodeTypes.init () Çif system.environment.isRadio Çif defined (manila.editResponder) Çmanila.editResponder.init () bundle { //init chatClient, xmlStorageSystem, and bookmarksMenu Çif defined (chatClient) // 11/14/04; 11:02:00 AM by TAC - no chat client in Frontier.root ÇchatClient.init () if defined (xmlStorageSystem) { // TAC - ? xmlStorageSystem.init ()}; if defined (bookmarksMenu) { // TAC - ? bookmarksMenu.init ()}}; bundle { //finish installation if not defined (Frontier.tools.data.flInstalled) { Frontier.tools.data.flInstalled = false}; if not Frontier.tools.data.flInstalled { //install wrapper scripts for file and edit menu calls, and isFileMenuItemChecked/Enabled if system.environment.isRadio { if defined (system.verbs.builtins.pike) { delete (@pike.isFileMenuItemChecked); script.newScriptObject ("on isFileMenuItemChecked (cmd) {return (Frontier.tools.windowTypes.isFileMenuItemChecked (cmd))}", @pike.isFileMenuItemChecked); delete (@pike.isFileMenuItemEnabled); script.newScriptObject ("on isFileMenuItemEnabled (cmd) {return (Frontier.tools.windowTypes.isFileMenuItemEnabled (cmd))}", @pike.isFileMenuItemEnabled); delete (@pike.runFileMenuScript); script.newScriptObject ("on runFileMenuScript (itemname) {return (Frontier.tools.windowTypes.runFileMenuScript (itemname))}", @pike.runFileMenuScript); delete (@pike.runEditMenuScript); script.newScriptObject ("on runEditMenuScript (itemname) {return (Frontier.tools.windowTypes.runEditMenuScript (itemname))}", @pike.runEditMenuScript)}}}; bundle { //delete old callback entries local (adr); for adr in @user.callbacks { if defined (adr^.pike) { delete (@adr^.pike)}; if defined (adr^.playlist) { delete (@adr^.playlist)}}}; Frontier.tools.data.flInstalled = true} //only do this once \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.init ! ÇChanges Ç11/6/05; 9:05:15 AM by TAC Çmoved pike/playlist callback cleanup into if block of finish installation, no need to do it more than once Çmoved menu.addSubMenu call into finish installation bundle and only run once, this is a script-wise workaround for the problem < http://sourceforge.net/tracker/index.php?func=detail&aid=1338735&group_id=120666&atid=687798 > Ç11/29/04; 1:17:12 AM by TAC ÇTools menu now installed as a sub menu of the Operations menu Ç11/14/04; 11:14:42 AM by TAC Çadded initialization Frontier.tools.data Ç11/26/01; 5:55:25 PM by JES ÇCreate callback tables at user.tools.callbacks. Right now, there are four callbacks, beforeInstall, beforeUninstall, afterInstall, and afterUninstall. Ç9/19/01; 5:41:45 PM by JES ÇCreate an empty table at system.temp.Frontier.tools, for storing temporary information about Tools. Ç7/1/01; 7:01:01 PM by JES ÇAdded initialization of windowTypes-related items. Ç6/21/01; 1:20:57 AM by JES ÇIf this is Radio, only check to see if user.menus.tools == @playlist.tools.menu, if playlist.tools.menu is defined. Ç04/22/01; 8:58:49 PM by JES ÇBe sure the user.html.callbacks.fileWriters.ftp table exists. Ç4/18/01; 1:20:35 AM by JES ÇCribbed from playlist.tools from Radio.root. on installCallback (adrcode, name, replaceIfEqualsString=nil, adr...@us...) { local (adrtable = @adrCallbacks^.[name]); if not defined (adrtable^) { new (tableType, adrtable)}; local (adrscript = @adrtable^.tools); if replaceIfEqualsString != nil { if defined (adrscript^) { if string (adrscript^) == replaceIfEqualsString { delete (adrscript)}}}; if not defined (adrscript^) { adrscript^ = @adrcode^.[name]}}; bundle { // 11/14/04; 11:14:42 AM by TAC - init Frontier.tools.data if not (defined (Frontier.tools.data)) { new (tableType, @Frontier.tools.data)}; if not (defined (Frontier.tools.data.nodeTypes)) { new (tableType, @Frontier.tools.data.nodeTypes)}}; bundle { //init user.tools if not defined (user.tools) { new (tableType, @user.tools)}; if not defined (user.tools.databases) { new (tableType, @user.tools.databases)}; if not defined (user.tools.prefs) { new (tableType, @user.tools.prefs)}; if system.environment.isPike and defined (playlist.tools.menu) { if user.menus.tools == @playlist.tools.menu { delete (@user.menus.tools)}}; Çif not defined (user.menus.tools) // 11/29/04; 1:16:55 AM by TAC - disabled Çuser.menus.tools = @Frontier.tools.menu}; bundle { //init temp.Frontier.tools if not defined (system.temp.Frontier) { new (tableType, @system.temp.Frontier)}; if not defined (system.temp.Frontier.tools) { new (tableType, @system.temp.Frontier.tools)}}; bundle { //set up Frontier.tools.thread if not defined (user.scheduler.threads.tools) { user.scheduler.threads.tools = @Frontier.tools.thread}}; bundle { //init user.tools.menus if not defined (user.tools.menus) { new (tabletype, @user.tools.menus)}; if not defined (user.tools.menus.rightClickMenu) { new (menubartype, @user.tools.menus.rightClickMenu)}}; bundle { //init user.tools.nodeTypes if not defined (user.tools.nodeTypes) { new (tabletype, @user.tools.nodeTypes)}}; bundle { //make sure nodeTypes-related callbacks are installed local (adrcode = @Frontier.tools.nodeTypes.callbacks); installCallback (adrcode, "opCollapse", "return (Frontier.tools.opExpandCallback ())"); installCallback (adrcode, "opExpand", "return (Frontier.tools.opExpandCallback ())"); installCallback (adrcode, "opRightClick", "on tools (adrmenu) {\r\treturn (Frontier.tools.opRightClickCallback (adrmenu))}"); Çbundle //old code Çbundle //opCollapse Çlocal (adrtable = @user.callbacks.opCollapse) Çif not defined (adrtable^) Çnew (tableType, adrtable) Çlocal (adrscript = @adrtable^.tools) Çif defined (adrscript^) Çif string (adrscript^) == "return (Frontier.tools.opExpandCallback ())" Çdelete (adrscript) Çif not defined (adrscript^) Çadrscript^ = @adrcode^.opCollapse Çbundle //opExpand Çlocal (adrtable = @user.callbacks.opExpand) Çif not defined (adrtable^) Çnew (tableType, adrtable) Çlocal (adrscript = @adrtable^.tools) Çif defined (adrscript^) Çif string (adrscript^) == "return (Frontier.tools.opExpandCallback ())" Çdelete (adrscript) Çif not defined (adrscript^) Çadrscript^ = @adrcode^.opExpand Çbundle //opRightClick Çlocal (adrtable = @user.callbacks.opRightClick) Çif not defined (adrtable^) Çnew (tableType, adrtable) Çlocal (adrscript = @adrtable^.tools) Çif defined (adrscript^) Çif string (adrscript^) == "on tools (adrmenu) {\r\treturn (Frontier.tools.opRightClickCallback (adrmenu))}" Çdelete (adrscript) Çif not defined (adrscript^) Çadrscript^ = @adrcode^.opRightClick}; bundle { //make sure the html fileWriters callbacks table exists if not defined (user.html.callbacks) { new (tableType, @user.html.callbacks)}; if not defined (user.html.callbacks.fileWriters) { new (tableType, @user.html.callbacks.fileWriters)}; if not defined (user.html.callbacks.fileWriters.ftp) { new (tableType, @user.html.callbacks.fileWriters.ftp)}}; bundle { //init user.tools.windowTypes if not defined (user.tools.windowTypes) { new (tabletype, @user.tools.windowTypes)}}; bundle { //make sure windowTypes-related callbacks are installed local (adrcode = @Frontier.tools.windowTypes.callbacks); ÇBuiltin callbacks installCallback (adrcode, "closeWindow"); installCallback (adrcode, "openWindow"); installCallback (adrcode, "saveWindow"); ÇOutline callbacks installCallback (adrcode, "opReturnKey"); installCallback (adrcode, "opCursorMoved"); }; bundle { //install commandCallbacks, and create user.tools.callbacks tables on sureTable (adrparent, name) { if not defined (adrparent^.[name]) { new (tableType, @adrparent^.[name])}}; local (adrcallbacks = @user.tools.commandCallbacks); if not defined (adrcallbacks^) { new (tableType, adrcallbacks)}; sureTable (adrcallbacks, "isMenuItemEnabled"); sureTable (adrcallbacks, "close"); sureTable (adrcallbacks, "new"); sureTable (adrcallbacks, "open"); sureTable (adrcallbacks, "openUrl"); sureTable (adrcallbacks, "revert"); sureTable (adrcallbacks, "save"); sureTable (adrcallbacks, "saveAs"); sureTable (adrcallbacks, "saveAsHtml"); sureTable (adrcallbacks, "saveAsPlainText"); sureTable (adrcallbacks, "viewInBrowser"); adrcallbacks = @user.tools.callbacks; if not defined (adrcallbacks^) { new (tableType, adrcallbacks)}; sureTable (adrcallbacks, "beforeInstall"); sureTable (adrcallbacks, "afterInstall"); sureTable (adrcallbacks, "beforeUninstall"); sureTable (adrcallbacks, "afterUninstall")}; Çbundle //init manila windowTypes, nodeTypes and editResponder // 11/14/04; 10:56:38 AM by TAC - don't install Manila Çif defined (manila.windowTypes) Çmanila.windowTypes.init () Çif defined (manila.nodeTypes) Çmanila.nodeTypes.init () Çif system.environment.isRadio Çif defined (manila.editResponder) Çmanila.editResponder.init () bundle { //init chatClient, xmlStorageSystem, and bookmarksMenu Çif defined (chatClient) // 11/14/04; 11:02:00 AM by TAC - no chat client in Frontier.root ÇchatClient.init () if defined (xmlStorageSystem) { // TAC - ? xmlStorageSystem.init ()}; if defined (bookmarksMenu) { // TAC - ? bookmarksMenu.init ()}}; bundle { //finish installation if not defined (Frontier.tools.data.flInstalled) { Frontier.tools.data.flInstalled = false}; if not (Frontier.tools.data.flInstalled) { menu.addSubMenu (@system.menus.menubar, "", @Frontier.tools.menu); // 11/29/04; 1:21:43 AM by TAC if system.environment.isRadio { // install wrapper scripts for file and edit menu calls, and isFileMenuItemChecked/Enabled if defined (system.verbs.builtins.pike) { delete (@pike.isFileMenuItemChecked); script.newScriptObject ("on isFileMenuItemChecked (cmd) {return (Frontier.tools.windowTypes.isFileMenuItemChecked (cmd))}", @pike.isFileMenuItemChecked); delete (@pike.isFileMenuItemEnabled); script.newScriptObject ("on isFileMenuItemEnabled (cmd) {return (Frontier.tools.windowTypes.isFileMenuItemEnabled (cmd))}", @pike.isFileMenuItemEnabled); delete (@pike.runFileMenuScript); script.newScriptObject ("on runFileMenuScript (itemname) {return (Frontier.tools.windowTypes.runFileMenuScript (itemname))}", @pike.runFileMenuScript); delete (@pike.runEditMenuScript); script.newScriptObject ("on runEditMenuScript (itemname) {return (Frontier.tools.windowTypes.runEditMenuScript (itemname))}", @pike.runEditMenuScript)}}; bundle { // delete old callback entries local (adr); for adr in @user.callbacks { if defined (adr^.pike) { delete (@adr^.pike)}; if defined (adr^.playlist) { delete (@adr^.playlist)}}}}; Frontier.tools.data.flInstalled = true} //only do this once \ No newline at end of file |
|
From: creedon <icr...@us...> - 2005-11-06 01:29:02
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28176 Modified Files: httpClient Log Message: when deleting expired cookies, delete in reverse order Index: httpClient =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/tcp/httpClient,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** httpClient 7 Sep 2005 17:05:55 -0000 1.2 --- httpClient 6 Nov 2005 01:28:51 -0000 1.3 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.tcp.httpClient ! on httpClient (method="GET", server="", port=nil, path="", proxy=user.webBrowser.proxy.domain, proxyPort=user.webBrowser.proxy.port, proxyUserName=user.webBrowser.proxy.userName, proxyPassword=user.webBrowser.proxy.password, data="", datatype="", username="", password="", adrHdrTable=nil, cookiesOn=false, debug=false, timeOutTicks=60*30, flMessages=true, ctFollowRedirects=0, flJustHeaders=false, flAcceptOpml=false, flUseProxy=nil, adrRedirectInfo=nil) { ÇChanges Ç5/3/04; 12:14:50 AM by TAC Çcookies weren't working for a path that looks like "/mypath" Ç2/7/03; 3:49:12 PM by JES ÇWhen testing for proxy-exempt servers, don't inclue the port number if specified in the server parameter. Ç2002 Ç10/20/02; 2:32:23 AM by JES ÇRespect user.webBrowser.proxy.exceptions. Ç10/16/02; 6:55:56 PM by JES ÇRemoved debugging code. Ç10/14/02; 11:10:16 AM by JES ÇIf server is 127.0.0.1 or "localhost", set flUseProxy to false. Ç10/13/02; 6:23:28 PM by DW ÇNew optional param -- adrRedirectInfo. If it's non-nil (the default) and we're redirecting, we fill the table with info about the redirect. The RSS aggregator needs this information, and it may prove useful in other places. See xml.rss.readService for an example of its usage. Ç2001 Ç12/19/01; 9:58:10 PM by JES ÇAdded a call to webBrowser.init, which initializes prefs at user.webBrowser.proxy. Added optional parameter, flUseProxy, which defaults to nil. If nil, then the value at user.webBrowser.proxy.enabled is used. Pass the value of flUseProxy when following redirects. Ç8/14/01; 1:49:11 PM by JES ÇWhen recursing to following redirects, pass in the flJustHeaders and flAcceptOpml parameters. Ç8/9/01; 6:10:17 PM by JES ÇIf the stream is unexpectedly closed by the remote host, call tcp.abortStream, to avoid consuming the available connections. Ç8/8/01; 3:21:27 PM by JES ÇIf no Accept header has been passed in, add an Accept header with the value: text/x-opml, */*, so that we get the response in opml instead of html. Ç3/1/01; 1:57:33 PM by PBS ÇTrim white space around the content-length header before coercing it to a number. If a server adds white space here, the coercion would fail, resulting in a connection counter leak. (History: this was discovered in Radio when reading the Red Herring channel.) Ç1/10/01; 10:36:30 AM by DW ÇAdd an optional parameter, flJustHeaders, if true, we don't read the body, we just return the header portion of the response. This is useful if you just want to know how big a download is, and want to defer downloading big things until the middle of the night when it's quiet on the Internet. Ç1/7/01; 9:44:18 PM by DW ÇIn Radio, set User-Agent to Radio UserLand. ÇChanged the header so it doesn't use backslashes. The outliner now supports wrapping headlines. Ç9/22/00; 11:27:50 AM by PBS ÇRespect the user's offline settings. Ç1999 Ç11/5/99; 3:00:39 AM by AR ÇIf the server doesn't send a Content-Length header, read until connection closes. Ç10/21/99; 3:57:29 PM by AR ÇAdapted to use new TCP verbs in 6.1. Ç6/14/99; 5:23:37 AM by AR ÇIf flMessages is true, we now clean up the message area before we return. Ç6/13/99; 9:20:04 AM by AR ÇBoth the read and write loop now yield time to other Frontier threads and to the system. ÇThe Host header is now generated correctly if the request goes thru a proxy server. ÇFixed a few inconsistencies in the cookie handling code. Thinks should now work correctly when connecting via a proxy server. ÇAdded an optional parameter, ctFollowRedirects, determining the number of times that HTTP redirects will be followed. In order to preserve previous behaviour, the default value is 0. Ç3/4/99; 11:54:30 AM by PBS ÇIf adrHdrTable^ contains a "Host" sub-item, don't add a Host header item. Ç3/2/99; 10:43:18 AM by DW Çif adrHdrTable^ contains a "User-Agent" sub-item, don't add a User-Agent header item Ç1998 Ç10/25/98; 6:33:59 AM by DW Çallow the use of a colon in the server name to specify the port Çexample: www.scripting.com:80 Çif present, we use that port, not the one specified in the call Çthe assumption is that most callers either specify 80 or don't specify the port at all Çfor crawlers, for example, they definitely want to use the port specified in the server string Çsome commands, esp in the webBrowser class, get the url from another piece of software Ç9/28/98; 4:42:12 AM by DW Çif we're sending to the same machine, set the stream ID to 0 Çuser.webserver.responders.CGI.methods.any is copying it, hope no CGIs are using it! Ç9/17/98; 7:11:56 AM by DW Çmsgs now say that they're from tcp.httpClient. Çchanged Connection to xxx timed out message to... ÇCan't process the request because the connection to xxx timed out. Çallow server to be "localhost", if so, we totally optimize the functionality Ç2/13/98; 8:57:10 AM by DW ÇInitial code assembled from various sample scripts by Dave Winer. ÇThe goal is to have a single documented way to talk to HTTP servers. ÇIt's got a long parameter list, but requires no configuration, doesn't run off a user.xxx table. ÇThe target user of this script is someone who needs to understand how the code works. ÇIt will be distributed with Frontier on both platforms as soon as we agree that this is complete and works. ÇWhen you call it, use parameter labels, don't depend on the order of these params. ÇFor examples, see tcp.examples. if tcp.isOffline () { //PBS 09/22/00: check offline status scriptError ("Can't send HTTP request because TCP is offline.")}; webBrowser.init (); try { //set flUseProxy if (flUseProxy == nil) and (typeOf (flUseProxy) == unknownType) { flUseProxy = user.webBrowser.proxy.enabled}; if server == "127.0.0.1" or string.lower (server) == "localhost" { //JES 10/14/02: don't call the loopback address through the proxy flUseProxy = false}; if flUseProxy { //check the exceptions table -- if we find a match then set flUseProxy to false on wildcardIpMatch (s, oneip) { local (i); if s == oneip { //optimization return (true)}; for i = 1 to 4 { try { local (part = string.nthField (oneip, ".", i)); local (pattern = string.nthField (s, ".", i)); if pattern == "*" { continue}; if pattern contains "-" { local (min = number (string.nthField (pattern, "-", 1)) ); local (max = number (string.nthField (pattern, "-", 2)) ); local (n = number (part)); if n >= min and n <= max { continue} else { return (false)}}; if pattern != part { return (false)}} else { return (false)}}; return (true)}; local (flIpAddress = false, hostToCheck = string.lower (string.nthField (server, ":", 1)) ); try { //see if flIpAddress should be true local (serverWithoutDots = string.replaceAll (server, ".", "")); double (serverWithoutDots); //will error if non-numeric characters are present flIpAddress = true} else { //check domains, and then try a DNS lookup local (adr); local (lowerserver = string.lower (server)); for adr in @user.webBrowser.proxy.exceptions { if string.wildcardMatch (hostToCheck, string.lower (nameOf (adr^)) ) { if adr^ { flUseProxy = false; break}}}; if flUseProxy { //try a reverse lookup so we can check against IP address try { hostToCheck = tcp.dns.getDottedId (server); flIpAddress = true}}}; if flUseProxy { //check to see if this specific IP is excepted if defined (user.webBrowser.proxy.exceptions.[hostToCheck]) { if user.webBrowser.proxy.exceptions.[hostToCheck] { flUseProxy = false}}}; if flUseProxy { //check for IP-address exceptions which contain wildcard characters and ranges local (i); for i = 1 to sizeOf (user.webBrowser.proxy.exceptions) { if user.webBrowser.proxy.exceptions[i] { local (oneexception = nameOf (user.webBrowser.proxy.exceptions[i])); if wildcardIpMatch (oneexception, hostToCheck) { flUseProxy = false; break}}}}}}; on displayMsg (s) { msg ("tcp.httpClient: " + s)}; local (myAddress = tcp.myDottedID (), flSameMachine = false); bundle { //look for the port specified in the server string if server contains ":" { try {port = number (string.nthField (server, ":", 2))}; //it might not be a number server = string.nthField (server, ":", 1)}; if port == nil { //no port was specified, either in the call or in the server string port = 80}}; bundle { //see if it's the same machine if string.lower (server) == "localhost" { flSameMachine = true} else { try {flSameMachine = tcp.equalNames (server, myAddress)}}; //DW 3/9/98 ÇPBS 9/18/98: check that the server on the requested port is Frontier. if port != user.inetd.config.http.port { flSameMachine = false} //it's the same machine, but it's not Frontier as a server else { if not (inetd.isDaemonRunning (@user.inetd.config.http)) { flSameMachine = false}}}; //Frontier isn't running as a webserver, there must be another server on this machine if not (path beginsWith "/") { path = "/" + path}; local (httpCommand = "", adrCookiesTable = @user.webBrowser.cookies); bundle { //build the HTTP request in "httpCommand" on add (s) { httpCommand = httpCommand + s + "\r\n"}; local (uri = path); if flUseProxy and (sizeOf (proxy) > 0) { //the request is going thru a proxy server: set uri accordingly uri = "http://" + server; if port != 80 { uri = uri + ":" + port}; uri = uri + path}; add (method + " " + uri + " HTTP/1.0"); if (adrHdrTable == nil) or (not defined (adrHdrTable^.["User-Agent"])) { //3/2/99; 10:43:10 AM by DW if system.environment.isPike { add ("User-Agent: Radio UserLand/" + Frontier.version () + " (" + sys.os () + ")")} else { add ("User-Agent: Frontier/" + Frontier.version () + " (" + sys.os () + ")")}}; local (host = "Host: " + server); if port != 80 { host = host + ":" + port}; if (adrHdrTable == nil) or (not defined (adrHdrTable^.["Host"])) { //3/4/99; 11:54:30 AM by PBS add (host)}; if flAcceptOpml { //8/8/01; 3:19:50 PM by JES if (adrHdrTable == nil) { add ("Accept: text/x-opml, */*")} else { //headers were passed in if defined (adrHdrTable^.Accept) { local (acceptHeader = adrHdrTable^.Accept); if not (acceptHeader contains "text/x-opml") { if sizeOf (string.trimWhiteSpace (acceptHeader)) > 0 { acceptHeader = "text/x-opml, " + acceptHeader} else { acceptHeader = "text/x-opml"}}; if not (acceptHeader contains "*/*") { acceptHeader = acceptHeader + ", */*"}; add ("Accept: " + acceptHeader)} else { add ("Accept: text/x-opml, */*")}}}; if sizeOf (data) > 0 { add ("Content-Type: " + datatype); add ("Content-length: " + sizeOf (data))}; if (sizeOf (username) > 0) or (sizeOf (password) > 0) { add ("Authorization: Basic " + base64.encode (username + ":" + password, 0))}; if flUseProxy and (sizeOf (proxy) > 0) { //the request is going thru a proxy server if (sizeOf (proxyUsername) > 0) or (sizeOf (proxyPassword) > 0) { //the proxy requires authentication add ("Proxy-Authorization: Basic " + base64.encode (proxyUsername + ":" + proxyPassword, 0))}}; if adrHdrTable != nil { //added 3.27.98 by ASG to include header items local (i); for i = 1 to sizeOf (adrHdrTable^) { local (headerName = nameOf (adrHdrTable^[i])); if flAcceptOpml { //8/8/01; 3:19:50 PM by JES: Only add the Acept header once if string.lower (headerName) == "accept" { continue}}; add (headerName + ": " + adrHdrTable^[i])}}; if cookiesOn and defined (adrCookiesTable^) { //add cookies to the request header: ASG 4/9/98 local (i, j, k, cookiePath = "/", cookiestring); if path != "/" { cookiePath = string.popSuffix (path, "/"); if cookiePath == "" { // 5/3/04; 12:14:50 AM by TAC - cookies weren't working for a path that looks like "/mypath" cookiePath = "/"}}; for i = 1 to sizeOf (adrCookiesTable^) { //loop through cookies table local (adrdomain = @adrCookiesTable^ [i]); if host endsWith nameOf (adrdomain^) { for j = 1 to sizeOf (adrdomain^) { local (adrcookie = @adrdomain^ [j]); if cookiePath contains nameOf (adrcookie^) { for k = 1 to sizeOf (adrcookie^) { if adrcookie^ [k].expires > clock.now () { //add this cookie cookiestring = cookiestring + nameOf (adrcookie^ [k]) + "=" + adrcookie^ [k].value + "; "} else { delete (@adrcookie^ [k])}}}}}}; //this cookie has expired so delete it if cookiestring != nil { cookiestring = string.delete (cookiestring, sizeof (cookiestring) - 1, 2); //delete trailing "; " add ("Cookie: " + cookiestring)}}; //add the cookies to the header add (""); //blank line if sizeOf (data) > 0 { httpCommand = httpCommand + data}}; if debug { //save a copy of the HTTP request for debugging wp.newTextObject (httpCommand, @scratchpad.httpCommand)}; local (httpResult = ""); if flSameMachine { //shortcut the call, turn our worst case into our best case: 9/17/98; 7:21:13 AM by DW local (params); new (tabletype, @params); params.client = myAddress; params.port = port; params.stream = 0; //9/28/98; 4:42:45 AM by DW params.request = httpCommand; httpResult = webserver.server (@params, httpCommand)} else { local (serverAddress = server, serverPort = port); if flUseProxy and (sizeOf (proxy) > 0) { //the request is going thru a proxy server: switch server and port serverAddress = proxy; serverPort = proxyPort}; if flMessages { //PBS 5/5/98 displayMsg ("Connecting to " + serverAddress + ".")}; local (stream = tcp.openStream (serverAddress, serverPort)); local (chunksize = 5 * 1024); if flMessages { displayMsg ("Sending request to " + serverAddress + ".")}; try { tcp.writeStringToStream (stream, httpCommand, chunkSize, timeOutTicks/60)} //write the command to the server else { tcp.abortStream (stream); scriptError (tryError)}; if flMessages { displayMsg ("Waiting for data from " + serverAddress + ".")}; local (pat = "\r\n\r\n"); try { tcp.readStreamUntil (stream, pat, timeOutTicks/60, @httpResult)} else { tcp.abortStream (stream); scriptError (tryerror)}; local (headerTable); webserver.util.parseHeaders (httpResult, @headerTable); if flJustHeaders { //the caller only wants the headers, not the body 1/10/01 by DW tcp.closeStream (stream)} else { if (string.upper (method) != "HEAD") and defined (headerTable.["Content-Length"]) { //we know there's content left to be read local (lenHeader = string.patternMatch (pat, httpResult) - 1); local (lenContent = number (string.trimWhiteSpace (headerTable.["Content-Length"]))); //PBS 03/01/01: trim white space before coercing local (lenTotal = lenHeader + string.length (pat) + lenContent); if flMessages { displayMsg ("Receiving response body (" + string.kBytes (lenContent) + ") from " + serverAddress + ".")}; try { tcp.readStreamBytes (stream, lenTotal, timeOutTicks/60, @httpResult)} else { tcp.abortStream (stream); scriptError (tryerror)}} else { //just read until connection closes if flMessages { displayMsg ("Receiving response from " + serverAddress + ".")}; try { tcp.readStreamUntilClosed (stream, timeOutTicks/60, @httpResult)} else { tcp.abortStream (stream); scriptError (tryerror)}}; tcp.closeStream (stream); if (httpResult != "") and flMessages { displayMsg ("Finished receiving " + string.kBytes (string.length (httpResult)) + " from " + serverAddress + ".")}}}; if (httpResult != "") and cookiesOn { // find, parse, and store any cookies: ASG 4/9/98 local (ixEndHeader, responseHeader, i, j); ixEndHeader = string.patternMatch ("\r\n\r\n", httpResult); //try to find the end of the response header if ixEndHeader > 0 { //there is a valid header, look for cookies responseHeader = string.mid (httpResult, 1, ixEndHeader - 1); //get the header if string.lower (responseHeader) contains "set-cookie:" { //the response header contains at least one cookie if not defined (adrCookiesTable^) { new (tableType, adrCookiesTable)}; for i = 1 to string.countFields (responseHeader, "\r") { //find all the cookies local (onecookie = string.nthField (responseHeader, "\r", i)); //get the cookie onecookie = string.popLeading (onecookie, '\n'); if string.lower (onecookie) beginsWith "set-cookie:" { local (flsecure = false); //not secure by default local (domain = server); //default domain to this server local (cookiePath = "/"); local (expires = clock.now () + (24 * 60 * 60)); //default expires at "end of session" local (cookieName, cookieValue); if path != "/" { cookiePath = string.popSuffix (path, "/")}; onecookie = string.popLeading (string.mid (onecookie, 12, infinity), ' '); for j = 1 to string.countFields (onecookie, ';') { local (cookiepart = string.nthField (onecookie, ';', j)); cookiepart = string.popLeading (cookiepart, ' '); case string.lower (string.nthField (cookiepart, '=', 1)) { //take care of standard parts "domain" { domain = string.nthField (cookiepart, '=', 2)}; "path" { cookiePath = string.nthField (cookiepart, '=', 2)}; "expires" { on cookieDateToSystemDate (cookieDate) { try { //some cookie dates can be converted to dates directly local (systemDate = date (cookieDate)); if systemDate < date ("Monday, 6-Feb-2040") { return (systemDate)}}; try { //it may be a date in the 21st century local (lastpart = string.nthField (cookieDate, "-", 3)); local (ixstart = string.patternMatch (lastpart, cookieDate)); return (date (string.insert ("20", cookieDate, ixstart)))}; return (false)}; expires = cookieDateToSystemDate (string.nthField (cookiepart, '=', 2)); if expires == false { //invalid cookie, ignore it break}}; "secure" { flsecure = true}} else { //this is the actual cookie name/value cookieName = string.nthField (cookiepart, '=', 1); cookieValue = string.nthField (cookiepart, '=', 2)}}; if clock.now () < expires { //store non-expired cookies only if not defined (adrCookiesTable^.[domain]) { //have we cookies already for this domain? new (tableType, @adrCookiesTable^.[domain])}; if not defined (adrCookiesTable^.[domain].[cookiePath]) { new (tableType, @adrCookiesTable^.[domain].[cookiePath])}; if not defined (adrCookiesTable^.[domain].[cookiePath].[cookieName]) { new (tableType, @adrCookiesTable^.[domain].[cookiePath].[cookieName])}; adrCookiesTable^.[domain].[cookiePath].[cookieName].value = cookieValue; adrCookiesTable^.[domain].[cookiePath].[cookieName].expires = expires; adrCookiesTable^.[domain].[cookiePath].[cookieName].secure = flsecure}}}}}}; if debug { //save a copy of the server's response for debugging wp.newTextObject (httpResult, @scratchpad.httpResult)}; if (ctFollowRedirects > 0) { //check whether we are being redirected: AR 6/13/1999 local (statusCode = string.nthField (httpResult, ' ', 2)); if ({"301", "302", "303"} contains statusCode) { //response codes for Moved Permanently, Moved Temporarily, See Other local (flRedirect = false, redirectServer, redirectPath); local (t); new (tableType, @t); webserver.util.parseHeaders (httpResult, @t); if defined (t.location) { //the response has a Location: header field on isAbsoluteURL (s) { if not (s contains ":") { return (false)}; local (scheme = string.lower (string.nthField (s, ":", 1))); if scheme == "" { return (false)}; local (ix); for ix = 1 to sizeof (scheme) { if not string.isAlpha (scheme[ix]) { return (false)}}; return (true)}; on isAbsolutePath (s) { return (s beginsWith "/")}; case true { isAbsoluteURL (t.location) { if string.lower (t.location) beginsWith "http://" { //it's an absolute HTTP URL local (s = string.delete (t.location, 1, string.length ("http://"))); redirectServer = string.nthField (s, "/", 1); redirectPath = string.delete (s, 1, string.length (redirectServer) + 1); flRedirect = true}}; isAbsolutePath (t.location) { redirectServer = server; redirectPath = t.location; flRedirect = true}} else { //assume it is a relative path redirectServer = server; redirectPath = string.popSuffix (path, "/") + "/" + t.location; flRedirect = true}}; if flRedirect { if flMessages { displayMsg ("Redirected to " + t.Location + ".")}; if statusCode == "303" { //use the GET method to retrieve the specified entity method = "GET"}; //see section 10.3.4 of RFC2068 if adrRedirectInfo != nil { //10/13/02 by DW, accumulate info about the redirect local (adrsubtable = @adrRedirectInfo^.[string.padWithZeros (sizeof (adrRedirectInfo^) + 1, 5)]); new (tableType, adrsubtable); adrsubtable^.code = statusCode; adrsubtable^.server = redirectServer; adrsubtable^.port = port; adrsubtable^.path = redirectPath}; httpResult = tcp.httpClient (method, redirectServer, port, redirectPath, proxy, proxyPort, proxyUserName, proxyPassword, data, datatype, username, password, adrHdrTable, cookiesOn, debug, timeOutTicks, flMessages, --ctFollowRedirects, flJustHeaders, flAcceptOpml, flUseProxy, adrRedirectInfo)}}}; if flMessages { //clean up the message area: AR 6/14/1999 msg ("")}; return (httpResult)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.tcp.httpClient ! on httpClient (method="GET", server="", port=nil, path="", proxy=user.webBrowser.proxy.domain, proxyPort=user.webBrowser.proxy.port, proxyUserName=user.webBrowser.proxy.userName, proxyPassword=user.webBrowser.proxy.password, data="", datatype="", username="", password="", adrHdrTable=nil, cookiesOn=false, debug=false, timeOutTicks=60*30, flMessages=true, ctFollowRedirects=0, flJustHeaders=false, flAcceptOpml=false, flUseProxy=nil, adrRedirectInfo=nil) { ÇChanges Ç11/2/05; 9:37:38 AM by TAC Çwhen deleting expired cookies, delete in reverse order Ç5/3/04; 12:14:50 AM by TAC Çcookies weren't working for a path that looks like "/mypath" Ç2/7/03; 3:49:12 PM by JES ÇWhen testing for proxy-exempt servers, don't inclue the port number if specified in the server parameter. Ç2002 Ç10/20/02; 2:32:23 AM by JES ÇRespect user.webBrowser.proxy.exceptions. Ç10/16/02; 6:55:56 PM by JES ÇRemoved debugging code. Ç10/14/02; 11:10:16 AM by JES ÇIf server is 127.0.0.1 or "localhost", set flUseProxy to false. Ç10/13/02; 6:23:28 PM by DW ÇNew optional param -- adrRedirectInfo. If it's non-nil (the default) and we're redirecting, we fill the table with info about the redirect. The RSS aggregator needs this information, and it may prove useful in other places. See xml.rss.readService for an example of its usage. Ç2001 Ç12/19/01; 9:58:10 PM by JES ÇAdded a call to webBrowser.init, which initializes prefs at user.webBrowser.proxy. Added optional parameter, flUseProxy, which defaults to nil. If nil, then the value at user.webBrowser.proxy.enabled is used. Pass the value of flUseProxy when following redirects. Ç8/14/01; 1:49:11 PM by JES ÇWhen recursing to following redirects, pass in the flJustHeaders and flAcceptOpml parameters. Ç8/9/01; 6:10:17 PM by JES ÇIf the stream is unexpectedly closed by the remote host, call tcp.abortStream, to avoid consuming the available connections. Ç8/8/01; 3:21:27 PM by JES ÇIf no Accept header has been passed in, add an Accept header with the value: text/x-opml, */*, so that we get the response in opml instead of html. Ç3/1/01; 1:57:33 PM by PBS ÇTrim white space around the content-length header before coercing it to a number. If a server adds white space here, the coercion would fail, resulting in a connection counter leak. (History: this was discovered in Radio when reading the Red Herring channel.) Ç1/10/01; 10:36:30 AM by DW ÇAdd an optional parameter, flJustHeaders, if true, we don't read the body, we just return the header portion of the response. This is useful if you just want to know how big a download is, and want to defer downloading big things until the middle of the night when it's quiet on the Internet. Ç1/7/01; 9:44:18 PM by DW ÇIn Radio, set User-Agent to Radio UserLand. ÇChanged the header so it doesn't use backslashes. The outliner now supports wrapping headlines. Ç9/22/00; 11:27:50 AM by PBS ÇRespect the user's offline settings. Ç1999 Ç11/5/99; 3:00:39 AM by AR ÇIf the server doesn't send a Content-Length header, read until connection closes. Ç10/21/99; 3:57:29 PM by AR ÇAdapted to use new TCP verbs in 6.1. Ç6/14/99; 5:23:37 AM by AR ÇIf flMessages is true, we now clean up the message area before we return. Ç6/13/99; 9:20:04 AM by AR ÇBoth the read and write loop now yield time to other Frontier threads and to the system. ÇThe Host header is now generated correctly if the request goes thru a proxy server. ÇFixed a few inconsistencies in the cookie handling code. Thinks should now work correctly when connecting via a proxy server. ÇAdded an optional parameter, ctFollowRedirects, determining the number of times that HTTP redirects will be followed. In order to preserve previous behaviour, the default value is 0. Ç3/4/99; 11:54:30 AM by PBS ÇIf adrHdrTable^ contains a "Host" sub-item, don't add a Host header item. Ç3/2/99; 10:43:18 AM by DW Çif adrHdrTable^ contains a "User-Agent" sub-item, don't add a User-Agent header item Ç1998 Ç10/25/98; 6:33:59 AM by DW Çallow the use of a colon in the server name to specify the port Çexample: www.scripting.com:80 Çif present, we use that port, not the one specified in the call Çthe assumption is that most callers either specify 80 or don't specify the port at all Çfor crawlers, for example, they definitely want to use the port specified in the server string Çsome commands, esp in the webBrowser class, get the url from another piece of software Ç9/28/98; 4:42:12 AM by DW Çif we're sending to the same machine, set the stream ID to 0 Çuser.webserver.responders.CGI.methods.any is copying it, hope no CGIs are using it! Ç9/17/98; 7:11:56 AM by DW Çmsgs now say that they're from tcp.httpClient. Çchanged Connection to xxx timed out message to... ÇCan't process the request because the connection to xxx timed out. Çallow server to be "localhost", if so, we totally optimize the functionality Ç2/13/98; 8:57:10 AM by DW ÇInitial code assembled from various sample scripts by Dave Winer. ÇThe goal is to have a single documented way to talk to HTTP servers. ÇIt's got a long parameter list, but requires no configuration, doesn't run off a user.xxx table. ÇThe target user of this script is someone who needs to understand how the code works. ÇIt will be distributed with Frontier on both platforms as soon as we agree that this is complete and works. ÇWhen you call it, use parameter labels, don't depend on the order of these params. ÇFor examples, see tcp.examples. if tcp.isOffline () { //PBS 09/22/00: check offline status scriptError ("Can't send HTTP request because TCP is offline.")}; webBrowser.init (); try { //set flUseProxy if (flUseProxy == nil) and (typeOf (flUseProxy) == unknownType) { flUseProxy = user.webBrowser.proxy.enabled}; if server == "127.0.0.1" or string.lower (server) == "localhost" { //JES 10/14/02: don't call the loopback address through the proxy flUseProxy = false}; if flUseProxy { //check the exceptions table -- if we find a match then set flUseProxy to false on wildcardIpMatch (s, oneip) { local (i); if s == oneip { //optimization return (true)}; for i = 1 to 4 { try { local (part = string.nthField (oneip, ".", i)); local (pattern = string.nthField (s, ".", i)); if pattern == "*" { continue}; if pattern contains "-" { local (min = number (string.nthField (pattern, "-", 1)) ); local (max = number (string.nthField (pattern, "-", 2)) ); local (n = number (part)); if n >= min and n <= max { continue} else { return (false)}}; if pattern != part { return (false)}} else { return (false)}}; return (true)}; local (flIpAddress = false, hostToCheck = string.lower (string.nthField (server, ":", 1)) ); try { //see if flIpAddress should be true local (serverWithoutDots = string.replaceAll (server, ".", "")); double (serverWithoutDots); //will error if non-numeric characters are present flIpAddress = true} else { //check domains, and then try a DNS lookup local (adr); local (lowerserver = string.lower (server)); for adr in @user.webBrowser.proxy.exceptions { if string.wildcardMatch (hostToCheck, string.lower (nameOf (adr^)) ) { if adr^ { flUseProxy = false; break}}}; if flUseProxy { //try a reverse lookup so we can check against IP address try { hostToCheck = tcp.dns.getDottedId (server); flIpAddress = true}}}; if flUseProxy { //check to see if this specific IP is excepted if defined (user.webBrowser.proxy.exceptions.[hostToCheck]) { if user.webBrowser.proxy.exceptions.[hostToCheck] { flUseProxy = false}}}; if flUseProxy { //check for IP-address exceptions which contain wildcard characters and ranges local (i); for i = 1 to sizeOf (user.webBrowser.proxy.exceptions) { if user.webBrowser.proxy.exceptions[i] { local (oneexception = nameOf (user.webBrowser.proxy.exceptions[i])); if wildcardIpMatch (oneexception, hostToCheck) { flUseProxy = false; break}}}}}}; on displayMsg (s) { msg ("tcp.httpClient: " + s)}; local (myAddress = tcp.myDottedID (), flSameMachine = false); bundle { //look for the port specified in the server string if server contains ":" { try {port = number (string.nthField (server, ":", 2))}; //it might not be a number server = string.nthField (server, ":", 1)}; if port == nil { //no port was specified, either in the call or in the server string port = 80}}; bundle { //see if it's the same machine if string.lower (server) == "localhost" { flSameMachine = true} else { try {flSameMachine = tcp.equalNames (server, myAddress)}}; //DW 3/9/98 ÇPBS 9/18/98: check that the server on the requested port is Frontier. if port != user.inetd.config.http.port { flSameMachine = false} //it's the same machine, but it's not Frontier as a server else { if not (inetd.isDaemonRunning (@user.inetd.config.http)) { flSameMachine = false}}}; //Frontier isn't running as a webserver, there must be another server on this machine if not (path beginsWith "/") { path = "/" + path}; local (httpCommand = "", adrCookiesTable = @user.webBrowser.cookies); bundle { //build the HTTP request in "httpCommand" on add (s) { httpCommand = httpCommand + s + "\r\n"}; local (uri = path); if flUseProxy and (sizeOf (proxy) > 0) { //the request is going thru a proxy server: set uri accordingly uri = "http://" + server; if port != 80 { uri = uri + ":" + port}; uri = uri + path}; add (method + " " + uri + " HTTP/1.0"); if (adrHdrTable == nil) or (not defined (adrHdrTable^.["User-Agent"])) { //3/2/99; 10:43:10 AM by DW if system.environment.isPike { add ("User-Agent: Radio UserLand/" + Frontier.version () + " (" + sys.os () + ")")} else { add ("User-Agent: Frontier/" + Frontier.version () + " (" + sys.os () + ")")}}; local (host = "Host: " + server); if port != 80 { host = host + ":" + port}; if (adrHdrTable == nil) or (not defined (adrHdrTable^.["Host"])) { //3/4/99; 11:54:30 AM by PBS add (host)}; if flAcceptOpml { //8/8/01; 3:19:50 PM by JES if (adrHdrTable == nil) { add ("Accept: text/x-opml, */*")} else { //headers were passed in if defined (adrHdrTable^.Accept) { local (acceptHeader = adrHdrTable^.Accept); if not (acceptHeader contains "text/x-opml") { if sizeOf (string.trimWhiteSpace (acceptHeader)) > 0 { acceptHeader = "text/x-opml, " + acceptHeader} else { acceptHeader = "text/x-opml"}}; if not (acceptHeader contains "*/*") { acceptHeader = acceptHeader + ", */*"}; add ("Accept: " + acceptHeader)} else { add ("Accept: text/x-opml, */*")}}}; if sizeOf (data) > 0 { add ("Content-Type: " + datatype); add ("Content-length: " + sizeOf (data))}; if (sizeOf (username) > 0) or (sizeOf (password) > 0) { add ("Authorization: Basic " + base64.encode (username + ":" + password, 0))}; if flUseProxy and (sizeOf (proxy) > 0) { //the request is going thru a proxy server if (sizeOf (proxyUsername) > 0) or (sizeOf (proxyPassword) > 0) { //the proxy requires authentication add ("Proxy-Authorization: Basic " + base64.encode (proxyUsername + ":" + proxyPassword, 0))}}; if adrHdrTable != nil { //added 3.27.98 by ASG to include header items local (i); for i = 1 to sizeOf (adrHdrTable^) { local (headerName = nameOf (adrHdrTable^[i])); if flAcceptOpml { //8/8/01; 3:19:50 PM by JES: Only add the Acept header once if string.lower (headerName) == "accept" { continue}}; add (headerName + ": " + adrHdrTable^[i])}}; if cookiesOn and defined (adrCookiesTable^) { //add cookies to the request header: ASG 4/9/98 local (i, j, k, cookiePath = "/", cookiestring); if path != "/" { cookiePath = string.popSuffix (path, "/"); if cookiePath == "" { // 5/3/04; 12:14:50 AM by TAC - cookies weren't working for a path that looks like "/mypath" cookiePath = "/"}}; for i = 1 to sizeOf (adrCookiesTable^) { //loop through cookies table local (adrdomain = @adrCookiesTable^ [i]); if host endsWith nameOf (adrdomain^) { for j = 1 to sizeOf (adrdomain^) { local (adrcookie = @adrdomain^ [j]); if cookiePath contains nameOf (adrcookie^) { for k = sizeOf (adrcookie^) downTo 1 { // 11/2/05; 9:37:38 AM by TAC if adrcookie^ [k].expires > clock.now () { //add this cookie cookiestring = cookiestring + nameOf (adrcookie^ [k]) + "=" + adrcookie^ [k].value + "; "} else { delete (@adrcookie^ [k])}}}}}}; //this cookie has expired so delete it if cookiestring != nil { cookiestring = string.delete (cookiestring, sizeof (cookiestring) - 1, 2); //delete trailing "; " add ("Cookie: " + cookiestring)}}; //add the cookies to the header add (""); //blank line if sizeOf (data) > 0 { httpCommand = httpCommand + data}}; if debug { //save a copy of the HTTP request for debugging wp.newTextObject (httpCommand, @scratchpad.httpCommand)}; local (httpResult = ""); if flSameMachine { //shortcut the call, turn our worst case into our best case: 9/17/98; 7:21:13 AM by DW local (params); new (tabletype, @params); params.client = myAddress; params.port = port; params.stream = 0; //9/28/98; 4:42:45 AM by DW params.request = httpCommand; httpResult = webserver.server (@params, httpCommand)} else { local (serverAddress = server, serverPort = port); if flUseProxy and (sizeOf (proxy) > 0) { //the request is going thru a proxy server: switch server and port serverAddress = proxy; serverPort = proxyPort}; if flMessages { //PBS 5/5/98 displayMsg ("Connecting to " + serverAddress + ".")}; local (stream = tcp.openStream (serverAddress, serverPort)); local (chunksize = 5 * 1024); if flMessages { displayMsg ("Sending request to " + serverAddress + ".")}; try { tcp.writeStringToStream (stream, httpCommand, chunkSize, timeOutTicks/60)} //write the command to the server else { tcp.abortStream (stream); scriptError (tryError)}; if flMessages { displayMsg ("Waiting for data from " + serverAddress + ".")}; local (pat = "\r\n\r\n"); try { tcp.readStreamUntil (stream, pat, timeOutTicks/60, @httpResult)} else { tcp.abortStream (stream); scriptError (tryerror)}; local (headerTable); webserver.util.parseHeaders (httpResult, @headerTable); if flJustHeaders { //the caller only wants the headers, not the body 1/10/01 by DW tcp.closeStream (stream)} else { if (string.upper (method) != "HEAD") and defined (headerTable.["Content-Length"]) { //we know there's content left to be read local (lenHeader = string.patternMatch (pat, httpResult) - 1); local (lenContent = number (string.trimWhiteSpace (headerTable.["Content-Length"]))); //PBS 03/01/01: trim white space before coercing local (lenTotal = lenHeader + string.length (pat) + lenContent); if flMessages { displayMsg ("Receiving response body (" + string.kBytes (lenContent) + ") from " + serverAddress + ".")}; try { tcp.readStreamBytes (stream, lenTotal, timeOutTicks/60, @httpResult)} else { tcp.abortStream (stream); scriptError (tryerror)}} else { //just read until connection closes if flMessages { displayMsg ("Receiving response from " + serverAddress + ".")}; try { tcp.readStreamUntilClosed (stream, timeOutTicks/60, @httpResult)} else { tcp.abortStream (stream); scriptError (tryerror)}}; tcp.closeStream (stream); if (httpResult != "") and flMessages { displayMsg ("Finished receiving " + string.kBytes (string.length (httpResult)) + " from " + serverAddress + ".")}}}; if (httpResult != "") and cookiesOn { // find, parse, and store any cookies: ASG 4/9/98 local (ixEndHeader, responseHeader, i, j); ixEndHeader = string.patternMatch ("\r\n\r\n", httpResult); //try to find the end of the response header if ixEndHeader > 0 { //there is a valid header, look for cookies responseHeader = string.mid (httpResult, 1, ixEndHeader - 1); //get the header if string.lower (responseHeader) contains "set-cookie:" { //the response header contains at least one cookie if not defined (adrCookiesTable^) { new (tableType, adrCookiesTable)}; for i = 1 to string.countFields (responseHeader, "\r") { //find all the cookies local (onecookie = string.nthField (responseHeader, "\r", i)); //get the cookie onecookie = string.popLeading (onecookie, '\n'); if string.lower (onecookie) beginsWith "set-cookie:" { local (flsecure = false); //not secure by default local (domain = server); //default domain to this server local (cookiePath = "/"); local (expires = clock.now () + (24 * 60 * 60)); //default expires at "end of session" local (cookieName, cookieValue); if path != "/" { cookiePath = string.popSuffix (path, "/")}; onecookie = string.popLeading (string.mid (onecookie, 12, infinity), ' '); for j = 1 to string.countFields (onecookie, ';') { local (cookiepart = string.nthField (onecookie, ';', j)); cookiepart = string.popLeading (cookiepart, ' '); case string.lower (string.nthField (cookiepart, '=', 1)) { //take care of standard parts "domain" { domain = string.nthField (cookiepart, '=', 2)}; "path" { cookiePath = string.nthField (cookiepart, '=', 2)}; "expires" { on cookieDateToSystemDate (cookieDate) { try { //some cookie dates can be converted to dates directly local (systemDate = date (cookieDate)); if systemDate < date ("Monday, 6-Feb-2040") { return (systemDate)}}; try { //it may be a date in the 21st century local (lastpart = string.nthField (cookieDate, "-", 3)); local (ixstart = string.patternMatch (lastpart, cookieDate)); return (date (string.insert ("20", cookieDate, ixstart)))}; return (false)}; expires = cookieDateToSystemDate (string.nthField (cookiepart, '=', 2)); if expires == false { //invalid cookie, ignore it break}}; "secure" { flsecure = true}} else { //this is the actual cookie name/value cookieName = string.nthField (cookiepart, '=', 1); cookieValue = string.nthField (cookiepart, '=', 2)}}; if clock.now () < expires { //store non-expired cookies only if not defined (adrCookiesTable^.[domain]) { //have we cookies already for this domain? new (tableType, @adrCookiesTable^.[domain])}; if not defined (adrCookiesTable^.[domain].[cookiePath]) { new (tableType, @adrCookiesTable^.[domain].[cookiePath])}; if not defined (adrCookiesTable^.[domain].[cookiePath].[cookieName]) { new (tableType, @adrCookiesTable^.[domain].[cookiePath].[cookieName])}; adrCookiesTable^.[domain].[cookiePath].[cookieName].value = cookieValue; adrCookiesTable^.[domain].[cookiePath].[cookieName].expires = expires; adrCookiesTable^.[domain].[cookiePath].[cookieName].secure = flsecure}}}}}}; if debug { //save a copy of the server's response for debugging wp.newTextObject (httpResult, @scratchpad.httpResult)}; if (ctFollowRedirects > 0) { //check whether we are being redirected: AR 6/13/1999 local (statusCode = string.nthField (httpResult, ' ', 2)); if ({"301", "302", "303"} contains statusCode) { //response codes for Moved Permanently, Moved Temporarily, See Other local (flRedirect = false, redirectServer, redirectPath); local (t); new (tableType, @t); webserver.util.parseHeaders (httpResult, @t); if defined (t.location) { //the response has a Location: header field on isAbsoluteURL (s) { if not (s contains ":") { return (false)}; local (scheme = string.lower (string.nthField (s, ":", 1))); if scheme == "" { return (false)}; local (ix); for ix = 1 to sizeof (scheme) { if not string.isAlpha (scheme[ix]) { return (false)}}; return (true)}; on isAbsolutePath (s) { return (s beginsWith "/")}; case true { isAbsoluteURL (t.location) { if string.lower (t.location) beginsWith "http://" { //it's an absolute HTTP URL local (s = string.delete (t.location, 1, string.length ("http://"))); redirectServer = string.nthField (s, "/", 1); redirectPath = string.delete (s, 1, string.length (redirectServer) + 1); flRedirect = true}}; isAbsolutePath (t.location) { redirectServer = server; redirectPath = t.location; flRedirect = true}} else { //assume it is a relative path redirectServer = server; redirectPath = string.popSuffix (path, "/") + "/" + t.location; flRedirect = true}}; if flRedirect { if flMessages { displayMsg ("Redirected to " + t.Location + ".")}; if statusCode == "303" { //use the GET method to retrieve the specified entity method = "GET"}; //see section 10.3.4 of RFC2068 if adrRedirectInfo != nil { //10/13/02 by DW, accumulate info about the redirect local (adrsubtable = @adrRedirectInfo^.[string.padWithZeros (sizeof (adrRedirectInfo^) + 1, 5)]); new (tableType, adrsubtable); adrsubtable^.code = statusCode; adrsubtable^.server = redirectServer; adrsubtable^.port = port; adrsubtable^.path = redirectPath}; httpResult = tcp.httpClient (method, redirectServer, port, redirectPath, proxy, proxyPort, proxyUserName, proxyPassword, data, datatype, username, password, adrHdrTable, cookiesOn, debug, timeOutTicks, flMessages, --ctFollowRedirects, flJustHeaders, flAcceptOpml, flUseProxy, adrRedirectInfo)}}}; if flMessages { //clean up the message area: AR 6/14/1999 msg ("")}; return (httpResult)} \ No newline at end of file |
|
From: creedon <icr...@us...> - 2005-11-06 01:26:33
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/startup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27704 Modified Files: startupScript Log Message: moved system.temp.Frontier check back to top of script Index: startupScript =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/startup/startupScript,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** startupScript 9 Oct 2005 23:37:14 -0000 1.11 --- startupScript 6 Nov 2005 01:26:22 -0000 1.12 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.startup.startupScript ! ÇChanges Ç10/9/05; 3:39:07 PM by TAC Çwhen storing prefs.root path, store realative path Çuse table.copyUndefinedContents to copy some item Çmove some of the user prefs initializations into Frontier.data.userPrefs Çrearrange script so that some initializations can happen outside of the first root run, this should make it easier to add new items and not have them get missed because the first root run had already been run once Ç10/4/05; 7:26:36 PM by TAC Çupon check for presence of Psapi.dll, don't use hard coded application name Ç9/26/05; 4:30:14 PM by TAC Çadded user.prefs.flReplaceDialogExpertMode Ç8/23/05; 7:22:18 PM by TAC Çadded user.prefs.flCompactModalMenus Ç7/14/05; 10:35:39 AM by TAC Çsystem.menus.data.currentMenuType set to nil so agent will update modal menu properly upon relaunch Ç7/6/05; 12:21:38 PM by TAC Çchanged user.callbacks.sendmail to user.callbacks.tcpSendMail Çadded user.prefs.mailHostPort Ç6/15/05; 6:52:11 PM by TAC Çrewrite for Open Source release, bring in code from startup.startupScript, userland.firstRootRun, userland.finishInstall, and userland.cleanRoot ÇOld code Çstartup.startupScript <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/startup/startupScript?rev=1.1> Çuserland.firstRootRun <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/firstRootRun?rev=1.1> Çuserland.finishInstall <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/finishInstall?rev=1.1> Çuserland.cleanRoot <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/cleanRoot?rev=1.1> Ç06/08/01; 11:24:35 PM by JES ÇWhen opening databases defined at user.databases, skip objects which aren't tables. This avoids the condition where startup wouldn't complete, if there's an item #1 in the user.databases table. Ç06/02/01; 8:34:20 PM by PBS ÇDo the web-based install and open the Control Panel if this is the first root run. Ç04/28/01; 7:48:46 PM by JES ÇCall Frontier.tools.startup in a try block, so that the startup process will finish even if Tools installation fails. Ç04/20/01; 4:49:05 PM by JES ÇCall tools.startup to install Tools at startup. Ç10/7/99; 4:20:26 PM by PBS ÇOnly run the #startup script in a guest database if runStartupScript exists and is true. Previously, it would be run whether runStartupScript was true or false. Çhttp://frontier.userland.com/stories/storyReader$1760 Ç10/6/99; 10:21:35 PM by PBS ÇOnly set the taskTime for the overnight task if it's in the past. This fixes a bug when the taskTime was before midnight, but it was being set for the next day, so the overnight task wouldn't run. Çhttp://frontier.userland.com/stories/storyReader$1761 Ç8/19/99; 6:44:48 AM by DW ÇMake sure that taskTimes in user.scheduler.tasks are in the future. ÇWe do this much more quickly than scheduler.monitor would. Çhttp://discuss.userland.com/msgReader$9658 ÇThis script runs when Frontier opens the Frontier.root file. local (flEnableAgents = true, flOpenDatabases = true, flEnableHttpServer = true); // can be set by the external startup script local (flFirstRootRun = true); bundle { // miscellaneous variable initializations and checks, phase 1 of 2 Frontier.pathString = file.folderFromPath (frontier.getFilePath ())}; if defined (user.prefs.firstRootRun) { flFirstRootRun = user.prefs.firstRootRun}; if flFirstRootRun { // disable agents, hide all windows, wipe temp and user Frontier.enableAgents (false); // try to keep agents from reporting errors while window.frontmost () != "" { // open windows can mess things up later on window.hide (window.frontmost ())}; Çreturn (false) // enable for testing new (tableType, @system.temp); new (tableType, @root.user)}; backups.init (); batchExporter.init (); export.init (); rootUpdates.init (); // set up user.rootUpdates, even though root updates uses tcp, its ok to set up here as no tcp calls are made at this time webEdit.init (); bundle { // set up user.prefs if flFirstRootRun { new (tableType, @user.prefs); bundle { // set up user.prefs.commonStyles case sys.os () { "MacOS" { if system.environment.isCarbon { user.prefs.commonStyles = Frontier.data.commonStylesMacCarbon} else { user.prefs.commonStyles = Frontier.data.commonStylesMac}}; "Win95"; "WinNT" { user.prefs.commonStyles = Frontier.data.commonStylesWin}}}}; table.copyUndefinedContents (@Frontier.data.userPrefs, @user.prefs); bundle { // set up user.prefs.dialogs if flFirstRootRun { new (tableType, @user.prefs.dialogs)}; table.copyUndefinedContents (@Frontier.data.userPrefs.dialogs, @user.prefs.dialogs)}; bundle { // set up user.prefs.search if flFirstRootRun { new (tableType, @user.prefs.search)}; table.copyUndefinedContents (@Frontier.data.userPrefs.search, @user.prefs.search); if not (defined (user.prefs.search.replaceWith)) { user.prefs.search.replaceWith = Frontier.version ()}}; Frontier.setupUserPrefsFonts ()}; if flFirstRootRun { bundle { // set up the quick script window clipboard.putvalue ("dialog.notify (\"Hello World!\")"); window.quickScript (); editmenu.selectall (); editmenu.paste (); window.close ("Quick Script")}; bundle { // set up root window local (w = "root"); window.open (w); window.setPosition (w, 0, 0); editMenu.setFont (user.prefs.fonts.tableFont); editMenu.setFontSize (user.prefs.fonts.tableFontSize); window.zoom (w)}; bundle { // set up user.callbacks new (tableType, @user.callbacks); new (tableType, @user.callbacks.closeWindow); new (tableType, @user.callbacks.cmd2click); new (tableType, @user.callbacks.compileChangedScript); new (tableType, @user.callbacks.control2click); new (tableType, @user.callbacks.fileWriteWholeFile); new (tableType, @user.callbacks.opCollapse); new (tableType, @user.callbacks.opCursorMoved); new (tableType, @user.callbacks.openWindow); new (tableType, @user.callbacks.opExpand); new (tableType, @user.callbacks.opInsert); new (tableType, @user.callbacks.opReturnKey); new (tableType, @user.callbacks.opRightClick); new (tableType, @user.callbacks.opStruct2Click); new (tableType, @user.callbacks.option2click); new (tableType, @user.callbacks.resume); new (tableType, @user.callbacks.saveWindow); new (tableType, @user.callbacks.shutdown); new (tableType, @user.callbacks.startup); new (tableType, @user.callbacks.statusMessage); new (tableType, @user.callbacks.suspend); new (tableType, @user.callbacks.systemTrayIcon2Click); new (tableType, @user.callbacks.systemTrayIconRightClick); new (tableType, @user.callbacks.tcpSendMail)}; bundle { // clear applications paths in system.verbs.apps local (adrAppsTable = @system.verbs.apps, i); for i = 1 to sizeof (adrAppsTable^) { local (adrAppInfo = @adrAppsTable^ [i].appInfo); if defined (adrAppInfo^) { adrAppInfo^.path = ""}}}; bundle { // set up Frontier.tools.thread Frontier.tools.thread.ct = 0; Frontier.tools.thread.enabled = true}; bundle { // set up workspace new (tableType, @root.workspace); new (outlineType, @workspace.notepad)}; bundle { // miscellaneous new (tableType, @root.scratchpad); new (tableType, @system.deskscripts); new (tableType, @user.databases); new (tableType, @user.protocols); }};Çnew (tableType, @websites.["#data"]) bundle { // set up user.menus if flFirstRootRun { new (tableType, @user.menus)}; Çuser.menus.bookmarkMenu = userland.virginBookmarkMenu if not (defined (user.menus.customMenu)) { user.menus.customMenu = Frontier.data.virginCustomMenu}}; if flFirstRootRun { // open mainResponder.root and prefs.root bundle { // open mainResponder.root, hidden and add to user.databases local (appFolder = Frontier.getSubFolder ("apps")); if not defined ( [appFolder + "mainResponder.root"] ) { Frontier.installApp ("mainResponder.root", false)}}; bundle { // open prefs.root, hidden and add to user.databases local (f = Frontier.getSubFolder ("www") + "prefs.root"); if not (defined ([f])) { fileMenu.open (f, true);}; //open hidden ÇAdd an entry to the user.databases table. local (adrTable = @user.databases.["prefs.root"]); new (tableType, adrTable); adrTable^.f = file.getPathChar () + (f - Frontier.pathString); adrTable^.openOnStartup = true; adrTable^.runStartupScript = false; adrTable^.supportsSubscribe = false}}; Çbundle //initialize responders Çuser.webserver.responders.websiteFramework.data.docTree.samples = @websites.samples Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.allSites) Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.contents) Ç Çif defined (user.webserver.responders.manilaEdit) Çdelete (@user.webserver.responders.manilaEdit) ÇfileMenu.save () bundle { // system.temp.Frontier if defined (system.temp.Frontier) { //only run the startup script once return}; new (tableType, @system.temp.Frontier); system.temp.Frontier.startupTime = clock.now (); system.temp.Frontier.startingUp = true}; bundle { // miscellaneous variable initializations and checks, phase 2 of 2 system.menus.data.currentsuite = ""; system.menus.data.currentMenuType = nil; system.menus.data.currentmenu = 0; bundle { // check for presence of Psapi.dll if sys.os () == "WinNT" { if not (sys.appIsRunning (file.fileFromPath (Frontier.getProgramPath ()))) { // 11/27/04; 12:14:40 PM by TAC - would it be possible for Frontier to install this on its own? dialog.alert ("You need to run the Frontier Psapi Installer for certain Frontier verbs to work properly.")}}}}; bundle { //open the about window if the pref says we should Çadded 12/16/98; 6:47:28 PM by DW if not defined (user.prefs.openAboutWindow) { user.prefs.openAboutWindow = true}; if user.prefs.openAboutWindow { window.about ()}}; bundle { //initialize the log, next bit of code could add a log item Çadded 12/16/98; 6:52:40 PM by DW if defined (log.startup) { log.startup ()}}; bundle { //run the external startup script local (fname = "frontierStartupCommands.txt"); local (f = file.folderFromPath (Frontier.getProgramPath ()) + fname); if file.exists (f) { try { evaluate (string (file.readWholeFile (f)))} else { log.add ("Error running " + fname + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}; bundle { // tcp based services webserver.init (); // needs to load first betty.init (); // needs to load second soap.init ()}; bundle { // people based services people.init (); // needs to load first custody.init (); webEditServer.init ()}; bundle { //open all the databases that have openOnStartup true Çadded 12/16/98; 6:23:16 PM by DW if defined (user.databases) { if flOpenDatabases { local (i, flmsg = false); for i = 1 to sizeof (user.databases) { if typeOf (user.databases[i]) == tableType { //06/08/01 JES: avert item #1 errors with user.databases [i] { local (flopened = false); try { if openOnStartup { msg (this + ": Opening " + file.fileFromPath (f)); flmsg = true; fileMenu.open (f, hidden:true); flopened = true}} else { log.add ("Startup error opening guest database " + nameof (user.databases [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}; if flopened { if defined (runStartupScript) { if runStartupScript { //PBS 10/7/99: check the value of runStartupScript: only run the script if the boolean is true local (adrscript = @[filespec (f)].["#startup"]); if defined (adrscript^) { try { adrscript^ ()} else { log.add ("Error running #startup script in guest database " + nameof (user.databases [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}}}}}}; if flmsg { msg ("")}}}}; try { //04/28/2001 JES: prevent startup from failing if Tool installation fails. Frontier.tools.startup ()}; scheduler.init (); html.init (); bundle { // webBrowser webBrowser.init (); if system.environment.isMac { try {new (tableType, @user.odbEditors.data.openFiles)}}; //Empty out the list of externally-edited files. if system.environment.isWindows { user.webBrowser.winDefaultBrowserApp = file.findApplication ("htm")}}; bundle { // first root run, phase 2 of 3 if flFirstRootRun { bundle { // set up websites table and related with websites.["#ftpSite"] { folder = file.folderFromPath (Frontier.getProgramPath ()) + "Websites" + file.getPathChar (); Çfile.sureFolder (folder) url = file.fileToURL (folder); isLocal = true}; user.html.sites.default = websites.["#ftpSite"]}; bundle { // personalize this copy of Frontier, configure network settings, and complete the installation local (flWebBasedInstall = true); if flWebBasedInstall { Ç11/29/04; 11:17:45 AM by TAC - the following seems like it should be done as part of mainRepsonder startup, init. IIRC, members.root is a feature of mainResponder bundle { //create the Admin membership group if needed local (adrRoot = @[system.temp.mainResponder.membersRootFile]); local (adrGroup = @adrRoot^.admin); if not defined (adrGroup^) { new (tableType, adrGroup)}; if not defined (adrGroup^.callbacks) { new (tableType, @adrGroup^.callbacks)}; if not defined (adrGroup^.cookieDomain) { adrGroup^.cookieDomain = ""}; if not defined (adrGroup^.cookieExpires) { adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; if not defined (adrGroup^.cookieName) { adrGroup^.cookieName = "Admin"}; if not defined (adrGroup^.mailReturnAddress) { adrGroup^.mailReturnAddress = user.prefs.mailAddress}; if not defined (adrGroup^.mailSubject) { adrGroup^.mailSubject = "Admin"}; if not defined (adrGroup^.mailTemplate) { wp.newTextObject ("", @adrGroup^.mailTemplate)}; if not defined (adrGroup^.openToPublic) { adrGroup^.openToPublic = false}; if not defined (adrGroup^.users) { new (tableType, @adrGroup^.users)}}; bundle { // prep for web based install via mainResponder admin website local (portString = ""); if user.inetd.config.http2.port != 80 { portString = ":" + user.inetd.config.http2.port}; if not defined (system.temp.Frontier.setupFrontier) { new (tableType, @system.temp.Frontier.setupFrontier)}; system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = true; local (setupUrl = "http://127.0.0.1" + portString + "/setupFrontier"); if not defined (system.temp.installer) { new (tableType, @system.temp.installer)}; system.temp.installer.urlToOpen = setupUrl}} else { on infoDialog () { //prompt the user for name, org and initials on kernelCall (adrName, adrInitials, adrOrg, adrEmail) { kernel (dialog.getUserInfo)}; local (name, initials, organization, email); case sys.os () { "Win95"; "WinNT" { if not (kernelCall (@name, @initials, @organization, @email)) { return (false)}; if initials == "" { dialog.alert ("You must specify your initials."); infoDialog ()}; user.prefs.name = name; user.prefs.initials = initials; user.prefs.organization = organization; user.prefs.mailAddress = email}; "MacOS" { bundle { //initialize user.prefs.name etc using info from Internet Config try { name = ic.geticpreference (ic.eventinfo.realName)}; try { organization = ic.geticpreference (ic.eventinfo.organization)}; try { email = ic.geticpreferece (ic.eventinfo.emailAddress)}; user.prefs.name = name; user.prefs.organization = organization; if name != "" { local (i); user.prefs.initials = name [1]; for i = 3 to sizeof (name) { if name [i] == ' ' { user.prefs.initials = user.prefs.initials + name [i+1]}}}}; card.run (@system.cards.userInfoDialog)}}; return (true)}; infoDialog ()}}; //AR 09/27/04 : personalize install ÇrootUpdates.getCurrent ("Frontier") // 11/29/04; 6:57:54 PM by TAC - if we get a root update then we'll need to use rootUpdates.update bundle { // about window local (w); window.about (); w = window.frontMost (); window.zoom (w); menus.scripts.styleCommand ("medium"); window.setPosition (w, 25, 75); };Çwindow.close (s) bundle { // license edit (@system.startup.license); // 12/4/04; 9:26:35 PM by TAC - i rather do this near the beginning of phase 1 firstRootRun but had a problem with this window and setting up the quick script window wp.setSelect (0, 0)}}}; system.callbacks.startup (); //call user's startup scripts bundle { // build menu bar system.menus.buildMenuBar (); system.menus.buildSuitesSubmenu ()}; //5.0 Frontier.enableAgents (flEnableAgents); if flEnableHttpServer { //6.0, daemons don't start up until all the startup code has run new (tableType, @user.inetd.listens); inetd.start ()}; //start up all daemons with startup set true if flFirstRootRun { // open a url and set first root run to false if defined (system.temp.installer.urlToOpen) { Çwindow.update ("About Frontier") webBrowser.openUrl (system.temp.installer.urlToOpen); webBrowser.bringToFront ()}; user.prefs.firstRootRun = false}; system.temp.Frontier.startingUp = false; //signal to all who care, let the hits begin! msg (""); fileMenu.save (); Ç Çbundle //license agreement Çlocal (editLicense = false) Çif sys.os () == "MacOS" Çon itemhit (itemnumber) Çcase (itemnumber) Ç1 Çyes ÇeditLicense = true Çreturn (false) Çstop processing the dialog Ç2 Çno Çreturn (false) Çstop processing the dialog Çreturn (true) Çkeep processing the dialog Çdialog.run (517, 1, @itemhit) Çelse Çif dialog.yesNo ("Frontier is licensed software. Do you want to read the license agreement now?") ÇeditLicense = true Çif editLicense Çbundle //get root update ÇproxyInit () Çif user.prefs.serialNumber != "" and not (string.lower (user.prefs.serialNumber) contains "trial") ÇrootUpdates.init () \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.startup.startupScript ! ÇChanges Ç11/5/05; 12:00:32 PM by TAC Çmoved system.temp.Frontier check back to top of script Ç10/9/05; 3:39:07 PM by TAC Çwhen storing prefs.root path, store realative path Çuse table.copyUndefinedContents to copy some item Çmove some of the user prefs initializations into Frontier.data.userPrefs Çrearrange script so that some initializations can happen outside of the first root run, this should make it easier to add new items and not have them get missed because the first root run had already been run once Ç10/4/05; 7:26:36 PM by TAC Çupon check for presence of Psapi.dll, don't use hard coded application name Ç9/26/05; 4:30:14 PM by TAC Çadded user.prefs.flReplaceDialogExpertMode Ç8/23/05; 7:22:18 PM by TAC Çadded user.prefs.flCompactModalMenus Ç7/14/05; 10:35:39 AM by TAC Çsystem.menus.data.currentMenuType set to nil so agent will update modal menu properly upon relaunch Ç7/6/05; 12:21:38 PM by TAC Çchanged user.callbacks.sendmail to user.callbacks.tcpSendMail Çadded user.prefs.mailHostPort Ç6/15/05; 6:52:11 PM by TAC Çrewrite for Open Source release, bring in code from startup.startupScript, userland.firstRootRun, userland.finishInstall, and userland.cleanRoot ÇOld code Çstartup.startupScript <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/startup/startupScript?rev=1.1> Çuserland.firstRootRun <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/firstRootRun?rev=1.1> Çuserland.finishInstall <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/finishInstall?rev=1.1> Çuserland.cleanRoot <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/cleanRoot?rev=1.1> Ç06/08/01; 11:24:35 PM by JES ÇWhen opening databases defined at user.databases, skip objects which aren't tables. This avoids the condition where startup wouldn't complete, if there's an item #1 in the user.databases table. Ç06/02/01; 8:34:20 PM by PBS ÇDo the web-based install and open the Control Panel if this is the first root run. Ç04/28/01; 7:48:46 PM by JES ÇCall Frontier.tools.startup in a try block, so that the startup process will finish even if Tools installation fails. Ç04/20/01; 4:49:05 PM by JES ÇCall tools.startup to install Tools at startup. Ç10/7/99; 4:20:26 PM by PBS ÇOnly run the #startup script in a guest database if runStartupScript exists and is true. Previously, it would be run whether runStartupScript was true or false. Çhttp://frontier.userland.com/stories/storyReader$1760 Ç10/6/99; 10:21:35 PM by PBS ÇOnly set the taskTime for the overnight task if it's in the past. This fixes a bug when the taskTime was before midnight, but it was being set for the next day, so the overnight task wouldn't run. Çhttp://frontier.userland.com/stories/storyReader$1761 Ç8/19/99; 6:44:48 AM by DW ÇMake sure that taskTimes in user.scheduler.tasks are in the future. ÇWe do this much more quickly than scheduler.monitor would. Çhttp://discuss.userland.com/msgReader$9658 ÇThis script runs when Frontier opens the Frontier.root file. bundle { // system.temp.Frontier if defined (system.temp.Frontier) { //only run the startup script once return}; new (tableType, @system.temp.Frontier); system.temp.Frontier.startupTime = clock.now (); system.temp.Frontier.startingUp = true}; local (flEnableAgents = true, flOpenDatabases = true, flEnableHttpServer = true); // can be set by the external startup script local (flFirstRootRun = true); bundle { // miscellaneous variable initializations and checks, phase 1 of 2 Frontier.pathString = file.folderFromPath (frontier.getFilePath ())}; if defined (user.prefs.firstRootRun) { flFirstRootRun = user.prefs.firstRootRun}; if flFirstRootRun { // disable agents, hide all windows, wipe temp and user Frontier.enableAgents (false); // try to keep agents from reporting errors while window.frontmost () != "" { // open windows can mess things up later on window.hide (window.frontmost ())}; Çreturn (false) // enable for testing new (tableType, @system.temp); new (tableType, @root.user)}; backups.init (); batchExporter.init (); export.init (); rootUpdates.init (); // set up user.rootUpdates, even though root updates uses tcp, its ok to set up here as no tcp calls are made at this time webEdit.init (); bundle { // set up user.prefs if flFirstRootRun { new (tableType, @user.prefs); bundle { // set up user.prefs.commonStyles case sys.os () { "MacOS" { if system.environment.isCarbon { user.prefs.commonStyles = Frontier.data.commonStylesMacCarbon} else { user.prefs.commonStyles = Frontier.data.commonStylesMac}}; "Win95"; "WinNT" { user.prefs.commonStyles = Frontier.data.commonStylesWin}}}}; table.copyUndefinedContents (@Frontier.data.userPrefs, @user.prefs); bundle { // set up user.prefs.dialogs if flFirstRootRun { new (tableType, @user.prefs.dialogs)}; table.copyUndefinedContents (@Frontier.data.userPrefs.dialogs, @user.prefs.dialogs)}; bundle { // set up user.prefs.search if flFirstRootRun { new (tableType, @user.prefs.search)}; table.copyUndefinedContents (@Frontier.data.userPrefs.search, @user.prefs.search); if not (defined (user.prefs.search.replaceWith)) { user.prefs.search.replaceWith = Frontier.version ()}}; Frontier.setupUserPrefsFonts ()}; if flFirstRootRun { bundle { // set up the quick script window clipboard.putvalue ("dialog.notify (\"Hello World!\")"); window.quickScript (); editmenu.selectall (); editmenu.paste (); window.close ("Quick Script")}; bundle { // set up root window local (w = "root"); window.open (w); window.setPosition (w, 0, 0); editMenu.setFont (user.prefs.fonts.tableFont); editMenu.setFontSize (user.prefs.fonts.tableFontSize); window.zoom (w)}; bundle { // set up user.callbacks new (tableType, @user.callbacks); new (tableType, @user.callbacks.closeWindow); new (tableType, @user.callbacks.cmd2click); new (tableType, @user.callbacks.compileChangedScript); new (tableType, @user.callbacks.control2click); new (tableType, @user.callbacks.fileWriteWholeFile); new (tableType, @user.callbacks.opCollapse); new (tableType, @user.callbacks.opCursorMoved); new (tableType, @user.callbacks.openWindow); new (tableType, @user.callbacks.opExpand); new (tableType, @user.callbacks.opInsert); new (tableType, @user.callbacks.opReturnKey); new (tableType, @user.callbacks.opRightClick); new (tableType, @user.callbacks.opStruct2Click); new (tableType, @user.callbacks.option2click); new (tableType, @user.callbacks.resume); new (tableType, @user.callbacks.saveWindow); new (tableType, @user.callbacks.shutdown); new (tableType, @user.callbacks.startup); new (tableType, @user.callbacks.statusMessage); new (tableType, @user.callbacks.suspend); new (tableType, @user.callbacks.systemTrayIcon2Click); new (tableType, @user.callbacks.systemTrayIconRightClick); new (tableType, @user.callbacks.tcpSendMail)}; bundle { // clear applications paths in system.verbs.apps local (adrAppsTable = @system.verbs.apps, i); for i = 1 to sizeof (adrAppsTable^) { local (adrAppInfo = @adrAppsTable^ [i].appInfo); if defined (adrAppInfo^) { adrAppInfo^.path = ""}}}; bundle { // set up Frontier.tools.thread Frontier.tools.thread.ct = 0; Frontier.tools.thread.enabled = true}; bundle { // set up workspace new (tableType, @root.workspace); new (outlineType, @workspace.notepad)}; bundle { // miscellaneous new (tableType, @root.scratchpad); new (tableType, @system.deskscripts); new (tableType, @user.databases); new (tableType, @user.protocols); }};Çnew (tableType, @websites.["#data"]) bundle { // set up user.menus if flFirstRootRun { new (tableType, @user.menus)}; Çuser.menus.bookmarkMenu = userland.virginBookmarkMenu if not (defined (user.menus.customMenu)) { user.menus.customMenu = Frontier.data.virginCustomMenu}}; if flFirstRootRun { // open mainResponder.root and prefs.root bundle { // open mainResponder.root, hidden and add to user.databases local (appFolder = Frontier.getSubFolder ("apps")); if not defined ( [appFolder + "mainResponder.root"] ) { Frontier.installApp ("mainResponder.root", false)}}; bundle { // open prefs.root, hidden and add to user.databases local (f = Frontier.getSubFolder ("www") + "prefs.root"); if not (defined ([f])) { fileMenu.open (f, true);}; //open hidden ÇAdd an entry to the user.databases table. local (adrTable = @user.databases.["prefs.root"]); new (tableType, adrTable); adrTable^.f = file.getPathChar () + (f - Frontier.pathString); adrTable^.openOnStartup = true; adrTable^.runStartupScript = false; adrTable^.supportsSubscribe = false}}; Çbundle //initialize responders Çuser.webserver.responders.websiteFramework.data.docTree.samples = @websites.samples Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.allSites) Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.contents) Ç Çif defined (user.webserver.responders.manilaEdit) Çdelete (@user.webserver.responders.manilaEdit) ÇfileMenu.save () bundle { // miscellaneous variable initializations and checks, phase 2 of 2 system.menus.data.currentsuite = ""; system.menus.data.currentMenuType = nil; system.menus.data.currentmenu = 0; bundle { // check for presence of Psapi.dll if sys.os () == "WinNT" { if not (sys.appIsRunning (file.fileFromPath (Frontier.getProgramPath ()))) { // 11/27/04; 12:14:40 PM by TAC - would it be possible for Frontier to install this on its own? dialog.alert ("You need to run the Frontier Psapi Installer for certain Frontier verbs to work properly.")}}}}; bundle { //open the about window if the pref says we should Çadded 12/16/98; 6:47:28 PM by DW if not defined (user.prefs.openAboutWindow) { user.prefs.openAboutWindow = true}; if user.prefs.openAboutWindow { window.about ()}}; bundle { //initialize the log, next bit of code could add a log item Çadded 12/16/98; 6:52:40 PM by DW if defined (log.startup) { log.startup ()}}; bundle { //run the external startup script local (fname = "frontierStartupCommands.txt"); local (f = file.folderFromPath (Frontier.getProgramPath ()) + fname); if file.exists (f) { try { evaluate (string (file.readWholeFile (f)))} else { log.add ("Error running " + fname + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}; bundle { // tcp based services webserver.init (); // needs to load first betty.init (); // needs to load second soap.init ()}; bundle { // people based services people.init (); // needs to load first custody.init (); webEditServer.init ()}; bundle { //open all the databases that have openOnStartup true Çadded 12/16/98; 6:23:16 PM by DW if defined (user.databases) { if flOpenDatabases { local (i, flmsg = false); for i = 1 to sizeof (user.databases) { if typeOf (user.databases[i]) == tableType { //06/08/01 JES: avert item #1 errors with user.databases [i] { local (flopened = false); try { if openOnStartup { msg (this + ": Opening " + file.fileFromPath (f)); flmsg = true; fileMenu.open (f, hidden:true); flopened = true}} else { log.add ("Startup error opening guest database " + nameof (user.databases [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}; if flopened { if defined (runStartupScript) { if runStartupScript { //PBS 10/7/99: check the value of runStartupScript: only run the script if the boolean is true local (adrscript = @[filespec (f)].["#startup"]); if defined (adrscript^) { try { adrscript^ ()} else { log.add ("Error running #startup script in guest database " + nameof (user.databases [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}}}}}}; if flmsg { msg ("")}}}}; try { //04/28/2001 JES: prevent startup from failing if Tool installation fails. Frontier.tools.startup ()}; scheduler.init (); html.init (); bundle { // webBrowser webBrowser.init (); if system.environment.isMac { try {new (tableType, @user.odbEditors.data.openFiles)}}; //Empty out the list of externally-edited files. if system.environment.isWindows { user.webBrowser.winDefaultBrowserApp = file.findApplication ("htm")}}; bundle { // first root run, phase 2 of 3 if flFirstRootRun { bundle { // set up websites table and related with websites.["#ftpSite"] { folder = file.folderFromPath (Frontier.getProgramPath ()) + "Websites" + file.getPathChar (); Çfile.sureFolder (folder) url = file.fileToURL (folder); isLocal = true}; user.html.sites.default = websites.["#ftpSite"]}; bundle { // personalize this copy of Frontier, configure network settings, and complete the installation local (flWebBasedInstall = true); if flWebBasedInstall { Ç11/29/04; 11:17:45 AM by TAC - the following seems like it should be done as part of mainRepsonder startup, init. IIRC, members.root is a feature of mainResponder bundle { //create the Admin membership group if needed local (adrRoot = @[system.temp.mainResponder.membersRootFile]); local (adrGroup = @adrRoot^.admin); if not defined (adrGroup^) { new (tableType, adrGroup)}; if not defined (adrGroup^.callbacks) { new (tableType, @adrGroup^.callbacks)}; if not defined (adrGroup^.cookieDomain) { adrGroup^.cookieDomain = ""}; if not defined (adrGroup^.cookieExpires) { adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; if not defined (adrGroup^.cookieName) { adrGroup^.cookieName = "Admin"}; if not defined (adrGroup^.mailReturnAddress) { adrGroup^.mailReturnAddress = user.prefs.mailAddress}; if not defined (adrGroup^.mailSubject) { adrGroup^.mailSubject = "Admin"}; if not defined (adrGroup^.mailTemplate) { wp.newTextObject ("", @adrGroup^.mailTemplate)}; if not defined (adrGroup^.openToPublic) { adrGroup^.openToPublic = false}; if not defined (adrGroup^.users) { new (tableType, @adrGroup^.users)}}; bundle { // prep for web based install via mainResponder admin website local (portString = ""); if user.inetd.config.http2.port != 80 { portString = ":" + user.inetd.config.http2.port}; if not defined (system.temp.Frontier.setupFrontier) { new (tableType, @system.temp.Frontier.setupFrontier)}; system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = true; local (setupUrl = "http://127.0.0.1" + portString + "/setupFrontier"); if not defined (system.temp.installer) { new (tableType, @system.temp.installer)}; system.temp.installer.urlToOpen = setupUrl}} else { on infoDialog () { //prompt the user for name, org and initials on kernelCall (adrName, adrInitials, adrOrg, adrEmail) { kernel (dialog.getUserInfo)}; local (name, initials, organization, email); case sys.os () { "Win95"; "WinNT" { if not (kernelCall (@name, @initials, @organization, @email)) { return (false)}; if initials == "" { dialog.alert ("You must specify your initials."); infoDialog ()}; user.prefs.name = name; user.prefs.initials = initials; user.prefs.organization = organization; user.prefs.mailAddress = email}; "MacOS" { bundle { //initialize user.prefs.name etc using info from Internet Config try { name = ic.geticpreference (ic.eventinfo.realName)}; try { organization = ic.geticpreference (ic.eventinfo.organization)}; try { email = ic.geticpreferece (ic.eventinfo.emailAddress)}; user.prefs.name = name; user.prefs.organization = organization; if name != "" { local (i); user.prefs.initials = name [1]; for i = 3 to sizeof (name) { if name [i] == ' ' { user.prefs.initials = user.prefs.initials + name [i+1]}}}}; card.run (@system.cards.userInfoDialog)}}; return (true)}; infoDialog ()}}; //AR 09/27/04 : personalize install ÇrootUpdates.getCurrent ("Frontier") // 11/29/04; 6:57:54 PM by TAC - if we get a root update then we'll need to use rootUpdates.update bundle { // about window local (w); window.about (); w = window.frontMost (); window.zoom (w); menus.scripts.styleCommand ("medium"); window.setPosition (w, 25, 75); };Çwindow.close (s) bundle { // license edit (@system.startup.license); // 12/4/04; 9:26:35 PM by TAC - i rather do this near the beginning of phase 1 firstRootRun but had a problem with this window and setting up the quick script window wp.setSelect (0, 0)}}}; system.callbacks.startup (); //call user's startup scripts bundle { // build menu bar system.menus.buildMenuBar (); system.menus.buildSuitesSubmenu ()}; //5.0 Frontier.enableAgents (flEnableAgents); if flEnableHttpServer { //6.0, daemons don't start up until all the startup code has run new (tableType, @user.inetd.listens); inetd.start ()}; //start up all daemons with startup set true if flFirstRootRun { // open a url and set first root run to false if defined (system.temp.installer.urlToOpen) { Çwindow.update ("About Frontier") webBrowser.openUrl (system.temp.installer.urlToOpen); webBrowser.bringToFront ()}; user.prefs.firstRootRun = false}; system.temp.Frontier.startingUp = false; //signal to all who care, let the hits begin! msg (""); fileMenu.save (); Ç Çbundle //license agreement Çlocal (editLicense = false) Çif sys.os () == "MacOS" Çon itemhit (itemnumber) Çcase (itemnumber) Ç1 Çyes ÇeditLicense = true Çreturn (false) Çstop processing the dialog Ç2 Çno Çreturn (false) Çstop processing the dialog Çreturn (true) Çkeep processing the dialog Çdialog.run (517, 1, @itemhit) Çelse Çif dialog.yesNo ("Frontier is licensed software. Do you want to read the license agreement now?") ÇeditLicense = true Çif editLicense Çbundle //get root update ÇproxyInit () Çif user.prefs.serialNumber != "" and not (string.lower (user.prefs.serialNumber) contains "trial") ÇrootUpdates.init () \ No newline at end of file |
|
From: creedon <icr...@us...> - 2005-11-06 01:19:46
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/html/data/glossary In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26503 Removed Files: osxBadge Log Message: removed, website gone --- osxBadge DELETED --- |
|
From: creedon <icr...@us...> - 2005-11-01 19:21:45
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4974 Modified Files: saveAs Log Message: fix for items created with New menu not being saved when using File menu Save As menu item in Frontier Index: saveAs =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes/commands/saveAs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** saveAs 1 Oct 2005 17:26:02 -0000 1.2 --- saveAs 1 Nov 2005 19:21:37 -0000 1.3 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.commands.saveAs ! on saveAs (adrItem=nil) { ÇChanges Ç9/21/05; 11:34:38 AM by TAC Çchanged to actually do a save as, as opposed to a save Çonly do export for non Frontier envrionments ÇHandle the Save As command. if adrItem == nil { //default to frontmost window adrItem = window.frontmost ()}; on saveDatabaseAs () { local (f = file.fileFromPath (window.getFile (table.getRootAddress (adrItem)))); if file.putFileDialog ("", @f) { fileMenu.saveCopy (f)}}; if not defined (adrItem^) { // save root adrItem = @root; saveDatabaseAs (); return (true)}; on runCallbacks (adrCallback) { //call callbacks if defined (adrCallback^) { local (flConsumed = false); local (adrScript); for adrScript in adrCallback { try { //11/30/00 JES while typeOf (adrScript^) == addressType { //follow addresses adrScript = adrScript^}; flConsumed = adrScript^ (adrItem, flClosing)}; if flConsumed { return (true)}}}; return (false)}; if runCallbacks (@user.tools.commandCallbacks.saveAs) { return (true)}; if system.environment.isRadio { if defined (user.pike.commandCallbacks) { if runCallbacks (@user.pike.commandCallbacks.saveAs) { return (true)}}}; bundle { //look for a windowType that handles this command local (type, adrType); if window.attributes.getOne ("type", @type, adrItem) { if Frontier.tools.windowTypes.findWindowType (type, @adrType, adrItem) { if defined (adrType^.save) { if adrType^.saveAs (adrItem) { window.attributes.setOne ("lastSaved", timeModified (adrItem), adrItem); saveDatabase (); return (true)} else { return (false)}}}}}; bundle { //if this is an outline window, save as an opml file local (adrType); if Frontier.tools.windowTypes.findWindowType ("outlinerFile", @adrType) { if adrType^.saveAs (adrItem) { return (true)}}}; if system.environment.isRadio { export.commands.export ()}; // Do we want to call the odb-export code here? saveDatabaseAs (); return (true)}; Çbundle // testing ÇsaveAs () \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.commands.saveAs ! on saveAs (adrItem=nil) { ÇChanges Ç11/1/05; 9:30:04 AM by TAC Çfix for items created with New menu not being saved when using File menu Save As menu item in Frontier Ç9/21/05; 11:34:38 AM by TAC Çchanged to actually do a save as, as opposed to a save Çonly do export for non Frontier envrionments ÇHandle the Save As command. if adrItem == nil { //default to frontmost window adrItem = window.frontmost ()}; on saveDatabaseAs () { local (f = file.fileFromPath (window.getFile (table.getRootAddress (adrItem)))); if file.putFileDialog ("", @f) { fileMenu.saveCopy (f)}}; if not defined (adrItem^) { // save root adrItem = @root; saveDatabaseAs (); return (true)}; on runCallbacks (adrCallback) { //call callbacks if defined (adrCallback^) { local (flConsumed = false); local (adrScript); for adrScript in adrCallback { try { //11/30/00 JES while typeOf (adrScript^) == addressType { //follow addresses adrScript = adrScript^}; flConsumed = adrScript^ (adrItem, flClosing)}; if flConsumed { return (true)}}}; return (false)}; if runCallbacks (@user.tools.commandCallbacks.saveAs) { return (true)}; if system.environment.isRadio { if defined (user.pike.commandCallbacks) { if runCallbacks (@user.pike.commandCallbacks.saveAs) { return (true)}}}; bundle { //look for a windowType that handles this command local (type, adrType); if window.attributes.getOne ("type", @type, adrItem) { if Frontier.tools.windowTypes.findWindowType (type, @adrType, adrItem) { if defined (adrType^.save) { if adrType^.saveAs (adrItem) { window.attributes.setOne ("lastSaved", timeModified (adrItem), adrItem); saveDatabase (); return (true)} else { return (false)}}}}}; if system.environment.isRadio { bundle { //if this is an outline window, save as an opml file local (adrType); if Frontier.tools.windowTypes.findWindowType ("outlinerFile", @adrType) { if adrType^.saveAs (adrItem) { return (true)}}}; export.commands.export ()}; // Do we want to call the odb-export code here? if not (system.environment.isRadio) { // save windows created by the new menu or opened from the file system local (f = window.getFile (adrItem)); if f == "" or file.type (f) != 'TABL' { return (fileMenu.saveAs ())}}; saveDatabaseAs (); return (true)}; Çbundle // testing ÇsaveAs () \ No newline at end of file |
|
From: creedon <icr...@us...> - 2005-11-01 19:18:20
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3772 Modified Files: save Log Message: fix for items created with New menu not being saved when using File menu Save menu item Index: save =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes/commands/save,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** save 13 Jun 2005 22:23:44 -0000 1.2 --- save 1 Nov 2005 19:18:09 -0000 1.3 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.commands.save ! on save (adrItem=nil, flClosing=false) { ÇHandle the Save command. ÇChanges: Ç02/05/00; 5:29:12 PM by PBS ÇBuild the table of information about this window, so we can preserve size, position, scroll state, and expansion state. Ç03/23/00; 12:15:17 PM by PBS ÇUse the About Window for feedback when saving. Ç03/24/00; 11:14:47 AM by PBS ÇDon't update the last saved date after a failed save. Display a friendly error message explaining that there was a communication error -- display the title of the object and the name of the server. Ç03/24/00; 6:41:08 PM by PBS ÇConvert cascadingStyleSheet to css -- because manila.css is the name of the handler. This fixes saving CSS items back to the server. ÇFri, Jul 7, 2000 at 11:00:09 PM by AR ÇCall any scripts in user.pike.commandCallbacks.save ÇIf one of the scripts returns true, we're done Ç07/23/00; 7:59:16 PM by PBS ÇIf it's a local outline document, save it to disk at the right location. Ç08/16/00; 10:38:06 PM by JES ÇAlways bring the last frontmost window to the front after saving. ÇMonday, August 21, 2000 at 5:48:56 AM by DW ÇProvide feedback when saving local files. Ç08/22/00; 9:59:29 PM by PBS ÇWhen saving a message, don't promote it to a story if storyInfo.flAddToStoriesList exists and is false. This preserves backwards compatibility, but it also provides a way for people to create and reply to dg messages without making them stories. Ç08/23/00; 3:14:32 AM by PBS ÇSupport custom serialization routines for advanced items. This allows the plain XML display to be over-ridden. ÇSat, Aug 26, 2000 at 6:13:44 PM by JES ÇSave weblog pages by rendering with the website framework, according to their #ftpSite table settings. Ç09/15/00; 1:55:51 PM by PBS ÇIf the outline is raw XML, don't try to save it as an outlineDocument. Ç09/16/00; 5:22:22 PM by PBS Ç.opml is the default extension when saving new files. Ç09/16/00; 3:16:02 PM by PBS ÇSave file system objects -- classic text files -- okay. Ç09/21/00; 5:35:57 PM by PBS ÇWhen saving an OPML file, save with Radio UserLand's file creator code and OPML file type. Ç09/22/00; 5:00:21 PM by PBS ÇBefore saving to a Manila server, check the offline status. Ç10/03/00; 6:41:58 PM by PBS ÇCallbacks can be addresses. Ç10/07/00; 1:37:06 PM by PBS ÇIf there's an error saving, report the actual error to the user. Ç11/03/00; 1:13:17 AM by JES ÇHandle saving the message as opml if the server is compatible. Ç11/20/00; 3:39:43 PM by JES ÇCall the user callbacks when saving local outlines or rendering wsf pages. Ç11/20/00; 10:19:36 PM by JES ÇAllow callbacks to consume the save action for weblog pages and local outlines. Ç11/21/00; 1:22:36 AM by PBS ÇUse generic template save routine when the template doesn't have a dedicated handler. Ç11/29/00; 10:34:08 PM by JES ÇDereference callback addresses in a try block in case a tool's odb is not opened Ç12/20/00; 1:19:14 AM by JES ÇBug fix: View in Browser works for new stories and new messages. Ç12/21/00; 11:07:10 AM by PBS ÇBring the window being saved back to front only if the About window is frontmost. Fixes bug reported on Scripting News: http://scriptingnews.userland.com/backissues/2000/12/21 Ç12/26/00; 3:04:22 PM by PBS ÇWhen doing a save as plain text, allow the user to decide the extension, don't force an .xml or whatever extension. If no extension is provided, then use .txt. Ç12/31/00; 12:33:46 AM by JES ÇOn Macs, convert opml text to latin text before saving local outlines to disk. Ç01/24/01; 1:46:18 PM by JES ÇIf an opml file contained any xml headers like xml-stylesheet declarations, include them when saving the file. Ç02/08/01; 4:05:36 PM by JES ÇBug fix: If the About Window is frontmost, save Radio.root. Ç02/21/01; 2:16:27 AM by JES ÇSave the file using the recorded line-ending format. Preserve Mac type/creator codes. Ç3/16/01; 10:30:51 PM by PBS ÇIf the About window is already open, don't call window.about (), as that messes up window cascade order. if adrItem == nil { //default to frontmost window adrItem = window.frontmost ()}; on saveDatabase () { msg ("Saving database..."); if typeOf (adrItem) == addressType { fileMenu.saveMyRoot (adritem)} else { fileMenu.save ()}; msg ("")}; //clear the feedback message if not defined (adrItem^) { //save Radio.root adrItem = @root; saveDatabase (); return (true)}; on runCallbacks (adrCallback) { //call callbacks if defined (adrCallback^) { local (flConsumed = false); local (adrScript); for adrScript in adrCallback { try { //11/30/00 JES while typeOf (adrScript^) == addressType { //follow addresses adrScript = adrScript^}; flConsumed = adrScript^ (adrItem, flClosing)}; if flConsumed { return (true)}}}; return (false)}; if runCallbacks (@user.tools.commandCallbacks.save) { return (true)}; if system.environment.isRadio { if defined (user.pike.commandCallbacks) { if runCallbacks (@user.pike.commandCallbacks.save) { return (true)}}}; bundle { //look for a windowType that handles this command local (type, adrType); if window.attributes.getOne ("type", @type, adrItem) { if Frontier.tools.windowTypes.findWindowType (type, @adrType, adrItem) { if defined (adrType^.save) { if adrType^.save (adrItem, flClosing) { window.attributes.setOne ("lastSaved", timeModified (adrItem), adrItem); saveDatabase (); return (true)} else { return (false)}}}}}; saveDatabase (); return (true); Çbundle //old code Çif adrItem == nil //get the current selection Çtry {adrItem = table.getCursorAddress ()} Çlocal (frontWindow = window.frontMost ()) Çlocal (aboutWindowName = "About Radio UserLand") Ç Çon saveDatabase () // 8/26/00 JES: factored saving code Çmsg ("Saving database...") Çif typeOf (adrItem) == addressType ÇfileMenu.saveMyRoot (adritem) Çelse ÇfileMenu.save () Ç Çif window.frontMost () == aboutWindowName //PBS 12/21/00: bring editing window back to front only if the About window is frontmost Çtry {edit (frontWindow)} //JES 08/16/00 Ç Çmsg ("") //clear the feedback message Ç Çlocal (flConsumed = false) Çif adrItem != nil //11/20/00 JES: call the user callbacks Çif defined (user.pike.commandCallbacks.save) Çlocal (adrcallback) Çfor adrcallback in @user.pike.commandCallbacks.save Çtry //11/30/00 JES Çwhile typeOf (adrcallback^) == addressType //follow addresses Çadrcallback = adrcallback^ ÇflConsumed = adrcallback^ (adrItem, flClosing) Çif flConsumed Çbreak Ç Çif not defined (adrItem^) //save Radio.root ÇadrItem = @root ÇsaveDatabase () Çreturn (true) Ç Çif not flConsumed //JES 08/26/00: handle rendering website framework pages Çif defined (suites.playlist.weblog.utilities.windowIsWebPage) and suites.playlist.weblog.utilities.windowIsWebPage (adrItem) Çhtml.buildOnePage (adrItem) Ç ÇsaveDatabase () Ç Çif not flConsumed //PBS 07/23/00: handle local outline documents Çif pike.isLocalOutline (adrItem) //handle local outlines only in this block Çlocal (adrTable = parentOf (adrItem^)) Çlocal (f) Çon saveFile () Çmsg ("Saving \"" + f + "\".") //Monday, August 21, 2000 at 5:47:45 AM by DW ÇadrTable^.title = file.fileFromPath (f) Çwindow.setTitle (adrItem, adrTable^.title) Çlocal (xmlText) Çif defined (adrTable^.flOutlineDocument) //PBS 09/15/00: it may be raw XML Çif not (adrTable^.flOutlineDocument) ÇxmlText = string (adrItem^) //raw XML is just string of the outline Çbundle //add linefeeds if this is Windows Çif system.environment.isWindows ÇxmlText = string.replaceAll (xmlText, "\r", "\r\n") Çif defined (adrTable^.fileCreator) //02/21/2001 JES: save with recorded type/creator Çfile.writeWholeFile (f, xmlText, adrTable^.fileType, adrTable^.fileCreator) Çelse Çfile.writeWholeFile (f, xmlText, 'TEXT', 'Radu') Çif xmlText == nil //if it's an outlineDocument, xmlText is not yet set ÇxmlText = op.outlineToXml (adrItem) //convert to outlineDocument Çif defined (adrTable^.lineEnding) //02/21/2001 JES: save the file with the recorded line-endings ÇxmlText = string.replaceAll (xmlText, "\r", adrTable^.lineEnding) Çbundle //01/23/01 JES: support style sheet declarations Çif defined (adrTable^.xmlHeaders) Çlocal (ix = string.patternMatch ("?>", xmlText) + 3) ÇxmlText = string.insert (adrTable^.xmlHeaders, xmlText, ix) Çif system.environment.isMac //12/31/00 JES: convert Mac text to latin ÇxmlText = latinToMac.macToLatin (xmlText) Çif defined (adrTable^.fileCreator) //02/21/2001 JES: save with recorded type/creator Çfile.writeWholeFile (f, xmlText, adrTable^.fileType, adrTable^.fileCreator) Çelse Çfile.writeWholeFile (f, xmlText, 'OPML', 'Radu') //PBS 09/21/00: save with Mac codes ÇadrTable^.f = f ÇadrTable^.lastSaved = clock.now () Çmsg ("") Çreturn (true) Çif defined (adrTable^.f) Çf = adrTable^.f ÇsaveFile () Çelse Çif not (file.putFileDialog ("Save as:", @f)) Çreturn (false) Çlocal (defaultExtension = ".opml") Çlocal (flOutlineDocument = false) Çif defined (adrTable^.flOutlineDocument) //PBS 12/26/00: check extension only with OPML documents Çif adrTable^.flOutlineDocument ÇflOutlineDocument = true Ç Çif flOutlineDocument //ensure .opml extension Çif not (string.lower (f) endsWith defaultExtension) Çf = f + defaultExtension Çelse //PBS 12/26/00: if no extension, use .txt extension Çlocal (fname = file.fileFromPath (f)) Çif not (fname contains ".") Çf = f + ".txt" Ç ÇsaveFile () Ç Çreturn (true) Ç Çbundle //PBS 09/18/00: handle saving the home page of the server Çlocal (adrHomePage = @system.temp.playlist.serverHomePage) Çif defined (adrHomePage^) Çif adrItem == adrHomePage Çlocal (s = string (adrHomePage^)) //get the text Çlocal (f = user.playlist.prefs.wwwFolder + "index.html") Çfile.writeWholeFile (f, s, 'TEXT', user.html.prefs.textFileCreator, clock.now ()) Çreturn (true) Ç Çlocal (flAboutWindowOpen = window.isOpen (aboutWindowName)) Ç Çon savingError (displayTitle) ÇHandle errors in saving the document. Display a message and clean up. ÇfileMenu.save () Çmsg ("") ÇPBS 04/03/00: save the actual tryError Çif not defined (temp.pike) Çnew (tableType, @temp.pike) Çwp.newTextObject (tryError, @temp.pike.lastSaveError) Çif not flAboutWindowOpen //close the About Window if it wasn't open before doing a save Çwindow.close (aboutWindowName) Çlocal (hostName = pike.getServerHostName (adrItem)) ÇscriptError ("Can't save " + displayTitle + " because of an error communicating with the server, " + hostName + ".") ÇscriptError ("Can't save " + displayTitle + " because " + tryError + ".") Ç Çif adrItem!= nil Çbundle //PBS 03/23/00: display feedback message Çif not flAboutWindowOpen //PBS 03/16/01: this call messes up window cascade order if the About window was already open Çwindow.about () Ç Çif not flConsumed Çlocal (windowType = pike.getWindowType (adrItem)) Çif windowType != "" Ç Çif not (playlist.tcpOkay ()) //PBS 09/22/00: check offline status Çreturn (false) Ç Çlocal (adrTable = parentOf (adrItem^)) Ç Çlocal (bodyType = "text/x-outline-tabbed") Ç Çlocal (windowInfoTable = pike.buildWindowInfoTable (adrItem)) //PBS 02/05/00: get the window info table Ç Çlocal (flServerAcceptsOpml = false) Çif defined (adrTable^.siteInfo.flAcceptsOpml) //11/03/00 JES ÇflServerAcceptsOpml = adrTable^.siteInfo.flAcceptsOpml Çcase windowType Ç"advancedItems" Çlocal (itemTypeName = nameOf (adrTable^)) Çmsg ("Saving " + itemTypeName + "...") Çlocal (handlerName = pike.advancedItemToHandlerName (itemTypeName)) Çtry Çlocal (s = string (adrItem^)) Çif defined (adrTable^.itemInfo.adrSerializeRoutine) //PBS 08/23/00: call serialization routine if there is one Çif defined (adrTable^.itemInfo.adrSerializeRoutine^) Çs = adrTable^.itemInfo.adrSerializeRoutine^ (adrTable) Çif defined (manila.[handlerName].set) Çmanila.[handlerName].set (@adrTable^.siteinfo, s, windowInfoTable) Çelse //PBS 11/20/00: use generic save routine Çmanila.advancedPref.set (@adrTable^.siteInfo, itemTypeName, s, windowInfoTable) Çelse ÇsavingError ("the " + itemTypeName) ÇadrTable^.lastSaved = clock.now () Ç"savedStories" Çif flServerAcceptsOpml ÇbodyType = "text/x-opml" Çlocal (subject = adrTable^.storyinfo.subject) Çmsg ("Saving \"" + subject + "\"...") Çlocal (adrStory = @adrTable^.storyinfo) Çtry Çif flServerAcceptsOpml //11/03/00 JES Çlocal (opmlText = op.outlineToXml (adrItem, ownerEmail:adrTable^.siteInfo.username)) Çmanila.message.set (@adrTable^.siteinfo, adrStory^.msgnum, adrStory^.subject, opmlText, bodyType, windowInfoTable) //PBS 02/05/00: added windowInfoTable parameter Çelse Çmanila.message.set (@adrTable^.siteinfo, adrStory^.msgnum, adrStory^.subject, string (adrItem^), bodyType, windowInfoTable) //PBS 02/05/00: added windowInfoTable parameter Çelse Çtemp.errorText = tryError ÇsavingError ("\"" + subject + "\"") ÇadrTable^.lastSaved = clock.now () Ç"newStories" Çif flServerAcceptsOpml ÇbodyType = "text/x-opml" Çlocal (subject = adrTable^.storyinfo.subject) Çmsg ("Saving \"" + subject + "\"...") Ç Çlocal (resulttable) Çtry Çlocal (inResponseTo = 0) Çif defined (adrTable^.storyInfo.inResponseTo) ÇinResponseTo = adrTable^.storyInfo.inResponseTo Çif flServerAcceptsOpml //11/03/00 JES Çlocal (opmlText = op.outlineToXml (adrItem, ownerEmail:adrTable^.siteInfo.username)) Çresulttable = manila.message.create (@adrTable^.siteinfo, subject, opmlText, bodyType, inResponseTo, windowInfoTable) Çelse Çresulttable = manila.message.create (@adrTable^.siteinfo, subject, string (adrItem^), bodyType, inResponseTo, windowInfoTable) Çelse Çtemp.errorText = tryError ÇsavingError ("\"" + subject + "\"") Ç Çif not flClosing //copy to savedStories Çlocal (adrStoryTable = pike.getStoryTableAddress (@adrTable^.siteinfo, resulttable.msgnum)) ÇadrStoryTable^.siteinfo = adrTable^.siteinfo ÇadrStoryTable^.storyinfo = resulttable Ç Çtable.move (adrItem, adrStoryTable) Çpike.setWindowTitle (adrStoryTable) Ç ÇadrTable^.storyinfo.url = adrStoryTable^.storyinfo.url //12/20/00 JES: make view in browser work for new stories Ç ÇadrStoryTable^.lastSaved = clock.now () Ç Çlocal (flAddToStoriesList = true) //PBS 08/22/00: if flAddToStoriesList exists and is false, don't add to stories. This way we can have messages that aren't stories. Çif defined (adrTable^.storyInfo.flAddToStoriesList) Çif not (adrTable^.storyInfo.flAddToStoriesList) ÇflAddToStoriesList = false Çif flAddToStoriesList Çmanila.message.addToStoriesList (@adrTable^.siteinfo, resulttable.msgnum) Ç Çif window.isOpen (adrItem) Çedit (adrItem) //PBS 03/24/00: bring it back to the front, in case the About Window came to the front Ç ÇsaveDatabase () Çbundle // factored code Çmsg ("Saving database...") Çif typeOf (adrItem) == addressType ÇfileMenu.saveMyRoot (adritem) Çelse ÇfileMenu.save () Ç Çtry {edit (frontWindow)} //JES 08/16/00 Ç Çmsg ("") //clear the feedback message Çif not flAboutWindowOpen //close the About Window if it wasn't open before doing a save Çwindow.close (aboutWindowName) Ç Çreturn (true)}; Çbundle // debugging Çsave (window.frontMost ()) \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.commands.save ! on save (adrItem = nil, flClosing = false) { ÇChanges Ç10/25/05; 7:02:08 PM by TAC Çfix for items created with New menu not being saved when using File menu Save menu item Ç2001 Ç3/16/01; 10:30:51 PM by PBS ÇIf the About window is already open, don't call window.about (), as that messes up window cascade order. Ç02/21/01; 2:16:27 AM by JES ÇSave the file using the recorded line-ending format. Preserve Mac type/creator codes. Ç02/08/01; 4:05:36 PM by JES ÇBug fix: If the About Window is frontmost, save Radio.root. Ç01/24/01; 1:46:18 PM by JES ÇIf an opml file contained any xml headers like xml-stylesheet declarations, include them when saving the file. Ç2000 Ç12/31/00; 12:33:46 AM by JES ÇOn Macs, convert opml text to latin text before saving local outlines to disk. Ç12/26/00; 3:04:22 PM by PBS ÇWhen doing a save as plain text, allow the user to decide the extension, don't force an .xml or whatever extension. If no extension is provided, then use .txt. Ç12/21/00; 11:07:10 AM by PBS ÇBring the window being saved back to front only if the About window is frontmost. Fixes bug reported on Scripting News: http://scriptingnews.userland.com/backissues/2000/12/21 Ç12/20/00; 1:19:14 AM by JES ÇBug fix: View in Browser works for new stories and new messages. Ç11/29/00; 10:34:08 PM by JES ÇDereference callback addresses in a try block in case a tool's odb is not opened Ç11/21/00; 1:22:36 AM by PBS ÇUse generic template save routine when the template doesn't have a dedicated handler. Ç11/20/00; 10:19:36 PM by JES ÇAllow callbacks to consume the save action for weblog pages and local outlines. Ç11/20/00; 3:39:43 PM by JES ÇCall the user callbacks when saving local outlines or rendering wsf pages. Ç11/03/00; 1:13:17 AM by JES ÇHandle saving the message as opml if the server is compatible. Ç10/07/00; 1:37:06 PM by PBS ÇIf there's an error saving, report the actual error to the user. Ç10/03/00; 6:41:58 PM by PBS ÇCallbacks can be addresses. Ç09/22/00; 5:00:21 PM by PBS ÇBefore saving to a Manila server, check the offline status. Ç09/21/00; 5:35:57 PM by PBS ÇWhen saving an OPML file, save with Radio UserLand's file creator code and OPML file type. Ç09/16/00; 3:16:02 PM by PBS ÇSave file system objects -- classic text files -- okay. Ç09/16/00; 5:22:22 PM by PBS Ç.opml is the default extension when saving new files. Ç09/15/00; 1:55:51 PM by PBS ÇIf the outline is raw XML, don't try to save it as an outlineDocument. ÇSat, Aug 26, 2000 at 6:13:44 PM by JES ÇSave weblog pages by rendering with the website framework, according to their #ftpSite table settings. Ç08/23/00; 3:14:32 AM by PBS ÇSupport custom serialization routines for advanced items. This allows the plain XML display to be over-ridden. Ç08/22/00; 9:59:29 PM by PBS ÇWhen saving a message, don't promote it to a story if storyInfo.flAddToStoriesList exists and is false. This preserves backwards compatibility, but it also provides a way for people to create and reply to dg messages without making them stories. ÇMonday, August 21, 2000 at 5:48:56 AM by DW ÇProvide feedback when saving local files. Ç08/16/00; 10:38:06 PM by JES ÇAlways bring the last frontmost window to the front after saving. Ç07/23/00; 7:59:16 PM by PBS ÇIf it's a local outline document, save it to disk at the right location. ÇFri, Jul 7, 2000 at 11:00:09 PM by AR ÇCall any scripts in user.pike.commandCallbacks.save ÇIf one of the scripts returns true, we're done Ç03/24/00; 6:41:08 PM by PBS ÇConvert cascadingStyleSheet to css -- because manila.css is the name of the handler. This fixes saving CSS items back to the server. Ç03/24/00; 11:14:47 AM by PBS ÇDon't update the last saved date after a failed save. Display a friendly error message explaining that there was a communication error -- display the title of the object and the name of the server. Ç03/23/00; 12:15:17 PM by PBS ÇUse the About Window for feedback when saving. Ç02/05/00; 5:29:12 PM by PBS ÇBuild the table of information about this window, so we can preserve size, position, scroll state, and expansion state. ÇHandle the Save command. if adrItem == nil { //default to frontmost window adrItem = window.frontmost ()}; on saveDatabase () { msg ("Saving database..."); if typeOf (adrItem) == addressType { fileMenu.saveMyRoot (adritem)} else { fileMenu.save ()}; msg ("")}; //clear the feedback message if not defined (adrItem^) { //save Radio.root adrItem = @root; saveDatabase (); return (true)}; on runCallbacks (adrCallback) { //call callbacks if defined (adrCallback^) { local (flConsumed = false); local (adrScript); for adrScript in adrCallback { try { //11/30/00 JES while typeOf (adrScript^) == addressType { //follow addresses adrScript = adrScript^}; flConsumed = adrScript^ (adrItem, flClosing)}; if flConsumed { return (true)}}}; return (false)}; if runCallbacks (@user.tools.commandCallbacks.save) { return (true)}; if system.environment.isRadio { if defined (user.pike.commandCallbacks) { if runCallbacks (@user.pike.commandCallbacks.save) { return (true)}}}; bundle { //look for a windowType that handles this command local (type, adrType); if window.attributes.getOne ("type", @type, adrItem) { if Frontier.tools.windowTypes.findWindowType (type, @adrType, adrItem) { if defined (adrType^.save) { if adrType^.save (adrItem, flClosing) { window.attributes.setOne ("lastSaved", timeModified (adrItem), adrItem); saveDatabase (); return (true)} else { return (false)}}}}}; if not (system.environment.isRadio) { // save windows created by the new menu or opened from the file system local (f = window.getFile (adrItem)); if f == "" or file.type (f) != 'TABL' { if fileMenu.save (adrItem) { return (true)}}}; saveDatabase (); return (true); Çbundle //old code Çif adrItem == nil //get the current selection Çtry {adrItem = table.getCursorAddress ()} Çlocal (frontWindow = window.frontMost ()) Çlocal (aboutWindowName = "About Radio UserLand") Ç Çon saveDatabase () // 8/26/00 JES: factored saving code Çmsg ("Saving database...") Çif typeOf (adrItem) == addressType ÇfileMenu.saveMyRoot (adritem) Çelse ÇfileMenu.save () Ç Çif window.frontMost () == aboutWindowName //PBS 12/21/00: bring editing window back to front only if the About window is frontmost Çtry {edit (frontWindow)} //JES 08/16/00 Ç Çmsg ("") //clear the feedback message Ç Çlocal (flConsumed = false) Çif adrItem != nil //11/20/00 JES: call the user callbacks Çif defined (user.pike.commandCallbacks.save) Çlocal (adrcallback) Çfor adrcallback in @user.pike.commandCallbacks.save Çtry //11/30/00 JES Çwhile typeOf (adrcallback^) == addressType //follow addresses Çadrcallback = adrcallback^ ÇflConsumed = adrcallback^ (adrItem, flClosing) Çif flConsumed Çbreak Ç Çif not defined (adrItem^) //save Radio.root ÇadrItem = @root ÇsaveDatabase () Çreturn (true) Ç Çif not flConsumed //JES 08/26/00: handle rendering website framework pages Çif defined (suites.playlist.weblog.utilities.windowIsWebPage) and suites.playlist.weblog.utilities.windowIsWebPage (adrItem) Çhtml.buildOnePage (adrItem) Ç ÇsaveDatabase () Ç Çif not flConsumed //PBS 07/23/00: handle local outline documents Çif pike.isLocalOutline (adrItem) //handle local outlines only in this block Çlocal (adrTable = parentOf (adrItem^)) Çlocal (f) Çon saveFile () Çmsg ("Saving \"" + f + "\".") //Monday, August 21, 2000 at 5:47:45 AM by DW ÇadrTable^.title = file.fileFromPath (f) Çwindow.setTitle (adrItem, adrTable^.title) Çlocal (xmlText) Çif defined (adrTable^.flOutlineDocument) //PBS 09/15/00: it may be raw XML Çif not (adrTable^.flOutlineDocument) ÇxmlText = string (adrItem^) //raw XML is just string of the outline Çbundle //add linefeeds if this is Windows Çif system.environment.isWindows ÇxmlText = string.replaceAll (xmlText, "\r", "\r\n") Çif defined (adrTable^.fileCreator) //02/21/2001 JES: save with recorded type/creator Çfile.writeWholeFile (f, xmlText, adrTable^.fileType, adrTable^.fileCreator) Çelse Çfile.writeWholeFile (f, xmlText, 'TEXT', 'Radu') Çif xmlText == nil //if it's an outlineDocument, xmlText is not yet set ÇxmlText = op.outlineToXml (adrItem) //convert to outlineDocument Çif defined (adrTable^.lineEnding) //02/21/2001 JES: save the file with the recorded line-endings ÇxmlText = string.replaceAll (xmlText, "\r", adrTable^.lineEnding) Çbundle //01/23/01 JES: support style sheet declarations Çif defined (adrTable^.xmlHeaders) Çlocal (ix = string.patternMatch ("?>", xmlText) + 3) ÇxmlText = string.insert (adrTable^.xmlHeaders, xmlText, ix) Çif system.environment.isMac //12/31/00 JES: convert Mac text to latin ÇxmlText = latinToMac.macToLatin (xmlText) Çif defined (adrTable^.fileCreator) //02/21/2001 JES: save with recorded type/creator Çfile.writeWholeFile (f, xmlText, adrTable^.fileType, adrTable^.fileCreator) Çelse Çfile.writeWholeFile (f, xmlText, 'OPML', 'Radu') //PBS 09/21/00: save with Mac codes ÇadrTable^.f = f ÇadrTable^.lastSaved = clock.now () Çmsg ("") Çreturn (true) Çif defined (adrTable^.f) Çf = adrTable^.f ÇsaveFile () Çelse Çif not (file.putFileDialog ("Save as:", @f)) Çreturn (false) Çlocal (defaultExtension = ".opml") Çlocal (flOutlineDocument = false) Çif defined (adrTable^.flOutlineDocument) //PBS 12/26/00: check extension only with OPML documents Çif adrTable^.flOutlineDocument ÇflOutlineDocument = true Ç Çif flOutlineDocument //ensure .opml extension Çif not (string.lower (f) endsWith defaultExtension) Çf = f + defaultExtension Çelse //PBS 12/26/00: if no extension, use .txt extension Çlocal (fname = file.fileFromPath (f)) Çif not (fname contains ".") Çf = f + ".txt" Ç ÇsaveFile () Ç Çreturn (true) Ç Çbundle //PBS 09/18/00: handle saving the home page of the server Çlocal (adrHomePage = @system.temp.playlist.serverHomePage) Çif defined (adrHomePage^) Çif adrItem == adrHomePage Çlocal (s = string (adrHomePage^)) //get the text Çlocal (f = user.playlist.prefs.wwwFolder + "index.html") Çfile.writeWholeFile (f, s, 'TEXT', user.html.prefs.textFileCreator, clock.now ()) Çreturn (true) Ç Çlocal (flAboutWindowOpen = window.isOpen (aboutWindowName)) Ç Çon savingError (displayTitle) ÇHandle errors in saving the document. Display a message and clean up. ÇfileMenu.save () Çmsg ("") ÇPBS 04/03/00: save the actual tryError Çif not defined (temp.pike) Çnew (tableType, @temp.pike) Çwp.newTextObject (tryError, @temp.pike.lastSaveError) Çif not flAboutWindowOpen //close the About Window if it wasn't open before doing a save Çwindow.close (aboutWindowName) Çlocal (hostName = pike.getServerHostName (adrItem)) ÇscriptError ("Can't save " + displayTitle + " because of an error communicating with the server, " + hostName + ".") ÇscriptError ("Can't save " + displayTitle + " because " + tryError + ".") Ç Çif adrItem!= nil Çbundle //PBS 03/23/00: display feedback message Çif not flAboutWindowOpen //PBS 03/16/01: this call messes up window cascade order if the About window was already open Çwindow.about () Ç Çif not flConsumed Çlocal (windowType = pike.getWindowType (adrItem)) Çif windowType != "" Ç Çif not (playlist.tcpOkay ()) //PBS 09/22/00: check offline status Çreturn (false) Ç Çlocal (adrTable = parentOf (adrItem^)) Ç Çlocal (bodyType = "text/x-outline-tabbed") Ç Çlocal (windowInfoTable = pike.buildWindowInfoTable (adrItem)) //PBS 02/05/00: get the window info table Ç Çlocal (flServerAcceptsOpml = false) Çif defined (adrTable^.siteInfo.flAcceptsOpml) //11/03/00 JES ÇflServerAcceptsOpml = adrTable^.siteInfo.flAcceptsOpml Çcase windowType Ç"advancedItems" Çlocal (itemTypeName = nameOf (adrTable^)) Çmsg ("Saving " + itemTypeName + "...") Çlocal (handlerName = pike.advancedItemToHandlerName (itemTypeName)) Çtry Çlocal (s = string (adrItem^)) Çif defined (adrTable^.itemInfo.adrSerializeRoutine) //PBS 08/23/00: call serialization routine if there is one Çif defined (adrTable^.itemInfo.adrSerializeRoutine^) Çs = adrTable^.itemInfo.adrSerializeRoutine^ (adrTable) Çif defined (manila.[handlerName].set) Çmanila.[handlerName].set (@adrTable^.siteinfo, s, windowInfoTable) Çelse //PBS 11/20/00: use generic save routine Çmanila.advancedPref.set (@adrTable^.siteInfo, itemTypeName, s, windowInfoTable) Çelse ÇsavingError ("the " + itemTypeName) ÇadrTable^.lastSaved = clock.now () Ç"savedStories" Çif flServerAcceptsOpml ÇbodyType = "text/x-opml" Çlocal (subject = adrTable^.storyinfo.subject) Çmsg ("Saving \"" + subject + "\"...") Çlocal (adrStory = @adrTable^.storyinfo) Çtry Çif flServerAcceptsOpml //11/03/00 JES Çlocal (opmlText = op.outlineToXml (adrItem, ownerEmail:adrTable^.siteInfo.username)) Çmanila.message.set (@adrTable^.siteinfo, adrStory^.msgnum, adrStory^.subject, opmlText, bodyType, windowInfoTable) //PBS 02/05/00: added windowInfoTable parameter Çelse Çmanila.message.set (@adrTable^.siteinfo, adrStory^.msgnum, adrStory^.subject, string (adrItem^), bodyType, windowInfoTable) //PBS 02/05/00: added windowInfoTable parameter Çelse Çtemp.errorText = tryError ÇsavingError ("\"" + subject + "\"") ÇadrTable^.lastSaved = clock.now () Ç"newStories" Çif flServerAcceptsOpml ÇbodyType = "text/x-opml" Çlocal (subject = adrTable^.storyinfo.subject) Çmsg ("Saving \"" + subject + "\"...") Ç Çlocal (resulttable) Çtry Çlocal (inResponseTo = 0) Çif defined (adrTable^.storyInfo.inResponseTo) ÇinResponseTo = adrTable^.storyInfo.inResponseTo Çif flServerAcceptsOpml //11/03/00 JES Çlocal (opmlText = op.outlineToXml (adrItem, ownerEmail:adrTable^.siteInfo.username)) Çresulttable = manila.message.create (@adrTable^.siteinfo, subject, opmlText, bodyType, inResponseTo, windowInfoTable) Çelse Çresulttable = manila.message.create (@adrTable^.siteinfo, subject, string (adrItem^), bodyType, inResponseTo, windowInfoTable) Çelse Çtemp.errorText = tryError ÇsavingError ("\"" + subject + "\"") Ç Çif not flClosing //copy to savedStories Çlocal (adrStoryTable = pike.getStoryTableAddress (@adrTable^.siteinfo, resulttable.msgnum)) ÇadrStoryTable^.siteinfo = adrTable^.siteinfo ÇadrStoryTable^.storyinfo = resulttable Ç Çtable.move (adrItem, adrStoryTable) Çpike.setWindowTitle (adrStoryTable) Ç ÇadrTable^.storyinfo.url = adrStoryTable^.storyinfo.url //12/20/00 JES: make view in browser work for new stories Ç ÇadrStoryTable^.lastSaved = clock.now () Ç Çlocal (flAddToStoriesList = true) //PBS 08/22/00: if flAddToStoriesList exists and is false, don't add to stories. This way we can have messages that aren't stories. Çif defined (adrTable^.storyInfo.flAddToStoriesList) Çif not (adrTable^.storyInfo.flAddToStoriesList) ÇflAddToStoriesList = false Çif flAddToStoriesList Çmanila.message.addToStoriesList (@adrTable^.siteinfo, resulttable.msgnum) Ç Çif window.isOpen (adrItem) Çedit (adrItem) //PBS 03/24/00: bring it back to the front, in case the About Window came to the front Ç ÇsaveDatabase () Çbundle // factored code Çmsg ("Saving database...") Çif typeOf (adrItem) == addressType ÇfileMenu.saveMyRoot (adritem) Çelse ÇfileMenu.save () Ç Çtry {edit (frontWindow)} //JES 08/16/00 Ç Çmsg ("") //clear the feedback message Çif not flAboutWindowOpen //close the About Window if it wasn't open before doing a save Çwindow.close (aboutWindowName) Ç Çreturn (true)}; Çbundle // testing Çsave (window.frontMost ()) \ No newline at end of file |
|
From: creedon <icr...@us...> - 2005-11-01 19:16:06
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3208 Modified Files: runOpenRecentMenuScript Log Message: added check for missing files and way deal with them Index: runOpenRecentMenuScript =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes/runOpenRecentMenuScript,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** runOpenRecentMenuScript 1 Oct 2005 17:39:18 -0000 1.1 --- runOpenRecentMenuScript 1 Nov 2005 19:15:55 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.runOpenRecentMenuScript ! on runOpenRecentMenuScript (ix) { ÇChanges Ç9/24/05; 8:45:56 PM by TAC Çcreated local (count = sizeOf (user.prefs.openRecentMenu.items)); ix = number (ix); if ix > count { // clear menu table.emptyTable (@user.prefs.openRecentMenu.items)} else { ix = count + 1 - ix; // translate from position in menu to position in items table Frontier.tools.windowTypes.commands.open (user.prefs.openRecentMenu.items [ix])}; return (true)}; bundle { // testing runOpenRecentMenuScript ("1")} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.runOpenRecentMenuScript ! on runOpenRecentMenuScript (ix) { ÇChanges Ç11/1/05; 8:51:49 AM by TAC Çadded check for missing files and way deal with them Ç9/24/05; 8:45:56 PM by TAC Çcreated local (count = sizeOf (user.prefs.openRecentMenu.items)); ix = number (ix); if ix > count { // clear menu table.emptyTable (@user.prefs.openRecentMenu.items)} else { local (f); ix = count + 1 - ix; // translate from position in menu to position in items table f = user.prefs.openRecentMenu.items [ix]; if not (file.exists (f)) { local (s = file.fileFromPath (f)); case dialog.threeWay ("File \"" + s + "\" is missing.", "Find", "Clear", "Cancel") { 1 { if file.getFileDialog ("Find file \"" + s + "\"...", @f, 0) { user.prefs.openRecentMenu.items [ix] = f} else { return (false)}}; 2 { delete (user.prefs.openRecentMenu.items [ix]); return (false)}; 3 { return (false)}}}; Frontier.tools.windowTypes.commands.open (f)}; return (true)}; Çbundle // testing ÇrunOpenRecentMenuScript ("1") \ No newline at end of file |
|
From: creedon <icr...@us...> - 2005-11-01 19:12:16
|
Update of /cvsroot/frontierkernel/Frontier/Common/resources/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1879 Modified Files: WinLand.rc kernelverbs.rc Log Message: Fix for File menu Save As menu item problem and Frontier script based File menu items. See < http://sourceforge.net/tracker/index.php?func=detail&aid=1339237&group_id=120666&atid=687798 >. Index: kernelverbs.rc =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/resources/Win32/kernelverbs.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kernelverbs.rc 26 Sep 2005 18:21:02 -0000 1.1 --- kernelverbs.rc 1 Nov 2005 19:12:07 -0000 1.2 *************** *** 752,759 **** "closeall\0", "save\0", ! "savecopy\0", "revert\0", "print\0", ! "quit\0" END --- 752,760 ---- "closeall\0", "save\0", ! // "savecopy\0", /* 2005-11-01 creedon */ "revert\0", "print\0", ! "quit\0", ! "saveas\0" /* 2005-10-26 creedon */ END Index: WinLand.rc =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/resources/Win32/WinLand.rc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** WinLand.rc 1 Oct 2005 17:34:38 -0000 1.9 --- WinLand.rc 1 Nov 2005 19:12:07 -0000 1.10 *************** *** 243,247 **** MENUITEM "&Save\tCtrl+S", filemenu+saveitem MENUITEM "Save as Runnable...", filemenu+saverunnableitem ! MENUITEM "Save a &Copy...", filemenu+saveasitem MENUITEM "&Revert", filemenu+revertitem MENUITEM SEPARATOR --- 243,247 ---- MENUITEM "&Save\tCtrl+S", filemenu+saveitem MENUITEM "Save as Runnable...", filemenu+saverunnableitem ! MENUITEM "Save &As...", filemenu+saveasitem /* 2005-10-26 creedon - changed to Save As*/ MENUITEM "&Revert", filemenu+revertitem MENUITEM SEPARATOR |
|
From: creedon <icr...@us...> - 2005-11-01 19:12:06
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1835 Modified Files: shellmenu.c shellverbs.c Log Message: Fix for File menu Save As menu item problem and Frontier script based File menu items. See < http://sourceforge.net/tracker/index.php?func=detail&aid=1339237&group_id=120666&atid=687798 >. Index: shellmenu.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellmenu.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shellmenu.c 2 Oct 2005 18:19:29 -0000 1.6 --- shellmenu.c 1 Nov 2005 19:11:57 -0000 1.7 *************** *** 1021,1024 **** --- 1021,1026 ---- /* + 2005-10-26 creedon: the file menu item that provides save as functionality now reads Save As... for database or file-object save for Frontier + 2005-09-25 creedon: added open recent menu changed to support calling script for some file/edit menu commands on all targets *************** *** 1181,1190 **** shellsetmenuitemstring (hmenu, saveitem, savedatabaseitemstring); // "Save Database"); ! shellsetmenuitemstring (hmenu, saveasitem, saveacopyitemstring); // "Save a CopyÉ"); } else { shellsetmenuitemstring (hmenu, saveitem, saveitemstring); // "\x07" "Save"); ! shellsetmenuitemstring (hmenu, saveasitem, saveasitemstring); // "\x07" "Save AsÉ"); } --- 1183,1192 ---- shellsetmenuitemstring (hmenu, saveitem, savedatabaseitemstring); // "Save Database"); ! // shellsetmenuitemstring (hmenu, saveasitem, saveacopyitemstring); // "Save a CopyÉ"); } else { shellsetmenuitemstring (hmenu, saveitem, saveitemstring); // "\x07" "Save"); ! // shellsetmenuitemstring (hmenu, saveasitem, saveasitemstring); // "\x07" "Save AsÉ"); } *************** *** 1467,1471 **** /* ! 2005-09-25 creedon: changed so that all targets can call script for some file/edit menu commands added open recent menu --- 1469,1473 ---- /* ! 2005-09-25 creedon: changed so that all targets can call scripts for some file/edit menu commands added open recent menu *************** *** 2333,2337 **** /* ! 2005-10-01 creedon: when no files are listed in the menu, disable al menu items made more accessible to windows platform --- 2335,2339 ---- /* ! 2005-10-01 creedon: when no files are listed in the menu, disable all menu items made more accessible to windows platform Index: shellverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellverbs.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shellverbs.c 1 Oct 2005 17:22:48 -0000 1.5 --- shellverbs.c 1 Nov 2005 19:11:57 -0000 1.6 *************** *** 56,59 **** --- 56,60 ---- #include "cancoon.h" #include "resources.h" + #include "file.h" /* 2005-10-26 creedon */ #ifdef WIN95VERSION *************** *** 95,99 **** savefunc, ! savecopyfunc, revertfunc, --- 96,100 ---- savefunc, ! // savecopyfunc, /* 2005-11-01 creedon */ revertfunc, *************** *** 103,106 **** --- 104,109 ---- quitfunc, + saveasfunc, /* 2005-10-26 creedon */ + ctfilemenuverbs } tyfilemenutoken; *************** *** 1254,1257 **** --- 1257,1265 ---- switch (token) { /*these verbs assume that the frontmost window's globals are pushed*/ + + /* + 2005-10-26 creedon: disabled savecopyfunc case, saveasfunc can do it all + added saveasfunc case, it wasn't possible to do a save as for a file-object + */ case savefunc: { /*save the frontmost window*/ *************** *** 1284,1288 **** } ! case savecopyfunc: { tyfilespec fs; --- 1292,1296 ---- } ! /* case savecopyfunc: { tyfilespec fs; *************** *** 1297,1301 **** break; ! } case revertfunc: --- 1305,1309 ---- break; ! } */ case revertfunc: *************** *** 1321,1324 **** --- 1329,1360 ---- break; + case saveasfunc: { + tyfilespec fs; + short ctconsumed = 0; + short ctpositional = 0; + tyvaluerecord val; + + initvalue (&val, stringvaluetype); + + flnextparamislast = true; + + if (!getoptionalparamvalue (hparam1, &ctconsumed, &ctpositional, "\x04""path", &val)) + return (false); + + if (val.data.stringvalue) { + bigstring bs; + + texthandletostring (val.data.stringvalue, bs); + pathtofilespec (bs, &fs); + (*v).data.flvalue = shellsaveas (shellwindow, &fs, false); + } + else + (*v).data.flvalue = shellsaveas (shellwindow, nil, false); + + fl = true; + + break; + } + } /*switch -- funcs with front globals pushed*/ |