-
Notifications
You must be signed in to change notification settings - Fork 989
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add customizable footer content #980
- Loading branch information
dularion
committed
May 13, 2020
1 parent
7a811d2
commit c8bc877
Showing
8 changed files
with
71 additions
and
6 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
41 changes: 41 additions & 0 deletions
41
grails-app/assets/javascripts/streama/directives/streama-wysiwyg-directive.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,41 @@ | ||
//= wrapped | ||
|
||
angular.module('streama') | ||
.directive('streamaWysiwyg', function () { | ||
return { | ||
require: 'ngModel', | ||
restrict: 'E', | ||
template: '<div class="quill-editor"></div>', | ||
scope: { | ||
}, | ||
link: function ($scope, $elem, $attrs, $ctrl) { | ||
|
||
var toolbarOptions = [ | ||
['bold', 'italic', 'underline'], // toggled buttons | ||
[{ 'list': 'ordered'}, { 'list': 'bullet' }], | ||
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown | ||
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme | ||
[{ 'font': [] }], | ||
[{ 'align': [] }], | ||
['clean'] // remove formatting button | ||
]; | ||
|
||
$ctrl.$render = render; | ||
var quill = new Quill($elem[0], { | ||
theme: 'bubble', | ||
modules: { | ||
toolbar: toolbarOptions | ||
} | ||
}); | ||
quill.on('text-change', onTextChange); | ||
|
||
function onTextChange(delta, oldDelta, source) { | ||
$ctrl.$setViewValue(quill.root.innerHTML); | ||
} | ||
|
||
function render() { | ||
quill.root.innerHTML = $ctrl.$modelValue; | ||
} | ||
} | ||
} | ||
}); |
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