View | Details | Raw Unified | Return to bug 20935
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.mark.min.js (+7 lines)
Line 0 Link Here
1
/*!***************************************************
2
* mark.js v8.11.1
3
* https://markjs.io/
4
* Copyright (c) 2014–2018, Julian Kühnel
5
* Released under the MIT license https://git.io/vwTVl
6
*****************************************************/
7
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):e.Mark=t(e.jQuery)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;n(this,e),this.ctx=t,this.iframes=r,this.exclude=i,this.iframesTimeout=o}return r(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(t){var n=e.filter(function(e){return e.contains(t)}).length>0;-1!==e.indexOf(t)||n||e.push(t)}),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var i=e.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(e){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(e)||(e.removeEventListener("load",a),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,function(){return!0},function(e){r++,n.waitForIframes(e.querySelector("html"),function(){--r||t()})},function(e){e||t()})}},{key:"forEachIframe",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=t.querySelectorAll("iframe"),s=a.length,c=0;a=Array.prototype.slice.call(a);var u=function(){--s<=0&&o(c)};s||u(),a.forEach(function(t){e.matches(t,i.exclude)?u():i.onIframeReady(t,function(e){n(t)&&(c++,r(e)),u()},u)})}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:null===t?e.nextNode():e.nextNode()&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var i=!1,o=!1;return r.forEach(function(e,t){e.val===n&&(i=t,o=e.handled)}),this.compareNodeIframe(e,t,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var i=this;e.forEach(function(e){e.handled||i.getIframeContents(e.val,function(e){i.createInstanceOnIframe(e).forEachNode(t,n,r)})})}},{key:"iterateThroughNodes",value:function(e,t,n,r,i){for(var o,a=this,s=this.createIterator(t,e,r),c=[],u=[],l=void 0,h=void 0;void 0,o=a.getIteratorNode(s),h=o.prevNode,l=o.node;)this.iframes&&this.forEachIframe(t,function(e){return a.checkIframeFilter(l,h,e,c)},function(t){a.createInstanceOnIframe(t).forEachNode(e,function(e){return u.push(e)},r)}),u.push(l);u.forEach(function(e){n(e)}),this.iframes&&this.handleOpenIframes(c,e,n,r),i()}},{key:"forEachNode",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),a=o.length;a||i(),o.forEach(function(o){var s=function(){r.iterateThroughNodes(e,o,t,n,function(){--a<=0&&i()})};r.iframes?r.waitForIframes(o,s):s()})}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var i=!1;return n.every(function(t){return!r.call(e,t)||(i=!0,!1)}),i}return!1}}]),e}(),a=function(){function e(t){n(this,e),this.opt=i({},{diacritics:!0,synonyms:{},accuracy:"partially",caseSensitive:!1,ignoreJoiners:!1,ignorePunctuation:[],wildcards:"disabled"},t)}return r(e,[{key:"create",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e),new RegExp(e,"gm"+(this.opt.caseSensitive?"":"i"))}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createSynonymsRegExp",value:function(e){var t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(e=e.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynonyms(a)+"|"+this.processSynonyms(s)+")"+r))}return e}},{key:"processSynonyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,function(e){return"\\"===e.charAt(0)?"?":""})).replace(/(?:\\)*\*/g,function(e){return"\\"===e.charAt(0)?"*":""})}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"})}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("["+t.join("")+"]*"):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],r=[];return e.split("").forEach(function(i){n.every(function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;e=e.replace(new RegExp("["+n+"]","gm"+t),"["+n+"]"),r.push(n)}return!0})}),e}},{key:"createMergedBlanksRegExp",value:function(e){return e.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(e){var t=this,n=this.opt.accuracy,r="string"==typeof n?n:n.value,i="";switch(("string"==typeof n?[]:n.limiters).forEach(function(e){i+="|"+t.escapeStr(e)}),r){case"partially":default:return"()("+e+")";case"complementary":return"()([^"+(i="\\s"+(i||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")))+"]*"+e+"[^"+i+"]*)";case"exactly":return"(^|\\s"+i+")("+e+")(?=$|\\s"+i+")"}}}]),e}(),s=function(){function e(t){n(this,e),this.ctx=t,this.ie=!1;var r=window.navigator.userAgent;(r.indexOf("MSIE")>-1||r.indexOf("Trident")>-1)&&(this.ie=!0)}return r(e,[{key:"log",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":t(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+e)}},{key:"getSeparatedKeywords",value:function(e){var t=this,n=[];return e.forEach(function(e){t.opt.separateWordSearch?e.split(" ").forEach(function(e){e.trim()&&-1===n.indexOf(e)&&n.push(e)}):e.trim()&&-1===n.indexOf(e)&&n.push(e)}),{keywords:n.sort(function(e,t){return t.length-e.length}),length:n.length}}},{key:"isNumeric",value:function(e){return Number(parseFloat(e))==e}},{key:"checkRanges",value:function(e){var t=this;if(!Array.isArray(e)||"[object Object]"!==Object.prototype.toString.call(e[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];var n=[],r=0;return e.sort(function(e,t){return e.start-t.start}).forEach(function(e){var i=t.callNoMatchOnInvalidRanges(e,r),o=i.start,a=i.end;i.valid&&(e.start=o,e.length=a-o,n.push(e),r=a)}),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n=void 0,r=void 0,i=!1;return e&&void 0!==e.start?(r=(n=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(e)),this.opt.noMatch(e))):(this.log("Ignoring invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:n,end:r,valid:i}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r=void 0,i=!0,o=n.length,a=t-o,s=parseInt(e.start,10)-a;return(r=(s=s>o?o:s)+parseInt(e.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),s<0||r-s<0||s>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)):""===n.substring(s,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:i}}},{key:"getTextNodes",value:function(e){var t=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(e){r.push({start:n.length,end:(n+=e.textContent).length,node:e})},function(e){return t.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){e({value:n,nodes:r})})}},{key:"matchesExclude",value:function(e){return o.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(e,t,n){var r=this.opt.element?this.opt.element:"mark",i=e.splitText(t),o=i.splitText(n-t),a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,i){var o=this;e.nodes.every(function(a,s){var c=e.nodes[s+1];if(void 0===c||c.start>t){if(!r(a.node))return!1;var u=t-a.start,l=(n>a.end?a.end:n)-a.start,h=e.value.substr(0,a.start),f=e.value.substr(l+a.start);if(a.node=o.wrapRangeInTextNode(a.node,u,l),e.value=h+f,e.nodes.forEach(function(t,n){n>=s&&(e.nodes[n].start>0&&n!==s&&(e.nodes[n].start-=l),e.nodes[n].end-=l)}),n-=l,i(a.node.previousSibling,a.start),!(n>a.end))return!1;t=a.end}return!0})}},{key:"wrapGroups",value:function(e,t,n,r){return r((e=this.wrapRangeInTextNode(e,t,t+n)).previousSibling),e}},{key:"separateGroups",value:function(e,t,n,r,i){for(var o=t.length,a=1;a<o;a++){var s=e.textContent.indexOf(t[a]);t[a]&&s>-1&&r(t[a],e)&&(e=this.wrapGroups(e,s,t[a].length,i))}return e}},{key:"wrapMatches",value:function(e,t,n,r,i){var o=this,a=0===t?0:t+1;this.getTextNodes(function(t){t.nodes.forEach(function(t){t=t.node;for(var i=void 0;null!==(i=e.exec(t.textContent))&&""!==i[a];){if(o.opt.separateGroups)t=o.separateGroups(t,i,a,n,r);else{if(!n(i[a],t))continue;var s=i.index;if(0!==a)for(var c=1;c<a;c++)s+=i[c].length;t=o.wrapGroups(t,s,i[a].length,r)}e.lastIndex=0}}),i()})}},{key:"wrapMatchesAcrossElements",value:function(e,t,n,r,i){var o=this,a=0===t?0:t+1;this.getTextNodes(function(t){for(var s=void 0;null!==(s=e.exec(t.value))&&""!==s[a];){var c=s.index;if(0!==a)for(var u=1;u<a;u++)c+=s[u].length;var l=c+s[a].length;o.wrapRangeInMappedTextNode(t,c,l,function(e){return n(s[a],e)},function(t,n){e.lastIndex=n,r(t)})}i()})}},{key:"wrapRangeFromIndex",value:function(e,t,n,r){var i=this;this.getTextNodes(function(o){var a=o.value.length;e.forEach(function(e,r){var s=i.checkWhitespaceRanges(e,a,o.value),c=s.start,u=s.end;s.valid&&i.wrapRangeInMappedTextNode(o,c,u,function(n){return t(n,e,o.value.substring(c,u),r)},function(t){n(t,e)})}),r()})}},{key:"unwrapMatches",value:function(e){for(var t=e.parentNode,n=document.createDocumentFragment();e.firstChild;)n.appendChild(e.removeChild(e.firstChild));t.replaceChild(n,e),this.ie?this.normalizeTextNode(t):t.normalize()}},{key:"normalizeTextNode",value:function(e){if(e){if(3===e.nodeType)for(;e.nextSibling&&3===e.nextSibling.nodeType;)e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);else this.normalizeTextNode(e.firstChild);this.normalizeTextNode(e.nextSibling)}}},{key:"markRegExp",value:function(e,t){var n=this;this.opt=t,this.log('Searching with expression "'+e+'"');var r=0,i="wrapMatches";this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),this[i](e,this.opt.ignoreGroups,function(e,t){return n.opt.filter(t,e,r)},function(e){r++,n.opt.each(e)},function(){0===r&&n.opt.noMatch(e),n.opt.done(r)})}},{key:"mark",value:function(e,t){var n=this;this.opt=t;var r=0,i="wrapMatches",o=this.getSeparatedKeywords("string"==typeof e?[e]:e),s=o.keywords,c=o.length;this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),0===c?this.opt.done(r):function e(t){var o=new a(n.opt).create(t),u=0;n.log('Searching with expression "'+o+'"'),n[i](o,1,function(e,i){return n.opt.filter(i,t,r,u)},function(e){u++,r++,n.opt.each(e)},function(){0===u&&n.opt.noMatch(t),s[c-1]===t?n.opt.done(r):e(s[s.indexOf(t)+1])})}(s[0])}},{key:"markRanges",value:function(e,t){var n=this;this.opt=t;var r=0,i=this.checkRanges(e);i&&i.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(i)),this.wrapRangeFromIndex(i,function(e,t,r,i){return n.opt.filter(e,t,r,i)},function(e,t){r++,n.opt.each(e,t)},function(){n.opt.done(r)})):this.opt.done(r)}},{key:"unmark",value:function(e){var t=this;this.opt=e;var n=this.opt.element?this.opt.element:"*";n+="[data-markjs]",this.opt.className&&(n+="."+this.opt.className),this.log('Removal selector "'+n+'"'),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,function(e){t.unwrapMatches(e)},function(e){var r=o.matches(e,n),i=t.matchesExclude(e);return!r||i?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}},{key:"opt",set:function(e){this._opt=i({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,acrossElements:!1,ignoreGroups:0,each:function(){},noMatch:function(){},filter:function(){return!0},done:function(){},debug:!1,log:window.console},e)},get:function(){return this._opt}},{key:"iterator",get:function(){return new o(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}}]),e}();return e.fn.mark=function(e,t){return new s(this.get()).mark(e,t),this},e.fn.markRegExp=function(e,t){return new s(this.get()).markRegExp(e,t),this},e.fn.markRanges=function(e,t){return new s(this.get()).markRanges(e,t),this},e.fn.unmark=function(e){return new s(this.get()).unmark(e),this},e});
(-)a/koha-tmpl/intranet-tmpl/prog/css/preferences.css (-31 / +47 lines)
Lines 20-65 textarea.preference-code, .preference-file { Link Here
20
	font-family: monospace;
20
	font-family: monospace;
21
}
21
}
22
22
23
a.expand-textarea {
23
a.expand-textarea,
24
a.collapse-textarea {
24
    display: block;
25
    display: block;
26
    font-size: 125%;
27
    font-weight: bold;
25
}
28
}
29
26
dl {
30
dl {
27
	margin-left : 1em;
31
	margin-left : 1em;
28
}
32
}
29
dt {
33
dt {
30
	padding : .1em;
34
	padding : .1em;
31
}
35
}
32
h1 {
33
	font-size : 149%;
34
}
35
h2 {
36
	font-size : 134%;
37
}
38
39
table {
40
	width : 100%;
41
}
42
36
43
caption {
37
h2 {
44
	color : #003399;
38
    background-color: #e6f0f2;
39
    font-size: 150%;
40
    padding: .4em;
41
    text-shadow: 0 1px 0 rgb(255, 255, 255);
45
}
42
}
46
43
47
h3 {
44
h4 label {
48
	color : #003366;
45
	color : #003366;
49
	margin : .4em 0;
46
    font-weight: bold;
50
    width : 40%;
51
}
52
53
h3.expanded {
54
    background: transparent url("../img/collapse.gif") 0 6px no-repeat;
55
	cursor : pointer;
56
	padding-left : 12px;
57
}
58
59
h3.collapsed {
60
    background: transparent url("../img/expand.gif") 0 6px no-repeat;
61
	cursor : pointer;
62
	padding-left : 12px;
63
}
47
}
64
48
65
.humanMsg strong {
49
.humanMsg strong {
Lines 67-75 h3.collapsed { Link Here
67
	font-weight: normal;
51
	font-weight: normal;
68
}
52
}
69
53
70
#yui-main {
54
71
	margin-bottom:2em;
72
}
73
#toolbar.floating {
55
#toolbar.floating {
74
    box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.5);
