# HG changeset patch # User robcast # Date 1487012083 -3600 # Node ID bd88824db0176bf612ad86bcd32b1a90532fa595 # Parent e52ac05b302d7b741e2be4a8adac3c482f9fa6ec# Parent fdc1ba44753952affe626abbcd804796a9f1207b Merge from default fdc1ba44753952affe626abbcd804796a9f1207b diff -r e52ac05b302d -r bd88824db017 common/src/main/java/digilib/conf/DigilibConfiguration.java --- a/common/src/main/java/digilib/conf/DigilibConfiguration.java Mon Feb 13 17:08:04 2017 +0100 +++ b/common/src/main/java/digilib/conf/DigilibConfiguration.java Mon Feb 13 19:54:43 2017 +0100 @@ -57,7 +57,7 @@ /** digilib version */ public static String getClassVersion() { - return "2.5.0"; + return "2.5.1"; } /* non-static getVersion for Java inheritance */ diff -r e52ac05b302d -r bd88824db017 webapp/src/main/webapp/api/ImgInfo-json.jsp --- a/webapp/src/main/webapp/api/ImgInfo-json.jsp Mon Feb 13 17:08:04 2017 +0100 +++ b/webapp/src/main/webapp/api/ImgInfo-json.jsp Mon Feb 13 19:54:43 2017 +0100 @@ -37,7 +37,7 @@ System.out.println(e); } } -%><% +%><%@ page contentType="application/json" pageEncoding="UTF-8" %><% // parsing the query docBean.setRequest(request); // get file diff -r e52ac05b302d -r bd88824db017 webapp/src/main/webapp/api/dirInfo-json.jsp --- a/webapp/src/main/webapp/api/dirInfo-json.jsp Mon Feb 13 17:08:04 2017 +0100 +++ b/webapp/src/main/webapp/api/dirInfo-json.jsp Mon Feb 13 19:54:43 2017 +0100 @@ -40,7 +40,7 @@ System.out.println(e); } } -%><%@ page contentType="application/json" %><% +%><%@ page contentType="application/json" pageEncoding="UTF-8" %><% // process request docBean.setRequest(request); // get directory diff -r e52ac05b302d -r bd88824db017 webapp/src/main/webapp/api/dirInfo-xml.jsp --- a/webapp/src/main/webapp/api/dirInfo-xml.jsp Mon Feb 13 17:08:04 2017 +0100 +++ b/webapp/src/main/webapp/api/dirInfo-xml.jsp Mon Feb 13 19:54:43 2017 +0100 @@ -40,7 +40,7 @@ System.out.println(e); } } -%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ page contentType="text/xml" %> +%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ page contentType="text/xml" pageEncoding="UTF-8"%> <% // process request docBean.setRequest(request); diff -r e52ac05b302d -r bd88824db017 webapp/src/main/webapp/api/dlContext-xml.jsp --- a/webapp/src/main/webapp/api/dlContext-xml.jsp Mon Feb 13 17:08:04 2017 +0100 +++ b/webapp/src/main/webapp/api/dlContext-xml.jsp Mon Feb 13 19:54:43 2017 +0100 @@ -38,7 +38,7 @@ System.out.println(e); } } -%> +%><%@ page contentType="text/xml" pageEncoding="UTF-8"%> <% // process request // get digilib config diff -r e52ac05b302d -r bd88824db017 webapp/src/main/webapp/api/dlInfo-json.jsp --- a/webapp/src/main/webapp/api/dlInfo-json.jsp Mon Feb 13 17:08:04 2017 +0100 +++ b/webapp/src/main/webapp/api/dlInfo-json.jsp Mon Feb 13 19:54:43 2017 +0100 @@ -34,7 +34,7 @@ System.out.println(e); } } -%><% +%><%@ page contentType="application/json" pageEncoding="UTF-8" %><% // parsing the query DigilibServletRequest dlRequest = new DigilibServletRequest(request); docBean.setRequest(dlRequest); diff -r e52ac05b302d -r bd88824db017 webapp/src/main/webapp/api/dlInfo-xml.jsp --- a/webapp/src/main/webapp/api/dlInfo-xml.jsp Mon Feb 13 17:08:04 2017 +0100 +++ b/webapp/src/main/webapp/api/dlInfo-xml.jsp Mon Feb 13 19:54:43 2017 +0100 @@ -34,7 +34,7 @@ System.out.println(e); } } -%> +%><%@ page contentType="text/xml" pageEncoding="UTF-8"%> <% // process request // parsing the query diff -r e52ac05b302d -r bd88824db017 webapp/src/main/webapp/jquery/annotator-dl.js --- a/webapp/src/main/webapp/jquery/annotator-dl.js Mon Feb 13 17:08:04 2017 +0100 +++ b/webapp/src/main/webapp/jquery/annotator-dl.js Mon Feb 13 19:54:43 2017 +0100 @@ -1,13 +1,13 @@ /* -** Annotator v1.2.9-dev-cab39d7 +** Annotator v1.2.10-dev-976a5f0 ** https://github.com/okfn/annotator/ ** -** Copyright 2015, the Annotator project contributors. +** Copyright 2017, the Annotator project contributors. ** Dual licensed under the MIT and GPLv3 licenses. ** https://github.com/okfn/annotator/blob/master/LICENSE ** -** Built at: 2015-02-20 19:20:03Z +** Built at: 2017-02-13 17:46:12Z */ @@ -613,7 +613,11 @@ } } if (r.end == null) { - node = this.endContainer.childNodes[this.endOffset - 1]; + if (this.endOffset) { + node = this.endContainer.childNodes[this.endOffset - 1]; + } else { + node = this.endContainer.previousSibling; + } r.end = Util.getLastTextNodeUpTo(node); r.endOffset = r.end.nodeValue.length; } @@ -1249,7 +1253,7 @@ }; Annotator.prototype.isAnnotator = function(element) { - return !!$(element).parents().addBack().filter('[class^=annotator-]').not('[class=annotator-hl]').not(this.wrapper).length; + return !!$(element).parents().addBack().filter('[class^=annotator-]').not('[class^=annotator-hl]').not(this.wrapper).length; }; Annotator.prototype.onHighlightMouseover = function(event) { @@ -1677,16 +1681,16 @@ left: event.pageX - mousedown.left }; if (mousedown.element === resize[0]) { - height = textarea.outerHeight(); - width = textarea.outerWidth(); + height = textarea.height(); + width = textarea.width(); directionX = editor.hasClass(classes.invert.x) ? -1 : 1; directionY = editor.hasClass(classes.invert.y) ? 1 : -1; textarea.height(height + (diff.top * directionY)); textarea.width(width + (diff.left * directionX)); - if (textarea.outerHeight() !== height) { + if (textarea.height() !== height) { mousedown.top = event.pageY; } - if (textarea.outerWidth() !== width) { + if (textarea.width() !== width) { mousedown.left = event.pageX; } } else if (mousedown.element === controls[0]) { @@ -2277,7 +2281,7 @@ var _this = this; if (__indexOf.call(this.annotations, annotation) >= 0) { return this._apiRequest('destroy', annotation, (function() { - _this.publish("annotationDestroyed", [annotation]); + _this.publish('annotationDestroyed', [annotation]); return _this.unregisterAnnotation(annotation); })); } @@ -2297,7 +2301,7 @@ } else { $.extend(annotation, data); } - this.publish("annotationStored", [data]); + this.publish('annotationStored', [data]); return $(annotation.highlights).data('annotation', annotation); }; @@ -2307,10 +2311,10 @@ Store.prototype._onLoadAnnotations = function(data) { var a, annotation, annotationMap, newData, _k, _l, _len2, _len3, _ref3; - this.publish("annotationRead", [this.annotations, data]); if (data == null) { data = []; } + this.publish("annotationRead", [this.annotations, data]); annotationMap = {}; _ref3 = this.annotations; for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) { @@ -2339,7 +2343,7 @@ if (data == null) { data = {}; } - this.publish("annotationSearchResult", [this.annotations, data]); + this.publish('annotationSearchResult', [this.annotations, data]); return this._onLoadAnnotations(data.rows || []); }; @@ -2930,7 +2934,8 @@ GroupPermissions.prototype._cleanPermissions = function(annotation) { var perm, type, _k, _len2, _ref3, _results; perm = annotation.permissions['admin']; - _ref3 = ['delete', 'update', 'read']; + annotation.permissions['delete'] = perm; + _ref3 = ['update', 'read']; _results = []; for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) { type = _ref3[_k]; diff -r e52ac05b302d -r bd88824db017 webapp/src/main/webapp/jquery/annotator-dl.min.js --- a/webapp/src/main/webapp/jquery/annotator-dl.min.js Mon Feb 13 17:08:04 2017 +0100 +++ b/webapp/src/main/webapp/jquery/annotator-dl.min.js Mon Feb 13 19:54:43 2017 +0100 @@ -1,1 +1,20 @@ -(function(){var y,d,b,s,I,c,H,a,e,t,v,q,G,D,u,h,J,x,k,C,z,F,E,r,i,A,p,n,m,l,B,w=[].slice,K={}.hasOwnProperty,j=function(N,L){for(var g in L){if(K.call(L,g)){N[g]=L[g]}}function M(){this.constructor=N}M.prototype=L.prototype;N.prototype=new M();N.__super__=L.prototype;return N},f=function(g,L){return function(){return g.apply(L,arguments)}},o=[].indexOf||function(M){for(var L=0,g=this.length;L/g,">").replace(/"/g,""")};c.uuid=(function(){var g;g=0;return function(){return g++}})();c.getGlobal=function(){return(function(){return this})()};c.maxZIndex=function(M){var L,g;L=(function(){var P,O,N;N=[];for(P=0,O=M.length;P0){if(M.start.nodeValue.length>M.startOffset){N.start=M.start.splitText(M.startOffset)}else{N.start=M.start.nextSibling}}else{N.start=M.start}if(M.start===M.end){if(N.start.nodeValue.length>(M.endOffset-M.startOffset)){N.start.splitText(M.endOffset-M.startOffset)}N.end=N.start}else{if(M.end.nodeValue.length>M.endOffset){M.end.splitText(M.endOffset)}N.end=M.end}N.commonAncestor=this.commonAncestorContainer;while(N.commonAncestor.nodeType!==Node.ELEMENT_NODE){N.commonAncestor=N.commonAncestor.parentNode}return new I.NormalizedRange(N)};g.prototype.serialize=function(L,M){return this.normalize(L).serialize(L,M)};return g})();I.NormalizedRange=(function(){function g(L){this.commonAncestor=L.commonAncestor;this.start=L.start;this.end=L.end}g.prototype.normalize=function(L){return this};g.prototype.limit=function(R){var N,Q,O,P,M,L;N=y.grep(this.textNodes(),function(S){return S.parentNode===R||y.contains(R,S.parentNode)});if(!N.length){return null}this.start=N[0];this.end=N[N.length-1];O=y(this.start).parents();L=y(this.end).parents();for(P=0,M=L.length;Paa){V[N+"Container"]=Z;V[N+"Offset"]=this[N+"Offset"]-O;break}else{O+=Z.nodeValue.length}}if(V[N+"Offset"]==null){throw new I.RangeError(""+N+"offset","Couldn't find offset "+this[N+"Offset"]+" in element "+this[N])}}T=document.compareDocumentPosition==null?function(ac,ab){return ac.contains(ab)}:function(ac,ab){return ac.compareDocumentPosition(ab)&16};y(V.startContainer).parents().each(function(){if(T(this,V.endContainer)){V.commonAncestorContainer=this;return false}});return new I.BrowserRange(V).normalize(X)};g.prototype.serialize=function(L,M){return this.normalize(L).serialize(L,M)};g.prototype.toObject=function(){return{start:this.start,startOffset:this.startOffset,end:this.end,endOffset:this.endOffset}};return g})();C=this.Annotator;d=(function(g){j(L,g);L.prototype.events={".annotator-adder button click":"onAdderClick",".annotator-adder button mousedown":"onAdderMousedown",".annotator-hl mouseover":"onHighlightMouseover",".annotator-hl mouseout":"startViewerHideTimer"};L.prototype.html={adder:'
",wrapper:'
'};L.prototype.options={readOnly:false};L.prototype.plugins={};L.prototype.editor=null;L.prototype.viewer=null;L.prototype.selectedRanges=null;L.prototype.mouseIsDown=false;L.prototype.ignoreMouseup=false;L.prototype.viewerHideTimer=null;function L(N,M){this.onDeleteAnnotation=f(this.onDeleteAnnotation,this);this.onEditAnnotation=f(this.onEditAnnotation,this);this.onAdderClick=f(this.onAdderClick,this);this.onAdderMousedown=f(this.onAdderMousedown,this);this.onHighlightMouseover=f(this.onHighlightMouseover,this);this.checkForEndSelection=f(this.checkForEndSelection,this);this.checkForStartSelection=f(this.checkForStartSelection,this);this.clearViewerHideTimer=f(this.clearViewerHideTimer,this);this.startViewerHideTimer=f(this.startViewerHideTimer,this);this.showViewer=f(this.showViewer,this);this.onEditorSubmit=f(this.onEditorSubmit,this);this.onEditorHide=f(this.onEditorHide,this);this.showEditor=f(this.showEditor,this);L.__super__.constructor.apply(this,arguments);this.plugins={};if(!L.supported()){return this}if(!this.options.readOnly){this._setupDocumentEvents()}this._setupWrapper()._setupViewer()._setupEditor();this._setupDynamicStyle();this.adder=y(this.html.adder).appendTo(this.wrapper).hide();L._instances.push(this)}L.prototype._setupWrapper=function(){this.wrapper=y(this.html.wrapper);this.element.find("script").remove();this.element.wrapInner(this.wrapper);this.wrapper=this.element.find(".annotator-wrapper");return this};L.prototype._setupViewer=function(){var M=this;this.viewer=new L.Viewer({readOnly:this.options.readOnly});this.viewer.hide().on("edit",this.onEditAnnotation).on("delete",this.onDeleteAnnotation).addField({load:function(O,N){if(N.text){y(O).html(c.escape(N.text))}else{y(O).html(""+(B("No Comment"))+"")}return M.publish("annotationViewerTextField",[O,N])}}).element.appendTo(this.wrapper).bind({mouseover:this.clearViewerHideTimer,mouseout:this.startViewerHideTimer});return this};L.prototype._setupEditor=function(){this.editor=new L.Editor();this.editor.hide().on("hide",this.onEditorHide).on("save",this.onEditorSubmit).addField({type:"textarea",label:B("Comments")+"\u2026",load:function(N,M){return y(N).find("textarea").val(M.text||"")},submit:function(N,M){return M.text=y(N).find("textarea").val()}});this.editor.element.appendTo(this.wrapper);return this};L.prototype._setupDocumentEvents=function(){y(document).bind({mouseup:this.checkForEndSelection,mousedown:this.checkForStartSelection});return this};L.prototype._setupDynamicStyle=function(){var N,P,O,M;O=y("#annotator-dynamic-style");if(!O.length){O=y('').appendTo(document.head)}P="*"+((function(){var T,R,Q,S;Q=["adder","outer","notice","filter"];S=[];for(T=0,R=Q.length;TV;S=0<=V?++X:--X){M=U.getRangeAt(S);P=new I.BrowserRange(M);Q=P.normalize().limit(this.wrapper[0]);if(Q===null){T.push(M)}W.push(Q)}return W}).call(this);U.removeAllRanges()}for(R=0,N=T.length;R0){return setTimeout((function(){return M(T)}),10)}else{return O.publish("annotationsLoaded",[P])}};P=N.slice();M(N);return this};L.prototype.dumpAnnotations=function(){if(this.plugins.Store){return this.plugins.Store.dumpAnnotations()}else{console.warn(B("Can't dump annotations without Store plugin."));return false}};L.prototype.highlightRange=function(P,U){var N,O,T,Q,M,S,R;if(U==null){U="annotator-hl"}T=/^\s*$/;N=y("");S=P.textNodes();R=[];for(Q=0,M=S.length;Q tag?"))}}return this};L.prototype.showEditor=function(M,N){this.editor.element.css(N);this.editor.load(M);this.publish("annotationEditorShown",[this.editor,M]);return this};L.prototype.onEditorHide=function(){this.publish("annotationEditorHidden",[this.editor]);return this.ignoreMouseup=false};L.prototype.onEditorSubmit=function(M){return this.publish("annotationEditorSubmit",[this.editor,M])};L.prototype.showViewer=function(N,M){this.viewer.element.css(M);this.viewer.load(N);return this.publish("annotationViewerShown",[this.viewer,N])};L.prototype.startViewerHideTimer=function(){if(!this.viewerHideTimer){return this.viewerHideTimer=setTimeout(this.viewer.hide,250)}};L.prototype.clearViewerHideTimer=function(){clearTimeout(this.viewerHideTimer);return this.viewerHideTimer=false};L.prototype.checkForStartSelection=function(M){if(!(M&&this.isAnnotator(M.target))){this.startViewerHideTimer()}return this.mouseIsDown=true};L.prototype.checkForEndSelection=function(R){var O,P,Q,N,M;this.mouseIsDown=false;if(this.ignoreMouseup){return}this.selectedRanges=this.getSelectedRanges();M=this.selectedRanges;for(Q=0,N=M.length;Q0){this.invertX()}return this};g.prototype.resetOrientation=function(){this.element.removeClass(this.classes.invert.x).removeClass(this.classes.invert.y);return this};g.prototype.invertX=function(){this.element.addClass(this.classes.invert.x);return this};g.prototype.invertY=function(){this.element.addClass(this.classes.invert.y);return this};g.prototype.isInvertedY=function(){return this.element.hasClass(this.classes.invert.y)};g.prototype.isInvertedX=function(){return this.element.hasClass(this.classes.invert.x)};return g})(b);d.Editor=(function(L){j(g,L);g.prototype.events={"form submit":"submit",".annotator-save click":"submit",".annotator-cancel click":"hide",".annotator-cancel mouseover":"onCancelButtonMouseover","textarea keydown":"processKeypress"};g.prototype.classes={hide:"annotator-hide",focus:"annotator-focus"};g.prototype.html='
\n
\n
    \n \n
    \n
    ";g.prototype.options={};function g(M){this.onCancelButtonMouseover=f(this.onCancelButtonMouseover,this);this.processKeypress=f(this.processKeypress,this);this.submit=f(this.submit,this);this.load=f(this.load,this);this.hide=f(this.hide,this);this.show=f(this.show,this);g.__super__.constructor.call(this,y(this.html)[0],M);this.fields=[];this.annotation={}}g.prototype.show=function(M){d.Util.preventEventDefault(M);this.element.removeClass(this.classes.hide);this.element.find(".annotator-save").addClass(this.classes.focus);this.checkOrientation();this.element.find(":input:first").focus();this.setupDraggables();return this.publish("show")};g.prototype.hide=function(M){d.Util.preventEventDefault(M);this.element.addClass(this.classes.hide);return this.publish("hide")};g.prototype.load=function(N){var P,O,M,Q;this.annotation=N;this.publish("load",[this.annotation]);Q=this.fields;for(O=0,M=Q.length;O');P.element=O[0];switch(P.type){case"textarea":M=y("