Lines 18-23
Link Here
|
18 |
Libraries › Administration › Koha |
18 |
Libraries › Administration › Koha |
19 |
</title> |
19 |
</title> |
20 |
[% INCLUDE 'doc-head-close.inc' %] |
20 |
[% INCLUDE 'doc-head-close.inc' %] |
|
|
21 |
[% Asset.css("lib/codemirror/codemirror.min.css") | $raw %] |
22 |
[% Asset.css("lib/codemirror/lint.min.css") | $raw %] |
21 |
</head> |
23 |
</head> |
22 |
|
24 |
|
23 |
<body id="admin_branches" class="admin"> |
25 |
<body id="admin_branches" class="admin"> |
Lines 275-280
Libraries › Administration › Koha
Link Here
|
275 |
</select> |
277 |
</select> |
276 |
<div class="hint">Set to 'yes' to show this library as a search option and on the libraries page in the OPAC.</div> |
278 |
<div class="hint">Set to 'yes' to show this library as a search option and on the libraries page in the OPAC.</div> |
277 |
</li> |
279 |
</li> |
|
|
280 |
<li> |
281 |
<label for="UserJS">UserJS: </label> |
282 |
<div style="display:flex; flex-direction:column;"> |
283 |
<a class="expand-textarea" id="expand_userjs" data-target="userjs" data-syntax="javascript" href="#">Click to edit</a> |
284 |
<textarea style="display:none" name="userjs" id="userjs" class="codemirror" rows="10" cols="40">[% library.userjs %]</textarea> |
285 |
<a class="collapse-textarea" id="collapse_userjs" data-target="userjs" data-syntax="javascript" style="display:none" href="#">Click to collapse</br></a> |
286 |
</div> |
287 |
</li> |
288 |
<li> |
289 |
<label for="UserCSS">UserCSS: </label> |
290 |
<div style="display:flex; flex-direction:column;"> |
291 |
<a class="expand-textarea" id="expand_usercss" data-target="usercss" data-syntax="css" href="#">Click to edit</a> |
292 |
<textarea style="display:none" name="usercss" id="usercss" class="" rows="10" cols="40">[% library.usercss %]</textarea> |
293 |
<a class="collapse-textarea" id="collapse_usercss" data-target="usercss" data-syntax="css" style="display:none" href="#">Click to collapse</br></a> |
294 |
</div> |
295 |
</li> |
296 |
</li> |
278 |
</ol> |
297 |
</ol> |
279 |
</fieldset> |
298 |
</fieldset> |
280 |
<fieldset class="action"> |
299 |
<fieldset class="action"> |
Lines 475-481
Libraries › Administration › Koha
Link Here
|
475 |
[% INCLUDE 'datatables.inc' %] |
494 |
[% INCLUDE 'datatables.inc' %] |
476 |
[% INCLUDE 'columns_settings.inc' %] |
495 |
[% INCLUDE 'columns_settings.inc' %] |
477 |
[% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %] |
496 |
[% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %] |
|
|
497 |
[% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %] |
498 |
[% Asset.js( "lib/codemirror/css.min.js" ) | $raw %] |
499 |
[% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %] |
500 |
[% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %] |
501 |
[% Asset.js( "lib/codemirror/yaml.min.js" ) | $raw %] |
502 |
[% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %] |
503 |
[% Asset.js( "lib/linters/jshint.min.js" ) | $raw %] |
504 |
[% Asset.js( "lib/linters/htmlhint.min.js" ) | $raw %] |
505 |
[% Asset.js( "lib/linters/csslint.min.js" ) | $raw %] |
506 |
[% Asset.js( "lib/linters/js-yaml.min.js" ) | $raw %] |
507 |
[% Asset.js( "lib/codemirror/html-lint.min.js" ) | $raw %] |
508 |
[% Asset.js( "lib/codemirror/javascript-lint.min.js" ) | $raw %] |
509 |
[% Asset.js( "lib/codemirror/css-lint.min.js" ) | $raw %] |
510 |
[% Asset.js( "lib/codemirror/yaml-lint.min.js" ) | $raw %] |
511 |
[% Asset.css("lib/codemirror/codemirror.css") | $raw %] |
478 |
[% INCLUDE 'str/tinymce_i18n.inc' %] |
512 |
[% INCLUDE 'str/tinymce_i18n.inc' %] |
|
|
513 |
<style> |
514 |
.CodeMirror { |
515 |
border: 1px solid #EEE; |
516 |
margin: 1em, 1em, 1em, 0; |
517 |
resize: vertical; |
518 |
width: 50em; |
519 |
} |
520 |
</style> |
479 |
<script> |
521 |
<script> |
480 |
var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'libraries', 'libraries', 'json' ) | $raw %]; |
522 |
var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'libraries', 'libraries', 'json' ) | $raw %]; |
481 |
var saved_table = localStorage.getItem("DataTables_libraries_/cgi-bin/koha/admin/branches.pl"); |
523 |
var saved_table = localStorage.getItem("DataTables_libraries_/cgi-bin/koha/admin/branches.pl"); |
Lines 674-690
Libraries › Administration › Koha
Link Here
|
674 |
[% END %] |
716 |
[% END %] |
675 |
}); |
717 |
}); |
676 |
|
718 |
|
677 |
tinyMCE.init({ |
719 |
$( ".expand-textarea" ).on("click", function(e){ |
678 |
branding : false, |
720 |
e.preventDefault(); |
679 |
relative_urls : false, |
721 |
$(this).hide(); |
680 |
content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css", |
722 |
var target = $(this).data("target"); |
681 |
menubar : "file edit view insert format tools table", |
723 |
var syntax = $(this).data("syntax"); |
682 |
mode : "specific_textareas", |
724 |
$("#collapse_" + target ).show(); |
683 |
plugins : "autoresize table hr link image charmap lists code emoticons", |
725 |
if( syntax ){ |
684 |
toolbar : [ |
726 |
var editor = CodeMirror.fromTextArea( document.getElementById( target ), { |
685 |
"formatselect | bold italic | cut copy paste | alignleft aligncenter alignright | outdent indent | image link unlink anchor cleanup hr", |
727 |
lineNumbers: true, |
686 |
"table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code" |
728 |
mode: syntax, |
687 |
], |
729 |
lineWrapping: true, |
|
|
730 |
viewportMargin: Infinity, |
731 |
gutters: ["CodeMirror-lint-markers"], |
732 |
lint: true |
733 |
}); |
734 |
editor.on("blur", function(){ |
735 |
editor.save(); |
736 |
}); |
737 |
} else { |
738 |
$( target ).show(); |
739 |
} |
740 |
}); |
741 |
|
742 |
$( ".collapse-textarea" ).on("click", function(e){ |
743 |
e.preventDefault(); |
744 |
$(this).hide(); |
745 |
var target = $(this).data("target"); |
746 |
var syntax = $(this).data("syntax"); |
747 |
$("#expand_" + target ).show(); |
748 |
if( syntax ){ |
749 |
var editor = $( "#" + target ).next(".CodeMirror")[0].CodeMirror; |
750 |
editor.toTextArea(); |
751 |
} |
752 |
$( "#" + target ).hide(); |
688 |
}); |
753 |
}); |
689 |
</script> |
754 |
</script> |
690 |
[% END %] |
755 |
[% END %] |