Created
September 1, 2018 01:04
-
-
Save chocopowwwa/535a43702b3b1972ebb2106b99a4ba53 to your computer and use it in GitHub Desktop.
Weblate summernote
This file contains hidden or 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
| // ==UserScript== | |
| // @name Summernote On Weblate | |
| // @version 1 | |
| // @require http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.js | |
| // @grant none | |
| // ==/UserScript== | |
| $.getStylesheet = function (href) { | |
| var $d = $.Deferred(); | |
| var $link = $('<link/>', { | |
| rel: 'stylesheet', | |
| type: 'text/css', | |
| href: href | |
| }).appendTo('head'); | |
| $d.resolve($link); | |
| return $d.promise(); | |
| }; | |
| $.getStylesheet('http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.css'); | |
| $(document).ready(function() { | |
| $('.translation-editor').summernote({ | |
| //onKeyup: function(e) { | |
| //$("#lawsContent").val($(this).code()); | |
| //}, | |
| callbacks: { | |
| onChange: function (contents, $editable) { | |
| $(this).val(contents); | |
| } | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment