From 489eb781bc29fbbe388dde25121ba5de77c8dc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sat, 15 Jun 2013 07:46:34 +0200 Subject: [PATCH 01/41] Add doT.js templating engine. re #73 --- resources/doT/doT.min.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 resources/doT/doT.min.js diff --git a/resources/doT/doT.min.js b/resources/doT/doT.min.js new file mode 100644 index 0000000..1f05f62 --- /dev/null +++ b/resources/doT/doT.min.js @@ -0,0 +1,7 @@ +/* Laura Doktorova https://github.com/olado/doT */(function(){function o(){var a={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},b=/&(?!#?\w+;)|<|>|"|'|\//g;return function(){return this?this.replace(b,function(c){return a[c]||c}):this}}function p(a,b,c){return(typeof b==="string"?b:b.toString()).replace(a.define||i,function(l,e,f,g){if(e.indexOf("def.")===0)e=e.substring(4);if(!(e in c))if(f===":"){a.defineParams&&g.replace(a.defineParams,function(n,h,d){c[e]={arg:h,text:d}});e in c||(c[e]=g)}else(new Function("def","def['"+ +e+"']="+g))(c);return""}).replace(a.use||i,function(l,e){if(a.useParams)e=e.replace(a.useParams,function(g,n,h,d){if(c[h]&&c[h].arg&&d){g=(h+":"+d).replace(/'|\\/g,"_");c.__exp=c.__exp||{};c.__exp[g]=c[h].text.replace(RegExp("(^|[^\\w$])"+c[h].arg+"([^\\w$])","g"),"$1"+d+"$2");return n+"def.__exp['"+g+"']"}});var f=(new Function("def","return "+e))(c);return f?p(a,f,c):f})}function m(a){return a.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var j={version:"1.0.0",templateSettings:{evaluate:/\{\{([\s\S]+?\}?)\}\}/g, +interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:true,append:true,selfcontained:false},template:undefined, +compile:undefined};if(typeof module!=="undefined"&&module.exports)module.exports=j;else if(typeof define==="function"&&define.amd)define(function(){return j});else(function(){return this||(0,eval)("this")})().doT=j;String.prototype.encodeHTML=o();var q={append:{start:"'+(",end:")+'",endencode:"||'').toString().encodeHTML()+'"},split:{start:"';out+=(",end:");out+='",endencode:"||'').toString().encodeHTML();out+='"}},i=/$^/;j.template=function(a,b,c){b=b||j.templateSettings;var l=b.append?q.append: +q.split,e,f=0,g;a=b.use||b.define?p(b,a,c||{}):a;a=("var out='"+(b.strip?a.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):a).replace(/'|\\/g,"\\$&").replace(b.interpolate||i,function(h,d){return l.start+m(d)+l.end}).replace(b.encode||i,function(h,d){e=true;return l.start+m(d)+l.endencode}).replace(b.conditional||i,function(h,d,k){return d?k?"';}else if("+m(k)+"){out+='":"';}else{out+='":k?"';if("+m(k)+"){out+='":"';}out+='"}).replace(b.iterate||i,function(h, +d,k,r){if(!d)return"';} } out+='";f+=1;g=r||"i"+f;d=m(d);return"';var arr"+f+"="+d+";if(arr"+f+"){var "+k+","+g+"=-1,l"+f+"=arr"+f+".length-1;while("+g+" Date: Sat, 15 Jun 2013 07:51:01 +0200 Subject: [PATCH 02/41] Add a template almost similar to the current UI. re #73 TODO : * Sort box is not here anymore * Has to be tested with and without Fancybox * Paging with left and right arrow is not working anymore * Probably many other things --- templates/default/frontpage.html | 78 ++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 templates/default/frontpage.html diff --git a/templates/default/frontpage.html b/templates/default/frontpage.html new file mode 100644 index 0000000..089ab57 --- /dev/null +++ b/templates/default/frontpage.html @@ -0,0 +1,78 @@ +
+ + {{=it.i18n.homeAlt}} + + Settings and menu +
+

{{=it.title}}

+
+
+
+
+
+ +
+
+ + + {{? it.databaseId != ""}} + + {{?}} + +
+
+
+
+
+
+{{~it.entries:entry:i}} + {{? it.containsBook == 0}} + + {{??}} +
+ + {{? entry.book.hasCover == 1}} + {{=it.i18n.coverAlt}} + {{?}} + +

+ {{~entry.book.preferedData:data:j}} + {{=data.name}}
+ {{~}} +

+ +
+

{{=htmlEscape (entry.title)}} + {{? entry.book.pubDate != ""}}({{=entry.book.pubDate}}){{?}} + {{? entry.book.rating != ""}}{{=entry.book.rating}}{{?}} +

+

{{=it.i18n.authorsTitle}} :

{{=htmlEscape (entry.book.authorsName)}}
+ {{? entry.book.tagsName != ""}}

{{=it.i18n.tagsTitle}} :

{{=htmlEscape (entry.book.tagsName)}}
{{?}} + {{? entry.book.seriesName != ""}}

{{=it.i18n.seriesTitle}} :

{{=htmlEscape (entry.book.SeriesName)}}
{{?}} +
+
+ {{?}} +{{~}} +
+
+
+ {{=it.i18n.customizeTitle}} +
+
+ {{=it.i18n.aboutTitle}} +
+ {{? it.isPaginated == 1}} +
+ {{? it.prevLink != ""}}{{=it.i18n.previousAlt}}{{?}} +

{{=it.currentPage}} / {{=it.maxPage}}

+ {{? it.nextLink != ""}}{{=it.i18n.nextAlt}}{{?}} +
+ {{?}} +
\ No newline at end of file From a509e3389de70b1986ad57e58e0e1607b4e56687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sat, 15 Jun 2013 08:03:22 +0200 Subject: [PATCH 03/41] The new interface is completely in Ajax. Feel a lot faster. re #73 Uses pushState / popState to keep browser history correct and allow using back in the browser. --- base.php | 75 +++++++++++++++- book.php | 25 ++++++ getJSON.php | 31 +++++++ index.php | 244 +++++++++++----------------------------------------- util.js | 8 ++ 5 files changed, 186 insertions(+), 197 deletions(-) create mode 100644 getJSON.php create mode 100644 util.js diff --git a/base.php b/base.php index c242942..0834a9f 100644 --- a/base.php +++ b/base.php @@ -218,7 +218,7 @@ class LinkNavigation extends Link parent::__construct ($phref, Link::OPDS_NAVIGATION_TYPE, $prel, $ptitle); if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB)); if (!preg_match ("#^\?(.*)#", $this->href) && !empty ($this->href)) $this->href = "?" . $this->href; - if (preg_match ("/bookdetail.php/", $_SERVER["SCRIPT_NAME"])) { + if (preg_match ("/(bookdetail|getJSON).php/", $_SERVER["SCRIPT_NAME"])) { $this->href = "index.php" . $this->href; } else { $this->href = $_SERVER["SCRIPT_NAME"] . $this->href; @@ -265,6 +265,16 @@ class Entry } return date (DATE_ATOM, self::$updated); } + + public function getContentArray () { + $navlink = "#"; + foreach ($this->linkArray as $link) { + if ($link->type != Link::OPDS_NAVIGATION_TYPE) { continue; } + + $navlink = $link->hrefXhtml (); + } + return array ( "title" => $this->title, "content" => $this->content, "navlink" => $navlink ); + } public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray) { global $config; @@ -299,6 +309,14 @@ class EntryBook extends Entry $this->localUpdated = $pbook->timestamp; } + public function getContentArray () { + $entry = array ( "title" => $this->title); + $entry ["coverurl"] = $this->getCover (); + $entry ["thumbnailurl"] = $this->getCoverThumbnail (); + $entry ["book"] = $this->book->getContentArray (); + return $entry; + } + public function getCoverThumbnail () { foreach ($this->linkArray as $link) { if ($link->rel == Link::OPDS_THUMBNAIL_TYPE) @@ -417,6 +435,61 @@ class Page } } + public function getContentArray () + { + global $config; + $database = GetUrlParam (DB); + $page = getURLParam ("page", Base::PAGE_INDEX); + $out = array ( "title" => $this->title, "version" => VERSION); + $entries = array (); + foreach ($this->entryArray as $entry) { + array_push ($entries, $entry->getContentArray ()); + } + $out ["databaseId"] = GetUrlParam (DB, ""); + $out ["databaseName"] = Base::getDbName (); + $out ["page"] = $page; + $out ["entries"] = $entries; + $out ["isPaginated"] = 0; + if ($this->isPaginated ()) { + $prevLink = $this->getPrevLink (); + $nextLink = $this->getNextLink (); + $out ["isPaginated"] = 1; + $out ["prevLink"] = ""; + if (!is_null ($prevLink)) { + $out ["prevLink"] = $prevLink->hrefXhtml (); + } + $out ["nextLink"] = ""; + if (!is_null ($nextLink)) { + $out ["nextLink"] = $nextLink->hrefXhtml (); + } + $out ["maxPage"] = $this->getMaxPage (); + $out ["currentPage"] = $this->n; + } + $out ["i18n"] = array ("coverAlt" => localize("i18n.coversection"), + "authorsTitle" => localize("authors.title"), + "tagsTitle" => localize("tags.title"), + "seriesTitle" => localize("series.title"), + "customizeTitle" => localize ("customize.title"), + "aboutTitle" => localize ("about.title"), + "previousAlt" => localize ("paging.previous.alternate"), + "nextAlt" => localize ("paging.next.alternate"), + "searchAlt" => localize ("search.alternate"), + "homeAlt" => localize ("home.alternate")); + + $out ["containsBook"] = 0; + if ($this->containsBook ()) { + $out ["containsBook"] = 1; + } + $out["abouturl"] = "about.xml"; + if (getCurrentOption ('use_fancyapps') == 0) { + $out["abouturl"] = "index.php" . str_replace ("&", "&", addURLParameter ("?page=16", DB, $database)); + } + + $out ["homeurl"] = "index.php"; + if ($page != Base::PAGE_INDEX && !is_null ($database)) $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter ("", DB, $database); + return $out; + } + public function isPaginated () { global $config; diff --git a/book.php b/book.php index 84d92a8..1b3459c 100644 --- a/book.php +++ b/book.php @@ -102,6 +102,31 @@ class Book extends Base { return "?page=".parent::PAGE_BOOK_DETAIL."&id=$this->id"; } + public function getContentArray () { + global $config; + $i = 0; + $preferedData = array (); + foreach ($config['cops_prefered_format'] as $format) + { + if ($i == 2) { break; } + if ($data = $this->getDataFormat ($format)) { + $i++; + array_push ($preferedData, array ("url" => $data->getHtmlLink (), "name" => $format)); + } + } + $serie = $this->getSerie (); + if (is_null ($serie)) $serie = ""; + + return array ("hasCover" => $this->hasCover, + "preferedData" => $preferedData, + "detailUrl" => $this->getDetailUrl (), + "rating" => $this->getRating (), + "pubDate" => $this->getPubDate (), + "authorsName" => $this->getAuthorsName (), + "tagsName" => $this->getTagsName (), + "seriesName" => $serie); + } + public function getDetailUrl ($permalink = false) { global $config; $urlParam = $this->getUri (); diff --git a/getJSON.php b/getJSON.php new file mode 100644 index 0000000..502361b --- /dev/null +++ b/getJSON.php @@ -0,0 +1,31 @@ + + * + */ + + require_once ("config.php"); + require_once ("base.php"); + require_once ("author.php"); + require_once ("serie.php"); + require_once ("tag.php"); + require_once ("language.php"); + require_once ("customcolumn.php"); + require_once ("book.php"); + + header ("Content-Type:application/json;charset=utf-8"); + $page = getURLParam ("page", Base::PAGE_INDEX); + $query = getURLParam ("query"); + $qid = getURLParam ("id"); + $n = getURLParam ("n", "1"); + $database = GetUrlParam (DB); + + $currentPage = Page::getPage ($page, $qid, $query, $n); + $currentPage->InitializeContent (); + + echo json_encode ($currentPage->getContentArray ()); + +?> \ No newline at end of file diff --git a/index.php b/index.php index f2f8c27..51d5467 100644 --- a/index.php +++ b/index.php @@ -32,9 +32,6 @@ $n = getURLParam ("n", "1"); $database = GetUrlParam (DB); - $currentPage = Page::getPage ($page, $qid, $query, $n); - $currentPage->InitializeContent (); - /* Test to see if pages are opened on an Eink screen * test Kindle, Kobo Touch and Sony PRS-T1 Ereader. * HTTP_USER_AGENT = "Mozilla/5.0 (Linux; U; en-us; EBRD1101; EXT) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" @@ -52,7 +49,7 @@ - <?php echo htmlspecialchars ($currentPage->title) ?> + COPS @@ -60,12 +57,44 @@ " media="screen" /> + + - + " /> -
-
- "> - " alt="" /> - - " alt="Settings and menu" /> -
-

title) ?>

