Orchard/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/cloudmedia-admin-settings.js

97 lines
17 KiB
JavaScript
Raw Normal View History

/*
** NOTE: This file is generated by Gulp and should not be edited directly!
** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp.
*/
/// <reference path="Typings/jquery.d.ts" />
/// <reference path="Typings/jqueryui.d.ts" />
/// <reference path="Typings/knockout.d.ts" />
var Orchard;
(function (Orchard) {
var Azure;
(function (Azure) {
var MediaServices;
(function (MediaServices) {
var Admin;
(function (Admin) {
var Settings;
(function (Settings) {
var StringItem = (function () {
function StringItem(value) {
this.value = ko.observable(value);
}
return StringItem;
})();
Settings.StringItem = StringItem;
var EncodingPreset = (function () {
function EncodingPreset(name, customXml) {
this.name = ko.observable(name);
this.customXml = ko.observable(customXml);
this.isExpanded = ko.observable(false);
this.type = ko.computed(function () {
var customXml = this.customXml();
if (!!customXml && customXml.length > 0)
return "Custom preset";
return "Standard preset";
}, this);
}
EncodingPreset.prototype.toggle = function () {
this.isExpanded(!this.isExpanded());
};
return EncodingPreset;
})();
Settings.EncodingPreset = EncodingPreset;
Settings.clientViewModel = {
wamsEncodingPresets: ko.observableArray(),
defaultWamsEncodingPresetIndex: ko.observable(),
subtitleLanguages: ko.observableArray()
};
function deleteWamsEncodingPreset(preset) {
var removedIndex = Settings.clientViewModel.wamsEncodingPresets.indexOf(preset);
Settings.clientViewModel.wamsEncodingPresets.remove(preset);
if (removedIndex === Settings.clientViewModel.defaultWamsEncodingPresetIndex())
Settings.clientViewModel.defaultWamsEncodingPresetIndex(0);
else if (removedIndex < Settings.clientViewModel.defaultWamsEncodingPresetIndex())
Settings.clientViewModel.defaultWamsEncodingPresetIndex(Settings.clientViewModel.defaultWamsEncodingPresetIndex() - 1);
}
Settings.deleteWamsEncodingPreset = deleteWamsEncodingPreset;
function addNewWamsEncodingPreset() {
Settings.clientViewModel.wamsEncodingPresets.push(new EncodingPreset("Unnamed", null));
$("#presets-table tbody:first-of-type tr:last-of-type td:nth-child(2) input").focus().select();
}
Settings.addNewWamsEncodingPreset = addNewWamsEncodingPreset;
function deleteSubtitleLanguage(languageCultureCode) {
Settings.clientViewModel.subtitleLanguages.remove(languageCultureCode);
}
Settings.deleteSubtitleLanguage = deleteSubtitleLanguage;
function addNewSubtitleLanguage() {
Settings.clientViewModel.subtitleLanguages.push(new StringItem("Unnamed"));
$("#languages-table tbody:first-of-type tr:last-of-type td:nth-child(1) input").focus().select();
}
Settings.addNewSubtitleLanguage = addNewSubtitleLanguage;
$(function () {
$.each(initWamsEncodingPresets, function (presetIndex, preset) {
Settings.clientViewModel.wamsEncodingPresets.push(new EncodingPreset(preset.name, preset.customXml));
});
Settings.clientViewModel.defaultWamsEncodingPresetIndex(initDefaultWamsEncodingPresetIndex);
$.each(initSubtitleLanguages, function (languageIndex, languageCultureCode) {
Settings.clientViewModel.subtitleLanguages.push(new StringItem(languageCultureCode));
});
ko.applyBindings(Settings.clientViewModel);
var localStorage = window["localStorage"];
$("#tabs").tabs({
activate: function () {
if (localStorage && localStorage.setItem)
localStorage.setItem("selectedCloudMediaSettingsTab", $("#tabs").tabs("option", "active"));
},
active: localStorage && localStorage.getItem ? localStorage.getItem("selectedCloudMediaSettingsTab") : null
}).show();
});
})(Settings = Admin.Settings || (Admin.Settings = {}));
})(Admin = MediaServices.Admin || (MediaServices.Admin = {}));
})(MediaServices = Azure.MediaServices || (Azure.MediaServices = {}));
})(Azure = Orchard.Azure || (Orchard.Azure = {}));
})(Orchard || (Orchard = {}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsb3VkbWVkaWEtYWRtaW4tc2V0dGluZ3MuanMiLCJjbG91ZG1lZGlhLWFkbWluLXNldHRpbmdzLnRzIl0sIm5hbWVzIjpbIk9yY2hhcmQiLCJPcmNoYXJkLkF6dXJlIiwiT3JjaGFyZC5BenVyZS5NZWRpYVNlcnZpY2VzIiwiT3JjaGFyZC5BenVyZS5NZWRpYV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