mirror of
https://github.com/2ec0b4/kaamelott-soundboard.git
synced 2025-12-08 23:53:24 +00:00
WIP - Mise en place du soundboard
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
define(
|
||||
'controllers/soundboard',
|
||||
[
|
||||
'marionette'
|
||||
'marionette',
|
||||
'views/soundboard'
|
||||
],
|
||||
function (Marionette) {
|
||||
function (Marionette, SoundboardView) {
|
||||
"use strict";
|
||||
|
||||
var SoundboardController = Marionette.Controller.extend({
|
||||
index: function() {
|
||||
var currentView = App.getRegion('app').currentView;
|
||||
|
||||
currentView.showChildView('main', new SoundboardView());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<main>
|
||||
<header class="site-header" role="banner">
|
||||
|
||||
</header>
|
||||
|
||||
<main class="site-main" role="main">
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
|
||||
</footer>
|
||||
|
||||
4
js/app/templates/search.hbs
Normal file
4
js/app/templates/search.hbs
Normal file
@@ -0,0 +1,4 @@
|
||||
<form action="index.html" method="post">
|
||||
<input type="text" name="s" value="">
|
||||
<input type="submit" name="submit" value="Rechercher">
|
||||
</form>
|
||||
7
js/app/templates/soundboard.hbs
Normal file
7
js/app/templates/soundboard.hbs
Normal file
@@ -0,0 +1,7 @@
|
||||
<div id="search">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="list">
|
||||
|
||||
</div>
|
||||
1
js/app/templates/sounds.hbs
Normal file
1
js/app/templates/sounds.hbs
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
15
js/app/views/search.js
Normal file
15
js/app/views/search.js
Normal file
@@ -0,0 +1,15 @@
|
||||
define(
|
||||
'views/search',
|
||||
[
|
||||
'marionette',
|
||||
'hbs!templates/search'
|
||||
],
|
||||
function (Marionette, SoundSearchTemplate) {
|
||||
"use strict";
|
||||
|
||||
var SoundSearchView = Marionette.LayoutView.extend({
|
||||
template: SoundSearchTemplate
|
||||
});
|
||||
|
||||
return SoundSearchView;
|
||||
});
|
||||
27
js/app/views/soundboard.js
Normal file
27
js/app/views/soundboard.js
Normal file
@@ -0,0 +1,27 @@
|
||||
define(
|
||||
'views/soundboard',
|
||||
[
|
||||
'marionette',
|
||||
'views/search',
|
||||
'views/sounds',
|
||||
'hbs!templates/soundboard'
|
||||
],
|
||||
function (Marionette, SoundSearchView, SoundListView, SoundboardTemplate) {
|
||||
"use strict";
|
||||
|
||||
var SoundboardView = Marionette.LayoutView.extend({
|
||||
template: SoundboardTemplate,
|
||||
regions: {
|
||||
'search': '#search',
|
||||
'list': '#list'
|
||||
},
|
||||
onShow: function() {
|
||||
|
||||
this.showChildView('search', new SoundSearchView());
|
||||
this.showChildView('list', new SoundListView());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return SoundboardView;
|
||||
});
|
||||
15
js/app/views/sounds.js
Normal file
15
js/app/views/sounds.js
Normal file
@@ -0,0 +1,15 @@
|
||||
define(
|
||||
'views/sounds',
|
||||
[
|
||||
'marionette',
|
||||
'hbs!templates/sounds'
|
||||
],
|
||||
function (Marionette, SoundListTemplate) {
|
||||
"use strict";
|
||||
|
||||
var SoundListView = Marionette.LayoutView.extend({
|
||||
template: SoundListTemplate
|
||||
});
|
||||
|
||||
return SoundListView;
|
||||
});
|
||||
Reference in New Issue
Block a user