Browse Source

refactoring home.js; bookmark.js hinzugefügt

pull/1/head
Edwina Barbalan 6 years ago
parent
commit
2f9750eae4
7 changed files with 69 additions and 50 deletions
  1. 16
    0
      public/bookmark.js
  2. 0
    40
      public/home.js
  3. 8
    10
      public/index.html
  4. 23
    0
      public/messageData.js
  5. 14
    0
      public/msgCard.js
  6. 3
    0
      public/style/style.css
  7. 5
    0
      public/style/style.less

+ 16
- 0
public/bookmark.js View File

const BookmarkRouter = {
template: `
<div>
<div class="bookmark-headline"><h4><b>Gepeicherte Beiträge</b></h4></div>
<MsgCard
v-for="(msg, index) in messages"
:key="msg.id"
:msg="msg"
></MsgCard>
</div>`,
data: function () {
return { messages: _messages };
},
methods: {
},
};

+ 0
- 40
public/home.js View File

_messages = [
{
id: 1,
subject: 'Betreff',
message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.',
tag: '#efi #bme #semester',
user: 'user_1'
},
{
id: 2,
subject: 'Betreff',
message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
tag: '#efi #fachschaft',
user: 'user_2'
},
{
id: 3,
subject: 'Betreff',
message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.',
tag: '#efi #bei #wichtig',
user: 'user_3'
},
];


Vue.component('MsgCard', {
template: `<div class="om-card card">
<h6 class="msg-head">
<b>{{ msg.subject }}</b>
<img src="favicon.ico" width=20px height=20px>
</h6>
{{ msg.message }}<br><br>
<a href="#">{{ msg.tag }}</a></p>
<div class="om-user-line">
<i class="material-icons">account_circle</i>
Erstellt von {{ msg.user }}
</div></div>`,
props: ['msg']
});

const HomeRouter = { const HomeRouter = {
template: ` template: `
<div> <div>

+ 8
- 10
public/index.html View File

<script src=lib/vue.js></script> <script src=lib/vue.js></script>
<script src=lib/vue-router.js></script> <script src=lib/vue-router.js></script>


<!-- NOTE: Call Vue Components -->
<!-- NOTE: JavaScript Libs & Files -->
<script src="home.js"></script> <script src="home.js"></script>
<!-- <script src="files.js"></script> -->
<script src="files.js"></script>
<script src="createMessage.js"></script> <script src="createMessage.js"></script>
<script src="bookmark.js"></script> <script src="bookmark.js"></script>
<script src="profil.js"></script> <script src="profil.js"></script>
<script src="msgCard.js"></script>
<script src="messageData.js"></script>




<title>OMApp</title> <title>OMApp</title>
const routes = [ const routes = [
{ path: "/", component: HomeRouter }, { path: "/", component: HomeRouter },
{ path: "/home", component: HomeRouter }, { path: "/home", component: HomeRouter },
/* { path: "/files", component: Files },
{ path: "/createMessage", component: CreateMsg },
{ path: "/bookmark", component: Bookmark },
{ path: "/profil", component: Profil },*/
{ path: "/bookmark", component: BookmarkRouter },
/* { path: "/files", component: FileRouter },
{ path: "/createMessage", component: CreateMsgRouter },
{ path: "/profil", component: ProfilRouter },*/
]; ];
const router = new VueRouter({ const router = new VueRouter({
routes routes


</script> </script>


<!-- NOTE: JavaScript Libs & Files -->
<!-- CDN_Vue.js developmement lib -->
<!--<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>-->
<!-- CDN_Vue.js minified lib --> <!-- CDN_Vue.js minified lib -->
<!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js"></script> --> <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js"></script> -->
<!-- CDN_jQuery minified lib --> <!-- CDN_jQuery minified lib -->
<!-- NOTE: Call main.js --> <!-- NOTE: Call main.js -->
<script src="main.js"></script> <script src="main.js"></script>



</body> </body>


</html> </html>

+ 23
- 0
public/messageData.js View File

_messages = [
{
id: 1,
subject: 'Betreff',
message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.',
tag: '#efi #bme #semester',
user: 'user_1'
},
{
id: 2,
subject: 'Betreff',
message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
tag: '#efi #fachschaft',
user: 'user_2'
},
{
id: 3,
subject: 'Betreff',
message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.',
tag: '#efi #bei #wichtig',
user: 'user_3'
},
];

+ 14
- 0
public/msgCard.js View File

Vue.component('MsgCard', {
template: `<div class="om-card card">
<h6 class="msg-head">
<b>{{ msg.subject }}</b>
<img src="favicon.ico" width=20px height=20px>
</h6>
{{ msg.message }}<br><br>
<a href="#">{{ msg.tag }}</a></p>
<div class="om-user-line">
<i class="material-icons">account_circle</i>
Erstellt von {{ msg.user }}
</div></div>`,
props: ['msg']
});

+ 3
- 0
public/style/style.css View File

.om-nav i { .om-nav i {
color: white; color: white;
} }
.bookmark-headline {
margin: 10px;
}
.form-group.is-focused .form-control { .form-group.is-focused .form-control {
background-image: linear-gradient(0deg, #0046a0 2px, rgba(0, 150, 136, 0) 0), linear-gradient(0deg, rgba(0, 0, 0, 0.26) 1px, transparent 0); background-image: linear-gradient(0deg, #0046a0 2px, rgba(0, 150, 136, 0) 0), linear-gradient(0deg, rgba(0, 0, 0, 0.26) 1px, transparent 0);
} }

+ 5
- 0
public/style/style.less View File

} }
} }


// bookmark
.bookmark-headline{
margin: 10px;
}



//bmd changes //bmd changes



Loading…
Cancel
Save