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

(-)a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.js (+89 lines)
Line 0 Link Here
1
/*jslint browser: true */ /*global jQuery: true */
2
3
/**
4
 * jQuery Cookie plugin
5
 *
6
 * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
7
 * Dual licensed under the MIT and GPL licenses:
8
 * http://www.opensource.org/licenses/mit-license.php
9
 * http://www.gnu.org/licenses/gpl.html
10
 *
11
 */
12
13
// TODO JsDoc
14
15
/**
16
 * Create a cookie with the given key and value and other optional parameters.
17
 *
18
 * @example $.cookie('the_cookie', 'the_value');
19
 * @desc Set the value of a cookie.
20
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
21
 * @desc Create a cookie with all available options.
22
 * @example $.cookie('the_cookie', 'the_value');
23
 * @desc Create a session cookie.
24
 * @example $.cookie('the_cookie', null);
25
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
26
 *       used when the cookie was set.
27
 *
28
 * @param String key The key of the cookie.
29
 * @param String value The value of the cookie.
30
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
31
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
32
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
33
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
34
 *                             when the the browser exits.
35
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
36
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
37
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
38
 *                        require a secure protocol (like HTTPS).
39
 * @type undefined
40
 *
41
 * @name $.cookie
42
 * @cat Plugins/Cookie
43
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
44
 */
45
46
/**
47
 * Get the value of a cookie with the given key.
48
 *
49
 * @example $.cookie('the_cookie');
50
 * @desc Get the value of a cookie.
51
 *
52
 * @param String key The key of the cookie.
53
 * @return The value of the cookie.
54
 * @type String
55
 *
56
 * @name $.cookie
57
 * @cat Plugins/Cookie
58
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
59
 */
60
jQuery.cookie = function (key, value, options) {
61
62
    // key and value given, set cookie...
63
    if (arguments.length > 1 && (value === null || typeof value !== "object")) {
64
        options = jQuery.extend({}, options);
65
66
        if (value === null) {
67
            options.expires = -1;
68
        }
69
70
        if (typeof options.expires === 'number') {
71
            var days = options.expires, t = options.expires = new Date();
72
            t.setDate(t.getDate() + days);
73
        }
74
75
        return (document.cookie = [
76
            encodeURIComponent(key), '=',
77
            options.raw ? String(value) : encodeURIComponent(String(value)),
78
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
79
            options.path ? '; path=' + options.path : '',
80
            options.domain ? '; domain=' + options.domain : '',
81
            options.secure ? '; secure' : ''
82
        ].join(''));
83
    }
84
85
    // key and possibly options given, get cookie...
86
    options = value || {};
87
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
88
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
89
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl (-2 / +41 lines)
Lines 2-7 Link Here
2
<title>Koha &rsaquo; Cataloging &rsaquo; <!-- TMPL_IF NAME="biblionumber" -->Editing <!-- TMPL_VAR NAME="title" escape="html" --> (Record Number <!-- TMPL_VAR name="biblionumber" -->)<!-- TMPL_ELSE -->Add MARC Record<!-- /TMPL_IF --></title>
2
<title>Koha &rsaquo; Cataloging &rsaquo; <!-- TMPL_IF NAME="biblionumber" -->Editing <!-- TMPL_VAR NAME="title" escape="html" --> (Record Number <!-- TMPL_VAR name="biblionumber" -->)<!-- TMPL_ELSE -->Add MARC Record<!-- /TMPL_IF --></title>
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/yui/plugins/bubbling-min.js"></script>
4
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/yui/plugins/bubbling-min.js"></script>
5
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.cookie.js"></script>
5
<script type="text/javascript">
6
<script type="text/javascript">
6
//<![CDATA[
7
//<![CDATA[
7
8
Lines 102-107 function _UNIMARCFieldDoc(field,fieldnumber) { Link Here
102
    }
103
    }
103
}
104
}
104
105
106
/*
107
 * Functions to load/unload css from the head element
108
 */
