Commit 7498c37d authored by Gautam Chitnis's avatar Gautam Chitnis

Refactor (VLM): Vue Component for VLM Modal Added

This commit creates Vue Component for VLM Modal.
Existing functionality of the Modal is intact.
An unused js file and its reference has been removed in this commit as well.

Gautam C.
parent 70eef05b
......@@ -12,7 +12,6 @@
<script src='src/vendors/vue/vue.js'></script>
<script src="src/vendors/plyr/plyr.js"></script>
<script src="src/services/command.js"></script>
<script src="src/utils/data-vars.js"></script>
<script src='src/components/playlist/playlist.component.js'></script>
<script src="src/services/initialize.js"></script>
<script src="src/components/player/plyr.methods.js"></script>
......@@ -42,35 +41,17 @@
<playlist></playlist>
</div>
</div>
<!-- Modal -->
<div id="vlmModal" class="modal fade" role="dialog">
<vlm-modal></vlm-modal>
</div>
</div>
<div id="videoPlayer" class="">
<!-- Video -->
<video></video>
</div>
<!-- Modal -->
<div id="vlmModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Write your VLM commands here (seperated by new line)</h4>
</div>
<div class="modal-body" id="">
<textarea id="vlm-command" cols="30 " rows="5"></textarea>
<div id="status">
status:
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="executeVLM()">Submit</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
<!-- Templates -->
......@@ -127,4 +108,28 @@
</div>
</script>
<!-- vlm modal Template -->
<script type="text/x-template" id="vlm-modal-template">
<div>
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Write your VLM commands here (seperated by new line)</h4>
</div>
<div class="modal-body" id="">
<textarea id="vlm-command" cols="30 " rows="5"></textarea>
<div id="status">
status:
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="bus.$emit('executeVLM')">Submit</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</script>
</html>
function executeVLM()
{
var cmd = document.getElementById("vlm-command").value;
sendCommand(2,"?command="+cmd);
console.log(xmlData);
}
\ No newline at end of file
Vue.component('vlm-modal', {
template: '#vlm-modal-template',
methods: {
executeVLM: function () {
var cmd = document.getElementById("vlm-command").value;
sendCommand(2,"?command="+cmd);
//console.log(xmlData);
}
},
created: function()
{
bus.$on('executeVLM', function()
{
this.executeVLM();
}.bind(this));
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment