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

(-)a/koha-tmpl/opac-tmpl/ccsr/en/css/opac.css (-1 / +19 lines)
Lines 786-792 a.tag_add { Link Here
786
 font-size : 100%;
786
 font-size : 100%;
787
      font-weight : bold;
787
      font-weight : bold;
788
    padding-left : 31px;
788
    padding-left : 31px;
789
   color : #336699;
789
   color : #007FAE;
790
       cursor : pointer;
790
       cursor : pointer;
791
}
791
}
792
.searchresults a.highlight_toggle {
792
.searchresults a.highlight_toggle {
Lines 1162-1167 a.cancel { Link Here
1162
       font-size: 90%;
1162
       font-size: 90%;
1163
}
1163
}
1164
1164
1165
.addto {
1166
    white-space: nowrap;
1167
}
1168
1165
.cartlist {
1169
.cartlist {
1166
 margin-top : 5px;
1170
 margin-top : 5px;
1167
}
1171
}
Lines 2876-2878 a.reviewlink,a.reviewlink:visited { Link Here
2876
    display: block;
2880
    display: block;
2877
    overflow: auto;
2881
    overflow: auto;
2878
}
2882
}
2883
2884
.details_link {
2885
    display : none;
2886
}
2887
2888
.details_link a {
2889
    display: inline-block;
2890
    padding : 5px 24px;
2891
    text-decoration: none;
2892
    background-image: url("../../images/sprite.png"); /* Print */
2893
    background-position: -5px -1138px;
2894
    background-repeat: no-repeat;
2895
    white-space: nowrap;
2896
}
(-)a/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc (+3 lines)
Lines 39-44 Link Here
39
<script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
39
<script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
40
<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
40
<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
41
<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery-ui.js"></script>
41
<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery-ui.js"></script>
42
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.json.js"></script>
43
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
44
<script type="text/javascript" src="[% themelang %]/js/commons.js"></script>
42
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.hoverIntent.minified.js"></script>
45
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.hoverIntent.minified.js"></script>
43
<script type="text/javascript" src="[% themelang %]/js/script.js"></script>
46
<script type="text/javascript" src="[% themelang %]/js/script.js"></script>
44
[% IF ( OPACAmazonCoverImages ) %]
47
[% IF ( OPACAmazonCoverImages ) %]
(-)a/koha-tmpl/opac-tmpl/ccsr/en/js/commons.js (+71 lines)
Line 0 Link Here
1
// Extends jQuery API
2
// http://www.wskidmore.com/downloads/jquery-uniqueArray.min.js
3
jQuery.extend({uniqueArray:function(e){if($.isArray(e)){var c={};var a,b;for(b=0,a=e.length;b<a;b++){var d=e[b].toString();if(c[d]){e.splice(b,1);a--;b--}else{c[d]=true}}}return(e)}});
4
5
function removeByValue(arr, val) {
6
    for(var i=0; i<arr.length; i++) {
7
        if(arr[i] == val) {
8
            arr.splice(i, 1);
9
            break;
10
        }
11
    }
12
}
13
14
function paramOfUrl( url, param ) {
15
    param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
16
    var regexS = "[\\?&]"+param+"=([^&#]*)";
17
    var regex = new RegExp( regexS );
18
    var results = regex.exec( url );
19
    if( results == null ) {
20
        return "";
21
    } else {
22
        return results[1];
23
    }
24
}
25
26
function addBibToContext( bibnum ) {
27
    var bibnums = getContextBiblioNumbers();
28
    bibnums.push(bibnum);
29
    setContextBiblioNumbers( bibnums );
30
    //var store = sessionStorage.getItem( "bibs_selected" );
31
}
32
33
function delBibToContext( bibnum ) {
34
    var bibnums = getContextBiblioNumbers();
35
    removeByValue( bibnums, bibnum );
36
    setContextBiblioNumbers( $.uniqueArray( bibnums ) );
37
}
38
39
function setContextBiblioNumbers( bibnums ) {
40
    //sessionStorage.setItem("bibs_selected", JSON.stringify( bibnums ) );
41
    $.cookie('bibs_selected', JSON.stringify( bibnums ));
42
}
43
44
function getContextBiblioNumbers() {
45
    //var r = sessionStorage.getItem("bibs_selected");
46
    var r = $.cookie('bibs_selected');
47
    if ( r ) {
48
        return JSON.parse(r);
49
    }
50
    r = new Array();
51
    return r;
52
}
53
54
function resetSearchContext() {
55
    setContextBiblioNumbers( new Array() );
56
}
57
58
$(document).ready(function(){
59
    // forms with action leading to search
60
    $("form[action*='opac-search.pl']").submit(function(){
61
        resetSearchContext();
62
    });
63
    // any link to launch a search except navigation links
64
    $("[href*='opac-search.pl?']").not(".nav").not('.searchwithcontext').click(function(){
65
        resetSearchContext();
66
    });
67
    // any link to a detail page from the results page.
68
    $("#bookbag_form a[href*='opac-detail.pl?']").click(function(){
69
        resetSearchContext();
70
    });
71
});
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/jquery/plugins/jquery.cookie.min.js (+1 lines)
Line 0 Link Here
1
jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/jquery/plugins/jquery.json.js (+199 lines)
Line 0 Link Here
1
/**
2
 * jQuery JSON plugin 2.4-alpha
3
 *
4
 * @author Brantley Harris, 2009-2011
5
 * @author Timo Tijhof, 2011-2012
6
 * @source This plugin is heavily influenced by MochiKit's serializeJSON, which is
7
 *         copyrighted 2005 by Bob Ippolito.
8
 * @source Brantley Harris wrote this plugin. It is based somewhat on the JSON.org
9
 *         website's http://www.json.org/json2.js, which proclaims:
10
 *         "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
11
 *         I uphold.
12
 * @license MIT License <http://www.opensource.org/licenses/mit-license.php>
13
 */
