From 9e7fbdf6bf4f8d3de1abe5b4644ef3fc8f551cd9 Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Fri, 18 Apr 2014 16:51:33 +0200 Subject: [PATCH 01/16] Only fire equal heights js on screens larger than 640px. The equal heights boxes look weird on small screens, so we're not firing the plugin there any longer. This introduces a new variable for breakpoints for responsive JS. Please *only* add more breakpoints if you actually use them. References #100 --- .../2k11/admin/serendipity_editor.js.tpl | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index abf24415..bf30b0d0 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -826,6 +826,9 @@ var AccessifyHTML5 = function (defaults, more_fixes) { }(document, jQuery)); $(function() { + // Breakpoints for responsive JS + var mq_small = matchMedia("(min-width:640px)"); + // Fire responsive nav if($('#main_menu').length > 0) { $('#nav-toggle').click(function(e) { @@ -1327,15 +1330,17 @@ $(function() { // Equal Heights $(window).load(function() { - if($('.equal_heights').length > 0) { - if($('html').hasClass('lt-ie9')) { - $('.equal_heights').syncHeight({ - updateOnResize: false - }); - } else { - $('.equal_heights').syncHeight({ - updateOnResize: true - }); + if (mq_small.matches) { + if($('.equal_heights').length > 0) { + if($('html').hasClass('lt-ie9')) { + $('.equal_heights').syncHeight({ + updateOnResize: false + }); + } else { + $('.equal_heights').syncHeight({ + updateOnResize: true + }); + } } } }); From b6b6dfe01aa11c95602dfaa1a8b3bf31510da8fe Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Sun, 20 Apr 2014 13:05:25 +0200 Subject: [PATCH 02/16] Make button links always contain their text. References #99 --- templates/2k11/admin/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css index 87badeeb..7c100ca4 100644 --- a/templates/2k11/admin/style.css +++ b/templates/2k11/admin/style.css @@ -421,6 +421,7 @@ nav ol { /* BACKEND HELPER CLASSES */ .icon_link, +.button_link, #insert_image, form > a, form > button, @@ -441,7 +442,6 @@ form > button, #dashboard_entries .entry_status, .comment_status, .tabs > ul > li, -#maintenance > section > .button_link, .overviewListForm { display: inline-block; } From 49ce0681178c7b96505b211ae3c3d5f0e7637e52 Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Sun, 20 Apr 2014 13:30:28 +0200 Subject: [PATCH 03/16] Include customized Modernizr build; update Modernizr to latest. This build includes only the tests and shivs in Modernizr we do actually use. If we add tests (in CSS or JS) or find some are missing, this build needs to be renewed. References #85 --- templates/2k11/admin/index.tpl | 2 +- templates/2k11/admin/installer.inc.tpl | 2 +- templates/2k11/admin/js/modernizr-2.7.1.min.js | 4 ---- templates/2k11/admin/js/modernizr-2.7.2.min.js | 4 ++++ templates/2k11/admin/media_choose.tpl | 2 +- templates/2k11/admin/media_showitem.tpl | 2 +- templates/2k11/admin/upgrader.inc.tpl | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 templates/2k11/admin/js/modernizr-2.7.1.min.js create mode 100644 templates/2k11/admin/js/modernizr-2.7.2.min.js diff --git a/templates/2k11/admin/index.tpl b/templates/2k11/admin/index.tpl index 3f604b7b..d91c73bd 100644 --- a/templates/2k11/admin/index.tpl +++ b/templates/2k11/admin/index.tpl @@ -9,7 +9,7 @@ - + {if $admin_vars.admin_installed}{serendipity_hookPlugin hook="backend_header" hookAll="true"}{/if} diff --git a/templates/2k11/admin/installer.inc.tpl b/templates/2k11/admin/installer.inc.tpl index d5f0c49b..a0b92a3e 100644 --- a/templates/2k11/admin/installer.inc.tpl +++ b/templates/2k11/admin/installer.inc.tpl @@ -9,7 +9,7 @@ - + diff --git a/templates/2k11/admin/js/modernizr-2.7.1.min.js b/templates/2k11/admin/js/modernizr-2.7.1.min.js deleted file mode 100644 index f3052b01..00000000 --- a/templates/2k11/admin/js/modernizr-2.7.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Modernizr 2.7.1 (Custom Build) | MIT & BSD - * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes - */ -;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.flexboxlegacy=function(){return J("boxDirection")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document); \ No newline at end of file diff --git a/templates/2k11/admin/js/modernizr-2.7.2.min.js b/templates/2k11/admin/js/modernizr-2.7.2.min.js new file mode 100644 index 00000000..d3d28660 --- /dev/null +++ b/templates/2k11/admin/js/modernizr-2.7.2.min.js @@ -0,0 +1,4 @@ +/* Modernizr 2.7.2 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-touch-shiv-mq-cssclasses-teststyles-hasevent-prefixes + */ +;window.Modernizr=function(a,b,c){function y(a){j.cssText=a}function z(a,b){return y(m.join(a+";")+(b||""))}function A(a,b){return typeof a===b}function B(a,b){return!!~(""+a).indexOf(b)}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:A(f,"function")?f.bind(d||b):f}return!1}var d="2.7.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},u=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return t("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},v=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=A(e[d],"function"),A(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),w={}.hasOwnProperty,x;!A(w,"undefined")&&!A(w.call,"undefined")?x=function(a,b){return w.call(a,b)}:x=function(a,b){return b in a&&A(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:t(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var D in n)x(n,D)&&(s=D.toLowerCase(),e[s]=n[D](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)x(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},y(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e.mq=u,e.hasEvent=v,e.testStyles=t,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document); \ No newline at end of file diff --git a/templates/2k11/admin/media_choose.tpl b/templates/2k11/admin/media_choose.tpl index f17a7601..1e04c01e 100644 --- a/templates/2k11/admin/media_choose.tpl +++ b/templates/2k11/admin/media_choose.tpl @@ -7,7 +7,7 @@ {if $media.css}{/if} {if $media.css_tree}{/if} - + {serendipity_hookPlugin hook="backend_header" hookAll="true"} diff --git a/templates/2k11/admin/media_showitem.tpl b/templates/2k11/admin/media_showitem.tpl index 9ba75d2f..4bec5efa 100644 --- a/templates/2k11/admin/media_showitem.tpl +++ b/templates/2k11/admin/media_showitem.tpl @@ -7,7 +7,7 @@ - + {if $perm_denied} diff --git a/templates/2k11/admin/upgrader.inc.tpl b/templates/2k11/admin/upgrader.inc.tpl index fcafde5f..ffc64446 100644 --- a/templates/2k11/admin/upgrader.inc.tpl +++ b/templates/2k11/admin/upgrader.inc.tpl @@ -9,7 +9,7 @@ - + {if $admin_vars.admin_installed}{serendipity_hookPlugin hook="backend_header" hookAll="true"}{/if} From 6b8f893299c6c3293eb4655ea79e343d93864a78 Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Sun, 20 Apr 2014 14:00:44 +0200 Subject: [PATCH 04/16] Include updated, "customized" build of MagnificPopup. Also adds missing test to Modernizr build. References #85 --- .../2k11/admin/js/jquery.magnific-popup.js | 3082 +++++++---------- .../2k11/admin/js/modernizr-2.7.2.min.js | 4 +- templates/2k11/admin/style.css | 206 +- 3 files changed, 1421 insertions(+), 1871 deletions(-) diff --git a/templates/2k11/admin/js/jquery.magnific-popup.js b/templates/2k11/admin/js/jquery.magnific-popup.js index 37c89328..d3ca0fc4 100644 --- a/templates/2k11/admin/js/jquery.magnific-popup.js +++ b/templates/2k11/admin/js/jquery.magnific-popup.js @@ -1,4 +1,4 @@ -/*! Magnific Popup - v0.9.2 - 2013-07-05 +/*! Magnific Popup - v0.9.9 - 2013-12-27 * http://dimsemenov.com/plugins/magnific-popup/ * Copyright (c) 2013 Dmitry Semenov; */ ;(function($) { @@ -15,134 +15,99 @@ * Private static constants */ var CLOSE_EVENT = 'Close', - BEFORE_CLOSE_EVENT = 'BeforeClose', - AFTER_CLOSE_EVENT = 'AfterClose', - BEFORE_APPEND_EVENT = 'BeforeAppend', - MARKUP_PARSE_EVENT = 'MarkupParse', - OPEN_EVENT = 'Open', - CHANGE_EVENT = 'Change', - NS = 'mfp', - EVENT_NS = '.' + NS, - READY_CLASS = 'mfp-ready', - REMOVING_CLASS = 'mfp-removing', - PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; + BEFORE_CLOSE_EVENT = 'BeforeClose', + AFTER_CLOSE_EVENT = 'AfterClose', + BEFORE_APPEND_EVENT = 'BeforeAppend', + MARKUP_PARSE_EVENT = 'MarkupParse', + OPEN_EVENT = 'Open', + CHANGE_EVENT = 'Change', + NS = 'mfp', + EVENT_NS = '.' + NS, + READY_CLASS = 'mfp-ready', + REMOVING_CLASS = 'mfp-removing', + PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; /** * Private vars */ var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' - MagnificPopup = function(){}, - _isJQ = !!(window.jQuery), - _prevStatus, - _window = $(window), - _body, - _document, - _prevContentType, - _wrapClasses, - _currPopupType; + MagnificPopup = function(){}, + _isJQ = !!(window.jQuery), + _prevStatus, + _window = $(window), + _body, + _document, + _prevContentType, + _wrapClasses, + _currPopupType; /** * Private functions */ var _mfpOn = function(name, f) { - mfp.ev.on(NS + name + EVENT_NS, f); - }, - _getEl = function(className, appendTo, html, raw) { - var el = document.createElement('div'); - el.className = 'mfp-'+className; - if(html) { - el.innerHTML = html; - } - if(!raw) { - el = $(el); - if(appendTo) { - el.appendTo(appendTo); - } - } else if(appendTo) { - appendTo.appendChild(el); - } - return el; - }, - _mfpTrigger = function(e, data) { - mfp.ev.triggerHandler(NS + e, data); + mfp.ev.on(NS + name + EVENT_NS, f); + }, + _getEl = function(className, appendTo, html, raw) { + var el = document.createElement('div'); + el.className = 'mfp-'+className; + if(html) { + el.innerHTML = html; + } + if(!raw) { + el = $(el); + if(appendTo) { + el.appendTo(appendTo); + } + } else if(appendTo) { + appendTo.appendChild(el); + } + return el; + }, + _mfpTrigger = function(e, data) { + mfp.ev.triggerHandler(NS + e, data); - if(mfp.st.callbacks) { - // converts "mfpEventName" to "eventName" callback and triggers it if it's present - e = e.charAt(0).toLowerCase() + e.slice(1); - if(mfp.st.callbacks[e]) { - mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); - } - } - }, - _setFocus = function() { - (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).trigger('focus'); - }, - _getCloseBtn = function(type) { - if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { - mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); - _currPopupType = type; - } - return mfp.currTemplate.closeBtn; - }, - // Initialize Magnific Popup only when called at least once - _checkInstance = function() { - if(!$.magnificPopup.instance) { - mfp = new MagnificPopup(); - mfp.init(); - $.magnificPopup.instance = mfp; - } - }, - // Check to close popup or not - // "target" is an element that was clicked - _checkIfClose = function(target) { + if(mfp.st.callbacks) { + // converts "mfpEventName" to "eventName" callback and triggers it if it's present + e = e.charAt(0).toLowerCase() + e.slice(1); + if(mfp.st.callbacks[e]) { + mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); + } + } + }, + _getCloseBtn = function(type) { + if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { + mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); + _currPopupType = type; + } + return mfp.currTemplate.closeBtn; + }, + // Initialize Magnific Popup only when called at least once + _checkInstance = function() { + if(!$.magnificPopup.instance) { + mfp = new MagnificPopup(); + mfp.init(); + $.magnificPopup.instance = mfp; + } + }, + // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr + supportsTransitions = function() { + var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist + v = ['ms','O','Moz','Webkit']; // 'v' for vendor - if($(target).hasClass(PREVENT_CLOSE_CLASS)) { - return; - } + if( s['transition'] !== undefined ) { + return true; + } - var closeOnContent = mfp.st.closeOnContentClick; - var closeOnBg = mfp.st.closeOnBgClick; + while( v.length ) { + if( v.pop() + 'Transition' in s ) { + return true; + } + } - if(closeOnContent && closeOnBg) { - return true; - } else { - - // We close the popup if click is on close button or on preloader. Or if there is no content. - if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { - return true; - } - - // if click is outside the content - if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { - if(closeOnBg) { - return true; - } - } else if(closeOnContent) { - return true; - } - - } - return false; - }, - // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr - supportsTransitions = function() { - var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist - v = ['ms','O','Moz','Webkit']; // 'v' for vendor - - if( s['transition'] !== undefined ) { - return true; - } - - while( v.length ) { - if( v.pop() + 'Transition' in s ) { - return true; - } - } - - return false; - }; + return false; + }; @@ -151,662 +116,701 @@ var _mfpOn = function(name, f) { */ MagnificPopup.prototype = { - constructor: MagnificPopup, + constructor: MagnificPopup, - /** - * Initializes Magnific Popup plugin. - * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed - */ - init: function() { - var appVersion = navigator.appVersion; - mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1; - mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1; - mfp.isLowIE = mfp.isIE7 || mfp.isIE8; - mfp.isAndroid = (/android/gi).test(appVersion); - mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); - mfp.supportsTransition = supportsTransitions(); + /** + * Initializes Magnific Popup plugin. + * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed + */ + init: function() { + var appVersion = navigator.appVersion; + mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1; + mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1; + mfp.isLowIE = mfp.isIE7 || mfp.isIE8; + mfp.isAndroid = (/android/gi).test(appVersion); + mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); + mfp.supportsTransition = supportsTransitions(); - // We disable fixed positioned lightbox on devices that don't handle it nicely. - // If you know a better way of detecting this - let me know. - mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); - _body = $(document.body); - _document = $(document); + // We disable fixed positioned lightbox on devices that don't handle it nicely. + // If you know a better way of detecting this - let me know. + mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); + _document = $(document); - mfp.popupsCache = {}; - }, + mfp.popupsCache = {}; + }, - /** - * Opens popup - * @param data [description] - */ - open: function(data) { + /** + * Opens popup + * @param data [description] + */ + open: function(data) { - var i; + if(!_body) { + _body = $(document.body); + } - if(data.isObj === false) { - // convert jQuery collection to array to avoid conflicts later - mfp.items = data.items.toArray(); + var i; - mfp.index = 0; - var items = data.items, - item; - for(i = 0; i < items.length; i++) { - item = items[i]; - if(item.parsed) { - item = item.el[0]; - } - if(item === data.el[0]) { - mfp.index = i; - break; - } - } - } else { - mfp.items = $.isArray(data.items) ? data.items : [data.items]; - mfp.index = data.index || 0; - } + if(data.isObj === false) { + // convert jQuery collection to array to avoid conflicts later + mfp.items = data.items.toArray(); - // if popup is already opened - we just update the content - if(mfp.isOpen) { - mfp.updateItemHTML(); - return; - } - - mfp.types = []; - _wrapClasses = ''; - if(data.mainEl && data.mainEl.length) { - mfp.ev = data.mainEl.eq(0); - } else { - mfp.ev = _document; - } + mfp.index = 0; + var items = data.items, + item; + for(i = 0; i < items.length; i++) { + item = items[i]; + if(item.parsed) { + item = item.el[0]; + } + if(item === data.el[0]) { + mfp.index = i; + break; + } + } + } else { + mfp.items = $.isArray(data.items) ? data.items : [data.items]; + mfp.index = data.index || 0; + } - if(data.key) { - if(!mfp.popupsCache[data.key]) { - mfp.popupsCache[data.key] = {}; - } - mfp.currTemplate = mfp.popupsCache[data.key]; - } else { - mfp.currTemplate = {}; - } + // if popup is already opened - we just update the content + if(mfp.isOpen) { + mfp.updateItemHTML(); + return; + } + + mfp.types = []; + _wrapClasses = ''; + if(data.mainEl && data.mainEl.length) { + mfp.ev = data.mainEl.eq(0); + } else { + mfp.ev = _document; + } + + if(data.key) { + if(!mfp.popupsCache[data.key]) { + mfp.popupsCache[data.key] = {}; + } + mfp.currTemplate = mfp.popupsCache[data.key]; + } else { + mfp.currTemplate = {}; + } - mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); - mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; + mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); + mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; - if(mfp.st.modal) { - mfp.st.closeOnContentClick = false; - mfp.st.closeOnBgClick = false; - mfp.st.showCloseBtn = false; - mfp.st.enableEscapeKey = false; - } - - - // Building markup - // main containers are created only once - if(!mfp.bgOverlay) { - - // Dark overlay - mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { - mfp.close(); - }); - - mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { - if(_checkIfClose(e.target)) { - mfp.close(); - } - }); - - mfp.container = _getEl('container', mfp.wrap); - } - - mfp.contentContainer = _getEl('content'); - if(mfp.st.preloader) { - mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); - } + if(mfp.st.modal) { + mfp.st.closeOnContentClick = false; + mfp.st.closeOnBgClick = false; + mfp.st.showCloseBtn = false; + mfp.st.enableEscapeKey = false; + } - // Initializing modules - var modules = $.magnificPopup.modules; - for(i = 0; i < modules.length; i++) { - var n = modules[i]; - n = n.charAt(0).toUpperCase() + n.slice(1); - mfp['init'+n].call(mfp); - } - _mfpTrigger('BeforeOpen'); + // Building markup + // main containers are created only once + if(!mfp.bgOverlay) { + + // Dark overlay + mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { + mfp.close(); + }); + + mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { + if(mfp._checkIfClose(e.target)) { + mfp.close(); + } + }); + + mfp.container = _getEl('container', mfp.wrap); + } + + mfp.contentContainer = _getEl('content'); + if(mfp.st.preloader) { + mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); + } - if(mfp.st.showCloseBtn) { - // Close button - if(!mfp.st.closeBtnInside) { - mfp.wrap.append( _getCloseBtn() ); - } else { - _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { - values.close_replaceWith = _getCloseBtn(item.type); - }); - _wrapClasses += ' mfp-close-btn-in'; - } - } - - if(mfp.st.alignTop) { - _wrapClasses += ' mfp-align-top'; - } - - - - if(mfp.fixedContentPos) { - mfp.wrap.css({ - overflow: mfp.st.overflowY, - overflowX: 'hidden', - overflowY: mfp.st.overflowY - }); - } else { - mfp.wrap.css({ - top: _window.scrollTop(), - position: 'absolute' - }); - } - if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { - mfp.bgOverlay.css({ - height: _document.height(), - position: 'absolute' - }); - } - - - - if(mfp.st.enableEscapeKey) { - // Close on ESC key - _document.on('keyup' + EVENT_NS, function(e) { - if(e.keyCode === 27) { - mfp.close(); - } - }); - } - - _window.on('resize' + EVENT_NS, function() { - mfp.updateSize(); - }); + // Initializing modules + var modules = $.magnificPopup.modules; + for(i = 0; i < modules.length; i++) { + var n = modules[i]; + n = n.charAt(0).toUpperCase() + n.slice(1); + mfp['init'+n].call(mfp); + } + _mfpTrigger('BeforeOpen'); - if(!mfp.st.closeOnContentClick) { - _wrapClasses += ' mfp-auto-cursor'; - } - - if(_wrapClasses) - mfp.wrap.addClass(_wrapClasses); + if(mfp.st.showCloseBtn) { + // Close button + if(!mfp.st.closeBtnInside) { + mfp.wrap.append( _getCloseBtn() ); + } else { + _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { + values.close_replaceWith = _getCloseBtn(item.type); + }); + _wrapClasses += ' mfp-close-btn-in'; + } + } + + if(mfp.st.alignTop) { + _wrapClasses += ' mfp-align-top'; + } - // this triggers recalculation of layout, so we get it once to not to trigger twice - var windowHeight = mfp.wH = _window.height(); - - var windowStyles = {}; + if(mfp.fixedContentPos) { + mfp.wrap.css({ + overflow: mfp.st.overflowY, + overflowX: 'hidden', + overflowY: mfp.st.overflowY + }); + } else { + mfp.wrap.css({ + top: _window.scrollTop(), + position: 'absolute' + }); + } + if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { + mfp.bgOverlay.css({ + height: _document.height(), + position: 'absolute' + }); + } - if( mfp.fixedContentPos ) { + + + if(mfp.st.enableEscapeKey) { + // Close on ESC key + _document.on('keyup' + EVENT_NS, function(e) { + if(e.keyCode === 27) { + mfp.close(); + } + }); + } + + _window.on('resize' + EVENT_NS, function() { + mfp.updateSize(); + }); + + + if(!mfp.st.closeOnContentClick) { + _wrapClasses += ' mfp-auto-cursor'; + } + + if(_wrapClasses) + mfp.wrap.addClass(_wrapClasses); + + + // this triggers recalculation of layout, so we get it once to not to trigger twice + var windowHeight = mfp.wH = _window.height(); + + + var windowStyles = {}; + + if( mfp.fixedContentPos ) { if(mfp._hasScrollBar(windowHeight)){ var s = mfp._getScrollbarSize(); if(s) { - windowStyles.paddingRight = s; + windowStyles.marginRight = s; } } } - if(mfp.fixedContentPos) { - if(!mfp.isIE7) { - windowStyles.overflow = 'hidden'; - } else { - // ie7 double-scroll bug - $('body, html').css('overflow', 'hidden'); - } - } - - - - var classesToadd = mfp.st.mainClass; - if(mfp.isIE7) { - classesToadd += ' mfp-ie7'; - } - if(classesToadd) { - mfp._addClassToMFP( classesToadd ); - } - - // add content - mfp.updateItemHTML(); - - _mfpTrigger('BuildControls'); - - - // remove scrollbar, add padding e.t.c - $('html').css(windowStyles); - - // add everything to DOM - mfp.bgOverlay.add(mfp.wrap).prependTo( document.body ); - - - - // Save last focused element - mfp._lastFocusedEl = document.activeElement; - - // Wait for next cycle to allow CSS transition - setTimeout(function() { - - if(mfp.content) { - mfp._addClassToMFP(READY_CLASS); - _setFocus(); - } else { - // if content is not defined (not loaded e.t.c) we add class only for BG - mfp.bgOverlay.addClass(READY_CLASS); - } - - // Trap the focus in popup - _document.on('focusin' + EVENT_NS, function (e) { - if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { - _setFocus(); - return false; - } - }); - - }, 16); - - mfp.isOpen = true; - mfp.updateSize(windowHeight); - _mfpTrigger(OPEN_EVENT); - }, - - /** - * Closes the popup - */ - close: function() { - if(!mfp.isOpen) return; - _mfpTrigger(BEFORE_CLOSE_EVENT); - - mfp.isOpen = false; - // for CSS3 animation - if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { - mfp._addClassToMFP(REMOVING_CLASS); - setTimeout(function() { - mfp._close(); - }, mfp.st.removalDelay); - } else { - mfp._close(); - } - }, - - /** - * Helper for close() function - */ - _close: function() { - _mfpTrigger(CLOSE_EVENT); - - var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; - - mfp.bgOverlay.detach(); - mfp.wrap.detach(); - mfp.container.empty(); - - if(mfp.st.mainClass) { - classesToRemove += mfp.st.mainClass + ' '; - } - - mfp._removeClassFromMFP(classesToRemove); - - if(mfp.fixedContentPos) { - var windowStyles = {paddingRight: ''}; - if(mfp.isIE7) { - $('body, html').css('overflow', ''); - } else { - windowStyles.overflow = ''; - } - $('html').css(windowStyles); - } - - _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); - mfp.ev.off(EVENT_NS); - - // clean up DOM elements that aren't removed - mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); - mfp.bgOverlay.attr('class', 'mfp-bg'); - mfp.container.attr('class', 'mfp-container'); - - // remove close button from target element - if(mfp.st.showCloseBtn && - (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { - if(mfp.currTemplate.closeBtn) - mfp.currTemplate.closeBtn.detach(); - } - - - if(mfp._lastFocusedEl) { - $(mfp._lastFocusedEl).trigger('focus'); // put tab focus back - } - mfp.currItem = null; - mfp.content = null; - mfp.currTemplate = null; - mfp.prevHeight = 0; - - _mfpTrigger(AFTER_CLOSE_EVENT); - }, - - updateSize: function(winHeight) { - - if(mfp.isIOS) { - // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 - var zoomLevel = document.documentElement.clientWidth / window.innerWidth; - var height = window.innerHeight * zoomLevel; - mfp.wrap.css('height', height); - mfp.wH = height; - } else { - mfp.wH = winHeight || _window.height(); - } - // Fixes #84: popup incorrectly positioned with position:relative on body - if(!mfp.fixedContentPos) { - mfp.wrap.css('height', mfp.wH); - } - - _mfpTrigger('Resize'); - - }, - - /** - * Set content of popup based on current index - */ - updateItemHTML: function() { - var item = mfp.items[mfp.index]; - - // Detach and perform modifications - mfp.contentContainer.detach(); - - if(mfp.content) - mfp.content.detach(); - - if(!item.parsed) { - item = mfp.parseEl( mfp.index ); - } - - var type = item.type; - - _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); - // BeforeChange event works like so: - // _mfpOn('BeforeChange', function(e, prevType, newType) { }); - - mfp.currItem = item; - - - - - - if(!mfp.currTemplate[type]) { - var markup = mfp.st[type] ? mfp.st[type].markup : false; - - // allows to modify markup - _mfpTrigger('FirstMarkupParse', markup); - - if(markup) { - mfp.currTemplate[type] = $(markup); - } else { - // if there is no markup found we just define that template is parsed - mfp.currTemplate[type] = true; - } - } - - if(_prevContentType && _prevContentType !== item.type) { - mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); - } - - var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); - mfp.appendContent(newContent, type); - - item.preloaded = true; - - _mfpTrigger(CHANGE_EVENT, item); - _prevContentType = item.type; - - // Append container back after its content changed - mfp.container.prepend(mfp.contentContainer); - - _mfpTrigger('AfterChange'); - }, - - - /** - * Set HTML content of popup - */ - appendContent: function(newContent, type) { - mfp.content = newContent; - - if(newContent) { - if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && - mfp.currTemplate[type] === true) { - // if there is no markup, we just append close button element inside - if(!mfp.content.find('.mfp-close').length) { - mfp.content.append(_getCloseBtn()); - } - } else { - mfp.content = newContent; - } - } else { - mfp.content = ''; - } - - _mfpTrigger(BEFORE_APPEND_EVENT); - mfp.container.addClass('mfp-'+type+'-holder'); - - mfp.contentContainer.append(mfp.content); - }, - - - - - /** - * Creates Magnific Popup data object based on given data - * @param {int} index Index of item to parse - */ - parseEl: function(index) { - var item = mfp.items[index], - type = item.type; - - if(item.tagName) { - item = { el: $(item) }; - } else { - item = { data: item, src: item.src }; - } - - if(item.el) { - var types = mfp.types; - - // check for 'mfp-TYPE' class - for(var i = 0; i < types.length; i++) { - if( item.el.hasClass('mfp-'+types[i]) ) { - type = types[i]; - break; - } - } - - item.src = item.el.attr('data-mfp-src'); - if(!item.src) { - item.src = item.el.attr('href'); - } - } - - item.type = type || mfp.st.type || 'inline'; - item.index = index; - item.parsed = true; - mfp.items[index] = item; - _mfpTrigger('ElementParse', item); - - return mfp.items[index]; - }, - - - /** - * Initializes single popup or a group of popups - */ - addGroup: function(el, options) { - var eHandler = function(e) { - e.mfpEl = this; - mfp._openClick(e, el, options); - }; - - if(!options) { - options = {}; - } - - var eName = 'click.magnificPopup'; - options.mainEl = el; - - if(options.items) { - options.isObj = true; - el.off(eName).on(eName, eHandler); - } else { - options.isObj = false; - if(options.delegate) { - el.off(eName).on(eName, options.delegate , eHandler); - } else { - options.items = el; - el.off(eName).on(eName, eHandler); - } - } - }, - _openClick: function(e, el, options) { - var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; - - - if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) { - return; - } - - var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; - - if(disableOn) { - if($.isFunction(disableOn)) { - if( !disableOn.call(mfp) ) { - return true; - } - } else { // else it's number - if( _window.width() < disableOn ) { - return true; - } - } - } - - if(e.type) { - e.preventDefault(); - - // This will prevent popup from closing if element is inside and popup is already opened - if(mfp.isOpen) { - e.stopPropagation(); - } - } - - - options.el = $(e.mfpEl); - if(options.delegate) { - options.items = el.find(options.delegate); - } - mfp.open(options); - }, - - - /** - * Updates text on preloader - */ - updateStatus: function(status, text) { - - if(mfp.preloader) { - if(_prevStatus !== status) { - mfp.container.removeClass('mfp-s-'+_prevStatus); - } - - if(!text && status === 'loading') { - text = mfp.st.tLoading; - } - - var data = { - status: status, - text: text - }; - // allows to modify status - _mfpTrigger('UpdateStatus', data); - - status = data.status; - text = data.text; - - mfp.preloader.html(text); - - mfp.preloader.find('a').on('click', function(e) { - e.stopImmediatePropagation(); - }); - - mfp.container.addClass('mfp-s-'+status); - _prevStatus = status; - } - }, - - - /* - "Private" helpers that aren't private at all - */ - _addClassToMFP: function(cName) { - mfp.bgOverlay.addClass(cName); - mfp.wrap.addClass(cName); - }, - _removeClassFromMFP: function(cName) { - this.bgOverlay.removeClass(cName); - mfp.wrap.removeClass(cName); - }, - _hasScrollBar: function(winHeight) { - return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); - }, - _parseMarkup: function(template, values, item) { - var arr; - if(item.data) { - values = $.extend(item.data, values); - } - _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); - - $.each(values, function(key, value) { - if(value === undefined || value === false) { - return true; - } - arr = key.split('_'); - if(arr.length > 1) { - var el = template.find(EVENT_NS + '-'+arr[0]); - - if(el.length > 0) { - var attr = arr[1]; - if(attr === 'replaceWith') { - if(el[0] !== value[0]) { - el.replaceWith(value); - } - } else if(attr === 'img') { - if(el.is('img')) { - el.attr('src', value); - } else { - el.replaceWith( '' ); - } - } else { - el.attr(arr[1], value); - } - } - - } else { - template.find(EVENT_NS + '-'+key).html(value); - } - }); - }, - - _getScrollbarSize: function() { - // thx David - if(mfp.scrollbarSize === undefined) { - var scrollDiv = document.createElement("div"); - scrollDiv.id = "mfp-sbm"; - scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; - document.body.appendChild(scrollDiv); - mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; - document.body.removeChild(scrollDiv); - } - return mfp.scrollbarSize; - } + if(mfp.fixedContentPos) { + if(!mfp.isIE7) { + windowStyles.overflow = 'hidden'; + } else { + // ie7 double-scroll bug + $('body, html').css('overflow', 'hidden'); + } + } + + + + var classesToadd = mfp.st.mainClass; + if(mfp.isIE7) { + classesToadd += ' mfp-ie7'; + } + if(classesToadd) { + mfp._addClassToMFP( classesToadd ); + } + + // add content + mfp.updateItemHTML(); + + _mfpTrigger('BuildControls'); + + // remove scrollbar, add margin e.t.c + $('html').css(windowStyles); + + // add everything to DOM + mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || _body ); + + // Save last focused element + mfp._lastFocusedEl = document.activeElement; + + // Wait for next cycle to allow CSS transition + setTimeout(function() { + + if(mfp.content) { + mfp._addClassToMFP(READY_CLASS); + mfp._setFocus(); + } else { + // if content is not defined (not loaded e.t.c) we add class only for BG + mfp.bgOverlay.addClass(READY_CLASS); + } + + // Trap the focus in popup + _document.on('focusin' + EVENT_NS, mfp._onFocusIn); + + }, 16); + + mfp.isOpen = true; + mfp.updateSize(windowHeight); + _mfpTrigger(OPEN_EVENT); + + return data; + }, + + /** + * Closes the popup + */ + close: function() { + if(!mfp.isOpen) return; + _mfpTrigger(BEFORE_CLOSE_EVENT); + + mfp.isOpen = false; + // for CSS3 animation + if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { + mfp._addClassToMFP(REMOVING_CLASS); + setTimeout(function() { + mfp._close(); + }, mfp.st.removalDelay); + } else { + mfp._close(); + } + }, + + /** + * Helper for close() function + */ + _close: function() { + _mfpTrigger(CLOSE_EVENT); + + var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; + + mfp.bgOverlay.detach(); + mfp.wrap.detach(); + mfp.container.empty(); + + if(mfp.st.mainClass) { + classesToRemove += mfp.st.mainClass + ' '; + } + + mfp._removeClassFromMFP(classesToRemove); + + if(mfp.fixedContentPos) { + var windowStyles = {marginRight: ''}; + if(mfp.isIE7) { + $('body, html').css('overflow', ''); + } else { + windowStyles.overflow = ''; + } + $('html').css(windowStyles); + } + + _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); + mfp.ev.off(EVENT_NS); + + // clean up DOM elements that aren't removed + mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); + mfp.bgOverlay.attr('class', 'mfp-bg'); + mfp.container.attr('class', 'mfp-container'); + + // remove close button from target element + if(mfp.st.showCloseBtn && + (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { + if(mfp.currTemplate.closeBtn) + mfp.currTemplate.closeBtn.detach(); + } + + + if(mfp._lastFocusedEl) { + $(mfp._lastFocusedEl).focus(); // put tab focus back + } + mfp.currItem = null; + mfp.content = null; + mfp.currTemplate = null; + mfp.prevHeight = 0; + + _mfpTrigger(AFTER_CLOSE_EVENT); + }, + + updateSize: function(winHeight) { + + if(mfp.isIOS) { + // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 + var zoomLevel = document.documentElement.clientWidth / window.innerWidth; + var height = window.innerHeight * zoomLevel; + mfp.wrap.css('height', height); + mfp.wH = height; + } else { + mfp.wH = winHeight || _window.height(); + } + // Fixes #84: popup incorrectly positioned with position:relative on body + if(!mfp.fixedContentPos) { + mfp.wrap.css('height', mfp.wH); + } + + _mfpTrigger('Resize'); + + }, + + /** + * Set content of popup based on current index + */ + updateItemHTML: function() { + var item = mfp.items[mfp.index]; + + // Detach and perform modifications + mfp.contentContainer.detach(); + + if(mfp.content) + mfp.content.detach(); + + if(!item.parsed) { + item = mfp.parseEl( mfp.index ); + } + + var type = item.type; + + _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); + // BeforeChange event works like so: + // _mfpOn('BeforeChange', function(e, prevType, newType) { }); + + mfp.currItem = item; + + + + if(!mfp.currTemplate[type]) { + var markup = mfp.st[type] ? mfp.st[type].markup : false; + + // allows to modify markup + _mfpTrigger('FirstMarkupParse', markup); + + if(markup) { + mfp.currTemplate[type] = $(markup); + } else { + // if there is no markup found we just define that template is parsed + mfp.currTemplate[type] = true; + } + } + + if(_prevContentType && _prevContentType !== item.type) { + mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); + } + + var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); + mfp.appendContent(newContent, type); + + item.preloaded = true; + + _mfpTrigger(CHANGE_EVENT, item); + _prevContentType = item.type; + + // Append container back after its content changed + mfp.container.prepend(mfp.contentContainer); + + _mfpTrigger('AfterChange'); + }, + + + /** + * Set HTML content of popup + */ + appendContent: function(newContent, type) { + mfp.content = newContent; + + if(newContent) { + if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && + mfp.currTemplate[type] === true) { + // if there is no markup, we just append close button element inside + if(!mfp.content.find('.mfp-close').length) { + mfp.content.append(_getCloseBtn()); + } + } else { + mfp.content = newContent; + } + } else { + mfp.content = ''; + } + + _mfpTrigger(BEFORE_APPEND_EVENT); + mfp.container.addClass('mfp-'+type+'-holder'); + + mfp.contentContainer.append(mfp.content); + }, + + + + /** + * Creates Magnific Popup data object based on given data + * @param {int} index Index of item to parse + */ + parseEl: function(index) { + var item = mfp.items[index], + type; + + if(item.tagName) { + item = { el: $(item) }; + } else { + type = item.type; + item = { data: item, src: item.src }; + } + + if(item.el) { + var types = mfp.types; + + // check for 'mfp-TYPE' class + for(var i = 0; i < types.length; i++) { + if( item.el.hasClass('mfp-'+types[i]) ) { + type = types[i]; + break; + } + } + + item.src = item.el.attr('data-mfp-src'); + if(!item.src) { + item.src = item.el.attr('href'); + } + } + + item.type = type || mfp.st.type || 'inline'; + item.index = index; + item.parsed = true; + mfp.items[index] = item; + _mfpTrigger('ElementParse', item); + + return mfp.items[index]; + }, + + + /** + * Initializes single popup or a group of popups + */ + addGroup: function(el, options) { + var eHandler = function(e) { + e.mfpEl = this; + mfp._openClick(e, el, options); + }; + + if(!options) { + options = {}; + } + + var eName = 'click.magnificPopup'; + options.mainEl = el; + + if(options.items) { + options.isObj = true; + el.off(eName).on(eName, eHandler); + } else { + options.isObj = false; + if(options.delegate) { + el.off(eName).on(eName, options.delegate , eHandler); + } else { + options.items = el; + el.off(eName).on(eName, eHandler); + } + } + }, + _openClick: function(e, el, options) { + var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; + + + if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) { + return; + } + + var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; + + if(disableOn) { + if($.isFunction(disableOn)) { + if( !disableOn.call(mfp) ) { + return true; + } + } else { // else it's number + if( _window.width() < disableOn ) { + return true; + } + } + } + + if(e.type) { + e.preventDefault(); + + // This will prevent popup from closing if element is inside and popup is already opened + if(mfp.isOpen) { + e.stopPropagation(); + } + } + + + options.el = $(e.mfpEl); + if(options.delegate) { + options.items = el.find(options.delegate); + } + mfp.open(options); + }, + + + /** + * Updates text on preloader + */ + updateStatus: function(status, text) { + + if(mfp.preloader) { + if(_prevStatus !== status) { + mfp.container.removeClass('mfp-s-'+_prevStatus); + } + + if(!text && status === 'loading') { + text = mfp.st.tLoading; + } + + var data = { + status: status, + text: text + }; + // allows to modify status + _mfpTrigger('UpdateStatus', data); + + status = data.status; + text = data.text; + + mfp.preloader.html(text); + + mfp.preloader.find('a').on('click', function(e) { + e.stopImmediatePropagation(); + }); + + mfp.container.addClass('mfp-s-'+status); + _prevStatus = status; + } + }, + + + /* + "Private" helpers that aren't private at all + */ + // Check to close popup or not + // "target" is an element that was clicked + _checkIfClose: function(target) { + + if($(target).hasClass(PREVENT_CLOSE_CLASS)) { + return; + } + + var closeOnContent = mfp.st.closeOnContentClick; + var closeOnBg = mfp.st.closeOnBgClick; + + if(closeOnContent && closeOnBg) { + return true; + } else { + + // We close the popup if click is on close button or on preloader. Or if there is no content. + if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { + return true; + } + + // if click is outside the content + if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { + if(closeOnBg) { + // last check, if the clicked element is in DOM, (in case it's removed onclick) + if( $.contains(document, target) ) { + return true; + } + } + } else if(closeOnContent) { + return true; + } + + } + return false; + }, + _addClassToMFP: function(cName) { + mfp.bgOverlay.addClass(cName); + mfp.wrap.addClass(cName); + }, + _removeClassFromMFP: function(cName) { + this.bgOverlay.removeClass(cName); + mfp.wrap.removeClass(cName); + }, + _hasScrollBar: function(winHeight) { + return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); + }, + _setFocus: function() { + (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus(); + }, + _onFocusIn: function(e) { + if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { + mfp._setFocus(); + return false; + } + }, + _parseMarkup: function(template, values, item) { + var arr; + if(item.data) { + values = $.extend(item.data, values); + } + _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); + + $.each(values, function(key, value) { + if(value === undefined || value === false) { + return true; + } + arr = key.split('_'); + if(arr.length > 1) { + var el = template.find(EVENT_NS + '-'+arr[0]); + + if(el.length > 0) { + var attr = arr[1]; + if(attr === 'replaceWith') { + if(el[0] !== value[0]) { + el.replaceWith(value); + } + } else if(attr === 'img') { + if(el.is('img')) { + el.attr('src', value); + } else { + el.replaceWith( '' ); + } + } else { + el.attr(arr[1], value); + } + } + + } else { + template.find(EVENT_NS + '-'+key).html(value); + } + }); + }, + + _getScrollbarSize: function() { + // thx David + if(mfp.scrollbarSize === undefined) { + var scrollDiv = document.createElement("div"); + scrollDiv.id = "mfp-sbm"; + scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; + document.body.appendChild(scrollDiv); + mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + } + return mfp.scrollbarSize; + } }; /* MagnificPopup core prototype end */ @@ -817,136 +821,144 @@ MagnificPopup.prototype = { * Public static functions */ $.magnificPopup = { - instance: null, - proto: MagnificPopup.prototype, - modules: [], + instance: null, + proto: MagnificPopup.prototype, + modules: [], - open: function(options, index) { - _checkInstance(); + open: function(options, index) { + _checkInstance(); - if(!options) - options = {}; + if(!options) { + options = {}; + } else { + options = $.extend(true, {}, options); + } - options.isObj = true; - options.index = index || 0; - return this.instance.open(options); - }, - close: function() { - return $.magnificPopup.instance.close(); - }, + options.isObj = true; + options.index = index || 0; + return this.instance.open(options); + }, - registerModule: function(name, module) { - if(module.options) { - $.magnificPopup.defaults[name] = module.options; - } - $.extend(this.proto, module.proto); - this.modules.push(name); - }, + close: function() { + return $.magnificPopup.instance && $.magnificPopup.instance.close(); + }, - defaults: { + registerModule: function(name, module) { + if(module.options) { + $.magnificPopup.defaults[name] = module.options; + } + $.extend(this.proto, module.proto); + this.modules.push(name); + }, - // Info about options is in docs: - // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options - - disableOn: 0, + defaults: { - key: null, + // Info about options is in docs: + // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options - midClick: false, + disableOn: 0, - mainClass: '', + key: null, - preloader: true, + midClick: false, - focus: '', // CSS selector of input to focus after popup is opened - - closeOnContentClick: false, + mainClass: '', - closeOnBgClick: true, + preloader: true, - closeBtnInside: true, + focus: '', // CSS selector of input to focus after popup is opened - showCloseBtn: true, + closeOnContentClick: false, - enableEscapeKey: true, + closeOnBgClick: true, - modal: false, + closeBtnInside: true, - alignTop: false, - - removalDelay: 0, - - fixedContentPos: 'auto', - - fixedBgPos: 'auto', + showCloseBtn: true, - overflowY: 'auto', + enableEscapeKey: true, - closeMarkup: '', + modal: false, - tClose: 'Close (Esc)', + alignTop: false, - tLoading: 'Loading...' + removalDelay: 0, - } + prependTo: null, + + fixedContentPos: 'auto', + + fixedBgPos: 'auto', + + overflowY: 'auto', + + closeMarkup: '', + + tClose: 'Close (Esc)', + + tLoading: 'Loading...' + + } }; $.fn.magnificPopup = function(options) { - _checkInstance(); + _checkInstance(); - var jqEl = $(this); + var jqEl = $(this); - // We call some API method of first param is a string - if (typeof options === "string" ) { + // We call some API method of first param is a string + if (typeof options === "string" ) { - if(options === 'open') { - var items, - itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, - index = parseInt(arguments[1], 10) || 0; + if(options === 'open') { + var items, + itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, + index = parseInt(arguments[1], 10) || 0; - if(itemOpts.items) { - items = itemOpts.items[index]; - } else { - items = jqEl; - if(itemOpts.delegate) { - items = items.find(itemOpts.delegate); - } - items = items.eq( index ); - } - mfp._openClick({mfpEl:items}, jqEl, itemOpts); - } else { - if(mfp.isOpen) - mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); - } + if(itemOpts.items) { + items = itemOpts.items[index]; + } else { + items = jqEl; + if(itemOpts.delegate) { + items = items.find(itemOpts.delegate); + } + items = items.eq( index ); + } + mfp._openClick({mfpEl:items}, jqEl, itemOpts); + } else { + if(mfp.isOpen) + mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); + } - } else { + } else { + // clone options obj + options = $.extend(true, {}, options); - /* - * As Zepto doesn't support .data() method for objects - * and it works only in normal browsers - * we assign "options" object directly to the DOM element. FTW! - */ - if(_isJQ) { - jqEl.data('magnificPopup', options); - } else { - jqEl[0].magnificPopup = options; - } + /* + * As Zepto doesn't support .data() method for objects + * and it works only in normal browsers + * we assign "options" object directly to the DOM element. FTW! + */ + if(_isJQ) { + jqEl.data('magnificPopup', options); + } else { + jqEl[0].magnificPopup = options; + } - mfp.addGroup(jqEl, options); + mfp.addGroup(jqEl, options); - } - return jqEl; + } + return jqEl; }; //Quick benchmark /* var start = performance.now(), - i, - rounds = 1000; + i, + rounds = 1000; for(i = 0; i < rounds; i++) { @@ -966,391 +978,316 @@ console.log('Test #2:', performance.now() - start); /*>>inline*/ var INLINE_NS = 'inline', - _hiddenClass, - _inlinePlaceholder, - _lastInlineElement, - _putInlineElementsBack = function() { - if(_lastInlineElement) { - _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); - _lastInlineElement = null; - } - }; + _hiddenClass, + _inlinePlaceholder, + _lastInlineElement, + _putInlineElementsBack = function() { + if(_lastInlineElement) { + _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); + _lastInlineElement = null; + } + }; $.magnificPopup.registerModule(INLINE_NS, { - options: { - hiddenClass: 'hide', // will be appended with `mfp-` prefix - markup: '', - tNotFound: 'Content not found' - }, - proto: { + options: { + hiddenClass: 'hide', // will be appended with `mfp-` prefix + markup: '', + tNotFound: 'Content not found' + }, + proto: { - initInline: function() { - mfp.types.push(INLINE_NS); + initInline: function() { + mfp.types.push(INLINE_NS); - _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { - _putInlineElementsBack(); - }); - }, + _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { + _putInlineElementsBack(); + }); + }, - getInline: function(item, template) { + getInline: function(item, template) { - _putInlineElementsBack(); + _putInlineElementsBack(); - if(item.src) { - var inlineSt = mfp.st.inline, - el = $(item.src); + if(item.src) { + var inlineSt = mfp.st.inline, + el = $(item.src); - if(el.length) { + if(el.length) { - // If target element has parent - we replace it with placeholder and put it back after popup is closed - var parent = el[0].parentNode; - if(parent && parent.tagName) { - if(!_inlinePlaceholder) { - _hiddenClass = inlineSt.hiddenClass; - _inlinePlaceholder = _getEl(_hiddenClass); - _hiddenClass = 'mfp-'+_hiddenClass; - } - // replace target inline element with placeholder - _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); - } + // If target element has parent - we replace it with placeholder and put it back after popup is closed + var parent = el[0].parentNode; + if(parent && parent.tagName) { + if(!_inlinePlaceholder) { + _hiddenClass = inlineSt.hiddenClass; + _inlinePlaceholder = _getEl(_hiddenClass); + _hiddenClass = 'mfp-'+_hiddenClass; + } + // replace target inline element with placeholder + _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); + } - mfp.updateStatus('ready'); - } else { - mfp.updateStatus('error', inlineSt.tNotFound); - el = $('
'); - } + mfp.updateStatus('ready'); + } else { + mfp.updateStatus('error', inlineSt.tNotFound); + el = $('
'); + } - item.inlineElement = el; - return el; - } + item.inlineElement = el; + return el; + } - mfp.updateStatus('ready'); - mfp._parseMarkup(template, {}, item); - return template; - } - } + mfp.updateStatus('ready'); + mfp._parseMarkup(template, {}, item); + return template; + } + } }); /*>>inline*/ -/*>>ajax*/ -var AJAX_NS = 'ajax', - _ajaxCur, - _removeAjaxCursor = function() { - if(_ajaxCur) { - _body.removeClass(_ajaxCur); - } - }; -$.magnificPopup.registerModule(AJAX_NS, { - - options: { - settings: null, - cursor: 'mfp-ajax-cur', - tError: 'The content could not be loaded.' - }, - - proto: { - initAjax: function() { - mfp.types.push(AJAX_NS); - _ajaxCur = mfp.st.ajax.cursor; - - _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, function() { - _removeAjaxCursor(); - if(mfp.req) { - mfp.req.abort(); - } - }); - }, - - getAjax: function(item) { - - if(_ajaxCur) - _body.addClass(_ajaxCur); - - mfp.updateStatus('loading'); - - var opts = $.extend({ - url: item.src, - success: function(data, textStatus, jqXHR) { - var temp = { - data:data, - xhr:jqXHR - }; - - _mfpTrigger('ParseAjax', temp); - - mfp.appendContent( $(temp.data), AJAX_NS ); - - item.finished = true; - - _removeAjaxCursor(); - - _setFocus(); - - setTimeout(function() { - mfp.wrap.addClass(READY_CLASS); - }, 16); - - mfp.updateStatus('ready'); - - _mfpTrigger('AjaxContentAdded'); - }, - error: function() { - _removeAjaxCursor(); - item.finished = item.loadError = true; - mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); - } - }, mfp.st.ajax.settings); - - mfp.req = $.ajax(opts); - - return ''; - } - } -}); - - - - - - - -/*>>ajax*/ /*>>image*/ var _imgInterval, - _getTitle = function(item) { - if(item.data && item.data.title !== undefined) - return item.data.title; + _getTitle = function(item) { + if(item.data && item.data.title !== undefined) + return item.data.title; - var src = mfp.st.image.titleSrc; + var src = mfp.st.image.titleSrc; - if(src) { - if($.isFunction(src)) { - return src.call(mfp, item); - } else if(item.el) { - return item.el.attr(src) || ''; - } - } - return ''; - }; + if(src) { + if($.isFunction(src)) { + return src.call(mfp, item); + } else if(item.el) { + return item.el.attr(src) || ''; + } + } + return ''; + }; $.magnificPopup.registerModule('image', { - options: { - markup: '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
', - cursor: 'mfp-zoom-out-cur', - titleSrc: 'title', - verticalFit: true, - tError: 'The image could not be loaded.' - }, + options: { + markup: '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
', + cursor: 'mfp-zoom-out-cur', + titleSrc: 'title', + verticalFit: true, + tError: 'The image could not be loaded.' + }, - proto: { - initImage: function() { - var imgSt = mfp.st.image, - ns = '.image'; + proto: { + initImage: function() { + var imgSt = mfp.st.image, + ns = '.image'; - mfp.types.push('image'); + mfp.types.push('image'); - _mfpOn(OPEN_EVENT+ns, function() { - if(mfp.currItem.type === 'image' && imgSt.cursor) { - _body.addClass(imgSt.cursor); - } - }); + _mfpOn(OPEN_EVENT+ns, function() { + if(mfp.currItem.type === 'image' && imgSt.cursor) { + _body.addClass(imgSt.cursor); + } + }); - _mfpOn(CLOSE_EVENT+ns, function() { - if(imgSt.cursor) { - _body.removeClass(imgSt.cursor); - } - _window.off('resize' + EVENT_NS); - }); + _mfpOn(CLOSE_EVENT+ns, function() { + if(imgSt.cursor) { + _body.removeClass(imgSt.cursor); + } + _window.off('resize' + EVENT_NS); + }); - _mfpOn('Resize'+ns, mfp.resizeImage); - if(mfp.isLowIE) { - _mfpOn('AfterChange', mfp.resizeImage); - } - }, - resizeImage: function() { - var item = mfp.currItem; - if(!item.img) return; + _mfpOn('Resize'+ns, mfp.resizeImage); + if(mfp.isLowIE) { + _mfpOn('AfterChange', mfp.resizeImage); + } + }, + resizeImage: function() { + var item = mfp.currItem; + if(!item || !item.img) return; - if(mfp.st.image.verticalFit) { - var decr = 0; - // fix box-sizing in ie7/8 - if(mfp.isLowIE) { - decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); - } - item.img.css('max-height', mfp.wH-decr); - } - }, - _onImageHasSize: function(item) { - if(item.img) { - - item.hasSize = true; + if(mfp.st.image.verticalFit) { + var decr = 0; + // fix box-sizing in ie7/8 + if(mfp.isLowIE) { + decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); + } + item.img.css('max-height', mfp.wH-decr); + } + }, + _onImageHasSize: function(item) { + if(item.img) { - if(_imgInterval) { - clearInterval(_imgInterval); - } - - item.isCheckingImgSize = false; + item.hasSize = true; - _mfpTrigger('ImageHasSize', item); + if(_imgInterval) { + clearInterval(_imgInterval); + } - if(item.imgHidden) { - if(mfp.content) - mfp.content.removeClass('mfp-loading'); - - item.imgHidden = false; - } + item.isCheckingImgSize = false; - } - }, + _mfpTrigger('ImageHasSize', item); - /** - * Function that loops until the image has size to display elements that rely on it asap - */ - findImageSize: function(item) { + if(item.imgHidden) { + if(mfp.content) + mfp.content.removeClass('mfp-loading'); - var counter = 0, - img = item.img[0], - mfpSetInterval = function(delay) { + item.imgHidden = false; + } - if(_imgInterval) { - clearInterval(_imgInterval); - } - // decelerating interval that checks for size of an image - _imgInterval = setInterval(function() { - if(img.naturalWidth > 0) { - mfp._onImageHasSize(item); - return; - } + } + }, - if(counter > 200) { - clearInterval(_imgInterval); - } + /** + * Function that loops until the image has size to display elements that rely on it asap + */ + findImageSize: function(item) { - counter++; - if(counter === 3) { - mfpSetInterval(10); - } else if(counter === 40) { - mfpSetInterval(50); - } else if(counter === 100) { - mfpSetInterval(500); - } - }, delay); - }; + var counter = 0, + img = item.img[0], + mfpSetInterval = function(delay) { - mfpSetInterval(1); - }, + if(_imgInterval) { + clearInterval(_imgInterval); + } + // decelerating interval that checks for size of an image + _imgInterval = setInterval(function() { + if(img.naturalWidth > 0) { + mfp._onImageHasSize(item); + return; + } - getImage: function(item, template) { + if(counter > 200) { + clearInterval(_imgInterval); + } - var guard = 0, + counter++; + if(counter === 3) { + mfpSetInterval(10); + } else if(counter === 40) { + mfpSetInterval(50); + } else if(counter === 100) { + mfpSetInterval(500); + } + }, delay); + }; - // image load complete handler - onLoadComplete = function() { - if(item) { - if (item.img[0].complete) { - item.img.off('.mfploader'); - - if(item === mfp.currItem){ - mfp._onImageHasSize(item); + mfpSetInterval(1); + }, - mfp.updateStatus('ready'); - } + getImage: function(item, template) { - item.hasSize = true; - item.loaded = true; + var guard = 0, - _mfpTrigger('ImageLoadComplete'); - - } - else { - // if image complete check fails 200 times (20 sec), we assume that there was an error. - guard++; - if(guard < 200) { - setTimeout(onLoadComplete,100); - } else { - onLoadError(); - } - } - } - }, + // image load complete handler + onLoadComplete = function() { + if(item) { + if (item.img[0].complete) { + item.img.off('.mfploader'); - // image error handler - onLoadError = function() { - if(item) { - item.img.off('.mfploader'); - if(item === mfp.currItem){ - mfp._onImageHasSize(item); - mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); - } + if(item === mfp.currItem){ + mfp._onImageHasSize(item); - item.hasSize = true; - item.loaded = true; - item.loadError = true; - } - }, - imgSt = mfp.st.image; + mfp.updateStatus('ready'); + } + + item.hasSize = true; + item.loaded = true; + + _mfpTrigger('ImageLoadComplete'); + + } + else { + // if image complete check fails 200 times (20 sec), we assume that there was an error. + guard++; + if(guard < 200) { + setTimeout(onLoadComplete,100); + } else { + onLoadError(); + } + } + } + }, + + // image error handler + onLoadError = function() { + if(item) { + item.img.off('.mfploader'); + if(item === mfp.currItem){ + mfp._onImageHasSize(item); + mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); + } + + item.hasSize = true; + item.loaded = true; + item.loadError = true; + } + }, + imgSt = mfp.st.image; - var el = template.find('.mfp-img'); - if(el.length) { - var img = new Image(); - img.className = 'mfp-img'; - item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); - img.src = item.src; + var el = template.find('.mfp-img'); + if(el.length) { + var img = document.createElement('img'); + img.className = 'mfp-img'; + item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); + img.src = item.src; - // without clone() "error" event is not firing when IMG is replaced by new IMG - // TODO: find a way to avoid such cloning - if(el.is('img')) { - item.img = item.img.clone(); - } - if(item.img[0].naturalWidth > 0) { - item.hasSize = true; - } - } + // without clone() "error" event is not firing when IMG is replaced by new IMG + // TODO: find a way to avoid such cloning + if(el.is('img')) { + item.img = item.img.clone(); + } - mfp._parseMarkup(template, { - title: _getTitle(item), - img_replaceWith: item.img - }, item); + img = item.img[0]; + if(img.naturalWidth > 0) { + item.hasSize = true; + } else if(!img.width) { + item.hasSize = false; + } + } - mfp.resizeImage(); + mfp._parseMarkup(template, { + title: _getTitle(item), + img_replaceWith: item.img + }, item); - if(item.hasSize) { - if(_imgInterval) clearInterval(_imgInterval); + mfp.resizeImage(); - if(item.loadError) { - template.addClass('mfp-loading'); - mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); - } else { - template.removeClass('mfp-loading'); - mfp.updateStatus('ready'); - } - return template; - } + if(item.hasSize) { + if(_imgInterval) clearInterval(_imgInterval); - mfp.updateStatus('loading'); - item.loading = true; + if(item.loadError) { + template.addClass('mfp-loading'); + mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); + } else { + template.removeClass('mfp-loading'); + mfp.updateStatus('ready'); + } + return template; + } - if(!item.hasSize) { - item.imgHidden = true; - template.addClass('mfp-loading'); - mfp.findImageSize(item); - } + mfp.updateStatus('loading'); + item.loading = true; - return template; - } - } + if(!item.hasSize) { + item.imgHidden = true; + template.addClass('mfp-loading'); + mfp.findImageSize(item); + } + + return template; + } + } }); @@ -1359,185 +1296,187 @@ $.magnificPopup.registerModule('image', { /*>>zoom*/ var hasMozTransform, - getHasMozTransform = function() { - if(hasMozTransform === undefined) { - hasMozTransform = document.createElement('p').style.MozTransform !== undefined; - } - return hasMozTransform; - }; + getHasMozTransform = function() { + if(hasMozTransform === undefined) { + hasMozTransform = document.createElement('p').style.MozTransform !== undefined; + } + return hasMozTransform; + }; $.magnificPopup.registerModule('zoom', { - options: { - enabled: false, - easing: 'ease-in-out', - duration: 300, - opener: function(element) { - return element.is('img') ? element : element.find('img'); - } - }, + options: { + enabled: false, + easing: 'ease-in-out', + duration: 300, + opener: function(element) { + return element.is('img') ? element : element.find('img'); + } + }, - proto: { + proto: { - initZoom: function() { - var zoomSt = mfp.st.zoom, - ns = '.zoom'; - - if(!zoomSt.enabled || !mfp.supportsTransition) { - return; - } + initZoom: function() { + var zoomSt = mfp.st.zoom, + ns = '.zoom', + image; - var duration = zoomSt.duration, - getElToAnimate = function(image) { - var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), - transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, - cssObj = { - position: 'fixed', - zIndex: 9999, - left: 0, - top: 0, - '-webkit-backface-visibility': 'hidden' - }, - t = 'transition'; + if(!zoomSt.enabled || !mfp.supportsTransition) { + return; + } - cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; + var duration = zoomSt.duration, + getElToAnimate = function(image) { + var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), + transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, + cssObj = { + position: 'fixed', + zIndex: 9999, + left: 0, + top: 0, + '-webkit-backface-visibility': 'hidden' + }, + t = 'transition'; - newImg.css(cssObj); - return newImg; - }, - showMainContent = function() { - mfp.content.css('visibility', 'visible'); - }, - openTimeout, - animatedImg; + cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; - _mfpOn('BuildControls'+ns, function() { - if(mfp._allowZoom()) { + newImg.css(cssObj); + return newImg; + }, + showMainContent = function() { + mfp.content.css('visibility', 'visible'); + }, + openTimeout, + animatedImg; - clearTimeout(openTimeout); - mfp.content.css('visibility', 'hidden'); + _mfpOn('BuildControls'+ns, function() { + if(mfp._allowZoom()) { - // Basically, all code below does is clones existing image, puts in on top of the current one and animated it - - image = mfp._getItemToZoom(); + clearTimeout(openTimeout); + mfp.content.css('visibility', 'hidden'); - if(!image) { - showMainContent(); - return; - } + // Basically, all code below does is clones existing image, puts in on top of the current one and animated it - animatedImg = getElToAnimate(image); - - animatedImg.css( mfp._getOffset() ); + image = mfp._getItemToZoom(); - mfp.wrap.append(animatedImg); + if(!image) { + showMainContent(); + return; + } - openTimeout = setTimeout(function() { - animatedImg.css( mfp._getOffset( true ) ); - openTimeout = setTimeout(function() { + animatedImg = getElToAnimate(image); - showMainContent(); + animatedImg.css( mfp._getOffset() ); - setTimeout(function() { - animatedImg.remove(); - image = animatedImg = null; - _mfpTrigger('ZoomAnimationEnded'); - }, 16); // avoid blink when switching images + mfp.wrap.append(animatedImg); - }, duration); // this timeout equals animation duration + openTimeout = setTimeout(function() { + animatedImg.css( mfp._getOffset( true ) ); + openTimeout = setTimeout(function() { - }, 16); // by adding this timeout we avoid short glitch at the beginning of animation + showMainContent(); + + setTimeout(function() { + animatedImg.remove(); + image = animatedImg = null; + _mfpTrigger('ZoomAnimationEnded'); + }, 16); // avoid blink when switching images + + }, duration); // this timeout equals animation duration + + }, 16); // by adding this timeout we avoid short glitch at the beginning of animation - // Lots of timeouts... - } - }); - _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { - if(mfp._allowZoom()) { + // Lots of timeouts... + } + }); + _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { + if(mfp._allowZoom()) { - clearTimeout(openTimeout); + clearTimeout(openTimeout); - mfp.st.removalDelay = duration; + mfp.st.removalDelay = duration; - if(!image) { - image = mfp._getItemToZoom(); - if(!image) { - return; - } - animatedImg = getElToAnimate(image); - } - - - animatedImg.css( mfp._getOffset(true) ); - mfp.wrap.append(animatedImg); - mfp.content.css('visibility', 'hidden'); - - setTimeout(function() { - animatedImg.css( mfp._getOffset() ); - }, 16); - } - - }); - - _mfpOn(CLOSE_EVENT+ns, function() { - if(mfp._allowZoom()) { - showMainContent(); - if(animatedImg) { - animatedImg.remove(); - } - } - }); - }, - - _allowZoom: function() { - return mfp.currItem.type === 'image'; - }, - - _getItemToZoom: function() { - if(mfp.currItem.hasSize) { - return mfp.currItem.img; - } else { - return false; - } - }, - - // Get element postion relative to viewport - _getOffset: function(isLarge) { - var el; - if(isLarge) { - el = mfp.currItem.img; - } else { - el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); - } - - var offset = el.offset(); - var paddingTop = parseInt(el.css('padding-top'),10); - var paddingBottom = parseInt(el.css('padding-bottom'),10); - offset.top -= ( $(window).scrollTop() - paddingTop ); + if(!image) { + image = mfp._getItemToZoom(); + if(!image) { + return; + } + animatedImg = getElToAnimate(image); + } - /* - - Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. + animatedImg.css( mfp._getOffset(true) ); + mfp.wrap.append(animatedImg); + mfp.content.css('visibility', 'hidden'); - */ - var obj = { - width: el.width(), - // fix Zepto height+padding issue - height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop - }; + setTimeout(function() { + animatedImg.css( mfp._getOffset() ); + }, 16); + } - // I hate to do this, but there is no another option - if( getHasMozTransform() ) { - obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; - } else { - obj.left = offset.left; - obj.top = offset.top; - } - return obj; - } + }); - } + _mfpOn(CLOSE_EVENT+ns, function() { + if(mfp._allowZoom()) { + showMainContent(); + if(animatedImg) { + animatedImg.remove(); + } + image = null; + } + }); + }, + + _allowZoom: function() { + return mfp.currItem.type === 'image'; + }, + + _getItemToZoom: function() { + if(mfp.currItem.hasSize) { + return mfp.currItem.img; + } else { + return false; + } + }, + + // Get element postion relative to viewport + _getOffset: function(isLarge) { + var el; + if(isLarge) { + el = mfp.currItem.img; + } else { + el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); + } + + var offset = el.offset(); + var paddingTop = parseInt(el.css('padding-top'),10); + var paddingBottom = parseInt(el.css('padding-bottom'),10); + offset.top -= ( $(window).scrollTop() - paddingTop ); + + + /* + + Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. + + */ + var obj = { + width: el.width(), + // fix Zepto height+padding issue + height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop + }; + + // I hate to do this, but there is no another option + if( getHasMozTransform() ) { + obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; + } else { + obj.left = offset.left; + obj.top = offset.top; + } + return obj; + } + + } }); @@ -1547,476 +1486,113 @@ $.magnificPopup.registerModule('zoom', { /*>>iframe*/ var IFRAME_NS = 'iframe', - _emptyPage = '//about:blank', - - _fixIframeBugs = function(isShowing) { - if(mfp.currTemplate[IFRAME_NS]) { - var el = mfp.currTemplate[IFRAME_NS].find('iframe'); - if(el.length) { - // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug - if(!isShowing) { - el[0].src = _emptyPage; - } + _emptyPage = '//about:blank', - // IE8 black screen bug fix - if(mfp.isIE8) { - el.css('display', isShowing ? 'block' : 'none'); - } - } - } - }; + _fixIframeBugs = function(isShowing) { + if(mfp.currTemplate[IFRAME_NS]) { + var el = mfp.currTemplate[IFRAME_NS].find('iframe'); + if(el.length) { + // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug + if(!isShowing) { + el[0].src = _emptyPage; + } + + // IE8 black screen bug fix + if(mfp.isIE8) { + el.css('display', isShowing ? 'block' : 'none'); + } + } + } + }; $.magnificPopup.registerModule(IFRAME_NS, { - options: { - markup: '
'+ - '
'+ - ''+ - '
', + options: { + markup: '
'+ + '
'+ + ''+ + '
', - srcAction: 'iframe_src', + srcAction: 'iframe_src', - // we don't care and support only one default type of URL by default - 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' - } - } - }, + // we don't care and support only one default type of URL by default + 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() { - mfp.types.push(IFRAME_NS); + proto: { + initIframe: function() { + mfp.types.push(IFRAME_NS); - _mfpOn('BeforeChange', function(e, prevType, newType) { - if(prevType !== newType) { - if(prevType === IFRAME_NS) { - _fixIframeBugs(); // iframe if removed - } else if(newType === IFRAME_NS) { - _fixIframeBugs(true); // iframe is showing - } - }// else { - // iframe source is switched, don't do anything - //} - }); + _mfpOn('BeforeChange', function(e, prevType, newType) { + if(prevType !== newType) { + if(prevType === IFRAME_NS) { + _fixIframeBugs(); // iframe if removed + } else if(newType === IFRAME_NS) { + _fixIframeBugs(true); // iframe is showing + } + }// else { + // iframe source is switched, don't do anything + //} + }); - _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { - _fixIframeBugs(); - }); - }, + _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { + _fixIframeBugs(); + }); + }, - getIframe: function(item, template) { - var embedSrc = item.src; - var iframeSt = mfp.st.iframe; - - $.each(iframeSt.patterns, function() { - if(embedSrc.indexOf( this.index ) > -1) { - if(this.id) { - if(typeof this.id === 'string') { - embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); - } else { - embedSrc = this.id.call( this, embedSrc ); - } - } - embedSrc = this.src.replace('%id%', embedSrc ); - return false; // break; - } - }); - - var dataObj = {}; - if(iframeSt.srcAction) { - dataObj[iframeSt.srcAction] = embedSrc; - } - mfp._parseMarkup(template, dataObj, item); + getIframe: function(item, template) { + var embedSrc = item.src; + var iframeSt = mfp.st.iframe; - mfp.updateStatus('ready'); + $.each(iframeSt.patterns, function() { + if(embedSrc.indexOf( this.index ) > -1) { + if(this.id) { + if(typeof this.id === 'string') { + embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); + } else { + embedSrc = this.id.call( this, embedSrc ); + } + } + embedSrc = this.src.replace('%id%', embedSrc ); + return false; // break; + } + }); - return template; - } - } + var dataObj = {}; + if(iframeSt.srcAction) { + dataObj[iframeSt.srcAction] = embedSrc; + } + mfp._parseMarkup(template, dataObj, item); + + mfp.updateStatus('ready'); + + return template; + } + } }); /*>>iframe*/ -/*>>gallery*/ -/** - * Get looped index depending on number of slides - */ -var _getLoopedId = function(index) { - var numSlides = mfp.items.length; - if(index > numSlides - 1) { - return index - numSlides; - } else if(index < 0) { - return numSlides + index; - } - return index; - }, - _replaceCurrTotal = function(text, curr, total) { - return text.replace('%curr%', curr + 1).replace('%total%', total); - }; - -$.magnificPopup.registerModule('gallery', { - - options: { - enabled: false, - arrowMarkup: '', - preload: [0,2], - navigateByImgClick: true, - arrows: true, - - tPrev: 'Previous (Left arrow key)', - tNext: 'Next (Right arrow key)', - tCounter: '%curr% of %total%' - }, - - proto: { - initGallery: function() { - - var gSt = mfp.st.gallery, - ns = '.mfp-gallery', - supportsFastClick = Boolean($.fn.mfpFastClick); - - mfp.direction = true; // true - next, false - prev - - if(!gSt || !gSt.enabled ) return false; - - _wrapClasses += ' mfp-gallery'; - - _mfpOn(OPEN_EVENT+ns, function() { - - if(gSt.navigateByImgClick) { - mfp.wrap.on('click'+ns, '.mfp-img', function() { - if(mfp.items.length > 1) { - mfp.next(); - return false; - } - }); - } - - _document.on('keydown'+ns, function(e) { - if (e.keyCode === 37) { - mfp.prev(); - } else if (e.keyCode === 39) { - mfp.next(); - } - }); - }); - - _mfpOn('UpdateStatus'+ns, function(e, data) { - if(data.text) { - data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); - } - }); - - _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) { - var l = mfp.items.length; - values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; - }); - - _mfpOn('BuildControls' + ns, function() { - if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { - var markup = gSt.arrowMarkup, - arrowLeft = mfp.arrowLeft = $( markup.replace('%title%', gSt.tPrev).replace('%dir%', 'left') ).addClass(PREVENT_CLOSE_CLASS), - arrowRight = mfp.arrowRight = $( markup.replace('%title%', gSt.tNext).replace('%dir%', 'right') ).addClass(PREVENT_CLOSE_CLASS); - - var eName = supportsFastClick ? 'mfpFastClick' : 'click'; - arrowLeft[eName](function() { - mfp.prev(); - }); - arrowRight[eName](function() { - mfp.next(); - }); - - // Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b) - if(mfp.isIE7) { - _getEl('b', arrowLeft[0], false, true); - _getEl('a', arrowLeft[0], false, true); - _getEl('b', arrowRight[0], false, true); - _getEl('a', arrowRight[0], false, true); - } - - mfp.container.append(arrowLeft.add(arrowRight)); - } - }); - - _mfpOn(CHANGE_EVENT+ns, function() { - if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); - - mfp._preloadTimeout = setTimeout(function() { - mfp.preloadNearbyImages(); - mfp._preloadTimeout = null; - }, 16); - }); - _mfpOn(CLOSE_EVENT+ns, function() { - _document.off(ns); - mfp.wrap.off('click'+ns); - - if(mfp.arrowLeft && supportsFastClick) { - mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick(); - } - mfp.arrowRight = mfp.arrowLeft = null; - }); - - }, - next: function() { - mfp.direction = true; - mfp.index = _getLoopedId(mfp.index + 1); - mfp.updateItemHTML(); - }, - prev: function() { - mfp.direction = false; - mfp.index = _getLoopedId(mfp.index - 1); - mfp.updateItemHTML(); - }, - goTo: function(newIndex) { - mfp.direction = (newIndex >= mfp.index); - mfp.index = newIndex; - mfp.updateItemHTML(); - }, - preloadNearbyImages: function() { - var p = mfp.st.gallery.preload, - preloadBefore = Math.min(p[0], mfp.items.length), - preloadAfter = Math.min(p[1], mfp.items.length), - i; - - for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { - mfp._preloadItem(mfp.index+i); - } - for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { - mfp._preloadItem(mfp.index-i); - } - }, - _preloadItem: function(index) { - index = _getLoopedId(index); - - if(mfp.items[index].preloaded) { - return; - } - - var item = mfp.items[index]; - if(!item.parsed) { - item = mfp.parseEl( index ); - } - - _mfpTrigger('LazyLoad', item); - - if(item.type === 'image') { - item.img = $('').on('load.mfploader', function() { - item.hasSize = true; - }).on('error.mfploader', function() { - item.hasSize = true; - item.loadError = true; - }).attr('src', item.src); - } - item.preloaded = true; - } - } -}); -/* -Touch Support that might be implemented some day - -addSwipeGesture: function() { - var startX, - moved, - multipleTouches; - - return; - - var namespace = '.mfp', - addEventNames = function(pref, down, move, up, cancel) { - mfp._tStart = pref + down + namespace; - mfp._tMove = pref + move + namespace; - mfp._tEnd = pref + up + namespace; - mfp._tCancel = pref + cancel + namespace; - }; - - if(window.navigator.msPointerEnabled) { - addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel'); - } else if('ontouchstart' in window) { - addEventNames('touch', 'start', 'move', 'end', 'cancel'); - } else { - return; - } - _window.on(mfp._tStart, function(e) { - var oE = e.originalEvent; - multipleTouches = moved = false; - startX = oE.pageX || oE.changedTouches[0].pageX; - }).on(mfp._tMove, function(e) { - if(e.originalEvent.touches.length > 1) { - multipleTouches = e.originalEvent.touches.length; - } else { - //e.preventDefault(); - moved = true; - } - }).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) { - if(moved && !multipleTouches) { - var oE = e.originalEvent, - diff = startX - (oE.pageX || oE.changedTouches[0].pageX); - - if(diff > 20) { - mfp.next(); - } else if(diff < -20) { - mfp.prev(); - } - } - }); -}, -*/ - - -/*>>gallery*/ - -/*>>retina*/ - -var RETINA_NS = 'retina'; - -$.magnificPopup.registerModule(RETINA_NS, { - options: { - replaceSrc: function(item) { - return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; }); - }, - ratio: 1 // Function or number. Set to 1 to disable. - }, - proto: { - initRetina: function() { - if(window.devicePixelRatio > 1) { - - var st = mfp.st.retina, - ratio = st.ratio; - - ratio = !isNaN(ratio) ? ratio : ratio(); - - if(ratio > 1) { - _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) { - item.img.css({ - 'max-width': item.img[0].naturalWidth / ratio, - 'width': '100%' - }); - }); - _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) { - item.src = st.replaceSrc(item, ratio); - }); - } - } - - } - } -}); - -/*>>retina*/ - -/*>>fastclick*/ -/** - * FastClick event implementation. (removes 300ms delay on touch devices) - * Based on https://developers.google.com/mobile/articles/fast_buttons - * - * You may use it outside the Magnific Popup by calling just: - * - * $('.your-el').mfpFastClick(function() { - * console.log('Clicked!'); - * }); - * - * To unbind: - * $('.your-el').destroyMfpFastClick(); - * - * - * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound. - * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick - * - */ - -(function() { - var ghostClickDelay = 1000, - supportsTouch = 'ontouchstart' in window, - unbindTouchMove = function() { - _window.off('touchmove'+ns+' touchend'+ns); - }, - eName = 'mfpFastClick', - ns = '.'+eName; - - - // As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way - $.fn.mfpFastClick = function(callback) { - - return $(this).each(function() { - - var elem = $(this), - lock; - - if( supportsTouch ) { - - var timeout, - startX, - startY, - pointerMoved, - point, - numPointers; - - elem.on('touchstart' + ns, function(e) { - pointerMoved = false; - numPointers = 1; - - point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0]; - startX = point.clientX; - startY = point.clientY; - - _window.on('touchmove'+ns, function(e) { - point = e.originalEvent ? e.originalEvent.touches : e.touches; - numPointers = point.length; - point = point[0]; - if (Math.abs(point.clientX - startX) > 10 || - Math.abs(point.clientY - startY) > 10) { - pointerMoved = true; - unbindTouchMove(); - } - }).on('touchend'+ns, function(e) { - unbindTouchMove(); - if(pointerMoved || numPointers > 1) { - return; - } - lock = true; - e.preventDefault(); - clearTimeout(timeout); - timeout = setTimeout(function() { - lock = false; - }, ghostClickDelay); - callback(); - }); - }); - - } - - elem.on('click' + ns, function() { - if(!lock) { - callback(); - } - }); - }); - }; - - $.fn.destroyMfpFastClick = function() { - $(this).off('touchstart' + ns + ' click' + ns); - if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns); - }; -})(); - -/*>>fastclick*/ -})(window.jQuery || window.Zepto); \ No newline at end of file + _checkInstance(); })(window.jQuery || window.Zepto); \ No newline at end of file diff --git a/templates/2k11/admin/js/modernizr-2.7.2.min.js b/templates/2k11/admin/js/modernizr-2.7.2.min.js index d3d28660..52d3137c 100644 --- a/templates/2k11/admin/js/modernizr-2.7.2.min.js +++ b/templates/2k11/admin/js/modernizr-2.7.2.min.js @@ -1,4 +1,4 @@ /* Modernizr 2.7.2 (Custom Build) | MIT & BSD - * Build: http://modernizr.com/download/#-touch-shiv-mq-cssclasses-teststyles-hasevent-prefixes + * Build: http://modernizr.com/download/#-input-inputtypes-touch-shiv-mq-cssclasses-teststyles-prefixes */ -;window.Modernizr=function(a,b,c){function y(a){j.cssText=a}function z(a,b){return y(m.join(a+";")+(b||""))}function A(a,b){return typeof a===b}function B(a,b){return!!~(""+a).indexOf(b)}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:A(f,"function")?f.bind(d||b):f}return!1}var d="2.7.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},u=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return t("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},v=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=A(e[d],"function"),A(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),w={}.hasOwnProperty,x;!A(w,"undefined")&&!A(w.call,"undefined")?x=function(a,b){return w.call(a,b)}:x=function(a,b){return b in a&&A(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:t(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var D in n)x(n,D)&&(s=D.toLowerCase(),e[s]=n[D](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)x(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},y(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e.mq=u,e.hasEvent=v,e.testStyles=t,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document); \ No newline at end of file +;window.Modernizr=function(a,b,c){function y(a){j.cssText=a}function z(a,b){return y(n.join(a+";")+(b||""))}function A(a,b){return typeof a===b}function B(a,b){return!!~(""+a).indexOf(b)}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:A(f,"function")?f.bind(d||b):f}return!1}function D(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},v=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return u("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},w={}.hasOwnProperty,x;!A(w,"undefined")&&!A(w.call,"undefined")?x=function(a,b){return w.call(a,b)}:x=function(a,b){return b in a&&A(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=s.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(s.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(s.call(arguments)))};return e}),o.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:u(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var E in o)x(o,E)&&(t=E.toLowerCase(),e[t]=o[E](),r.push((e[t]?"":"no-")+t));return e.input||D(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)x(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},y(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=n,e.mq=v,e.testStyles=u,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+r.join(" "):""),e}(this,this.document); \ No newline at end of file diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css index 7c100ca4..f9062215 100644 --- a/templates/2k11/admin/style.css +++ b/templates/2k11/admin/style.css @@ -2267,16 +2267,14 @@ input[name="serendipity[filter][fileCategory]"] { text-align: left; z-index: 1045; } -.mfp-inline-holder .mfp-content, -.mfp-ajax-holder .mfp-content { +.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 { +.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close { cursor: -moz-zoom-out; cursor: -webkit-zoom-out; cursor: zoom-out; } @@ -2290,10 +2288,7 @@ input[name="serendipity[filter][fileCategory]"] { .mfp-auto-cursor .mfp-content { cursor: auto; } -.mfp-close, -.mfp-arrow, -.mfp-preloader, -.mfp-counter { +.mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter { -webkit-user-select: none; -moz-user-select: none; user-select: none; } @@ -2314,12 +2309,10 @@ input[name="serendipity[filter][fileCategory]"] { left: 8px; right: 8px; z-index: 1044; } - -.mfp-preloader a { - color: #cccccc; } - -.mfp-preloader a:hover { - color: white; } + .mfp-preloader a { + color: #cccccc; } + .mfp-preloader a:hover { + color: white; } .mfp-s-ready .mfp-preloader { display: none; } @@ -2327,17 +2320,18 @@ input[name="serendipity[filter][fileCategory]"] { .mfp-s-error .mfp-content { display: none; } -button.mfp-close, -button.mfp-arrow { +button.mfp-close, button.mfp-arrow { overflow: visible; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; display: block; + outline: none; padding: 0; - z-index: 1046; } - + z-index: 1046; + -webkit-box-shadow: none; + box-shadow: none; } button::-moz-focus-inner { padding: 0; border: 0; } @@ -2352,21 +2346,22 @@ button::-moz-focus-inner { text-decoration: none; text-align: center; opacity: 0.65; + filter: alpha(opacity=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; } + opacity: 1; + filter: alpha(opacity=100); } .mfp-close:active { top: 1px; } .mfp-close-btn-in .mfp-close { color: #333333; } -.mfp-image-holder .mfp-close, -.mfp-iframe-holder .mfp-close { +.mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close { color: white; right: -6px; text-align: right; @@ -2384,6 +2379,7 @@ button::-moz-focus-inner { .mfp-arrow { position: absolute; opacity: 0.65; + filter: alpha(opacity=65); margin: 0; top: 50%; margin-top: -55px; @@ -2391,85 +2387,72 @@ button::-moz-focus-inner { 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 { - border-top-width: 13px; - border-bottom-width: 13px; - top: 8px; } -.mfp-arrow:before, -.mfp-arrow .mfp-b { - border-top-width: 21px; - border-bottom-width: 21px; } + .mfp-arrow:active { + margin-top: -54px; } + .mfp-arrow:hover, .mfp-arrow:focus { + opacity: 1; + filter: alpha(opacity=100); } + .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: medium inset transparent; } + .mfp-arrow:after, .mfp-arrow .mfp-a { + border-top-width: 13px; + border-bottom-width: 13px; + top: 8px; } + .mfp-arrow:before, .mfp-arrow .mfp-b { + border-top-width: 21px; + border-bottom-width: 21px; + opacity: 0.7; } .mfp-arrow-left { left: 0; } - .mfp-arrow-left:after, - .mfp-arrow-left .mfp-a { + .mfp-arrow-left:after, .mfp-arrow-left .mfp-a { border-right: 17px solid white; margin-left: 31px; } - .mfp-arrow-left:before, - .mfp-arrow-left .mfp-b { + .mfp-arrow-left:before, .mfp-arrow-left .mfp-b { margin-left: 25px; border-right: 27px solid #3f3f3f; } .mfp-arrow-right { right: 0; } - .mfp-arrow-right:after, - .mfp-arrow-right .mfp-a { + .mfp-arrow-right:after, .mfp-arrow-right .mfp-a { border-left: 17px solid white; margin-left: 39px; } - .mfp-arrow-right:before, - .mfp-arrow-right .mfp-b { + .mfp-arrow-right:before, .mfp-arrow-right .mfp-b { border-left: 27px solid #3f3f3f; } .mfp-iframe-holder { padding-top: 40px; padding-bottom: 40px; } - -.mfp-iframe-holder .mfp-content { - line-height: 0; - width: 100%; - max-width: 900px; } + .mfp-iframe-holder .mfp-content { + line-height: 0; + width: 100%; + max-width: 900px; } + .mfp-iframe-holder .mfp-close { + top: -40px; } .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; } + .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; } /* Main image in popup */ img.mfp-img { @@ -2485,22 +2468,28 @@ img.mfp-img { 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); - background: #444444; } - .mfp-figure { line-height: 0; } + .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); + background: #444444; } + .mfp-figure small { + color: #bdbdbd; + display: block; + font-size: 12px; + line-height: 14px; } + .mfp-figure figure { + margin: 0; } .mfp-bottom-bar { margin-top: -36px; @@ -2514,15 +2503,9 @@ img.mfp-img { text-align: left; line-height: 18px; color: #f3f3f3; - word-break: break-word; + word-wrap: 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%; } @@ -2531,20 +2514,19 @@ img.mfp-img { @media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) { /** - * Remove all paddings around the image on small screen - */ + * 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-figure small { + display: inline; + margin-left: 5px; } .mfp-img-mobile .mfp-bottom-bar { background: rgba(0, 0, 0, 0.6); bottom: 0; @@ -2555,14 +2537,11 @@ img.mfp-img { -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-bottom-bar:empty { + padding: 0; } .mfp-img-mobile .mfp-counter { right: 5px; top: 3px; } - .mfp-img-mobile .mfp-close { top: 0; right: 0; @@ -2572,27 +2551,22 @@ img.mfp-img { background: rgba(0, 0, 0, 0.6); position: fixed; text-align: center; - padding: 0; } + padding: 0; } } - .mfp-img-mobile .mfp-figure small { - display: inline; - margin-left: 5px; } } @media all and (max-width: 900px) { .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 { From a04a2de5c58a6f9812a8be9b8a7804530404baf8 Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Sun, 20 Apr 2014 14:09:47 +0200 Subject: [PATCH 05/16] Remove redundant comment. --- templates/2k11/admin/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css index f9062215..e60df107 100644 --- a/templates/2k11/admin/style.css +++ b/templates/2k11/admin/style.css @@ -2178,7 +2178,6 @@ input[name="serendipity[filter][fileCategory]"] { border-right: 0 none; } -/* Needs IE8 fallback */ .media_selector:first-of-type, .tabs > ul .first > a { border-radius: 4px 0 0 4px; From f704df9365360de248b058052359ccb341b650ef Mon Sep 17 00:00:00 2001 From: onli Date: Wed, 23 Apr 2014 02:27:14 +0200 Subject: [PATCH 06/16] support html5 multiple upload closes #126 --- include/admin/images.inc.php | 132 ++++++++++-------- templates/2k11/admin/media_upload.tpl | 2 +- .../2k11/admin/serendipity_editor.js.tpl | 13 ++ 3 files changed, 85 insertions(+), 62 deletions(-) diff --git a/include/admin/images.inc.php b/include/admin/images.inc.php index 4bea7201..a6c5ec43 100644 --- a/include/admin/images.inc.php +++ b/include/admin/images.inc.php @@ -265,73 +265,83 @@ switch ($serendipity['GET']['adminAction']) { serendipity_request_end(); } } else { - if (!is_array($serendipity['POST']['target_filename'])) { + if (!is_array($_FILES['serendipity']['name']['userfile'])) { break; } - foreach($serendipity['POST']['target_filename'] AS $idx => $target_filename) { - $uploadfile = &$_FILES['serendipity']['name']['userfile'][$idx]; - $uploadtmp = &$_FILES['serendipity']['tmp_name']['userfile'][$idx]; - if (!empty($target_filename)) { - $tfile = $target_filename; - } elseif (!empty($uploadfile)) { - $tfile = $uploadfile; - } else { - // skip empty array - continue; + foreach($_FILES['serendipity']['name']['userfile'] AS $idx => $uploadfiles) { + if (! is_array($uploadfiles)) { + $uploadfiles = array($uploadfiles); } - - $tfile = serendipity_uploadSecure(basename($tfile)); - - if (serendipity_isActiveFile($tfile)) { - $messages[] = ERROR_FILE_FORBIDDEN .' '. $tfile; - continue; - } - - $serendipity['POST']['target_directory'][$idx] = serendipity_uploadSecure($serendipity['POST']['target_directory'][$idx], true, true); - - if (!serendipity_checkDirUpload($serendipity['POST']['target_directory'][$idx])) { - $messages[] = PERM_DENIED; - continue; - } - - $target = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['POST']['target_directory'][$idx] . $tfile; - - $realname = $tfile; - if (file_exists($target)) { - $messages[] = '(' . $target . ') ' . ERROR_FILE_EXISTS_ALREADY; - $realname = serendipity_imageAppend($tfile, $target, $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['POST']['target_directory'][$idx]); - } - - // Accept file - if (is_uploaded_file($uploadtmp) && serendipity_checkMediaSize($uploadtmp) && move_uploaded_file($uploadtmp, $target)) { - $messages[] = sprintf( FILE_UPLOADED , $uploadfile , $target); - @umask(0000); - @chmod($target, 0664); - - $thumbs = array(array( - 'thumbSize' => $serendipity['thumbSize'], - 'thumb' => $serendipity['thumbSuffix'] - )); - serendipity_plugin_api::hook_event('backend_media_makethumb', $thumbs); - - foreach($thumbs as $thumb) { - // Create thumbnail - if ( $created_thumbnail = serendipity_makeThumbnail($tfile, $serendipity['POST']['target_directory'][$idx], $thumb['thumbSize'], $thumb['thumb']) ) { - $messages[] = THUMB_CREATED_DONE; - } + $uploadFileCounter=-1; + foreach($uploadfiles AS $uploadfile) { + $uploadFileCounter++; + $target_filename = $serendipity['POST']['target_filename'][$idx]; + $uploadtmp = $_FILES['serendipity']['tmp_name']['userfile'][$idx]; + if (is_array($uploadtmp)) { + $uploadtmp = $uploadtmp[$uploadFileCounter]; + } + if (!empty($target_filename)) { + $tfile = $target_filename; + } elseif (!empty($uploadfile)) { + $tfile = $uploadfile; + } else { + // skip empty array + continue; } - // Insert into database - $image_id = serendipity_insertImageInDatabase($tfile, $serendipity['POST']['target_directory'][$idx], $authorid, null, $realname); - serendipity_plugin_api::hook_event('backend_image_add', $target, $created_thumbnail); - $new_media[] = array( - 'image_id' => $image_id, - 'target' => $target, - 'created_thumbnail' => $created_thumbnail - ); - } else { - $messages[] = ERROR_UNKNOWN_NOUPLOAD; + $tfile = serendipity_uploadSecure(basename($tfile)); + + if (serendipity_isActiveFile($tfile)) { + $messages[] = ERROR_FILE_FORBIDDEN .' '. $tfile; + continue; + } + + $serendipity['POST']['target_directory'][$idx] = serendipity_uploadSecure($serendipity['POST']['target_directory'][$idx], true, true); + + if (!serendipity_checkDirUpload($serendipity['POST']['target_directory'][$idx])) { + $messages[] = PERM_DENIED; + continue; + } + + $target = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['POST']['target_directory'][$idx] . $tfile; + + $realname = $tfile; + if (file_exists($target)) { + $messages[] = '(' . $target . ') ' . ERROR_FILE_EXISTS_ALREADY; + $realname = serendipity_imageAppend($tfile, $target, $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['POST']['target_directory'][$idx]); + } + + // Accept file + if (is_uploaded_file($uploadtmp) && serendipity_checkMediaSize($uploadtmp) && move_uploaded_file($uploadtmp, $target)) { + $messages[] = sprintf( FILE_UPLOADED , $uploadfile , $target); + @umask(0000); + @chmod($target, 0664); + + $thumbs = array(array( + 'thumbSize' => $serendipity['thumbSize'], + 'thumb' => $serendipity['thumbSuffix'] + )); + serendipity_plugin_api::hook_event('backend_media_makethumb', $thumbs); + + foreach($thumbs as $thumb) { + // Create thumbnail + if ( $created_thumbnail = serendipity_makeThumbnail($tfile, $serendipity['POST']['target_directory'][$idx], $thumb['thumbSize'], $thumb['thumb']) ) { + $messages[] = THUMB_CREATED_DONE; + } + } + + // Insert into database + $image_id = serendipity_insertImageInDatabase($tfile, $serendipity['POST']['target_directory'][$idx], $authorid, null, $realname); + serendipity_plugin_api::hook_event('backend_image_add', $target, $created_thumbnail); + $new_media[] = array( + 'image_id' => $image_id, + 'target' => $target, + 'created_thumbnail' => $created_thumbnail + ); + } else { + $messages[] = ERROR_UNKNOWN_NOUPLOAD; + } } } } diff --git a/templates/2k11/admin/media_upload.tpl b/templates/2k11/admin/media_upload.tpl index c1dec1e1..87d70aa8 100644 --- a/templates/2k11/admin/media_upload.tpl +++ b/templates/2k11/admin/media_upload.tpl @@ -18,7 +18,7 @@
- +
diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index bf30b0d0..2c5f58bc 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -1296,6 +1296,19 @@ $(function() { }); } + if ($('.uploadform_userfile').length > 0) { + $('.uploadform_userfile').change(function() { + if ($(this).get(0).files.length > 1) { + $(this).parent().siblings(':first').fadeOut(); + $(this).parent().siblings(':first').find('input').val(''); + $(this).attr('name', $(this).attr('name') + '[]'); + } + if ($(this).get(0).files.length == 1) { + $(this).parent().siblings(':first').fadeIn(); + } + }); + } + // reopen detail element after spamblock action if ($('#serendipity_comments_list').length > 0 && window.location.hash && $('#' + window.location.hash.replace('#', '')).length > 0) { $('#' + window.location.hash.replace('#', '')).find(".toggle_info").click(); From 063b753892cb0fe5faa4730a2a3bc0ec531c1241 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Thu, 24 Apr 2014 15:21:25 +0200 Subject: [PATCH 07/16] Proof of concept idea for the "filter category" idea http://board.s9y.org/viewtopic.php?f=11&t=19862 --- templates/2k11/admin/entries.tpl | 6 ++++++ templates/2k11/admin/serendipity_editor.js.tpl | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/templates/2k11/admin/entries.tpl b/templates/2k11/admin/entries.tpl index 361b9f17..614eda55 100644 --- a/templates/2k11/admin/entries.tpl +++ b/templates/2k11/admin/entries.tpl @@ -107,6 +107,12 @@
{$CONST.CATEGORY} + +
+ + +
+ {foreach from=$entry_vars.category_options item="entry_cat"}
{$entry_cat.depth_pad} diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index 2c5f58bc..8647d393 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -983,6 +983,22 @@ $(function() { } {/if} + $('#categoryfilter').keyup(function() { + var current_categoryfilter = $(this).val().toLowerCase(); + + if (current_categoryfilter == '') { + $('#edit_entry_category .form_check').toggle(true); + } else { + $('#edit_entry_category .form_check').each(function() { + if ($(this).find('label').html().toLowerCase().indexOf(current_categoryfilter) > -1) { + $(this).toggle(true); + } else { + $(this).toggle(false); + } + }); + } + }); + // Advanced options if($('#advanced_options').length > 0) { $('#toggle_advanced').click(function() { From f89b34f2b04968e40a7bd2cb2f21971d96155dee Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Thu, 24 Apr 2014 15:28:13 +0200 Subject: [PATCH 08/16] Fix issue #128 --- templates/2k11/admin/serendipity_editor.js.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index 8647d393..5a46ef6d 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -88,7 +88,7 @@ var my_link = prompt("Enter URL:","http://"); if (my_link) { - if (getSelection($(txtarea) ) == "") { + if (serendipity.getSelection($(txtarea) ) == "") { var my_desc = prompt("Enter Description", ''); } var my_title = prompt("Enter title/tooltip:", ""); From efbfb2b320cba311dfe6710fbc53d9d11ee4d85e Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 24 Apr 2014 16:06:25 +0200 Subject: [PATCH 09/16] Proof of concept for CKEDITOR WYSIWYG-Mode respecting "S9y image floats" The stylesheet would need some love though! (YL?) :) References #129 --- htmlarea/ckeditor_custom_config.js | 5 +- htmlarea/wysiwyg-style.css | 86 ++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 htmlarea/wysiwyg-style.css diff --git a/htmlarea/ckeditor_custom_config.js b/htmlarea/ckeditor_custom_config.js index e279953e..f620f7b6 100644 --- a/htmlarea/ckeditor_custom_config.js +++ b/htmlarea/ckeditor_custom_config.js @@ -1,5 +1,5 @@ /** - * @fileOverview A Serendipity CKEDITOR custom config file: ckeditor_custom_config.js, v. 1.0, 2014-03-14, Ian + * @fileOverview A Serendipity CKEDITOR custom config file: ckeditor_custom_config.js, v. 1.1, 2014-04-24, Ian */ /** @@ -54,6 +54,9 @@ CKEDITOR.editorConfig = function( config ) { // It will still generate an empty

though. config.autoParagraph = false; // but this one definitely prevents adding multiple empty paragraphs when switching source mode!!! + // add custom Serendipity styles to ckeditor wysiwyg-mode, to repect css image floats + config.contentsCss = 'htmlarea/wysiwyg-style.css'; + // The configuration setting that controls the ENTER mode is "config.enterMode" and it offers three options: // (1) The default creates a paragraph element each time the "enter" key is pressed: //config.enterMode = CKEDITOR.ENTER_P; // inserts

diff --git a/htmlarea/wysiwyg-style.css b/htmlarea/wysiwyg-style.css new file mode 100644 index 00000000..acb2ba20 --- /dev/null +++ b/htmlarea/wysiwyg-style.css @@ -0,0 +1,86 @@ +/** + * Adds custom Serendipity image float styles to CKEDITOR wysiwyg-mode + */ + +.serendipity_image_left, +.serendipity_image_right, +.serendipity_image_center, +.serendipity_imageComment_center, +.serendipity_imageComment_left, +.serendipity_imageComment_right { + background: transparent; + border: 0 none; + padding: 0!important; +} + +.serendipity_image_left, +.serendipity_image_right, +.serendipity_imageComment_left, +.serendipity_imageComment_right { + display: block; + float: none; + margin: 0 0 1em; +} + +.serendipity_image_center { + display: block; + margin: 0 auto 1em auto; +} + +.plain-images .serendipity_image_left, +.plain-images .serendipity_image_right, +.plain-images .serendipity_image_center, +.plain-images .serendipity_imageComment_center, +.plain-images .serendipity_imageComment_left, +.plain-images .serendipity_imageComment_right { + border: 1px solid #aaa; +} + +.plain-images .serendipity_imageComment_txt { + background: #ddd; +} + +.fancy-images .serendipity_image_left, +.fancy-images .serendipity_image_right, +.fancy-images .serendipity_image_center, +.fancy-images .serendipity_imageComment_img { + -webkit-box-shadow: 0 0 2px 1px rgba(0,0,0,.5); + -moz-box-shadow: 0 0 2px 1px rgba(0,0,0,.5); + box-shadow: 0 0 2px 1px rgba(0,0,0,.5); +} + +.no-boxshadow .fancy-images .serendipity_image_left, +.no-boxshadow .fancy-images .serendipity_image_right, +.no-boxshadow .fancy-images .serendipity_image_center, +.no-boxshadow .fancy-images .serendipity_imageComment_img { + border: 1px solid #aaa; +} + +.serendipity_imageComment_center, +.serendipity_imageComment_left, +.serendipity_imageComment_right { + height: auto; + max-width: 100%; +} + +.serendipity_image_left { + float: left; + margin: 0 2em 1em 0; +} + +.serendipity_image_right { + float: right; + margin: 0 0 1em 2em; +} + +.serendipity_imageComment_left { + display: inline; + float: left; + margin: 0 2em 1em 0; +} + +.serendipity_imageComment_right { + display: inline; + float: right; + margin: 0 0 1em 2em; +} From 2ae6bcc5dd9d626c229bd4443a404d979d58b46f Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Thu, 24 Apr 2014 17:30:40 +0200 Subject: [PATCH 10/16] Add reset button for category filter; add some styling. References #123 --- templates/2k11/admin/entries.tpl | 7 ++++--- templates/2k11/admin/serendipity_editor.js.tpl | 13 ++++++++++--- templates/2k11/admin/style.css | 5 +++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/templates/2k11/admin/entries.tpl b/templates/2k11/admin/entries.tpl index 614eda55..5f57f901 100644 --- a/templates/2k11/admin/entries.tpl +++ b/templates/2k11/admin/entries.tpl @@ -108,9 +108,10 @@
{$CONST.CATEGORY} -
- - +
+ + + {* i18n *}
{foreach from=$entry_vars.category_options item="entry_cat"} diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index 5a46ef6d..23eacbc3 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -983,6 +983,7 @@ $(function() { } {/if} + // Category filter $('#categoryfilter').keyup(function() { var current_categoryfilter = $(this).val().toLowerCase(); @@ -990,15 +991,21 @@ $(function() { $('#edit_entry_category .form_check').toggle(true); } else { $('#edit_entry_category .form_check').each(function() { - if ($(this).find('label').html().toLowerCase().indexOf(current_categoryfilter) > -1) { - $(this).toggle(true); + var $el = $(this); + if ($el.find('label').html().toLowerCase().indexOf(current_categoryfilter) > -1) { + $el.toggle(true); } else { - $(this).toggle(false); + $el.toggle(false); } }); } }); + // Reset button for category filter + $('#reset_categoryfilter').click(function() { + $('#categoryfilter').val("").keyup(); + }); + // Advanced options if($('#advanced_options').length > 0) { $('#toggle_advanced').click(function() { diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css index e60df107..f55e4d19 100644 --- a/templates/2k11/admin/style.css +++ b/templates/2k11/admin/style.css @@ -1259,6 +1259,10 @@ summary { padding: .4em 0; } +#categoryfilter { + min-width: 20em; +} + .user_level { display: block; } @@ -2146,6 +2150,7 @@ label .perm_name, .no-js .comment_summary, .no-js .show_config_option .icon-right-dir, .no-js #keyword_list, +.no-js #category_filter, .js .additional_info, .js .installer .icon-info-circled, .hidden, From 631bc150ac06b1b66263af29172833a00e7d464c Mon Sep 17 00:00:00 2001 From: onli Date: Thu, 24 Apr 2014 18:25:56 +0200 Subject: [PATCH 11/16] improve update notice: timeout, config The updater in the dashboard needed a timeout to not kill the backend if github is not reachable Also, this makes the check configurable --- include/admin/overview.inc.php | 7 +++++ include/functions_installer.inc.php | 41 +++++++++++++++++++++------ include/tpl/config_local.inc.php | 6 ++++ templates/2k11/admin/overview.inc.tpl | 23 +++++++++++---- 4 files changed, 63 insertions(+), 14 deletions(-) diff --git a/include/admin/overview.inc.php b/include/admin/overview.inc.php index 4954df1d..6f221354 100644 --- a/include/admin/overview.inc.php +++ b/include/admin/overview.inc.php @@ -23,6 +23,12 @@ switch($serendipity['POST']['adminAction']) { $data['error_publish'] = $success; } break; + case 'updateCheckDisable': + if ( !serendipity_checkFormToken() || !serendipity_checkPermission('blogConfiguration') ) { + break; + } + serendipity_set_config_var('updateCheck', false); + break; } @@ -40,6 +46,7 @@ $data['backend_frontpage_display'] = $output['more']; $data['curVersion'] = serendipity_getCurrentVersion(); $data['usedVersion'] = $serendipity['version']; +$data['updateCheck'] = $serendipity['updateCheck']; $data['update'] = version_compare($data['usedVersion'], $data['curVersion'], '<'); diff --git a/include/functions_installer.inc.php b/include/functions_installer.inc.php index 28170ccf..e993dd4e 100644 --- a/include/functions_installer.inc.php +++ b/include/functions_installer.inc.php @@ -1196,21 +1196,44 @@ function serendipity_verifyFTPChecksums() { return $badsums; } + +/** + * Check https://raw.github.com/s9y/Serendipity/master/docs/RELEASE for the newest available version + * + * If the file is not fetch- or parseable (behind a proxy, malformed by Garvin), this will return -1 + * */ function serendipity_getCurrentVersion() { - $updateURL = 'https://raw.github.com/s9y/Serendipity/master/docs/RELEASE'; - - $file = fopen($updateURL, 'r'); - if (!$file) { - return; + global $serendipity; + if ($serendipity['updateCheck'] != "stable" && $serendipity['updateCheck'] != "beta") { + return -1; } + $updateURL = 'https://raw.github.com/s9y/Serendipity/master/docs/RELEASE'; + $context = stream_context_create( array('http'=>array('timeout' => 5.0)) ); - while (!feof($file)) { - $line = fgets($file); + $file = @file_get_contents($updateURL, false, $context); - if (preg_match('/stable:(.+$)/', $line, $match)) { - return $match[1]; + if ( ! $file) { + if (function_exists('curl_init')) { + $ch = curl_init($updateURL); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_TIMEOUT, "5"); + $file = curl_exec($ch); + curl_close($ch); } } + + if ($file) { + if ($serendipity['updateCheck'] == "stable") { + if (preg_match('/^stable:(.+)\b/', $file, $match)) { + return $match[1]; + } + } else { + if (preg_match('/^beta:(.+)\b/', $file, $match)) { + return $match[1]; + } + } + } + return -1; } /* vim: set sts=4 ts=4 sw=4 expandtab : */ diff --git a/include/tpl/config_local.inc.php b/include/tpl/config_local.inc.php index e7ed6196..ac3cb1ef 100644 --- a/include/tpl/config_local.inc.php +++ b/include/tpl/config_local.inc.php @@ -398,6 +398,12 @@ 'type' => 'bool', 'default' => false, 'permission' => 'blogConfiguration'), + array('var' => 'updateCheck', + 'title' => UPDATE_NOTIFICATION, + 'description' => "Show the update notification in the Dashboard, and for which channel?", # i18n + 'type' => 'list', + 'default' => array('stable' => 'stable', 'beta' => 'beta', 'false' => NO ), # i18n + 'permission' => 'blogConfiguration'), )); $res['display'] = diff --git a/templates/2k11/admin/overview.inc.tpl b/templates/2k11/admin/overview.inc.tpl index 09e4cfc0..6620b96d 100644 --- a/templates/2k11/admin/overview.inc.tpl +++ b/templates/2k11/admin/overview.inc.tpl @@ -11,12 +11,25 @@ {$CONST.PUBLISH_ERROR}: {$error_publish} {/if} - {if $update} -
-

{$CONST.UPDATE_NOTIFICATION}

+ {if $updateCheck == "stable" || $updateCheck == "beta" } + {if $curVersion == -1} +
+

{$CONST.UPDATE_NOTIFICATION}

- {$CONST.NEW_VERSION_AVAILABLE} {$curVersion} -
+ Check for new Serendipity version failed {* i18n *} +
+ + {$token} + {* i18n *} +
+
+ {else if $update} +
+

{$CONST.UPDATE_NOTIFICATION}

+ + {$CONST.NEW_VERSION_AVAILABLE} {$curVersion} +
+ {/if} {/if}

{if 'adminComments'|checkPermission}{/if}{$CONST.COMMENTS}{if 'adminComments'|checkPermission}{/if}

From 10d26f6fbfeb7ead71a73ef489379796699f5ec9 Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 24 Apr 2014 18:56:38 +0200 Subject: [PATCH 12/16] fix RecursiveDirectoryIterator() UnexpectedValueException thrown for PHP >= 5.3 @mattsches please test References #116 and http://board.s9y.org/viewtopic.php?f=1&t=19860 --- include/functions_upgrader.inc.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/functions_upgrader.inc.php b/include/functions_upgrader.inc.php index ae40d0f8..91e8848b 100644 --- a/include/functions_upgrader.inc.php +++ b/include/functions_upgrader.inc.php @@ -163,12 +163,8 @@ $dead_htmlarea_dirs = array( */ function recursive_directory_iterator($dir = array()) { foreach ($dir AS $path) { - try { - serendipity_removeDeadFiles_SPL($path); - @rmdir($path); - } catch (Exception $e) { - echo htmlspecialchars($path) . " >> File or directory probably does not exist.
"; - } + serendipity_removeDeadFiles_SPL($path); + @rmdir($path); } } @@ -293,7 +289,13 @@ function serendipity_killPlugin($name) { */ function serendipity_removeDeadFiles_SPL($dir=null, $deadfiles=null, $purgedir=null, $list_only=false) { if (!is_dir($dir)) return; - $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST); + try { + $_dir = new RecursiveDirectoryIterator($dir); + // NOTE: UnexpectedValueException thrown for PHP >= 5.3 + } catch (Exception $e) { + return; + } + $iterator = new RecursiveIteratorIterator($_dir, RecursiveIteratorIterator::CHILD_FIRST); $search = array("\\", '//'); $replace = array('/'); foreach ($iterator as $file) { From 919674e25a73a25d8589c825771060ba7fcd6600 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 25 Apr 2014 09:30:21 +0200 Subject: [PATCH 13/16] i81n for categoryfilter --- lang/UTF-8/plugin_lang.php | 1 + lang/UTF-8/serendipity_lang_bg.inc.php | 1 + lang/UTF-8/serendipity_lang_cn.inc.php | 1 + lang/UTF-8/serendipity_lang_cs.inc.php | 1 + lang/UTF-8/serendipity_lang_cz.inc.php | 1 + lang/UTF-8/serendipity_lang_da.inc.php | 1 + lang/UTF-8/serendipity_lang_de.inc.php | 1 + lang/UTF-8/serendipity_lang_en.inc.php | 3 ++- lang/UTF-8/serendipity_lang_es.inc.php | 1 + lang/UTF-8/serendipity_lang_fa.inc.php | 1 + lang/UTF-8/serendipity_lang_fi.inc.php | 1 + lang/UTF-8/serendipity_lang_fr.inc.php | 1 + lang/UTF-8/serendipity_lang_hu.inc.php | 1 + lang/UTF-8/serendipity_lang_is.inc.php | 1 + lang/UTF-8/serendipity_lang_it.inc.php | 1 + lang/UTF-8/serendipity_lang_ja.inc.php | 1 + lang/UTF-8/serendipity_lang_ko.inc.php | 1 + lang/UTF-8/serendipity_lang_nl.inc.php | 1 + lang/UTF-8/serendipity_lang_no.inc.php | 1 + lang/UTF-8/serendipity_lang_pl.inc.php | 1 + lang/UTF-8/serendipity_lang_pt.inc.php | 1 + lang/UTF-8/serendipity_lang_pt_PT.inc.php | 1 + lang/UTF-8/serendipity_lang_ro.inc.php | 1 + lang/UTF-8/serendipity_lang_ru.inc.php | 1 + lang/UTF-8/serendipity_lang_sa.inc.php | 1 + lang/UTF-8/serendipity_lang_se.inc.php | 1 + lang/UTF-8/serendipity_lang_sk.inc.php | 1 + lang/UTF-8/serendipity_lang_ta.inc.php | 1 + lang/UTF-8/serendipity_lang_tn.inc.php | 1 + lang/UTF-8/serendipity_lang_tr.inc.php | 1 + lang/UTF-8/serendipity_lang_tw.inc.php | 1 + lang/UTF-8/serendipity_lang_zh.inc.php | 1 + lang/addlang.txt | 5 +---- lang/plugin_lang.php | 1 + lang/serendipity_lang_bg.inc.php | 1 + lang/serendipity_lang_cn.inc.php | 1 + lang/serendipity_lang_cs.inc.php | 1 + lang/serendipity_lang_cz.inc.php | 1 + lang/serendipity_lang_da.inc.php | 1 + lang/serendipity_lang_de.inc.php | 1 + lang/serendipity_lang_en.inc.php | 1 + lang/serendipity_lang_es.inc.php | 1 + lang/serendipity_lang_fa.inc.php | 1 + lang/serendipity_lang_fi.inc.php | 1 + lang/serendipity_lang_fr.inc.php | 1 + lang/serendipity_lang_hu.inc.php | 1 + lang/serendipity_lang_is.inc.php | 1 + lang/serendipity_lang_it.inc.php | 1 + lang/serendipity_lang_ja.inc.php | 1 + lang/serendipity_lang_ko.inc.php | 1 + lang/serendipity_lang_nl.inc.php | 1 + lang/serendipity_lang_no.inc.php | 1 + lang/serendipity_lang_pl.inc.php | 1 + lang/serendipity_lang_pt.inc.php | 1 + lang/serendipity_lang_pt_PT.inc.php | 1 + lang/serendipity_lang_ro.inc.php | 1 + lang/serendipity_lang_ru.inc.php | 1 + lang/serendipity_lang_sa.inc.php | 1 + lang/serendipity_lang_se.inc.php | 1 + lang/serendipity_lang_sk.inc.php | 1 + lang/serendipity_lang_ta.inc.php | 1 + lang/serendipity_lang_tn.inc.php | 1 + lang/serendipity_lang_tr.inc.php | 1 + lang/serendipity_lang_tw.inc.php | 1 + lang/serendipity_lang_zh.inc.php | 1 + templates/2k11/admin/entries.tpl | 2 +- 66 files changed, 67 insertions(+), 6 deletions(-) diff --git a/lang/UTF-8/plugin_lang.php b/lang/UTF-8/plugin_lang.php index 62509a25..e72e037d 100644 --- a/lang/UTF-8/plugin_lang.php +++ b/lang/UTF-8/plugin_lang.php @@ -80,3 +80,4 @@ foreach($const['missing'] AS $file => $constants) { } echo "---------------------------\n"; } +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_bg.inc.php b/lang/UTF-8/serendipity_lang_bg.inc.php index fcd304d3..4a4fe76a 100644 --- a/lang/UTF-8/serendipity_lang_bg.inc.php +++ b/lang/UTF-8/serendipity_lang_bg.inc.php @@ -1022,3 +1022,4 @@ $i18n_filename_to = array('-', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_cn.inc.php b/lang/UTF-8/serendipity_lang_cn.inc.php index 0c4603a8..c791e02c 100644 --- a/lang/UTF-8/serendipity_lang_cn.inc.php +++ b/lang/UTF-8/serendipity_lang_cn.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_cs.inc.php b/lang/UTF-8/serendipity_lang_cs.inc.php index f157d4bf..b4be11eb 100644 --- a/lang/UTF-8/serendipity_lang_cs.inc.php +++ b/lang/UTF-8/serendipity_lang_cs.inc.php @@ -1060,3 +1060,4 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_cz.inc.php b/lang/UTF-8/serendipity_lang_cz.inc.php index 7c486c59..b83cd38c 100644 --- a/lang/UTF-8/serendipity_lang_cz.inc.php +++ b/lang/UTF-8/serendipity_lang_cz.inc.php @@ -1060,3 +1060,4 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_da.inc.php b/lang/UTF-8/serendipity_lang_da.inc.php index 72b53938..93f7400f 100644 --- a/lang/UTF-8/serendipity_lang_da.inc.php +++ b/lang/UTF-8/serendipity_lang_da.inc.php @@ -1029,3 +1029,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_de.inc.php b/lang/UTF-8/serendipity_lang_de.inc.php index 1689ae1e..6a811cc5 100644 --- a/lang/UTF-8/serendipity_lang_de.inc.php +++ b/lang/UTF-8/serendipity_lang_de.inc.php @@ -1034,3 +1034,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI-Tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Ausführbar?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Filter entfernen'); diff --git a/lang/UTF-8/serendipity_lang_en.inc.php b/lang/UTF-8/serendipity_lang_en.inc.php index 6355c72a..158ef892 100644 --- a/lang/UTF-8/serendipity_lang_en.inc.php +++ b/lang/UTF-8/serendipity_lang_en.inc.php @@ -627,7 +627,7 @@ @define('RESET_DATE', 'Reset date'); @define('RESET_DATE_DESC', 'Click here to reset the date to the current time'); @define('PROBLEM_PERMISSIONS_HOWTO', 'Permissions can be set by running shell command: `%s` on the failed directory, or by setting this using an FTP program'); -@define('WARNING_TEMPLATE_DEPRECATED', 'Warning: Your current theme is using a deprecated template method, you are advised to update if possible'); +@define('WARNING_TEMPLATE_DEPRECATED', 'Warning: Your current theme is using a deprecated theme method, you are advised to update if possible'); @define('ENTRY_PUBLISHED_FUTURE', 'This entry is not yet published.'); @define('ENTRIES_BY', 'Entries by %s'); @define('PREVIOUS', 'Previous'); @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_es.inc.php b/lang/UTF-8/serendipity_lang_es.inc.php index 04642ec0..8c3243d4 100644 --- a/lang/UTF-8/serendipity_lang_es.inc.php +++ b/lang/UTF-8/serendipity_lang_es.inc.php @@ -1048,3 +1048,4 @@ Melvin TODO [20060128]: What spanish word do we use for "referrers" ?? @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_fa.inc.php b/lang/UTF-8/serendipity_lang_fa.inc.php index bf17bcb4..81889d2f 100644 --- a/lang/UTF-8/serendipity_lang_fa.inc.php +++ b/lang/UTF-8/serendipity_lang_fa.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_fi.inc.php b/lang/UTF-8/serendipity_lang_fi.inc.php index b436c525..d07ee44f 100644 --- a/lang/UTF-8/serendipity_lang_fi.inc.php +++ b/lang/UTF-8/serendipity_lang_fi.inc.php @@ -1030,3 +1030,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_fr.inc.php b/lang/UTF-8/serendipity_lang_fr.inc.php index 17c44b5a..82aab51a 100644 --- a/lang/UTF-8/serendipity_lang_fr.inc.php +++ b/lang/UTF-8/serendipity_lang_fr.inc.php @@ -1037,3 +1037,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_hu.inc.php b/lang/UTF-8/serendipity_lang_hu.inc.php index 0578316c..14d45820 100644 --- a/lang/UTF-8/serendipity_lang_hu.inc.php +++ b/lang/UTF-8/serendipity_lang_hu.inc.php @@ -1028,3 +1028,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_is.inc.php b/lang/UTF-8/serendipity_lang_is.inc.php index b219506b..c8558248 100644 --- a/lang/UTF-8/serendipity_lang_is.inc.php +++ b/lang/UTF-8/serendipity_lang_is.inc.php @@ -1030,3 +1030,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_it.inc.php b/lang/UTF-8/serendipity_lang_it.inc.php index 8de6f507..77f51c8d 100644 --- a/lang/UTF-8/serendipity_lang_it.inc.php +++ b/lang/UTF-8/serendipity_lang_it.inc.php @@ -1033,3 +1033,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_ja.inc.php b/lang/UTF-8/serendipity_lang_ja.inc.php index 9ce00ce9..de77d619 100644 --- a/lang/UTF-8/serendipity_lang_ja.inc.php +++ b/lang/UTF-8/serendipity_lang_ja.inc.php @@ -1034,3 +1034,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_ko.inc.php b/lang/UTF-8/serendipity_lang_ko.inc.php index ac70c016..12018da9 100644 --- a/lang/UTF-8/serendipity_lang_ko.inc.php +++ b/lang/UTF-8/serendipity_lang_ko.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_nl.inc.php b/lang/UTF-8/serendipity_lang_nl.inc.php index bc0c6384..9e529009 100644 --- a/lang/UTF-8/serendipity_lang_nl.inc.php +++ b/lang/UTF-8/serendipity_lang_nl.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_no.inc.php b/lang/UTF-8/serendipity_lang_no.inc.php index 9f66cd7e..501a9d31 100644 --- a/lang/UTF-8/serendipity_lang_no.inc.php +++ b/lang/UTF-8/serendipity_lang_no.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_pl.inc.php b/lang/UTF-8/serendipity_lang_pl.inc.php index 74a03811..d811b05d 100644 --- a/lang/UTF-8/serendipity_lang_pl.inc.php +++ b/lang/UTF-8/serendipity_lang_pl.inc.php @@ -1028,3 +1028,4 @@ $i18n_filename_to = array('_', 'a', 'A', 'a', 'A', 'b', 'B', 'c', 'C', 'c', 'C @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_pt.inc.php b/lang/UTF-8/serendipity_lang_pt.inc.php index 893300f9..23658039 100644 --- a/lang/UTF-8/serendipity_lang_pt.inc.php +++ b/lang/UTF-8/serendipity_lang_pt.inc.php @@ -1034,3 +1034,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_pt_PT.inc.php b/lang/UTF-8/serendipity_lang_pt_PT.inc.php index 94566b0b..d63c0088 100644 --- a/lang/UTF-8/serendipity_lang_pt_PT.inc.php +++ b/lang/UTF-8/serendipity_lang_pt_PT.inc.php @@ -1041,3 +1041,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_ro.inc.php b/lang/UTF-8/serendipity_lang_ro.inc.php index a0dd55f5..987a1a6c 100644 --- a/lang/UTF-8/serendipity_lang_ro.inc.php +++ b/lang/UTF-8/serendipity_lang_ro.inc.php @@ -1031,3 +1031,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_ru.inc.php b/lang/UTF-8/serendipity_lang_ru.inc.php index ac40e364..c1ddbafa 100644 --- a/lang/UTF-8/serendipity_lang_ru.inc.php +++ b/lang/UTF-8/serendipity_lang_ru.inc.php @@ -1033,3 +1033,4 @@ $i18n_filename_to = array('_', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_sa.inc.php b/lang/UTF-8/serendipity_lang_sa.inc.php index 01f61874..de7ffe35 100644 --- a/lang/UTF-8/serendipity_lang_sa.inc.php +++ b/lang/UTF-8/serendipity_lang_sa.inc.php @@ -949,3 +949,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_se.inc.php b/lang/UTF-8/serendipity_lang_se.inc.php index d076b51d..d525349b 100644 --- a/lang/UTF-8/serendipity_lang_se.inc.php +++ b/lang/UTF-8/serendipity_lang_se.inc.php @@ -1030,3 +1030,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_sk.inc.php b/lang/UTF-8/serendipity_lang_sk.inc.php index 0b02a77a..5f748901 100644 --- a/lang/UTF-8/serendipity_lang_sk.inc.php +++ b/lang/UTF-8/serendipity_lang_sk.inc.php @@ -1020,3 +1020,4 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_ta.inc.php b/lang/UTF-8/serendipity_lang_ta.inc.php index 9de9c205..a948a151 100644 --- a/lang/UTF-8/serendipity_lang_ta.inc.php +++ b/lang/UTF-8/serendipity_lang_ta.inc.php @@ -1029,3 +1029,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_tn.inc.php b/lang/UTF-8/serendipity_lang_tn.inc.php index 8d0080e2..9378d57a 100644 --- a/lang/UTF-8/serendipity_lang_tn.inc.php +++ b/lang/UTF-8/serendipity_lang_tn.inc.php @@ -1034,3 +1034,4 @@ $i18n_unknown = 'tw'; @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_tr.inc.php b/lang/UTF-8/serendipity_lang_tr.inc.php index d91e86c4..6d7f187d 100644 --- a/lang/UTF-8/serendipity_lang_tr.inc.php +++ b/lang/UTF-8/serendipity_lang_tr.inc.php @@ -1034,3 +1034,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_tw.inc.php b/lang/UTF-8/serendipity_lang_tw.inc.php index d87d1b2e..9590b5f9 100644 --- a/lang/UTF-8/serendipity_lang_tw.inc.php +++ b/lang/UTF-8/serendipity_lang_tw.inc.php @@ -1035,3 +1035,4 @@ $i18n_unknown = 'tw'; @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/UTF-8/serendipity_lang_zh.inc.php b/lang/UTF-8/serendipity_lang_zh.inc.php index c60cad70..13f46bb1 100644 --- a/lang/UTF-8/serendipity_lang_zh.inc.php +++ b/lang/UTF-8/serendipity_lang_zh.inc.php @@ -1030,3 +1030,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/addlang.txt b/lang/addlang.txt index 472e173d..c52c0492 100644 --- a/lang/addlang.txt +++ b/lang/addlang.txt @@ -1,4 +1 @@ -@define('INSTALLER_CLI_TOOLS', 'Server-side command line tools'); -@define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); -@define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); -@define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/plugin_lang.php b/lang/plugin_lang.php index 62509a25..e72e037d 100644 --- a/lang/plugin_lang.php +++ b/lang/plugin_lang.php @@ -80,3 +80,4 @@ foreach($const['missing'] AS $file => $constants) { } echo "---------------------------\n"; } +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_bg.inc.php b/lang/serendipity_lang_bg.inc.php index e91d0e67..694d2585 100644 --- a/lang/serendipity_lang_bg.inc.php +++ b/lang/serendipity_lang_bg.inc.php @@ -1022,3 +1022,4 @@ $i18n_filename_to = array('-', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_cn.inc.php b/lang/serendipity_lang_cn.inc.php index 0c4603a8..c791e02c 100644 --- a/lang/serendipity_lang_cn.inc.php +++ b/lang/serendipity_lang_cn.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_cs.inc.php b/lang/serendipity_lang_cs.inc.php index 24a59549..3d07948b 100644 --- a/lang/serendipity_lang_cs.inc.php +++ b/lang/serendipity_lang_cs.inc.php @@ -1060,3 +1060,4 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_cz.inc.php b/lang/serendipity_lang_cz.inc.php index 48d0847c..d7ddee46 100644 --- a/lang/serendipity_lang_cz.inc.php +++ b/lang/serendipity_lang_cz.inc.php @@ -1060,3 +1060,4 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_da.inc.php b/lang/serendipity_lang_da.inc.php index b2385fde..7aff945f 100644 --- a/lang/serendipity_lang_da.inc.php +++ b/lang/serendipity_lang_da.inc.php @@ -1029,3 +1029,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_de.inc.php b/lang/serendipity_lang_de.inc.php index 2c666140..d5b36851 100644 --- a/lang/serendipity_lang_de.inc.php +++ b/lang/serendipity_lang_de.inc.php @@ -1034,3 +1034,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI-Tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Ausführbar?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Filter entfernen'); diff --git a/lang/serendipity_lang_en.inc.php b/lang/serendipity_lang_en.inc.php index 57f0ac90..3660b1c4 100644 --- a/lang/serendipity_lang_en.inc.php +++ b/lang/serendipity_lang_en.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_es.inc.php b/lang/serendipity_lang_es.inc.php index cb06df45..43c3d82d 100644 --- a/lang/serendipity_lang_es.inc.php +++ b/lang/serendipity_lang_es.inc.php @@ -1048,3 +1048,4 @@ Melvin TODO [20060128]: What spanish word do we use for "referrers" ?? @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_fa.inc.php b/lang/serendipity_lang_fa.inc.php index bf17bcb4..81889d2f 100644 --- a/lang/serendipity_lang_fa.inc.php +++ b/lang/serendipity_lang_fa.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_fi.inc.php b/lang/serendipity_lang_fi.inc.php index b436c525..d07ee44f 100644 --- a/lang/serendipity_lang_fi.inc.php +++ b/lang/serendipity_lang_fi.inc.php @@ -1030,3 +1030,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_fr.inc.php b/lang/serendipity_lang_fr.inc.php index aa0a3876..59d0a86e 100644 --- a/lang/serendipity_lang_fr.inc.php +++ b/lang/serendipity_lang_fr.inc.php @@ -1037,3 +1037,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_hu.inc.php b/lang/serendipity_lang_hu.inc.php index 67a3d3cc..ac1a17bd 100644 --- a/lang/serendipity_lang_hu.inc.php +++ b/lang/serendipity_lang_hu.inc.php @@ -1028,3 +1028,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_is.inc.php b/lang/serendipity_lang_is.inc.php index a91f74a7..24d6c023 100644 --- a/lang/serendipity_lang_is.inc.php +++ b/lang/serendipity_lang_is.inc.php @@ -1030,3 +1030,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_it.inc.php b/lang/serendipity_lang_it.inc.php index e57b1da0..17120540 100644 --- a/lang/serendipity_lang_it.inc.php +++ b/lang/serendipity_lang_it.inc.php @@ -1033,3 +1033,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_ja.inc.php b/lang/serendipity_lang_ja.inc.php index 9ce00ce9..de77d619 100644 --- a/lang/serendipity_lang_ja.inc.php +++ b/lang/serendipity_lang_ja.inc.php @@ -1034,3 +1034,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_ko.inc.php b/lang/serendipity_lang_ko.inc.php index ac70c016..12018da9 100644 --- a/lang/serendipity_lang_ko.inc.php +++ b/lang/serendipity_lang_ko.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_nl.inc.php b/lang/serendipity_lang_nl.inc.php index ceea9b22..63fae184 100644 --- a/lang/serendipity_lang_nl.inc.php +++ b/lang/serendipity_lang_nl.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_no.inc.php b/lang/serendipity_lang_no.inc.php index 04cf63b4..f7f46012 100644 --- a/lang/serendipity_lang_no.inc.php +++ b/lang/serendipity_lang_no.inc.php @@ -1032,3 +1032,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_pl.inc.php b/lang/serendipity_lang_pl.inc.php index 1342d9cc..9855dae2 100644 --- a/lang/serendipity_lang_pl.inc.php +++ b/lang/serendipity_lang_pl.inc.php @@ -1028,3 +1028,4 @@ $i18n_filename_to = array('_', 'a', 'A', 'a', 'A', 'b', 'B', 'c', 'C', 'c', 'C @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_pt.inc.php b/lang/serendipity_lang_pt.inc.php index de1dce72..c92e7e85 100644 --- a/lang/serendipity_lang_pt.inc.php +++ b/lang/serendipity_lang_pt.inc.php @@ -1034,3 +1034,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_pt_PT.inc.php b/lang/serendipity_lang_pt_PT.inc.php index 4401874f..4ac9a64d 100644 --- a/lang/serendipity_lang_pt_PT.inc.php +++ b/lang/serendipity_lang_pt_PT.inc.php @@ -1041,3 +1041,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_ro.inc.php b/lang/serendipity_lang_ro.inc.php index a0dd55f5..987a1a6c 100644 --- a/lang/serendipity_lang_ro.inc.php +++ b/lang/serendipity_lang_ro.inc.php @@ -1031,3 +1031,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_ru.inc.php b/lang/serendipity_lang_ru.inc.php index ac40e364..c1ddbafa 100644 --- a/lang/serendipity_lang_ru.inc.php +++ b/lang/serendipity_lang_ru.inc.php @@ -1033,3 +1033,4 @@ $i18n_filename_to = array('_', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_sa.inc.php b/lang/serendipity_lang_sa.inc.php index dc520161..883c1494 100644 --- a/lang/serendipity_lang_sa.inc.php +++ b/lang/serendipity_lang_sa.inc.php @@ -949,3 +949,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_se.inc.php b/lang/serendipity_lang_se.inc.php index 46eb00f6..4171770b 100644 --- a/lang/serendipity_lang_se.inc.php +++ b/lang/serendipity_lang_se.inc.php @@ -1030,3 +1030,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_sk.inc.php b/lang/serendipity_lang_sk.inc.php index 0b02a77a..5f748901 100644 --- a/lang/serendipity_lang_sk.inc.php +++ b/lang/serendipity_lang_sk.inc.php @@ -1020,3 +1020,4 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_ta.inc.php b/lang/serendipity_lang_ta.inc.php index 9de9c205..a948a151 100644 --- a/lang/serendipity_lang_ta.inc.php +++ b/lang/serendipity_lang_ta.inc.php @@ -1029,3 +1029,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_tn.inc.php b/lang/serendipity_lang_tn.inc.php index 8d0080e2..9378d57a 100644 --- a/lang/serendipity_lang_tn.inc.php +++ b/lang/serendipity_lang_tn.inc.php @@ -1034,3 +1034,4 @@ $i18n_unknown = 'tw'; @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_tr.inc.php b/lang/serendipity_lang_tr.inc.php index d91e86c4..6d7f187d 100644 --- a/lang/serendipity_lang_tr.inc.php +++ b/lang/serendipity_lang_tr.inc.php @@ -1034,3 +1034,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_tw.inc.php b/lang/serendipity_lang_tw.inc.php index 949e5cb6..72b4c8c1 100644 --- a/lang/serendipity_lang_tw.inc.php +++ b/lang/serendipity_lang_tw.inc.php @@ -1035,3 +1035,4 @@ $i18n_unknown = 'tw'; @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/lang/serendipity_lang_zh.inc.php b/lang/serendipity_lang_zh.inc.php index b0b88e29..06cd078e 100644 --- a/lang/serendipity_lang_zh.inc.php +++ b/lang/serendipity_lang_zh.inc.php @@ -1030,3 +1030,4 @@ @define('INSTALLER_CLI_TOOLNAME', 'CLI tool'); @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); +@define('RESET_FILTERS', 'Reset filters'); diff --git a/templates/2k11/admin/entries.tpl b/templates/2k11/admin/entries.tpl index 5f57f901..670fa5df 100644 --- a/templates/2k11/admin/entries.tpl +++ b/templates/2k11/admin/entries.tpl @@ -111,7 +111,7 @@
- {* i18n *} +
{foreach from=$entry_vars.category_options item="entry_cat"} From 5e0c4c074e12b6f8e13f8e806f6ee2d244bf7b3c Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 25 Apr 2014 09:55:41 +0200 Subject: [PATCH 14/16] include upgrader timestamp document recent changes i18n for upgrader --- docs/NEWS | 22 ++++++++++++++++++++++ include/admin/overview.inc.php | 3 +-- include/functions_installer.inc.php | 20 ++++++++++++++++---- include/tpl/config_local.inc.php | 2 +- lang/UTF-8/plugin_lang.php | 3 +++ lang/UTF-8/serendipity_lang_bg.inc.php | 3 +++ lang/UTF-8/serendipity_lang_cn.inc.php | 3 +++ lang/UTF-8/serendipity_lang_cs.inc.php | 3 +++ lang/UTF-8/serendipity_lang_cz.inc.php | 3 +++ lang/UTF-8/serendipity_lang_da.inc.php | 3 +++ lang/UTF-8/serendipity_lang_de.inc.php | 3 +++ lang/UTF-8/serendipity_lang_en.inc.php | 3 +++ lang/UTF-8/serendipity_lang_es.inc.php | 3 +++ lang/UTF-8/serendipity_lang_fa.inc.php | 3 +++ lang/UTF-8/serendipity_lang_fi.inc.php | 3 +++ lang/UTF-8/serendipity_lang_fr.inc.php | 3 +++ lang/UTF-8/serendipity_lang_hu.inc.php | 3 +++ lang/UTF-8/serendipity_lang_is.inc.php | 3 +++ lang/UTF-8/serendipity_lang_it.inc.php | 3 +++ lang/UTF-8/serendipity_lang_ja.inc.php | 3 +++ lang/UTF-8/serendipity_lang_ko.inc.php | 3 +++ lang/UTF-8/serendipity_lang_nl.inc.php | 3 +++ lang/UTF-8/serendipity_lang_no.inc.php | 3 +++ lang/UTF-8/serendipity_lang_pl.inc.php | 3 +++ lang/UTF-8/serendipity_lang_pt.inc.php | 3 +++ lang/UTF-8/serendipity_lang_pt_PT.inc.php | 3 +++ lang/UTF-8/serendipity_lang_ro.inc.php | 3 +++ lang/UTF-8/serendipity_lang_ru.inc.php | 3 +++ lang/UTF-8/serendipity_lang_sa.inc.php | 3 +++ lang/UTF-8/serendipity_lang_se.inc.php | 3 +++ lang/UTF-8/serendipity_lang_sk.inc.php | 3 +++ lang/UTF-8/serendipity_lang_ta.inc.php | 3 +++ lang/UTF-8/serendipity_lang_tn.inc.php | 3 +++ lang/UTF-8/serendipity_lang_tr.inc.php | 3 +++ lang/UTF-8/serendipity_lang_tw.inc.php | 3 +++ lang/UTF-8/serendipity_lang_zh.inc.php | 3 +++ lang/addlang.txt | 4 +++- lang/plugin_lang.php | 3 +++ lang/serendipity_lang_bg.inc.php | 3 +++ lang/serendipity_lang_cn.inc.php | 3 +++ lang/serendipity_lang_cs.inc.php | 3 +++ lang/serendipity_lang_cz.inc.php | 3 +++ lang/serendipity_lang_da.inc.php | 3 +++ lang/serendipity_lang_de.inc.php | 3 +++ lang/serendipity_lang_en.inc.php | 3 +++ lang/serendipity_lang_es.inc.php | 3 +++ lang/serendipity_lang_fa.inc.php | 3 +++ lang/serendipity_lang_fi.inc.php | 3 +++ lang/serendipity_lang_fr.inc.php | 3 +++ lang/serendipity_lang_hu.inc.php | 3 +++ lang/serendipity_lang_is.inc.php | 3 +++ lang/serendipity_lang_it.inc.php | 3 +++ lang/serendipity_lang_ja.inc.php | 3 +++ lang/serendipity_lang_ko.inc.php | 3 +++ lang/serendipity_lang_nl.inc.php | 3 +++ lang/serendipity_lang_no.inc.php | 3 +++ lang/serendipity_lang_pl.inc.php | 3 +++ lang/serendipity_lang_pt.inc.php | 3 +++ lang/serendipity_lang_pt_PT.inc.php | 3 +++ lang/serendipity_lang_ro.inc.php | 3 +++ lang/serendipity_lang_ru.inc.php | 3 +++ lang/serendipity_lang_sa.inc.php | 3 +++ lang/serendipity_lang_se.inc.php | 3 +++ lang/serendipity_lang_sk.inc.php | 3 +++ lang/serendipity_lang_ta.inc.php | 3 +++ lang/serendipity_lang_tn.inc.php | 3 +++ lang/serendipity_lang_tr.inc.php | 3 +++ lang/serendipity_lang_tw.inc.php | 3 +++ lang/serendipity_lang_zh.inc.php | 3 +++ templates/2k11/admin/overview.inc.tpl | 4 ++-- 70 files changed, 237 insertions(+), 10 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index bcb4efb4..6266923c 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -4,6 +4,28 @@ Version 2.0-beta2 () ------------------------------------------------------------------------ + * Upgrader in Dashboard can be disabled, returns error message when + URL not accessible + + * Added a category filtering ability for the entry editor + + * Better check when removing old/dead files to prevent error + messages + + * WYSIWYG editor respects image floats + + * Support html5 multiple file upload + + * Modernizr, magnificPopup updates + + * Improvements to equal heights js, button labels + + * No longer truncate long entry titles + + * Improve non-WYSIWYG editor tag insertion, url insertion + + * Improve less DOM firing on certain javascript tasks + Version 2.0-beta1 (April 14th, 2014) ------------------------------------------------------------------------ diff --git a/include/admin/overview.inc.php b/include/admin/overview.inc.php index 6f221354..02e8b630 100644 --- a/include/admin/overview.inc.php +++ b/include/admin/overview.inc.php @@ -44,12 +44,11 @@ $output = array(); serendipity_plugin_api::hook_event('backend_frontpage_display', $output); $data['backend_frontpage_display'] = $output['more']; -$data['curVersion'] = serendipity_getCurrentVersion(); $data['usedVersion'] = $serendipity['version']; $data['updateCheck'] = $serendipity['updateCheck']; +$data['curVersion'] = serendipity_getCurrentVersion(); $data['update'] = version_compare($data['usedVersion'], $data['curVersion'], '<'); - $comments = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id) ORDER BY c.id DESC LIMIT 5"); diff --git a/include/functions_installer.inc.php b/include/functions_installer.inc.php index e993dd4e..24dac8b5 100644 --- a/include/functions_installer.inc.php +++ b/include/functions_installer.inc.php @@ -1204,15 +1204,24 @@ function serendipity_verifyFTPChecksums() { * */ function serendipity_getCurrentVersion() { global $serendipity; + if ($serendipity['updateCheck'] != "stable" && $serendipity['updateCheck'] != "beta") { return -1; } + + // Perform update check once a day. We use a suffix of the configured channel, so when + // the user switches channels, it has its own timer. + if ($serendipity['last_update_check_' . $serendipity['updateCheck']] >= (time()-86400)) { + // Last update was performed less than a day ago. Return last result. + return $serendipity['last_update_version_' . $serendipity['updateCheck']]; + } + + serendipity_set_config_var('last_update_check_' . $serendipity['updateCheck'], time()); $updateURL = 'https://raw.github.com/s9y/Serendipity/master/docs/RELEASE'; - $context = stream_context_create( array('http'=>array('timeout' => 5.0)) ); + $context = stream_context_create(array('http' => array('timeout' => 5.0))); + $file = @file_get_contents($updateURL, false, $context); - $file = @file_get_contents($updateURL, false, $context); - - if ( ! $file) { + if (!$file) { if (function_exists('curl_init')) { $ch = curl_init($updateURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); @@ -1225,14 +1234,17 @@ function serendipity_getCurrentVersion() { if ($file) { if ($serendipity['updateCheck'] == "stable") { if (preg_match('/^stable:(.+)\b/', $file, $match)) { + serendipity_set_config_var('last_update_version_' . $serendipity['updateCheck'], $match[1]); return $match[1]; } } else { if (preg_match('/^beta:(.+)\b/', $file, $match)) { + serendipity_set_config_var('last_update_version_' . $serendipity['updateCheck'], $match[1]); return $match[1]; } } } + return -1; } diff --git a/include/tpl/config_local.inc.php b/include/tpl/config_local.inc.php index ac3cb1ef..101ffb75 100644 --- a/include/tpl/config_local.inc.php +++ b/include/tpl/config_local.inc.php @@ -400,7 +400,7 @@ 'permission' => 'blogConfiguration'), array('var' => 'updateCheck', 'title' => UPDATE_NOTIFICATION, - 'description' => "Show the update notification in the Dashboard, and for which channel?", # i18n + 'description' => UPDATE_NOTIFICATION_DESC, 'type' => 'list', 'default' => array('stable' => 'stable', 'beta' => 'beta', 'false' => NO ), # i18n 'permission' => 'blogConfiguration'), diff --git a/lang/UTF-8/plugin_lang.php b/lang/UTF-8/plugin_lang.php index e72e037d..6d54992d 100644 --- a/lang/UTF-8/plugin_lang.php +++ b/lang/UTF-8/plugin_lang.php @@ -81,3 +81,6 @@ foreach($const['missing'] AS $file => $constants) { echo "---------------------------\n"; } @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_bg.inc.php b/lang/UTF-8/serendipity_lang_bg.inc.php index 4a4fe76a..7c1ca8a4 100644 --- a/lang/UTF-8/serendipity_lang_bg.inc.php +++ b/lang/UTF-8/serendipity_lang_bg.inc.php @@ -1023,3 +1023,6 @@ $i18n_filename_to = array('-', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_cn.inc.php b/lang/UTF-8/serendipity_lang_cn.inc.php index c791e02c..4951b71c 100644 --- a/lang/UTF-8/serendipity_lang_cn.inc.php +++ b/lang/UTF-8/serendipity_lang_cn.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_cs.inc.php b/lang/UTF-8/serendipity_lang_cs.inc.php index b4be11eb..b39aa092 100644 --- a/lang/UTF-8/serendipity_lang_cs.inc.php +++ b/lang/UTF-8/serendipity_lang_cs.inc.php @@ -1061,3 +1061,6 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_cz.inc.php b/lang/UTF-8/serendipity_lang_cz.inc.php index b83cd38c..99cf61a6 100644 --- a/lang/UTF-8/serendipity_lang_cz.inc.php +++ b/lang/UTF-8/serendipity_lang_cz.inc.php @@ -1061,3 +1061,6 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_da.inc.php b/lang/UTF-8/serendipity_lang_da.inc.php index 93f7400f..60985a30 100644 --- a/lang/UTF-8/serendipity_lang_da.inc.php +++ b/lang/UTF-8/serendipity_lang_da.inc.php @@ -1030,3 +1030,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_de.inc.php b/lang/UTF-8/serendipity_lang_de.inc.php index 6a811cc5..74882e0f 100644 --- a/lang/UTF-8/serendipity_lang_de.inc.php +++ b/lang/UTF-8/serendipity_lang_de.inc.php @@ -1035,3 +1035,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Ausführbar?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Filter entfernen'); +@define('UPDATE_FAILMSG', 'Update-Check für neue Serendipity-Version fehlgeschlagen. Das kann passieren wenn die URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE nicht erreichbar ist, der Server ausgehende Verbindungen verhindert oder es andere Verbindungsprobleme gibt.'); +@define('UPDATE_FAILACTION', 'Automatischen Update-Check deaktivieren'); +@define('UPDATE_NOTIFICATION_DESC', 'Sollen Update-Checks im Dashboard angezeigt werden, und wenn ja für welche Versionen?'); diff --git a/lang/UTF-8/serendipity_lang_en.inc.php b/lang/UTF-8/serendipity_lang_en.inc.php index 158ef892..7ab469f3 100644 --- a/lang/UTF-8/serendipity_lang_en.inc.php +++ b/lang/UTF-8/serendipity_lang_en.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_es.inc.php b/lang/UTF-8/serendipity_lang_es.inc.php index 8c3243d4..0b04a964 100644 --- a/lang/UTF-8/serendipity_lang_es.inc.php +++ b/lang/UTF-8/serendipity_lang_es.inc.php @@ -1049,3 +1049,6 @@ Melvin TODO [20060128]: What spanish word do we use for "referrers" ?? @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_fa.inc.php b/lang/UTF-8/serendipity_lang_fa.inc.php index 81889d2f..7375d5e4 100644 --- a/lang/UTF-8/serendipity_lang_fa.inc.php +++ b/lang/UTF-8/serendipity_lang_fa.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_fi.inc.php b/lang/UTF-8/serendipity_lang_fi.inc.php index d07ee44f..03031b74 100644 --- a/lang/UTF-8/serendipity_lang_fi.inc.php +++ b/lang/UTF-8/serendipity_lang_fi.inc.php @@ -1031,3 +1031,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_fr.inc.php b/lang/UTF-8/serendipity_lang_fr.inc.php index 82aab51a..7aace2f4 100644 --- a/lang/UTF-8/serendipity_lang_fr.inc.php +++ b/lang/UTF-8/serendipity_lang_fr.inc.php @@ -1038,3 +1038,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_hu.inc.php b/lang/UTF-8/serendipity_lang_hu.inc.php index 14d45820..8fd61cdc 100644 --- a/lang/UTF-8/serendipity_lang_hu.inc.php +++ b/lang/UTF-8/serendipity_lang_hu.inc.php @@ -1029,3 +1029,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_is.inc.php b/lang/UTF-8/serendipity_lang_is.inc.php index c8558248..a2f56b95 100644 --- a/lang/UTF-8/serendipity_lang_is.inc.php +++ b/lang/UTF-8/serendipity_lang_is.inc.php @@ -1031,3 +1031,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_it.inc.php b/lang/UTF-8/serendipity_lang_it.inc.php index 77f51c8d..5a2f1095 100644 --- a/lang/UTF-8/serendipity_lang_it.inc.php +++ b/lang/UTF-8/serendipity_lang_it.inc.php @@ -1034,3 +1034,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_ja.inc.php b/lang/UTF-8/serendipity_lang_ja.inc.php index de77d619..6096b2a3 100644 --- a/lang/UTF-8/serendipity_lang_ja.inc.php +++ b/lang/UTF-8/serendipity_lang_ja.inc.php @@ -1035,3 +1035,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_ko.inc.php b/lang/UTF-8/serendipity_lang_ko.inc.php index 12018da9..ddc9809d 100644 --- a/lang/UTF-8/serendipity_lang_ko.inc.php +++ b/lang/UTF-8/serendipity_lang_ko.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_nl.inc.php b/lang/UTF-8/serendipity_lang_nl.inc.php index 9e529009..0f63b42c 100644 --- a/lang/UTF-8/serendipity_lang_nl.inc.php +++ b/lang/UTF-8/serendipity_lang_nl.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_no.inc.php b/lang/UTF-8/serendipity_lang_no.inc.php index 501a9d31..d5c43df1 100644 --- a/lang/UTF-8/serendipity_lang_no.inc.php +++ b/lang/UTF-8/serendipity_lang_no.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_pl.inc.php b/lang/UTF-8/serendipity_lang_pl.inc.php index d811b05d..3edf9e85 100644 --- a/lang/UTF-8/serendipity_lang_pl.inc.php +++ b/lang/UTF-8/serendipity_lang_pl.inc.php @@ -1029,3 +1029,6 @@ $i18n_filename_to = array('_', 'a', 'A', 'a', 'A', 'b', 'B', 'c', 'C', 'c', 'C @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_pt.inc.php b/lang/UTF-8/serendipity_lang_pt.inc.php index 23658039..e0860b05 100644 --- a/lang/UTF-8/serendipity_lang_pt.inc.php +++ b/lang/UTF-8/serendipity_lang_pt.inc.php @@ -1035,3 +1035,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_pt_PT.inc.php b/lang/UTF-8/serendipity_lang_pt_PT.inc.php index d63c0088..0378db7c 100644 --- a/lang/UTF-8/serendipity_lang_pt_PT.inc.php +++ b/lang/UTF-8/serendipity_lang_pt_PT.inc.php @@ -1042,3 +1042,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_ro.inc.php b/lang/UTF-8/serendipity_lang_ro.inc.php index 987a1a6c..ed577133 100644 --- a/lang/UTF-8/serendipity_lang_ro.inc.php +++ b/lang/UTF-8/serendipity_lang_ro.inc.php @@ -1032,3 +1032,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_ru.inc.php b/lang/UTF-8/serendipity_lang_ru.inc.php index c1ddbafa..5573d7e4 100644 --- a/lang/UTF-8/serendipity_lang_ru.inc.php +++ b/lang/UTF-8/serendipity_lang_ru.inc.php @@ -1034,3 +1034,6 @@ $i18n_filename_to = array('_', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_sa.inc.php b/lang/UTF-8/serendipity_lang_sa.inc.php index de7ffe35..6e111237 100644 --- a/lang/UTF-8/serendipity_lang_sa.inc.php +++ b/lang/UTF-8/serendipity_lang_sa.inc.php @@ -950,3 +950,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_se.inc.php b/lang/UTF-8/serendipity_lang_se.inc.php index d525349b..62e0bc93 100644 --- a/lang/UTF-8/serendipity_lang_se.inc.php +++ b/lang/UTF-8/serendipity_lang_se.inc.php @@ -1031,3 +1031,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_sk.inc.php b/lang/UTF-8/serendipity_lang_sk.inc.php index 5f748901..9273f52e 100644 --- a/lang/UTF-8/serendipity_lang_sk.inc.php +++ b/lang/UTF-8/serendipity_lang_sk.inc.php @@ -1021,3 +1021,6 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_ta.inc.php b/lang/UTF-8/serendipity_lang_ta.inc.php index a948a151..ed38385d 100644 --- a/lang/UTF-8/serendipity_lang_ta.inc.php +++ b/lang/UTF-8/serendipity_lang_ta.inc.php @@ -1030,3 +1030,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_tn.inc.php b/lang/UTF-8/serendipity_lang_tn.inc.php index 9378d57a..38f249f9 100644 --- a/lang/UTF-8/serendipity_lang_tn.inc.php +++ b/lang/UTF-8/serendipity_lang_tn.inc.php @@ -1035,3 +1035,6 @@ $i18n_unknown = 'tw'; @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_tr.inc.php b/lang/UTF-8/serendipity_lang_tr.inc.php index 6d7f187d..832cb929 100644 --- a/lang/UTF-8/serendipity_lang_tr.inc.php +++ b/lang/UTF-8/serendipity_lang_tr.inc.php @@ -1035,3 +1035,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_tw.inc.php b/lang/UTF-8/serendipity_lang_tw.inc.php index 9590b5f9..0098f15b 100644 --- a/lang/UTF-8/serendipity_lang_tw.inc.php +++ b/lang/UTF-8/serendipity_lang_tw.inc.php @@ -1036,3 +1036,6 @@ $i18n_unknown = 'tw'; @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/UTF-8/serendipity_lang_zh.inc.php b/lang/UTF-8/serendipity_lang_zh.inc.php index 13f46bb1..e6285399 100644 --- a/lang/UTF-8/serendipity_lang_zh.inc.php +++ b/lang/UTF-8/serendipity_lang_zh.inc.php @@ -1031,3 +1031,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/addlang.txt b/lang/addlang.txt index c52c0492..f4593f78 100644 --- a/lang/addlang.txt +++ b/lang/addlang.txt @@ -1 +1,3 @@ -@define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/plugin_lang.php b/lang/plugin_lang.php index e72e037d..6d54992d 100644 --- a/lang/plugin_lang.php +++ b/lang/plugin_lang.php @@ -81,3 +81,6 @@ foreach($const['missing'] AS $file => $constants) { echo "---------------------------\n"; } @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_bg.inc.php b/lang/serendipity_lang_bg.inc.php index 694d2585..6ba3eb62 100644 --- a/lang/serendipity_lang_bg.inc.php +++ b/lang/serendipity_lang_bg.inc.php @@ -1023,3 +1023,6 @@ $i18n_filename_to = array('-', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_cn.inc.php b/lang/serendipity_lang_cn.inc.php index c791e02c..4951b71c 100644 --- a/lang/serendipity_lang_cn.inc.php +++ b/lang/serendipity_lang_cn.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_cs.inc.php b/lang/serendipity_lang_cs.inc.php index 3d07948b..b8f8d478 100644 --- a/lang/serendipity_lang_cs.inc.php +++ b/lang/serendipity_lang_cs.inc.php @@ -1061,3 +1061,6 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_cz.inc.php b/lang/serendipity_lang_cz.inc.php index d7ddee46..5dd6cf72 100644 --- a/lang/serendipity_lang_cz.inc.php +++ b/lang/serendipity_lang_cz.inc.php @@ -1061,3 +1061,6 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_da.inc.php b/lang/serendipity_lang_da.inc.php index 7aff945f..e20f9852 100644 --- a/lang/serendipity_lang_da.inc.php +++ b/lang/serendipity_lang_da.inc.php @@ -1030,3 +1030,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_de.inc.php b/lang/serendipity_lang_de.inc.php index d5b36851..a8e3cc3b 100644 --- a/lang/serendipity_lang_de.inc.php +++ b/lang/serendipity_lang_de.inc.php @@ -1035,3 +1035,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Ausführbar?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Filter entfernen'); +@define('UPDATE_FAILMSG', 'Update-Check für neue Serendipity-Version fehlgeschlagen. Das kann passieren wenn die URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE nicht erreichbar ist, der Server ausgehende Verbindungen verhindert oder es andere Verbindungsprobleme gibt.'); +@define('UPDATE_FAILACTION', 'Automatischen Update-Check deaktivieren'); +@define('UPDATE_NOTIFICATION_DESC', 'Sollen Update-Checks im Dashboard angezeigt werden, und wenn ja für welche Versionen?'); diff --git a/lang/serendipity_lang_en.inc.php b/lang/serendipity_lang_en.inc.php index 3660b1c4..cf6ee4e4 100644 --- a/lang/serendipity_lang_en.inc.php +++ b/lang/serendipity_lang_en.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_es.inc.php b/lang/serendipity_lang_es.inc.php index 43c3d82d..42c3e238 100644 --- a/lang/serendipity_lang_es.inc.php +++ b/lang/serendipity_lang_es.inc.php @@ -1049,3 +1049,6 @@ Melvin TODO [20060128]: What spanish word do we use for "referrers" ?? @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_fa.inc.php b/lang/serendipity_lang_fa.inc.php index 81889d2f..7375d5e4 100644 --- a/lang/serendipity_lang_fa.inc.php +++ b/lang/serendipity_lang_fa.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_fi.inc.php b/lang/serendipity_lang_fi.inc.php index d07ee44f..03031b74 100644 --- a/lang/serendipity_lang_fi.inc.php +++ b/lang/serendipity_lang_fi.inc.php @@ -1031,3 +1031,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_fr.inc.php b/lang/serendipity_lang_fr.inc.php index 59d0a86e..1fedaf3c 100644 --- a/lang/serendipity_lang_fr.inc.php +++ b/lang/serendipity_lang_fr.inc.php @@ -1038,3 +1038,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_hu.inc.php b/lang/serendipity_lang_hu.inc.php index ac1a17bd..6f3620f3 100644 --- a/lang/serendipity_lang_hu.inc.php +++ b/lang/serendipity_lang_hu.inc.php @@ -1029,3 +1029,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_is.inc.php b/lang/serendipity_lang_is.inc.php index 24d6c023..91c9cfc9 100644 --- a/lang/serendipity_lang_is.inc.php +++ b/lang/serendipity_lang_is.inc.php @@ -1031,3 +1031,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_it.inc.php b/lang/serendipity_lang_it.inc.php index 17120540..4dba7bc2 100644 --- a/lang/serendipity_lang_it.inc.php +++ b/lang/serendipity_lang_it.inc.php @@ -1034,3 +1034,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_ja.inc.php b/lang/serendipity_lang_ja.inc.php index de77d619..6096b2a3 100644 --- a/lang/serendipity_lang_ja.inc.php +++ b/lang/serendipity_lang_ja.inc.php @@ -1035,3 +1035,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_ko.inc.php b/lang/serendipity_lang_ko.inc.php index 12018da9..ddc9809d 100644 --- a/lang/serendipity_lang_ko.inc.php +++ b/lang/serendipity_lang_ko.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_nl.inc.php b/lang/serendipity_lang_nl.inc.php index 63fae184..0a4fee9b 100644 --- a/lang/serendipity_lang_nl.inc.php +++ b/lang/serendipity_lang_nl.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_no.inc.php b/lang/serendipity_lang_no.inc.php index f7f46012..70e68e32 100644 --- a/lang/serendipity_lang_no.inc.php +++ b/lang/serendipity_lang_no.inc.php @@ -1033,3 +1033,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_pl.inc.php b/lang/serendipity_lang_pl.inc.php index 9855dae2..5be48181 100644 --- a/lang/serendipity_lang_pl.inc.php +++ b/lang/serendipity_lang_pl.inc.php @@ -1029,3 +1029,6 @@ $i18n_filename_to = array('_', 'a', 'A', 'a', 'A', 'b', 'B', 'c', 'C', 'c', 'C @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_pt.inc.php b/lang/serendipity_lang_pt.inc.php index c92e7e85..6721f014 100644 --- a/lang/serendipity_lang_pt.inc.php +++ b/lang/serendipity_lang_pt.inc.php @@ -1035,3 +1035,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_pt_PT.inc.php b/lang/serendipity_lang_pt_PT.inc.php index 4ac9a64d..cfe663b0 100644 --- a/lang/serendipity_lang_pt_PT.inc.php +++ b/lang/serendipity_lang_pt_PT.inc.php @@ -1042,3 +1042,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_ro.inc.php b/lang/serendipity_lang_ro.inc.php index 987a1a6c..ed577133 100644 --- a/lang/serendipity_lang_ro.inc.php +++ b/lang/serendipity_lang_ro.inc.php @@ -1032,3 +1032,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_ru.inc.php b/lang/serendipity_lang_ru.inc.php index c1ddbafa..5573d7e4 100644 --- a/lang/serendipity_lang_ru.inc.php +++ b/lang/serendipity_lang_ru.inc.php @@ -1034,3 +1034,6 @@ $i18n_filename_to = array('_', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_sa.inc.php b/lang/serendipity_lang_sa.inc.php index 883c1494..78e146df 100644 --- a/lang/serendipity_lang_sa.inc.php +++ b/lang/serendipity_lang_sa.inc.php @@ -950,3 +950,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_se.inc.php b/lang/serendipity_lang_se.inc.php index 4171770b..bc6798b6 100644 --- a/lang/serendipity_lang_se.inc.php +++ b/lang/serendipity_lang_se.inc.php @@ -1031,3 +1031,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_sk.inc.php b/lang/serendipity_lang_sk.inc.php index 5f748901..9273f52e 100644 --- a/lang/serendipity_lang_sk.inc.php +++ b/lang/serendipity_lang_sk.inc.php @@ -1021,3 +1021,6 @@ $i18n_filename_to = array ( @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_ta.inc.php b/lang/serendipity_lang_ta.inc.php index a948a151..ed38385d 100644 --- a/lang/serendipity_lang_ta.inc.php +++ b/lang/serendipity_lang_ta.inc.php @@ -1030,3 +1030,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_tn.inc.php b/lang/serendipity_lang_tn.inc.php index 9378d57a..38f249f9 100644 --- a/lang/serendipity_lang_tn.inc.php +++ b/lang/serendipity_lang_tn.inc.php @@ -1035,3 +1035,6 @@ $i18n_unknown = 'tw'; @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_tr.inc.php b/lang/serendipity_lang_tr.inc.php index 6d7f187d..832cb929 100644 --- a/lang/serendipity_lang_tr.inc.php +++ b/lang/serendipity_lang_tr.inc.php @@ -1035,3 +1035,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_tw.inc.php b/lang/serendipity_lang_tw.inc.php index 72b4c8c1..d0c348d7 100644 --- a/lang/serendipity_lang_tw.inc.php +++ b/lang/serendipity_lang_tw.inc.php @@ -1036,3 +1036,6 @@ $i18n_unknown = 'tw'; @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/lang/serendipity_lang_zh.inc.php b/lang/serendipity_lang_zh.inc.php index 06cd078e..1e5c7fdf 100644 --- a/lang/serendipity_lang_zh.inc.php +++ b/lang/serendipity_lang_zh.inc.php @@ -1031,3 +1031,6 @@ @define('INSTALLER_CLI_TOOLSTATUS', 'Executable?'); @define('VIDEO', 'Video'); @define('RESET_FILTERS', 'Reset filters'); +@define('UPDATE_FAILMSG', 'Check for new Serendipity version failed. This can happen because either the URL https://raw.github.com/s9y/Serendipity/master/docs/RELEASE is down, your server blocks outgoing connections or there are other connection issues.'); +@define('UPDATE_FAILACTION', 'Disable automatic update check'); +@define('UPDATE_NOTIFICATION_DESC', 'Show the update notification in the Dashboard, and for which channel?'); diff --git a/templates/2k11/admin/overview.inc.tpl b/templates/2k11/admin/overview.inc.tpl index 6620b96d..abada88f 100644 --- a/templates/2k11/admin/overview.inc.tpl +++ b/templates/2k11/admin/overview.inc.tpl @@ -16,11 +16,11 @@

{$CONST.UPDATE_NOTIFICATION}

- Check for new Serendipity version failed {* i18n *} + {$CONST.UPDATE_FAILMSG}
{$token} - {* i18n *} +
{else if $update} From c73f21ce0d45333ce72f17312051ff4bb516efab Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 25 Apr 2014 10:39:14 +0200 Subject: [PATCH 15/16] pubdate/pubDate --- docs/NEWS | 2 ++ include/admin/importers/generic.inc.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/NEWS b/docs/NEWS index 6266923c..dcc389ba 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -4,6 +4,8 @@ Version 2.0-beta2 () ------------------------------------------------------------------------ + * RSS importer accepts pubDate in addition to pubdate element. + * Upgrader in Dashboard can be disabled, returns error message when URL not accessible diff --git a/include/admin/importers/generic.inc.php b/include/admin/importers/generic.inc.php index f059d7a4..688cb3fc 100644 --- a/include/admin/importers/generic.inc.php +++ b/include/admin/importers/generic.inc.php @@ -94,6 +94,9 @@ class Serendipity_Import_Generic extends Serendipity_Import { } $entry['title'] = $this->decode($item['title']); + if (!isset($item['pubdate']) && isset($item['pubDate'])) { + $item['pubdate'] = $item['pubDate']; + } $entry['timestamp'] = $this->decode(strtotime(isset($item['pubdate']) ? $item['pubdate'] : $item['dc:date'])); if ($entry['timestamp'] == -1) { // strtotime does not seem to parse ISO 8601 dates From d355f82de226ac9d93a09ad9d78b01f1f87cf03f Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Fri, 25 Apr 2014 10:54:15 +0200 Subject: [PATCH 16/16] Open Spartacus XML file in a seperate window/tab. --- .../serendipity_event_spartacus/serendipity_event_spartacus.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php index c5c5a100..bc692916 100644 --- a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php +++ b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php @@ -385,7 +385,7 @@ class serendipity_event_spartacus extends serendipity_event } $url_ip = gethostbyname($url_hostname); - $this->outputMSG('notice', sprintf(PLUGIN_EVENT_SPARTACUS_FETCHING, '' . basename($url) . '')); + $this->outputMSG('notice', sprintf(PLUGIN_EVENT_SPARTACUS_FETCHING, '' . basename($url) . '')); if (file_exists($target) && filesize($target) > 0 && filemtime($target) >= (time()-$cacheTimeout)) { $data = file_get_contents($target);