mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
minify
This commit is contained in:
parent
82bcca376f
commit
8a6884abef
494 changed files with 256 additions and 120180 deletions
|
@ -1,60 +1 @@
|
|||
define(['./voicecommands.js', './grammarprocessor.js', 'require'], function (voicecommands, grammarprocessor, require) {
|
||||
'use strict';
|
||||
|
||||
var commandgroups;
|
||||
|
||||
function getCommandGroups() {
|
||||
|
||||
if (commandgroups) {
|
||||
return Promise.resolve(commandgroups);
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var file = "grammar";
|
||||
|
||||
require(['text!./grammar/' + file + '.json'], function (response) {
|
||||
commandgroups = JSON.parse(response);
|
||||
resolve(commandgroups);
|
||||
});
|
||||
});
|
||||
}
|
||||
/// <summary> Process the transcript described by text. </summary>
|
||||
/// <param name="text"> The text. </param>
|
||||
/// <returns> . </returns>
|
||||
function processTranscript(text) {
|
||||
if (text) {
|
||||
|
||||
return getCommandGroups().then(function (commandgroups) {
|
||||
var processor = grammarprocessor(commandgroups, text);
|
||||
if (processor && processor.command) {
|
||||
console.log("Command from Grammar Processor", processor);
|
||||
return voicecommands(processor)
|
||||
.then(function (result) {
|
||||
|
||||
console.log("Result of executed command", result);
|
||||
if (result.item.actionid === 'show' && result.item.sourceid === 'group') {
|
||||
return Promise.resolve({ error: "group", item: result.item, groupName: result.name, fn: result.fn });
|
||||
} else {
|
||||
return Promise.resolve({ item: result.item, fn: result.fn });
|
||||
}
|
||||
}, function () {
|
||||
return Promise.reject({ error: "unrecognized-command", text: text });
|
||||
});
|
||||
} else {
|
||||
return Promise.reject({ error: "unrecognized-command", text: text });
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
return Promise.reject({ error: "empty" });
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> An enum constant representing the window. voice input manager option. </summary>
|
||||
return {
|
||||
processTranscript: processTranscript,
|
||||
getCommandGroups: getCommandGroups
|
||||
};
|
||||
|
||||
});
|
||||
define(["./voicecommands.js","./grammarprocessor.js","require"],function(voicecommands,grammarprocessor,require){"use strict";function getCommandGroups(){return commandgroups?Promise.resolve(commandgroups):new Promise(function(resolve,reject){var file="grammar";require(["text!./grammar/"+file+".json"],function(response){commandgroups=JSON.parse(response),resolve(commandgroups)})})}function processTranscript(text){return text?getCommandGroups().then(function(commandgroups){var processor=grammarprocessor(commandgroups,text);return processor&&processor.command?(console.log("Command from Grammar Processor",processor),voicecommands(processor).then(function(result){return console.log("Result of executed command",result),"show"===result.item.actionid&&"group"===result.item.sourceid?Promise.resolve({error:"group",item:result.item,groupName:result.name,fn:result.fn}):Promise.resolve({item:result.item,fn:result.fn})},function(){return Promise.reject({error:"unrecognized-command",text:text})})):Promise.reject({error:"unrecognized-command",text:text})}):Promise.reject({error:"empty"})}var commandgroups;return{processTranscript:processTranscript,getCommandGroups:getCommandGroups}});
|
Loading…
Add table
Add a link
Reference in a new issue