14
(function ($) {
15
    'use strict';
16
17
    var escape = /["\\\x00-\x1f\x7f-\x9f]/g,
18
        meta = {
19
            '\b': '\\b',
20
            '\t': '\\t',
21
            '\n': '\\n',
22
            '\f': '\\f',
23
            '\r': '\\r',
24
            '"' : '\\"',
25
            '\\': '\\\\'
26
        },
27
        hasOwn = Object.prototype.hasOwnProperty;
28
29
    /**
30
     * jQuery.toJSON
31
     * Converts the given argument into a JSON representation.
32
     *
33
     * @param o {Mixed} The json-serializable *thing* to be converted
34
     *
35
     * If an object has a toJSON prototype, that will be used to get the representation.
36
     * Non-integer/string keys are skipped in the object, as are keys that point to a
37
     * function.
38
     *
39
     */
40
    $.toJSON = typeof JSON === 'object' && JSON.stringify ? JSON.stringify : function (o) {
41
        if (o === null) {
42
            return 'null';
43
        }
44
45
        var pairs, k, name, val,
46
            type = $.type(o);
47
48
        if (type === 'undefined') {
49
            return undefined;
50
        }
51
52
        // Also covers instantiated Number and Boolean objects,
53
        // which are typeof 'object' but thanks to $.type, we
54
        // catch them here. I don't know whether it is right
55
        // or wrong that instantiated primitives are not
56
        // exported to JSON as an {"object":..}.
57
        // We choose this path because that's what the browsers did.
58
        if (type === 'number' || type === 'boolean') {
59
            return String(o);
60
        }
61
        if (type === 'string') {
62
            return $.quoteString(o);
63
        }
64
        if (typeof o.toJSON === 'function') {
65
            return $.toJSON(o.toJSON());
66
        }
67
        if (type === 'date') {
68
            var month = o.getUTCMonth() + 1,
69
                day = o.getUTCDate(),
70
                year = o.getUTCFullYear(),
71
                hours = o.getUTCHours(),
72
                minutes = o.getUTCMinutes(),
73
                seconds = o.getUTCSeconds(),
74
                milli = o.getUTCMilliseconds();
75
76
            if (month < 10) {
77
                month = '0' + month;
78
            }
79
            if (day < 10) {
80
                day = '0' + day;
81
            }
82
            if (hours < 10) {
83
                hours = '0' + hours;
84
            }
85
            if (minutes < 10) {
86
                minutes = '0' + minutes;
87
            }
88
            if (seconds < 10) {
89
                seconds = '0' + seconds;
90
            }
91
            if (milli < 100) {
92
                milli = '0' + milli;
93
            }
94
            if (milli < 10) {
95
                milli = '0' + milli;
96
            }
97
            return '"' + year + '-' + month + '-' + day + 'T' +
98
                hours + ':' + minutes + ':' + seconds +
99
                '.' + milli + 'Z"';
100
        }
101
102
        pairs = [];
103
104
        if ($.isArray(o)) {
105
            for (k = 0; k < o.length; k++) {
106
                pairs.push($.toJSON(o[k]) || 'null');
107
            }
108
            return '[' + pairs.join(',') + ']';
109
        }
110
111
        // Any other object (plain object, RegExp, ..)
112
        // Need to do typeof instead of $.type, because we also
113
        // want to catch non-plain objects.
114
        if (typeof o === 'object') {
115
            for (k in o) {
116
                // Only include own properties,
117
                // Filter out inherited prototypes
118
                if (hasOwn.call(o, k)) {
119
                    // Keys must be numerical or string. Skip others
120
                    type = typeof k;
121
                    if (type === 'number') {
122
                        name = '"' + k + '"';
123
                    } else if (type === 'string') {
124
                        name = $.quoteString(k);
125
                    } else {
126
                        continue;
127
                    }
128
                    type = typeof o[k];
129
130
                    // Invalid values like these return undefined
131
                    // from toJSON, however those object members
132
                    // shouldn't be included in the JSON string at all.
133
                    if (type !== 'function' && type !== 'undefined') {
134
                        val = $.toJSON(o[k]);
135
                        pairs.push(name + ':' + val);
136
                    }
137
                }
138
            }
139
            return '{' + pairs.join(',') + '}';
140
        }
141
    };
142
143
    /**
144
     * jQuery.evalJSON
145
     * Evaluates a given json string.
146
     *
147
     * @param str {String}
148
     */
149
    $.evalJSON = typeof JSON === 'object' && JSON.parse ? JSON.parse : function (str) {
150
        /*jshint evil: true */
151
        return eval('(' + str + ')');
152
    };
153
154
    /**
155
     * jQuery.secureEvalJSON
156
     * Evals JSON in a way that is *more* secure.
157
     *
158
     * @param str {String}
159
     */
160
    $.secureEvalJSON = typeof JSON === 'object' && JSON.parse ? JSON.parse : function (str) {
161
        var filtered =
162
            str
163
            .replace(/\\["\\\/bfnrtu]/g, '@')
164
            .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
165
            .replace(/(?:^|:|,)(?:\s*\[)+/g, '');
166
167
        if (/^[\],:{}\s]*$/.test(filtered)) {
168
            /*jshint evil: true */
169
            return eval('(' + str + ')');
170
        }
171
        throw new SyntaxError('Error parsing JSON, source is not valid.');
172
    };
173
174
    /**
175
     * jQuery.quoteString
176
     * Returns a string-repr of a string, escaping quotes intelligently.
177
     * Mostly a support function for toJSON.
178
     * Examples:
179
     * >>> jQuery.quoteString('apple')
180
     * "apple"
181
     *
182
     * >>> jQuery.quoteString('"Where are we going?", she asked.')
183
     * "\"Where are we going?\", she asked."
184
     */
185
    $.quoteString = function (str) {
186
        if (str.match(escape)) {
187
            return '"' + str.replace(escape, function (a) {
188
                var c = meta[a];
189
                if (typeof c === 'string') {
190
                    return c;
191
                }
192
                c = a.charCodeAt();
193
                return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
194
            }) + '"';
195
        }
196
        return '"' + str + '"';
197
    };
198
199
}(jQuery));
(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (-1 / +17 lines)
Lines 846-852 a.tag_add { Link Here
846
	font-size : 100%;
846
	font-size : 100%;
847
	font-weight : bold;
847
	font-weight : bold;
848
	padding-left : 31px;
848
	padding-left : 31px;
849
	color : #336699;
849
    color : #006699;
850
	cursor : pointer;
850
	cursor : pointer;
851
}
851
}
852
.searchresults a.highlight_toggle {
852
.searchresults a.highlight_toggle {
Lines 1223-1228 a.cancel { Link Here
1223
	font-size: 90%;
1223
	font-size: 90%;
1224
}
1224
}
1225
1225
1226
.addto {
1227
    white-space: nowrap;
1228
}
1229
1226
.cartlist {
1230
.cartlist {
1227
	margin-top : 5px;
1231
	margin-top : 5px;
1228
}
1232
}
Lines 3063-3065 padding: 0.1em 0; Link Here
3063
    display: block;
3067
    display: block;
3064
    overflow: auto;
3068
    overflow: auto;
3065
}
3069
}
3070
.details_link {
3071
    display : none;
3072
}
3073
.details_link a {
3074
    display: inline-block;
3075
    padding : 5px 24px;
3076
    text-decoration: none;
3077
    background-image: url("../../images/sprite.png"); /* Print */
3078
    background-position: -5px -1138px;
3079
    background-repeat: no-repeat;
3080
    white-space: nowrap;
3081
}
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-1 / +1 lines)
Lines 529-535 $(document).ready(function(){ Link Here
529
                              Tag status here.
529
                              Tag status here.
530
                            </span>
530
                            </span>
531
            [% END %]
531
            [% END %]
532
            <span class="details_link" style="display:none" ><a href="#">Browse selected biblios &gt;&gt;</a></span>
532
            <span class="details_link"><a href="#">Browse selected records</a></span>
533
        </div>
533
        </div>
534
534
535
        </td></tr>
535
        </td></tr>

Return to bug 10858