[[projects:projects]]:vote ====== Vote ====== todo: * 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 * 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 * AI to match duplicate decisions and candidates * 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: * hero of the month * crime story of the month * Should the USA provoke Russia into a nuclear war? * How do we give low-IQ people a stable, community-oriented, moral center? * How can we increase rational thought? * restrictions on corporations * No such thing as "limited liability". * "full responsibility" for every individual, regardless of affiliations. * no personhood * all employees are jointly and severally liable * No participation in politics. Same as churches. * Single-user companies. No conglomerates. No oil companies owning media companies. * Each company must be shaken out every couple years. * Regulatory agency and corporate employment are mutually exclusive, lifetime. * Give tax-breaks to churches * State ministry of progpaganda * Outlaw advertising * keep media independent * no profits * salary range confined to 1x to 2x ==== vote.txt jun 2026 ==== 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: 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 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