mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-28 23:06:43 -04:00
Moved source code under src folder - massive change
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<ul id="main-menu-region">
|
||||
<div class="pull-left logo">
|
||||
<a href="/">
|
||||
<img src="/Content/Images/logo.png" alt="NzbDrone">
|
||||
</a>
|
||||
</div>
|
||||
<li>
|
||||
<a href="/">
|
||||
<i class="icon-play"></i>
|
||||
<br>
|
||||
Series
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/calendar">
|
||||
<i class="icon-calendar"></i>
|
||||
<br>
|
||||
Calendar
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="history">
|
||||
<i class="icon-time"></i>
|
||||
<br>
|
||||
History
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="missing">
|
||||
<i class="icon-warning-sign"></i>
|
||||
<br>
|
||||
Missing
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="settings">
|
||||
<i class="icon-cogs"></i>
|
||||
<br>
|
||||
Settings
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="system">
|
||||
<i class="icon-laptop"></i>
|
||||
<br>
|
||||
System
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HGGGM7JT5YVSS" target="_blank">
|
||||
<i class="icon-nd-donate"></i>
|
||||
<br>
|
||||
Donate
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<div class="search">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-search"></i></span>
|
||||
<input class="span4 x-series-search" id="prependedInput" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Navbar/Search'
|
||||
], function (Marionette) {
|
||||
return Marionette.ItemView.extend({
|
||||
template : 'Navbar/NavbarTemplate',
|
||||
|
||||
ui: {
|
||||
search: '.x-series-search'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click a': 'onClick'
|
||||
},
|
||||
|
||||
onRender: function (){
|
||||
this.ui.search.bindSearch();
|
||||
},
|
||||
|
||||
onClick: function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var target = $(event.target);
|
||||
|
||||
//look down for <a/>
|
||||
var href = event.target.getAttribute('href');
|
||||
|
||||
//if couldn't find it look up
|
||||
if (!href && target.parent('a') && target.parent('a')[0]) {
|
||||
|
||||
var linkElement = target.parent('a')[0];
|
||||
|
||||
href = linkElement.getAttribute('href');
|
||||
this.setActive(linkElement);
|
||||
}
|
||||
else {
|
||||
this.setActive(event.target);
|
||||
}
|
||||
},
|
||||
|
||||
setActive: function (element) {
|
||||
//Todo: Set active on first load
|
||||
this.$('a').removeClass('active');
|
||||
$(element).addClass('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'Series/SeriesCollection'
|
||||
], function (App, SeriesCollection) {
|
||||
$(document).on('keydown', function (e){
|
||||
if ($(e.target).is('input')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.keyCode === 84) {
|
||||
$('.x-series-search').focus();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$.fn.bindSearch = function () {
|
||||
$(this).typeahead({
|
||||
source : function () {
|
||||
return SeriesCollection.pluck('title');
|
||||
},
|
||||
|
||||
sorter: function (items) {
|
||||
return items.sort();
|
||||
},
|
||||
|
||||
updater: function (item) {
|
||||
var series = SeriesCollection.findWhere({ title: item });
|
||||
|
||||
this.$element.blur();
|
||||
App.Router.navigate('/series/{0}'.format(series.get('titleSlug')), { trigger: true });
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user