Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <!-- NOTE: Meta Tags -->
  5. <meta charset="utf-8">
  6. <meta name="description" content="Ohm management app">
  7. <meta name="keywords" content="">
  8. <meta name="author" content="">
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  10. <!--for demonstration:-->
  11. <!-- <meta http-equiv="refresh" content="10">
  12. <!-- <meta http-equiv="refresh" content="30"> -->
  13. <!-- NOTE: Define Theme Color -->
  14. <!-- Chrome, Firefox OS and Opera -->
  15. <meta name="theme-color" content="#0046a0">
  16. <!-- NOTE: Icon for tab recognition -->
  17. <!-- highest resolution for Chrome & Opera -->
  18. <link rel="icon" sizes="192x192" href="favicon.ico">
  19. <!-- icons for Safari -> iOS Icons -->
  20. <!-- icons for IE & Windows phone -->
  21. <meta name="msapplication-square70x70logo" content="icon_smalltile.png">
  22. <meta name="msapplication-square150x150logo" content="icon_mediumtile.png">
  23. <meta name="msapplication-square310x310logo" content="icon_largetile.png">
  24. <meta name="msapplication-wide310x150logo" content="icon_widetile.png">
  25. <!-- NOTE: iOS - Add to Homescreen -->
  26. <!-- Hide Safari UI Components -->
  27. <meta name="apple-mobile-web-app-capable" content="yes" />
  28. <!-- iOS Status bar: black or black-translucent -->
  29. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  30. <!-- iOS App Name next to Icon -->
  31. <meta name="apple-mobile-web-app-title" content="OHM News">
  32. <!-- Icon: No transparency allowed -->
  33. <link rel="apple-touch-icon" href="img/launcher/ios_launcher_app_icon_192.png"> <!-- iphone -->
  34. <link rel="apple-touch-icon" sizes="152x152" href="img/launcher/ios_launcher_app_icon_152.png"><!-- ipad -->
  35. <link rel="apple-touch-icon" sizes="180x180" href="img/launcher/ios_launcher_app_icon_180.png"><!-- iphone-retina -->
  36. <link rel="apple-touch-icon" sizes="167x167" href="img/launcher/ios_launcher_app_icon_167.png"><!-- ipad-retina -->
  37. <!-- Splash screen: If not set, will be white screen -->
  38. <link rel="apple-touch-startup-image" sizes="2048x2732" href="ios-splash/apple_splash_2048.png" /><!-- Tablet -->
  39. <link rel="apple-touch-startup-image" sizes="1668x2224"href="ios-splash/apple_splash_1668.png" /><!-- Tablet -->
  40. <link rel="apple-touch-startup-image" sizes="1536x2048" href="ios-splash/apple_splash_1536.png" /><!-- Tablet -->
  41. <link rel="apple-touch-startup-image" sizes="1125x2436" href="ios-splash/apple_splash_1125.png" /><!-- Tablet ? Phone -->
  42. <link rel="apple-touch-startup-image" sizes="1242x2208" href="ios-splash/apple_splash_1242.png" /><!-- Tablet ? Phone -->
  43. <link rel="apple-touch-startup-image" sizes="750x1334" href="ios-splash/apple_splash_750.png" /><!-- Phone -->
  44. <link rel="apple-touch-startup-image" sizes="640x1136" href="ios-splash/apple_splash_640.png" /><!-- Phone -->
  45. <!-- NOTE: CSS -->
  46. <!-- CSS_Material Design for Bootstrap fonts and icons -->
  47. <link rel="stylesheet" href="lib/bootstrap-font-and-icons.css">
  48. <!-- NOTE: Call manifest.json -->
  49. <link rel="manifest" href="manifest.json">
  50. <!-- NOTE: Load JQuery, Vue.js, VueRouter, Vuetify -->
  51. <script src="lib/jquery-3.3.1.min.js"></script>
  52. <script src="lib/vue-2.6.10.js"></script>
  53. <script src="lib/vue-router-3.0.1.js"></script>
  54. <!-- Buefy/Vuetify -->
  55. <script src="lib/buefy-0.7.5.js"></script>
  56. <!-- <script src="lib/buefy-0.7.5.min.js"></script>-->
  57. <link rel="stylesheet" href="https://cdn.materialdesignicons.com/2.5.94/css/materialdesignicons.min.css">
  58. <link rel="stylesheet" type="text/css" href="lib/buefy-0.7.5.css">
  59. <!--<link rel="stylesheet" type="text/css" href="lib/buefy-0.7.5.min.css">-->
  60. <!-- CSS_Custom Design -->
  61. <link rel="stylesheet" type="text/css" href="style/style.css">
  62. <!-- NOTE: JavaScript Libs & Files -->
  63. <script src="routes/home.js"></script>
  64. <script src="routes/files.js"></script>
  65. <script src="routes/createMessage.js"></script>
  66. <script src="routes/bookmark.js"></script>
  67. <script src="routes/profil.js"></script>
  68. <script src="routes/msgCard.js"></script>
  69. <script src="routes/messageData.js"></script>
  70. <script src="routes/tagData.js"></script>
  71. <script src="routes/profilCard.js"></script>
  72. <script src="routes/profilData.js"></script>
  73. <script src="routes/login.js"></script>
  74. <script src="routes/navRoutes.js"></script>
  75. <title>OHM News</title>
  76. </head>
  77. <body>
  78. <div id="api">
  79. <div class="om-header-container">
  80. <div class="om-header">
  81. <a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
  82. <form class="om-searchbar" @submit.prevent="search()">
  83. <b-field>
  84. <b-autocomplete
  85. rounded
  86. v-model="searchtext"
  87. @keydown.native.enter="search"
  88. :data="filteredDataArray"
  89. placeholder="suche..."
  90. icon="magnify"
  91. @select="option => selected = option">
  92. </b-autocomplete>
  93. <!--<b-input
  94. type="search"
  95. v-model="searchtext"
  96. icon="magnify"
  97. placeholder="Suche...">
  98. </b-input>-->
  99. <!--<b-taginput
  100. id="search-text"
  101. type="search"
  102. v-model="selected"
  103. :data=taglist
  104. autocomplete
  105. allow-new:true
  106. icon="magnify"
  107. placeholder="Suche.."
  108. @typing="getFilteredTags"
  109. @input="saveTagsToArray">
  110. </b-taginput>-->
  111. <button @click="clear">x</button>
  112. </b-field>
  113. </form>
  114. </div>
  115. </div>
  116. <div class="om-content">
  117. <div id=xxx></div>
  118. <nav-router></nav-router>
  119. <router-view></router-view>
  120. </div>
  121. </div>
  122. <!--<b-tabs type="is-toggle" expanded>
  123. <b-tab-item><router-link to="/home" >
  124. <b-icon
  125. pack="fas"
  126. icon="home"
  127. size="is-small">
  128. </b-icon>
  129. </router-link></b-tab-item>
  130. <b-tab-item icon="magnify"></b-tab-item>
  131. <b-tab-item icon="plus-circle"></b-tab-item>
  132. <b-tab-item icon="bookmark"></b-tab-item>
  133. <b-tab-item icon="account"></b-tab-item>
  134. </b-tabs>-->
  135. <script>
  136. var tagArray = ["lorem"];
  137. const dat=[
  138. 'th',
  139. 'efi',
  140. 'wichtig',
  141. ];
  142. </script>
  143. <script>
  144. var app = new Vue({
  145. router,
  146. el: '#api',
  147. data: function() {
  148. return {
  149. searchtext: "",
  150. isSearchActiv: false,
  151. selected: [],
  152. taglist: dat,
  153. };
  154. },
  155. computed:{
  156. filteredDataArray() {
  157. return this.taglist.filter((option) => {
  158. return option
  159. .toString()
  160. .toLowerCase()
  161. .indexOf(this.searchtext.toLowerCase()) >= 0
  162. })
  163. }
  164. },
  165. methods: {
  166. search: function() {
  167. this.isSearchActiv = true;
  168. console.log("Searchtext: " +this.searchtext.replace(/#/g,''));
  169. $.ajax({
  170. url: "api/msg/search/" + this.searchtext.replace(/#/g, ''),
  171. method: "GET"
  172. }).done(jd => {
  173. // NICHT SO wg. Vue: _messagelist = jd;
  174. _messagelist.splice(0, _messagelist.length);
  175. _messagelist.push.apply(_messagelist, jd);
  176. //console.log("jd: "+jd);
  177. for (var e in jd) {
  178. if (!_messages[jd[e]]) {
  179. get_insert_message(jd[e]);
  180. }
  181. }
  182. }).fail(function(e, f, g) {
  183. console.log("searching: err: " + e + f + g);
  184. })
  185. },
  186. list_messages: function () {
  187. $.ajax({url: "api/msg/ids", method: "GET"})
  188. .done(jd => {
  189. // NICHT SO wg. Vue: _messagelist = jd;
  190. _messagelist.splice(0, _messagelist.length);
  191. _messagelist.push.apply(_messagelist, jd);
  192. //console.log("jd: "+jd);
  193. for (var e in jd) {
  194. if (!_messages[jd[e]]) {
  195. get_insert_message(jd[e]);
  196. }
  197. }
  198. }).fail(function (e, f, g) {
  199. console.log("list_msg: err: " + e + f + g);
  200. });
  201. },
  202. getFilteredTags(text) {
  203. this.taglist = dat.filter((option) => {
  204. return option
  205. .toString()
  206. .toLowerCase()
  207. .indexOf(text.toLowerCase()) >= 0
  208. })
  209. this.search();
  210. },
  211. saveTagsToArray: function() {
  212. tagArray = this.selected;
  213. console.info(tagArray);
  214. },
  215. list_tags: function () {
  216. $.ajax({url: "api/tag/ids",method: "GET"})
  217. .done(jd => {
  218. // NICHT SO wg. Vue: _messagelist = jd;
  219. _taglist.splice(0, _taglist.length);
  220. _taglist.push.apply(_taglist, jd);
  221. console.log("tag: jd: " + jd);
  222. for (var e in jd) {
  223. if (!_tags[jd[e]]) {
  224. get_insert_tag(jd[e]);
  225. }
  226. }
  227. }).fail(function (e, f, g) {
  228. console.log("err: " + e + f + g);
  229. });
  230. },
  231. clear: function() {
  232. console.log("clear");
  233. this.isSearchActiv = false;
  234. this.searchtext = "";
  235. this.list_messages();
  236. },
  237. },
  238. mounted: function () {
  239. //this.search();
  240. this.list_tags();
  241. },
  242. });
  243. function get_insert_tag(id){
  244. $.ajax({ url: "api/tag/"+id, method: "GET" }).done(function (tag) {
  245. dat.push("#"+tag.name);
  246. console.log("it worked!");
  247. }).fail(function (e, f, g) {
  248. console.log("cannot load " + id + ".json: " + e + f + g);
  249. })
  250. }
  251. const search_data = [];
  252. /*
  253. export.default {
  254. data: function () {
  255. return {
  256. selected: [],
  257. taglist: data,
  258. };
  259. },
  260. computed: {
  261. filteredTagArray() {
  262. this.taglist = data.filter((option) => {
  263. return option
  264. .toString()
  265. .toLowerCase()
  266. .indexOf(this.name.toLowerCase()) >= 0
  267. })
  268. },
  269. },
  270. methods: {
  271. evaluate(text) {
  272. this.taglist = data.filter((option) => {
  273. return option
  274. .toString()
  275. .toLowerCase()
  276. .indexOf(text.toLowerCase()) >= 0
  277. })
  278. },
  279. },
  280. mounted: function () {
  281. if ($(this).bootstrapMaterialDesign)
  282. $(this).bootstrapMaterialDesign();
  283. },
  284. };
  285. */
  286. </script>
  287. <!-- CDN_Vue.js minified lib -->
  288. <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js"></script> -->
  289. <!-- CDN_jQuery minified lib -->
  290. <!--<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>-->
  291. <!-- Load Popper.js -->
  292. <script src="lib/popper-1.12.6.js"></script>
  293. <!-- Load Bootstrap.js -->
  294. <script src="lib/bootstrap-material-design.js"></script>
  295. <!-- NOTE: Call main.js -->
  296. <script src="main.js"></script>
  297. </body>
  298. </html>