-
-
> -
-
-
- " /> -
-
- - - - - - -
-
-
- containsBook ()) { ?> -
-
- <?php echo localize (" /> -
-
- - -
-
- -
-
- -
-entryArray as $entry) { - if (get_class ($entry) != "EntryBook") { -?> - - - - -
- + +
diff --git a/util.js b/util.js new file mode 100644 index 0000000..7beab6d --- /dev/null +++ b/util.js @@ -0,0 +1,8 @@ +function htmlEscape(str) { + return String(str) + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>'); +} \ No newline at end of file From c96d629ad0944622ef7f97049a53aca567d4c4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sat, 15 Jun 2013 08:27:33 +0200 Subject: [PATCH 04/41] Move most of javascript in util.js. Enabled paging with arrow keys. Refactor a little. re #73 --- index.php | 29 --------------------- templates/default/frontpage.html | 4 +-- util.js | 44 +++++++++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/index.php b/index.php index 51d5467..8663986 100644 --- a/index.php +++ b/index.php @@ -65,35 +65,6 @@ " /> - " media="screen" /> - @@ -69,23 +51,6 @@ $(document).ready(function() { // Handler for .ready() called. - $("#sort").click(function(){ - $('.books').sortElements(function(a, b){ - var test = 1; - if ($("#sortorder").val() == "desc") - { - test = -1; - } - return $(a).find ("." + $("#sortchoice").val()).text() > $(b).find ("." + $("#sortchoice").val()).text() ? test : -test; - }); - }); - - - $(".fancycover").fancybox(fancyBoxObject (null, 'image')); - - $(".fancyabout").fancybox(fancyBoxObject ('COPS ', 'ajax')); - - $.when($.get('templates/default/header.html'), $.get('templates/default/footer.html'), $.get('templates/default/bookdetail.html'), diff --git a/util.js b/util.js index 7f1ad5f..11d9bd3 100644 --- a/util.js +++ b/util.js @@ -14,6 +14,10 @@ function fancyBoxObject (title, type) { return out; } +function getCurrentOption (option) { + return $.cookie (option); +} + function htmlEscape(str) { return String(str) .replace(/&/g, '&') @@ -42,6 +46,17 @@ function updatePage (data) { ajaxifyLinks (); + $("#sort").click(function(){ + $('.books').sortElements(function(a, b){ + var test = 1; + if ($("#sortorder").val() == "desc") + { + test = -1; + } + return $(a).find ("." + $("#sortchoice").val()).text() > $(b).find ("." + $("#sortchoice").val()).text() ? test : -test; + }); + }); + $(".headright").click(function(){ if ($("#tool").is(":hidden")) { $("#tool").slideDown("slow"); @@ -52,18 +67,25 @@ function updatePage (data) { } }); - $(".fancydetail").click(function(event){ - event.preventDefault(); - var url = $(this).attr("href"); - var jsonurl = url.replace ("bookdetail", "getJSON"); - $.getJSON(jsonurl, function(data) { - var detail = templateBookDetail (data); - $.fancybox( { - content: detail, - autoSize: true + if (getCurrentOption ("use_fancyapps") == 1) { + $(".fancydetail").click(function(event){ + event.preventDefault(); + var url = $(this).attr("href"); + var jsonurl = url.replace ("bookdetail", "getJSON"); + $.getJSON(jsonurl, function(data) { + data ["i18n"] = currentData ["i18n"]; + var detail = templateBookDetail (data); + $.fancybox( { + content: detail, + autoSize: true + }); }); }); - }); + + $(".fancycover").fancybox(fancyBoxObject (null, 'image')); + + $(".fancyabout").fancybox(fancyBoxObject ('COPS ' + currentData.version, 'ajax')); + } } From 7640ae31f70c7d83dd8306a9d46fe4f30debecb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sun, 16 Jun 2013 22:14:21 +0200 Subject: [PATCH 17/41] Everything is in the template. re #73 --- templates/default/page.html | 4 +++- util.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/default/page.html b/templates/default/page.html index 054ae54..85757f0 100644 --- a/templates/default/page.html +++ b/templates/default/page.html @@ -1,3 +1,5 @@ +
{{#def.header}} {{#def.main}} -{{#def.footer}} \ No newline at end of file +{{#def.footer}} +
\ No newline at end of file diff --git a/util.js b/util.js index 11d9bd3..fffa612 100644 --- a/util.js +++ b/util.js @@ -40,7 +40,7 @@ function updatePage (data) { currentData = data; var result = templatePage (data); document.title = data.title; - $(".container").html (result); + $("body").html (result); if ($.cookie('toolbar') == 1) $("#tool").show (); From 074a2b8a0fc6f68e1bdbd7de88fe6d4825dede9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sun, 16 Jun 2013 22:44:49 +0200 Subject: [PATCH 18/41] See last commit. re #73 --- index.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/index.php b/index.php index 9ad90f6..f0c5336 100644 --- a/index.php +++ b/index.php @@ -86,8 +86,5 @@ - -
-
From 8de878fa94b28f4509436f10bae9a7cada630979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 17 Jun 2013 21:21:52 +0200 Subject: [PATCH 19/41] Save new things in constants. re #73 --- getJSON.php | 7 ++++--- templates/default/bookdetail.html | 16 ++++++++-------- templates/default/footer.html | 8 ++++---- templates/default/header.html | 20 ++++++++++---------- templates/default/main.html | 8 ++++---- util.js | 4 ++-- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/getJSON.php b/getJSON.php index cdd5a4f..24dc92e 100644 --- a/getJSON.php +++ b/getJSON.php @@ -26,7 +26,7 @@ $currentPage = Page::getPage ($page, $qid, $query, $n); $currentPage->InitializeContent (); - $out = array ( "title" => $currentPage->title, "version" => VERSION); + $out = array ( "title" => $currentPage->title); $entries = array (); foreach ($currentPage->entryArray as $entry) { array_push ($entries, $entry->getContentArray ()); @@ -55,7 +55,8 @@ $out ["currentPage"] = $currentPage->n; } if (!is_null (getURLParam ("complete"))) { - $out ["i18n"] = array ("coverAlt" => localize("i18n.coversection"), + $out ["const"] = array ("version" => VERSION, "i18n" => array ( + "coverAlt" => localize("i18n.coversection"), "authorsTitle" => localize("authors.title"), "bookwordTitle" => localize("bookword.title"), "tagsTitle" => localize("tags.title"), @@ -72,7 +73,7 @@ "languagesTitle" => localize("language.title"), "contentTitle" => localize("content.summary"), "sortorderAsc" => localize("search.sortorder.asc"), - "sortorderDesc" => localize("search.sortorder.desc")); + "sortorderDesc" => localize("search.sortorder.desc"))); } $out ["containsBook"] = 0; diff --git a/templates/default/bookdetail.html b/templates/default/bookdetail.html index 07c9870..8cba571 100644 --- a/templates/default/bookdetail.html +++ b/templates/default/bookdetail.html @@ -2,7 +2,7 @@ {{? it.book.hasCover == 1}} - {{=it.i18n.coverAlt}} + {{=it.const.i18n.coverAlt}} {{?}} @@ -11,16 +11,16 @@ {{=data.format}}
{{~}} -

{{=it.i18n.permalinkAlt}}{{=htmlEscape (it.title)}}

+

{{=it.const.i18n.permalinkAlt}}{{=htmlEscape (it.title)}}

-

{{=it.i18n.authorsTitle}}:

+

{{=it.const.i18n.authorsTitle}}:

{{~it.book.authors:author:j}} {{? j > 0}}, {{?}}{{=htmlEscape (author.name)}} {{~}}

{{? it.book.tagsName != ""}}

-

{{=it.i18n.tagsTitle}}:

+

{{=it.const.i18n.tagsTitle}}:

{{~it.book.tags:tag:k}} {{? k > 0}}, {{?}}{{=htmlEscape (tag.name)}} {{~}} @@ -28,22 +28,22 @@ {{?}} {{? it.book.seriesName != ""}}

-

{{=it.i18n.seriesTitle}} :

{{=htmlEscape (it.book.seriesCompleteName)}} +

{{=it.const.i18n.seriesTitle}} :

{{=htmlEscape (it.book.seriesCompleteName)}}

{{?}} {{? it.book.pubDate != ""}}

-

{{=it.i18n.pubdateTitle}}:

{{=it.book.pubDate}} +

{{=it.const.i18n.pubdateTitle}}:

{{=it.book.pubDate}}

{{?}} {{? it.book.languagesName != ""}}

-

{{=it.i18n.languagesTitle}}:

{{=it.book.languagesName}} +

{{=it.const.i18n.languagesTitle}}:

{{=it.book.languagesName}}

{{?}} {{? it.book.content != ""}}
-

{{=it.i18n.contentTitle}}

+

{{=it.const.i18n.contentTitle}}

{{=it.book.content}}
{{?}} \ No newline at end of file diff --git a/templates/default/footer.html b/templates/default/footer.html index 640a795..6c9863f 100644 --- a/templates/default/footer.html +++ b/templates/default/footer.html @@ -1,15 +1,15 @@
- {{=it.i18n.customizeTitle}} + {{=it.const.i18n.customizeTitle}}
- {{=it.i18n.aboutTitle}} + {{=it.const.i18n.aboutTitle}}
{{? it.isPaginated == 1}}
- {{? it.prevLink != ""}}{{=it.i18n.previousAlt}}{{?}} + {{? it.prevLink != ""}}{{=it.const.i18n.previousAlt}}{{?}}

{{=it.currentPage}} / {{=it.maxPage}}

- {{? it.nextLink != ""}}{{=it.i18n.nextAlt}}{{?}} + {{? it.nextLink != ""}}{{=it.const.i18n.nextAlt}}{{?}}
{{?}}
\ No newline at end of file diff --git a/templates/default/header.html b/templates/default/header.html index d1651eb..407bf06 100644 --- a/templates/default/header.html +++ b/templates/default/header.html @@ -1,8 +1,8 @@
- {{=it.i18n.homeAlt}} + {{=it.const.i18n.homeAlt}} - Settings and menu + Settings and menu

{{=it.title}}

@@ -10,7 +10,7 @@
- +
@@ -25,18 +25,18 @@ {{? it.containsBook == 1}}
- {{=it.i18n.sortAlt}} + {{=it.const.i18n.sortAlt}}
diff --git a/templates/default/main.html b/templates/default/main.html index 75c5463..d650241 100644 --- a/templates/default/main.html +++ b/templates/default/main.html @@ -16,7 +16,7 @@
{{? entry.book.hasCover == 1}} - {{=it.i18n.coverAlt}} + {{=it.const.i18n.coverAlt}} {{?}}

@@ -30,9 +30,9 @@ {{? entry.book.pubDate != ""}}({{=entry.book.pubDate}}){{?}} {{? entry.book.rating != ""}}{{=entry.book.rating}}{{?}}

-

{{=it.i18n.authorsTitle}} :

{{=htmlEscape (entry.book.authorsName)}}
- {{? entry.book.tagsName != ""}}

{{=it.i18n.tagsTitle}} :

{{=htmlEscape (entry.book.tagsName)}}
{{?}} - {{? entry.book.seriesName != ""}}

{{=it.i18n.seriesTitle}} :

{{=htmlEscape (entry.book.seriesName)}}
{{?}} +

{{=it.const.i18n.authorsTitle}} :

{{=htmlEscape (entry.book.authorsName)}}
+ {{? entry.book.tagsName != ""}}

{{=it.const.i18n.tagsTitle}} :

{{=htmlEscape (entry.book.tagsName)}}
{{?}} + {{? entry.book.seriesName != ""}}

{{=it.const.i18n.seriesTitle}} :

{{=htmlEscape (entry.book.seriesName)}}
{{?}}
{{?}} diff --git a/util.js b/util.js index fffa612..33757b6 100644 --- a/util.js +++ b/util.js @@ -36,7 +36,7 @@ function navigateTo (url) { } function updatePage (data) { - data ["i18n"] = currentData ["i18n"]; + data ["const"] = currentData ["const"]; currentData = data; var result = templatePage (data); document.title = data.title; @@ -73,7 +73,7 @@ function updatePage (data) { var url = $(this).attr("href"); var jsonurl = url.replace ("bookdetail", "getJSON"); $.getJSON(jsonurl, function(data) { - data ["i18n"] = currentData ["i18n"]; + data ["const"] = currentData ["const"]; var detail = templateBookDetail (data); $.fancybox( { content: detail, From 23267e37fa65bb2edd8485653e8125e09e2fcbc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 17 Jun 2013 21:41:59 +0200 Subject: [PATCH 20/41] Simplify book detail. re #73 --- book.php | 6 +-- bookdetail.php | 103 ------------------------------------------------- util.js | 13 ++++--- 3 files changed, 8 insertions(+), 114 deletions(-) delete mode 100644 bookdetail.php diff --git a/book.php b/book.php index 38d4413..55d19f9 100644 --- a/book.php +++ b/book.php @@ -169,11 +169,7 @@ class Book extends Base { $urlParam = $this->getUri (); if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB)); $urlParam = str_replace ("&", "&", $urlParam); - if ($permalink || getCurrentOption ('use_fancyapps') == 0) { - return 'index.php' . $urlParam; - } else { - return 'bookdetail.php' . $urlParam; - } + return 'index.php' . $urlParam; } public function getTitle () { diff --git a/bookdetail.php b/bookdetail.php deleted file mode 100644 index 51d8f8a..0000000 --- a/bookdetail.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - */ - -require_once ("config.php"); -require_once ("book.php"); - -$book = Book::getBookById($_GET["id"]); -$authors = $book->getAuthors (); -$tags = $book->getTags (); -$serie = $book->getSerie (); -$book->getLinkArray (); - -?> -
- - hasCover) { - ?> - hrefXhtml () ?>"> - hrefXhtml () ?>" alt="" /> - - - -getDatas() as $data) - { -?> -

format ?>

- -

" alt="" />title) ?>

-

-

:

- - 0) echo ", "; -?> - name) ?> - -

- 0) { -?> -

-

:

- - 0) echo ", "; -?> - name) ?> - -

- -

-

:

- seriesIndex, htmlspecialchars ($serie->name)) ?> -

-getPubDate() != "") - { -?> -

-

:

- getPubDate() ?> -

-getLanguages () != "") - { -?> -

-

:

- getLanguages () ?> -

- -
-

-
>getComment (false) ?>
-
\ No newline at end of file diff --git a/util.js b/util.js index 33757b6..5ab7e71 100644 --- a/util.js +++ b/util.js @@ -71,14 +71,13 @@ function updatePage (data) { $(".fancydetail").click(function(event){ event.preventDefault(); var url = $(this).attr("href"); - var jsonurl = url.replace ("bookdetail", "getJSON"); + var jsonurl = url.replace ("index", "getJSON"); $.getJSON(jsonurl, function(data) { data ["const"] = currentData ["const"]; var detail = templateBookDetail (data); - $.fancybox( { - content: detail, - autoSize: true - }); + var fancyparams = fancyBoxObject (data.title, null); + fancyparams ["content"] = detail; + $.fancybox(fancyparams); }); }); @@ -91,7 +90,9 @@ function updatePage (data) { function ajaxifyLinks () { if (history.pushState) { - $("a[href^='index']").click (function (event) { + var links = $("a[href^='index']"); + if (getCurrentOption ("use_fancyapps") == 1) links = links.not (".fancydetail"); + links.click (function (event) { event.preventDefault(); var url = $(this).attr('href'); From 2029ab7d0144f91ae5208ad12409116492e212f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 17 Jun 2013 22:23:58 +0200 Subject: [PATCH 21/41] Simplify a little the JSON, a little more to do. re # 73 --- base.php | 2 -- book.php | 4 ++-- getJSON.php | 40 ++++++++++++++++++++----------------- templates/default/main.html | 6 ++++-- util.js | 9 +++++++++ 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/base.php b/base.php index 36f8f0f..9a47436 100644 --- a/base.php +++ b/base.php @@ -311,8 +311,6 @@ class EntryBook extends Entry public function getContentArray () { $entry = array ( "title" => $this->title); - $entry ["coverurl"] = $this->getCover (); - $entry ["thumbnailurl"] = $this->getCoverThumbnail (); $entry ["book"] = $this->book->getContentArray (); return $entry; } diff --git a/book.php b/book.php index 55d19f9..65c0a53 100644 --- a/book.php +++ b/book.php @@ -126,9 +126,9 @@ class Book extends Base { $su = $link->hrefXhtml (); } - return array ("hasCover" => $this->hasCover, + return array ("id" => $this->id, + "hasCover" => $this->hasCover, "preferedData" => $preferedData, - "detailUrl" => $this->getDetailUrl (), "rating" => $this->getRating (), "pubDate" => $this->getPubDate (), "languagesName" => $this->getLanguages (), diff --git a/getJSON.php b/getJSON.php index 24dc92e..bcda031 100644 --- a/getJSON.php +++ b/getJSON.php @@ -56,24 +56,28 @@ } if (!is_null (getURLParam ("complete"))) { $out ["const"] = array ("version" => VERSION, "i18n" => array ( - "coverAlt" => localize("i18n.coversection"), - "authorsTitle" => localize("authors.title"), - "bookwordTitle" => localize("bookword.title"), - "tagsTitle" => localize("tags.title"), - "seriesTitle" => localize("series.title"), - "customizeTitle" => localize ("customize.title"), - "aboutTitle" => localize ("about.title"), - "previousAlt" => localize ("paging.previous.alternate"), - "nextAlt" => localize ("paging.next.alternate"), - "searchAlt" => localize ("search.alternate"), - "sortAlt" => localize ("sort.alternate"), - "homeAlt" => localize ("home.alternate"), - "permalinkAlt" => localize ("permalink.alternate"), - "pubdateTitle" => localize("pubdate.title"), - "languagesTitle" => localize("language.title"), - "contentTitle" => localize("content.summary"), - "sortorderAsc" => localize("search.sortorder.asc"), - "sortorderDesc" => localize("search.sortorder.desc"))); + "coverAlt" => localize("i18n.coversection"), + "authorsTitle" => localize("authors.title"), + "bookwordTitle" => localize("bookword.title"), + "tagsTitle" => localize("tags.title"), + "seriesTitle" => localize("series.title"), + "customizeTitle" => localize ("customize.title"), + "aboutTitle" => localize ("about.title"), + "previousAlt" => localize ("paging.previous.alternate"), + "nextAlt" => localize ("paging.next.alternate"), + "searchAlt" => localize ("search.alternate"), + "sortAlt" => localize ("sort.alternate"), + "homeAlt" => localize ("home.alternate"), + "permalinkAlt" => localize ("permalink.alternate"), + "pubdateTitle" => localize("pubdate.title"), + "languagesTitle" => localize("language.title"), + "contentTitle" => localize("content.summary"), + "sortorderAsc" => localize("search.sortorder.asc"), + "sortorderDesc" => localize("search.sortorder.desc")), + "url" => array ( + "detailUrl" => "index.php?page=13&id={0}&db={1}", + "coverUrl" => "fetch.php?id={0}&db={1}", + "thumbnailUrl" => "fetch.php?height=70&id={0}&db={1}")); } $out ["containsBook"] = 0; diff --git a/templates/default/main.html b/templates/default/main.html index d650241..4476845 100644 --- a/templates/default/main.html +++ b/templates/default/main.html @@ -16,7 +16,9 @@
{{? entry.book.hasCover == 1}} - {{=it.const.i18n.coverAlt}} + + {{=it.const.i18n.coverAlt}} + {{?}}

@@ -24,7 +26,7 @@ {{=data.name}}
{{~}}

- +

{{=htmlEscape (entry.title)}} {{? entry.book.pubDate != ""}}({{=entry.book.pubDate}}){{?}} diff --git a/util.js b/util.js index 5ab7e71..f2a8fdb 100644 --- a/util.js +++ b/util.js @@ -14,6 +14,15 @@ function fancyBoxObject (title, type) { return out; } +function strformat () { + var s = arguments[0]; + for (var i = 0; i < arguments.length - 1; i++) { + var reg = new RegExp("\\{" + i + "\\}", "gm"); + s = s.replace(reg, arguments[i + 1]); + } + return s; +} + function getCurrentOption (option) { return $.cookie (option); } From aa376d63b26e42728df309cb7cefc4a9f337d910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 17 Jun 2013 22:30:09 +0200 Subject: [PATCH 22/41] simplify again. re #73 --- book.php | 1 - templates/default/bookdetail.html | 2 +- util.js | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/book.php b/book.php index 65c0a53..06fe5d0 100644 --- a/book.php +++ b/book.php @@ -142,7 +142,6 @@ class Book extends Base { public function getFullContentArray () { $out = $this->getContentArray (); - $out ["detailurl"] = $this->getDetailUrl (true); $out ["coverurl"] = Data::getLink ($this, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml (); $out ["thumbnailurl"] = Data::getLink ($this, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, 150)->hrefXhtml (); $out ["content"] = $this->getComment (false); diff --git a/templates/default/bookdetail.html b/templates/default/bookdetail.html index 8cba571..9d58fa6 100644 --- a/templates/default/bookdetail.html +++ b/templates/default/bookdetail.html @@ -11,7 +11,7 @@ {{=data.format}}
{{~}}

-

{{=it.const.i18n.permalinkAlt}}{{=htmlEscape (it.title)}}

+

{{=it.const.i18n.permalinkAlt}}{{=htmlEscape (it.title)}}

{{=it.const.i18n.authorsTitle}}:

{{~it.book.authors:author:j}} diff --git a/util.js b/util.js index f2a8fdb..262da8b 100644 --- a/util.js +++ b/util.js @@ -16,8 +16,8 @@ function fancyBoxObject (title, type) { function strformat () { var s = arguments[0]; - for (var i = 0; i < arguments.length - 1; i++) { - var reg = new RegExp("\\{" + i + "\\}", "gm"); + for (var i = 0; i < arguments.length - 1; i++) { + var reg = new RegExp("\\{" + i + "\\}", "gm"); s = s.replace(reg, arguments[i + 1]); } return s; From d656f4692ce894e9d655fdf6e84c0e5802c6b3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 18 Jun 2013 12:26:08 +0200 Subject: [PATCH 23/41] Move jquery to resources. re #73 --HG-- rename : js/jquery-1.9.1.min.js => resources/jQuery/jquery-1.9.1.min.js --- customize.php | 2 +- index.php | 2 +- {js => resources/jQuery}/jquery-1.9.1.min.js | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {js => resources/jQuery}/jquery-1.9.1.min.js (100%) diff --git a/customize.php b/customize.php index 6907831..bc19c65 100644 --- a/customize.php +++ b/customize.php @@ -24,7 +24,7 @@ <?php echo localize ("customize.title") ?> - + diff --git a/index.php b/index.php index f0c5336..0f77abe 100644 --- a/index.php +++ b/index.php @@ -34,7 +34,7 @@ COPS - + " media="screen" /> diff --git a/js/jquery-1.9.1.min.js b/resources/jQuery/jquery-1.9.1.min.js similarity index 100% rename from js/jquery-1.9.1.min.js rename to resources/jQuery/jquery-1.9.1.min.js From 0381b56272d0621213cc7778ad1026257ff5218a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 18 Jun 2013 12:31:02 +0200 Subject: [PATCH 24/41] Upgrade jquery cookie. re #73 --- js/jquery.cookies.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/js/jquery.cookies.js b/js/jquery.cookies.js index 0321fce..7401208 100644 --- a/js/jquery.cookies.js +++ b/js/jquery.cookies.js @@ -1,10 +1,8 @@ /*! - * jQuery Cookie Plugin + * jQuery Cookie Plugin v1.3.1 * https://github.com/carhartl/jquery-cookie - * Copyright 2011, Klaus Hartl - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://www.opensource.org/licenses/mit-license.php - * http://www.opensource.org/licenses/GPL-2.0 - * Last update: Sun, 03 Mar 2013 06:56:32 +0000 + * + * Copyright 2013 Klaus Hartl + * Released under the MIT license */ -(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else{factory(jQuery)}}(function($){var pluses=/\+/g;function raw(s){return s}function decoded(s){return decodeURIComponent(s.replace(pluses,' '))}function converted(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g, '"').replace(/\\\\/g,'\\');}try{return config.json?JSON.parse(s):s}catch(er){}}var config=$.cookie=function(key,value,options){if(value!==undefined){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)}value=config.json?JSON.stringify(value):String(value);return(document.cookie=[config.raw?key:encodeURIComponent(key),'=',config.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}var decode=config.raw?raw:decoded;var cookies=document.cookie.split('; ');var result=key?undefined:{};for(var i=0,l=cookies.length;ip;p++){var r=n[p].split("="),s=m(r.shift()),t=m(r.join("="));if(d&&d===s){o=h(t);break}d||(o[s]=h(t))}return o};i.defaults={},a.removeCookie=function(b,c){return null!==a.cookie(b)?(a.cookie(b,null,c),!0):!1}})(jQuery,document); \ No newline at end of file From 065a7dac8eaa93157e558cc1d8ade64eff502558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 18 Jun 2013 12:33:33 +0200 Subject: [PATCH 25/41] Move jquery-cookie to resources. re #73 --HG-- rename : js/jquery.cookies.js => resources/jquery-cookie/jquery.cookies.js --- customize.php | 2 +- index.php | 2 +- {js => resources/jquery-cookie}/jquery.cookies.js | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {js => resources/jquery-cookie}/jquery.cookies.js (100%) diff --git a/customize.php b/customize.php index bc19c65..f7f93d6 100644 --- a/customize.php +++ b/customize.php @@ -25,7 +25,7 @@ <?php echo localize ("customize.title") ?> - + " /> diff --git a/index.php b/index.php index 0f77abe..24200d3 100644 --- a/index.php +++ b/index.php @@ -35,7 +35,7 @@ COPS - + " media="screen" /> diff --git a/js/jquery.cookies.js b/resources/jquery-cookie/jquery.cookies.js similarity index 100% rename from js/jquery.cookies.js rename to resources/jquery-cookie/jquery.cookies.js From ad286e491e1a9e861274e484f6cb1d3611f3f664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 18 Jun 2013 20:44:00 +0200 Subject: [PATCH 26/41] Fix series sorting. re #73 --- templates/default/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/main.html b/templates/default/main.html index 4476845..b2cd360 100644 --- a/templates/default/main.html +++ b/templates/default/main.html @@ -34,7 +34,7 @@

{{=it.const.i18n.authorsTitle}} :

{{=htmlEscape (entry.book.authorsName)}}
{{? entry.book.tagsName != ""}}

{{=it.const.i18n.tagsTitle}} :

{{=htmlEscape (entry.book.tagsName)}}
{{?}} - {{? entry.book.seriesName != ""}}

{{=it.const.i18n.seriesTitle}} :

{{=htmlEscape (entry.book.seriesName)}}
{{?}} + {{? entry.book.seriesName != ""}}

{{=it.const.i18n.seriesTitle}} :

{{=htmlEscape (entry.book.seriesName)}}
{{?}}
{{?}} From 4410a5cc8258b338ddfa13ba44573f7daf0132e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 18 Jun 2013 22:24:35 +0200 Subject: [PATCH 27/41] Handle search with Ajax. re #73 --- templates/default/header.html | 2 +- util.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/default/header.html b/templates/default/header.html index 407bf06..aa0d110 100644 --- a/templates/default/header.html +++ b/templates/default/header.html @@ -8,7 +8,7 @@
- {{? it.containsBook == 1}} -
+
- {{?}}
diff --git a/util.js b/util.js index e68d12e..6860741 100644 --- a/util.js +++ b/util.js @@ -1,7 +1,19 @@ -var templatePage, templateBookDetail, templateMain, currentData; +var templatePage, templateBookDetail, templateMain, currentData, before; +var DEBUG = true; var isEink = /Kobo|Kindle|EBRD1101/i.test(navigator.userAgent); +function debug_log(text) { + if ( DEBUG ) { + console.log(text); + } +} + +function elapsed () { + var elapsed = new Date () - before; + return "Elapsed : " + elapsed; +} + function fancyBoxObject (title, type) { var out = { prevEffect : 'none', nextEffect : 'none' }; if (isEink) { @@ -42,6 +54,7 @@ function htmlEscape(str) { } function navigateTo (url) { + before = new Date (); var jsonurl = url.replace ("index", "getJSON"); $.getJSON(jsonurl, function(data) { history.pushState(data, "", url); @@ -50,13 +63,30 @@ function navigateTo (url) { } function updatePage (data) { + var result; data ["const"] = currentData ["const"]; - currentData = data; - var result = templatePage (data); + if (false && $("section").length && currentData.isPaginated == 0 && data.isPaginated == 0) { + // Partial update (for now disabled) + debug_log ("Partial update"); + result = templateMain (data); + $("h1").html (data.title); + $("section").html (result); + } else { + // Full update + result = templatePage (data); + $("body").html (result); + } document.title = data.title; - $("body").html (result); + currentData = data; + + debug_log (elapsed ()); if ($.cookie('toolbar') == 1) $("#tool").show (); + if (currentData.containsBook == 1) { + $("#sortForm").show (); + } else { + $("#sortForm").hide (); + } ajaxifyLinks (); @@ -84,6 +114,7 @@ function updatePage (data) { if (getCurrentOption ("use_fancyapps") == 1) { $(".fancydetail").click(function(event){ event.preventDefault(); + before = new Date (); var url = $(this).attr("href"); var jsonurl = url.replace ("index", "getJSON"); $.getJSON(jsonurl, function(data) { @@ -92,6 +123,7 @@ function updatePage (data) { var fancyparams = fancyBoxObject (data.title, null); fancyparams ["content"] = detail; $.fancybox(fancyparams); + debug_log (elapsed ()); }); }); @@ -123,6 +155,7 @@ function ajaxifyLinks () { } window.onpopstate = function(event) { + before = new Date (); updatePage (event.state); }; From 3144c528e5bc10daf9aa43fab2d1ae9a18885b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 20 Jun 2013 14:43:31 +0200 Subject: [PATCH 31/41] Handle better if pushState is available or not. re #73 --- util.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/util.js b/util.js index 6860741..530e20e 100644 --- a/util.js +++ b/util.js @@ -2,6 +2,9 @@ var templatePage, templateBookDetail, templateMain, currentData, before; var DEBUG = true; var isEink = /Kobo|Kindle|EBRD1101/i.test(navigator.userAgent); +var isPushStateEnabled = window.history && window.history.pushState && window.history.replaceState && + // pushState isn't reliable on iOS until 5. + !navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/); function debug_log(text) { if ( DEBUG ) { @@ -131,18 +134,10 @@ function updatePage (data) { $(".fancyabout").fancybox(fancyBoxObject ('COPS ' + currentData.version, 'ajax')); } - - $("#searchForm").submit (function (event) { - event.preventDefault(); - - var url = strformat ("index.php?page=9¤t={0}&query={1}&db={2}", currentData.page, $("input[name=query]").val (), currentData.databaseId); - navigateTo (url); - }); - } function ajaxifyLinks () { - if (history.pushState) { + if (isPushStateEnabled) { var links = $("a[href^='index']"); if (getCurrentOption ("use_fancyapps") == 1) links = links.not (".fancydetail"); links.click (function (event) { @@ -151,6 +146,13 @@ function ajaxifyLinks () { var url = $(this).attr('href'); navigateTo (url); }); + + $("#searchForm").submit (function (event) { + event.preventDefault(); + + var url = strformat ("index.php?page=9¤t={0}&query={1}&db={2}", currentData.page, $("input[name=query]").val (), currentData.databaseId); + navigateTo (url); + }); } } From cdde134a650e65f3178f3e36f51f20c56d44e3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 20 Jun 2013 20:31:57 +0200 Subject: [PATCH 32/41] Also use global options. re #73 --- util.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util.js b/util.js index 530e20e..1e07a47 100644 --- a/util.js +++ b/util.js @@ -44,6 +44,11 @@ function isDefined(x) { } function getCurrentOption (option) { + if (!$.cookie (option)) { + if (currentData && currentData.const && currentData.const.config && currentData.const.config [option]) { + return currentData.const.config [option]; + } + } return $.cookie (option); } From d1fca67e5bd2363ff67653417b4f26d84867ca46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 20 Jun 2013 20:38:29 +0200 Subject: [PATCH 33/41] Modify htaccess to enable expires by type. re #73 --- .htaccess | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.htaccess b/.htaccess index d124065..e92019b 100644 --- a/.htaccess +++ b/.htaccess @@ -25,6 +25,37 @@ RewriteRule ^download/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&type=epub [L] RewriteRule ^download/(\d*)/.*\.(.*)$ fetch.php?data=$1&type=$2 [L] + +ExpiresActive on + +# Data +ExpiresByType text/xml "access plus 0 seconds" +ExpiresByType application/xml "access plus 0 seconds" +ExpiresByType application/json "access plus 0 seconds" +ExpiresByType application/xhtml+xml "access plus 0 seconds" + +# Favicon (cannot be renamed) +ExpiresByType image/x-icon "access plus 1 week" + +# Media: images +ExpiresByType image/png "access plus 1 month" +ExpiresByType image/jpg "access plus 1 month" +ExpiresByType image/jpeg "access plus 1 month" + +# Webfonts +ExpiresByType font/truetype "access plus 1 month" +ExpiresByType font/opentype "access plus 1 month" +ExpiresByType application/x-font-woff "access plus 1 month" +ExpiresByType image/svg+xml "access plus 1 month" +ExpiresByType application/vnd.ms-fontobject "access plus 1 month" + +# CSS and JavaScript +ExpiresByType text/css "access plus 1 year" +ExpiresByType application/javascript "access plus 1 year" +ExpiresByType text/javascript "access plus 1 year" + + + ########################################### # Uncomment if you wish to protect access with a password ########################################### From 44c3a10487e90d4215a7f5a7b991b45830e4ce16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 20 Jun 2013 21:08:50 +0200 Subject: [PATCH 34/41] Due to a bug in Firefox which forbid state of size greater that 320k. The cache is not outside. re #73 --- index.php | 1 + resources/lru/lru.js | 249 +++++++++++++++++++++++++++++++++++++++++++ util.js | 8 +- 3 files changed, 256 insertions(+), 2 deletions(-) create mode 100644 resources/lru/lru.js diff --git a/index.php b/index.php index 24200d3..00da962 100644 --- a/index.php +++ b/index.php @@ -40,6 +40,7 @@ " media="screen" /> + diff --git a/resources/lru/lru.js b/resources/lru/lru.js new file mode 100644 index 0000000..d014942 --- /dev/null +++ b/resources/lru/lru.js @@ -0,0 +1,249 @@ +/** + * A doubly linked list-based Least Recently Used (LRU) cache. Will keep most + * recently used items while discarding least recently used items when its limit + * is reached. + * + * Licensed under MIT. Copyright (c) 2010 Rasmus Andersson + * See README.md for details. + * + * Illustration of the design: + * + * entry entry entry entry + * ______ ______ ______ ______ + * | head |.newer => | |.newer => | |.newer => | tail | + * | A | | B | | C | | D | + * |______| <= older.|______| <= older.|______| <= older.|______| + * + * removed <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- added + */ +function LRUCache (limit) { + // Current size of the cache. (Read-only). + this.size = 0; + // Maximum number of items this cache can hold. + this.limit = limit; + this._keymap = {}; +} + +/** + * Put into the cache associated with . Returns the entry which was + * removed to make room for the new entry. Otherwise undefined is returned + * (i.e. if there was enough room already). + */ +LRUCache.prototype.put = function(key, value) { + var entry = {key:key, value:value}; + // Note: No protection agains replacing, and thus orphan entries. By design. + this._keymap[key] = entry; + if (this.tail) { + // link previous tail to the new tail (entry) + this.tail.newer = entry; + entry.older = this.tail; + } else { + // we're first in -- yay + this.head = entry; + } + // add new entry to the end of the linked list -- it's now the freshest entry. + this.tail = entry; + if (this.size === this.limit) { + // we hit the limit -- remove the head + return this.shift(); + } else { + // increase the size counter + this.size++; + } +} + +/** + * Purge the least recently used (oldest) entry from the cache. Returns the + * removed entry or undefined if the cache was empty. + * + * If you need to perform any form of finalization of purged items, this is a + * good place to do it. Simply override/replace this function: + * + * var c = new LRUCache(123); + * c.shift = function() { + * var entry = LRUCache.prototype.shift.call(this); + * doSomethingWith(entry); + * return entry; + * } + */ +LRUCache.prototype.shift = function() { + // todo: handle special case when limit == 1 + var entry = this.head; + if (entry) { + if (this.head.newer) { + this.head = this.head.newer; + this.head.older = undefined; + } else { + this.head = undefined; + } + // Remove last strong reference to and remove links from the purged + // entry being returned: + entry.newer = entry.older = undefined; + // delete is slow, but we need to do this to avoid uncontrollable growth: + delete this._keymap[entry.key]; + } + return entry; +} + +/** + * Get and register recent use of . Returns the value associated with + * or undefined if not in cache. + */ +LRUCache.prototype.get = function(key, returnEntry) { + // First, find our cache entry + var entry = this._keymap[key]; + if (entry === undefined) return; // Not cached. Sorry. + // As was found in the cache, register it as being requested recently + if (entry === this.tail) { + // Already the most recenlty used entry, so no need to update the list + return entry.value; + } + // HEAD--------------TAIL + // <.older .newer> + // <--- add direction -- + // A B C E + if (entry.newer) { + if (entry === this.head) + this.head = entry.newer; + entry.newer.older = entry.older; // C <-- E. + } + if (entry.older) + entry.older.newer = entry.newer; // C. --> E + entry.newer = undefined; // D --x + entry.older = this.tail; // D. --> E + if (this.tail) + this.tail.newer = entry; // E. <-- D + this.tail = entry; + return returnEntry ? entry : entry.value; +} + +// ---------------------------------------------------------------------------- +// Following code is optional and can be removed without breaking the core +// functionality. + +/** + * Check if is in the cache without registering recent use. Feasible if + * you do not want to chage the state of the cache, but only "peek" at it. + * Returns the entry associated with if found, or undefined if not found. + */ +LRUCache.prototype.find = function(key) { + return this._keymap[key]; +} + +/** + * Update the value of entry with . Returns the old value, or undefined if + * entry was not in the cache. + */ +LRUCache.prototype.set = function(key, value) { + var oldvalue, entry = this.get(key, true); + if (entry) { + oldvalue = entry.value; + entry.value = value; + } else { + oldvalue = this.put(key, value); + if (oldvalue) oldvalue = oldvalue.value; + } + return oldvalue; +} + +/** + * Remove entry from cache and return its value. Returns undefined if not + * found. + */ +LRUCache.prototype.remove = function(key) { + var entry = this._keymap[key]; + if (!entry) return; + delete this._keymap[entry.key]; // need to do delete unfortunately + if (entry.newer && entry.older) { + // relink the older entry with the newer entry + entry.older.newer = entry.newer; + entry.newer.older = entry.older; + } else if (entry.newer) { + // remove the link to us + entry.newer.older = undefined; + // link the newer entry to head + this.head = entry.newer; + } else if (entry.older) { + // remove the link to us + entry.older.newer = undefined; + // link the newer entry to head + this.tail = entry.older; + } else {// if(entry.older === undefined && entry.newer === undefined) { + this.head = this.tail = undefined; + } + + this.size--; + return entry.value; +} + +/** Removes all entries */ +LRUCache.prototype.removeAll = function() { + // This should be safe, as we never expose strong refrences to the outside + this.head = this.tail = undefined; + this.size = 0; + this._keymap = {}; +} + +/** + * Return an array containing all keys of entries stored in the cache object, in + * arbitrary order. + */ +if (typeof Object.keys === 'function') { + LRUCache.prototype.keys = function() { return Object.keys(this._keymap); } +} else { + LRUCache.prototype.keys = function() { + var keys = []; + for (var k in this._keymap) keys.push(k); + return keys; + } +} + +/** + * Call `fun` for each entry. Starting with the newest entry if `desc` is a true + * value, otherwise starts with the oldest (head) enrty and moves towards the + * tail. + * + * `fun` is called with 3 arguments in the context `context`: + * `fun.call(context, Object key, Object value, LRUCache self)` + */ +LRUCache.prototype.forEach = function(fun, context, desc) { + if (context === true) { desc = true; context = undefined; } + else if (typeof context !== 'object') context = this; + if (desc) { + var entry = this.tail; + while (entry) { + fun.call(context, entry.key, entry.value, this); + entry = entry.older; + } + } else { + var entry = this.head; + while (entry) { + fun.call(context, entry.key, entry.value, this); + entry = entry.newer; + } + } +} + +/** Returns a JSON (array) representation */ +LRUCache.prototype.toJSON = function() { + var s = [], entry = this.head; + while (entry) { + s.push({key:entry.key.toJSON(), value:entry.value.toJSON()}); + entry = entry.newer; + } + return s; +} + +/** Returns a String representation */ +LRUCache.prototype.toString = function() { + var s = '', entry = this.head; + while (entry) { + s += String(entry.key)+':'+entry.value; + if (entry = entry.newer) + s += ' < '; + } + return s; +} + +// Export ourselves +if (typeof this === 'object') this.LRUCache = LRUCache; diff --git a/util.js b/util.js index 1e07a47..0b57d91 100644 --- a/util.js +++ b/util.js @@ -1,5 +1,7 @@ var templatePage, templateBookDetail, templateMain, currentData, before; +var cache = new LRUCache(30); + var DEBUG = true; var isEink = /Kobo|Kindle|EBRD1101/i.test(navigator.userAgent); var isPushStateEnabled = window.history && window.history.pushState && window.history.replaceState && @@ -65,7 +67,8 @@ function navigateTo (url) { before = new Date (); var jsonurl = url.replace ("index", "getJSON"); $.getJSON(jsonurl, function(data) { - history.pushState(data, "", url); + history.pushState(jsonurl, "", url); + cache.put (jsonurl, data); updatePage (data); }); } @@ -163,7 +166,8 @@ function ajaxifyLinks () { window.onpopstate = function(event) { before = new Date (); - updatePage (event.state); + var data = cache.get (event.state) + updatePage (data); }; $(document).keydown(function(e){ From b2d670a05d949b45f777890c2a71ec95ccd98568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 20 Jun 2013 21:21:43 +0200 Subject: [PATCH 35/41] Also use the cache event if not using back with browser. re #73 --- index.php | 7 +++++-- util.js | 14 ++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 00da962..df1ea9d 100644 --- a/index.php +++ b/index.php @@ -52,12 +52,14 @@ $(document).ready(function() { // Handler for .ready() called. + var url = ""; + $.when($.get('templates/default/header.html'), $.get('templates/default/footer.html'), $.get('templates/default/bookdetail.html'), $.get('templates/default/main.html'), $.get('templates/default/page.html'), - $.getJSON('')).done(function(header, footer, bookdetail, main, page, data){ + $.getJSON(url)).done(function(header, footer, bookdetail, main, page, data){ templateBookDetail = doT.template (bookdetail [0]); var defMain = { @@ -77,7 +79,8 @@ currentData = data [0]; updatePage (data [0]); - history.replaceState(data [0], "", window.location); + cache.put (url, data [0]); + history.replaceState(url, "", window.location); }); }); diff --git a/util.js b/util.js index 0b57d91..7d9ef36 100644 --- a/util.js +++ b/util.js @@ -66,11 +66,17 @@ function htmlEscape(str) { function navigateTo (url) { before = new Date (); var jsonurl = url.replace ("index", "getJSON"); - $.getJSON(jsonurl, function(data) { + var cachedData = cache.get (jsonurl); + if (cachedData) { history.pushState(jsonurl, "", url); - cache.put (jsonurl, data); - updatePage (data); - }); + updatePage (cachedData); + } else { + $.getJSON(jsonurl, function(data) { + history.pushState(jsonurl, "", url); + cache.put (jsonurl, data); + updatePage (data); + }); + } } function updatePage (data) { From 30d37304640dd524c442639e0eb46591b31bcda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 21 Jun 2013 08:31:01 +0200 Subject: [PATCH 36/41] Fix version string --- util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.js b/util.js index 7d9ef36..7437ec3 100644 --- a/util.js +++ b/util.js @@ -146,7 +146,7 @@ function updatePage (data) { $(".fancycover").fancybox(fancyBoxObject (null, 'image')); - $(".fancyabout").fancybox(fancyBoxObject ('COPS ' + currentData.version, 'ajax')); + $(".fancyabout").fancybox(fancyBoxObject ('COPS ' + currentData.const.version, 'ajax')); } } From 6b8846e02baf135214d6cd1ac71c5fba6e33c0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 21 Jun 2013 08:38:02 +0200 Subject: [PATCH 37/41] Fix search. re #73 --- base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base.php b/base.php index 9a47436..3279c4c 100644 --- a/base.php +++ b/base.php @@ -11,7 +11,7 @@ define ("DB", "db"); date_default_timezone_set($config['default_timezone']); function getURLParam ($name, $default = NULL) { - if (!empty ($_GET) && isset($_GET[$name])) { + if (!empty ($_GET) && isset($_GET[$name]) && $_GET[$name] != "") { return $_GET[$name]; } return $default; From e833172e9981472d9f6cdcc1be307d7013eb38eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 21 Jun 2013 21:31:49 +0200 Subject: [PATCH 38/41] Add emailing. re #53 --- book.php | 10 ++++++++-- images/mail-send.png | Bin 0 -> 3585 bytes styles/style-default.css | 4 ++++ templates/default/bookdetail.html | 6 +++++- util.js | 17 +++++++++++++++++ 5 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 images/mail-send.png diff --git a/book.php b/book.php index 06fe5d0..dcfb1c9 100644 --- a/book.php +++ b/book.php @@ -140,14 +140,20 @@ class Book extends Base { } public function getFullContentArray () { + global $config; $out = $this->getContentArray (); $out ["coverurl"] = Data::getLink ($this, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml (); $out ["thumbnailurl"] = Data::getLink ($this, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, 150)->hrefXhtml (); $out ["content"] = $this->getComment (false); $out ["datas"] = array (); + $dataKindle = $this->GetMostInterestingDataToSendToKindle (); foreach ($this->getDatas() as $data) { - array_push ($out ["datas"], array ("format" => $data->format, "url" => $data->getHtmlLink ())); + $tab = array ("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink (), "mail" => 0); + if (!empty ($config['cops_mail_configuration']) && !is_null ($dataKindle) && $data->id == $dataKindle->id) { + $tab ["mail"] = 1; + } + array_push ($out ["datas"], $tab); } $out ["authors"] = array (); foreach ($this->getAuthors () as $author) { @@ -264,7 +270,7 @@ class Book extends Base { public function GetMostInterestingDataToSendToKindle () { - $bestFormatForKindle = array ("PDF", "MOBI"); + $bestFormatForKindle = array ("EPUB", "PDF", "MOBI"); $bestRank = -1; $bestData = NULL; foreach ($this->getDatas () as $data) { diff --git a/images/mail-send.png b/images/mail-send.png new file mode 100644 index 0000000000000000000000000000000000000000..1dbcb984beb68467ddbc5b9da97f153a33a7f90f GIT binary patch literal 3585 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 Hu0mjf|4GKS literal 0 HcmV?d00001 diff --git a/styles/style-default.css b/styles/style-default.css index 2f910db..1fe2da5 100644 --- a/styles/style-default.css +++ b/styles/style-default.css @@ -156,8 +156,12 @@ max-width:800px; text-decoration : none; font-weight: bold; padding: 5px 10px 5px 10px; + text-align: center; } +.download img { + vertical-align:middle; +} .books h4{ display: inline; diff --git a/templates/default/bookdetail.html b/templates/default/bookdetail.html index 9d58fa6..e5b5662 100644 --- a/templates/default/bookdetail.html +++ b/templates/default/bookdetail.html @@ -8,7 +8,11 @@

{{~it.book.datas:data:i}} - {{=data.format}}
+ {{=data.format}} + {{? data.mail == 1}} + Mail + {{?}} +
{{~}}

{{=it.const.i18n.permalinkAlt}}{{=htmlEscape (it.title)}}

diff --git a/util.js b/util.js index 7437ec3..79302af 100644 --- a/util.js +++ b/util.js @@ -19,6 +19,23 @@ function elapsed () { return "Elapsed : " + elapsed; } +function retourMail(data, textStatus, jqXHR ) { + alert (data); +} + +function sendToMailAddress (component, dataid) { + $toto = $.cookie ('email'); + if (!$.cookie ('email')) { + var email = window.prompt ("Please enter your email : ", ""); + $.cookie ('email', email); + } + email = $.cookie ('email'); + var url = 'sendtomail.php'; + if (currentData.databaseId) url = url + '?db=' + currentData.databaseId; + $.ajax ({url: url, type: 'post', data: { data: dataid, email: email }, success: retourMail}); +} + + function fancyBoxObject (title, type) { var out = { prevEffect : 'none', nextEffect : 'none' }; if (isEink) { From d3ce31c6be322dff8f73c74a393f0b7174aeada4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 25 Jun 2013 08:40:08 +0200 Subject: [PATCH 39/41] Move from Xhtml to Html. re #73 --- base.php | 2 +- book.php | 1 - data.php | 2 +- getJSON.php | 8 ++++---- index.php | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/base.php b/base.php index 3279c4c..13f85d3 100644 --- a/base.php +++ b/base.php @@ -208,7 +208,7 @@ class Link } public function hrefXhtml () { - return str_replace ("&", "&", $this->href); + return $this->href; } } diff --git a/book.php b/book.php index dcfb1c9..3987026 100644 --- a/book.php +++ b/book.php @@ -173,7 +173,6 @@ class Book extends Base { global $config; $urlParam = $this->getUri (); if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB)); - $urlParam = str_replace ("&", "&", $urlParam); return 'index.php' . $urlParam; } diff --git a/data.php b/data.php index 0430bd8..5e08044 100644 --- a/data.php +++ b/data.php @@ -105,7 +105,7 @@ class Data extends Base { } else { - return str_replace ("&", "&", self::getLink ($this->book, $this->extension, $this->getMimeType (), NULL, $this->getFilename (), $this->id, NULL)->href); + return self::getLink ($this->book, $this->extension, $this->getMimeType (), NULL, $this->getFilename (), $this->id, NULL)->href; } } diff --git a/getJSON.php b/getJSON.php index 6147725..dbd4ce2 100644 --- a/getJSON.php +++ b/getJSON.php @@ -75,9 +75,9 @@ "sortorderAsc" => localize("search.sortorder.asc"), "sortorderDesc" => localize("search.sortorder.desc")), "url" => array ( - "detailUrl" => "index.php?page=13&id={0}&db={1}", - "coverUrl" => "fetch.php?id={0}&db={1}", - "thumbnailUrl" => "fetch.php?height=70&id={0}&db={1}"), + "detailUrl" => "index.php?page=13&id={0}&db={1}", + "coverUrl" => "fetch.php?id={0}&db={1}", + "thumbnailUrl" => "fetch.php?height=70&id={0}&db={1}"), "config" => array ( "use_fancyapps" => $config ["cops_use_fancyapps"], "max_item_per_page" => $config['cops_max_item_per_page'])); @@ -89,7 +89,7 @@ } $out["abouturl"] = "about.xml"; if (getCurrentOption ('use_fancyapps') == 0) { - $out["abouturl"] = "index.php" . str_replace ("&", "&", addURLParameter ("?page=16", DB, $database)); + $out["abouturl"] = "index.php" . addURLParameter ("?page=16", DB, $database); } $out ["homeurl"] = "index.php"; diff --git a/index.php b/index.php index df1ea9d..fcc915c 100644 --- a/index.php +++ b/index.php @@ -22,7 +22,7 @@ exit (); } - header ("Content-Type:application/xhtml+xml;charset=utf-8"); + header ("Content-Type:text/html;charset=utf-8"); $page = getURLParam ("page", Base::PAGE_INDEX); $query = getURLParam ("query"); $qid = getURLParam ("id"); @@ -52,7 +52,7 @@ $(document).ready(function() { // Handler for .ready() called. - var url = ""; + var url = ""; $.when($.get('templates/default/header.html'), $.get('templates/default/footer.html'), From e547899584f0d46dbc81a44ac7cf0cdc0d803d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 25 Jun 2013 08:53:04 +0200 Subject: [PATCH 40/41] Migrate from Fancybox to Magnific Popup. re #73 --HG-- rename : about.xml => about.html --- about.xml => about.html | 0 getJSON.php | 2 +- index.php | 4 +- .../jquery.magnific-popup.min.js | 4 + resources/Magnific-Popup/magnific-popup.css | 395 ++++++++++++++++++ resources/fancybox/blank.gif | Bin 43 -> 0 bytes resources/fancybox/fancybox_loading.gif | Bin 3866 -> 0 bytes resources/fancybox/fancybox_overlay.png | Bin 1003 -> 0 bytes resources/fancybox/fancybox_sprite.png | Bin 1362 -> 0 bytes .../fancybox/helpers/fancybox_buttons.png | Bin 1080 -> 0 bytes .../helpers/jquery.fancybox-buttons.css | 96 ----- .../helpers/jquery.fancybox-buttons.js | 121 ------ .../fancybox/helpers/jquery.fancybox-media.js | 196 --------- .../helpers/jquery.fancybox-thumbs.css | 54 --- .../helpers/jquery.fancybox-thumbs.js | 162 ------- resources/fancybox/jquery.fancybox.css | 249 ----------- resources/fancybox/jquery.fancybox.pack.js | 1 - styles/style-default.css | 10 + 18 files changed, 412 insertions(+), 882 deletions(-) rename about.xml => about.html (100%) create mode 100644 resources/Magnific-Popup/jquery.magnific-popup.min.js create mode 100644 resources/Magnific-Popup/magnific-popup.css delete mode 100644 resources/fancybox/blank.gif delete mode 100644 resources/fancybox/fancybox_loading.gif delete mode 100644 resources/fancybox/fancybox_overlay.png delete mode 100644 resources/fancybox/fancybox_sprite.png delete mode 100644 resources/fancybox/helpers/fancybox_buttons.png delete mode 100644 resources/fancybox/helpers/jquery.fancybox-buttons.css delete mode 100644 resources/fancybox/helpers/jquery.fancybox-buttons.js delete mode 100644 resources/fancybox/helpers/jquery.fancybox-media.js delete mode 100644 resources/fancybox/helpers/jquery.fancybox-thumbs.css delete mode 100644 resources/fancybox/helpers/jquery.fancybox-thumbs.js delete mode 100644 resources/fancybox/jquery.fancybox.css delete mode 100644 resources/fancybox/jquery.fancybox.pack.js diff --git a/about.xml b/about.html similarity index 100% rename from about.xml rename to about.html diff --git a/getJSON.php b/getJSON.php index dbd4ce2..d66ca4e 100644 --- a/getJSON.php +++ b/getJSON.php @@ -87,7 +87,7 @@ if ($currentPage->containsBook ()) { $out ["containsBook"] = 1; } - $out["abouturl"] = "about.xml"; + $out["abouturl"] = "about.html"; if (getCurrentOption ('use_fancyapps') == 0) { $out["abouturl"] = "index.php" . addURLParameter ("?page=16", DB, $database); } diff --git a/index.php b/index.php index fcc915c..28d59ec 100644 --- a/index.php +++ b/index.php @@ -36,8 +36,8 @@ COPS - - " media="screen" /> + + " media="screen" /> diff --git a/resources/Magnific-Popup/jquery.magnific-popup.min.js b/resources/Magnific-Popup/jquery.magnific-popup.min.js new file mode 100644 index 0000000..d5c1ad1 --- /dev/null +++ b/resources/Magnific-Popup/jquery.magnific-popup.min.js @@ -0,0 +1,4 @@ +/*! Magnific Popup - v0.8.9 - 2013-06-04 +* http://dimsemenov.com/plugins/magnific-popup/ +* Copyright (c) 2013 Dmitry Semenov; */ +(function(e){var t,i,n,a,r,o,s,l="Close",c="AfterClose",d="BeforeAppend",p="MarkupParse",u="Open",f="Change",m="mfp",g="."+m,v="mfp-ready",h="mfp-removing",C="mfp-prevent-close",y=function(){},w=!!window.jQuery,b=e(window),I=function(e,i){t.ev.on(m+e+g,i)},x=function(t,i,n,a){var r=document.createElement("div");return r.className="mfp-"+t,n&&(r.innerHTML=n),a?i&&i.appendChild(r):(r=e(r),i&&r.appendTo(i)),r},k=function(i,n){t.ev.triggerHandler(m+i,n),t.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),t.st.callbacks[i]&&t.st.callbacks[i].apply(t,e.isArray(n)?n:[n]))},S=function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},P=function(i){return i===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=i),t.currTemplate.closeBtn},E=function(){e.magnificPopup.instance||(t=new y,t.init(),e.magnificPopup.instance=t)},T=function(i){if(!e(i).hasClass(C)){var n=t.st.closeOnContentClick,a=t.st.closeOnBgClick;if(n&&a)return!0;if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(n)return!0}else if(a)return!0;return!1}};y.prototype={constructor:y,init:function(){var i=navigator.appVersion;t.isIE7=-1!==i.indexOf("MSIE 7."),t.isIE8=-1!==i.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document.body),a=e(document),t.popupsCache={}},open:function(i){var r;if(i.isObj===!1){t.items=i.items.toArray(),t.index=0;var s,l=i.items;for(r=0;l.length>r;r++)if(s=l[r],s.parsed&&(s=s.el[0]),s===i.el[0]){t.index=r;break}}else t.items=e.isArray(i.items)?i.items:[i.items],t.index=i.index||0;if(t.isOpen)return t.updateItemHTML(),void 0;t.types=[],o="",t.ev=i.mainEl||a,i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.bgOverlay||(t.bgOverlay=x("bg").on("click"+g,function(){t.close()}),t.wrap=x("wrap").attr("tabindex",-1).on("click"+g,function(e){T(e.target)&&t.close()}),t.container=x("container",t.wrap)),t.contentContainer=x("content"),t.st.preloader&&(t.preloader=x("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(r=0;c.length>r;r++){var d=c[r];d=d.charAt(0).toUpperCase()+d.slice(1),t["init"+d].call(t)}k("BeforeOpen"),t.st.closeBtnInside?(I(p,function(e,t,i,n){i.close_replaceWith=P(n.type)}),o+=" mfp-close-btn-in"):t.wrap.append(P()),t.st.alignTop&&(o+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:b.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:a.height(),position:"absolute"}),a.on("keyup"+g,function(e){27===e.keyCode&&t.close()}),b.on("resize"+g,function(){t.updateSize()}),t.st.closeOnContentClick||(o+=" mfp-auto-cursor"),o&&t.wrap.addClass(o);var f=t.wH=b.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(f)){var h=t._getScrollbarSize();h&&(m.paddingRight=h)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var C=t.st.mainClass;t.isIE7&&(C+=" mfp-ie7"),C&&t._addClassToMFP(C),t.updateItemHTML(),k("BuildControls"),n.css(m),t.bgOverlay.add(t.wrap).prependTo(document.body),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),S()):t.bgOverlay.addClass(v),a.on("focusin"+g,function(i){return i.target===t.wrap[0]||e.contains(t.wrap[0],i.target)?void 0:(S(),!1)})},16),t.isOpen=!0,t.updateSize(f),k(u)},close:function(){t.isOpen&&(t.isOpen=!1,t.st.removalDelay&&!t.isLowIE?(t._addClassToMFP(h),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){k(l);var i=h+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var r={paddingRight:""};t.isIE7?e("body, html").css("overflow",""):r.overflow="",n.css(r)}a.off("keyup"+g+" focusin"+g),t.ev.off(g),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,k(c)},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*i;t.wrap.css("height",n),t.wH=n}else t.wH=e||b.height();t.fixedContentPos||t.wrap.css("height",t.wH),k("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var n=i.type;if(k("BeforeChange",[t.currItem?t.currItem.type:"",n]),t.currItem=i,!t.currTemplate[n]){var a=t.st[n]?t.st[n].markup:!1;k("FirstMarkupParse",a),t.currTemplate[n]=a?e(a):!0}r&&r!==i.type&&t.container.removeClass("mfp-"+r+"-holder");var o=t["get"+n.charAt(0).toUpperCase()+n.slice(1)](i,t.currTemplate[n]);t.appendContent(o,n),i.preloaded=!0,k(f,i),r=i.type,t.container.prepend(t.contentContainer),k("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.closeBtnInside&&t.currTemplate[i]===!0?t.content.find(".mfp-close").length||t.content.append(P()):t.content=e:t.content="",k(d),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var n=t.items[i],a=n.type;if(n=n.tagName?{el:e(n)}:{data:n,src:n.src},n.el){for(var r=t.types,o=0;r.length>o;o++)if(n.el.hasClass("mfp-"+r[o])){a=r[o];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=a||t.st.type||"inline",n.index=i,n.parsed=!0,t.items[i]=n,k("ElementParse",n),t.items[i]},addGroup:function(e,i){var n=function(n){n.mfpEl=this,t._openClick(n,e,i)};i||(i={});var a="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(a).on(a,n)):(i.isObj=!1,i.delegate?e.off(a).on(a,i.delegate,n):(i.items=e,e.off(a).on(a,n)))},_openClick:function(i,n,a){var r=void 0!==a.midClick?a.midClick:e.magnificPopup.defaults.midClick;if(r||2!==i.which){var o=void 0!==a.disableOn?a.disableOn:e.magnificPopup.defaults.disableOn;if(o)if(e.isFunction(o)){if(!o.call(t))return!0}else if(o>b.width())return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation()),a.el=e(i.mfpEl),a.delegate&&(a.items=n.find(a.delegate)),t.open(a)}},updateStatus:function(e,n){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),n||"loading"!==e||(n=t.st.tLoading);var a={status:e,text:n};k("UpdateStatus",a),e=a.status,n=a.text,t.preloader.html(n),t.preloader.find("a").click(function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),i=e}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?a.height():document.body.scrollHeight)>(e||b.height())},_parseMarkup:function(t,i,n){var a;n.data&&(i=e.extend(n.data,i)),k(p,[t,i,n]),e.each(i,function(e,i){if(void 0===i||i===!1)return!0;if(a=e.split("_"),a.length>1){var n=t.find(g+"-"+a[0]);if(n.length>0){var r=a[1];"replaceWith"===r?n[0]!==i[0]&&n.replaceWith(i):"img"===r?n.is("img")?n.attr("src",i):n.replaceWith(''):n.attr(a[1],i)}}else t.find(g+"-"+e).html(i)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:y.prototype,modules:[],open:function(e,t){return E(),e||(e={}),e.isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,alignTop:!1,removalDelay:0,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(i){E();var n=e(this);if("string"==typeof i)if("open"===i){var a,r=w?n.data("magnificPopup"):n[0].magnificPopup,o=parseInt(arguments[1],10)||0;r.items?a=r.items[o]:(a=n,r.delegate&&(a=a.find(r.delegate)),a=a.eq(o)),t._openClick({mfpEl:a},n,r)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else w?n.data("magnificPopup",i):n[0].magnificPopup=i,t.addGroup(n,i);return n};var M,O,_,z="inline",B=function(){_&&(O.after(_.addClass(M)).detach(),_=null)};e.magnificPopup.registerModule(z,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(z),I(l+"."+z,function(){B()})},getInline:function(i,n){if(B(),i.src){var a=t.st.inline,r=e(i.src);if(r.length){var o=r[0].parentNode;o&&o.tagName&&(O||(M=a.hiddenClass,O=x(M),M="mfp-"+M),_=r.after(O).detach().removeClass(M)),t.updateStatus("ready")}else t.updateStatus("error",a.tNotFound),r=e("
");return i.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(n,{},i),n}}});var H,F="ajax",L=function(){H&&n.removeClass(H)};e.magnificPopup.registerModule(F,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){t.types.push(F),H=t.st.ajax.cursor,I(l+"."+F,function(){L(),t.req&&t.req.abort()})},getAjax:function(i){H&&n.addClass(H),t.updateStatus("loading");var a=e.extend({url:i.src,success:function(n,a,r){var o={data:n,xhr:r};k("ParseAjax",o),t.appendContent(e(o.data),F),i.finished=!0,L(),S(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),k("AjaxContentAdded")},error:function(){L(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(a),""}}});var A,j=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var n=t.st.image.titleSrc;if(n){if(e.isFunction(n))return n.call(t,i);if(i.el)return i.el.attr(n)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var e=t.st.image,i=".image";t.types.push("image"),I(u+i,function(){"image"===t.currItem.type&&e.cursor&&n.addClass(e.cursor)}),I(l+i,function(){e.cursor&&n.removeClass(e.cursor),b.off("resize"+g)}),I("Resize"+i,t.resizeImage),t.isLowIE&&I("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-i)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,A&&clearInterval(A),e.isCheckingImgSize=!1,k("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,n=e.img[0],a=function(r){A&&clearInterval(A),A=setInterval(function(){return n.naturalWidth>0?(t._onImageHasSize(e),void 0):(i>200&&clearInterval(A),i++,3===i?a(10):40===i?a(50):100===i&&a(500),void 0)},r)};a(1)},getImage:function(i,n){var a=0,r=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0):(a++,200>a?setTimeout(r,100):o()))},o=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=n.find(".mfp-img");if(l.length){var c=new Image;c.className="mfp-img",i.img=e(c).on("load.mfploader",r).on("error.mfploader",o),c.src=i.src,l.is("img")&&(i.img=i.img.clone())}return t._parseMarkup(n,{title:j(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(A&&clearInterval(A),i.loadError?(n.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(n.removeClass("mfp-loading"),t.updateStatus("ready")),n):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,n.addClass("mfp-loading"),t.findImageSize(i)),n)}}});var N="iframe",W="//about:blank",R=function(e){if(t.currTemplate[N]){var i=t.currTemplate[N].find("iframe");i.length&&(e||(i[0].src=W),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(N,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(N),I("BeforeChange",function(e,t,i){t!==i&&(t===N?R():i===N&&R(!0))}),I(l+"."+N,function(){R()})},getIframe:function(i,n){var a=i.src,r=t.st.iframe;e.each(r.patterns,function(){return a.indexOf(this.index)>-1?(this.id&&(a="string"==typeof this.id?a.substr(a.lastIndexOf(this.id)+this.id.length,a.length):this.id.call(this,a)),a=this.src.replace("%id%",a),!1):void 0});var o={};return r.srcAction&&(o[r.srcAction]=a),t._parseMarkup(n,o,i),t.updateStatus("ready"),n}}});var Y=function(e){var i=t.items.length;return e>i-1?e-i:0>e?i+e:e},q=function(e,t,i){return e.replace("%curr%",t+1).replace("%total%",i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,n=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,i&&i.enabled?(o+=" mfp-gallery",I(u+n,function(){i.navigateByImgClick&&t.wrap.on("click"+n,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),a.on("keydown"+n,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),I("UpdateStatus"+n,function(e,i){i.text&&(i.text=q(i.text,t.currItem.index,t.items.length))}),I(p+n,function(e,n,a,r){var o=t.items.length;a.counter=o>1?q(i.tCounter,r.index,o):""}),I("BuildControls"+n,function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,a=t.arrowLeft=e(n.replace("%title%",i.tPrev).replace("%dir%","left")).addClass(C),o=t.arrowRight=e(n.replace("%title%",i.tNext).replace("%dir%","right")).addClass(C),s=r?"mfpFastClick":"click";a[s](function(){t.prev()}),o[s](function(){t.next()}),t.isIE7&&(x("b",a[0],!1,!0),x("a",a[0],!1,!0),x("b",o[0],!1,!0),x("a",o[0],!1,!0)),t.container.append(a.add(o))}}),I(f+n,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),I(l+n,function(){a.off(n),t.wrap.off("click"+n),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=Y(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=Y(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),a=Math.min(i[1],t.items.length);for(e=1;(t.direction?a:n)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?n:a)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=Y(i),!t.items[i].preloaded){var n=t.items[i];n.parsed||(n=t.parseEl(i)),k("LazyLoad",n),"image"===n.type&&(n.img=e('').on("load.mfploader",function(){n.hasSize=!0}).on("error.mfploader",function(){n.hasSize=!0,n.loadError=!0}).attr("src",n.src)),n.preloaded=!0}}}});var D="retina";e.magnificPopup.registerModule(D,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;i=isNaN(i)?i():i,i>1&&(I("ImageHasSize."+D,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})}),I("ElementParse."+D,function(t,n){n.src=e.replaceSrc(n,i)}))}}}}),function(){var t=1e3,i="ontouchstart"in window,n=function(){b.off("touchmove"+r+" touchend"+r)},a="mfpFastClick",r="."+a;e.fn.mfpFastClick=function(a){return e(this).each(function(){var o,s=e(this);if(i){var l,c,d,p,u,f;s.on("touchstart"+r,function(e){p=!1,f=1,u=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=u.clientX,d=u.clientY,b.on("touchmove"+r,function(e){u=e.originalEvent?e.originalEvent.touches:e.touches,f=u.length,u=u[0],(Math.abs(u.clientX-c)>10||Math.abs(u.clientY-d)>10)&&(p=!0,n())}).on("touchend"+r,function(e){n(),p||f>1||(o=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){o=!1},t),a())})})}s.on("click"+r,function(){o||a()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),i&&b.off("touchmove"+r+" touchend"+r)}}()})(window.jQuery||window.Zepto); \ No newline at end of file diff --git a/resources/Magnific-Popup/magnific-popup.css b/resources/Magnific-Popup/magnific-popup.css new file mode 100644 index 0000000..f1dec8b --- /dev/null +++ b/resources/Magnific-Popup/magnific-popup.css @@ -0,0 +1,395 @@ +/* Magnific Popup CSS */ +.mfp-bg { + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 502; + overflow: hidden; + position: fixed; + background: #0b0b0b; + opacity: 0.8; + filter: alpha(opacity=80); } + +.mfp-wrap { + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 503; + position: fixed; + outline: none !important; + -webkit-backface-visibility: hidden; } + +.mfp-container { + height: 100%; + text-align: center; + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + padding: 0 8px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + +.mfp-container:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; } + +.mfp-align-top .mfp-container:before { + display: none; } + +.mfp-content { + position: relative; + display: inline-block; + vertical-align: middle; + margin: 0 auto; + text-align: left; + z-index: 505; } + +.mfp-inline-holder .mfp-content, +.mfp-ajax-holder .mfp-content { + width: 100%; + cursor: auto; } + +.mfp-ajax-cur { + cursor: progress; } + +.mfp-zoom-out-cur, +.mfp-zoom-out-cur .mfp-image-holder .mfp-close { + cursor: -moz-zoom-out; + cursor: -webkit-zoom-out; + cursor: zoom-out; } + +.mfp-zoom { + cursor: pointer; + cursor: -webkit-zoom-in; + cursor: -moz-zoom-in; + cursor: zoom-in; } + +.mfp-auto-cursor .mfp-content { + cursor: auto; } + +.mfp-close, +.mfp-arrow, +.mfp-preloader, +.mfp-counter { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } + +.mfp-loading.mfp-figure { + display: none; } + +.mfp-hide { + display: none !important; } + +.mfp-preloader { + color: #cccccc; + position: absolute; + top: 50%; + width: auto; + text-align: center; + margin-top: -0.8em; + left: 8px; + right: 8px; + z-index: 504; } + +.mfp-preloader a { + color: #cccccc; } + +.mfp-preloader a:hover { + color: white; } + +.mfp-s-ready .mfp-preloader { + display: none; } + +.mfp-s-error .mfp-content { + display: none; } + +button.mfp-close, +button.mfp-arrow { + overflow: visible; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; + display: block; + padding: 0; + z-index: 506; } + +button::-moz-focus-inner { + padding: 0; + border: 0; } + +.mfp-close { + width: 44px; + height: 44px; + line-height: 44px; + position: absolute; + right: 0; + top: 0; + text-decoration: none; + text-align: center; + opacity: 0.65; + padding: 0 0 18px 10px; + color: white; + font-style: normal; + font-size: 28px; + font-family: Arial, Baskerville, monospace; } + .mfp-close:hover, .mfp-close:focus { + opacity: 1; } + .mfp-close:active { + top: 1px; } + +.mfp-close-btn-in .mfp-close { + color: #333333; } + +.mfp-image-holder .mfp-close, +.mfp-iframe-holder .mfp-close { + color: white; + right: -6px; + text-align: right; + padding-right: 6px; + width: 100%; } + +.mfp-counter { + position: absolute; + top: 0; + right: 0; + color: #cccccc; + font-size: 12px; + line-height: 18px; } + +.mfp-arrow { + position: absolute; + top: 0; + opacity: 0.65; + margin: 0; + top: 50%; + margin-top: -55px; + padding: 0; + width: 90px; + height: 110px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +.mfp-arrow:active { + margin-top: -54px; } + +.mfp-arrow:hover, +.mfp-arrow:focus { + opacity: 1; } + +.mfp-arrow:before, .mfp-arrow:after, +.mfp-arrow .mfp-b, +.mfp-arrow .mfp-a { + content: ''; + display: block; + width: 0; + height: 0; + position: absolute; + left: 0; + top: 0; + margin-top: 35px; + margin-left: 35px; + border: solid transparent; } +.mfp-arrow:after, +.mfp-arrow .mfp-a { + opacity: 0.8; + border-top-width: 12px; + border-bottom-width: 12px; + top: 8px; } +.mfp-arrow:before, +.mfp-arrow .mfp-b { + border-top-width: 20px; + border-bottom-width: 20px; } + +.mfp-arrow-left { + left: 0; } + .mfp-arrow-left:after, + .mfp-arrow-left .mfp-a { + border-right: 12px solid black; + left: 5px; } + .mfp-arrow-left:before, + .mfp-arrow-left .mfp-b { + border-right: 20px solid white; } + +.mfp-arrow-right { + right: 0; } + .mfp-arrow-right:after, + .mfp-arrow-right .mfp-a { + border-left: 12px solid black; + left: 3px; } + .mfp-arrow-right:before, + .mfp-arrow-right .mfp-b { + border-left: 20px solid white; } + +.mfp-iframe-holder { + padding-top: 40px; + padding-bottom: 40px; } + +.mfp-iframe-holder .mfp-content { + line-height: 0; + width: 100%; + max-width: 900px; } + +.mfp-iframe-scaler { + width: 100%; + height: 0; + overflow: hidden; + padding-top: 56.25%; } + +.mfp-iframe-scaler iframe { + position: absolute; + display: block; + top: 0; + left: 0; + width: 100%; + height: 100%; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); + background: black; } + +.mfp-iframe-holder .mfp-close { + top: -40px; } + +/* Main image in popup */ +img.mfp-img { + width: auto; + max-width: 100%; + height: auto; + display: block; + line-height: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 40px 0 40px; + margin: 0 auto; } + +/* The shadow behind the image */ +.mfp-figure:after { + content: ''; + position: absolute; + left: 0; + top: 40px; + bottom: 40px; + display: block; + right: 0; + width: auto; + height: auto; + z-index: -1; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); } + +.mfp-figure { + line-height: 0; } + +.mfp-bottom-bar { + margin-top: -36px; + position: absolute; + top: 100%; + left: 0; + width: 100%; + cursor: auto; } + +.mfp-title { + text-align: left; + line-height: 18px; + color: #f3f3f3; + word-break: break-word; + padding-right: 36px; } + +.mfp-figure small { + color: #bdbdbd; + display: block; + font-size: 12px; + line-height: 14px; } + +.mfp-image-holder .mfp-content { + max-width: 100%; } + +.mfp-gallery .mfp-image-holder .mfp-figure { + cursor: pointer; } + +@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) { + /** + * Remove all paddings around the image on small screen + */ + .mfp-img-mobile .mfp-image-holder { + padding-left: 0; + padding-right: 0; } + + .mfp-img-mobile img.mfp-img { + padding: 0; } + + /* The shadow behind the image */ + .mfp-img-mobile .mfp-figure:after { + top: 0; + bottom: 0; } + + .mfp-img-mobile .mfp-bottom-bar { + background: rgba(0, 0, 0, 0.6); + bottom: 0; + margin: 0; + top: auto; + padding: 3px 5px; + position: fixed; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + + .mfp-img-mobile .mfp-bottom-bar:empty { + padding: 0; } + + .mfp-img-mobile .mfp-counter { + right: 5px; + top: 3px; } + + .mfp-img-mobile .mfp-close { + top: 0; + right: 0; + width: 35px; + height: 35px; + line-height: 35px; + background: rgba(0, 0, 0, 0.6); + position: fixed; + text-align: center; + padding: 0; } + + .mfp-img-mobile .mfp-figure small { + display: inline; + margin-left: 5px; } } +@media all and (max-width: 800px) { + .mfp-arrow { + -webkit-transform: scale(0.75); + transform: scale(0.75); } + + .mfp-arrow-left { + -webkit-transform-origin: 0; + transform-origin: 0; } + + .mfp-arrow-right { + -webkit-transform-origin: 100%; + transform-origin: 100%; } + + .mfp-container { + padding-left: 6px; + padding-right: 6px; } } +.mfp-ie7 .mfp-img { + padding: 0; } +.mfp-ie7 .mfp-bottom-bar { + width: 600px; + left: 50%; + margin-left: -300px; + margin-top: 5px; + padding-bottom: 5px; } +.mfp-ie7 .mfp-container { + padding: 0; } +.mfp-ie7 .mfp-content { + padding-top: 44px; } +.mfp-ie7 .mfp-close { + top: 0; + right: 0; + padding-top: 0; } diff --git a/resources/fancybox/blank.gif b/resources/fancybox/blank.gif deleted file mode 100644 index 35d42e808f0a8017b8d52a06be2f8fec0b466a66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43 scmZ?wbhEHbWMp7uXkcLY|NlP&1B2pE7Dgb&paUX6G7L;iE{qJ;0LZEa`2YX_ diff --git a/resources/fancybox/fancybox_loading.gif b/resources/fancybox/fancybox_loading.gif deleted file mode 100644 index 01586176d793c261db6b6ca4ca7822b2d3b35703..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3866 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 diff --git a/resources/fancybox/helpers/jquery.fancybox-buttons.css b/resources/fancybox/helpers/jquery.fancybox-buttons.css deleted file mode 100644 index 9453b46..0000000 --- a/resources/fancybox/helpers/jquery.fancybox-buttons.css +++ /dev/null @@ -1,96 +0,0 @@ -#fancybox-buttons { - position: fixed; - left: 0; - width: 100%; - z-index: 8050; -} - -#fancybox-buttons.top { - top: 10px; -} - -#fancybox-buttons.bottom { - bottom: 10px; -} - -#fancybox-buttons ul { - display: block; - width: 166px; - height: 30px; - margin: 0 auto; - padding: 0; - list-style: none; - border: 1px solid #111; - border-radius: 3px; - -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - background: rgb(50,50,50); - background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); - background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); -} - -#fancybox-buttons ul li { - float: left; - margin: 0; - padding: 0; -} - -#fancybox-buttons a { - display: block; - width: 30px; - height: 30px; - text-indent: -9999px; - background-image: url('fancybox_buttons.png'); - background-repeat: no-repeat; - outline: none; - opacity: 0.8; -} - -#fancybox-buttons a:hover { - opacity: 1; -} - -#fancybox-buttons a.btnPrev { - background-position: 5px 0; -} - -#fancybox-buttons a.btnNext { - background-position: -33px 0; - border-right: 1px solid #3e3e3e; -} - -#fancybox-buttons a.btnPlay { - background-position: 0 -30px; -} - -#fancybox-buttons a.btnPlayOn { - background-position: -30px -30px; -} - -#fancybox-buttons a.btnToggle { - background-position: 3px -60px; - border-left: 1px solid #111; - border-right: 1px solid #3e3e3e; - width: 35px -} - -#fancybox-buttons a.btnToggleOn { - background-position: -27px -60px; -} - -#fancybox-buttons a.btnClose { - border-left: 1px solid #111; - width: 35px; - background-position: -56px 0px; -} - -#fancybox-buttons a.btnDisabled { - opacity : 0.4; - cursor: default; -} \ No newline at end of file diff --git a/resources/fancybox/helpers/jquery.fancybox-buttons.js b/resources/fancybox/helpers/jquery.fancybox-buttons.js deleted file mode 100644 index 50baeca..0000000 --- a/resources/fancybox/helpers/jquery.fancybox-buttons.js +++ /dev/null @@ -1,121 +0,0 @@ - /*! - * Buttons helper for fancyBox - * version: 1.0.5 (Mon, 15 Oct 2012) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * buttons: { - * position : 'top' - * } - * } - * }); - * - */ -(function ($) { - //Shortcut for fancyBox object - var F = $.fancybox; - - //Add helper object - F.helpers.buttons = { - defaults : { - skipSingle : false, // disables if gallery contains single image - position : 'top', // 'top' or 'bottom' - tpl : '
' - }, - - list : null, - buttons: null, - - beforeLoad: function (opts, obj) { - //Remove self if gallery do not have at least two items - - if (opts.skipSingle && obj.group.length < 2) { - obj.helpers.buttons = false; - obj.closeBtn = true; - - return; - } - - //Increase top margin to give space for buttons - obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; - }, - - onPlayStart: function () { - if (this.buttons) { - this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); - } - }, - - onPlayEnd: function () { - if (this.buttons) { - this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); - } - }, - - afterShow: function (opts, obj) { - var buttons = this.buttons; - - if (!buttons) { - this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); - - buttons = { - prev : this.list.find('.btnPrev').click( F.prev ), - next : this.list.find('.btnNext').click( F.next ), - play : this.list.find('.btnPlay').click( F.play ), - toggle : this.list.find('.btnToggle').click( F.toggle ) - } - } - - //Prev - if (obj.index > 0 || obj.loop) { - buttons.prev.removeClass('btnDisabled'); - } else { - buttons.prev.addClass('btnDisabled'); - } - - //Next / Play - if (obj.loop || obj.index < obj.group.length - 1) { - buttons.next.removeClass('btnDisabled'); - buttons.play.removeClass('btnDisabled'); - - } else { - buttons.next.addClass('btnDisabled'); - buttons.play.addClass('btnDisabled'); - } - - this.buttons = buttons; - - this.onUpdate(opts, obj); - }, - - onUpdate: function (opts, obj) { - var toggle; - - if (!this.buttons) { - return; - } - - toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); - - //Size toggle button - if (obj.canShrink) { - toggle.addClass('btnToggleOn'); - - } else if (!obj.canExpand) { - toggle.addClass('btnDisabled'); - } - }, - - beforeClose: function () { - if (this.list) { - this.list.remove(); - } - - this.list = null; - this.buttons = null; - } - }; - -}(jQuery)); \ No newline at end of file diff --git a/resources/fancybox/helpers/jquery.fancybox-media.js b/resources/fancybox/helpers/jquery.fancybox-media.js deleted file mode 100644 index 4b5e783..0000000 --- a/resources/fancybox/helpers/jquery.fancybox-media.js +++ /dev/null @@ -1,196 +0,0 @@ -/*! - * Media helper for fancyBox - * version: 1.0.5 (Tue, 23 Oct 2012) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * media: true - * } - * }); - * - * Set custom URL parameters: - * $(".fancybox").fancybox({ - * helpers : { - * media: { - * youtube : { - * params : { - * autoplay : 0 - * } - * } - * } - * } - * }); - * - * Or: - * $(".fancybox").fancybox({, - * helpers : { - * media: true - * }, - * youtube : { - * autoplay: 0 - * } - * }); - * - * Supports: - * - * Youtube - * http://www.youtube.com/watch?v=opj24KnzrWo - * http://www.youtube.com/embed/opj24KnzrWo - * http://youtu.be/opj24KnzrWo - * Vimeo - * http://vimeo.com/40648169 - * http://vimeo.com/channels/staffpicks/38843628 - * http://vimeo.com/groups/surrealism/videos/36516384 - * http://player.vimeo.com/video/45074303 - * Metacafe - * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ - * http://www.metacafe.com/watch/7635964/ - * Dailymotion - * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people - * Twitvid - * http://twitvid.com/QY7MD - * Twitpic - * http://twitpic.com/7p93st - * Instagram - * http://instagr.am/p/IejkuUGxQn/ - * http://instagram.com/p/IejkuUGxQn/ - * Google maps - * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 - * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 - * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 - */ -(function ($) { - "use strict"; - - //Shortcut for fancyBox object - var F = $.fancybox, - format = function( url, rez, params ) { - params = params || ''; - - if ( $.type( params ) === "object" ) { - params = $.param(params, true); - } - - $.each(rez, function(key, value) { - url = url.replace( '$' + key, value || '' ); - }); - - if (params.length) { - url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; - } - - return url; - }; - - //Add helper object - F.helpers.media = { - defaults : { - youtube : { - matcher : /(youtube\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, - params : { - autoplay : 1, - autohide : 1, - fs : 1, - rel : 0, - hd : 1, - wmode : 'opaque', - enablejsapi : 1 - }, - type : 'iframe', - url : '//www.youtube.com/embed/$3' - }, - vimeo : { - matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, - params : { - autoplay : 1, - hd : 1, - show_title : 1, - show_byline : 1, - show_portrait : 0, - fullscreen : 1 - }, - type : 'iframe', - url : '//player.vimeo.com/video/$1' - }, - metacafe : { - matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, - params : { - autoPlay : 'yes' - }, - type : 'swf', - url : function( rez, params, obj ) { - obj.swf.flashVars = 'playerVars=' + $.param( params, true ); - - return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; - } - }, - dailymotion : { - matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, - params : { - additionalInfos : 0, - autoStart : 1 - }, - type : 'swf', - url : '//www.dailymotion.com/swf/video/$1' - }, - twitvid : { - matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, - params : { - autoplay : 0 - }, - type : 'iframe', - url : '//www.twitvid.com/embed.php?guid=$1' - }, - twitpic : { - matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, - type : 'image', - url : '//twitpic.com/show/full/$1/' - }, - instagram : { - matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, - type : 'image', - url : '//$1/p/$2/media/' - }, - google_maps : { - matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, - type : 'iframe', - url : function( rez ) { - return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); - } - } - }, - - beforeLoad : function(opts, obj) { - var url = obj.href || '', - type = false, - what, - item, - rez, - params; - - for (what in opts) { - item = opts[ what ]; - rez = url.match( item.matcher ); - - if (rez) { - type = item.type; - params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); - - url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); - - break; - } - } - - if (type) { - obj.href = url; - obj.type = type; - - obj.autoHeight = false; - } - } - }; - -}(jQuery)); \ No newline at end of file diff --git a/resources/fancybox/helpers/jquery.fancybox-thumbs.css b/resources/fancybox/helpers/jquery.fancybox-thumbs.css deleted file mode 100644 index e40ae82..0000000 --- a/resources/fancybox/helpers/jquery.fancybox-thumbs.css +++ /dev/null @@ -1,54 +0,0 @@ -#fancybox-thumbs { - position: fixed; - left: 0; - width: 100%; - overflow: hidden; - z-index: 8050; -} - -#fancybox-thumbs.bottom { - bottom: 2px; -} - -#fancybox-thumbs.top { - top: 2px; -} - -#fancybox-thumbs ul { - position: relative; - list-style: none; - margin: 0; - padding: 0; -} - -#fancybox-thumbs ul li { - float: left; - padding: 1px; - opacity: 0.5; -} - -#fancybox-thumbs ul li.active { - opacity: 0.75; - padding: 0; - border: 1px solid #fff; -} - -#fancybox-thumbs ul li:hover { - opacity: 1; -} - -#fancybox-thumbs ul li a { - display: block; - position: relative; - overflow: hidden; - border: 1px solid #222; - background: #111; - outline: none; -} - -#fancybox-thumbs ul li img { - display: block; - position: relative; - border: 0; - padding: 0; -} \ No newline at end of file diff --git a/resources/fancybox/helpers/jquery.fancybox-thumbs.js b/resources/fancybox/helpers/jquery.fancybox-thumbs.js deleted file mode 100644 index 5db3d4a..0000000 --- a/resources/fancybox/helpers/jquery.fancybox-thumbs.js +++ /dev/null @@ -1,162 +0,0 @@ - /*! - * Thumbnail helper for fancyBox - * version: 1.0.7 (Mon, 01 Oct 2012) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * thumbs: { - * width : 50, - * height : 50 - * } - * } - * }); - * - */ -(function ($) { - //Shortcut for fancyBox object - var F = $.fancybox; - - //Add helper object - F.helpers.thumbs = { - defaults : { - width : 50, // thumbnail width - height : 50, // thumbnail height - position : 'bottom', // 'top' or 'bottom' - source : function ( item ) { // function to obtain the URL of the thumbnail image - var href; - - if (item.element) { - href = $(item.element).find('img').attr('src'); - } - - if (!href && item.type === 'image' && item.href) { - href = item.href; - } - - return href; - } - }, - - wrap : null, - list : null, - width : 0, - - init: function (opts, obj) { - var that = this, - list, - thumbWidth = opts.width, - thumbHeight = opts.height, - thumbSource = opts.source; - - //Build list structure - list = ''; - - for (var n = 0; n < obj.group.length; n++) { - list += '
  • '; - } - - this.wrap = $('
    ').addClass(opts.position).appendTo('body'); - this.list = $('
      ' + list + '
    ').appendTo(this.wrap); - - //Load each thumbnail - $.each(obj.group, function (i) { - var href = thumbSource( obj.group[ i ] ); - - if (!href) { - return; - } - - $("").load(function () { - var width = this.width, - height = this.height, - widthRatio, heightRatio, parent; - - if (!that.list || !width || !height) { - return; - } - - //Calculate thumbnail width/height and center it - widthRatio = width / thumbWidth; - heightRatio = height / thumbHeight; - - parent = that.list.children().eq(i).find('a'); - - if (widthRatio >= 1 && heightRatio >= 1) { - if (widthRatio > heightRatio) { - width = Math.floor(width / heightRatio); - height = thumbHeight; - - } else { - width = thumbWidth; - height = Math.floor(height / widthRatio); - } - } - - $(this).css({ - width : width, - height : height, - top : Math.floor(thumbHeight / 2 - height / 2), - left : Math.floor(thumbWidth / 2 - width / 2) - }); - - parent.width(thumbWidth).height(thumbHeight); - - $(this).hide().appendTo(parent).fadeIn(300); - - }).attr('src', href); - }); - - //Set initial width - this.width = this.list.children().eq(0).outerWidth(true); - - this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); - }, - - beforeLoad: function (opts, obj) { - //Remove self if gallery do not have at least two items - if (obj.group.length < 2) { - obj.helpers.thumbs = false; - - return; - } - - //Increase bottom margin to give space for thumbs - obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); - }, - - afterShow: function (opts, obj) { - //Check if exists and create or update list - if (this.list) { - this.onUpdate(opts, obj); - - } else { - this.init(opts, obj); - } - - //Set active element - this.list.children().removeClass('active').eq(obj.index).addClass('active'); - }, - - //Center list - onUpdate: function (opts, obj) { - if (this.list) { - this.list.stop(true).animate({ - 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) - }, 150); - } - }, - - beforeClose: function () { - if (this.wrap) { - this.wrap.remove(); - } - - this.wrap = null; - this.list = null; - this.width = 0; - } - } - -}(jQuery)); \ No newline at end of file diff --git a/resources/fancybox/jquery.fancybox.css b/resources/fancybox/jquery.fancybox.css deleted file mode 100644 index bd3289b..0000000 --- a/resources/fancybox/jquery.fancybox.css +++ /dev/null @@ -1,249 +0,0 @@ -/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */ -.fancybox-wrap, -.fancybox-skin, -.fancybox-outer, -.fancybox-inner, -.fancybox-image, -.fancybox-wrap iframe, -.fancybox-wrap object, -.fancybox-nav, -.fancybox-nav span, -.fancybox-tmp -{ - padding: 0; - margin: 0; - border: 0; - outline: none; - vertical-align: top; -} - -.fancybox-wrap { - position: absolute; - top: 0; - left: 0; - z-index: 8020; -} - -.fancybox-skin { - position: relative; - background: #f9f9f9; - color: #444; - text-shadow: none; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.fancybox-opened { - z-index: 8030; -} - -.fancybox-opened .fancybox-skin { - -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); - box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); -} - -.fancybox-outer, .fancybox-inner { - position: relative; -} - -.fancybox-inner { - overflow: hidden; -} - -.fancybox-type-iframe .fancybox-inner { - -webkit-overflow-scrolling: touch; -} - -.fancybox-error { - color: #444; - font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; - margin: 0; - padding: 15px; - white-space: nowrap; -} - -.fancybox-image, .fancybox-iframe { - display: block; - width: 100%; - height: 100%; -} - -.fancybox-image { - max-width: 100%; - max-height: 100%; -} - -#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { - background-image: url('fancybox_sprite.png'); -} - -#fancybox-loading { - position: fixed; - top: 50%; - left: 50%; - margin-top: -22px; - margin-left: -22px; - background-position: 0 -108px; - opacity: 0.8; - cursor: pointer; - z-index: 8060; -} - -#fancybox-loading div { - width: 44px; - height: 44px; - background: url('fancybox_loading.gif') center center no-repeat; -} - -.fancybox-close { - position: absolute; - top: -18px; - right: -18px; - width: 36px; - height: 36px; - cursor: pointer; - z-index: 8040; -} - -.fancybox-nav { - position: absolute; - top: 0; - width: 40%; - height: 100%; - cursor: pointer; - text-decoration: none; - background: transparent url('blank.gif'); /* helps IE */ - -webkit-tap-highlight-color: rgba(0,0,0,0); - z-index: 8040; -} - -.fancybox-prev { - left: 0; -} - -.fancybox-next { - right: 0; -} - -.fancybox-nav span { - position: absolute; - top: 50%; - width: 36px; - height: 34px; - margin-top: -18px; - cursor: pointer; - z-index: 8040; - visibility: hidden; -} - -.fancybox-prev span { - left: 10px; - background-position: 0 -36px; -} - -.fancybox-next span { - right: 10px; - background-position: 0 -72px; -} - -.fancybox-nav:hover span { - visibility: visible; -} - -.fancybox-tmp { - position: absolute; - top: -99999px; - left: -99999px; - visibility: hidden; - max-width: 99999px; - max-height: 99999px; - overflow: visible !important; -} - -/* Overlay helper */ - -.fancybox-lock { - overflow: hidden; -} - -.fancybox-overlay { - position: absolute; - top: 0; - left: 0; - overflow: hidden; - display: none; - z-index: 8010; - background: url('fancybox_overlay.png'); -} - -.fancybox-overlay-fixed { - position: fixed; - bottom: 0; - right: 0; -} - -.fancybox-lock .fancybox-overlay { - overflow: auto; - overflow-y: scroll; -} - -/* Title helper */ - -.fancybox-title { - visibility: hidden; - font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; - position: relative; - text-shadow: none; - z-index: 8050; -} - -.fancybox-opened .fancybox-title { - visibility: visible; -} - -.fancybox-title-float-wrap { - position: absolute; - bottom: 0; - right: 50%; - margin-bottom: -35px; - z-index: 8050; - text-align: center; -} - -.fancybox-title-float-wrap .child { - display: inline-block; - margin-right: -100%; - padding: 2px 20px; - background: transparent; /* Fallback for web browsers that doesn't support RGBa */ - background: rgba(0, 0, 0, 0.8); - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; - text-shadow: 0 1px 2px #222; - color: #FFF; - font-weight: bold; - line-height: 24px; - white-space: nowrap; -} - -.fancybox-title-outside-wrap { - position: relative; - margin-top: 10px; - color: #fff; -} - -.fancybox-title-inside-wrap { - padding-top: 10px; -} - -.fancybox-title-over-wrap { - position: absolute; - bottom: 0; - left: 0; - color: #fff; - padding: 10px; - background: #000; - background: rgba(0, 0, 0, .8); -} \ No newline at end of file diff --git a/resources/fancybox/jquery.fancybox.pack.js b/resources/fancybox/jquery.fancybox.pack.js deleted file mode 100644 index 6ef73d9..0000000 --- a/resources/fancybox/jquery.fancybox.pack.js +++ /dev/null @@ -1 +0,0 @@ -(function(l,o,i,e){var d=i(l),a=i(o),p=i.fancybox=function(){p.open.apply(this,arguments)},k=navigator.userAgent.match(/msie/i),c=null,f=o.createTouch!==e,j=function(q){return q&&q.hasOwnProperty&&q instanceof i},b=function(q){return q&&i.type(q)==="string"},m=function(q){return b(q)&&q.indexOf("%")>0},h=function(q){return(q&&!(q.style.overflow&&q.style.overflow==="hidden")&&((q.clientWidth&&q.scrollWidth>q.clientWidth)||(q.clientHeight&&q.scrollHeight>q.clientHeight)))},n=function(s,r){var q=parseInt(s,10)||0;if(r&&m(s)){q=p.getViewport()[r]/100*q}return Math.ceil(q)},g=function(q,r){return n(q,r)+"px"};i.extend(p,{version:"2.1.4",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:true,autoHeight:false,autoWidth:false,autoResize:true,autoCenter:!f,fitToView:true,aspectRatio:false,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:true,closeBtn:true,closeClick:false,nextClick:false,mouseWheel:true,autoPlay:false,playSpeed:3000,preload:3,modal:false,loop:true,ajax:{dataType:"html",headers:{"X-fancyBox":true}},iframe:{scrolling:"auto",preload:true},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:true,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:true,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:true,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:true,title:true},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:false,isOpen:false,isOpened:false,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:false},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(r,q){if(!r){return}if(!i.isPlainObject(q)){q={}}if(false===p.close(true)){return}if(!i.isArray(r)){r=j(r)?i(r).get():[r]}i.each(r,function(w,x){var v={},s,A,y,z,u,B,t;if(i.type(x)==="object"){if(x.nodeType){x=i(x)}if(j(x)){v={href:x.data("fancybox-href")||x.attr("href"),title:x.data("fancybox-title")||x.attr("title"),isDom:true,element:x};if(i.metadata){i.extend(true,v,x.metadata())}}else{v=x}}s=q.href||v.href||(b(x)?x:null);A=q.title!==e?q.title:v.title||"";y=q.content||v.content;z=y?"html":(q.type||v.type);if(!z&&v.isDom){z=x.data("fancybox-type");if(!z){u=x.prop("class").match(/fancybox\.(\w+)/);z=u?u[1]:null}}if(b(s)){if(!z){if(p.isImage(s)){z="image"}else{if(p.isSWF(s)){z="swf"}else{if(s.charAt(0)==="#"){z="inline"}else{if(b(x)){z="html";y=x}}}}}if(z==="ajax"){B=s.split(/\s+/,2);s=B.shift();t=B.shift()}}if(!y){if(z==="inline"){if(s){y=i(b(s)?s.replace(/.*(?=#[^\s]+$)/,""):s)}else{if(v.isDom){y=x}}}else{if(z==="html"){y=s}else{if(!z&&!s&&v.isDom){z="inline";y=x}}}}i.extend(v,{href:s,type:z,content:y,title:A,selector:t});r[w]=v});p.opts=i.extend(true,{},p.defaults,q);if(q.keys!==e){p.opts.keys=q.keys?i.extend({},p.defaults.keys,q.keys):false}p.group=r;return p._start(p.opts.index)},cancel:function(){var q=p.coming;if(!q||false===p.trigger("onCancel")){return}p.hideLoading();if(p.ajaxLoad){p.ajaxLoad.abort()}p.ajaxLoad=null;if(p.imgPreload){p.imgPreload.onload=p.imgPreload.onerror=null}if(q.wrap){q.wrap.stop(true,true).trigger("onReset").remove()}p.coming=null;if(!p.current){p._afterZoomOut(q)}},close:function(q){p.cancel();if(false===p.trigger("beforeClose")){return}p.unbindEvents();if(!p.isActive){return}if(!p.isOpen||q===true){i(".fancybox-wrap").stop(true).trigger("onReset").remove();p._afterZoomOut()}else{p.isOpen=p.isOpened=false;p.isClosing=true;i(".fancybox-item, .fancybox-nav").remove();p.wrap.stop(true,true).removeClass("fancybox-opened");p.transitions[p.current.closeMethod]()}},play:function(s){var q=function(){clearTimeout(p.player.timer)},u=function(){q();if(p.current&&p.player.isActive){p.player.timer=setTimeout(p.next,p.current.playSpeed)}},r=function(){q();a.unbind(".player");p.player.isActive=false;p.trigger("onPlayEnd")},t=function(){if(p.current&&(p.current.loop||p.current.index=s.index?"next":"prev")];p.router=q||"jumpto";if(s.loop){if(r<0){r=s.group.length+(r%s.group.length)}r=r%s.group.length}if(s.group[r]!==e){p.cancel();p._start(r)}},reposition:function(t,q){var s=p.current,r=s?s.wrap:null,u;if(r){u=p._getPosition(q);if(t&&t.type==="scroll"){delete u.position;r.stop(true,true).animate(u,200)}else{r.css(u);s.pos=i.extend({},s.dim,u)}}},update:function(s){var q=(s&&s.type),r=!q||q==="orientationchange";if(r){clearTimeout(c);c=null}if(!p.isOpen||c){return}c=setTimeout(function(){var t=p.current;if(!t||p.isClosing){return}p.wrap.removeClass("fancybox-tmp");if(r||q==="load"||(q==="resize"&&t.autoResize)){p._setDimension()}if(!(q==="scroll"&&t.canShrink)){p.reposition(s)}p.trigger("onUpdate");c=null},(r&&!f?0:300))},toggle:function(q){if(p.isOpen){p.current.fitToView=i.type(q)==="boolean"?q:!p.current.fitToView;if(f){p.wrap.removeAttr("style").addClass("fancybox-tmp");p.trigger("onUpdate")}p.update()}},hideLoading:function(){a.unbind(".loading");i("#fancybox-loading").remove()},showLoading:function(){var r,q;p.hideLoading();r=i('
    ').click(p.cancel).appendTo("body");a.bind("keydown.loading",function(s){if((s.which||s.keyCode)===27){s.preventDefault();p.cancel()}});if(!p.defaults.fixed){q=p.getViewport();r.css({position:"absolute",top:(q.h*0.5)+q.y,left:(q.w*0.5)+q.x})}},getViewport:function(){var q=(p.current&&p.current.locked)||false,r={x:d.scrollLeft(),y:d.scrollTop()};if(q){r.w=q[0].clientWidth;r.h=q[0].clientHeight}else{r.w=f&&l.innerWidth?l.innerWidth:d.width();r.h=f&&l.innerHeight?l.innerHeight:d.height()}return r},unbindEvents:function(){if(p.wrap&&j(p.wrap)){p.wrap.unbind(".fb")}a.unbind(".fb");d.unbind(".fb")},bindEvents:function(){var r=p.current,q;if(!r){return}d.bind("orientationchange.fb"+(f?"":" resize.fb")+(r.autoCenter&&!r.locked?" scroll.fb":""),p.update);q=r.keys;if(q){a.bind("keydown.fb",function(u){var s=u.which||u.keyCode,t=u.target||u.srcElement;if(s===27&&p.coming){return false}if(!u.ctrlKey&&!u.altKey&&!u.shiftKey&&!u.metaKey&&!(t&&(t.type||i(t).is("[contenteditable]")))){i.each(q,function(v,w){if(r.group.length>1&&w[s]!==e){p[v](w[s]);u.preventDefault();return false}if(i.inArray(s,w)>-1){p[v]();u.preventDefault();return false}})}})}if(i.fn.mousewheel&&r.mouseWheel){p.wrap.bind("mousewheel.fb",function(x,y,t,s){var w=x.target||null,u=i(w),v=false;while(u.length){if(v||u.is(".fancybox-skin")||u.is(".fancybox-wrap")){break}v=h(u[0]);u=i(u).parent()}if(y!==0&&!v){if(p.group.length>1&&!r.canShrink){if(s>0||t>0){p.prev(s>0?"down":"left")}else{if(s<0||t<0){p.next(s<0?"up":"right")}}x.preventDefault()}}})}},trigger:function(r,t){var q,s=t||p.coming||p.current;if(!s){return}if(i.isFunction(s[r])){q=s[r].apply(s,Array.prototype.slice.call(arguments,1))}if(q===false){return false}if(s.helpers){i.each(s.helpers,function(v,u){if(u&&p.helpers[v]&&i.isFunction(p.helpers[v][r])){u=i.extend(true,{},p.helpers[v].defaults,u);p.helpers[v][r](u,s)}})}a.trigger(r)},isImage:function(q){return b(q)&&q.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(q){return b(q)&&q.match(/\.(swf)((\?|#).*)?$/i)},_start:function(r){var s={},w,q,t,u,v;r=n(r);w=p.group[r]||null;if(!w){return false}s=i.extend(true,{},p.opts,w);u=s.margin;v=s.padding;if(i.type(u)==="number"){s.margin=[u,u,u,u]}if(i.type(v)==="number"){s.padding=[v,v,v,v]}if(s.modal){i.extend(true,s,{closeBtn:false,closeClick:false,nextClick:false,arrows:false,mouseWheel:false,keys:null,helpers:{overlay:{closeClick:false}}})}if(s.autoSize){s.autoWidth=s.autoHeight=true}if(s.width==="auto"){s.autoWidth=true}if(s.height==="auto"){s.autoHeight=true}s.group=p.group;s.index=r;p.coming=s;if(false===p.trigger("beforeLoad")){p.coming=null;return}t=s.type;q=s.href;if(!t){p.coming=null;if(p.current&&p.router&&p.router!=="jumpto"){p.current.index=r;return p[p.router](p.direction)}return false}p.isActive=true;if(t==="image"||t==="swf"){s.autoHeight=s.autoWidth=false;s.scrolling="visible"}if(t==="image"){s.aspectRatio=true}if(t==="iframe"&&f){s.scrolling="scroll"}s.wrap=i(s.tpl.wrap).addClass("fancybox-"+(f?"mobile":"desktop")+" fancybox-type-"+t+" fancybox-tmp "+s.wrapCSS).appendTo(s.parent||"body");i.extend(s,{skin:i(".fancybox-skin",s.wrap),outer:i(".fancybox-outer",s.wrap),inner:i(".fancybox-inner",s.wrap)});i.each(["Top","Right","Bottom","Left"],function(y,x){s.skin.css("padding"+x,g(s.padding[y]))});p.trigger("onReady");if(t==="inline"||t==="html"){if(!s.content||!s.content.length){return p._error("content")}}else{if(!q){return p._error("href")}}if(t==="image"){p._loadImage()}else{if(t==="ajax"){p._loadAjax()}else{if(t==="iframe"){p._loadIframe()}else{p._afterLoad()}}}},_error:function(q){i.extend(p.coming,{type:"html",autoWidth:true,autoHeight:true,minWidth:0,minHeight:0,scrolling:"no",hasError:q,content:p.coming.tpl.error});p._afterLoad()},_loadImage:function(){var q=p.imgPreload=new Image();q.onload=function(){this.onload=this.onerror=null;p.coming.width=this.width;p.coming.height=this.height;p._afterLoad()};q.onerror=function(){this.onload=this.onerror=null;p._error("image")};q.src=p.coming.href;if(q.complete!==true){p.showLoading()}},_loadAjax:function(){var q=p.coming;p.showLoading();p.ajaxLoad=i.ajax(i.extend({},q.ajax,{url:q.href,error:function(r,s){if(p.coming&&s!=="abort"){p._error("ajax",r)}else{p.hideLoading()}},success:function(r,s){if(s==="success"){q.content=r;p._afterLoad()}}}))},_loadIframe:function(){var q=p.coming,r=i(q.tpl.iframe.replace(/\{rnd\}/g,new Date().getTime())).attr("scrolling",f?"auto":q.iframe.scrolling).attr("src",q.href);i(q.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(s){}});if(q.iframe.preload){p.showLoading();r.one("load",function(){i(this).data("ready",1);if(!f){i(this).bind("load.fb",p.update)}i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();p._afterLoad()})}q.content=r.appendTo(q.inner);if(!q.iframe.preload){p._afterLoad()}},_preloadImages:function(){var v=p.group,u=p.current,q=v.length,s=u.preload?Math.min(u.preload,q-1):0,t,r;for(r=1;r<=s;r+=1){t=v[(u.index+r)%q];if(t.type==="image"&&t.href){new Image().src=t.href}}},_afterLoad:function(){var r=p.coming,t=p.current,y="fancybox-placeholder",v,w,x,s,q,u;p.hideLoading();if(!r||p.isActive===false){return}if(false===p.trigger("afterLoad",r,t)){r.wrap.stop(true).trigger("onReset").remove();p.coming=null;return}if(t){p.trigger("beforeChange",t);t.wrap.stop(true).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()}p.unbindEvents();v=r;w=r.content;x=r.type;s=r.scrolling;i.extend(p,{wrap:v.wrap,skin:v.skin,outer:v.outer,inner:v.inner,current:v,previous:t});q=v.href;switch(x){case"inline":case"ajax":case"html":if(v.selector){w=i("
    ").html(w).find(v.selector)}else{if(j(w)){if(!w.data(y)){w.data(y,i('
    ').insertAfter(w).hide())}w=w.show().detach();v.wrap.bind("onReset",function(){if(i(this).find(w).length){w.hide().replaceAll(w.data(y)).data(y,false)}})}}break;case"image":w=v.tpl.image.replace("{href}",q).replace("&","&");break;case"swf":w='';u="";i.each(v.swf,function(z,A){w+='';u+=" "+z+'="'+A+'"'});w+='";break}if(!(j(w)&&w.parent().is(v.inner))){v.inner.append(w)}p.trigger("beforeShow");v.inner.css("overflow",s==="yes"?"scroll":(s==="no"?"hidden":s));p._setDimension();p.reposition();p.isOpen=false;p.coming=null;p.bindEvents();if(!p.isOpened){i(".fancybox-wrap").not(v.wrap).stop(true).trigger("onReset").remove()}else{if(t.prevMethod){p.transitions[t.prevMethod]()}}p.transitions[p.isOpened?v.nextMethod:v.openMethod]();p._preloadImages()},_setDimension:function(){var T=p.getViewport(),P=0,V=false,X=false,B=p.wrap,N=p.skin,Y=p.inner,K=p.current,L=K.width,I=K.height,E=K.minWidth,x=K.minHeight,R=K.maxWidth,J=K.maxHeight,D=K.scrolling,v=K.scrollOutside?K.scrollbarWidth:0,H=K.margin,w=n(H[1]+H[3]),u=n(H[0]+H[2]),s,r,O,Q,G,F,M,z,y,U,t,W,q,A,C;B.add(N).add(Y).width("auto").height("auto").removeClass("fancybox-tmp");s=n(N.outerWidth(true)-N.width());r=n(N.outerHeight(true)-N.height());O=w+s;Q=u+r;G=m(L)?(T.w-O)*n(L)/100:L;F=m(I)?(T.h-Q)*n(I)/100:I;if(K.type==="iframe"){A=K.content;if(K.autoHeight&&A.data("ready")===1){try{if(A[0].contentWindow.document.location){Y.width(G).height(9999);C=A.contents().find("body");if(v){C.css("overflow-x","hidden")}F=C.height()}}catch(S){}}}else{if(K.autoWidth||K.autoHeight){Y.addClass("fancybox-tmp");if(!K.autoWidth){Y.width(G)}if(!K.autoHeight){Y.height(F)}if(K.autoWidth){G=Y.width()}if(K.autoHeight){F=Y.height()}Y.removeClass("fancybox-tmp")}}L=n(G);I=n(F);y=G/F;E=n(m(E)?n(E,"w")-O:E);R=n(m(R)?n(R,"w")-O:R);x=n(m(x)?n(x,"h")-Q:x);J=n(m(J)?n(J,"h")-Q:J);M=R;z=J;if(K.fitToView){R=Math.min(T.w-O,R);J=Math.min(T.h-Q,J)}W=T.w-w;q=T.h-u;if(K.aspectRatio){if(L>R){L=R;I=n(L/y)}if(I>J){I=J;L=n(I*y)}if(LW||t>q)&&L>E&&I>x){if(P++>19){break}I=Math.max(x,Math.min(J,I-10));L=n(I*y);if(LR){L=R;I=n(L/y)}Y.width(L).height(I);B.width(L+s);U=B.width();t=B.height()}}else{L=Math.max(E,Math.min(L,L-(U-W)));I=Math.max(x,Math.min(I,I-(t-q)))}}if(v&&D==="auto"&&IW||t>q)&&L>E&&I>x;X=K.aspectRatio?(Lx&&I1)){p.inner.css("cursor","pointer").bind("click.fb",function(r){if(!i(r.target).is("a")&&!i(r.target).parent().is("a")){r.preventDefault();p[q.closeClick?"close":"next"]()}})}if(q.closeBtn){i(q.tpl.closeBtn).appendTo(p.skin).bind("click.fb",function(r){r.preventDefault();p.close()})}if(q.arrows&&p.group.length>1){if(q.loop||q.index>0){i(q.tpl.prev).appendTo(p.outer).bind("click.fb",p.prev)}if(q.loop||q.index
    ').appendTo("body");this.fixed=false;if(q.fixed&&p.defaults.fixed){this.overlay.addClass("fancybox-overlay-fixed");this.fixed=true}},open:function(r){var q=this;r=i.extend({},this.defaults,r);if(this.overlay){this.overlay.unbind(".overlay").width("auto").height("auto")}else{this.create(r)}if(!this.fixed){d.bind("resize.overlay",i.proxy(this.update,this));this.update()}if(r.closeClick){this.overlay.bind("click.overlay",function(s){if(i(s.target).hasClass("fancybox-overlay")){if(p.isActive){p.close()}else{q.close()}}})}this.overlay.css(r.css).show()},close:function(){i(".fancybox-overlay").remove();d.unbind("resize.overlay");this.overlay=null;if(this.margin!==false){i("body").css("margin-right",this.margin);this.margin=false}if(this.el){this.el.removeClass("fancybox-lock")}},update:function(){var r="100%",q;this.overlay.width(r).height("100%");if(k){q=Math.max(o.documentElement.offsetWidth,o.body.offsetWidth);if(a.width()>q){r=a.width()}}else{if(a.width()>d.width()){r=a.width()}}this.overlay.width(r).height(a.height())},onReady:function(q,r){i(".fancybox-overlay").stop(true,true);if(!this.overlay){this.margin=a.height()>d.height()||i("body").css("overflow-y")==="scroll"?i("body").css("margin-right"):false;this.el=o.all&&!o.querySelector?i("html"):i("body");this.create(q)}if(q.locked&&this.fixed){r.locked=this.overlay.append(r.wrap);r.fixed=false}if(q.showEarly===true){this.beforeShow.apply(this,arguments)}},beforeShow:function(q,r){if(r.locked){this.el.addClass("fancybox-lock");if(this.margin!==false){i("body").css("margin-right",n(this.margin)+r.scrollbarWidth)}}this.open(q)},onUpdate:function(){if(!this.fixed){this.update()}},afterClose:function(q){if(this.overlay&&!p.isActive){this.overlay.fadeOut(q.speedOut,i.proxy(this.close,this))}}};p.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(r){var t=p.current,v=t.title,q=r.type,u,s;if(i.isFunction(v)){v=v.call(t.element,t)}if(!b(v)||i.trim(v)===""){return}u=i('
    '+v+"
    ");switch(q){case"inside":s=p.skin;break;case"outside":s=p.wrap;break;case"over":s=p.inner;break;default:s=p.skin;u.appendTo("body");if(k){u.width(u.width())}u.wrapInner('');p.current.margin[2]+=Math.abs(n(u.css("margin-bottom")));break}u[(r.position==="top"?"prependTo":"appendTo")](s)}};i.fn.fancybox=function(s){var r,t=i(this),q=this.selector||"",u=function(y){var x=i(this).blur(),v=r,w,z;if(!(y.ctrlKey||y.altKey||y.shiftKey||y.metaKey)&&!x.is(".fancybox-wrap")){w=s.groupAttr||"data-fancybox-group";z=x.attr(w);if(!z){w="rel";z=x.get(0)[w]}if(z&&z!==""&&z!=="nofollow"){x=q.length?i(q):t;x=x.filter("["+w+'="'+z+'"]');v=x.index(this)}s.index=v;if(p.open(x,s)!==false){y.preventDefault()}}};s=s||{};r=s.index||0;if(!q||s.live===false){t.unbind("click.fb-start").bind("click.fb-start",u)}else{a.undelegate(q,"click.fb-start").delegate(q+":not('.fancybox-item, .fancybox-nav')","click.fb-start",u)}this.filter("[data-fancybox-start=1]").trigger("click");return this};a.ready(function(){if(i.scrollbarWidth===e){i.scrollbarWidth=function(){var r=i('
    ').appendTo("body"),s=r.children(),q=s.innerWidth()-s.height(99).innerWidth();r.remove();return q}}if(i.support.fixedPosition===e){i.support.fixedPosition=(function(){var r=i('
    ').appendTo("body"),q=(r[0].offsetTop===20||r[0].offsetTop===15);r.remove();return q}())}i.extend(p.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")})})}(window,document,jQuery)); \ No newline at end of file diff --git a/styles/style-default.css b/styles/style-default.css index 1fe2da5..6875370 100644 --- a/styles/style-default.css +++ b/styles/style-default.css @@ -46,6 +46,16 @@ a:hover { color:#000; text-decoration: none; } .books:hover { width: 100%; background-color: #778899; } .link a:hover { display:inline-block; width: 100%; background-color: #778899; /*Dirty IE Hack*/ zoom: 1; *display: inline;} +.mfp-content .bookpopup { + position: relative; + background: #FFF; + padding: 20px; + width: auto; + max-width: 700px; + margin: 20px auto; +} + + img { margin:0; From 8833ff06eafccce166cea5b7b244f968c87bb45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 25 Jun 2013 08:53:38 +0200 Subject: [PATCH 41/41] Forgot one file. re #73 --- util.js | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/util.js b/util.js index 79302af..2cf520f 100644 --- a/util.js +++ b/util.js @@ -35,19 +35,6 @@ function sendToMailAddress (component, dataid) { $.ajax ({url: url, type: 'post', data: { data: dataid, email: email }, success: retourMail}); } - -function fancyBoxObject (title, type) { - var out = { prevEffect : 'none', nextEffect : 'none' }; - if (isEink) { - out ["openEffect"] = 'none'; - out ["closeEffect"] = 'none'; - out ["helper"] = { overlay : null }; - } - if (title) out ["title"] = title; - if (type) out ["type"] = type; - return out; -} - function strformat () { var s = arguments[0]; for (var i = 0; i < arguments.length - 1; i++) { @@ -154,16 +141,27 @@ function updatePage (data) { $.getJSON(jsonurl, function(data) { data ["const"] = currentData ["const"]; var detail = templateBookDetail (data); - var fancyparams = fancyBoxObject (data.title, null); - fancyparams ["content"] = detail; - $.fancybox(fancyparams); + $.magnificPopup.open({ + items: { + src: detail, + type: 'inline' + } + }); debug_log (elapsed ()); }); }); - $(".fancycover").fancybox(fancyBoxObject (null, 'image')); + + $('section').magnificPopup({ + delegate: '.fancycover', // child items selector, by clicking on it popup will open + type: 'image', + gallery:{enabled:true, preload: [0,2]} + // other options + }); + - $(".fancyabout").fancybox(fancyBoxObject ('COPS ' + currentData.const.version, 'ajax')); + + $('.fancyabout').magnificPopup({ type: 'ajax' }); } }