Added popup functionality and Library

* doPopup() JavaScript call creates a centered popup div with user
    defined width, height, title, content, and calls an optional
    callback function

* Library with currently non-modifiable book list, and a popup with the
    books' details

Signed-off-by: Gergely Polonkai <polesz@w00d5t0ck.info>
This commit is contained in:
Polonkai Gergely
2012-08-08 22:15:51 +02:00
parent 624e56389e
commit 55cde1594b
19 changed files with 1128 additions and 12 deletions

View File

@@ -0,0 +1,13 @@
/**
* Portions of this code are from the Google Closure Library,
* received from the Closure Authors under the Apache 2.0 license.
*
* All other code is (C) 2011 FriendsOfSymfony and subject to the MIT license.
*/
(function() {var g=this;function i(a,b){var c=a.split("."),d=g;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&b!==void 0?d[e]=b:d=d[e]?d[e]:d[e]={}}
function k(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(c=="[object Window]")return"object";if(c=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(c=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if(b=="function"&&typeof a.call=="undefined")return"object";return b};var l=/^[a-zA-Z0-9\-_.!~*'()]*$/;function m(a){a=""+a;return!l.test(a)?encodeURIComponent(a):a};var n=Array.prototype,p=n.forEach?function(a,b,c){n.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=typeof a=="string"?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};function q(a){var b=0,c;for(c in a)b++;return b}function r(a){var b={},c;for(c in a)b[c]=a[c];return b};function s(a,b){this.b={};this.a=[];var c=arguments.length;if(c>1){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof s){t(a);d=a.a.concat();t(a);e=[];for(c=0;c<a.a.length;c++)e.push(a.b[a.a[c]])}else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)this.set(d[c],e[c])}}s.prototype.e=0;s.prototype.m=0;
function t(a){if(a.e!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Object.prototype.hasOwnProperty.call(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.e!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],Object.prototype.hasOwnProperty.call(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}s.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.b,a)?this.b[a]:b};
s.prototype.set=function(a,b){Object.prototype.hasOwnProperty.call(this.b,a)||(this.e++,this.a.push(a),this.m++);this.b[a]=b};function u(a){if(a[1]){var b=a[0],c=b.indexOf("#");c>=0&&(a.push(b.substr(c)),a[0]=b=b.substr(0,c));c=b.indexOf("?");c<0?a[1]="?":c==b.length-1&&(a[1]=void 0)}return a.join("")}function v(a,b){for(var c in b){var d=c,e=b[c],f=a;if(k(e)=="array")for(var h=0;h<e.length;h++)f.push("&",d),e[h]!==""&&f.push("=",m(e[h]));else e!=null&&(f.push("&",d),e!==""&&f.push("=",m(e)))}return a};function w(a,b){this.d=a||{c:""};this.g(b||{})}(function(a){a.f=function(){return a.l||(a.l=new a)}})(w);w.prototype.g=function(a){this.h=new s(a)};w.prototype.i=function(a){this.d.c=a};w.prototype.k=function(){return this.d.c};
w.prototype.j=function(a,b){if(!Object.prototype.hasOwnProperty.call(this.h.b,a))throw Error('The route "'+a+'" does not exist.');var c=this.h.get(a),d=b||{},e=r(d),f="",h=!0;p(c.tokens,function(b){if("text"===b[0])f=b[1]+f,h=!1;else if("variable"===b[0]){if(!1===h||!(b[3]in c.defaults)||b[3]in d&&d[b[3]]!=c.defaults[b[3]]){var j;if(b[3]in d){j=d[b[3]];var o=b[3];o in e&&delete e[o]}else if(b[3]in c.defaults)j=c.defaults[b[3]];else{if(h)return;throw Error('The route "'+a+'" requires the parameter "'+
b[3]+'".');}if(!(!0===j||!1===j||""===j)||!h)f=b[1]+encodeURIComponent(j).replace(/%2F/g,"/")+f;h=!1}}else throw Error('The token type "'+b[0]+'" is not supported.');});f===""&&(f="/");q(e)>0&&(f=u(v([f],e)));return this.d.c+f};i("fos.Router",w);i("fos.Router.setData",function(a){var b=w.f();b.i(a.base_url);b.g(a.routes)});w.getInstance=w.f;w.prototype.setRoutes=w.prototype.g;w.prototype.setBaseUrl=w.prototype.i;w.prototype.getBaseUrl=w.prototype.k;w.prototype.generate=w.prototype.j;window.Routing=w.f();})();

View File

@@ -137,6 +137,16 @@ body {
padding: 5px;
}
#konyvtar-gomb {
float: left;
padding: 5px;
}
#konyvtar-gomb a {
color: inherit;
text-decoration: none;
}
#bottom-line {
position: fixed;
left: 0;
@@ -358,3 +368,102 @@ td.uj-post p .kuldes-gomb {
font-style: italic;
}
#popup-container {
display: none;
position: fixed;
height: 300px;
width: 200px;
background: #ffffff;
z-index: 80;
}
#popup-close {
position: absolute;
width: 16px;
height: 16px;
top: -5px;
right: -5px;
background-image: url('../images/no.png');
}
#popup-inside {
border: 1px solid black;
height: 292px;
width: 192px;
margin-left: auto;
margin-right: auto;
margin-top: 3px;
}
#popup-title {
font-weight: bold;
padding: 5px;
}
#popup-content {
padding: 3px;
}
#popup-scrollable {
width: 192px;
clear: both;
margin: 20px 0 10px;
}
#popup-scrollable .viewport {
width: 172px;
height: 246px;
overflow: hidden;
position: relative;
}
#popup-scrollable .overview {
list-style: none;
position: absolute;
left: 0;
top: 0;
}
#popup-scrollable .thumb .end, #popup-scrollable .thumb {
background-color: #003D5D;
}
#popup-scrollable .scrollbar {
position: relative;
float: right;
width: 15px;
}
#popup-scrollable .track {
background-color: #D8EEFD;
height: 100%;
width: 13px;
position: relative;
padding: 0 1px;
}
#popup-scrollable .thumb {
height: 20px;
width: 13px;
cursor: pointer;
overflow: hidden;
position: absolute;
top: 0;
}
#popup-scrollable .thumb .end {
overflow: hidden;
height: 5px;
width: 13px;
}
#popup-scrollable .disable {
display: none;
}
.gomb {
background-color: #cccccc;
color: black;
white-space: nowrap;
}

