User Tools

Site Tools


projects:vote:vote

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:vote:vote [2024/10/14 23:14] jhagstrandprojects:vote:vote [2026/06/20 22:19] (current) – [vote.txt jun 2026] jhagstrand
Line 5: Line 5:
 todo: todo:
  
-  * x clean up results page, remove "instan...", display details on request, add decision at top 
-  * x Remove ballot and results from leftnav 
   * clean up Help: "no-spoiler",  "anti-spoiler"   * clean up Help: "no-spoiler",  "anti-spoiler"
 +  * back button come back to about from wikipedia, browserhistory return to last used page
 +  * add Register button to Login form and vice-versa
 +  * display url on ballot
   * add, edit, delete, approve decisions   * add, edit, delete, approve decisions
 +    * if userid = ownerid, show pencil as edit link
 +    * allow delete from edit screen
 +    * give everyone the insert link: compose, add, insert, new
 +      * a "new" link at the bottom of the list
   * add, edit, delete, approve candidate   * add, edit, delete, approve candidate
-  * display url on ballot +  * AI to match duplicate decisions and candidates 
-  * AI to match duplicate questions and answers+ 
 +  * encryption: only the voter can see his own ballot 
 + 
 +  * authentication: each voter is a member of the jurisdiction of the decision 
 +    * Add jurisdiction table, as ID, title, user ID.  
 +    * Had jurisdiction user table as jurisdiction ID user email.  
 +    * Add Eli to add change delete jurisdiction records  
 +    * Add jurisdiction ID column to decision table  
 +    * Filter decision lookup to users that belong to that jurisdiction.  
 + 
  
 content: content:
Line 35: Line 50:
      * salary range confined to 1x to 2x      * salary range confined to 1x to 2x
  
 +==== vote.txt jun 2026 ====
 +<code>
 +vote.txt
 +
 +reverse engineering
 +
 +html/svc.php -> php/svchub.php -> getprofile,putprofile
 +
 +html/account/svc.php -> php/account/svchub.php -> register,verify,forgotpassword,etc.
 +
 +
 +model of singleton objects
 +
 +user.js - voyc.User, represents logged-in user
 +
 +view.js - voyc.View, subscribes to nav requests: home, about, account, profile
 +
 +model.js - voyc.Model, meant to be main driver for app (start with model app, then rename)
 +
 +account.js - voyc.Account, account svc driver.  submits svc requests and receives data back.
 +
 +accountview.js - voyc.AccountView, account ui driver
 +
 +vote.js - voyc.Vote, app driver
 +
 +
 +
 +todo:
 +define html components: account, vote
 +get nav to work in view.js
 +resolve vote and model
 +resolve Observer vs Event
 +
 +webdev svc castballot makes call to webprod, hardcoded in vote.js 
 + model.js does it correctly
 +
 +x shell script in ~/webdev/disable_dev.sh
 +
 +castballot.php - 
 + input: electionid (int), votes (string of ints)
 + insert into vote.vote (userid, electionid, votes) ...;
 +
 + select id, name, party from vote.candidate where electionid = $1;
 + shuffle
 +
 + select votes from vote.vote where electionid = $1;
 + build array of votes
 + count votes in rounds
 +
 + output: candidates, results 
 +
 +validate.php - 
 + function validateInteger()
 + function validateArrayOfIntegers()
 +
 +-------------------
 +
 +vote.js
 +voyc.Vote()
 +
 +this.comm = Comm() instantiate Comm object
 +
 +getElection(electionid)
 + svc castballot return candidates, results
 + drawElection
 + show heading "2016 USA Pres"
 + drawBallot
 + get candidates from svc, 
 + those who are ranked: sort by rank, 
 + draw in a loop
 + those not yet ranked: sort by random
 + draw in a loop
 + enable the Cast Ballot button
 + drawResults
 + get results returned from svc
 + display the winner
 + display the rounds details in a table
 +
 + nav.replace('ballot' nav.replace using webprod/vote/.../jslib/nav.js object
 +
 +on load, new voyc.Vote()
 +
 +--------------------
 +
 +model.js
 +voyc.Model()
 +
 +instantiate self and object model: View, User, Account, AccountView
 +
 +instantiate Observer
 +
 +instantiage BrowserHistory and pagedraw() function
 +
 +instantiate Comm  
 +
 +subscribe to events: set/getProfile requessted, submitted, posted, received
 +
 +--------------------
 +
 +index.html
 +
 +header - leftnav, headeruser
 +
 +section content-container
 + section content-home
 + section ballot
 + section results
 + section content-about
 + section content-profile
 +
 +3 modeless dialogs
 + leftnav
 + header user
 + unused settings
 +modal container
 +9 modal dialogs - all used by account
 +
 +footer - two logo links
 +
 +
 +--------------------
 +
 +usage:
 +<insert from readme>
 +mv model.js to vote.js
 +substitute vote.Model to voyc.Vote
 +
 +
 +Event  pub/sub
 +Observer  pub/sub
 +
 +terminology
 +Observer
 +Pub/Sub
 +Data Binding
 +Message Queue
 +Event-driven architecture
 +decoupled
 +Listener
 +dispatcher
 +
 +Observer/Observeable
 +addEventListener/dispatchEvent
 +Publisher/Subscriber
 +Send/Receive
 +
 +
 +table
 +
 +singleton object that runs it all
 +subscriber/listener/receiver
 +publisher/
 +
 +verb, doer
 +
 +dispatcher
 +
 +manager      thingie         list         action               actor          action           actor
 +window       event           queue        addEventListener()   listener       dispatchEvent    dispatcher
 +Observer     note            stack        subscribe()          subscriber     publish()        publisher
 +Event        <parameters>    events       subscribe()          subscriber     publish()        publisher
 +             message         queue        send or xmit         sender         receive          receiver
 +
 +two lists
 +1. list of subscribers or listeners
 +2. queue of published messages or events that can be processed asynchronously
 +
 +-------------------------------
 +
 +original version, plus:
 + account management: login, register, etc
 + one vote per user, can be changed
 + multiple elections
 + election results vs rounds detailed results
 +
 +election menu
 +ballot
 +results
 +detailed results
 +about
 +</code>
projects/vote/vote.1728962050.txt.gz · Last modified: 2024/10/14 23:14 by jhagstrand

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki