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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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 rounded v-model="searchtext" @keydown.native.enter="search" :data="filteredDataArray" placeholder="suche..." icon="magnify" @select="option => selected = option">
  91. </b-autocomplete>
  92. <!--<b-input
  93. type="search"
  94. v-model="searchtext"
  95. icon="magnify"
  96. placeholder="Suche...">
  97. </b-input>-->
  98. <!--<b-taginput
  99. id="search-text"
  100. type="search"
  101. v-model="selected"
  102. :data=taglist
  103. autocomplete
  104. allow-new:true
  105. icon="magnify"
  106. placeholder="Suche.."
  107. @typing="getFilteredTags"
  108. @input="saveTagsToArray">
  109. </b-taginput>-->
  110. <b-button type="is-light" @click="clear">x</b-button>
  111. </b-field>
  112. </form>
  113. </div>
  114. </div>
  115. <div class="om-content">
  116. <div id=xxx></div>
  117. <nav-router></nav-router>
  118. <router-view></router-view>
  119. </div>
  120. </div>
  121. <!--<b-tabs type="is-toggle" expanded>
  122. <b-tab-item><router-link to="/home" >
  123. <b-icon
  124. pack="fas"
  125. icon="home"
  126. size="is-small">
  127. </b-icon>
  128. </router-link></b-tab-item>
  129. <b-tab-item icon="magnify"></b-tab-item>
  130. <b-tab-item icon="plus-circle"></b-tab-item>
  131. <b-tab-item icon="bookmark"></b-tab-item>
  132. <b-tab-item icon="account"></b-tab-item>
  133. </b-tabs>-->
  134. <!--
  135. <nav class="navbar is-fixed-bottom is-expanded is-light is-hoverable" role="navigation" aria-label="main navigation">
  136. <div class="navbar-brand is-expanded">
  137. <router-link to="/home" class="navbar-item is-expanded has-text-centered is-active">
  138. <i class="material-icons">home</i>
  139. </router-link>
  140. <router-link to="/files" class="navbar-item is-expanded">
  141. <i class="material-icons">language</i>
  142. </router-link>
  143. <router-link to="/createMessage" class="navbar-item is-expanded">
  144. <i class="material-icons">add_circle</i>
  145. </router-link>
  146. <router-link to="/bookmark" class="navbar-item is-expanded">
  147. <i class="material-icons">bookmark</i>
  148. </router-link>
  149. <router-link to="/profil" class="navbar-item is-expanded">
  150. <i class="material-icons">person</i>
  151. </router-link>
  152. </div>
  153. </nav>
  154. <nav class="nav nav-tabs nav-justified om-nav" v-if="$route.path !=='/createMessage' ">
  155. <router-link to="/home" class="navbar-item has-text-centered"><i class="material-icons">home</i></router-link>
  156. <router-link to="/files" class="navbar-item has-text-centered"><i class="material-icons">language</i></router-link>
  157. <router-link to="/createMessage" class="navbar-item has-text-centered outlined"><i class="material-icons">add_circle</i></router-link>
  158. <router-link to="/bookmark" class="navbar-item has-text-centered"><i class="material-icons">bookmark</i></router-link>
  159. <router-link to="/profil" class="navbar-item has-text-centered"><i class="material-icons">person</i></router-link>
  160. </nav>
  161. </div>
  162. -->
  163. <script>
  164. var isSearchActive = false;
  165. var tagArray = ["lorem"];
  166. const dat = [
  167. 'th',
  168. 'efi',
  169. 'wichtig',
  170. ];
  171. </script>
  172. <!-- const routes = [
  173. { path: "/", component: HomeRouter },
  174. { path: "/home", component: HomeRouter },
  175. { path: "/files", component: FileRouter },
  176. { path: "/createMessage", component: CreateMsgRouter },
  177. { path: "/bookmark", component: BookmarkRouter },
  178. { path: "/profil", component: ProfilRouter },
  179. ];
  180. const router = new VueRouter({
  181. routes
  182. }); -->
  183. <script>
  184. var app = new Vue({
  185. router,
  186. el: '#api',
  187. data: function() {
  188. return {
  189. searchtext: "",
  190. //isSearchActiv: false,
  191. selected: [],
  192. taglist: dat,
  193. };
  194. },
  195. computed: {
  196. filteredDataArray() {
  197. return this.taglist.filter((option) => {
  198. return option
  199. .toString()
  200. .toLowerCase()
  201. .indexOf(this.searchtext.toLowerCase()) >= 0
  202. })
  203. }
  204. },
  205. methods: {
  206. getFilteredTags(text) {
  207. this.taglist = dat.filter((option) => {
  208. return option
  209. .toString()
  210. .toLowerCase()
  211. .indexOf(text.toLowerCase()) >= 0
  212. })
  213. this.search();
  214. },
  215. saveTagsToArray: function() {
  216. tagArray = this.selected;
  217. console.info(tagArray);
  218. },
  219. search: function() {
  220. searching(this.searchtext);
  221. },
  222. list_messages: function() {
  223. messages();
  224. },
  225. list_tags: function() {
  226. $.ajax({
  227. url: "api/tag/ids",
  228. method: "GET"
  229. })
  230. .done(jd => {
  231. // NICHT SO wg. Vue: _messagelist = jd;
  232. _taglist.splice(0, _taglist.length);
  233. _taglist.push.apply(_taglist, jd);
  234. console.log("tag: jd: " + jd);
  235. for (var e in jd) {
  236. if (!_tags[jd[e]]) {
  237. get_insert_tag(jd[e]);
  238. }
  239. }
  240. }).fail(function(e, f, g) {
  241. console.log("err: " + e + f + g);
  242. });
  243. },
  244. clear: function() {
  245. console.log("clear");
  246. isSearchActiv = false;
  247. this.searchtext = "";
  248. this.list_messages();
  249. },
  250. },
  251. mounted: function() {
  252. //this.search();
  253. this.list_tags();
  254. },
  255. });
  256. function get_insert_tag(id) {
  257. $.ajax({
  258. url: "api/tag/" + id,
  259. method: "GET"
  260. }).done(function(tag) {
  261. dat.push("#" + tag.name);
  262. console.log("it worked!");
  263. }).fail(function(e, f, g) {
  264. console.log("cannot load " + id + ".json: " + e + f + g);
  265. })
  266. }
  267. function searching(searchtext) {
  268. isSearchActiv = true;
  269. console.log("Searchtext: " + searchtext.replace(/#/g, ''));
  270. $.ajax({
  271. url: "api/msg/search/" + searchtext.replace(/#/g, ''),
  272. method: "GET"
  273. }).done(jd => {
  274. // NICHT SO wg. Vue: _messagelist = jd;
  275. _messagelist.splice(0, _messagelist.length);
  276. _messagelist.push.apply(_messagelist, jd);
  277. //console.log("jd: "+jd);
  278. for (var e in jd) {
  279. if (!_messages[jd[e]]) {
  280. get_insert_message(jd[e]);
  281. }
  282. }
  283. }).fail(function(e, f, g) {
  284. console.log("searching: err: " + e + f + g);
  285. })
  286. }
  287. function messages() {
  288. $.ajax({
  289. url: "api/msg/ids",
  290. method: "GET"
  291. })
  292. .done(jd => {
  293. // NICHT SO wg. Vue: _messagelist = jd;
  294. _messagelist.splice(0, _messagelist.length);
  295. _messagelist.push.apply(_messagelist, jd);
  296. //console.log("jd: "+jd);
  297. for (var e in jd) {
  298. if (!_messages[jd[e]]) {
  299. get_insert_message(jd[e]);
  300. }
  301. }
  302. }).fail(function(e, f, g) {
  303. console.log("list_msg: err: " + e + f + g);
  304. });
  305. }
  306. const search_data = [];
  307. /*
  308. export.default {
  309. data: function () {
  310. return {
  311. selected: [],
  312. taglist: data,
  313. };
  314. },
  315. computed: {
  316. filteredTagArray() {
  317. this.taglist = data.filter((option) => {
  318. return option
  319. .toString()
  320. .toLowerCase()
  321. .indexOf(this.name.toLowerCase()) >= 0
  322. })
  323. },
  324. },
  325. methods: {
  326. evaluate(text) {
  327. this.taglist = data.filter((option) => {
  328. return option
  329. .toString()
  330. .toLowerCase()
  331. .indexOf(text.toLowerCase()) >= 0
  332. })
  333. },
  334. },
  335. mounted: function () {
  336. if ($(this).bootstrapMaterialDesign)
  337. $(this).bootstrapMaterialDesign();
  338. },
  339. };
  340. */
  341. </script>
  342. <!-- CDN_Vue.js minified lib -->
  343. <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js"></script> -->
  344. <!-- CDN_jQuery minified lib -->
  345. <!--<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>-->
  346. <!-- Load Popper.js -->
  347. <script src="lib/popper-1.12.6.js"></script>
  348. <!-- Load Bootstrap.js -->
  349. <script src="lib/bootstrap-material-design.js"></script>
  350. <!-- NOTE: Call main.js -->
  351. <script src="main.js"></script>
  352. </body>
  353. </html>