56
    box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.5);
75
    border-radius: 0;
57
    border-radius: 0;
Lines 89-91 span.overridden { Link Here
89
    font-weight: bold;
71
    font-weight: bold;
90
    color: red;
72
    color: red;
91
}
73
}
74
75
.pref_line {
76
    border: 1px solid #CCC;
77
}
78
79
#menu ul li.active a.pref_sublink {
80
    background: #FFF none;
81
    border: 0;
82
    color: #004D99;
83
    font-weight: normal;
84
    font-size: 100%;
85
    margin: 0;
86
    padding: .2em .5em;
87
    text-align: right;
88
    text-decoration: underline;
89
}
90
91
dl.name-row {
92
    border-bottom: 1px solid #EEE;
93
    margin: .3em 0;
94
    margin-left: 1em;
95
    padding: .3em 0;
96
}
97
98
.name-cell label {
99
    font-weight: bold;
100
    font-size: 130%;
101
    color: #336699;
102
}
103
104
dd {
105
    text-indent: 0;
106
    margin-left: 3em;
107
}
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (+5 lines)
Lines 420-425 hr { Link Here
420
    clear: both;
420
    clear: both;
421
}
421
}
422
422
423
mark {
424
    background-color: #EFFF73;
425
    padding: 0;
426
}
427
423
p {
428
p {
424
    margin: .5em 0;
429
    margin: .5em 0;
425
}
430
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (+3 lines)
Lines 961-966 Link Here
961
961
962
            <h2>JSZip</h2>
962
            <h2>JSZip</h2>
963
            <p>The <a href="https://stuk.github.io/jszip/">JSZip</a> JavaScript library is licensed under both the <a href="https://github.com/Stuk/jszip/blob/master/LICENSE.markdown">MIT and GPLv3 Licenses</a>.</p>
963
            <p>The <a href="https://stuk.github.io/jszip/">JSZip</a> JavaScript library is licensed under both the <a href="https://github.com/Stuk/jszip/blob/master/LICENSE.markdown">MIT and GPLv3 Licenses</a>.</p>
964
965
            <h2>mark.js</h2>
966
            <p>The <a href="https://markjs.io/">mark.js</a> JavaScript library by <a href="https://github.com/julmot">Julian Kühnel</a> is licensed under the <a href="https://github.com/julmot/mark.js/blob/master/LICENSE">MIT Licenses</a>.</p>
964
        </div>
967
        </div>
965
968
966
        <div id="translations">
969
        <div id="translations">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (-33 / +42 lines)
Lines 10-15 Link Here
10
[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %]
10
[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %]
11
[% Asset.css("css/humanmsg.css") | $raw %]
11
[% Asset.css("css/humanmsg.css") | $raw %]
12
</head>
12
</head>
13
13
<body id="admin_preferences" class="admin">
14
<body id="admin_preferences" class="admin">
14
[% INCLUDE 'header.inc' %]
15
[% INCLUDE 'header.inc' %]
15
[% INCLUDE 'prefs-admin-search.inc' %]
16
[% INCLUDE 'prefs-admin-search.inc' %]
Lines 34-80 Link Here
34
    [% ELSIF searchfield %]
35
    [% ELSIF searchfield %]
35
        <h1>You searched for: [% searchfield | html %]</h1>
36
        <h1>You searched for: [% searchfield | html %]</h1>
36
    [% END %]
37
    [% END %]
38
    [% IF ( searchfield && !search_not_found ) %]
39
        <p>
40
            Results in sections:
41
            [% FOREACH TAB IN TABS %]
42
                <a href="#[% TAB.tab_title %]">[% TAB.tab_title %]</a>[% UNLESS ( loop.last ) %] &bull; [% END %]
43
            [% END %]
44
        </p>
45
    [% END %]
46
    [% IF ( searchfield ) %]
47
        <label for="keyword_filter">Filter: <input type="text" size="10" name="keyword_filter" id="keyword_filter" /> <a href="#" id="clear_filter" style="display:none;"><i class="fa fa-remove"></i></a></label>
48
    [% END %]
37
    [% FOREACH TAB IN TABS %]
49
    [% FOREACH TAB IN TABS %]
38
    <div class="prefs-tab">
50
    <div class="prefs-tab">
39
    <h2>[% TAB.tab_title | html %] preferences</h2>
51
52
    <h2 id="[% TAB.tab_title | html %]">[% TAB.tab_title | html %] preferences</h2>
40
    <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
53
    <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
41
        [% UNLESS ( searchfield ) %]<div id="toolbar"><button class="save-all submit" type="submit">Save all [% TAB.tab_title | html %] preferences</button></div>[% END %]
54
        [% UNLESS ( searchfield ) %]
55
            <div id="toolbar">
56
                <button class="save-all submit" type="submit">Save all [% TAB.tab_title | html %] preferences</button>
57
                <label for="keyword_filter">Filter: <input type="text" size="10" name="keyword_filter" id="keyword_filter" /> <a href="#" id="clear_filter" style="display:none;"><i class="fa fa-remove"></i></a></label>
58
            </div>
59
        [% END %]
42
        <input type="hidden" name="op" value="save" />
60
        <input type="hidden" name="op" value="save" />
43
        <input type="hidden" name="tab" value="[% TAB.tab_id | html %]" />
61
        <input type="hidden" name="tab" value="[% TAB.tab_id | html %]" />
44
62
        [% FOREACH LINE IN TAB.LINES %]
45
            [% FOREACH LINE IN TAB.LINES %]
46
            [% IF ( LINE.is_group_title ) %]
63
            [% IF ( LINE.is_group_title ) %]
47
            [% UNLESS ( loop.first ) %]</tbody></table>[% END %]
64
                [% UNLESS ( loop.first ) %][% END %]
48
            <h3>[% LINE.title | html %]</h3>
65
                <h3 class="name-row">[% LINE.title | html %]</h3>
49
            <table class="preferences">
66
                [% UNLESS ( loop.last ) %][% END %]
50
            <thead><tr><th>Preference</th><th>Value</th></tr></thead>
51
            [% UNLESS ( loop.last ) %]<tbody>[% END %]
52
            [% ELSE %]
67
            [% ELSE %]
53
            [% IF ( loop.first ) %]<table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody>[% END %]
68
                [% IF ( loop.first ) %][% END %]
54
            <tr class="name-row">
69
            <dl class="name-row">
55
                <td class="name-cell">
70
                <dt class="name-cell">
56
                    <code>
71
                    [% FOREACH NAME IN LINE.NAMES %]
57
                        [% FOREACH NAME IN LINE.NAMES %]
72
                        <label for="pref_[% NAME.name | html %]">
58
						<label for="pref_[% NAME.name | html %]">
73
                            [% NAME.name | html %]
59
							[% IF ( NAME.jumped ) %]
60
							<span class="term" id="jumped">[% NAME.name | html %]</span>
61
                            [% ELSIF ( NAME.highlighted ) %]
62
							<span class="term">[% NAME.name | html %]</span>
63
							[% ELSE %]
64
							[% NAME.name | html %]
65
							[% END %]
66
74
67
                            [% IF NAME.overridden %]
75
                            [% IF NAME.overridden %]
68
                                <span class="overridden" title="The system preference [% NAME.name | html %] may have been overridden from this value by one or more virtual hosts.">
76
                                <span class="overridden" title="The system preference [% NAME.name | html %] may have been overridden from this value by one or more virtual hosts.">
69
                                    [Overridden]
77
                                    [Overridden]
70
                                </span>
78
                                </span>
71
                            [% END %]
79
                            [% END %]
72
						</label>
80
                        </label>
73
                        [% UNLESS ( loop.last ) %]<br />[% END %]
81
                    [% UNLESS ( loop.last ) %]<br />[% END %]
74
                        [% END %]
82
                    [% END %]
75
                    </code>
83
                </dt>
76
                </td>
84
                <dd><div>
77
                <td><div>
78
                    [% FOREACH CHUNK IN LINE.CHUNKS %]
85
                    [% FOREACH CHUNK IN LINE.CHUNKS %]
79
                    [% IF ( CHUNK.type_text ) %]
86
                    [% IF ( CHUNK.type_text ) %]
80
                    [% CHUNK.contents | $raw %]
87
                    [% CHUNK.contents | $raw %]
Lines 100-108 Link Here
100
                        [% IF ( CHUNK.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
107
                        [% IF ( CHUNK.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
101
                        <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %] mce" rows="20" cols="60">[% CHUNK.value | html %]</textarea>
108
                        <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %] mce" rows="20" cols="60">[% CHUNK.value | html %]</textarea>
102
                        [% ELSE %]
109
                        [% ELSE %]
103
                        <a class="expand-textarea" style="display: none" href="#">Click to Edit</a>
110
                        <a class="expand-textarea" style="display: none" href="#"><i class="fa fa-pencil"></i> Click to edit</a>
104
                        <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %]" rows="10" cols="40">[% CHUNK.value | html %]</textarea>
111
                        <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %]" rows="10" cols="40">[% CHUNK.value | html %]</textarea>
105
                        <a class="collapse-textarea" style="display:none" href="#">Click to collapse</br></a>
112
                        <a class="collapse-textarea" style="display:none" href="#"><i class="fa fa-angle-double-up"></i> Click to collapse</br></a>
106
                        [% END %]
113
                        [% END %]
107
                    [% ELSIF ( CHUNK.type_languages ) %]
114
                    [% ELSIF ( CHUNK.type_languages ) %]
108
                    <dl class="sortable">
115
                    <dl class="sortable">
Lines 137-145 Link Here
137
                    </dl>
144
                    </dl>
138
                    [% END %]
145
                    [% END %]
139
                    [% END %]
146
                    [% END %]
140
                </div></td>
147
                </div></dt>
141
            </tr>
148
            </dl>
142
            [% IF ( loop.last ) %]</tbody></table>[% END %]
149
            [% IF ( loop.last ) %][% END %]
143
            [% END %]
150
            [% END %]
144
        [% END %]
151
        [% END %]
145
        <fieldset class="action"><button class="save-all submit" type="submit">Save all [% TAB.tab_title | html %] preferences</button> <a href="/cgi-bin/koha/admin/preferences.pl" class="force_reload cancel">Cancel</a></fieldset>
152
        <fieldset class="action"><button class="save-all submit" type="submit">Save all [% TAB.tab_title | html %] preferences</button> <a href="/cgi-bin/koha/admin/preferences.pl" class="force_reload cancel">Cancel</a></fieldset>
Lines 193-200 Link Here
193
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
200
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
194
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
201
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
195
        var MSG_LOADING = _( "Loading..." );
202
        var MSG_LOADING = _( "Loading..." );
203
        var MSG_FILTER_NOT_FOUND = _("No matching terms were found on this page");
196
    </script>
204
    </script>
197
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
205
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
206
    [% Asset.js("lib/jquery/plugins/jquery.mark.min.js") | $raw %]
198
    [% Asset.js("js/ajax.js") | $raw %]
207
    [% Asset.js("js/ajax.js") | $raw %]
199
    [% Asset.js("js/pages/preferences.js") | $raw %]
208
    [% Asset.js("js/pages/preferences.js") | $raw %]
200
    [%# Add WYSIWYG editor for htmlarea system preferences %]
209
    [%# Add WYSIWYG editor for htmlarea system preferences %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-29 / +33 lines)
Lines 45-58 KOHA.Preferences = { Link Here
45
45
46
$( document ).ready( function () {
46
$( document ).ready( function () {
47
47
48
    $("table.preferences").dataTable($.extend(true, {}, dataTablesDefaults, {
49
        "sDom": 't',
50
        "aoColumnDefs": [
51
            { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }
52
        ],
53
        "bPaginate": false
54
    }));
55
56
    function mark_modified() {
48
    function mark_modified() {
57
        $( this.form ).find( '.save-all' ).prop('disabled', false);
49
        $( this.form ).find( '.save-all' ).prop('disabled', false);
58
        $( this ).addClass( 'modified' );
50
        $( this ).addClass( 'modified' );
Lines 118-146 $( document ).ready( function () { Link Here
118
        return false;
110
        return false;
119
    });
111
    });
120
112
113
    if ( search_jumped ) {
114
        document.location.hash = "jumped";
115
    }
116
117
    $(".name-row").mark( to_highlight );
121
118
122
    $("h3").attr("class","expanded").attr("title",MSG_CLICK_TO_EXPAND);
123
    var collapsible = $(".collapsed,.expanded");
124
119
125
    $(collapsible).on("click",function(){
120
    // Filtering by mark.js
126
        var panel = $(this).next("div");
121
    var keyword_filter = $("#keyword_filter"),
127
        if(panel.is(":visible")){
122
    context = $(".name-row");
128
            $(this).addClass("collapsed").removeClass("expanded").attr("title",MSG_CLICK_TO_EXPAND);
123
    $("#clear_filter").on("click", function(e){
129
            panel.hide();
124
        e.preventDefault();
125
        keyword_filter.val("").trigger("input");
126
    });
127
    keyword_filter.on("input", function() {
128
        var term = $(this).val();
129
        context.show().unmark();
130
        if (term) {
131
            $("#clear_filter").show();
132
            context.mark(term, {
133
                done: function( total ) {
134
                    if( total > 0 ){
135
                        context.not(":has(mark)").hide();
136
                    }
137
                },
138
                noMatch: function(term){
139
                    if( $("#filter_empty").length < 1 ){
140
                        $("main").prepend("<div id=\"filter_empty\" class=\"dialog alert\">" + MSG_FILTER_NOT_FOUND + "</div>");
141
                    }
142
                    context.not(":has(mark)").show();
143
                }
144
            });
130
        } else {
145
        } else {
131
            $(this).addClass("expanded").removeClass("collapsed").attr("title",MSG_CLICK_TO_COLLAPSE);
146
            $("#clear_filter").hide();
132
            panel.show();
147
            $("#filter_empty").remove();
133
        }
148
        }
134
    });
149
    });
135
150
136
    if ( to_highlight ) {
151
});
137
        var words = to_highlight.split( ' ' );
138
        $( '.prefs-tab table' ).find( 'td, th' ).not( '.name-cell' ).each( function ( i, td ) {
139
            $.each( words, function ( i, word ) { $( td ).highlight( word ) } );
140
        } ).find( 'option, textarea' ).removeHighlight();
141
    }
142
143
    if ( search_jumped ) {
144
        document.location.hash = "jumped";
145
    }
146
} );
147
- 

Return to bug 20935