82 Commits

Author SHA1 Message Date
Jonathan Bernard
3c3d553768 Bugfix in ts_api:delete_entry/1, bad case clause ordering. 2011-03-10 16:00:46 -06:00
Jonathan Bernard
39c3b83d3f Implemented edit and update for entries.
- Added ts_entry:delete/1 to delete an entry from the database.
- Implemented ts_api:delete_entry/3.
- Added a form to facilitate editing individual entries.
- Moved the small show/hide functions directly into the HTML.
- Wired up the update timeline form.
- Wired up the edit and update entry form.
2011-03-08 18:02:33 -06:00
Jonathan Bernard
1b1e31059b Implemented entry creation, pagination. Some restyling and bugfixes.
- Bug fix in ts_api:list_entries/3. Case statement matching on atoms but
  input is a list (string).
- Bug fix in ts_api:put_entry/3. Was expecting the wrong result from
  ts_entry:new/1.
- Bug fix in ts_entry:list/4. Code crashed when the starting offset was
  greater than the total number of elements. Now returns [].
- Fixed ts_json:encode_datetime/1 and ts_json:decode_datetime/1 to handle
  millisecond values in the datetime string (per ISO standard).
- Broke out ``control-links`` style to a top-level class.
- Added showdown.js, a JS Markdown processor. Not hooked up to anything
  yet but intend to display entry notes with Markdown.
- Added code for entry pagination. Loads the most recent 20 entries and
  loads more upon demand in batches of 20.
- Fixed bug in login routine that kept the user edit fields from being
  pre-populated.
- Rewrote the loadEntries function to double for new entries and loading
  more existing entries.
- Commented displayEntries. Also refactored into displayNewerEntries,
  which pushed new entries on to the top of the stack, and
  displayOlderEntries, which tags them onto the bottom.
- Implemented hidden notes field for new entry input.
- Implemented new entry creation.
- Created a helper function to ISO format a Date object.
- Expanded entry template to show control links (edit, show notes, del).
- Activated the 'load more entries' button.
2011-03-07 16:43:40 -06:00
Jonathan Bernard
c185c8cd81 Deciding on UI for entry list. 2011-03-06 13:46:18 -06:00
Jonathan Bernard
e6fcf736bb Reset configs again, forgot. 2011-03-03 17:11:27 -06:00
Jonathan Bernard
122a3bd1e3 Started implementing entry loading in client side.
- Bug fix in ts_entry:new/1. Msspelled ``atomic``.
- Bug fix in ts_json:record_to_ejson/1. For ``ts_entry`` records, the
  Username and TimelineId elements were not being converted from atoms to list.
- Added the entry template for loaded and created entry elements.
- Added ICanHaz.js (which wraps mustache.js) and underscore.js.
- Implemented a naive version of displayEntries() in ts.js.
- Added debug alerts for error cases in ts.js.
- Styling the new entry elements.
2011-03-03 17:09:13 -06:00
Jonathan Bernard
dfab257a12 Reset the config files. 2011-03-01 18:13:47 -06:00
Jonathan Bernard
348c73a36f Bugfix and documentation.
- Fixed a bug in ts_api:list_timelines/2 and ts_api:list_entries/3, which
  respond only to GET requests but were looking for POST data.
- Added documentation for ts.js.
2011-03-01 18:00:51 -06:00
Jonathan Bernard
efab46f167 Win32-specific configuration. 2011-03-01 08:59:10 -06:00
Jonathan Bernard
439a080f14 Started adding implementation of client-side functionality.
- Changed ts_api:dispatch_user/3 to return information for the user currently,
  authenticated if a valid session id is presented and no username is presented.
- Moved the generic styling of form > * elements to be specific to .bar > form.
- Added jQuery U 1.8.0.
- Created login dialog that will automatically load upon page load if the user
  is not logged in.
- Added styling for jQuery UI login dialog.
- Implemented login functionality on the client page.
- Implemented functionality to load user and timeline records on the client
  side.
