2007-09-06 21:36:39 +00:00
function Wiki ( invoker ) {
2007-07-16 20:22:38 +00:00
this . next _id = null ;
this . focused _editor = null ;
this . blank _editor _id = null ;
this . notebook = null ;
this . notebook _id = getElement ( "notebook_id" ) . value ;
2007-08-29 00:50:46 +00:00
this . parent _id = getElement ( "parent_id" ) . value ; // id of the notebook containing this one
2007-08-16 01:29:18 +00:00
this . startup _notes = new Array ( ) ; // map of startup notes: note id to bool
this . open _editors = new Array ( ) ; // map of open notes: note title to editor
2007-09-11 19:19:03 +00:00
this . all _notes _editor = null ; // editor for display of list of all notes
2007-09-10 20:04:46 +00:00
this . search _results _editor = null ; // editor for display of search results
2007-09-06 21:36:39 +00:00
this . invoker = invoker ;
2007-10-16 21:37:12 +00:00
this . rate _plan = evalJSON ( getElement ( "rate_plan" ) . value ) ;
2007-09-20 22:59:00 +00:00
this . storage _usage _high = false ;
2007-07-16 20:22:38 +00:00
2007-11-15 22:40:16 +00:00
var total _notes _count _node = getElement ( "total_notes_count" ) ;
if ( total _notes _count _node )
this . total _notes _count = parseInt ( scrapeText ( total _notes _count _node ) ) ;
else
this . total _notes _count = null ;
2007-10-16 21:37:12 +00:00
// grab the current notebook from the list of available notebooks
2007-11-17 22:55:13 +00:00
this . notebooks = evalJSON ( getElement ( "notebooks" ) . value ) ;
for ( var i in this . notebooks ) {
if ( this . notebooks [ i ] . object _id == this . notebook _id ) {
this . notebook = this . notebooks [ i ]
2007-10-16 21:37:12 +00:00
break ;
}
}
2007-10-19 21:07:22 +00:00
if ( this . notebook && this . notebook . read _write ) {
unsupported _agent = null ;
if ( /Safari/ . test ( navigator . userAgent ) )
unsupported _agent = "Safari" ;
if ( /Opera/ . test ( navigator . userAgent ) )
unsupported _agent = "Opera" ;
if ( unsupported _agent )
alert ( "Luminotes does not currently support the " + unsupported _agent + " web browser for editing. If possible, please use Firefox or Internet Explorer instead. " + unsupported _agent + " support will be added in a future release. Sorry for the inconvenience." ) ;
}
2007-11-17 04:21:48 +00:00
var deleted _id = getElement ( "deleted_id" ) . value ;
2007-11-17 04:39:33 +00:00
var skip _empty _message = deleted _id ? true : false ;
2007-11-17 04:21:48 +00:00
2007-10-16 21:37:12 +00:00
// populate the wiki with startup notes
this . populate (
evalJSON ( getElement ( "startup_notes" ) . value || "null" ) ,
2007-10-30 23:05:46 +00:00
evalJSON ( getElement ( "current_notes" ) . value || "null" ) ,
2007-11-17 04:39:33 +00:00
evalJSON ( getElement ( "note_read_write" ) . value || "true" ) ,
skip _empty _message
2007-10-16 21:37:12 +00:00
) ;
this . display _storage _usage ( evalJSON ( getElement ( "storage_bytes" ) . value || "0" ) ) ;
2007-08-07 01:48:43 +00:00
connect ( this . invoker , "error_message" , this , "display_error" ) ;
2007-09-27 22:40:18 +00:00
connect ( this . invoker , "message" , this , "display_message" ) ;
2007-07-16 20:22:38 +00:00
connect ( "search_form" , "onsubmit" , this , "search" ) ;
2007-09-05 23:11:19 +00:00
connect ( "html" , "onclick" , this , "background_clicked" ) ;
2007-11-09 20:07:32 +00:00
connect ( "html" , "onkeydown" , this , "key_pressed" ) ;
2007-11-29 20:15:37 +00:00
connect ( window , "onresize" , this , "resize_editors" ) ;
2007-07-16 20:22:38 +00:00
2007-10-27 03:22:34 +00:00
var blank _note _stub = getElement ( "blank_note_stub" ) ;
if ( blank _note _stub ) {
connect ( blank _note _stub , "onmouseover" , function ( event ) {
addElementClass ( blank _note _stub , "blank_note_stub_border" ) ;
removeElementClass ( blank _note _stub , "blank_note_stub_hidden_border" ) ;
} ) ;
connect ( blank _note _stub , "onmouseout" , function ( event ) {
addElementClass ( blank _note _stub , "blank_note_stub_hidden_border" ) ;
removeElementClass ( blank _note _stub , "blank_note_stub_border" ) ;
} ) ;
connect ( blank _note _stub , "onclick" , this , "create_blank_editor" ) ;
}
2007-07-16 20:22:38 +00:00
var self = this ;
2007-10-16 21:37:12 +00:00
var logout _link = getElement ( "logout_link" ) ;
if ( logout _link ) {
connect ( "logout_link" , "onclick" , function ( event ) {
self . save _editor ( null , true ) ;
self . invoker . invoke ( "/users/logout" , "POST" ) ;
event . stop ( ) ;
} ) ;
2007-07-16 20:22:38 +00:00
}
2007-11-15 23:46:30 +00:00
var rename = evalJSON ( getElement ( "rename" ) . value ) ;
2007-11-17 04:21:48 +00:00
if ( rename && this . notebook . read _write )
2007-11-15 23:46:30 +00:00
this . start _notebook _rename ( ) ;
2007-11-17 04:39:33 +00:00
// if a notebook was just deleted, show a message with an undo button
if ( deleted _id && this . notebook . read _write ) {
var undo _button = createDOM ( "input" , {
"type" : "button" ,
"class" : "message_button" ,
"value" : "undo" ,
"title" : "undo deletion"
} ) ;
var trash _link = createDOM ( "a" , {
"href" : "/notebooks/" + this . notebook . trash _id + "?parent_id=" + this . notebook . object _id
} , "trash" ) ;
var message _div = this . display _message ( "The notebook has been moved to the" , [ trash _link , ". " , undo _button ] , "notes_top" ) ;
var self = this ;
2007-11-17 22:55:13 +00:00
connect ( undo _button , "onclick" , function ( event ) { self . undelete _notebook ( event , deleted _id ) ; } ) ;
2007-11-17 04:39:33 +00:00
}
2007-07-16 20:22:38 +00:00
}
Wiki . prototype . update _next _id = function ( result ) {
this . next _id = result . next _id ;
}
2007-09-20 20:36:19 +00:00
Wiki . prototype . display _storage _usage = function ( storage _bytes ) {
2007-09-20 22:26:43 +00:00
if ( ! storage _bytes )
return ;
2007-09-20 20:36:19 +00:00
// display the user's current storage usage
var MEGABYTE = 1024 * 1024 ;
function bytes _to _megabytes ( storage _bytes ) {
return Math . round ( storage _bytes / MEGABYTE ) ;
}
2007-10-16 21:37:12 +00:00
var quota _bytes = this . rate _plan . storage _quota _bytes ;
if ( ! quota _bytes )
return ;
2007-09-20 20:36:19 +00:00
var usage _percent = Math . round ( storage _bytes / quota _bytes * 100.0 ) ;
2007-09-20 23:30:09 +00:00
if ( usage _percent > 90 ) {
2007-09-20 20:36:19 +00:00
var storage _usage _class = "storage_usage_high" ;
2007-09-20 23:25:59 +00:00
if ( this . storage _usage _high == false )
this . display _message ( "You are currently using " + usage _percent + "% of your available storage space. Please delete some notes, empty the trash, or upgrade your account." ) ;
2007-09-20 22:59:00 +00:00
this . storage _usage _high = true ;
} else if ( usage _percent > 75 ) {
2007-09-20 20:36:19 +00:00
var storage _usage _class = "storage_usage_medium" ;
2007-09-20 22:59:00 +00:00
this . storage _usage _high = false ;
} else {
2007-09-20 20:36:19 +00:00
var storage _usage _class = "storage_usage_low" ;
2007-09-20 22:59:00 +00:00
this . storage _usage _high = false ;
}
2007-09-20 20:36:19 +00:00
replaceChildNodes (
"storage_usage_area" ,
createDOM ( "div" , { "class" : storage _usage _class } ,
2007-09-28 20:42:27 +00:00
bytes _to _megabytes ( storage _bytes ) + " MB (" + usage _percent + "%) of " + bytes _to _megabytes ( quota _bytes ) + " MB" )
2007-09-20 20:36:19 +00:00
) ;
}
2007-11-17 04:39:33 +00:00
Wiki . prototype . populate = function ( startup _notes , current _notes , note _read _write , skip _empty _message ) {
2007-11-17 22:55:13 +00:00
var self = this ;
// if this is the trash, display a list of all deleted notebooks
if ( this . notebook . name == "trash" ) {
var heading _shown = false ;
var deleted _notebooks = getElement ( "deleted_notebooks" ) ;
for ( var i in this . notebooks ) {
var notebook = this . notebooks [ i ] ;
if ( ! notebook . deleted )
continue ;
if ( ! heading _shown ) {
appendChildNodes ( deleted _notebooks , createDOM ( "h4" , { } , "deleted notebooks" ) ) ;
heading _shown = true ;
}
delete _button = createDOM ( "input" , {
"type" : "button" ,
"class" : "note_button" ,
"id" : "delete_notebook_" + notebook . object _id ,
"value" : "delete forever" ,
"title" : "delete notebook"
} ) ;
function connect _delete ( notebook _id ) {
connect ( delete _button , "onclick" , function ( event ) { self . delete _notebook _forever ( event , notebook _id ) ; } ) ;
}
connect _delete ( notebook . object _id ) ;
undelete _button = createDOM ( "input" , {
"type" : "button" ,
"class" : "note_button" ,
"id" : "undelete_notebook_" + notebook . object _id ,
"value" : "undelete" ,
"title" : "undelete notebook"
} ) ;
function connect _undelete ( notebook _id ) {
connect ( undelete _button , "onclick" , function ( event ) { self . undelete _notebook ( event , notebook _id ) ; } ) ;
}
connect _undelete ( notebook . object _id ) ;
appendChildNodes ( deleted _notebooks , createDOM ( "div" ,
2007-11-17 23:29:22 +00:00
{ "id" : "deleted_notebook_" + notebook . object _id , "class" : "deleted_notebook_item" } ,
2007-11-17 22:55:13 +00:00
createDOM ( "span" , { } , delete _button ) ,
createDOM ( "span" , { } , undelete _button ) ,
createDOM ( "span" , { } , notebook . name )
) ) ;
}
}
2007-10-16 21:37:12 +00:00
// create an editor for each startup note in the received notebook, focusing the first one
var focus = true ;
for ( var i in startup _notes ) {
var startup _note = startup _notes [ i ] ;
this . startup _notes [ startup _note . object _id ] = true ;
2007-09-01 21:06:37 +00:00
2007-10-30 23:05:46 +00:00
// don't actually create an editor if a particular list of notes was provided in the result
if ( current _notes . length == 0 ) {
2007-10-16 21:37:12 +00:00
var editor = this . create _editor (
startup _note . object _id ,
2007-10-30 23:05:46 +00:00
// grab this note's contents from the static notes area
2007-10-16 21:37:12 +00:00
getElement ( "static_note_" + startup _note . object _id ) . innerHTML ,
startup _note . deleted _from _id ,
startup _note . revision ,
2007-10-30 23:05:46 +00:00
startup _note . creation ,
2007-10-16 21:37:12 +00:00
this . notebook . read _write , false , focus
) ;
2007-09-01 21:06:37 +00:00
2007-10-16 21:37:12 +00:00
this . open _editors [ startup _note . title ] = editor ;
focus = false ;
}
2007-08-29 00:50:46 +00:00
}
2007-08-28 20:57:08 +00:00
2007-10-30 23:05:46 +00:00
// if particular notes were provided, then display editors for them
var focus = true ;
for ( var i in current _notes ) {
var note = current _notes [ i ] ;
2007-10-16 21:37:12 +00:00
this . create _editor (
note . object _id ,
getElement ( "static_note_" + note . object _id ) . innerHTML ,
note . deleted _from _id ,
note . revision ,
2007-10-30 23:05:46 +00:00
note . creation ,
this . notebook . read _write && note _read _write , false , focus
2007-10-16 21:37:12 +00:00
) ;
2007-10-30 23:05:46 +00:00
focus = false ;
}
2007-08-07 01:48:43 +00:00
2007-11-17 04:39:33 +00:00
if ( startup _notes . length == 0 && current _notes . length == 0 && ! skip _empty _message )
2007-10-16 21:37:12 +00:00
this . display _empty _message ( ) ;
2007-08-07 01:48:43 +00:00
2007-10-16 21:37:12 +00:00
var empty _trash _link = getElement ( "empty_trash_link" ) ;
if ( empty _trash _link )
connect ( empty _trash _link , "onclick" , function ( event ) { self . delete _all _editors ( event ) ; } ) ;
2007-08-07 01:48:43 +00:00
2007-10-16 21:37:12 +00:00
if ( this . notebook . read _write ) {
2007-07-16 20:22:38 +00:00
connect ( window , "onunload" , function ( event ) { self . editor _focused ( null , true ) ; } ) ;
2007-10-25 23:19:57 +00:00
connect ( "newNote" , "onclick" , this , "create_blank_editor" ) ;
connect ( "createLink" , "onclick" , this , "toggle_link_button" ) ;
2007-07-16 20:22:38 +00:00
connect ( "bold" , "onclick" , function ( event ) { self . toggle _button ( event , "bold" ) ; } ) ;
connect ( "italic" , "onclick" , function ( event ) { self . toggle _button ( event , "italic" ) ; } ) ;
2007-08-27 21:01:42 +00:00
connect ( "underline" , "onclick" , function ( event ) { self . toggle _button ( event , "underline" ) ; } ) ;
2007-07-16 20:22:38 +00:00
connect ( "title" , "onclick" , function ( event ) { self . toggle _button ( event , "title" , "h3" ) ; } ) ;
connect ( "insertUnorderedList" , "onclick" , function ( event ) { self . toggle _button ( event , "insertUnorderedList" ) ; } ) ;
connect ( "insertOrderedList" , "onclick" , function ( event ) { self . toggle _button ( event , "insertOrderedList" ) ; } ) ;
2007-10-25 23:19:57 +00:00
this . make _image _button ( "newNote" , "new_note" , true ) ;
this . make _image _button ( "createLink" , "link" ) ;
this . make _image _button ( "bold" ) ;
this . make _image _button ( "italic" ) ;
this . make _image _button ( "underline" ) ;
this . make _image _button ( "title" ) ;
this . make _image _button ( "insertUnorderedList" , "bullet_list" ) ;
this . make _image _button ( "insertOrderedList" , "numbered_list" ) ;
2007-07-16 20:22:38 +00:00
// grab the next available object id
this . invoker . invoke ( "/next_id" , "POST" , null ,
function ( result ) { self . update _next _id ( result ) ; }
) ;
}
2007-10-16 21:37:12 +00:00
var all _notes _link = getElement ( "all_notes_link" ) ;
if ( all _notes _link ) {
connect ( all _notes _link , "onclick" , function ( event ) {
2007-11-09 06:49:26 +00:00
self . load _editor ( "all notes" , "null" , null , null , getElement ( "notes_top" ) ) ;
2007-09-04 21:37:48 +00:00
event . stop ( ) ;
} ) ;
}
2007-08-07 01:48:43 +00:00
2007-10-16 21:37:12 +00:00
var download _html _link = getElement ( "download_html_link" ) ;
if ( download _html _link ) {
connect ( download _html _link , "onclick" , function ( event ) {
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
self . save _editor ( null , true ) ;
} ) ;
}
2007-11-15 01:30:45 +00:00
var add _notebook _link = getElement ( "add_notebook_link" ) ;
if ( add _notebook _link ) {
connect ( add _notebook _link , "onclick" , function ( event ) {
self . invoker . invoke ( "/notebooks/create" , "POST" ) ;
event . stop ( ) ;
} ) ;
}
var rename _notebook _link = getElement ( "rename_notebook_link" ) ;
if ( rename _notebook _link ) {
connect ( rename _notebook _link , "onclick" , function ( event ) {
self . start _notebook _rename ( ) ;
event . stop ( ) ;
} ) ;
}
var notebook _header _name = getElement ( "notebook_header_name" ) ;
if ( notebook _header _name ) {
connect ( notebook _header _name , "onclick" , function ( event ) {
self . start _notebook _rename ( ) ;
event . stop ( ) ;
} ) ;
}
2007-11-17 04:21:48 +00:00
2007-11-17 23:29:22 +00:00
var delete _notebook _link = getElement ( "delete_notebook_link" ) ;
if ( delete _notebook _link ) {
connect ( delete _notebook _link , "onclick" , function ( event ) {
2007-11-17 04:21:48 +00:00
self . delete _notebook ( ) ;
event . stop ( ) ;
} ) ;
}
2007-07-16 20:22:38 +00:00
}
2007-09-05 23:11:19 +00:00
Wiki . prototype . background _clicked = function ( event ) {
if ( ! hasElementClass ( event . target ( ) , "pulldown_checkbox" ) )
this . clear _pulldowns ( ) ;
}
2007-07-16 20:22:38 +00:00
Wiki . prototype . create _blank _editor = function ( event ) {
if ( event ) event . stop ( ) ;
2007-10-27 03:22:34 +00:00
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
2007-08-30 20:39:41 +00:00
// if we're within the trash, don't allow new note creation
if ( this . notebook . name == "trash" ) {
this . display _error ( "You can't create notes in the trash." ) ;
return ;
}
2007-07-16 20:22:38 +00:00
// if there is already a blank editor, then highlight it and bail
if ( this . blank _editor _id != null ) {
2007-07-17 01:21:31 +00:00
var blank _iframe _id = "note_" + this . blank _editor _id ;
2007-07-16 20:22:38 +00:00
var iframe = getElement ( blank _iframe _id ) ;
if ( iframe && iframe . editor . empty ( ) ) {
iframe . editor . highlight ( ) ;
return ;
}
}
2007-10-30 23:05:46 +00:00
var editor = this . create _editor ( undefined , undefined , undefined , undefined , undefined , this . notebook . read _write , true , true ) ;
2007-10-19 20:24:16 +00:00
this . increment _total _notes _count ( ) ;
2007-09-05 18:49:28 +00:00
this . blank _editor _id = editor . id ;
2007-10-22 20:52:04 +00:00
this . add _all _notes _link ( editor . id , "" ) ;
2007-07-16 20:22:38 +00:00
}
2007-11-09 06:49:26 +00:00
Wiki . prototype . load _editor = function ( note _title , note _id , revision , link , position _after ) {
2007-09-02 03:51:31 +00:00
if ( this . notebook . name == "trash" && ! revision ) {
2007-11-09 06:49:26 +00:00
this . display _message ( "If you'd like to use this note, try undeleting it first." , undefined , position _after ) ;
2007-08-30 20:39:41 +00:00
return ;
}
2007-08-15 00:18:30 +00:00
// if a link is given with an open link pulldown, then ignore the note title given and use the
// one from the pulldown instead
2007-08-16 19:55:11 +00:00
if ( link ) {
var pulldown = link . pulldown ;
var pulldown _title = undefined ;
if ( pulldown ) {
pulldown _title = strip ( pulldown . title _field . value ) ;
if ( pulldown _title )
note _title = pulldown _title ;
}
2007-08-15 00:18:30 +00:00
2007-08-23 06:45:42 +00:00
// if the title looks like a URL, then make it a link to an external site
if ( /^\w+:\/\// . test ( note _title ) ) {
link . target = "_new" ;
link . href = note _title ;
window . open ( link . href ) ;
return
}
2007-10-22 23:17:56 +00:00
if ( link . target )
link . removeAttribute ( "target" ) ;
2007-08-16 22:27:58 +00:00
}
2007-09-06 08:27:41 +00:00
// if the note corresponding to the link's id is already open, highlight it and bail, but only if
// we didn't pull a title from an open link pulldown
if ( ! pulldown _title ) {
if ( revision )
var iframe = getElement ( "note_" + note _id + " " + revision ) ;
else
var iframe = getElement ( "note_" + note _id ) ;
if ( iframe ) {
iframe . editor . highlight ( ) ;
if ( link )
link . href = "/notebooks/" + this . notebook _id + "?note_id=" + note _id ;
return ;
}
2007-08-16 01:29:18 +00:00
}
2007-09-07 23:46:01 +00:00
// if there's not a valid destination note id, then load by title instead of by id
2007-08-16 01:29:18 +00:00
var self = this ;
2007-09-07 23:46:01 +00:00
if ( pulldown _title || note _id == undefined || note _id == "new" || note _id == "null" ) {
2007-09-10 20:04:46 +00:00
// if the note_title corresponds to a "magic" note's title, then dynamically highlight or create the note
2007-09-07 23:46:01 +00:00
if ( note _title == "all notes" ) {
this . invoker . invoke (
"/notebooks/all_notes" , "GET" , { "notebook_id" : this . notebook . object _id } ,
function ( result ) { self . display _all _notes _list ( result ) ; }
) ;
2007-09-05 23:44:34 +00:00
return ;
}
2007-09-10 20:04:46 +00:00
if ( note _title == "search results" ) {
var editor = this . open _editors [ note _title ] ;
if ( editor ) {
editor . highlight ( ) ;
return ;
}
this . display _search _results ( ) ;
return ;
}
2007-09-05 23:44:34 +00:00
2007-09-05 19:54:04 +00:00
// but if the note corresponding to the link's title is already open, highlight it and bail
if ( ! revision ) {
var editor = this . open _editors [ note _title ] ;
if ( editor ) {
editor . highlight ( ) ;
if ( link )
link . href = "/notebooks/" + this . notebook _id + "?note_id=" + editor . id ;
return ;
}
}
2007-08-14 04:13:49 +00:00
this . invoker . invoke (
"/notebooks/load_note_by_title" , "GET" , {
"notebook_id" : this . notebook _id ,
"note_title" : note _title ,
"revision" : revision
} ,
2007-11-09 06:49:26 +00:00
function ( result ) { self . parse _loaded _editor ( result , note _title , revision , link , position _after ) ; }
2007-08-14 04:13:49 +00:00
) ;
return ;
}
2007-07-16 20:22:38 +00:00
this . invoker . invoke (
2007-07-17 01:21:31 +00:00
"/notebooks/load_note" , "GET" , {
2007-07-16 20:22:38 +00:00
"notebook_id" : this . notebook _id ,
2007-07-31 22:53:57 +00:00
"note_id" : note _id ,
"revision" : revision
2007-07-16 20:22:38 +00:00
} ,
2007-11-09 06:49:26 +00:00
function ( result ) { self . parse _loaded _editor ( result , note _title , revision , link , position _after ) ; }
2007-07-16 20:22:38 +00:00
) ;
}
2007-08-16 01:29:18 +00:00
Wiki . prototype . resolve _link = function ( note _title , link , callback ) {
2007-08-16 22:27:58 +00:00
// if the title looks like a URL, then make it a link to an external site
if ( /^\w+:\/\// . test ( note _title ) ) {
link . target = "_new" ;
link . href = note _title ;
if ( callback ) callback ( "web link" ) ;
2007-09-07 23:03:12 +00:00
return ;
2007-08-16 22:27:58 +00:00
}
2007-10-22 23:17:56 +00:00
if ( link && link . target )
link . removeAttribute ( "target" ) ;
2007-08-16 22:27:58 +00:00
2007-09-10 20:04:46 +00:00
if ( note _title == "all notes" || note _title == "search results" ) {
2007-09-07 23:03:12 +00:00
link . href = "/notebooks/" + this . notebook _id + "?" + queryString (
[ "title" , "note_id" ] ,
[ note _title , "null" ]
) ;
2007-09-10 20:04:46 +00:00
if ( callback ) {
if ( note _title == "all notes" )
callback ( "list of all notes in this notebook" ) ;
else
callback ( "current search results" ) ;
}
2007-09-07 23:03:12 +00:00
return ;
}
2007-08-16 01:29:18 +00:00
var id = parse _query ( link ) . note _id ;
// if the link already has a valid-looking id, it's already resolved, so bail
2007-08-16 22:27:58 +00:00
if ( ! callback && id != undefined && id != "new" && id != "null" )
2007-08-16 01:29:18 +00:00
return ;
2007-07-16 20:22:38 +00:00
2007-08-14 04:13:49 +00:00
if ( note _title . length == 0 )
return ;
2007-08-16 01:29:18 +00:00
// if the note corresponding to the link's title is already open, resolve the link and bail
var editor = this . open _editors [ note _title ] ;
if ( editor ) {
2007-10-22 23:17:56 +00:00
if ( link )
link . href = "/notebooks/" + this . notebook _id + "?note_id=" + editor . id ;
2007-08-16 01:29:18 +00:00
if ( callback )
callback ( editor . contents ( ) ) ;
return ;
}
2007-08-14 04:13:49 +00:00
var self = this ;
2007-11-27 21:28:25 +00:00
if ( callback ) {
this . invoker . invoke (
"/notebooks/load_note_by_title" , "GET" , {
"notebook_id" : this . notebook _id ,
"note_title" : note _title ,
"summarize" : true
} ,
function ( result ) {
if ( result && result . note ) {
link . href = "/notebooks/" + self . notebook _id + "?note_id=" + result . note . object _id ;
} else {
link . href = "/notebooks/" + self . notebook _id + "?" + queryString (
[ "title" , "note_id" ] ,
[ note _title , "null" ]
) ;
}
callback ( ( result && result . note ) ? result . note . summary : null ) ;
}
) ;
return ;
}
2007-07-16 20:22:38 +00:00
this . invoker . invoke (
2007-11-27 21:28:25 +00:00
"/notebooks/lookup_note_id" , "GET" , {
2007-07-16 20:22:38 +00:00
"notebook_id" : this . notebook _id ,
2007-07-17 01:21:31 +00:00
"note_title" : note _title
2007-07-16 20:22:38 +00:00
} ,
2007-08-14 04:13:49 +00:00
function ( result ) {
2007-11-27 21:28:25 +00:00
if ( result && result . note _id ) {
link . href = "/notebooks/" + self . notebook _id + "?note_id=" + result . note _id ;
2007-08-16 01:29:18 +00:00
} else {
link . href = "/notebooks/" + self . notebook _id + "?" + queryString (
[ "title" , "note_id" ] ,
[ note _title , "null" ]
) ;
}
2007-08-14 04:13:49 +00:00
}
2007-07-16 20:22:38 +00:00
) ;
}
2007-11-09 06:49:26 +00:00
Wiki . prototype . parse _loaded _editor = function ( result , note _title , requested _revision , link , position _after ) {
2007-10-22 23:17:56 +00:00
if ( result . note _id _in _trash ) {
var undelete _button = createDOM ( "input" , {
"type" : "button" ,
"class" : "message_button" ,
"value" : "undelete" ,
"title" : "undelete note"
} ) ;
var trash _link = createDOM ( "a" , {
"href" : "/notebooks/" + this . notebook . trash _id + "?parent_id=" + this . notebook . object _id
} , "trash" ) ;
2007-11-09 06:49:26 +00:00
var message _div = this . display _message ( "That note is in the" , [ trash _link , ". " , undelete _button ] , position _after )
2007-10-22 23:17:56 +00:00
var self = this ;
2007-11-09 06:49:26 +00:00
connect ( undelete _button , "onclick" , function ( event ) { self . undelete _editor _via _undelete ( event , result . note _id _in _trash , message _div ) ; } ) ;
2007-10-22 23:17:56 +00:00
return ;
}
2007-07-17 01:21:31 +00:00
if ( result . note ) {
2007-07-31 22:53:57 +00:00
var id = result . note . object _id ;
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
if ( requested _revision )
id += " " + requested _revision ;
var actual _revision = result . note . revision ;
2007-10-30 23:05:46 +00:00
var actual _creation = result . note . creation ;
2007-07-17 01:21:31 +00:00
var note _text = result . note . contents ;
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
var deleted _from _id = result . note . deleted ;
2007-07-16 20:22:38 +00:00
} else {
var id = null ;
2007-07-17 01:21:31 +00:00
var note _text = "<h3>" + note _title ;
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
var deleted _from _id = null ;
var actual _revision = null ;
2007-10-30 23:05:46 +00:00
var actual _creation = null ;
2007-10-19 20:24:16 +00:00
this . increment _total _notes _count ( ) ;
2007-07-16 20:22:38 +00:00
}
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
if ( requested _revision )
2007-07-31 22:53:57 +00:00
var read _write = false ; // show previous revisions as read-only
else
2007-10-16 21:37:12 +00:00
var read _write = this . notebook . read _write ;
2007-07-31 22:53:57 +00:00
2007-11-09 06:49:26 +00:00
var editor = this . create _editor ( id , note _text , deleted _from _id , actual _revision , actual _creation , read _write , true , false , position _after ) ;
2007-09-05 18:49:28 +00:00
id = editor . id ;
2007-08-14 20:34:31 +00:00
// if a link that launched this editor was provided, update it with the created note's id
if ( link && id )
2007-08-15 00:18:30 +00:00
link . href = "/notebooks/" + this . notebook _id + "?note_id=" + id ;
2007-07-16 20:22:38 +00:00
}
2007-11-09 06:49:26 +00:00
Wiki . prototype . create _editor = function ( id , note _text , deleted _from _id , revision , creation , read _write , highlight , focus , position _after ) {
2007-07-16 20:22:38 +00:00
var self = this ;
if ( isUndefinedOrNull ( id ) ) {
2007-10-16 21:37:12 +00:00
if ( this . notebook . read _write ) {
2007-07-16 20:22:38 +00:00
id = this . next _id ;
this . invoker . invoke ( "/next_id" , "POST" , null ,
function ( result ) { self . update _next _id ( result ) ; }
) ;
} else {
id = 0 ;
}
}
2007-07-31 22:53:57 +00:00
// for read-only notes within read-write notebooks, tack the revision timestamp onto the start of the note text
2007-10-16 21:37:12 +00:00
if ( ! read _write && this . notebook . read _write && revision ) {
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
var short _revision = this . brief _revision ( revision ) ;
2007-09-27 00:26:51 +00:00
note _text = "<p>Previous revision from " + short _revision + "</p>" + note _text ;
2007-07-31 22:53:57 +00:00
}
2007-10-30 23:05:46 +00:00
if ( ! read _write && creation ) {
var short _creation = this . brief _revision ( creation ) ;
2007-11-11 21:37:30 +00:00
note _text = '<p>' + short _creation + ' | <a href="/blog?note_id=' + id + '" target="_top">permalink</a></p>' + note _text ;
2007-10-30 23:05:46 +00:00
}
2007-07-17 01:21:31 +00:00
var startup = this . startup _notes [ id ] ;
2007-11-09 06:49:26 +00:00
var editor = new Editor ( id , this . notebook _id , note _text , deleted _from _id , revision , read _write , startup , highlight , focus , position _after ) ;
2007-07-16 20:22:38 +00:00
2007-10-16 21:37:12 +00:00
if ( this . notebook . read _write ) {
2007-07-16 20:22:38 +00:00
connect ( editor , "state_changed" , this , "editor_state_changed" ) ;
2007-08-16 01:29:18 +00:00
connect ( editor , "title_changed" , this , "editor_title_changed" ) ;
2007-07-16 20:22:38 +00:00
connect ( editor , "key_pressed" , this , "editor_key_pressed" ) ;
connect ( editor , "delete_clicked" , function ( event ) { self . delete _editor ( event , editor ) } ) ;
2007-08-07 01:48:43 +00:00
connect ( editor , "undelete_clicked" , function ( event ) { self . undelete _editor _via _trash ( event , editor ) } ) ;
2007-07-26 01:18:41 +00:00
connect ( editor , "changes_clicked" , function ( event ) { self . toggle _editor _changes ( event , editor ) } ) ;
2007-07-16 20:22:38 +00:00
connect ( editor , "options_clicked" , function ( event ) { self . toggle _editor _options ( event , editor ) } ) ;
connect ( editor , "focused" , this , "editor_focused" ) ;
}
connect ( editor , "load_editor" , this , "load_editor" ) ;
connect ( editor , "hide_clicked" , function ( event ) { self . hide _editor ( event , editor ) } ) ;
connect ( editor , "submit_form" , function ( url , form ) {
self . invoker . invoke ( url , "POST" , null , null , form ) ;
} ) ;
2007-11-09 06:49:26 +00:00
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
2007-09-05 18:49:28 +00:00
return editor ;
2007-07-16 20:22:38 +00:00
}
2007-11-29 20:15:37 +00:00
Wiki . prototype . resize _editors = function ( ) {
var iframes = getElementsByTagAndClassName ( "iframe" , "note_frame" ) ;
for ( var i in iframes ) {
var editor = iframes [ i ] . editor ;
editor . resize ( ) ;
}
}
2007-07-16 20:22:38 +00:00
Wiki . prototype . editor _state _changed = function ( editor ) {
this . update _toolbar ( ) ;
2007-08-14 04:13:49 +00:00
this . display _link _pulldown ( editor ) ;
}
2007-08-16 01:29:18 +00:00
Wiki . prototype . editor _title _changed = function ( editor , old _title , new _title ) {
delete this . open _editors [ old _title ] ;
2007-10-22 20:52:04 +00:00
if ( new _title != null && ! editor . empty ( ) ) {
2007-08-16 01:29:18 +00:00
this . open _editors [ new _title ] = editor ;
2007-10-22 20:52:04 +00:00
this . add _all _notes _link ( editor . id , new _title ) ;
}
2007-08-16 01:29:18 +00:00
}
2007-08-30 20:17:10 +00:00
Wiki . prototype . display _link _pulldown = function ( editor , link ) {
2007-09-04 21:37:48 +00:00
if ( ! editor . read _write ) {
this . clear _pulldowns ( ) ;
return ;
}
2007-08-30 20:17:10 +00:00
if ( ! link )
link = editor . find _link _at _cursor ( ) ;
2007-08-14 04:13:49 +00:00
2007-09-11 00:10:44 +00:00
// if there's no link at the current cursor location, or there is a link but it was just started,
// bail
if ( ! link || link == editor . link _started ) {
2007-08-14 04:13:49 +00:00
this . clear _pulldowns ( ) ;
return ;
}
2007-08-16 01:29:18 +00:00
var pulldown = link . pulldown ;
2007-08-14 04:13:49 +00:00
if ( pulldown )
pulldown . update _position ( ) ;
// if the cursor is now on a link, display a link pulldown if there isn't already one open
2007-08-29 23:54:14 +00:00
if ( link _title ( link ) . length > 0 ) {
2007-08-14 04:13:49 +00:00
if ( ! pulldown ) {
this . clear _pulldowns ( ) ;
new Link _pulldown ( this , this . notebook _id , this . invoker , editor , link ) ;
}
}
2007-07-16 20:22:38 +00:00
}
Wiki . prototype . editor _focused = function ( editor , fire _and _forget ) {
if ( editor )
2007-07-17 01:21:31 +00:00
addElementClass ( editor . iframe , "focused_note_frame" ) ;
2007-07-16 20:22:38 +00:00
if ( this . focused _editor && this . focused _editor != editor ) {
2007-08-14 04:13:49 +00:00
this . clear _pulldowns ( ) ;
2007-07-17 01:21:31 +00:00
removeElementClass ( this . focused _editor . iframe , "focused_note_frame" ) ;
2007-07-16 20:22:38 +00:00
// if the formerly focused editor is completely empty, then remove it as the user leaves it and switches to this editor
2007-10-26 21:01:22 +00:00
if ( this . focused _editor . id == this . blank _editor _id && this . focused _editor . empty ( ) ) {
2007-10-22 20:52:04 +00:00
this . remove _all _notes _link ( this . focused _editor . id ) ;
2007-07-16 20:22:38 +00:00
this . focused _editor . shutdown ( ) ;
2007-10-19 20:24:16 +00:00
this . decrement _total _notes _count ( ) ;
2007-09-05 18:49:28 +00:00
this . display _empty _message ( ) ;
2007-07-16 20:22:38 +00:00
} else {
// when switching editors, save the one being left
this . save _editor ( null , fire _and _forget ) ;
}
}
this . focused _editor = editor ;
}
2007-11-09 20:07:32 +00:00
Wiki . prototype . key _pressed = function ( event ) {
2007-11-12 11:26:10 +00:00
if ( ! this . notebook . read _write )
return ;
2007-11-09 20:07:32 +00:00
var code = event . key ( ) . code ;
if ( event . modifier ( ) . ctrl ) {
// ctrl-n: new note
if ( code == 78 )
this . create _blank _editor ( event ) ;
}
}
2007-07-16 20:22:38 +00:00
Wiki . prototype . editor _key _pressed = function ( editor , event ) {
var code = event . key ( ) . code ;
if ( event . modifier ( ) . ctrl ) {
// ctrl-backtick: alert with frame HTML contents (temporary for debugging)
if ( code == 192 || code == 96 ) {
2007-09-07 23:03:12 +00:00
alert ( editor . contents ( ) ) ;
2007-07-16 20:22:38 +00:00
event . stop ( ) ;
// ctrl-b: bold
} else if ( code == 66 ) {
this . toggle _button ( event , "bold" ) ;
// ctrl-i: italic
} else if ( code == 73 ) {
this . toggle _button ( event , "italic" ) ;
2007-08-27 21:01:42 +00:00
// ctrl-u: underline
} else if ( code == 85 ) {
this . toggle _button ( event , "underline" ) ;
2007-07-16 20:22:38 +00:00
// ctrl-t: title
} else if ( code == 84 ) {
this . toggle _button ( event , "title" , "h3" ) ;
2007-08-27 21:09:39 +00:00
// ctrl-period: unordered list
} else if ( code == 190 ) {
2007-07-16 20:22:38 +00:00
this . toggle _button ( event , "insertUnorderedList" ) ;
2007-11-09 20:07:32 +00:00
// ctrl-1: ordered list
2007-07-16 20:22:38 +00:00
} else if ( code == 49 ) {
this . toggle _button ( event , "insertOrderedList" ) ;
2007-11-09 20:07:32 +00:00
// ctrl-l: link
2007-07-18 20:28:42 +00:00
} else if ( code == 76 ) {
2007-07-16 20:22:38 +00:00
this . toggle _link _button ( event ) ;
2007-07-17 01:21:31 +00:00
// ctrl-n: new note
2007-07-16 20:22:38 +00:00
} else if ( code == 78 ) {
this . create _blank _editor ( event ) ;
2007-07-17 01:21:31 +00:00
// ctrl-h: hide note
2007-07-16 20:22:38 +00:00
} else if ( code == 72 ) {
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
if ( ! editor . deleted _from _id )
2007-09-05 18:57:50 +00:00
this . hide _editor ( event ) ;
2007-07-17 01:21:31 +00:00
// ctrl-d: delete note
2007-07-16 20:22:38 +00:00
} else if ( code == 68 ) {
this . delete _editor ( event ) ;
}
// IE: hitting space or tab while making a link shouldn't end the link
} else if ( ( code == 32 || code == 9 ) && editor . document . selection && editor . state _enabled ( "createLink" ) ) {
var range = editor . document . selection . createRange ( ) ;
var text = range . parentElement ( ) . firstChild ;
text . nodeValue += " " ;
event . stop ( ) ;
}
}
2007-10-25 23:19:57 +00:00
IMAGE _DIR = "/static/images/" ;
Wiki . prototype . make _image _button = function ( name , filename _prefix , handle _mouse _up _and _down ) {
var button = getElement ( name ) ;
if ( ! filename _prefix )
filename _prefix = name ;
button . filename _prefix = filename _prefix ;
connect ( button , "onmouseover" , function ( event ) {
if ( /_down/ . test ( button . src ) )
button . src = IMAGE _DIR + filename _prefix + "_button_down_hover.png" ;
else
button . src = IMAGE _DIR + filename _prefix + "_button_hover.png" ;
} ) ;
connect ( button , "onmouseout" , function ( event ) {
if ( /_down/ . test ( button . src ) )
button . src = IMAGE _DIR + filename _prefix + "_button_down.png" ;
else
button . src = IMAGE _DIR + filename _prefix + "_button.png" ;
} ) ;
if ( handle _mouse _up _and _down ) {
connect ( button , "onmousedown" , function ( event ) {
if ( /_hover/ . test ( button . src ) )
button . src = IMAGE _DIR + filename _prefix + "_button_down_hover.png" ;
else
button . src = IMAGE _DIR + filename _prefix + "_button_down.png" ;
} ) ;
connect ( button , "onmouseup" , function ( event ) {
if ( /_hover/ . test ( button . src ) )
button . src = IMAGE _DIR + filename _prefix + "_button_hover.png" ;
else
button . src = IMAGE _DIR + filename _prefix + "_button.png" ;
} ) ;
}
}
Wiki . prototype . down _image _button = function ( name ) {
var button = getElement ( name ) ;
2007-10-31 21:03:06 +00:00
if ( /_down/ . test ( button . src ) )
return ;
2007-10-25 23:19:57 +00:00
if ( /_hover/ . test ( button . src ) )
button . src = IMAGE _DIR + button . filename _prefix + "_button_down_hover.png" ;
else
button . src = IMAGE _DIR + button . filename _prefix + "_button_down.png" ;
}
Wiki . prototype . up _image _button = function ( name ) {
var button = getElement ( name ) ;
2007-10-31 21:03:06 +00:00
if ( ! /_down/ . test ( button . src ) )
return ;
2007-10-25 23:19:57 +00:00
if ( /_hover/ . test ( button . src ) )
button . src = IMAGE _DIR + button . filename _prefix + "_button_hover.png" ;
else
button . src = IMAGE _DIR + button . filename _prefix + "_button.png" ;
}
Wiki . prototype . toggle _image _button = function ( name ) {
var button = getElement ( name ) ;
if ( /_down/ . test ( button . src ) ) {
if ( /_hover/ . test ( button . src ) )
button . src = IMAGE _DIR + button . filename _prefix + "_button_hover.png" ;
else
button . src = IMAGE _DIR + button . filename _prefix + "_button.png" ;
return false ;
} else {
if ( /_hover/ . test ( button . src ) )
button . src = IMAGE _DIR + button . filename _prefix + "_button_down_hover.png" ;
else
button . src = IMAGE _DIR + button . filename _prefix + "_button_down.png" ;
return true ;
}
}
2007-07-16 20:22:38 +00:00
Wiki . prototype . toggle _button = function ( event , button _id , state _name ) {
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
2007-07-31 22:53:57 +00:00
if ( this . focused _editor && this . focused _editor . read _write ) {
2007-07-16 20:22:38 +00:00
this . focused _editor . focus ( ) ;
this . focused _editor . exec _command ( state _name || button _id ) ;
this . focused _editor . resize ( ) ;
this . update _button ( button _id , state _name ) ;
}
event . stop ( ) ;
}
Wiki . prototype . update _button = function ( button _id , state _name ) {
if ( this . focused _editor . state _enabled ( state _name || button _id ) )
2007-10-25 23:19:57 +00:00
this . down _image _button ( button _id ) ;
2007-07-16 20:22:38 +00:00
else
2007-10-25 23:19:57 +00:00
this . up _image _button ( button _id ) ;
2007-07-16 20:22:38 +00:00
}
Wiki . prototype . update _toolbar = function ( ) {
if ( this . focused _editor ) {
this . update _button ( "bold" ) ;
this . update _button ( "italic" ) ;
2007-08-27 21:01:42 +00:00
this . update _button ( "underline" ) ;
2007-07-16 20:22:38 +00:00
this . update _button ( "title" , "h3" ) ;
this . update _button ( "insertUnorderedList" ) ;
this . update _button ( "insertOrderedList" ) ;
this . update _button ( "createLink" ) ;
}
}
Wiki . prototype . toggle _link _button = function ( event ) {
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
2007-08-30 20:17:10 +00:00
var link = null ;
2007-07-16 20:22:38 +00:00
2007-07-31 22:53:57 +00:00
if ( this . focused _editor && this . focused _editor . read _write ) {
2007-07-16 20:22:38 +00:00
this . focused _editor . focus ( ) ;
2007-10-25 23:19:57 +00:00
if ( this . toggle _image _button ( "createLink" ) )
2007-11-27 21:28:25 +00:00
link = this . focused _editor . start _link ( ) ;
2007-07-16 20:22:38 +00:00
else
2007-08-30 20:17:10 +00:00
link = this . focused _editor . end _link ( ) ;
2007-08-14 04:13:49 +00:00
2007-11-27 21:28:25 +00:00
if ( link ) {
var self = this ;
this . resolve _link ( link _title ( link ) , link , function ( summary ) {
self . display _link _pulldown ( self . focused _editor , link ) ;
} ) ;
} else {
this . display _link _pulldown ( this . focused _editor ) ;
}
2007-07-16 20:22:38 +00:00
}
event . stop ( ) ;
}
Wiki . prototype . hide _editor = function ( event , editor ) {
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
2007-10-19 20:24:16 +00:00
if ( editor == this . focused _editor )
this . focused _editor = null ;
2007-07-16 20:22:38 +00:00
if ( ! editor ) {
editor = this . focused _editor ;
this . focused _editor = null ;
}
if ( editor ) {
2007-10-19 20:24:16 +00:00
// if the editor to hide is completely empty, then simply remove it
2007-10-26 21:01:22 +00:00
if ( editor . id == this . blank _editor _id && editor . empty ( ) ) {
2007-10-22 20:52:04 +00:00
this . remove _all _notes _link ( editor . id ) ;
2007-10-19 20:24:16 +00:00
editor . shutdown ( ) ;
this . decrement _total _notes _count ( ) ;
} else {
// before hiding an editor, save it
2007-10-31 06:41:23 +00:00
if ( this . notebook . read _write && editor . read _write )
2007-10-19 20:24:16 +00:00
this . save _editor ( editor ) ;
editor . shutdown ( ) ;
2007-10-19 20:38:38 +00:00
Highlight ( "all_notes_link" ) ;
2007-10-19 20:24:16 +00:00
}
2007-07-16 20:22:38 +00:00
2007-09-05 18:49:28 +00:00
this . display _empty _message ( ) ;
2007-07-16 20:22:38 +00:00
}
event . stop ( ) ;
}
Wiki . prototype . delete _editor = function ( event , editor ) {
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
if ( ! editor ) {
editor = this . focused _editor ;
this . focused _editor = null ;
}
if ( editor ) {
2007-07-17 01:21:31 +00:00
if ( this . startup _notes [ editor . id ] )
delete this . startup _notes [ editor . id ] ;
2007-07-16 20:22:38 +00:00
2007-08-07 01:48:43 +00:00
this . save _editor ( editor , true ) ;
2007-09-20 22:26:43 +00:00
var self = this ;
2007-10-16 21:37:12 +00:00
if ( this . notebook . read _write && editor . read _write ) {
2007-07-17 01:21:31 +00:00
this . invoker . invoke ( "/notebooks/delete_note" , "POST" , {
2007-07-16 20:22:38 +00:00
"notebook_id" : this . notebook _id ,
2007-07-17 01:21:31 +00:00
"note_id" : editor . id
2007-09-20 22:26:43 +00:00
} , function ( result ) { self . display _storage _usage ( result . storage _bytes ) ; } ) ;
2007-07-16 20:22:38 +00:00
}
if ( editor == this . focused _editor )
this . focused _editor = null ;
2007-10-26 21:01:22 +00:00
if ( this . notebook . trash _id && ! ( editor . id == this . blank _editor _id && editor . empty ( ) ) ) {
2007-08-23 23:56:42 +00:00
var undo _button = createDOM ( "input" , {
"type" : "button" ,
"class" : "message_button" ,
"value" : "undo" ,
"title" : "undo deletion"
} ) ;
2007-09-05 07:34:59 +00:00
var trash _link = createDOM ( "a" , {
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
"href" : "/notebooks/" + this . notebook . trash _id + "?parent_id=" + this . notebook . object _id
2007-09-05 07:34:59 +00:00
} , "trash" ) ;
2007-11-09 06:49:26 +00:00
var message _div = this . display _message ( "The note has been moved to the" , [ trash _link , ". " , undo _button ] , editor . iframe ) ;
2007-08-23 23:56:42 +00:00
var self = this ;
2007-11-09 06:49:26 +00:00
connect ( undo _button , "onclick" , function ( event ) { self . undelete _editor _via _undo ( event , editor , message _div ) ; } ) ;
2007-08-23 23:56:42 +00:00
}
2007-07-16 20:22:38 +00:00
2007-10-22 20:52:04 +00:00
this . remove _all _notes _link ( editor . id ) ;
2007-08-23 23:56:42 +00:00
editor . shutdown ( ) ;
2007-10-19 20:24:16 +00:00
this . decrement _total _notes _count ( ) ;
2007-09-05 18:49:28 +00:00
this . display _empty _message ( ) ;
2007-08-07 01:48:43 +00:00
}
event . stop ( ) ;
}
Wiki . prototype . undelete _editor _via _trash = function ( event , editor ) {
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
if ( ! editor ) {
editor = this . focused _editor ;
this . focused _editor = null ;
}
if ( editor ) {
if ( this . startup _notes [ editor . id ] )
delete this . startup _notes [ editor . id ] ;
this . save _editor ( editor , true ) ;
2007-10-16 21:37:12 +00:00
if ( this . notebook . read _write && editor . read _write ) {
2007-09-20 22:26:43 +00:00
var self = this ;
2007-08-07 01:48:43 +00:00
this . invoker . invoke ( "/notebooks/undelete_note" , "POST" , {
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
"notebook_id" : editor . deleted _from _id ,
2007-08-07 01:48:43 +00:00
"note_id" : editor . id
2007-09-20 22:26:43 +00:00
} , function ( result ) { self . display _storage _usage ( result . storage _bytes ) ; } ) ;
2007-08-07 01:48:43 +00:00
}
if ( editor == this . focused _editor )
this . focused _editor = null ;
2007-10-22 20:52:04 +00:00
this . remove _all _notes _link ( editor . id ) ;
2007-08-07 01:48:43 +00:00
editor . shutdown ( ) ;
2007-10-19 20:24:16 +00:00
this . decrement _total _notes _count ( ) ;
2007-09-05 18:49:28 +00:00
this . display _empty _message ( ) ;
2007-08-07 01:48:43 +00:00
}
event . stop ( ) ;
}
2007-11-09 06:49:26 +00:00
Wiki . prototype . undelete _editor _via _undo = function ( event , editor , position _after ) {
2007-08-07 01:48:43 +00:00
if ( editor ) {
2007-10-16 21:37:12 +00:00
if ( this . notebook . read _write && editor . read _write ) {
2007-09-20 22:26:43 +00:00
var self = this ;
2007-08-07 01:48:43 +00:00
this . invoker . invoke ( "/notebooks/undelete_note" , "POST" , {
"notebook_id" : this . notebook _id ,
"note_id" : editor . id
2007-09-20 22:26:43 +00:00
} , function ( result ) { self . display _storage _usage ( result . storage _bytes ) ; } ) ;
2007-08-07 01:48:43 +00:00
}
2007-08-10 19:19:47 +00:00
this . startup _notes [ editor . id ] = true ;
2007-10-19 20:24:16 +00:00
this . increment _total _notes _count ( ) ;
2007-11-09 06:49:26 +00:00
this . load _editor ( "Note not found." , editor . id , null , null , position _after ) ;
2007-08-07 01:48:43 +00:00
}
2007-07-16 20:22:38 +00:00
event . stop ( ) ;
}
2007-11-09 06:54:45 +00:00
Wiki . prototype . undelete _editor _via _undelete = function ( event , note _id , position _after ) {
2007-10-22 23:17:56 +00:00
if ( this . notebook . read _write ) {
var self = this ;
this . invoker . invoke ( "/notebooks/undelete_note" , "POST" , {
"notebook_id" : this . notebook _id ,
"note_id" : note _id
} , function ( result ) { self . display _storage _usage ( result . storage _bytes ) ; } ) ;
}
this . startup _notes [ note _id ] = true ;
this . increment _total _notes _count ( ) ;
2007-11-09 06:49:26 +00:00
this . load _editor ( "Note not found." , note _id , null , null , position _after ) ;
2007-10-22 23:17:56 +00:00
event . stop ( ) ;
}
2007-11-17 22:55:13 +00:00
Wiki . prototype . undelete _notebook = function ( event , notebook _id ) {
2007-11-17 04:21:48 +00:00
this . invoker . invoke ( "/notebooks/undelete" , "POST" , {
2007-11-17 04:31:19 +00:00
"notebook_id" : notebook _id
2007-11-17 04:21:48 +00:00
} ) ;
event . stop ( ) ;
}
2007-10-22 23:17:56 +00:00
2007-08-23 23:56:42 +00:00
Wiki . prototype . compare _versions = function ( event , editor , previous _revision ) {
this . clear _pulldowns ( ) ;
// display the two revisions for comparison by the user
2007-11-09 06:49:26 +00:00
this . load _editor ( editor . title , editor . id , previous _revision , null , editor . iframe ) ;
this . load _editor ( editor . title , editor . id , null , null , editor . iframe ) ;
2007-08-23 23:56:42 +00:00
}
2007-07-16 20:22:38 +00:00
Wiki . prototype . save _editor = function ( editor , fire _and _forget ) {
if ( ! editor )
editor = this . focused _editor ;
2007-07-26 01:18:41 +00:00
var self = this ;
2007-10-26 21:01:22 +00:00
if ( editor && editor . read _write && ! ( editor . id == this . blank _editor _id && editor . empty ( ) ) ) {
2007-07-17 01:21:31 +00:00
this . invoker . invoke ( "/notebooks/save_note" , "POST" , {
2007-07-16 20:22:38 +00:00
"notebook_id" : this . notebook _id ,
2007-07-17 01:21:31 +00:00
"note_id" : editor . id ,
2007-07-16 20:22:38 +00:00
"contents" : editor . contents ( ) ,
2007-08-23 23:56:42 +00:00
"startup" : editor . startup ,
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
"previous_revision" : editor . revision ? editor . revision : "None"
2007-09-20 22:26:43 +00:00
} , function ( result ) {
self . update _editor _revisions ( result , editor ) ;
self . display _storage _usage ( result . storage _bytes ) ;
} , null , fire _and _forget ) ;
2007-07-26 01:18:41 +00:00
}
}
Wiki . prototype . update _editor _revisions = function ( result , editor ) {
2007-08-23 23:56:42 +00:00
// if there's not a newly saved revision, then the contents are unchanged, so bail
if ( ! result . new _revision )
return ;
2007-07-26 01:18:41 +00:00
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
var client _previous _revision = editor . revision ;
editor . revision = result . new _revision ;
2007-08-23 23:56:42 +00:00
// if the server's idea of the previous revision doesn't match the client's, then someone has
// gone behind our back and saved the editor's note from another window
if ( result . previous _revision != client _previous _revision ) {
var compare _button = createDOM ( "input" , {
"type" : "button" ,
"class" : "message_button" ,
"value" : "compare versions" ,
"title" : "compare your version with the modified version"
} ) ;
2007-11-09 06:49:26 +00:00
this . display _error ( 'Your changes to the note titled "' + editor . title + '" have overwritten changes made in another window.' , [ compare _button ] , editor . iframe ) ;
2007-08-23 23:56:42 +00:00
var self = this ;
connect ( compare _button , "onclick" , function ( event ) {
self . compare _versions ( event , editor , result . previous _revision ) ;
} ) ;
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
if ( ! editor . revisions _list || editor . revisions _list . length == 0 )
return ;
editor . revisions _list . push ( result . previous _revision ) ;
2007-07-16 20:22:38 +00:00
}
2007-08-23 23:56:42 +00:00
// add the new revision to the editor's revisions list
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
if ( ! editor . revisions _list || editor . revisions _list . length == 0 )
return ;
editor . revisions _list . push ( result . new _revision ) ;
2007-07-16 20:22:38 +00:00
}
Wiki . prototype . search = function ( event ) {
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
var self = this ;
2007-08-17 22:26:02 +00:00
this . invoker . invoke ( "/notebooks/search" , "GET" , {
2007-09-28 20:31:20 +00:00
"notebook_id" : this . notebook _id
2007-08-17 22:26:02 +00:00
} ,
2007-09-10 20:04:46 +00:00
function ( result ) { self . display _search _results ( result ) ; } ,
2007-07-16 20:22:38 +00:00
"search_form"
) ;
event . stop ( ) ;
}
2007-09-10 20:04:46 +00:00
Wiki . prototype . display _search _results = function ( result ) {
2007-07-16 20:22:38 +00:00
// if there are no search results, indicate that and bail
2007-09-10 20:04:46 +00:00
if ( ! result || result . notes . length == 0 ) {
2007-11-09 06:49:26 +00:00
this . display _message ( "No matching notes." , undefined , getElement ( "notes_top" ) ) ;
2007-07-16 20:22:38 +00:00
return ;
}
2007-09-10 20:04:46 +00:00
// otherwise, there are multiple search results, so create a "magic" search results note. but
// first close any open search results notes
if ( this . search _results _editor )
this . search _results _editor . shutdown ( ) ;
var list = createDOM ( "span" , { } ) ;
for ( var i in result . notes ) {
var note = result . notes [ i ]
if ( ! note . title ) continue ;
2007-11-02 20:19:53 +00:00
if ( note . contents . length == 0 ) {
2007-11-27 21:28:25 +00:00
var summary = "empty note" ;
2007-09-10 20:04:46 +00:00
} else {
2007-11-27 21:28:25 +00:00
var summary = note . summary ;
2007-11-02 20:19:53 +00:00
2007-11-27 21:28:25 +00:00
// if the summary appears not to end with a complete sentence, add "..."
if ( ! /[?!.]\s*$/ . test ( summary ) )
summary = summary + " <b>...</b>" ;
2007-09-10 20:04:46 +00:00
}
2007-11-27 21:28:25 +00:00
var summary _span = createDOM ( "span" ) ;
summary _span . innerHTML = summary ;
2007-11-02 20:19:53 +00:00
2007-09-10 20:04:46 +00:00
appendChildNodes ( list ,
createDOM ( "p" , { } ,
createDOM ( "a" , { "href" : "/notebooks/" + this . notebook _id + "?note_id=" + note . object _id } , note . title ) ,
createDOM ( "br" ) ,
2007-11-27 21:28:25 +00:00
summary _span
2007-09-10 20:04:46 +00:00
)
) ;
2007-07-16 20:22:38 +00:00
}
2007-09-10 20:04:46 +00:00
2007-11-09 06:49:26 +00:00
this . search _results _editor = this . create _editor ( "search_results" , "<h3>search results</h3>" + list . innerHTML , undefined , undefined , undefined , false , true , true , getElement ( "notes_top" ) ) ;
2007-07-16 20:22:38 +00:00
}
2007-09-04 21:37:48 +00:00
Wiki . prototype . display _all _notes _list = function ( result ) {
2007-10-22 20:52:04 +00:00
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
2007-11-18 23:06:51 +00:00
if ( this . display _empty _message ( true ) == true )
2007-09-04 21:37:48 +00:00
return ;
2007-09-11 19:19:03 +00:00
if ( this . all _notes _editor )
this . all _notes _editor . shutdown ( ) ;
2007-09-04 21:37:48 +00:00
// build up a list of all notes in this notebook, one link per note
2007-10-22 20:52:04 +00:00
var list = createDOM ( "ul" , { "id" : "notes_list" } ) ;
if ( this . focused _editor )
appendChildNodes ( list , this . create _all _notes _link ( this . focused _editor . id , this . focused _editor . title || "untitled note" ) ) ;
2007-09-04 21:37:48 +00:00
for ( var i in result . notes ) {
var note _tuple = result . notes [ i ]
var note _id = note _tuple [ 0 ] ;
var note _title = note _tuple [ 1 ] ;
2007-10-22 20:52:04 +00:00
if ( this . focused _editor && note _id == this . focused _editor . id )
continue ;
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
if ( ! note _title )
note _title = "untitled note" ;
2007-09-04 21:37:48 +00:00
2007-10-22 20:52:04 +00:00
appendChildNodes ( list , this . create _all _notes _link ( note _id , note _title ) ) ;
2007-09-04 21:37:48 +00:00
}
2007-10-22 20:52:04 +00:00
var list _holder = createDOM ( "div" , { } , list ) ;
2007-11-09 06:49:26 +00:00
this . all _notes _editor = this . create _editor ( "all_notes" , "<h3>all notes</h3>" + list _holder . innerHTML , undefined , undefined , undefined , false , true , true , getElement ( "notes_top" ) ) ;
2007-09-04 21:37:48 +00:00
}
2007-11-09 06:49:26 +00:00
Wiki . prototype . display _message = function ( text , nodes , position _after ) {
2007-07-16 20:22:38 +00:00
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
2007-08-07 01:48:43 +00:00
var inner _div = DIV ( { "class" : "message_inner" } , text + " " ) ;
2007-09-05 07:34:59 +00:00
for ( var i in nodes )
appendChildNodes ( inner _div , nodes [ i ] ) ;
2007-08-07 01:48:43 +00:00
2007-09-20 23:25:59 +00:00
ok _button = createDOM ( "input" , {
"type" : "button" ,
"class" : "message_button" ,
"value" : "ok" ,
2007-09-20 23:34:34 +00:00
"title" : "dismiss this message"
2007-09-20 23:25:59 +00:00
} ) ;
appendChildNodes ( inner _div , ok _button ) ;
connect ( ok _button , "onclick" , this . clear _messages ) ;
2007-07-16 20:22:38 +00:00
var div = DIV ( { "class" : "message" } , inner _div ) ;
2007-09-05 07:34:59 +00:00
div . nodes = nodes ;
2007-08-07 01:48:43 +00:00
2007-11-09 06:49:26 +00:00
if ( position _after )
insertSiblingNodesAfter ( position _after , div )
else if ( this . focused _editor )
insertSiblingNodesAfter ( this . focused _editor . iframe , div )
else
appendChildNodes ( "notes" , div ) ;
return div ;
2007-08-07 01:48:43 +00:00
}
2007-11-09 06:49:26 +00:00
Wiki . prototype . display _error = function ( text , nodes , position _after ) {
2007-08-07 01:48:43 +00:00
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
2007-08-21 21:25:59 +00:00
// remove all empty editors, some of which might exist due to a problem reaching the server
var iframes = getElementsByTagAndClassName ( "iframe" , "note_frame" ) ;
for ( var i in iframes ) {
var editor = iframes [ i ] . editor ;
if ( editor . empty ( ) )
editor . shutdown ( ) ;
}
2007-08-23 23:56:42 +00:00
var inner _div = DIV ( { "class" : "error_inner" } , text + " " ) ;
2007-09-05 07:34:59 +00:00
for ( var i in nodes )
appendChildNodes ( inner _div , nodes [ i ] ) ;
2007-08-23 23:56:42 +00:00
2007-09-20 23:25:59 +00:00
ok _button = createDOM ( "input" , {
"type" : "button" ,
"class" : "message_button" ,
"value" : "ok" ,
2007-09-20 23:34:34 +00:00
"title" : "dismiss this message"
2007-09-20 23:25:59 +00:00
} ) ;
appendChildNodes ( inner _div , ok _button ) ;
connect ( ok _button , "onclick" , this . clear _messages ) ;
2007-08-07 01:48:43 +00:00
var div = DIV ( { "class" : "error" } , inner _div ) ;
2007-09-05 07:34:59 +00:00
div . nodes = nodes ;
2007-08-23 23:56:42 +00:00
2007-11-09 06:49:26 +00:00
if ( position _after )
insertSiblingNodesAfter ( position _after , div )
else if ( this . focused _editor )
insertSiblingNodesAfter ( this . focused _editor . iframe , div )
else
appendChildNodes ( "notes" , div ) ;
return div ;
2007-07-16 20:22:38 +00:00
}
Wiki . prototype . clear _messages = function ( ) {
var results = getElementsByTagAndClassName ( "div" , "message" ) ;
2007-08-07 01:48:43 +00:00
for ( var i in results ) {
var result = results [ i ] ;
blindUp ( result , options = { "duration" : 0.5 , afterFinish : function ( ) {
try {
2007-09-05 07:34:59 +00:00
for ( var j in result . nodes )
disconnectAll ( result . nodes [ j ] ) ;
2007-08-07 01:48:43 +00:00
removeElement ( result ) ;
} catch ( e ) { }
} } ) ;
}
2007-11-12 10:48:37 +00:00
var results = getElementsByTagAndClassName ( "div" , "error" ) ;
for ( var i in results ) {
var result = results [ i ] ;
blindUp ( result , options = { "duration" : 0.5 , afterFinish : function ( ) {
try {
removeElement ( result ) ;
} catch ( e ) { }
} } ) ;
}
2007-07-16 20:22:38 +00:00
}
Wiki . prototype . clear _pulldowns = function ( ) {
var results = getElementsByTagAndClassName ( "div" , "pulldown" ) ;
for ( var i in results ) {
var result = results [ i ] ;
2007-08-30 20:17:10 +00:00
// close the pulldown if it's been open at least a quarter second
if ( new Date ( ) - result . pulldown . init _time >= 250 )
result . pulldown . shutdown ( ) ;
2007-07-16 20:22:38 +00:00
}
}
2007-09-01 21:06:37 +00:00
Wiki . prototype . delete _all _editors = function ( event ) {
this . clear _messages ( ) ;
this . clear _pulldowns ( ) ;
this . startup _notes = new Array ( ) ;
2007-10-16 21:37:12 +00:00
if ( this . notebook . read _write ) {
2007-09-20 22:26:43 +00:00
var self = this ;
2007-09-01 21:06:37 +00:00
this . invoker . invoke ( "/notebooks/delete_all_notes" , "POST" , {
"notebook_id" : this . notebook _id
2007-09-20 22:26:43 +00:00
} , function ( result ) { self . display _storage _usage ( result . storage _bytes ) ; } ) ;
2007-09-01 21:06:37 +00:00
}
this . focused _editor = null ;
var iframes = getElementsByTagAndClassName ( "iframe" , "note_frame" ) ;
for ( var i in iframes ) {
var editor = iframes [ i ] . editor ;
editor . shutdown ( ) ;
}
2007-10-19 20:24:16 +00:00
this . zero _total _notes _count ( ) ;
2007-11-18 23:06:51 +00:00
this . display _empty _message ( true ) ;
2007-09-01 21:06:37 +00:00
event . stop ( ) ;
}
2007-11-18 23:06:51 +00:00
Wiki . prototype . display _empty _message = function ( replace _messages ) {
2007-09-05 18:49:28 +00:00
var iframes = getElementsByTagAndClassName ( "iframe" , "note_frame" ) ;
2007-11-18 23:06:51 +00:00
if ( ! replace _messages ) {
// if there are any messages already open, bail
var messages = getElementsByTagAndClassName ( "div" , "message" ) ;
if ( messages . length > 0 ) return false ;
2007-11-15 22:40:16 +00:00
2007-11-18 23:06:51 +00:00
// if there are any errors open, bail
var errors = getElementsByTagAndClassName ( "div" , "error" ) ;
if ( errors . length > 0 ) return false ;
}
2007-11-15 22:40:16 +00:00
2007-09-05 18:49:28 +00:00
// if there are any open editors, bail
for ( var i in iframes ) {
var iframe = iframes [ i ] ;
if ( iframe . editor . closed == false )
2007-11-15 22:40:16 +00:00
return false ;
2007-09-05 18:49:28 +00:00
}
2007-11-15 22:40:16 +00:00
if ( ! this . total _notes _count ) {
if ( this . parent _id )
2007-11-17 22:55:13 +00:00
this . display _message ( "There are no notes in the trash." )
2007-11-15 22:40:16 +00:00
else
this . display _message ( "This notebook is empty." ) ;
return true ;
}
return false ;
2007-09-05 18:49:28 +00:00
}
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
DATE _PATTERN = /(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d).(\d+)[+-](\d\d:?\d\d)/ ;
2007-07-31 22:53:57 +00:00
Wiki . prototype . brief _revision = function ( revision ) {
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
var matches = DATE _PATTERN . exec ( revision ) ;
return new Date ( Date . UTC (
matches [ 1 ] , // year
matches [ 2 ] - 1 , // month (zero-based)
matches [ 3 ] , // day
matches [ 4 ] , // hour
matches [ 5 ] , // minute
matches [ 6 ] , // second
matches [ 7 ] * 0.001 // milliseconds
) ) . toLocaleString ( ) ;
2007-10-19 20:24:16 +00:00
}
Wiki . prototype . increment _total _notes _count = function ( ) {
2007-11-15 22:40:16 +00:00
if ( this . total _notes _count == null ) return ;
this . total _notes _count += 1 ;
replaceChildNodes ( "total_notes_count" , this . total _notes _count ) ;
2007-10-19 20:24:16 +00:00
}
Wiki . prototype . decrement _total _notes _count = function ( ) {
2007-11-15 22:40:16 +00:00
if ( this . total _notes _count == null ) return ;
this . total _notes _count -= 1 ;
replaceChildNodes ( "total_notes_count" , this . total _notes _count ) ;
2007-10-19 20:24:16 +00:00
}
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
2007-10-19 20:24:16 +00:00
Wiki . prototype . zero _total _notes _count = function ( ) {
2007-11-15 22:40:16 +00:00
if ( this . total _notes _count == null ) return ;
this . total _notes _count = 0 ;
replaceChildNodes ( "total_notes_count" , this . total _notes _count ) ;
2007-07-31 22:53:57 +00:00
}
2007-10-22 20:52:04 +00:00
Wiki . prototype . remove _all _notes _link = function ( note _id ) {
if ( ! this . all _notes _editor ) return ;
withDocument ( this . all _notes _editor . document , function ( ) {
var note _link = getElement ( "note_link_" + note _id ) ;
if ( note _link )
removeElement ( note _link ) ;
} ) ;
this . all _notes _editor . resize ( ) ;
}
Wiki . prototype . add _all _notes _link = function ( note _id , note _title ) {
if ( ! this . all _notes _editor ) return ;
2007-10-22 20:57:26 +00:00
if ( note _title == "all notes" || note _title == "search results" ) return ;
2007-10-22 20:52:04 +00:00
if ( ! note _title || note _title . length == 0 )
note _title = "untitled note" ;
var self = this ;
withDocument ( this . all _notes _editor . document , function ( ) {
// if the note link already exists, update its title and bail
var note _link = getElement ( "note_link_" + note _id ) ;
if ( note _link ) {
replaceChildNodes ( note _link . firstChild , note _title ) ;
self . all _notes _editor . resize ( ) ;
return ;
}
var notes _list = getElement ( "notes_list" ) ;
if ( ! notes _list ) return ;
var first _note _link = notes _list . firstChild ;
var new _note _link = self . create _all _notes _link ( note _id , note _title ) ;
if ( first _note _link )
insertSiblingNodesBefore ( first _note _link , new _note _link ) ;
else
appendChildNodes ( notes _list , new _note _link ) ;
} ) ;
this . all _notes _editor . resize ( ) ;
}
Wiki . prototype . create _all _notes _link = function ( note _id , note _title ) {
return createDOM ( "li" , { "id" : "note_link_" + note _id } ,
createDOM ( "a" , { "href" : "/notebooks/" + this . notebook _id + "?note_id=" + note _id } , note _title )
) ;
}
2007-11-15 01:30:45 +00:00
Wiki . prototype . start _notebook _rename = function ( ) {
this . clear _pulldowns ( ) ;
// if a renaming is already in progress, end the renaming instead of starting one
var notebook _name _field = getElement ( "notebook_name_field" ) ;
if ( notebook _name _field ) {
this . end _notebook _rename ( ) ;
return ;
}
notebook _name _field = createDOM (
"input" , {
"type" : "text" ,
"value" : this . notebook . name ,
"id" : "notebook_name_field" ,
"name" : "notebook_name_field" ,
"size" : "30" ,
"maxlength" : "100" ,
"class" : "text_field"
}
) ;
var ok _button = createDOM (
"input" , {
"type" : "button" ,
"class" : "message_button" ,
"value" : "ok" ,
"title" : "dismiss this message"
}
) ;
var rename _form = createDOM (
"form" , { "id" : "rename_form" } , notebook _name _field , ok _button
) ;
replaceChildNodes ( "notebook_header_area" , rename _form ) ;
var self = this ;
connect ( rename _form , "onsubmit" , function ( event ) {
self . end _notebook _rename ( ) ;
event . stop ( ) ;
} ) ;
connect ( ok _button , "onclick" , function ( event ) {
self . end _notebook _rename ( ) ;
event . stop ( ) ;
} ) ;
notebook _name _field . focus ( ) ;
notebook _name _field . select ( ) ;
}
Wiki . prototype . end _notebook _rename = function ( ) {
var new _notebook _name = getElement ( "notebook_name_field" ) . value ;
// if the new name is blank or reserved, don't actually rename the notebook
if ( /^\s*$/ . test ( new _notebook _name ) )
new _notebook _name = this . notebook . name ;
2007-11-15 22:55:57 +00:00
if ( /^\s*Luminotes/ . test ( new _notebook _name ) || /^\s*trash\s*$/ . test ( new _notebook _name ) ) {
2007-11-15 01:30:45 +00:00
new _notebook _name = this . notebook . name ;
this . display _error ( "That notebook name is not available. Please try a different one." ) ;
}
// rename the notebook in the header
var notebook _header _name = createDOM (
"span" ,
{ "id" : "notebook_header_name" } ,
createDOM ( "strong" , { } , new _notebook _name )
) ;
replaceChildNodes ( "notebook_header_area" , notebook _header _name ) ;
var self = this ;
connect ( notebook _header _name , "onclick" , function ( event ) {
self . start _notebook _rename ( ) ;
event . stop ( ) ;
} ) ;
// rename the notebook link on the right side of the page
replaceChildNodes (
"notebook_" + this . notebook . object _id ,
document . createTextNode ( new _notebook _name )
) ;
// if the name has changed, then send the new name to the server
if ( new _notebook _name == this . notebook . name )
return ;
this . notebook . name = new _notebook _name ;
this . invoker . invoke ( "/notebooks/rename" , "POST" , {
"notebook_id" : this . notebook _id ,
"name" : new _notebook _name
} ) ;
}
2007-11-17 04:21:48 +00:00
Wiki . prototype . delete _notebook = function ( ) {
2007-11-17 04:39:33 +00:00
if ( this . focused _editor )
this . save _editor ( this . focused _editor , true ) ;
2007-11-17 04:21:48 +00:00
this . invoker . invoke ( "/notebooks/delete" , "POST" , {
2007-11-17 04:31:19 +00:00
"notebook_id" : this . notebook _id
2007-11-17 04:21:48 +00:00
} ) ;
}
2007-11-17 22:55:13 +00:00
Wiki . prototype . delete _notebook _forever = function ( event , notebook _id ) {
var deleted _notebook _node = getElement ( "deleted_notebook_" + notebook _id ) ;
if ( ! deleted _notebook _node ) return ;
for ( var i in deleted _notebook _node . childNodes ) {
var child = deleted _notebook _node . childNodes [ i ] ;
disconnectAll ( child ) ;
}
removeElement ( deleted _notebook _node ) ;
2007-11-17 23:29:22 +00:00
var items = getElementsByTagAndClassName ( "div" , "deleted_notebook_item" ) ;
if ( items . length == 0 )
removeElement ( "deleted_notebooks" ) ;
2007-11-19 22:03:04 +00:00
var self = this ;
2007-11-17 23:29:22 +00:00
this . invoker . invoke ( "/notebooks/delete_forever" , "POST" , {
2007-11-17 22:55:13 +00:00
"notebook_id" : notebook _id
2007-11-19 22:03:04 +00:00
} , function ( result ) { self . display _storage _usage ( result . storage _bytes ) ; } ) ;
2007-11-17 22:55:13 +00:00
event . stop ( ) ;
}
2007-07-26 01:18:41 +00:00
Wiki . prototype . toggle _editor _changes = function ( event , editor ) {
// if the pulldown is already open, then just close it
var pulldown _id = "changes_" + editor . id ;
var existing _div = getElement ( pulldown _id ) ;
if ( existing _div ) {
existing _div . pulldown . shutdown ( ) ;
return ;
}
event . stop ( ) ;
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
2007-10-11 11:29:42 +00:00
// if there's already a cached revision list, or the editor doesn't have a revision yet, then
// display the changes pulldown and bail
if ( ( editor . revisions _list && editor . revisions _list . length > 0 ) || ! editor . revision ) {
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
new Changes _pulldown ( this , this . notebook _id , this . invoker , editor ) ;
return ;
}
// otherwise, load the revision list for this note from the server
var self = this ;
this . invoker . invoke (
"/notebooks/load_note_revisions" , "GET" , {
"notebook_id" : this . notebook _id ,
"note_id" : editor . id
} ,
function ( result ) {
editor . revisions _list = result . revisions ;
new Changes _pulldown ( self , self . notebook _id , self . invoker , editor ) ;
}
) ;
2007-07-26 01:18:41 +00:00
}
2007-07-16 20:22:38 +00:00
Wiki . prototype . toggle _editor _options = function ( event , editor ) {
// if the pulldown is already open, then just close it
2007-07-20 22:41:20 +00:00
var pulldown _id = "options_" + editor . id ;
var existing _div = getElement ( pulldown _id ) ;
2007-07-16 20:22:38 +00:00
if ( existing _div ) {
existing _div . pulldown . shutdown ( ) ;
return ;
}
2007-07-31 22:53:57 +00:00
new Options _pulldown ( this , this . notebook _id , this . invoker , editor ) ;
2007-07-20 22:41:20 +00:00
event . stop ( ) ;
}
2007-09-06 21:36:39 +00:00
connect ( window , "onload" , function ( event ) { new Wiki ( new Invoker ( ) ) ; } ) ;
2007-07-20 22:41:20 +00:00
2007-08-14 04:13:49 +00:00
function Pulldown ( wiki , notebook _id , pulldown _id , anchor , relative _to ) {
2007-07-31 22:53:57 +00:00
this . wiki = wiki ;
2007-07-16 20:22:38 +00:00
this . notebook _id = notebook _id ;
2007-07-20 22:41:20 +00:00
this . div = createDOM ( "div" , { "id" : pulldown _id , "class" : "pulldown" } ) ;
2007-07-16 20:22:38 +00:00
this . div . pulldown = this ;
2007-08-30 20:17:10 +00:00
this . init _time = new Date ( ) ;
2007-08-14 04:13:49 +00:00
this . anchor = anchor ;
this . relative _to = relative _to ;
2007-07-16 20:22:38 +00:00
addElementClass ( this . div , "invisible" ) ;
appendChildNodes ( document . body , this . div ) ;
2007-08-14 04:13:49 +00:00
var position = calculate _position ( anchor , relative _to ) ;
2007-07-16 20:22:38 +00:00
setElementPosition ( this . div , position ) ;
removeElementClass ( this . div , "invisible" ) ;
2007-08-14 04:13:49 +00:00
}
function calculate _position ( anchor , relative _to ) {
// position the pulldown under the anchor
var position = getElementPosition ( anchor ) ;
if ( relative _to ) {
var relative _pos = getElementPosition ( relative _to ) ;
if ( relative _pos ) {
position . x += relative _pos . x ;
position . y += relative _pos . y ;
2007-08-15 20:35:02 +00:00
// Work around an IE "feature" in which an element within an iframe changes its absolute
// position based on how far the page is scrolled. The if is necessary to prevent this
// workaround from screwing positions up in sane browsers like Firefox.
if ( getStyle ( "content" , "position" ) == "absolute" )
position . y -= getElement ( "html" ) . scrollTop ;
2007-08-14 04:13:49 +00:00
}
}
var anchor _dimensions = getElementDimensions ( anchor ) ;
2007-08-15 20:35:02 +00:00
// if the anchor has no height, move the position down a bit by an arbitrary amount
2007-08-14 04:13:49 +00:00
if ( anchor _dimensions . h == 0 )
position . y += 8 ;
else
position . y += anchor _dimensions . h + 4 ;
return position ;
}
Pulldown . prototype . update _position = function ( ) {
var position = calculate _position ( this . anchor , this . relative _to ) ;
setElementPosition ( this . div , position ) ;
}
2007-07-16 20:22:38 +00:00
2007-07-20 22:41:20 +00:00
Pulldown . prototype . shutdown = function ( ) {
removeElement ( this . div ) ;
}
2007-07-31 22:53:57 +00:00
function Options _pulldown ( wiki , notebook _id , invoker , editor ) {
Pulldown . call ( this , wiki , notebook _id , "options_" + editor . id , editor . options _button ) ;
2007-07-20 22:41:20 +00:00
this . invoker = invoker ;
this . editor = editor ;
2007-07-26 01:18:41 +00:00
this . startup _checkbox = createDOM ( "input" , { "type" : "checkbox" , "class" : "pulldown_checkbox" } ) ;
2007-08-20 20:02:42 +00:00
this . startup _toggle = createDOM ( "a" , { "href" : "" , "class" : "pulldown_link" , "title" : "Display this note whenever the notebook is loaded." } ,
2007-07-20 22:41:20 +00:00
"show on startup"
) ;
2007-07-26 01:18:41 +00:00
appendChildNodes ( this . div , this . startup _checkbox ) ;
2007-07-20 22:41:20 +00:00
appendChildNodes ( this . div , this . startup _toggle ) ;
this . startup _checkbox . checked = editor . startup ;
var self = this ;
2007-07-26 01:18:41 +00:00
connect ( this . startup _checkbox , "onclick" , function ( event ) { self . startup _clicked ( event ) ; } ) ;
2007-07-20 22:41:20 +00:00
connect ( this . startup _toggle , "onclick" , function ( event ) { self . startup _clicked ( event ) ; event . stop ( ) ; } ) ;
}
2007-08-20 19:51:02 +00:00
Options _pulldown . prototype = new function ( ) { this . prototype = Pulldown . prototype ; } ;
2007-07-20 22:41:20 +00:00
Options _pulldown . prototype . constructor = Options _pulldown ;
Options _pulldown . prototype . startup _clicked = function ( event ) {
2007-07-16 20:22:38 +00:00
if ( event . target ( ) != this . startup _checkbox )
this . startup _checkbox . checked = this . startup _checkbox . checked ? false : true ;
this . editor . startup = this . startup _checkbox . checked ;
2007-07-31 22:53:57 +00:00
// save this note along with its toggled startup state
this . wiki . save _editor ( this . editor ) ;
2007-07-16 20:22:38 +00:00
}
2007-07-20 22:41:20 +00:00
Options _pulldown . prototype . shutdown = function ( ) {
Pulldown . prototype . shutdown . call ( this ) ;
2007-07-31 22:53:57 +00:00
disconnectAll ( this . startup _checkbox ) ;
2007-07-16 20:22:38 +00:00
disconnectAll ( this . startup _toggle ) ;
}
2007-07-26 01:18:41 +00:00
2007-07-31 22:53:57 +00:00
function Changes _pulldown ( wiki , notebook _id , invoker , editor ) {
Pulldown . call ( this , wiki , notebook _id , "changes_" + editor . id , editor . changes _button ) ;
2007-07-26 01:18:41 +00:00
this . invoker = invoker ;
this . editor = editor ;
2007-07-31 22:53:57 +00:00
this . links = new Array ( ) ;
2007-07-26 01:18:41 +00:00
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
if ( ! editor . revisions _list || editor . revisions _list . length == 0 ) {
2007-07-26 01:18:41 +00:00
appendChildNodes ( this . div , createDOM ( "span" , "This note has no previous changes." ) ) ;
return ;
}
Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres
................
r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-401" from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines
Beginning a conversion from bsddb to postgres.
................
r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines
Merged revisions 402-404 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
........
r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Yay, no more stupid deprecation warnings from simplejson about the sre module.
........
................
r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines
* Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
* Began removal of all references to Scheduler, @async, yield, and so on.
* Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines
All unit tests for the new model classes now pass.
................
r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines
Reordering some columns and adding some indices.
................
r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines
Now adding trash notebooks to user_notebook table. Also switching db
conversion/verification tools back to require Python 2.5, since they still use
the old Scheduler, which requires 2.5 generator features.
................
r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines
Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines
controller.Users unit tests now finally pass!
................
r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines
Got controller.Root unit tests passing.
Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines
All unit tests pass! Fuck yeah!
................
r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines
Removing all references to Scheduler from luminotes.py
................
r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines
Converted deleted_from to deleted_from_id in a few more places.
Fixed bug in Users.contents().
................
r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines
Typo fix in Note sql method.
Adding autocommit flag to Database.next_id() method.
................
r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines
Updating unit test for new auto commit flag.
................
r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines
Removing debugging print.
................
r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines
More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines
Fixed controller.Database handling of tuple as an Object_type.
Made SQL for user storage calculation better at handling null values and also more succinct.
................
r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines
Converting Wiki.js to trash_id notebook member instead of trash object.
................
r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines
Notebooks.contents() now returns notebooks with correct read-write status.
................
r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines
Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines
No longer redirecting to trash notebook upon login.
................
r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines
Made controller.Database use a connection pool.
................
r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines
Converted initdb.py and updatedb.py to Postgres from bsddb.
................
r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines
Changing error message to remove underscores from variable names.
................
r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines
Removing unused note_title parameter from Wiki.create_editor().
................
r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines
Revision regular expression now supports timezone notation.
................
r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines
Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines
More strict access checking. Fixed oversight in Postgres DB conversion where,
in certain controller.Notebook methods, access was only checked at the
notebook level, not at the note level as well.
................
r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines
Now loading revisions on demand from client when the "changes" button is clicked. Also caching
loading revisions so subsequent clicks don't have to reload.
................
r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines
Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines
The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines
Updated install instructuctions to include use of initdb.py.
................
r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines
Made initdb.py only nuke (drop tables/views) when given a command-line flag.
Also made install directions more correct.
................
r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines
IE 6 doesn't like commas.
................
r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines
load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
something in it
................
r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines
Forgot to actually save off the new revision as editor.revision.
................
r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines
More intelligent datetime handling:
* convertdb.py assumes old bsddb database timestamps are Pacific, and then
converts them to UTC before inserting them into the new PostgreSQL
database.
* No longer using naked timezoneless datetime objects in model/controller
code, except in unit tests that need compatability with pysqlite. Now
using UTC everwhere.
* Asking PostgreSQL to give us all timestamps back in UTC.
* New dependency on python-tz (pytz) package, noted in INSTALL doc.
* Client now responsible for converting UTC timestamps to local time for
display.
................
r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines
Tweak to prevent potential race in IE.
................
r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Got JavaScript "unit" tests passing again.
................
r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines
Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
// display list of revision timestamps in reverse chronological order
var revisions _list = clone ( editor . revisions _list ) ;
2007-07-26 01:18:41 +00:00
revisions _list . reverse ( ) ;
2007-07-31 22:53:57 +00:00
var self = this ;
2007-10-16 21:37:12 +00:00
for ( var i = 0 ; i < revisions _list . length - 1 ; ++ i ) { // -1 to skip the oldest revision
2007-07-26 01:18:41 +00:00
var revision = revisions _list [ i ] ;
2007-07-31 22:53:57 +00:00
var short _revision = this . wiki . brief _revision ( revision ) ;
2007-07-26 01:18:41 +00:00
var href = "/notebooks/" + this . notebook _id + "?" + queryString (
[ "note_id" , "revision" ] ,
[ this . editor . id , revision ]
) ;
2007-07-31 22:53:57 +00:00
var link = createDOM ( "a" , { "href" : href , "class" : "pulldown_link" } , short _revision ) ;
this . links . push ( link ) ;
link . revision = revision ;
connect ( link , "onclick" , function ( event ) { self . link _clicked ( event , self . editor . id ) ; } ) ;
appendChildNodes ( this . div , link ) ;
2007-07-26 01:18:41 +00:00
appendChildNodes ( this . div , createDOM ( "br" ) ) ;
}
}
2007-08-20 19:51:02 +00:00
Changes _pulldown . prototype = new function ( ) { this . prototype = Pulldown . prototype ; } ;
2007-07-26 01:18:41 +00:00
Changes _pulldown . prototype . constructor = Changes _pulldown ;
2007-07-31 22:53:57 +00:00
Changes _pulldown . prototype . link _clicked = function ( event , note _id ) {
var revision = event . target ( ) . revision ;
2007-11-09 06:49:26 +00:00
this . wiki . load _editor ( "Revision not found." , note _id , revision , null , this . editor . iframe ) ;
2007-07-31 22:53:57 +00:00
event . stop ( ) ;
}
2007-08-14 04:13:49 +00:00
Changes _pulldown . prototype . shutdown = function ( ) {
2007-07-31 22:53:57 +00:00
Pulldown . prototype . shutdown . call ( this ) ;
for ( var i in this . links )
disconnectAll ( this . links [ i ] ) ;
}
2007-08-14 04:13:49 +00:00
function Link _pulldown ( wiki , notebook _id , invoker , editor , link ) {
2007-08-16 01:29:18 +00:00
link . pulldown = this ;
2007-08-14 04:13:49 +00:00
this . link = link ;
Pulldown . call ( this , wiki , notebook _id , "link_" + editor . id , link , editor . iframe ) ;
this . invoker = invoker ;
this . editor = editor ;
2007-08-16 22:27:58 +00:00
this . title _field = createDOM ( "input" , { "class" : "text_field" , "size" : "30" , "maxlength" : "256" } ) ;
2007-11-27 21:28:25 +00:00
this . note _summary = createDOM ( "span" , { } ) ;
2007-08-14 04:13:49 +00:00
this . previous _title = "" ;
var self = this ;
connect ( this . title _field , "onclick" , function ( event ) { self . title _field _clicked ( event ) ; } ) ;
2007-08-20 18:43:45 +00:00
connect ( this . title _field , "onfocus" , function ( event ) { self . title _field _focused ( event ) ; } ) ;
2007-08-14 04:13:49 +00:00
connect ( this . title _field , "onchange" , function ( event ) { self . title _field _changed ( event ) ; } ) ;
connect ( this . title _field , "onblur" , function ( event ) { self . title _field _changed ( event ) ; } ) ;
connect ( this . title _field , "onkeydown" , function ( event ) { self . title _field _key _pressed ( event ) ; } ) ;
appendChildNodes ( this . div , createDOM ( "span" , { "class" : "field_label" } , "links to: " ) ) ;
appendChildNodes ( this . div , this . title _field ) ;
2007-11-27 21:28:25 +00:00
appendChildNodes ( this . div , this . note _summary ) ;
2007-08-14 04:13:49 +00:00
2007-08-16 22:27:58 +00:00
// links with targets are considered links to external sites
if ( link . target ) {
2007-09-07 23:03:12 +00:00
this . title _field . value = link . href ;
2007-11-27 21:28:25 +00:00
replaceChildNodes ( this . note _summary , "web link" ) ;
2007-08-16 22:27:58 +00:00
return ;
}
2007-08-14 04:13:49 +00:00
var query = parse _query ( link ) ;
2007-08-15 00:18:30 +00:00
var title = link _title ( link , query ) ;
2007-08-14 04:13:49 +00:00
var id = query . note _id ;
2007-09-07 23:03:12 +00:00
// if the note has no destination note id set, try loading the note from the server by title
2007-08-16 22:27:58 +00:00
if ( ( id == undefined || id == "new" || id == "null" ) && title . length > 0 ) {
2007-09-07 23:03:12 +00:00
if ( title == "all notes" ) {
this . title _field . value = title ;
2007-11-27 21:28:25 +00:00
this . display _summary ( title , "list of all notes in this notebook" ) ;
2007-09-07 23:03:12 +00:00
return ;
}
2007-09-10 20:04:46 +00:00
if ( title == "search results" ) {
this . title _field . value = title ;
2007-11-27 21:28:25 +00:00
this . display _summary ( title , "current search results" ) ;
2007-09-10 20:04:46 +00:00
return ;
}
2007-08-16 20:11:01 +00:00
this . invoker . invoke (
"/notebooks/load_note_by_title" , "GET" , {
"notebook_id" : this . notebook _id ,
2007-11-27 21:28:25 +00:00
"note_title" : title ,
"summarize" : true
2007-08-16 20:11:01 +00:00
} ,
function ( result ) {
2007-10-22 21:44:17 +00:00
// if the user has already started typing something, don't overwrite it
if ( self . title _field . value . length != 0 )
return ;
2007-08-16 20:11:01 +00:00
if ( result . note ) {
self . title _field . value = result . note . title ;
2007-11-27 21:28:25 +00:00
self . display _summary ( result . note . title , result . note . summary ) ;
2007-08-16 20:11:01 +00:00
} else {
self . title _field . value = title ;
2007-11-27 21:28:25 +00:00
replaceChildNodes ( self . note _summary , "empty note" ) ;
2007-08-16 20:11:01 +00:00
}
}
) ;
2007-08-14 04:13:49 +00:00
return ;
}
2007-08-14 20:34:31 +00:00
// if this link has an actual destination note id set, then see if that note is already open. if
2007-11-27 21:28:25 +00:00
// so, display its title and a summary of its contents
2007-08-14 20:34:31 +00:00
var iframe = getElement ( "note_" + id ) ;
if ( iframe ) {
2007-08-16 01:29:18 +00:00
this . title _field . value = iframe . editor . title ;
2007-11-27 21:28:25 +00:00
this . display _summary ( iframe . editor . title , iframe . editor . summarize ( ) ) ;
2007-08-14 20:34:31 +00:00
return ;
}
2007-11-27 21:28:25 +00:00
// otherwise, load the destination note from the server, displaying its title and a summary of
2007-08-14 20:34:31 +00:00
// its contents
2007-08-14 04:13:49 +00:00
this . invoker . invoke (
"/notebooks/load_note" , "GET" , {
"notebook_id" : this . notebook _id ,
2007-11-27 21:28:25 +00:00
"note_id" : id ,
"summarize" : true
2007-08-14 04:13:49 +00:00
} ,
function ( result ) {
2007-10-22 21:44:17 +00:00
// if the user has already started typing something, don't overwrite it
if ( self . title _field . value . length != 0 )
return ;
2007-08-14 04:13:49 +00:00
if ( result . note ) {
self . title _field . value = result . note . title ;
2007-11-27 21:28:25 +00:00
self . display _summary ( result . note . title , result . note . summary ) ;
2007-08-14 04:13:49 +00:00
} else {
2007-08-15 00:18:30 +00:00
self . title _field . value = title ;
2007-11-27 21:28:25 +00:00
replaceChildNodes ( self . note _summary , "empty note" ) ;
2007-08-14 04:13:49 +00:00
}
}
) ;
}
2007-08-20 19:51:02 +00:00
Link _pulldown . prototype = new function ( ) { this . prototype = Pulldown . prototype ; } ;
2007-08-14 04:13:49 +00:00
Link _pulldown . prototype . constructor = Link _pulldown ;
2007-11-27 21:28:25 +00:00
Link _pulldown . prototype . display _summary = function ( title , summary ) {
if ( ! summary )
replaceChildNodes ( this . note _summary , "empty note" ) ;
else if ( summary . length == 0 )
replaceChildNodes ( this . note _summary , "empty note" ) ;
else
replaceChildNodes ( this . note _summary , summary ) ;
2007-08-14 04:13:49 +00:00
}
Link _pulldown . prototype . title _field _clicked = function ( event ) {
event . stop ( ) ;
}
2007-08-20 18:43:45 +00:00
Link _pulldown . prototype . title _field _focused = function ( event ) {
this . title _field . select ( ) ;
}
2007-08-14 04:13:49 +00:00
Link _pulldown . prototype . title _field _changed = function ( event ) {
// if the title is actually unchanged, then bail
if ( this . title _field . value == this . previous _title )
return ;
2007-11-27 21:28:25 +00:00
replaceChildNodes ( this . note _summary , "" ) ;
2007-08-15 00:18:30 +00:00
var title = strip ( this . title _field . value ) ;
this . previous _title = title ;
2007-08-14 04:13:49 +00:00
2007-08-16 01:29:18 +00:00
var self = this ;
2007-11-27 21:28:25 +00:00
this . wiki . resolve _link ( title , this . link , function ( summary ) {
self . display _summary ( title , summary ) ;
2007-08-16 01:29:18 +00:00
} ) ;
2007-08-14 04:13:49 +00:00
}
Link _pulldown . prototype . title _field _key _pressed = function ( event ) {
// if enter is pressed, consider the title field altered. this is necessary because IE neglects
// to issue an onchange event when enter is pressed in an input field
if ( event . key ( ) . code == 13 ) {
this . title _field _changed ( ) ;
event . stop ( ) ;
}
}
Link _pulldown . prototype . update _position = function ( anchor , relative _to ) {
Pulldown . prototype . update _position . call ( this , anchor , relative _to ) ;
}
Link _pulldown . prototype . shutdown = function ( ) {
Pulldown . prototype . shutdown . call ( this ) ;
disconnectAll ( this . title _field ) ;
if ( this . link )
2007-08-16 01:29:18 +00:00
this . link . pulldown = null ;
2007-08-14 04:13:49 +00:00
}