index.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <!-- Favicon as generated by realfavicongenerator.net (slightly modified for webpack) -->
  7. <link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-touch-icon.png">
  8. <link rel="icon" type="image/png" href="favicon/favicon-32x32.png" sizes="32x32">
  9. <link rel="icon" type="image/png" href="favicon/favicon-16x16.png" sizes="16x16">
  10. <link rel="manifest" href="favicon/manifest.json">
  11. <link rel="mask-icon" href="favicon/safari-pinned-tab.svg" color="#5bbad5">
  12. <link rel="shortcut icon" href="favicon/favicon.ico">
  13. <meta name="apple-mobile-web-app-title" content="Mumble">
  14. <meta name="application-name" content="Mumble">
  15. <meta name="msapplication-config" content="${require('./favicon/browserconfig.xml')}">
  16. <meta name="theme-color" content="#ffffff">
  17. <script src="config.js"></script>
  18. <script src="config.local.js"></script>
  19. <script src="theme.js"></script>
  20. <script src="matrix.js"></script>
  21. </head>
  22. <body>
  23. <div class="loading-container" data-bind="css: { loaded: true }">
  24. <div class="loading-circle" data-bind="css: { loaded: true }"></div>
  25. </div>
  26. <div id="container" style="display: none" data-bind="visible: true,
  27. css: { minimal: minimalView }">
  28. <!-- ko with: connectDialog -->
  29. <div class="connect-dialog dialog" data-bind="visible: visible() && !joinOnly()">
  30. <div id="connect-dialog_title" class="dialog-header">
  31. Connect to Server
  32. </div>
  33. <div data-bind="if: $root.config.connectDialog.helpText">
  34. <p data-bind="html: helpText"></p>
  35. </div>
  36. <form data-bind="submit: connect">
  37. <table>
  38. <tr data-bind="if: $root.config.connectDialog.address">
  39. <td id="connect-dialog_input_address">Address</td>
  40. <td><input id="address" type="text" data-bind="value: address" required></td>
  41. </tr>
  42. <tr data-bind="if: $root.config.connectDialog.port">
  43. <td id="connect-dialog_input_port">Port</td>
  44. <td><input id="port" type="text" data-bind="value: port" required></td>
  45. </tr>
  46. <tr data-bind="if: $root.config.connectDialog.username">
  47. <td id="connect-dialog_input_username">Username</td>
  48. <td><input id="username" type="text" data-bind="value: username" required></td>
  49. </tr>
  50. <tr data-bind="if: $root.config.connectDialog.password">
  51. <td id="connect-dialog_input_password">Password</td>
  52. <td><input id="password" type="password" data-bind="value: password"></td>
  53. </tr>
  54. <tr data-bind="if: $root.config.connectDialog.token">
  55. <td id="connect-dialog_input_tokens">Tokens</td>
  56. <td>
  57. <input type="text" data-bind='value: tokenToAdd, valueUpdate: "afterkeydown"'>
  58. </td>
  59. </tr>
  60. <tr data-bind="if: $root.config.connectDialog.token">
  61. <td></td>
  62. <td>
  63. <button id="connect-dialog_controls_remove" class="dialog-submit" type="button" data-bind="enable: selectedTokens().length > 0, click: removeSelectedTokens()">Remove</button>
  64. <button id="connect-dialog_controls_add" class="dialog-submit" type="button" data-bind="enable: tokenToAdd().length > 0, click: addToken()">Add</button>
  65. </td>
  66. </tr>
  67. <tr data-bind="if: $root.config.connectDialog.token, visible: tokens().length > 0">
  68. <td></td>
  69. <td><select id="token" multiple="multiple" height="5" data-bind="options:tokens, selectedOptions:selectedTokens"></select></td>
  70. </tr>
  71. <tr data-bind="if: $root.config.connectDialog.channelName">
  72. <td>Channel</td>
  73. <td><input id="channelName" type="text" data-bind="value: channelName"></td>
  74. </tr>
  75. </table>
  76. <div class="dialog-footer">
  77. <input id="connect-dialog_controls_cancel" class="dialog-close" type="button" data-bind="click: hide" value="Cancel">
  78. <input id="connect-dialog_controls_connect" class="dialog-submit" type="submit" value="Connect">
  79. </div>
  80. </form>
  81. </div>
  82. <!-- /ko -->
  83. <!-- ko with: addChannelDialog -->
  84. <div class="add-channel-dialog dialog" data-bind="visible: visible()">
  85. <div class="dialog-header">
  86. Add channel
  87. </div>
  88. <form data-bind="submit: addchannel">
  89. <table>
  90. <tr>
  91. <td>Channel</td>
  92. <td><input id="channelName" type="text" data-bind="value: channelName" required></td>
  93. </tr>
  94. </table>
  95. <input class="dialog-submit" type="submit" value="Add channel">
  96. </form>
  97. </div>
  98. <!-- /ko -->
  99. <!-- ko with: connectDialog -->
  100. <div class="join-dialog dialog" data-bind="visible: visible() && joinOnly()">
  101. <div class="dialog-header">
  102. Mumble Voice Conference
  103. </div>
  104. <form data-bind="submit: connect">
  105. <input class="dialog-submit" type="submit" value="Join Conference">
  106. </form>
  107. </div>
  108. <!-- /ko -->
  109. <!-- ko with: connectErrorDialog -->
  110. <div class="connect-dialog error-dialog dialog" data-bind="visible: visible()">
  111. <div class="dialog-header">
  112. Failed to connect
  113. </div>
  114. <form data-bind="submit: connect">
  115. <table>
  116. <tr class="reason">
  117. <td colspan=2>
  118. <!-- ko if: type() == 0 || type() == 8 -->
  119. <span class="refused">
  120. The connection has been refused.
  121. </span>
  122. <!-- /ko -->
  123. <!-- ko if: type() == 1 -->
  124. <span class="version">
  125. The server uses an incompatible version.
  126. </span>
  127. <!-- /ko -->
  128. <!-- ko if: type() == 2 -->
  129. <span class="username">
  130. Your user name was rejected. Maybe try a different one?
  131. </span>
  132. <!-- /ko -->
  133. <!-- ko if: type() == 3 -->
  134. <span class="userpassword">
  135. The given password is incorrect.
  136. The user name you have chosen requires a special one.
  137. </span>
  138. <!-- /ko -->
  139. <!-- ko if: type() == 4 -->
  140. <span class="serverpassword">
  141. The given password is incorrect.
  142. </span>
  143. <!-- /ko -->
  144. <!-- ko if: type() == 5 -->
  145. <span class="username-in-use">
  146. The user name you have chosen is already in use.
  147. </span>
  148. <!-- /ko -->
  149. <!-- ko if: type() == 6 -->
  150. <span class="full">
  151. The server is full.
  152. </span>
  153. <!-- /ko -->
  154. <!-- ko if: type() == 7 -->
  155. <span class="clientcert">
  156. The server requires you to provide a client certificate
  157. which is not supported by this web application.
  158. </span>
  159. <!-- /ko -->
  160. <br>
  161. <span class="server">
  162. The server reports:
  163. </span>
  164. <br>
  165. "<span class="connect-error-reason" data-bind="text: reason"></span>"
  166. </td>
  167. </tr>
  168. <tr data-bind="if: type() == 2 || type() == 3 || type() == 5">
  169. <td class="alternate-username">Username</td>
  170. <td><input id="username" type="text" data-bind="value: username" required></td>
  171. </tr>
  172. <tr data-bind="if: type() == 3 || type() == 4">
  173. <td class="alternate-password">Password</td>
  174. <td><input id="password" type="password" data-bind="value: password" required></td>
  175. </tr>
  176. </table>
  177. <div class="dialog-footer">
  178. <input class="dialog-close" type="button" value="Cancel"
  179. data-bind="click: hide, visible: !joinOnly()">
  180. <input class="dialog-submit" type="submit" value="Retry">
  181. </div>
  182. </form>
  183. </div>
  184. <!-- /ko -->
  185. <!-- ko with: connectionInfo -->
  186. <div class="connection-info-dialog dialog" data-bind="visible: visible">
  187. <div class="dialog-header">
  188. Connection Information
  189. </div>
  190. <div class="dialog-content">
  191. <h3>Version</h3>
  192. <!-- ko with: serverVersion -->
  193. Protocol
  194. <span data-bind="text: major + '.' + minor + '.' + patch"></span>.
  195. <br>
  196. <br>
  197. <span data-bind="text: release"></span>
  198. <br>
  199. <span data-bind="text: os"></span>
  200. <span data-bind="text: osVersion"></span>
  201. <br>
  202. <!-- /ko -->
  203. <!-- ko if: !serverVersion() -->
  204. Unknown
  205. <!-- /ko -->
  206. <h3>Control channel</h3>
  207. <span data-bind="text: latencyMs().toFixed(2)"></span> ms average latency
  208. (<span data-bind="text: latencyDeviation().toFixed(2)"></span> deviation)
  209. <br>
  210. <br>
  211. Remote host <span data-bind="text: remoteHost"></span>
  212. (port <span data-bind="text: remotePort"></span>)
  213. <br>
  214. <h3>Audio bandwidth</h3>
  215. Maximum <span data-bind="text: (maxBitrate()/1000).toFixed(1)"></span> kbits/s
  216. (<span data-bind="text: (maxBandwidth()/1000).toFixed(1)"></span> kbits/s with overhead)
  217. <br>
  218. Current <span data-bind="text: (currentBitrate()/1000).toFixed(1)"></span> kbits/s
  219. (<span data-bind="text: (currentBandwidth()/1000).toFixed(1)"></span> kbits/s with overhead)
  220. <br>
  221. Codec: <span data-bind="text: codec"></span>
  222. </div>
  223. <div class="dialog-footer">
  224. <input class="dialog-close" type="button" data-bind="click: hide" value="OK">
  225. </div>
  226. </div>
  227. <!-- /ko -->
  228. <!-- ko with: settingsDialog -->
  229. <div class="settings-dialog dialog" data-bind="visible: $data">
  230. <div class="dialog-header">
  231. Settings
  232. </div>
  233. <form data-bind="submit: $root.applySettings">
  234. <table>
  235. <tr>
  236. <td>Transmission</td>
  237. <td>
  238. <select data-bind='value: voiceMode'>
  239. <option value="cont">Continuous</option>
  240. <option value="vad">Voice Activity</option>
  241. <option value="ptt">Push To Talk</option>
  242. </td>
  243. </tr>
  244. <tr data-bind="visible: voiceMode() == 'vad'">
  245. <td colspan="2">
  246. <div class="mic-volume-container">
  247. <div class="mic-volume" data-bind="style: {
  248. width: testVadLevel()*100 + '%',
  249. background: testVadActive() ? 'green' : 'red'
  250. }"></div>
  251. </div>
  252. <input type="range" min="0" max="1" step="0.01"
  253. data-bind="value: vadLevel">
  254. </td>
  255. </tr>
  256. <tr data-bind="visible: voiceMode() == 'ptt'">
  257. <td>PTT Key</td>
  258. <td>
  259. <input type="button" data-bind="value: pttKeyDisplay, click: recordPttKey">
  260. </td>
  261. </tr>
  262. <tr>
  263. <td>Audio Quality</td>
  264. <td><span data-bind="text: (audioBitrate()/1000).toFixed(1)"></span> kbit/s</td>
  265. </tr>
  266. <tr>
  267. <td colspan="2">
  268. <input type="range" min="8000" max="96000" step="8"
  269. data-bind="value: audioBitrate, valueUpdate: 'input'">
  270. </td>
  271. </tr>
  272. <tr>
  273. <td>Audio per packet</td>
  274. <td><span data-bind="text: msPerPacket"></span> ms</td>
  275. </tr>
  276. <tr>
  277. <td colspan="2">
  278. <input type="range" min="10" max="60" step="10"
  279. data-bind="value: msPerPacket, valueUpdate: 'input'">
  280. </td>
  281. </tr>
  282. <tr>
  283. <td colspan="2" class="bandwidth-info">
  284. <span data-bind="text: (totalBandwidth()/1000).toFixed(1)"></span>
  285. kbit/s
  286. (Audio
  287. <span data-bind="text: (audioBitrate()/1000).toFixed(1)"></span>,
  288. Position
  289. <span data-bind="text: (positionBandwidth()/1000).toFixed(1)"></span>,
  290. Overhead
  291. <span data-bind="text: (overheadBandwidth()/1000).toFixed(1)"></span>)
  292. </td>
  293. </tr>
  294. <tr>
  295. <td>Show Avatars</td>
  296. <td>
  297. <select data-bind='value: showAvatars'>
  298. <option value="always">Always</option>
  299. <option value="own_channel">Same Channel</option>
  300. <option value="linked_channel">Linked Channels</option>
  301. <option value="minimal_only">Minimal View</option>
  302. <option value="never">Never</option>
  303. </td>
  304. </tr>
  305. <tr>
  306. <td colspan="2">
  307. <input type="checkbox" data-bind="checked: userCountInChannelName">
  308. Show user count after channel name
  309. </td>
  310. </tr>
  311. </table>
  312. <div class="dialog-footer">
  313. <input class="dialog-close" type="button" data-bind="click: $root.closeSettings" value="Cancel">
  314. <input class="dialog-submit" type="submit" value="Apply">
  315. </div>
  316. </form>
  317. </div>
  318. <!-- /ko -->
  319. <img class="avatar-view" data-bind="visible: avatarView, attr: { src: avatarView },
  320. click: function () { avatarView(null) }"></img>
  321. <!-- ko with: userContextMenu -->
  322. <ul class="context-menu user-context-menu" data-bind="if: target,
  323. style: { left: posX() + 'px',
  324. top: posY() + 'px' }">
  325. <!-- ko with: target -->
  326. <li data-bind="css: { disabled: !canChangeMute() }"
  327. class="mute">
  328. Mute
  329. </li>
  330. <li data-bind="css: { disabled: !canChangeDeafen() }"
  331. class="deafen">
  332. Deafen
  333. </li>
  334. <li data-bind="css: { disabled: !canChangePrioritySpeaker() }"
  335. class="priority-speaker">
  336. Priority Speaker
  337. </li>
  338. <li data-bind="css: { disabled: !canLocalMute() }"
  339. class="local-mute">
  340. Local Mute
  341. </li>
  342. <li data-bind="css: { disabled: !canIgnoreMessages() }"
  343. class="ignore-messages">
  344. Ignore Messages
  345. </li>
  346. <li data-bind="css: { disabled: !canChangeComment() }, visible: comment"
  347. class="view-comment">
  348. View Comment
  349. </li>
  350. <!-- ko if: $data === $root.thisUser() -->
  351. <li data-bind="css: { disabled: !canChangeComment() }, visible: true"
  352. class="change-comment">
  353. Change Comment
  354. </li>
  355. <!-- /ko -->
  356. <!-- ko if: $data !== $root.thisUser() -->
  357. <li data-bind="css: { disabled: !canChangeComment() }, visible: comment"
  358. class="reset-comment">
  359. Reset Comment
  360. </li>
  361. <!-- /ko -->
  362. <li data-bind="css: { disabled: !canChangeAvatar() }, visible: texture,
  363. click: viewAvatar"
  364. class="view-avatar">
  365. View Avatar
  366. </li>
  367. <!-- ko if: $data === $root.thisUser() -->
  368. <li data-bind="css: { disabled: !canChangeAvatar() }, visible: true,
  369. click: changeAvatar"
  370. class="change-avatar">
  371. Change Avatar
  372. </li>
  373. <!-- /ko -->
  374. <li data-bind="css: { disabled: !canChangeAvatar() }, visible: texture,
  375. click: removeAvatar",
  376. class="reset-avatar">
  377. Reset Avatar
  378. </li>
  379. <li data-bind="css: { disabled: true }, visible: true"
  380. class="send-message">
  381. Send Message
  382. </li>
  383. <li data-bind="css: { disabled: true }, visible: true"
  384. class="information">
  385. Information
  386. </li>
  387. <li data-bind="visible: $data === $root.thisUser(),
  388. css: { checked: selfMute },
  389. click: toggleMute"
  390. class="self-mute">
  391. Self Mute
  392. </li>
  393. <li data-bind="visible: $data === $root.thisUser(),
  394. css: { checked: selfDeaf },
  395. click: toggleDeaf"
  396. class="self-deafen">
  397. Self Deafen
  398. </li>
  399. <!-- ko if: $data !== $root.thisUser() -->
  400. <li data-bind="css: { disabled: true }, visible: true"
  401. class="add-friend">
  402. Add Friend
  403. </li>
  404. <li data-bind="css: { disabled: true }, visible: false"
  405. class="remove-friend">
  406. Remove Friend
  407. </li>
  408. <!-- /ko -->
  409. <!-- /ko -->
  410. </ul>
  411. <!-- /ko -->
  412. <!-- ko with: channelContextMenu -->
  413. <ul class="context-menu channel-context-menu" data-bind="if: target,
  414. style: { left: posX() + 'px',
  415. top: posY() + 'px' }">
  416. <!-- ko with: target -->
  417. <li data-bind="visible: users.indexOf($root.thisUser()) === -1,
  418. css: { disabled: !canJoin() },
  419. click: $root.requestMove.bind($root, $root.thisUser())"
  420. class="join">
  421. Join Channel
  422. </li>
  423. <li data-bind="css: { disabled: !canAdd() }, click: $root.openAddChannel.bind($root, $root.thisUser())"
  424. class="add">
  425. Add
  426. </li>
  427. <li data-bind="css: { disabled: !canEdit() }"
  428. class="edit">
  429. Edit
  430. </li>
  431. <li data-bind="css: { disabled: !canRemove() }, click: $root.ChannelRemove.bind($root, $root.thisUser())"
  432. class="remove">
  433. Remove
  434. </li>
  435. <li data-bind="css: { disabled: !canLink() }"
  436. class="link">
  437. Link
  438. </li>
  439. <li data-bind="css: { disabled: !canUnlink() }"
  440. class="unlink">
  441. Unlink
  442. </li>
  443. <li data-bind="css: { disabled: !canUnlink() }"
  444. class="unlink-all">
  445. Unlink All
  446. </li>
  447. <li data-bind="css: { disabled: true }"
  448. class="copy-mumble-url">
  449. Copy Mumble URL
  450. </li>
  451. <li data-bind="css: { disabled: true }"
  452. class="copy-mumble-web-url">
  453. Copy Mumble-Web URL
  454. </li>
  455. <li data-bind="css: { disabled: !canSendMessage() }"
  456. class="send-message">
  457. Send Message
  458. </li>
  459. <!-- /ko -->
  460. </ul>
  461. <!-- /ko -->
  462. <script type="text/html" id="user-tag">
  463. <span class="user-tag" data-bind="text: name"></span>
  464. </script>
  465. <script type="text/html" id="channel-tag">
  466. <span class="channel-tag" data-bind="text: name"></span>
  467. </script>
  468. <div class="toolbar" data-bind="css: { 'toolbar-horizontal': toolbarHorizontal(),
  469. 'toolbar-vertical': !toolbarHorizontal() }">
  470. <img class="tb-horizontal handle-horizontal" src="/svg/handle_horizontal.svg"
  471. data-bind="click: toggleToolbarOrientation"
  472. title="Switch Orientation" alt="Switch Orientation">
  473. <img class="tb-vertical handle-vertical" src="/svg/handle_vertical.svg"
  474. data-bind="click: toggleToolbarOrientation"
  475. title="Switch Orientation" alt="Switch Orientation">
  476. <img class="tb-connect" data-bind="visible: !connectDialog.joinOnly(),
  477. click: connectDialog.show"
  478. rel="connect" src="/svg/applications-internet.svg"
  479. title="Connect to Server" alt="Connection">
  480. <img class="tb-information" rel="information" src="/svg/information_icon.svg"
  481. data-bind="click: connectionInfo.show,
  482. css: { disabled: !thisUser() }"
  483. title="Information" alt="Information">
  484. <div class="divider"></div>
  485. <img class="tb-mute" data-bind="visible: !selfMute(),
  486. click: function () { requestMute(thisUser()) }"
  487. rel="mute" src="/svg/audio-input-microphone.svg"
  488. title="Mute" alt="Mute">
  489. <img class="tb-unmute tb-active" data-bind="visible: selfMute,
  490. click: function () { requestUnmute(thisUser()) }"
  491. rel="unmute" src="/svg/audio-input-microphone-muted.svg"
  492. title="Unmute" alt="Unmute">
  493. <img class="tb-deaf" data-bind="visible: !selfDeaf(),
  494. click: function () { requestDeaf(thisUser()) }"
  495. rel="deaf" src="/svg/audio-output.svg"
  496. title="Deafen" alt="Deafen">
  497. <img class="tb-undeaf tb-active" data-bind="visible: selfDeaf,
  498. click: function () { requestUndeaf(thisUser()) }"
  499. rel="undeaf" src="/svg/audio-output-deafened.svg"
  500. title="Undeafen" alt="Undeafen">
  501. <img class="tb-record" data-bind="click: function(){}"
  502. rel="record" src="/svg/media-record.svg"
  503. title="Record" alt="Record">
  504. <div class="divider"></div>
  505. <img class="tb-comment" data-bind="click: commentDialog.show"
  506. rel="comment" src="/svg/toolbar-comment.svg"
  507. title="Comment" alt="Comment">
  508. <div class="divider"></div>
  509. <img class="tb-settings" data-bind="click: openSettings"
  510. rel="settings" src="/svg/config_basic.svg"
  511. title="Settings" alt="Settings">
  512. <div class="divider"></div>
  513. <img class="tb-sourcecode" data-bind="click: openSourceCode"
  514. rel="Source Code" src="/svg/source-code.svg"
  515. title="Open Soure Code" alt="Open Source Code">
  516. </div>
  517. <div class="chat">
  518. <script type="text/html" id="log-generic">
  519. <span data-bind="text: value"></span>
  520. </script>
  521. <script type="text/html" id="log-welcome-message">
  522. Welcome message: <span data-bind="html: message"></span>
  523. </script>
  524. <script type="text/html" id="log-chat-message">
  525. <span data-bind="visible: channel">
  526. (Channel)
  527. </span>
  528. <span data-bind="template: { name: 'user-tag', data: user }"></span>:
  529. <span class="message-content" data-bind="html: message"></span>
  530. </script>
  531. <script type="text/html" id="log-chat-message-self">
  532. To
  533. <span data-bind="template: { if: $data.channel, name: 'channel-tag', data: $data.channel }">
  534. </span><span data-bind="template: { if: $data.user, name: 'user-tag', data: $data.user }">
  535. </span>:
  536. <span class="message-content" data-bind="html: message"></span>
  537. </script>
  538. <script type="text/html" id="log-disconnect">
  539. </script>
  540. <div class="log" data-bind="foreach: {
  541. data: log,
  542. afterRender: function (e) {
  543. [].forEach.call(e[1].getElementsByTagName('a'), function(e){e.target = '_blank'})
  544. }
  545. }">
  546. <div class="log-entry">
  547. <span class="log-timestamp" data-bind="text: $root.getTimeString()"></span>
  548. <!-- ko template: { data: $data, name: function(l) { return 'log-' + l.type; } } -->
  549. <!-- /ko -->
  550. </div>
  551. </div>
  552. <form data-bind="submit: submitMessageBox">
  553. <textarea id="message-box" row=1 data-bind="
  554. attr: { placeholder: messageBoxHint },
  555. textInput: messageBox,
  556. event: {keypress: submitOnEnter}"></textarea>
  557. </form>
  558. </div>
  559. <script type="text/html" id="channel">
  560. <div class="channel" data-bind="
  561. click: $root.select,
  562. event: {
  563. contextmenu: openContextMenu,
  564. dblclick: $root.requestMove.bind($root, $root.thisUser())
  565. },
  566. css: {
  567. selected: $root.selected() === $data,
  568. currentChannel: users.indexOf($root.thisUser()) !== -1
  569. }">
  570. <div class="channel-status">
  571. <img class="channel-description" data-bind="visible: description"
  572. alt="description" src="/svg/comment.svg">
  573. </div>
  574. <div data-bind="if: description">
  575. <div class="channel-description tooltip" data-bind="html: description"></div>
  576. </div>
  577. <img class="channel-icon" src="/svg/channel.svg"
  578. data-bind="visible: !linked() && $root.thisUser().channel() !== $data">
  579. <img class="channel-icon-active" src="/svg/channel_active.svg"
  580. data-bind="visible: $root.thisUser().channel() === $data">
  581. <img class="channel-icon-linked" src="/svg/channel_linked.svg"
  582. data-bind="visible: linked() && $root.thisUser().channel() !== $data">
  583. <div class="channel-name">
  584. <span data-bind="text: name"></span>
  585. <!-- ko if: $root.settings.userCountInChannelName() && userCount() !== 0 -->
  586. &nbsp;(<span data-bind="text: userCount()"></span>)
  587. <!-- /ko -->
  588. </div>
  589. </div>
  590. <!-- ko if: expanded -->
  591. <!-- ko foreach: users -->
  592. <div class="user-wrapper">
  593. <div class="user-tree"></div>
  594. <div class="user" data-bind="
  595. click: $root.select,
  596. event: {
  597. contextmenu: openContextMenu
  598. },
  599. css: {
  600. thisClient: $root.thisUser() === $data,
  601. selected: $root.selected() === $data
  602. }">
  603. <div class="user-status" data-bind="attr: { title: state }">
  604. <img class="user-comment" data-bind="visible: comment"
  605. alt="comment" src="/svg/comment.svg">
  606. <img class="user-server-mute" data-bind="visible: mute"
  607. alt="server mute" src="/svg/muted_server.svg">
  608. <img class="user-suppress-mute" data-bind="visible: suppress"
  609. alt="suppressed" src="/svg/muted_suppressed.svg">
  610. <img class="user-self-mute" data-bind="visible: selfMute"
  611. alt="self mute" src="/svg/muted_self.svg">
  612. <img class="user-server-deaf" data-bind="visible: deaf"
  613. alt="server deaf" src="/svg/deafened_server.svg">
  614. <img class="user-self-deaf" data-bind="visible: selfDeaf"
  615. alt="self deaf" src="/svg/deafened_self.svg">
  616. <img class="user-authenticated" data-bind="visible: uid"
  617. alt="authenticated" src="/svg/authenticated.svg">
  618. </div>
  619. <div data-bind="if: comment">
  620. <div class="user-comment tooltip" data-bind="html: comment"></div>
  621. </div>
  622. <!-- ko if: show_avatar() -->
  623. <img class="user-avatar" alt="avatar"
  624. data-bind="attr: { src: texture },
  625. css: { 'user-avatar-talk-off': talking() == 'off',
  626. 'user-avatar-talk-on': talking() == 'on',
  627. 'user-avatar-talk-whisper': talking() == 'whisper',
  628. 'user-avatar-talk-shout': talking() == 'shout' }">
  629. <!-- /ko -->
  630. <!-- ko ifnot: show_avatar() -->
  631. <img class="user-talk user-talk-off" data-bind="visible: talking() == 'off'"
  632. alt="talk off" src="/svg/talking_off.svg">
  633. <img class="user-talk user-talk-on" data-bind="visible: talking() == 'on'"
  634. alt="talk on" src="/svg/talking_on.svg">
  635. <img class="user-talk user-talk-whisper" data-bind="visible: talking() == 'whisper'"
  636. alt="whisper" src="/svg/talking_whisper.svg">
  637. <img class="user-talk user-talk-shout" data-bind="visible: talking() == 'shout'"
  638. alt="shout" src="/svg/talking_alt.svg">
  639. <!-- /ko -->
  640. <div class="user-name" data-bind="text: name"></div>
  641. </div>
  642. </div>
  643. <!-- /ko -->
  644. <!-- ko foreach: channels -->
  645. <div class="channel-wrapper">
  646. <!-- ko ifnot: users().length || channels().length -->
  647. <div class="channel-tree"></div>
  648. <!-- /ko -->
  649. <div class="branch" data-bind="if: users().length || channels().length">
  650. <img class="branch-open" src="/svg/branch_open.svg"
  651. data-bind="click: expanded.bind($data, false), visible: expanded()">
  652. <img class="branch-closed" src="/svg/branch_closed.svg"
  653. data-bind="click: expanded.bind($data, true), visible: !expanded()">
  654. </div>
  655. <div class="channel-sub" data-bind="template: {name: 'channel', data: $data}"></div>
  656. </div>
  657. <!-- /ko -->
  658. <!-- /ko -->
  659. </script>
  660. <div class="channel-root-container" data-bind="if: root, visible: !minimalView()">
  661. <div class="channel-root" data-bind="template: {name: 'channel', data: root}"></div>
  662. </div>
  663. <div class="channel-root-container" data-bind="if: thisUser, visible: minimalView()">
  664. <div class="channel-root" data-bind="template: {name: 'channel', data: thisUser().channel}"></div>
  665. </div>
  666. </div>
  667. </body>
  668. <script src="index.js"></script>
  669. </html>