From 26ac5275179520e0c1a2b5d583d37cbec5cab917 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 22 Sep 2014 20:04:50 -0400 Subject: [PATCH] add custom intros path --- dashboard-ui/channelsettings.html | 2 +- dashboard-ui/cinemamodeconfiguration.html | 39 +++++++++++-------- dashboard-ui/css/site.css | 4 ++ .../scripts/cinemamodeconfiguration.js | 28 ++++++++++++- 4 files changed, 55 insertions(+), 18 deletions(-) diff --git a/dashboard-ui/channelsettings.html b/dashboard-ui/channelsettings.html index f910097f4c..4c2cdc696a 100644 --- a/dashboard-ui/channelsettings.html +++ b/dashboard-ui/channelsettings.html @@ -51,7 +51,7 @@
${LabelChannelDownloadSizeLimitHelp}
-
${ButtonLearnMore}
+
${ButtonLearnMore}
  • diff --git a/dashboard-ui/cinemamodeconfiguration.html b/dashboard-ui/cinemamodeconfiguration.html index 38cb5be0d7..87ad3b7df3 100644 --- a/dashboard-ui/cinemamodeconfiguration.html +++ b/dashboard-ui/cinemamodeconfiguration.html @@ -18,9 +18,7 @@

    ${CinemaModeConfigurationHelp}

    -

    ${ButtonThisFeatureRequiresSupporter}

    -
    -
    +
    ${LabelEnableCinemaModeFor} @@ -30,27 +28,36 @@

    -
    -
    - ${LabelEnableTheFollowingIntros} - - - - -
    -
    ${LabelEnableTheFollowingIntrosHelp}
    -
    -
    • - - + + +
      ${OptionTrailersFromMyMoviesHelp}
      + +
    • +
    • + + +
      ${LabelThisFeatureRequiresSupporterHelp}
      +
    • ${LabelEnableIntroParentalControlHelp}
    • +
    • + + +
    • +
    • + +
      + +
      + +
      ${LabelCustomIntrosPathHelp}
      +

      diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 443afb7173..3b83fb9712 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -274,6 +274,10 @@ h1 .imageLink { border-radius: 5px; } +.fieldDescription + .fieldDescription { + margin-top: 5px; +} + .ulForm { margin-bottom: 20px !important; } diff --git a/dashboard-ui/scripts/cinemamodeconfiguration.js b/dashboard-ui/scripts/cinemamodeconfiguration.js index 5ab5e64cd0..e5b0ba0eb5 100644 --- a/dashboard-ui/scripts/cinemamodeconfiguration.js +++ b/dashboard-ui/scripts/cinemamodeconfiguration.js @@ -11,10 +11,34 @@ $('#chkUnwatchedOnly', page).checked(!config.EnableIntrosForWatchedContent).checkboxradio('refresh'); $('#chkEnableParentalControl', page).checked(config.EnableIntrosParentalControl).checkboxradio('refresh'); + $('#txtCustomIntrosPath', page).val(config.CustomIntroPath || ''); + Dashboard.hideLoadingMsg(); } - $(document).on('pageshow', "#cinemaModeConfigurationPage", function () { + $(document).on('pageinit', "#cinemaModeConfigurationPage", function () { + + var page = this; + + $('#btnSelectCustomIntrosPath', page).on("click.selectDirectory", function () { + + var picker = new DirectoryBrowser(page); + + picker.show({ + + callback: function (path) { + + if (path) { + $('#txtCustomIntrosPath', page).val(path); + } + picker.close(); + }, + + header: Globalize.translate('HeaderSelectCustomIntrosPath') + }); + }); + + }).on('pageshow', "#cinemaModeConfigurationPage", function () { Dashboard.showLoadingMsg(); @@ -41,6 +65,8 @@ ApiClient.getNamedConfiguration("cinemamode").done(function (config) { + config.CustomIntroPath = $('#txtCustomIntrosPath', page).val(); + config.EnableIntrosForMovies = $('#chkMovies', page).checked(); config.EnableIntrosForEpisodes = $('#chkEpisodes', page).checked(); config.EnableIntrosFromMoviesInLibrary = $('#chkMyMovieTrailers', page).checked();