2011-03-01 08:23:51 -06:00
Jonathan Bernard
4492f87a39 Added user_summary to api.
Added ts_api:dispatch_app/3
Added ts_api:get_user_summary/2
Fixed compile errors in ts_user.
Added comments.
2011-02-24 07:29:30 -06:00
Jonathan Bernard
1a3c0d5c4e Further updates to page. Small update to internal API.
Internal API update functions now accept partial updates, allowing one to
selectively update only some fields of a particular record.
2011-02-14 17:16:37 -06:00
Jonathan Bernard
ddc12cec64 Further work on web interface. 2011-02-14 09:01:32 -06:00
Jonathan Bernard
19fc37c772 Working on new entry. 2011-02-13 11:38:50 -06:00
Jonathan Bernard
d743635865 Added more JS event handler implementations. 2011-02-12 14:57:29 -06:00
Jonathan Bernard
6197363508 More progress on the application page.
Created and styled the forms for updating user/timeline information.
Wired the hidden forms to links that expose them using jQuery.
2011-02-12 07:48:19 -06:00
Jonathan Bernard
9c645e9a88 Changed the header and link presentation. 2011-02-11 17:09:58 -06:00
Jonathan Bernard
6bdf0ab526 The main app page is starting to take form.
Created stylesheet for page.
Added real content and structure to the app page.
2011-02-11 16:35:11 -06:00
Jonathan Bernard
dcd836ba8e Testing out design ideas. 2011-02-11 08:32:12 -06:00
Jonathan Bernard
afca12ecc9 Started working on the client-side code. 2011-02-10 07:47:35 -06:00
Jonathan Bernard
0642c18a6e Implemented cookie-based authentication to the API.
Created timestamper module to start the application.
Added cookie-based authentication to ts_api.
Added utility methods to ts_api:
    * make_json_400/1 and make_json_400/1
    * make_json_401/1 and make_json_401/2
    * parse_json_body/1 reads a JSON object from a HTTP request body.
Implemented ts_api_session module to manage api user sessions.
Fixed ts_entry:list* methods to be 0-indexed.
Removed the ts_json:ejson_to_record/1 implementation for ts_user records.
    Decided that ts_user records are never trusted from the client,
    manipulation of fields such as pwd, username will be restricted to
    app pages.
Changed the password hashing algorithm. Now uses SHA1(pwd + 256bit salt).
    Want to use bcrypt, investingating cross-platform bcrypt implementation.
Fixed yaws.conf config file.
2011-02-07 08:56:07 -06:00
Jonathan Bernard
5809ed3959 Implementing API 2011-02-05 08:57:34 -06:00
Jonathan Bernard
6e2e0d5f00 Redesigned API URL structure. Updated ts_api to implement this.
Implemented ts_api:list_timelines/2.
Adjusted ts_timeline:list/3 to be 0-indexed.
Changed ts_user password hash to use a random salt + SHA1
Added some skeleton testing code.
2011-02-04 17:19:53 -06:00
Jonathan Bernard
1575e25898 Implemented ts_api:get_user/2, ts_api:put_user/1, and ts_api:post_user/1.
Created a utility function for OK results, ts_api:make_json_200/2
Created ts_common:new/1 and ts_common:update/1 to generalize record creation and update.
Refactored ts_timeline:new/1 and ts_timeline:update/1 to use the ts_common functions.
Implemented ts_json:record_to_ejson/1 and ts_json:ejson_to_record/1 for ts_user records.
Implemented ts_user module.
2011-02-03 17:23:40 -06:00
Jonathan Bernard
6fe9184c8e Continuing work on the API.
The id_counter module now includes the record directly in the source.
Fixed many typos and small syntax errors.
Added ts_api:dispatch_user/2 to handle different HTTP methods.
Added method placeholder stubs to ts_api.
Implemented ts_api:list_entries/3.
Added ts_user record and ts_user module.
Implemented ts_entry:list/4, the more generic guts of the other list functions.
Created ts_entry:list_asc/3 and ts_entry:list_desc/3.
Fixed ts_json:encode_datetime/1.
2011-02-02 16:57:58 -06:00
Jonathan Bernard
098cd4cbb9 Continue to implement the API.
Started implementing ts_api:list_entries/3
Implemented ts_api:get_entry_by_id/4
2011-01-31 10:04:01 -06:00
Jonathan Bernard
309d6915fc Additional parts of the API, DB layer.
Implemented additional API functions:
    * dispatch_timeline/4
    * dispatch_event_by_id/4
    * get_timeline/3
    * put_timeline/3
    * post_timeline/3
    * make_json_404/2, make_json_405/2, make_json_500/1
Implemented ts_timeline:lookup/2
Implemented ts_entry:lookup/2
2011-01-30 08:28:56 -06:00
Jonathan Bernard
b690326cf4 Small addition to ts_api. 2011-01-29 13:41:27 -06:00
Jonathan Bernard
0d96c26174 Started craeting API dispatch and implementation. Updated api doc. 2011-01-29 10:46:45 -06:00
Jonathan Bernard
c04b73d9cc More implementation.
Modified intent of ts_db_records. timestamp value is no longer a
  {Date, Time} value, it is now gregorian seconds since year 0.
  This was done to make queries that are based on date comparisons
  easier to write and more efficient.
Added date time comparison function to ts_common.
Implemented update/1 and list/3 for ts_entry.
2011-01-28 16:57:15 -06:00
Jonathan Bernard
495336fc58 Starting DB implementation.
Added Makefile, id_counter.erl, and yaws.conf.
Created ts_common module. Will contain common DB code. So far only list/3.
Created ts_timeline module. DB code for storing timeline entries.
Created ts_entry module, DB code for storing timelin entries.
2011-01-28 06:49:47 -06:00
Jonathan Bernard
111da51c73 Beginning API documentation. 2011-01-28 03:22:21 -06:00