Skip to content

Commit

Permalink
Moved away from paper-tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
softworkz committed Jul 22, 2016
1 parent 8a0ccc6 commit 0ae34c9
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 110 deletions.
25 changes: 15 additions & 10 deletions MovieOrganizer/Html/fileorganizer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['dialogHelper', 'paper-checkbox', 'paper-input', 'paper-button', 'paper-icon-button-light', 'paper-icon-item', 'html!bower_components/paper-tabs/paper-tabs.html'], function (dialogHelper) {
define(['dialogHelper', 'paper-checkbox', 'paper-input', 'emby-button', 'paper-icon-button-light'], function (dialogHelper) {

var extractedName;
var extractedYear;
Expand Down Expand Up @@ -125,8 +125,6 @@
context.querySelector('#selectSeriesFolder').innerHTML = seriesFolderHtml;
context.querySelector('#selectMovieFolder').innerHTML = movieFolderHtml;

context.querySelector('#paperTabs').selectIndex(0);

}, onApiFailure);

}, onApiFailure);
Expand Down Expand Up @@ -239,7 +237,7 @@

require(['components/itemidentifier/itemidentifier'], function (itemidentifier) {

itemidentifier.showFindNew(extractedName, extractedYear, 'Series').then(function (newItem) {
itemidentifier.showFindNew(extractedName || '', extractedYear, 'Series').then(function (newItem) {

if (newItem != null) {
currentNewItem = newItem;
Expand Down Expand Up @@ -267,14 +265,13 @@

require(['components/itemidentifier/itemidentifier'], function (itemidentifier) {

itemidentifier.showFindNew(extractedName, extractedYear, 'Movie').then(function (newItem) {
itemidentifier.showFindNew(extractedName || '', extractedYear, 'Movie').then(function (newItem) {

if (newItem != null) {
currentNewItem = newItem;
var movieName = currentNewItem.Name;

if (currentNewItem.ProductionYear)
{
if (currentNewItem.ProductionYear) {
movieName = movieName + ' (' + currentNewItem.ProductionYear + ')';
}

Expand Down Expand Up @@ -302,10 +299,14 @@
function selectTab(dlg, tabIndex) {

if (tabIndex == 0) {
dlg.querySelector('#episode').classList.add('ui-btn-active');
dlg.querySelector('#movie').classList.remove('ui-btn-active');
dlg.querySelector('#organizeSeries').classList.remove('hide');
dlg.querySelector('#organizeMovies').classList.add('hide');
}
else {
dlg.querySelector('#episode').classList.remove('ui-btn-active');
dlg.querySelector('#movie').classList.add('ui-btn-active');
dlg.querySelector('#organizeSeries').classList.add('hide');
dlg.querySelector('#organizeMovies').classList.remove('hide');
}
Expand Down Expand Up @@ -393,10 +394,14 @@
selectedSeriesChanged(dlg);
});

dlg.querySelector('#paperTabs').addEventListener('iron-select', function (e) {
dlg.querySelector('#episode').addEventListener('click', function (e) {

selectTab(dlg, 0);
});

dlg.querySelector('#movie').addEventListener('click', function (e) {

var tabs = dlg.querySelector('#paperTabs');
selectTab(dlg, tabs.selected);
selectTab(dlg, 1);
});

selectTab(dlg, 0);
Expand Down
175 changes: 77 additions & 98 deletions MovieOrganizer/Html/fileorganizer.template.html
Original file line number Diff line number Diff line change
@@ -1,112 +1,91 @@
<div class="dialogHeader" style="margin:0;">
<button is="paper-icon-button-light" class="btnCancel" tabindex="-1"><iron-icon icon="arrow-back"></iron-icon></button>
<div class="dialogHeader" style="margin:0 0 2em;">
<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1">
<i class="md-icon">&#xE5C4;</i>
</button>
<div class="dialogHeaderTitle">
</div>
</div>

<style>
paper-tabs {
background-color: #020202;
color: #fff;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
}

paper-tab {
text-transform: uppercase;
font-weight: 400;
}

paper-tabs #selectionBar {
background-color: #52B54B !important;
}

paper-tabs paper-ripple {
color: #52B54B !important;
}
</style>

<paper-tabs id="paperTabs" hidescrollbuttons style="padding: 0;">
<paper-tab>
<div>Series Episode</div>
</paper-tab>

<paper-tab>
<div>Organize Movie</div>
</paper-tab>
</paper-tabs>
<div id="tabcontainer" class="readOnlyContent" style="margin:auto;">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true" style="margin-top: 1em">
<a id="episode" href="#" data-role="button" class="ui-btn-active">Series Episode</a>
<a id="movie" href="#" data-role="button">Organize Movie</a>
</div>
</div>

<div style="margin-top:20px;">
<div id="organizeSeries">
<form class="episodeCorrectionForm" style="margin:auto;">
<form id="organizeSeries" class="episodeCorrectionForm" style="margin:auto;">

<p><b>Filename:</b><br /><span class="inputFile"></span></p>
<p class="paraInputSeriesName"><b>Extracted Series Name:</b><br /><span class="inputSeriesName"></span></p>
<p class="paraInputYear"><b>Extracted Year::</b><br /><span class="inputYear"></span></p>
<p><b>Filename:</b><br /><span class="inputFile"></span></p>
<p class="paraInputSeriesName"><b>Extracted Series Name:</b><br /><span class="inputSeriesName"></span></p>
<p class="paraInputYear"><b>Extracted Year::</b><br /><span class="inputYear"></span></p>

<div style="margin: 2em 0 1em;">
<div style="width:85%;display:inline-block;">
<label for="selectSeries" class="selectLabel">${LabelSeries}</label>
<select id="selectSeries" data-mini="true" required="required"></select>
</div>
<button type="button" is="paper-icon-button-light" id="btnNewSeries" title="${ButtonNew}"><iron-icon icon="add"></iron-icon></button>
</div>
<div class="fldSelectSeriesFolder hide" style="margin: 1em 0 1em;">
<div style="width:100%;display:inline-block;">
<label for="selectSeriesFolder" class="selectLabel">Series Root Folder</label>
<select id="selectSeriesFolder" data-mini="true"></select>
</div>
</div>
<div style="margin: 1em 0;">
<paper-input id="txtSeason" type="number" pattern="[0-9]*" required min="0" label="${LabelSeasonNumber}"></paper-input>
</div>
<div style="margin: 1em 0;">
<paper-input id="txtEpisode" type="number" pattern="[0-9]*" required min="0" label="${LabelEpisodeNumber}"></paper-input>
</div>
<div style="margin: 1em 0;">
<paper-input id="txtEndingEpisode" type="number" pattern="[0-9]*" min="0" label="${LabelEndingEpisodeNumber}"></paper-input>
<div class="fieldDescription">${LabelEndingEpisodeNumberHelp}</div>
</div>
<div class="fldRemember hide">
<br />
<paper-checkbox type="checkbox" id="chkRememberCorrection">${OptionRememberOrganizeCorrection} <span class="extractedName" style="font-weight: bold; font-style: italic" /></paper-checkbox>
</div>
<br />
<button type="submit" data-role="none" class="clearButton">
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonOk}</span></paper-button>
</button>
<input id="hfResultId" type="hidden" />
</form>
<div style="margin: 2em 0 1em;">
<div style="width:85%;display:inline-block;">
<label for="selectSeries" class="selectLabel">${LabelSeries}</label>
<select id="selectSeries" data-mini="true" required="required"></select>
</div>
<button type="button" is="paper-icon-button-light" id="btnNewSeries" class="autoSize" title="${ButtonNew}">
<i class="md-icon">add</i>
</button>
</div>
<div class="fldSelectSeriesFolder hide" style="margin: 1em 0 1em;">
<div style="width:100%;display:inline-block;">
<label for="selectSeriesFolder" class="selectLabel">Series Root Folder</label>
<select id="selectSeriesFolder" data-mini="true"></select>
</div>
</div>
<div style="margin: 1em 0;">
<paper-input id="txtSeason" type="number" pattern="[0-9]*" required min="0" label="${LabelSeasonNumber}"></paper-input>
</div>
<div style="margin: 1em 0;">
<paper-input id="txtEpisode" type="number" pattern="[0-9]*" required min="0" label="${LabelEpisodeNumber}"></paper-input>
</div>
<div style="margin: 1em 0;">
<paper-input id="txtEndingEpisode" type="number" pattern="[0-9]*" min="0" label="${LabelEndingEpisodeNumber}"></paper-input>
<div class="fieldDescription">${LabelEndingEpisodeNumberHelp}</div>
</div>
<div class="fldRemember hide">
<br />
<paper-checkbox type="checkbox" id="chkRememberCorrection">${OptionRememberOrganizeCorrection} <span class="extractedName" style="font-weight: bold; font-style: italic" /></paper-checkbox>
</div>
<br />
<button is="emby-button" type="submit" class="raised submit block">
<i class="md-icon">check</i>
<span>${ButtonOk}</span>
</button>
<input id="hfResultId" type="hidden" />
</form>

<div id="organizeMovies" class="hide">
<form class="organizeMovieForm" style="margin:auto;">
<form class="organizeMovieForm" id="organizeMovies" class="hide" style="margin:auto;">

<p><b>Filename:</b><br /><span class="inputFile2"></span></p>
<p class="paraInputSeriesName2"><b>Extracted Name:</b><br /><span class="inputSeriesName2"></span></p>
<p class="paraInputYear2"><b>Extracted Year::</b><br /><span class="inputYear2"></span></p>
<p><b>Filename:</b><br /><span class="inputFile2"></span></p>
<p class="paraInputSeriesName2"><b>Extracted Name:</b><br /><span class="inputSeriesName2"></span></p>
<p class="paraInputYear2"><b>Extracted Year::</b><br /><span class="inputYear2"></span></p>

<div style="margin: 2em 0 1em;">
<button type="button" data-role="none" class="clearButton" id="btnIdentifyMovie">
<paper-button raised class="submit block"><iron-icon icon="search"></iron-icon><span>Identify Movie</span></paper-button>
</button>
</div>
<div style="margin: 2em 0 1em;">
<button is="emby-button" type="button" class="raised block" id="btnIdentifyMovie">
<i class="md-icon">check</i>
<span>Identify Movie</span>
</button>
</div>

<div id="identifiedMovie" class="hide">
<div style="margin: 1em 0;">
<paper-input id="txtSelectedMovie" required readonly label="Identified Movie"></paper-input>
</div>
<br />
<div class="fldSelectMovieFolder" style="margin: 1em 0 1em;">
<div style="width:100%;display:inline-block;">
<label for="selectMovieFolder" class="selectLabel">Movie Root Folder</label>
<select id="selectMovieFolder" data-mini="true"></select>
</div>
</div>
<button type="submit" data-role="none" class="clearButton">
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonOk}</span></paper-button>
</button>
<div id="identifiedMovie" class="hide">
<div style="margin: 1em 0;">
<paper-input id="txtSelectedMovie" required readonly label="Identified Movie"></paper-input>
</div>
<br />
<div class="fldSelectMovieFolder" style="margin: 1em 0 1em;">
<div style="width:100%;display:inline-block;">
<label for="selectMovieFolder" class="selectLabel">Movie Root Folder</label>
<select id="selectMovieFolder" data-mini="true"></select>
</div>
<input id="hfResultIdMovie" type="hidden" />
</form>
</div>
<button is="emby-button" type="submit" class="raised submit block">
<i class="md-icon">check</i>
<span>${ButtonOk}</span>
</button>
</div>
</div>
<input id="hfResultIdMovie" type="hidden" />
</form>

<div id="bottomspace" style="min-height: 1em;" />
4 changes: 2 additions & 2 deletions MovieOrganizer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MovieOrganizer Beta 1")]
[assembly: AssemblyDescription("Beta 1")]
[assembly: AssemblyTitle("MovieOrganizer Beta 3")]
[assembly: AssemblyDescription("Beta 3")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MovieOrganizer")]
Expand Down

0 comments on commit 0ae34c9

Please sign in to comment.