BIN
web/images/no.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

1
web/js/jquery.tinyscrollbar.min.js vendored Normal file
View File

@@ -0,0 +1 @@
(function(a){a.tiny=a.tiny||{};a.tiny.scrollbar={options:{axis:"y",wheel:40,scroll:true,lockscroll:true,size:"auto",sizethumb:"auto"}};a.fn.tinyscrollbar=function(d){var c=a.extend({},a.tiny.scrollbar.options,d);this.each(function(){a(this).data("tsb",new b(a(this),c))});return this};a.fn.tinyscrollbar_update=function(c){return a(this).data("tsb").update(c)};function b(q,g){var k=this,t=q,j={obj:a(".viewport",q)},h={obj:a(".overview",q)},d={obj:a(".scrollbar",q)},m={obj:a(".track",d.obj)},p={obj:a(".thumb",d.obj)},l=g.axis==="x",n=l?"left":"top",v=l?"Width":"Height",r=0,y={start:0,now:0},o={},e=("ontouchstart" in document.documentElement)?true:false;function c(){k.update();s();return k}this.update=function(z){j[g.axis]=j.obj[0]["offset"+v];h[g.axis]=h.obj[0]["scroll"+v];h.ratio=j[g.axis]/h[g.axis];d.obj.toggleClass("disable",h.ratio>=1);m[g.axis]=g.size==="auto"?j[g.axis]:g.size;p[g.axis]=Math.min(m[g.axis],Math.max(0,(g.sizethumb==="auto"?(m[g.axis]*h.ratio):g.sizethumb)));d.ratio=g.sizethumb==="auto"?(h[g.axis]/m[g.axis]):(h[g.axis]-j[g.axis])/(m[g.axis]-p[g.axis]);r=(z==="relative"&&h.ratio<=1)?Math.min((h[g.axis]-j[g.axis]),Math.max(0,r)):0;r=(z==="bottom"&&h.ratio<=1)?(h[g.axis]-j[g.axis]):isNaN(parseInt(z,10))?r:parseInt(z,10);w()};function w(){var z=v.toLowerCase();p.obj.css(n,r/d.ratio);h.obj.css(n,-r);o.start=p.obj.offset()[n];d.obj.css(z,m[g.axis]);m.obj.css(z,m[g.axis]);p.obj.css(z,p[g.axis])}function s(){if(!e){p.obj.bind("mousedown",i);m.obj.bind("mouseup",u)}else{j.obj[0].ontouchstart=function(z){if(1===z.touches.length){i(z.touches[0]);z.stopPropagation()}}}if(g.scroll&&window.addEventListener){t[0].addEventListener("DOMMouseScroll",x,false);t[0].addEventListener("mousewheel",x,false)}else{if(g.scroll){t[0].onmousewheel=x}}}function i(A){var z=parseInt(p.obj.css(n),10);o.start=l?A.pageX:A.pageY;y.start=z=="auto"?0:z;if(!e){a(document).bind("mousemove",u);a(document).bind("mouseup",f);p.obj.bind("mouseup",f)}else{document.ontouchmove=function(B){B.preventDefault();u(B.touches[0])};document.ontouchend=f}}function x(B){if(h.ratio<1){var A=B||window.event,z=A.wheelDelta?A.wheelDelta/120:-A.detail/3;r-=z*g.wheel;r=Math.min((h[g.axis]-j[g.axis]),Math.max(0,r));p.obj.css(n,r/d.ratio);h.obj.css(n,-r);if(g.lockscroll||(r!==(h[g.axis]-j[g.axis])&&r!==0)){A=a.event.fix(A);A.preventDefault()}}}function u(z){if(h.ratio<1){if(!e){y.now=Math.min((m[g.axis]-p[g.axis]),Math.max(0,(y.start+((l?z.pageX:z.pageY)-o.start))))}else{y.now=Math.min((m[g.axis]-p[g.axis]),Math.max(0,(y.start+(o.start-(l?z.pageX:z.pageY)))))}r=y.now*d.ratio;h.obj.css(n,-r);p.obj.css(n,y.now)}}function f(){a(document).unbind("mousemove",u);a(document).unbind("mouseup",f);p.obj.unbind("mouseup",f);document.ontouchmove=document.ontouchend=null}return c()}}(jQuery));