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/staff-global.css (+5 lines)
Lines 93-98 h1,h2,h3,h4,h5,h6 { Link Here
93
	margin : .3em 0;
93
	margin : .3em 0;
94
}
94
}
95
95
96
mark {
97
    background-color: #EFFF73;
98
    padding: 0;
99
}
100
96
p {
101
p {
97
	margin: .5em 0 .5em 0;
102
	margin: .5em 0 .5em 0;
98
}
103
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (+3 lines)
Lines 1012-1017 Link Here
1012
1012
1013
            <h2>JSZip</h2>
1013
            <h2>JSZip</h2>
1014
            <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>
1014
            <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>
1015
1016
            <h2>mark.js</h2>
1017
            <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>
1015
        </div>
1018
        </div>
1016
1019
1017
        <div id="translations">
1020
        <div id="translations">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (-48 / +58 lines)
Lines 9-25 Link Here
9
[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") %]
9
[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") %]
10
[% Asset.css("css/humanmsg.css") %]
10
[% Asset.css("css/humanmsg.css") %]
11
</head>
11
</head>
12
12
<body id="admin_preferences" class="admin">
13
<body id="admin_preferences" class="admin">
13
[% INCLUDE 'header.inc' %]
14
[% INCLUDE 'header.inc' %]
14
[% INCLUDE 'prefs-admin-search.inc' %]
15
[% INCLUDE 'prefs-admin-search.inc' %]
15
16
16
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; System preferences</div>
17
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; System preferences</div>
17
18
18
<div id="doc3" class="yui-t2">
19
<div class="main container-fluid">
19
20
    <div class="row">
20
   <div id="bd">
21
        <div class="col-sm-10 col-sm-push-2">
21
    <div id="yui-main">
22
            <main>
22
	    <div class="yui-b">
23
23
24
    [% IF ( jump_not_found ) %]
24
    [% IF ( jump_not_found ) %]
25
    <h2>System preferences</h2>
25
    <h2>System preferences</h2>
Lines 34-80 Link Here
34
    [% ELSIF searchfield %]
34
    [% ELSIF searchfield %]
35
        <h1>You searched for: [% searchfield | html %]</h1>
35
        <h1>You searched for: [% searchfield | html %]</h1>
36
    [% END %]
36
    [% END %]
37
    [% IF ( searchfield && !search_not_found ) %]
38
        <p>
39
            Results in sections:
40
            [% FOREACH TAB IN TABS %]
41
                <a href="#[% TAB.tab_title %]">[% TAB.tab_title %]</a>[% UNLESS ( loop.last ) %] &bull; [% END %]
42
            [% END %]
43
        </p>
44
    [% END %]
45
    [% IF ( searchfield ) %]
46
        <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>
47
    [% END %]
37
    [% FOREACH TAB IN TABS %]
48
    [% FOREACH TAB IN TABS %]
38
    <div class="prefs-tab">
49
    <div class="prefs-tab">
39
    <h2>[% TAB.tab_title %] preferences</h2>
50
    <h2 id="[% TAB.tab_title %]">[% TAB.tab_title %] preferences</h2>
40
    <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
51
    <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 %] preferences</button></div>[% END %]
52
        [% UNLESS ( searchfield ) %]
53
            <div id="toolbar">
54
                <button class="save-all submit" type="submit">Save all [% TAB.tab_title %] preferences</button>
55
                <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>
56
            </div>
57
        [% END %]
42
        <input type="hidden" name="op" value="save" />
58
        <input type="hidden" name="op" value="save" />
43
        <input type="hidden" name="tab" value="[% TAB.tab_id %]" />
59
        <input type="hidden" name="tab" value="[% TAB.tab_id %]" />
44
60
        [% FOREACH LINE IN TAB.LINES %]
45
            [% FOREACH LINE IN TAB.LINES %]
46
            [% IF ( LINE.is_group_title ) %]
61
            [% IF ( LINE.is_group_title ) %]
47
            [% UNLESS ( loop.first ) %]</tbody></table>[% END %]
62
                [% UNLESS ( loop.first ) %][% END %]
48
            <h3>[% LINE.title %]</h3>
63
                <h3 class="name-row">[% LINE.title %]</h3>
49
            <table class="preferences">
64
                [% UNLESS ( loop.last ) %][% END %]
50
            <thead><tr><th>Preference</th><th>Value</th></tr></thead>
51
            [% UNLESS ( loop.last ) %]<tbody>[% END %]
52
            [% ELSE %]
65
            [% ELSE %]
53
            [% IF ( loop.first ) %]<table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody>[% END %]
66
                [% IF ( loop.first ) %][% END %]
54
            <tr class="name-row">
67
            <dl class="name-row">
55
                <td class="name-cell">
68
                <dt class="name-cell">
56
                    <code>
69
                    [% FOREACH NAME IN LINE.NAMES %]
57
                        [% FOREACH NAME IN LINE.NAMES %]
70
                        <label for="pref_[% NAME.name %]">
58
						<label for="pref_[% NAME.name %]">
71
                            [% NAME.name %]
59
							[% IF ( NAME.jumped ) %]
60
							<span class="term" id="jumped">[% NAME.name %]</span>
61
                            [% ELSIF ( NAME.highlighted ) %]
62
							<span class="term">[% NAME.name %]</span>
63
							[% ELSE %]
64
							[% NAME.name %]
65
							[% END %]
66
72
67
                            [% IF NAME.overridden %]
73
                            [% IF NAME.overridden %]
68
                                <span class="overridden" title="The system preference [% NAME.name %] may have been overridden from this value by one or more virtual hosts.">
74
                                <span class="overridden" title="The system preference [% NAME.name %] may have been overridden from this value by one or more virtual hosts.">
69
                                    [Overridden]
75
                                    [Overridden]
70
                                </span>
76
                                </span>
71
                            [% END %]
77
                            [% END %]
72
						</label>
78
                        </label>
73
                        [% UNLESS ( loop.last ) %]<br />[% END %]
79
                    [% UNLESS ( loop.last ) %]<br />[% END %]
74
                        [% END %]
80
                    [% END %]
75
                    </code>
81
                </dt>
76
                </td>
82
                <dd><div>
77
                <td><div>
78
                    [% FOREACH CHUNK IN LINE.CHUNKS %]
83
                    [% FOREACH CHUNK IN LINE.CHUNKS %]
79
                    [% IF ( CHUNK.type_text ) %]
84
                    [% IF ( CHUNK.type_text ) %]
80
                    [% CHUNK.contents %]
85
                    [% CHUNK.contents %]
Lines 100-108 Link Here
100
                        [% IF ( CHUNK.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
105
                        [% IF ( CHUNK.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
101
                        <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %] mce" rows="20" cols="60">[% CHUNK.value %]</textarea>
106
                        <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %] mce" rows="20" cols="60">[% CHUNK.value %]</textarea>
102
                        [% ELSE %]
107
                        [% ELSE %]
103
                        <a class="expand-textarea" style="display: none" href="#">Click to Edit</a>
108
                        <a class="expand-textarea" style="display: none" href="#"><i class="fa fa-pencil"></i> Click to edit</a>
104
                        <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" rows="10" cols="40">[% CHUNK.value %]</textarea>
109
                        <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" rows="10" cols="40">[% CHUNK.value %]</textarea>
105
                        <a class="collapse-textarea" style="display:none" href="#">Click to collapse</br></a>
110
                        <a class="collapse-textarea" style="display:none" href="#"><i class="fa fa-angle-double-up"></i> Click to collapse</br></a>
106
                        [% END %]
111
                        [% END %]
107
                    [% ELSIF ( CHUNK.type_languages ) %]
112
                    [% ELSIF ( CHUNK.type_languages ) %]
108
                    <dl class="sortable">
113
                    <dl class="sortable">
Lines 137-163 Link Here
137
                    </dl>
142
                    </dl>
138
                    [% END %]
143
                    [% END %]
139
                    [% END %]
144
                    [% END %]
140
                </div></td>
145
                </div></dt>
141
            </tr>
146
            </dl>
142
            [% IF ( loop.last ) %]</tbody></table>[% END %]
147
            [% IF ( loop.last ) %][% END %]
143
            [% END %]
148
            [% END %]
144
        [% END %]
149
        [% END %]
145
        <fieldset class="action"><button class="save-all submit" type="submit">Save all [% TAB.tab_title %] preferences</button> <a href="/cgi-bin/koha/admin/preferences.pl" class="force_reload cancel">Cancel</a></fieldset>
150
        <fieldset class="action"><button class="save-all submit" type="submit">Save all [% TAB.tab_title %] preferences</button> <a href="/cgi-bin/koha/admin/preferences.pl" class="force_reload cancel">Cancel</a></fieldset>
146
    </form>
151
    </form>
147
    </div>
152
    </div>
148
    [% END %]
153
    [% END %]
149
</div>
154
150
</div>
155
            </main>
151
<div class="yui-b">
156
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
152
[% INCLUDE 'prefs-menu.inc' %]
157
153
</div>
158
        <div class="col-sm-2 col-sm-pull-10">
154
</div>
159
            <aside>
160
                [% INCLUDE 'admin-menu.inc' %]
161
            </aside>
162
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
163
     </div> <!-- /.row -->
155
164
156
[% MACRO jsinclude BLOCK %]
165
[% MACRO jsinclude BLOCK %]
157
    [% INCLUDE 'datatables.inc' %]
166
    [% INCLUDE 'datatables.inc' %]
158
    [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %]
167
    [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %]
159
    [% Asset.js("lib/jquery/plugins/multiple-select/jquery.multiple.select.js") %]
168
    [% Asset.js("lib/jquery/plugins/multiple-select/jquery.multiple.select.js") %]
160
    <script type="text/javascript">
169
    <script>
161
        [% UNLESS ( searchfield ) %]$(document).ready(function(){
170
        [% UNLESS ( searchfield ) %]$(document).ready(function(){
162
                $('#toolbar').fixFloat();
171
                $('#toolbar').fixFloat();
163
            });[% END %]
172
            });[% END %]
Lines 190-198 Link Here
190
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
199
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
191
        var MSG_LOADING = _( "Loading..." );
200
        var MSG_LOADING = _( "Loading..." );
192
    </script>
201
    </script>
193
    <script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
202
    [% Asset.js("lib/jquery/plugins/humanmsg.js") %]
194
    <script src="[% interface %]/[% theme %]/js/ajax.js" type="text/javascript"></script>
203
    [% Asset.js("lib/jquery/plugins/jquery.mark.min.js") %]
195
    <script src="[% interface %]/[% theme %]/js/pages/preferences.js" type="text/javascript"></script>
204
    [% Asset.js("js/ajax.js") %]
205
    [% Asset.js("js/pages/preferences.js") %]
196
    [%# Add WYSIWYG editor for htmlarea system preferences %]
206
    [%# Add WYSIWYG editor for htmlarea system preferences %]
197
    [% INCLUDE 'wysiwyg-systempreferences.inc' %]
207
    [% INCLUDE 'wysiwyg-systempreferences.inc' %]
198
[% END %]
208
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-28 / +29 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
                    alert( term + " not found");
140
                    context.not(":has(mark)").show();
141
                }
142
            });
130
        } else {
143
        } else {
131
            $(this).addClass("expanded").removeClass("collapsed").attr("title",MSG_CLICK_TO_COLLAPSE);
144
            $("#clear_filter").hide();
132
            panel.show();
133
        }
145
        }
134
    });
146
    });
135
147
136
    if ( to_highlight ) {
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
} );
148
} );
147
- 

Return to bug 20935