@@ -0,0 +1,7 @@ | |||
{ | |||
"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" | |||
} |
@@ -0,0 +1,7 @@ | |||
{ | |||
"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.", | |||
"tag": "#efi #bme #semester", | |||
"user": "user_1" | |||
} |
@@ -0,0 +1,7 @@ | |||
{ | |||
"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 #bme #semester", | |||
"user": "user_1" | |||
} |
@@ -1,20 +1,30 @@ | |||
const HomeRouter = { | |||
template: ` | |||
<div> | |||
template: ` | |||
<div id="om-msg-cards"> | |||
<MsgCard | |||
v-for="(msg, index) in messages" | |||
:key="msg.id" | |||
:msg="msg" | |||
v-for="id in messagelist" | |||
:key="id" | |||
:msg="messages[id] || {}" | |||
></MsgCard> | |||
</div>`, | |||
data: function () { | |||
return { messages: _messages }; | |||
}, | |||
methods: { | |||
data: function () { | |||
return { | |||
messagelist: _messagelist, | |||
messages: _messages, | |||
}; | |||
}, | |||
methods: { | |||
refresh_messages: function () { | |||
_messages.push ({id: 42, subject: "xxx", message: "warum habt ihr auch so viel", user: "nobody", tags:"foo"}); | |||
_messages.push({ //////// alt | |||
id: 42, | |||
subject: "xxx", | |||
message: "warum habt ihr auch so viel", | |||
user: "nobody", | |||
tags: "foo" | |||
}); | |||
}, | |||
}, | |||
}, | |||
/*mounted: function() { | |||
this.refresh_messages(); | |||
}*/ |
@@ -53,13 +53,43 @@ | |||
<script src="profilCard.js"></script> | |||
<script src="profilData.js"></script> | |||
<script type = "text/javascript" language = "javascript"> | |||
function get_insert_message (id) { | |||
$.get (id+".json" | |||
) .done (function (msg) { | |||
// _messages[id] = msg; | |||
Vue.set (_messages, id, msg); | |||
}) .fail (function (e,f,g) { | |||
console.log ("cannot load "+id+".json: "+e+f+g); | |||
}) | |||
} | |||
$(document).ready(function() { | |||
console.log("egal"); | |||
$.get('list.json' | |||
) .done (function (jd) { | |||
// _messagelist = jd; | |||
_messagelist.splice (0, _messagelist.length); | |||
_messagelist.push.apply (_messagelist, jd); | |||
console.log("egal2"); | |||
//$('#xxx').text(jd[0]); | |||
for (var e in jd) { | |||
if (! _messages[jd[e]]) { | |||
get_insert_message (jd[e]); | |||
} | |||
} | |||
}) .fail (function(e,f,g) { | |||
console.log("egal3: "+e+f+g ); | |||
}); | |||
}); | |||
</script> | |||
<title>OMApp</title> | |||
</head> | |||
<body> | |||
<div id="app"> | |||
<div id="api"> | |||
<div class="om-header-container"> | |||
<div class="om-header"> | |||
<a href="index.html"><img src="img/th_nbg_ohmicon_amp.png" width=55px height=55px></a> | |||
@@ -70,6 +100,7 @@ | |||
</div> | |||
<div class="om-content"> | |||
<div id=xxx></div> | |||
<router-view></router-view> | |||
</div> | |||
@@ -97,7 +128,7 @@ | |||
}); | |||
var app = new Vue({ | |||
router, | |||
el: '#app' | |||
el: '#api' | |||
}); | |||
</script> | |||
@@ -111,7 +142,7 @@ | |||
<!-- CDN_Bootstrap JS lib --> | |||
<script src="https://unpkg.com/bootstrap-material-design@4.1.1/dist/js/bootstrap-material-design.js" integrity="sha384-CauSuKpEqAFajSpkdjv3z9t8E7RlpJ1UP0lKM/+NdtSarroVKu069AlsRPKkFBz9" crossorigin="anonymous"></script> | |||
<!-- NOTE: Call main.js --> | |||
<script src="main.js"></script> | |||
<xxxscript src="main.js"></script> | |||
</body> | |||
@@ -0,0 +1 @@ | |||
["1","2","3"] |
@@ -1,23 +1,2 @@ | |||
_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' | |||
}, | |||
]; | |||
_messagelist = []; | |||
_messages = {}; |
@@ -0,0 +1,23 @@ | |||
[ | |||
{ | |||
"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" | |||
} | |||
] |