index.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title></title>
  6. <link rel="icon" type="image/png" href="/favicon.png" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  8. <!--Import Google Icon Font-->
  9. <link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  10. <!--Import materialize.css-->
  11. <link type="text/css" rel="stylesheet" href="3rdparty/css/materialize.min.css" media="screen,projection"/>
  12. <link rel="stylesheet" href="index.min.css"/>
  13. </head>
  14. <body id="application">
  15. <div v-show="mainView === 'login'" v-cloak>
  16. <div class="container" id="loginView">
  17. <div class="row">
  18. <div class="col-md-4 col-md-offset-4">
  19. <h4 class="modal-title">Login</h4>
  20. </div>
  21. </div>
  22. <form v-on:submit.prevent="doLogin">
  23. <div class="row">
  24. <div class="col-md-4 col-md-offset-4">
  25. <div class="form-group label-floating">
  26. <label class="control-label" for="inputUsername">Username</label>
  27. <input type="text" class="form-control" id="inputUsername" v-model="username" autofocus />
  28. </div>
  29. </div>
  30. <div class="col-md-4 col-md-offset-4">
  31. <div class="form-group label-floating">
  32. <label class="control-label" for="inputPassword">Password</label>
  33. <input type="password" class="form-control" id="inputPassword" v-model="password" autofocus />
  34. </div>
  35. </div>
  36. </div>
  37. <div class="row">
  38. <div class="col-md-4 col-md-offset-4">
  39. <button type="submit" class="btn btn-success pull-right">Login</button>
  40. </div>
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. <div v-show="mainView === 'content'" v-cloak>
  46. <div class="navbar-fixed">
  47. <nav>
  48. <div class="nav-wrapper white" style="color: black;">
  49. <div class="input-field">
  50. <input id="search" v-el:searchinput type="search" v-model="search" v-on:keyup.enter="doSearch">
  51. <label for="search"><i class="material-icons" style="color: black;">search</i></label>
  52. <i class="material-icons" v-on:click="clearSearch()" style="color: black;">close</i>
  53. </div>
  54. </div>
  55. </nav>
  56. </div>
  57. <div class="modal" id="modalDel">
  58. <div class="modal-content">
  59. <h4>Really Delete this Thing?</h4>
  60. </div>
  61. <div class="modal-footer">
  62. <button type="button" class="modal-action waves-effect btn-flat" v-on:click="deleteThing()">Delete</button>
  63. <button type="button" class="modal-action modal-close waves-effect btn-flat" data-dismiss="modal">Close</button>
  64. </div>
  65. </div>
  66. <div class="fixed-action-btn" style="bottom: 45px; right: 24px;">
  67. <a class="btn-floating btn-large" v-on:click="showSettings()">
  68. <i class="large material-icons">reorder</i>
  69. </a>
  70. </div>
  71. <div class="settings" id="settings">
  72. <div class="container" v-bind:class="{ 'open': open }">
  73. <div class="section">
  74. <h5>Interface</h5>
  75. <p>
  76. <form class="form-horizontal">
  77. <div class="form-group">
  78. <label htmlFor="inputTitle" class="col s4 control-label">Title</label>
  79. <div class="col s7">
  80. <input type="text" class="form-control" id="inputTitle" v-model="settings.title" placeholder="Title" />
  81. </div>
  82. </div>
  83. <div class="form-group">
  84. <label htmlFor="inputBackgroundImage" class="col s4 control-label">Background</label>
  85. <div class="col s7">
  86. <input type="text" class="form-control" id="inputBackgroundImage" v-model="settings.backgroundUrl" placeholder="url" />
  87. </div>
  88. </div>
  89. </form>
  90. <div class="col s12">
  91. <button class="waves-effect waves-teal btn-flat" v-on:click="toggleSettings">Cancel</button>
  92. <button class="waves-effect waves-teal btn-flat" v-on:click="saveSettings">Save</button>
  93. </div>
  94. </p>
  95. </div>
  96. <br/>
  97. <div class="section">
  98. <h5>Content</h5>
  99. <p>
  100. <div v-show="!importFile">
  101. <input id="inputImport" v-el:importfile type="file" v-on:change="importFileChanged()" class="hide">
  102. <button class="btn btn-raised" v-on:click="triggerImportInput()">Import</button>
  103. </div>
  104. <div v-show="importFile">
  105. <p>Really Import from {{importFile && importFile.name}}?</p>
  106. <button class="btn btn-flat" v-on:click="importThingsCancel()">No</button>
  107. <button class="btn btn-flat" v-on:click="importThings()">Yes</button>
  108. </div>
  109. <br/>
  110. <button class="btn btn-raised" v-on:click="exportThings">Export</button>
  111. </p>
  112. </div>
  113. <br/>
  114. <div class="section">
  115. <h5>Session</h5>
  116. <p>
  117. <button class="btn btn-raised" v-on:click="logout">Logout</button>
  118. </p>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="container main">
  123. <div class="row">
  124. <div class="col s2 tags">
  125. <div v-show="!busyTags" class="right-align">
  126. <h5>Tags</h5>
  127. <div v-for="tag in tags | orderBy 'usage' -1" style="text-overflow: ellipsis; overflow: hidden;">
  128. <a href="{{'/#search?#' + tag.name}}" v-on:click="tagSearch(tag)" transition="present">#{{ tag.name }}</a>
  129. </div>
  130. <br/>
  131. </div>
  132. <div v-show="busyTags">
  133. <br/>
  134. <br/>
  135. <br/>
  136. <center><i class="spinner"></i></center>
  137. </div>
  138. </div>
  139. <div class="col s8">
  140. <div class="card" v-on:click="giveAddFocus()">
  141. <div class="card-content right-align">
  142. <textarea v-el:addinput placeholder="Add something..." v-model="thingContent" v-bind:class="{ active: !!thingContent }"></textarea>
  143. <button v-el:addbutton class="waves-effect waves-teal btn-flat" v-on:click="addThing()" v-bind:class="{ hide: !thingContent }">add</button>
  144. </div>
  145. </div>
  146. <div v-show="!busyThings">
  147. <div class="card thing" v-for="thing in things">
  148. <div class="col s12 thing-title-date">
  149. {{ thing.createdAt | prettyDateOffset }}
  150. <span v-show="thing.edit">
  151. <button class="waves-effect waves-teal btn-flat" v-on:click="cancelEdit(thing)">cancel</button>
  152. <button class="waves-effect waves-teal btn green" v-on:click="saveEdit(thing)">save</button>
  153. </span>
  154. <span v-show="!thing.edit">
  155. <button class="waves-effect waves-teal btn-flat" v-on:click="showThingDel(thing)">delete</button>
  156. <button class="waves-effect waves-teal btn-flat" v-on:click="showThingEdit(thing)">edit</button>
  157. </span>
  158. </div>
  159. <div class="card-content" v-show="thing.edit"><textarea v-model="thing.content" style="height: 200px"></textarea></div>
  160. <div class="card-content" v-show="!thing.edit">{{{ thing.richContent | markdown }}}</div>
  161. </div>
  162. </div>
  163. <div v-show="busyThings">
  164. <br/>
  165. <br/>
  166. <br/>
  167. <center><i class="spinner"></i></center>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <!--Import jQuery before materialize.js-->
  174. <script type="text/javascript" src="3rdparty/jquery.min.js"></script>
  175. <script type="text/javascript" src="3rdparty/js/materialize.min.js"></script>
  176. <script src="bundle.js"></script>
  177. </body>
  178. </html>