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