modpol.interactions.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>Reference</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <br/>
  20. <h1>Modpol</h1>
  21. <ul>
  22. <li><a href="../index.html">Index</a></li>
  23. </ul>
  24. <h2>Contents</h2>
  25. <ul>
  26. <li><a href="#Functions">Functions</a></li>
  27. </ul>
  28. <h2>Modules</h2>
  29. <ul class="nowrap">
  30. <li><strong>modpol.interactions</strong></li>
  31. <li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
  32. <li><a href="../modules/change_modules.html">change_modules</a></li>
  33. <li><a href="../modules/change_modules.html">change_modules</a></li>
  34. <li><a href="../modules/consent.html">consent</a></li>
  35. <li><a href="../modules/create_token.html">create_token</a></li>
  36. <li><a href="../modules/defer_consent.html">defer_consent</a></li>
  37. <li><a href="../modules/display_processes.html">display_processes</a></li>
  38. <li><a href="../modules/join_org.html">join_org</a></li>
  39. <li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
  40. <li><a href="../modules/leave_org.html">leave_org</a></li>
  41. <li><a href="../modules/message_org.html">message_org</a></li>
  42. <li><a href="../modules/randomizer.html">randomizer</a></li>
  43. <li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
  44. <li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
  45. <li><a href="../modules/remove_org.html">remove_org</a></li>
  46. <li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
  47. <li><a href="../modules/remove_process.html">remove_process</a></li>
  48. <li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
  49. <li><a href="../modules/send_token.html">send_token</a></li>
  50. <li><a href="../modules/module_template.html">module_template</a></li>
  51. <li><a href="../modules/tokenomics.html">tokenomics</a></li>
  52. <li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
  53. <li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
  54. <li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
  55. <li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
  56. <li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
  57. <li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
  58. </ul>
  59. </div>
  60. <div id="content">
  61. <h1>Module <code>modpol.interactions</code></h1>
  62. <p>INTERACTIONS.LUA (CLI).</p>
  63. <p>
  64. User interaction functions for Modular Politics
  65. Called by modpol.lua</p>
  66. <h2><a href="#Functions">Functions</a></h2>
  67. <table class="function_list">
  68. <tr>
  69. <td class="name" nowrap><a href="#modpol.interactions.dashboard">modpol.interactions.dashboard (user)</a></td>
  70. <td class="summary">Output: Display a menu of commands to the user</td>
  71. </tr>
  72. <tr>
  73. <td class="name" nowrap><a href="#modpol.interactions.org_dashboard">modpol.interactions.org_dashboard (user, org_string)</a></td>
  74. <td class="summary">Output: Displays a menu of org-specific commands to the user</td>
  75. </tr>
  76. <tr>
  77. <td class="name" nowrap><a href="#modpol.interactions.user_dashboard">modpol.interactions.user_dashboard (viewer, user, completion)</a></td>
  78. <td class="summary">Function: modpol.interactions.user_dashboard
  79. Displays a dashboard about a particular user</td>
  80. </tr>
  81. <tr>
  82. <td class="name" nowrap><a href="#modpol.interactions.message">modpol.interactions.message (user, message)</a></td>
  83. <td class="summary">Prints message to CLI.</td>
  84. </tr>
  85. <tr>
  86. <td class="name" nowrap><a href="#modpol.interactions.message_user">modpol.interactions.message_user (sender, recipient)</a></td>
  87. <td class="summary">Gets and sends a message from one user to another</td>
  88. </tr>
  89. <tr>
  90. <td class="name" nowrap><a href="#modpol.interactions.display">modpol.interactions.display (user, title, message, done)</a></td>
  91. <td class="summary">Displays complex data to a user</td>
  92. </tr>
  93. <tr>
  94. <td class="name" nowrap><a href="#modpol.interactions.text_query">modpol.interactions.text_query (User, Query, func)</a></td>
  95. <td class="summary">Applies "func" to user input.</td>
  96. </tr>
  97. <tr>
  98. <td class="name" nowrap><a href="#modpol.interactions.dropdown_query">modpol.interactions.dropdown_query (user, label, options, func)</a></td>
  99. <td class="summary">Output: Calls func on choice.</td>
  100. </tr>
  101. <tr>
  102. <td class="name" nowrap><a href="#modpol.interactions.checkbox_query">modpol.interactions.checkbox_query (user, label, options, func)</a></td>
  103. <td class="summary">Allows user to select from a set of options</td>
  104. </tr>
  105. <tr>
  106. <td class="name" nowrap><a href="#modpol.interactions.binary_poll_user">modpol.interactions.binary_poll_user (user, question, func)</a></td>
  107. <td class="summary">Output: Applies "func" to user input.</td>
  108. </tr>
  109. <tr>
  110. <td class="name" nowrap><a href="#modpol.interactions.message_org">modpol.interactions.message_org (initiator, org, message)</a></td>
  111. <td class="summary">Output: broadcasts message to all org members</td>
  112. </tr>
  113. </table>
  114. <br/>
  115. <br/>
  116. <h2 class="section-header "><a name="Functions"></a>Functions</h2>
  117. <dl class="function">
  118. <dt>
  119. <a name = "modpol.interactions.dashboard"></a>
  120. <strong>modpol.interactions.dashboard (user)</strong>
  121. </dt>
  122. <dd>
  123. Output: Display a menu of commands to the user
  124. <h3>Parameters:</h3>
  125. <ul>
  126. <li><span class="parameter">user</span>
  127. (string)
  128. </li>
  129. </ul>
  130. </dd>
  131. <dt>
  132. <a name = "modpol.interactions.org_dashboard"></a>
  133. <strong>modpol.interactions.org_dashboard (user, org_string)</strong>
  134. </dt>
  135. <dd>
  136. Output: Displays a menu of org-specific commands to the user
  137. <h3>Parameters:</h3>
  138. <ul>
  139. <li><span class="parameter">user</span>
  140. (string)
  141. </li>
  142. <li><span class="parameter">org_string</span>
  143. (string or id)
  144. </li>
  145. </ul>
  146. </dd>
  147. <dt>
  148. <a name = "modpol.interactions.user_dashboard"></a>
  149. <strong>modpol.interactions.user_dashboard (viewer, user, completion)</strong>
  150. </dt>
  151. <dd>
  152. Function: modpol.interactions.user_dashboard
  153. Displays a dashboard about a particular user
  154. <h3>Parameters:</h3>
  155. <ul>
  156. <li><span class="parameter">viewer</span>
  157. Name of user viewing the dashboard (string)
  158. </li>
  159. <li><span class="parameter">user</span>
  160. Name of user being viewed (string)
  161. </li>
  162. <li><span class="parameter">completion</span>
  163. Optional function to call on Done button
  164. </li>
  165. </ul>
  166. </dd>
  167. <dt>
  168. <a name = "modpol.interactions.message"></a>
  169. <strong>modpol.interactions.message (user, message)</strong>
  170. </dt>
  171. <dd>
  172. Prints message to CLI.
  173. Buttons: message, done
  174. <h3>Parameters:</h3>
  175. <ul>
  176. <li><span class="parameter">user</span>
  177. (string)
  178. </li>
  179. <li><span class="parameter">message</span>
  180. (string)
  181. </li>
  182. </ul>
  183. </dd>
  184. <dt>
  185. <a name = "modpol.interactions.message_user"></a>
  186. <strong>modpol.interactions.message_user (sender, recipient)</strong>
  187. </dt>
  188. <dd>
  189. Gets and sends a message from one user to another
  190. <h3>Parameters:</h3>
  191. <ul>
  192. <li><span class="parameter">sender</span>
  193. Name of user sending (string)
  194. </li>
  195. <li><span class="parameter">recipient</span>
  196. Name of user receiving (string)
  197. </li>
  198. </ul>
  199. </dd>
  200. <dt>
  201. <a name = "modpol.interactions.display"></a>
  202. <strong>modpol.interactions.display (user, title, message, done)</strong>
  203. </dt>
  204. <dd>
  205. Displays complex data to a user
  206. <h3>Parameters:</h3>
  207. <ul>
  208. <li><span class="parameter">user</span>
  209. Name of target user (string)
  210. </li>
  211. <li><span class="parameter">title</span>
  212. Title of display (string)
  213. </li>
  214. <li><span class="parameter">message</span>
  215. Content of message (string or table of strings)
  216. </li>
  217. <li><span class="parameter">done</span>
  218. Optional function for what happens when user is done
  219. </li>
  220. </ul>
  221. </dd>
  222. <dt>
  223. <a name = "modpol.interactions.text_query"></a>
  224. <strong>modpol.interactions.text_query (User, Query, func)</strong>
  225. </dt>
  226. <dd>
  227. Applies "func" to user input.
  228. Func input: user input (string)
  229. <h3>Parameters:</h3>
  230. <ul>
  231. <li><span class="parameter">User</span>
  232. (string)
  233. </li>
  234. <li><span class="parameter">Query</span>
  235. (string)
  236. </li>
  237. <li><span class="parameter">func</span>
  238. (function)
  239. </li>
  240. </ul>
  241. </dd>
  242. <dt>
  243. <a name = "modpol.interactions.dropdown_query"></a>
  244. <strong>modpol.interactions.dropdown_query (user, label, options, func)</strong>
  245. </dt>
  246. <dd>
  247. Output: Calls func on choice.
  248. Func input: choice (string)
  249. <h3>Parameters:</h3>
  250. <ul>
  251. <li><span class="parameter">user</span>
  252. (string)
  253. </li>
  254. <li><span class="parameter">label</span>
  255. (string)
  256. </li>
  257. <li><span class="parameter">options</span>
  258. (table of strings)
  259. </li>
  260. <li><span class="parameter">func</span>
  261. (choice) (function)
  262. </li>
  263. </ul>
  264. </dd>
  265. <dt>
  266. <a name = "modpol.interactions.checkbox_query"></a>
  267. <strong>modpol.interactions.checkbox_query (user, label, options, func)</strong>
  268. </dt>
  269. <dd>
  270. Allows user to select from a set of options
  271. <h3>Parameters:</h3>
  272. <ul>
  273. <li><span class="parameter">user</span>
  274. Name of user (string)
  275. </li>
  276. <li><span class="parameter">label</span>
  277. Query for user before options (string)
  278. </li>
  279. <li><span class="parameter">options</span>
  280. Table of options and their checked status in the form {{"option_1_string", true}, {"option_2_string", false}}
  281. </li>
  282. <li><span class="parameter">func</span>
  283. Function to be called with param "input", made up of the corrected table in the same format as the param options
  284. </li>
  285. </ul>
  286. </dd>
  287. <dt>
  288. <a name = "modpol.interactions.binary_poll_user"></a>
  289. <strong>modpol.interactions.binary_poll_user (user, question, func)</strong>
  290. </dt>
  291. <dd>
  292. Output: Applies "func" to user input.
  293. Func input: user input (string: y/n)
  294. <h3>Parameters:</h3>
  295. <ul>
  296. <li><span class="parameter">user</span>
  297. (string)
  298. </li>
  299. <li><span class="parameter">question</span>
  300. (string)
  301. </li>
  302. <li><span class="parameter">func</span>
  303. (function)
  304. </li>
  305. </ul>
  306. </dd>
  307. <dt>
  308. <a name = "modpol.interactions.message_org"></a>
  309. <strong>modpol.interactions.message_org (initiator, org, message)</strong>
  310. </dt>
  311. <dd>
  312. Output: broadcasts message to all org members
  313. <h3>Parameters:</h3>
  314. <ul>
  315. <li><span class="parameter">initiator</span>
  316. (string)
  317. </li>
  318. <li><span class="parameter">org</span>
  319. (number or string)
  320. </li>
  321. <li><span class="parameter">message</span>
  322. (string)
  323. </li>
  324. </ul>
  325. </dd>
  326. </dl>
  327. </div> <!-- id="content" -->
  328. </div> <!-- id="main" -->
  329. <div id="about">
  330. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
  331. <i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
  332. </div> <!-- id="about" -->
  333. </div> <!-- id="container" -->
  334. </body>
  335. </html>