Skip to content

Instantly share code, notes, and snippets.

@chocopowwwa
Created September 1, 2018 01:04
Show Gist options
  • Select an option

  • Save chocopowwwa/535a43702b3b1972ebb2106b99a4ba53 to your computer and use it in GitHub Desktop.

Select an option

Save chocopowwwa/535a43702b3b1972ebb2106b99a4ba53 to your computer and use it in GitHub Desktop.
Weblate summernote
// ==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