109
function loadCSS(id,cssDef) {
110
111
  var cssElem=document.createElement("style");
112
  cssElem.setAttribute("type", "text/css");
113
  cssElem.setAttribute("id", id);
114
  cssElem.innerHTML = cssDef;
115
 
116
  document.getElementsByTagName("head")[0].appendChild(cssElem);
117
}
118
119
function unloadCSS(id) {
120
  var elem = document.getElementById(id);
121
  elem.parentNode.removeChild(elem);
122
}
123
124
/*
125
 * Functions to hide/show marc docs links
126
 */
127
function hideMARCdocLinks() {
128
  loadCSS("marcDocsCSS",".marcdocs{display: none;}");
129
}
130
131
function showMARCdocLinks() {
132
  unloadCSS("marcDocsCSS");
133
}
134
135
function toggleMARCDocs(checked) {
136
  if (checked) {
137
    showMARCdocLinks();
138
  } else {
139
    hideMARCdocLinks();
140
  }
141
}
142
105
/**
143
/**
106
 * check if mandatory subfields are written
144
 * check if mandatory subfields are written
107
 */
145
 */
Lines 649-654 function unHideSubfield(index,labelindex) { // FIXME :: is it used ? Link Here
649
687
650
688
651
<h1><!-- TMPL_IF NAME="biblionumber" -->Editing <em><!-- TMPL_VAR NAME="title" escape="html" --></em> (Record Number <!-- TMPL_VAR name="biblionumber" -->)</h1><!-- TMPL_ELSE -->Add MARC Record</h1><!-- /TMPL_IF -->
689
<h1><!-- TMPL_IF NAME="biblionumber" -->Editing <em><!-- TMPL_VAR NAME="title" escape="html" --></em> (Record Number <!-- TMPL_VAR name="biblionumber" -->)</h1><!-- TMPL_ELSE -->Add MARC Record</h1><!-- /TMPL_IF -->
690
<div><input type="checkbox" name="marcDocsSelect" checked="true" onclick="toggleMARCDocs(this.checked)"/>
691
 Show MARC tag documentation links<br/></div>
652
692
653
<!-- TMPL_UNLESS name="number" -->
693
<!-- TMPL_UNLESS name="number" -->
654
    <!-- show duplicate warning on tab 0 only -->
694
    <!-- show duplicate warning on tab 0 only -->
Lines 784-790 function unHideSubfield(index,labelindex) { // FIXME :: is it used ? Link Here
784
            	<!-- TMPL_IF NAME="advancedMARCEditor" -->
824
            	<!-- TMPL_IF NAME="advancedMARCEditor" -->
785
		<a href="#" tabindex="1" class="tagnum" title="<!-- TMPL_VAR NAME="tag_lib"--> - Click to Expand this Tag" onclick="ExpandField('tag_<!-- TMPL_VAR NAME="tag"-->_<!-- TMPL_VAR NAME='index' --><!-- TMPL_VAR NAME="random" -->'); return false;"><!-- TMPL_VAR NAME="tag" --></a>
825
		<a href="#" tabindex="1" class="tagnum" title="<!-- TMPL_VAR NAME="tag_lib"--> - Click to Expand this Tag" onclick="ExpandField('tag_<!-- TMPL_VAR NAME="tag"-->_<!-- TMPL_VAR NAME='index' --><!-- TMPL_VAR NAME="random" -->'); return false;"><!-- TMPL_VAR NAME="tag" --></a>
786
		<!-- TMPL_ELSE -->
826
		<!-- TMPL_ELSE -->
787
                        <span class="tagnum" title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --><a 
827
                        <span class="tagnum" title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --><a class="marcdocs"
788
                 onclick="PopupMARCFieldDoc(<!-- TMPL_VAR NAME="tag" -->, <!-- TMPL_VAR NAME="number" -->); return false;">&nbsp;?</a></span>
828
                 onclick="PopupMARCFieldDoc(<!-- TMPL_VAR NAME="tag" -->, <!-- TMPL_VAR NAME="number" -->); return false;">&nbsp;?</a></span>
789
		<!-- /TMPL_IF -->
829
		<!-- /TMPL_IF -->
790
                <!-- TMPL_IF NAME="fixedfield" -->
830
                <!-- TMPL_IF NAME="fixedfield" -->
791
- 

Return to bug 5546