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 10.0KB

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