Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
16 changed files
with
314 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"use strict"; | ||
(function() { | ||
//This a wrapped dropdown element that automatically handles the particulars | ||
|
||
angular.module("firebotApp").component("commandOption", { | ||
bindings: { | ||
metadata: "=", | ||
name: "<", | ||
onUpdate: "&" | ||
}, | ||
template: ` | ||
<div ng-switch="$ctrl.metadata.type" style="padding-bottom: 10px;font-size: 15px;font-weight: 600;"> | ||
<div>{{$ctrl.metadata.type != 'boolean' ? $ctrl.metadata.title ? $ctrl.metadata.title : $ctrl.name : ""}}</div> | ||
<div ng-if="$ctrl.metadata.type != 'boolean' && $ctrl.metadata.description" style="padding-bottom: 5px;font-size: 14px;font-weight: 300;">{{$ctrl.metadata.description}}</div> | ||
<div ng-switch-when="string"> | ||
<textarea ng-if="$ctrl.metadata.useTextArea" ng-model="$ctrl.metadata.value" class="form-control" placeholder="Enter text" rows="5" style="width:100%"></textarea> | ||
<input ng-if="!$ctrl.metadata.useTextArea" class="form-control" type="text" placeholder="Enter text" ng-model="$ctrl.metadata.value"> | ||
</div> | ||
<div ng-switch-when="number"> | ||
<input class="form-control" type="number" placeholder="Enter a number" ng-model="$ctrl.metadata.value"> | ||
</div> | ||
<div ng-switch-when="boolean" style="padding-top:10px;"> | ||
<label class="control-fb control--checkbox" style="font-weight: 600;"> {{$ctrl.metadata.title ? $ctrl.metadata.title : $ctrl.name}} | ||
<input type="checkbox" ng-click="$ctrl.metadata.value = !$ctrl.metadata.value" ng-checked="$ctrl.metadata.value" aria-label="..."> | ||
<div class="control__indicator"></div> | ||
</label> | ||
</div> | ||
<div ng-switch-when="enum" style="padding-top:5px;"> | ||
<dropdown-select options="$ctrl.metadata.options" selected="$ctrl.metadata.value"></dropdown-select> | ||
</div> | ||
<div ng-switch-when="filepath"> | ||
<file-chooser model="$ctrl.metadata.value" options="$ctrl.metadata.fileOptions"></file-chooser></file-chooser> | ||
</div> | ||
<div ng-if="$ctrl.metadata.tip != null && $ctrl.metadata.tip !== ''" class="muted" style="font-size:12px; padding-top: 3px;">{{$ctrl.metadata.tip}}</div> | ||
</div> | ||
<hr ng-if="$ctrl.metadata.showBottomHr" style="margin-top:10px; margin-bottom:15px;" /> | ||
`, | ||
controller: function() { | ||
let ctrl = this; | ||
|
||
//If there is no value, supply the default. | ||
ctrl.$onInit = function() { | ||
if (ctrl.metadata.value === undefined || ctrl.metadata.value === null) { | ||
ctrl.metadata.value = ctrl.metadata.default; | ||
|
||
// If its an enum and no default is supplied, select the first one | ||
if (ctrl.metadata.type === "enum") { | ||
if (ctrl.metadata.default == null) { | ||
ctrl.metadata.value = ctrl.metadata.options[0]; | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
}); | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"use strict"; | ||
|
||
(function() { | ||
angular.module("firebotApp").component("settingContainer", { | ||
bindings: { | ||
header: "@", | ||
description: "@", | ||
padTop: "<" | ||
}, | ||
transclude: true, | ||
template: ` | ||
<div class="fb-setting-container" ng-class="{ 'fb-setting-padtop' : $ctrl.padTop }"> | ||
<div class="fb-setting-header" ng-if="$ctrl.header"> | ||
<h4>{{$ctrl.header}} <span ng-if="$ctrl.description != null" class="muted" style="padding-bottom: 4px;padding-left: 2px;font-size: 13px;font-family: 'Quicksand';">({{$ctrl.description}})</span></h4> | ||
</div> | ||
<div class="fb-setting-content" ng-transclude></div> | ||
</div> | ||
` | ||
}); | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.