-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
...icker/App_Plugins/Skybrud.VideoPicker/Scripts/Controllers/Providers/DreamBroker/Config.js
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,62 @@ | ||
angular.module("umbraco").controller("Skybrud.VideoPicker.DreamBroker.Config.Controller", function ($scope, formHelper) { | ||
|
||
var config = $scope.model.config; | ||
|
||
function bool(alias, value) { | ||
|
||
if (config[alias]) return; | ||
|
||
config[alias] = { | ||
readonly: true, | ||
value: value | ||
}; | ||
|
||
} | ||
|
||
bool("consent", false); | ||
bool("autoplay", false); | ||
|
||
$scope.properties = [ | ||
{ | ||
alias: "consent", | ||
label: "Require consent", | ||
description: "Select whether the embed code requires prior consent before being shown to the user.", | ||
value: config.consent.value, | ||
view: "boolean" | ||
}, | ||
{ | ||
alias: "autoplay", | ||
label: "Autoplay", | ||
description: "Select whether the video should automatically start to play when the player loads.", | ||
value: config.autoplay.value, | ||
view: "boolean" | ||
} | ||
]; | ||
|
||
$scope.save = function () { | ||
|
||
if (formHelper.submitForm({ scope: $scope })) { | ||
|
||
formHelper.resetForm({ scope: $scope }); | ||
|
||
$scope.properties.forEach(function (p) { | ||
|
||
// Fix boolean values (instead of "1" and "0") | ||
if (p.view === "boolean") { | ||
p.value = p.value === "1" || p.value === true; | ||
} | ||
|
||
config[p.alias] = { | ||
readonly: true, | ||
value: p.value | ||
}; | ||
|
||
}); | ||
|
||
$scope.model.submit(config); | ||
|
||
} | ||
|
||
}; | ||
|
||
}); |
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
45 changes: 45 additions & 0 deletions
45
src/Skybrud.VideoPicker/App_Plugins/Skybrud.VideoPicker/Views/DreamBroker/Config.html
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,45 @@ | ||
<div ng-controller="Skybrud.VideoPicker.DreamBroker.Config.Controller"> | ||
|
||
<form name="dreambrokerConfig" ng-submit="save()" novalidate val-form-manager> | ||
|
||
<umb-editor-view> | ||
|
||
<umb-editor-header | ||
name="model.title" | ||
hide-icon="true" | ||
hide-alias="true" | ||
name-locked="true" | ||
hide-description="true"> | ||
</umb-editor-header> | ||
|
||
<umb-editor-container> | ||
<umb-box> | ||
<umb-box-content> | ||
<umb-property property="property" ng-repeat="property in properties"> | ||
<umb-property-editor model="property"></umb-property-editor> | ||
</umb-property> | ||
</umb-box-content> | ||
</umb-box> | ||
</umb-editor-container> | ||
|
||
<umb-editor-footer> | ||
<umb-editor-footer-content-right> | ||
<umb-button | ||
type="button" | ||
button-style="link" | ||
label-key="general_close" | ||
action="model.close()"> | ||
</umb-button> | ||
<umb-button | ||
type="submit" | ||
button-style="success" | ||
label-key="general_submit"> | ||
</umb-button> | ||
</umb-editor-footer-content-right> | ||
</umb-editor-footer> | ||
|
||
</umb-editor-view> | ||
|
||
</form> | ||
|
||
</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
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