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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. <!-- CSS_Material Design for Bootstrap minified CSS -->
  49. <!--<link rel="stylesheet" href="lib/bootstrap-material-design.min.css">-->
  50. >>>>>>> origin/developer
  51. <!-- NOTE: Call manifest.json -->
  52. <link rel="manifest" href="manifest.json">
  53. <!-- NOTE: Load JQuery, Vue.js, VueRouter, Vuetify -->
  54. <script src="lib/jquery-3.3.1.min.js"></script>
  55. <script src="lib/vue-2.6.10.js"></script>
  56. <script src="lib/vue-router-3.0.1.js"></script>
  57. <!-- Buefy/Vuetify -->
  58. <script src="lib/buefy-0.7.5.js"></script>
  59. <!-- <script src="lib/buefy-0.7.5.min.js"></script>-->
  60. <link rel="stylesheet" href="https://cdn.materialdesignicons.com/2.5.94/css/materialdesignicons.min.css">
  61. <link rel="stylesheet" type="text/css" href="lib/buefy-0.7.5.css">
  62. <!--<link rel="stylesheet" type="text/css" href="lib/buefy-0.7.5.min.css">-->
  63. <!-- <script src="lib/vuetify-1.5.14.js"></script>-->
  64. <!-- <script src="lib/vuetify-1.5.14.min.js"></script>-->
  65. <!-- <link rel="stylesheet" type="text/css" href="lib/vuetify-1.5.14.css">-->
  66. <!-- <link rel="stylesheet" type="text/css" href="lib/vuetify-1.5.14.min.css">-->
  67. >>>>>>> origin/developer
  68. <!-- CSS_Custom Design -->
  69. <link rel="stylesheet" type="text/css" href="style/style.css">
  70. <!-- NOTE: JavaScript Libs & Files -->
  71. <script src="routes/home.js"></script>
  72. <script src="routes/files.js"></script>
  73. <script src="routes/createMessage.js"></script>
  74. <script src="routes/bookmark.js"></script>
  75. <script src="routes/profil.js"></script>
  76. <script src="routes/msgCard.js"></script>
  77. <script src="routes/messageData.js"></script>
  78. <script src="routes/tagData.js"></script>
  79. <script src="routes/profilCard.js"></script>
  80. <script src="routes/profilData.js"></script>
  81. <script src="routes/login.js"></script>
  82. <script src="routes/navRoutes.js"></script>
  83. <title>OHM News</title>
  84. </head>
  85. <body>
  86. <div id="api">
  87. <div class="om-header-container">
  88. <div class="om-header">
  89. <a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
  90. <form class="om-searchbar" @submit.prevent="search()">
  91. <b-field>
  92. <b-autocomplete rounded v-model="searchtext" @keydown.native.enter="search" :data="filteredDataArray" placeholder="suche..." icon="magnify" @select="option => selected = option">
  93. </b-autocomplete>
  94. <button @click="clear">x</button>
  95. </b-field>
  96. </form>
  97. </div>
  98. </div>
  99. <div class="om-content">
  100. <div id=xxx></div>
  101. <nav-router></nav-router>
  102. <router-view></router-view>
  103. </div>
  104. </div>
  105. <script>
  106. var isSearchActive = false;
  107. var tagArray = ["lorem"];
  108. const dat = [
  109. 'th',
  110. 'efi',
  111. 'wichtig',
  112. ];
  113. </script>
  114. <script>
  115. var app = new Vue({
  116. router,
  117. el: '#api',
  118. data: function() {
  119. return {
  120. searchtext: "",
  121. //isSearchActiv: false,
  122. selected: [],
  123. taglist: dat,
  124. };
  125. },
  126. computed: {
  127. filteredDataArray() {
  128. return this.taglist.filter((option) => {
  129. return option
  130. .toString()
  131. .toLowerCase()
  132. .indexOf(this.searchtext.toLowerCase()) >= 0
  133. })
  134. }
  135. },
  136. methods: {
  137. getFilteredTags(text) {
  138. this.taglist = dat.filter((option) => {
  139. return option
  140. .toString()
  141. .toLowerCase()
  142. .indexOf(text.toLowerCase()) >= 0
  143. })
  144. this.search();
  145. },
  146. saveTagsToArray: function() {
  147. tagArray = this.selected;
  148. console.info(tagArray);
  149. },
  150. search: function() {
  151. searching(this.searchtext);
  152. },
  153. list_messages: function() {
  154. messages();
  155. },
  156. list_tags: function() {
  157. $.ajax({
  158. url: "api/tag/ids",
  159. method: "GET"
  160. })
  161. .done(jd => {
  162. // NICHT SO wg. Vue: _messagelist = jd;
  163. _taglist.splice(0, _taglist.length);
  164. _taglist.push.apply(_taglist, jd);
  165. console.log("tag: jd: " + jd);
  166. for (var e in jd) {
  167. if (!_tags[jd[e]]) {
  168. get_insert_tag(jd[e]);
  169. }
  170. }
  171. }).fail(function(e, f, g) {
  172. console.log("err: " + e + f + g);
  173. });
  174. },
  175. clear: function() {
  176. console.log("clear");
  177. isSearchActiv = false;
  178. this.searchtext = "";
  179. this.list_messages();
  180. },
  181. },
  182. mounted: function() {
  183. //this.search();
  184. this.list_tags();
  185. },
  186. });
  187. function get_insert_tag(id) {
  188. $.ajax({
  189. url: "api/tag/" + id,
  190. method: "GET"
  191. }).done(function(tag) {
  192. dat.push("#" + tag.name);
  193. console.log("it worked!");
  194. }).fail(function(e, f, g) {
  195. console.log("cannot load " + id + ".json: " + e + f + g);
  196. })
  197. }
  198. function searching(searchtext) {
  199. isSearchActiv = true;
  200. console.log("Searchtext: " + searchtext.replace(/#/g, ''));
  201. $.ajax({
  202. url: "api/msg/search/" + searchtext.replace(/#/g, ''),
  203. method: "GET"
  204. }).done(jd => {
  205. // NICHT SO wg. Vue: _messagelist = jd;
  206. _messagelist.splice(0, _messagelist.length);
  207. _messagelist.push.apply(_messagelist, jd);
  208. //console.log("jd: "+jd);
  209. for (var e in jd) {
  210. if (!_messages[jd[e]]) {
  211. get_insert_message(jd[e]);
  212. }
  213. }
  214. }).fail(function(e, f, g) {
  215. console.log("searching: err: " + e + f + g);
  216. })
  217. }
  218. function messages() {
  219. $.ajax({
  220. url: "api/msg/ids",
  221. method: "GET"
  222. })
  223. .done(jd => {
  224. // NICHT SO wg. Vue: _messagelist = jd;
  225. _messagelist.splice(0, _messagelist.length);
  226. _messagelist.push.apply(_messagelist, jd);
  227. //console.log("jd: "+jd);
  228. for (var e in jd) {
  229. if (!_messages[jd[e]]) {
  230. get_insert_message(jd[e]);
  231. }
  232. }
  233. }).fail(function(e, f, g) {
  234. console.log("list_msg: err: " + e + f + g);
  235. });
  236. }
  237. const search_data = [];
  238. /*
  239. export.default {
  240. data: function () {
  241. return {
  242. selected: [],
  243. taglist: data,
  244. };
  245. },
  246. computed: {
  247. filteredTagArray() {
  248. this.taglist = data.filter((option) => {
  249. return option
  250. .toString()
  251. .toLowerCase()
  252. .indexOf(this.name.toLowerCase()) >= 0
  253. })
  254. },
  255. },
  256. methods: {
  257. evaluate(text) {
  258. this.taglist = data.filter((option) => {
  259. return option
  260. .toString()
  261. .toLowerCase()
  262. .indexOf(text.toLowerCase()) >= 0
  263. })
  264. },
  265. },
  266. mounted: function () {
  267. if ($(this).bootstrapMaterialDesign)
  268. $(this).bootstrapMaterialDesign();
  269. },
  270. };
  271. */
  272. </script>
  273. <!-- CDN_Vue.js minified lib -->
  274. <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js"></script> -->
  275. <!-- CDN_jQuery minified lib -->
  276. <!--<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>-->
  277. <!-- Load Popper.js -->
  278. <script src="lib/popper-1.12.6.js"></script>
  279. <!-- Load Bootstrap.js -->
  280. <script src="lib/bootstrap-material-design.js"></script>
  281. <!-- NOTE: Call main.js -->
  282. <script src="main.js"></script>
  283. </body>
  284. </html>