Lines 17-22
Link Here
|
17 |
Libraries › Administration › Koha |
17 |
Libraries › Administration › Koha |
18 |
</title> |
18 |
</title> |
19 |
[% INCLUDE 'doc-head-close.inc' %] |
19 |
[% INCLUDE 'doc-head-close.inc' %] |
|
|
20 |
[% Asset.css("lib/codemirror/codemirror.min.css") | $raw %] |
21 |
[% Asset.css("lib/codemirror/lint.min.css") | $raw %] |
20 |
</head> |
22 |
</head> |
21 |
|
23 |
|
22 |
<body id="admin_branches" class="admin"> |
24 |
<body id="admin_branches" class="admin"> |
Lines 288-293
Libraries › Administration › Koha
Link Here
|
288 |
</select> |
290 |
</select> |
289 |
<div class="hint">Set to 'yes' to show this library as a search option and on the Libraries page in the OPAC.</div> |
291 |
<div class="hint">Set to 'yes' to show this library as a search option and on the Libraries page in the OPAC.</div> |
290 |
</li> |
292 |
</li> |
|
|
293 |
<li> |
294 |
<label for="UserJS">UserJS: </label> |
295 |
<div style="display:flex; flex-direction:column;"> |
296 |
<a class="expand-textarea" id="expand_userjs" data-target="userjs" data-syntax="javascript" href="#">Click to edit</a> |
297 |
<textarea style="display:none" name="userjs" id="userjs" class="codemirror" rows="10" cols="40">[% library.userjs %]</textarea> |
298 |
<a class="collapse-textarea" id="collapse_userjs" data-target="userjs" data-syntax="javascript" style="display:none" href="#">Click to collapse</br></a> |
299 |
</div> |
300 |
</li> |
301 |
<li> |
302 |
<label for="UserCSS">UserCSS: </label> |
303 |
<div style="display:flex; flex-direction:column;"> |
304 |
<a class="expand-textarea" id="expand_usercss" data-target="usercss" data-syntax="css" href="#">Click to edit</a> |
305 |
<textarea style="display:none" name="usercss" id="usercss" class="" rows="10" cols="40">[% library.usercss %]</textarea> |
306 |
<a class="collapse-textarea" id="collapse_usercss" data-target="usercss" data-syntax="css" style="display:none" href="#">Click to collapse</br></a> |
307 |
</div> |
308 |
</li> |
309 |
</li> |
291 |
</ol> |
310 |
</ol> |
292 |
</fieldset> |
311 |
</fieldset> |
293 |
<fieldset class="action"> |
312 |
<fieldset class="action"> |
Lines 488-494
Libraries › Administration › Koha
Link Here
|
488 |
[% INCLUDE 'datatables.inc' %] |
507 |
[% INCLUDE 'datatables.inc' %] |
489 |
[% INCLUDE 'columns_settings.inc' %] |
508 |
[% INCLUDE 'columns_settings.inc' %] |
490 |
[% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %] |
509 |
[% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %] |
|
|
510 |
[% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %] |
511 |
[% Asset.js( "lib/codemirror/css.min.js" ) | $raw %] |
512 |
[% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %] |
513 |
[% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %] |
514 |
[% Asset.js( "lib/codemirror/yaml.min.js" ) | $raw %] |
515 |
[% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %] |
516 |
[% Asset.js( "lib/linters/jshint.min.js" ) | $raw %] |
517 |
[% Asset.js( "lib/linters/htmlhint.min.js" ) | $raw %] |
518 |
[% Asset.js( "lib/linters/csslint.min.js" ) | $raw %] |
519 |
[% Asset.js( "lib/linters/js-yaml.min.js" ) | $raw %] |
520 |
[% Asset.js( "lib/codemirror/html-lint.min.js" ) | $raw %] |
521 |
[% Asset.js( "lib/codemirror/javascript-lint.min.js" ) | $raw %] |
522 |
[% Asset.js( "lib/codemirror/css-lint.min.js" ) | $raw %] |
523 |
[% Asset.js( "lib/codemirror/yaml-lint.min.js" ) | $raw %] |
524 |
[% Asset.css("lib/codemirror/codemirror.css") | $raw %] |
491 |
[% INCLUDE 'str/tinymce_i18n.inc' %] |
525 |
[% INCLUDE 'str/tinymce_i18n.inc' %] |
|
|
526 |
<style> |
527 |
.CodeMirror { |
528 |
border: 1px solid #EEE; |
529 |
margin: 1em, 1em, 1em, 0; |
530 |
resize: vertical; |
531 |
width: 50em; |
532 |
} |
533 |
</style> |
492 |
<script> |
534 |
<script> |
493 |
var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'libraries', 'libraries', 'json' ) | $raw %]; |
535 |
var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'libraries', 'libraries', 'json' ) | $raw %]; |
494 |
var saved_table = localStorage.getItem("DataTables_libraries_/cgi-bin/koha/admin/branches.pl"); |
536 |
var saved_table = localStorage.getItem("DataTables_libraries_/cgi-bin/koha/admin/branches.pl"); |
Lines 687-703
Libraries › Administration › Koha
Link Here
|
687 |
[% END %] |
729 |
[% END %] |
688 |
}); |
730 |
}); |
689 |
|
731 |
|
690 |
tinyMCE.init({ |
732 |
$( ".expand-textarea" ).on("click", function(e){ |
691 |
branding : false, |
733 |
e.preventDefault(); |
692 |
relative_urls : false, |
734 |
$(this).hide(); |
693 |
content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css", |
735 |
var target = $(this).data("target"); |
694 |
menubar : "file edit view insert format tools table", |
736 |
var syntax = $(this).data("syntax"); |
695 |
mode : "specific_textareas", |
737 |
$("#collapse_" + target ).show(); |
696 |
plugins : "autoresize table hr link image charmap lists code emoticons", |
738 |
if( syntax ){ |
697 |
toolbar : [ |
739 |
var editor = CodeMirror.fromTextArea( document.getElementById( target ), { |
698 |
"formatselect | bold italic | cut copy paste | alignleft aligncenter alignright | outdent indent | image link unlink anchor cleanup hr", |
740 |
lineNumbers: true, |
699 |
"table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code" |
741 |
mode: syntax, |
700 |
], |
742 |
lineWrapping: true, |
|
|
743 |
viewportMargin: Infinity, |
744 |
gutters: ["CodeMirror-lint-markers"], |
745 |
lint: true |
746 |
}); |
747 |
editor.on("blur", function(){ |
748 |
editor.save(); |
749 |
}); |
750 |
} else { |
751 |
$( target ).show(); |
752 |
} |
753 |
}); |
754 |
|
755 |
$( ".collapse-textarea" ).on("click", function(e){ |
756 |
e.preventDefault(); |
757 |
$(this).hide(); |
758 |
var target = $(this).data("target"); |
759 |
var syntax = $(this).data("syntax"); |
760 |
$("#expand_" + target ).show(); |
761 |
if( syntax ){ |
762 |
var editor = $( "#" + target ).next(".CodeMirror")[0].CodeMirror; |
763 |
editor.toTextArea(); |
764 |
} |
765 |
$( "#" + target ).hide(); |
701 |
}); |
766 |
}); |
702 |
</script> |
767 |
</script> |
703 |
[% END %] |
768 |
[% END %] |