From 854c5cfd497983a73ad03090cc661898dea7d3c1 Mon Sep 17 00:00:00 2001 From: Ben Dunkle Date: Thu, 4 Jan 2018 11:32:42 -0500 Subject: [PATCH] Re-uploading from local work --- README.md | 18 +++++++++++++----- arrive.min.js | 10 ++++++++++ shrinkwrap_images.css | 12 +++++++----- shrinkwrap_images.js | 33 ++++++++------------------------- shrinkwrap_images.php | 13 +++++++++---- 5 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 arrive.min.js diff --git a/README.md b/README.md index 895d6f9..28becf6 100755 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Contributors: EmpireOfLight Tags: image, anti-piracy Requires at least: 2.8 Tested up to: 4.9.1 +Stable tag: trunk + Add a protective coating onto your images to discourage downloading. @@ -38,18 +40,24 @@ No. It is just a preventative step for image authors who want to do whatever the At my WordCamp Rochester talk, WordPress for Artists, I was asked if there were any plugins that could do this. Not finding one, I set about writing one myself. -= 1.0 = - - First stable version (thanks for support Andrew - PageLines.com) + == Changelog == + += 1.2 = +* Bug fixes. +* Added plugin banner. -= 0.9. = - - Initial Release += 1.1 = +* Now overlays clear.gif onto lightboxed images. +* Added plugin icon. + +=1.0 = +* Initial Release. == Upgrade Notice == Make sure you get the latest version. - == Localization == Want to contribute with a translation to your language? Please check at https://translate.wordpress.org/projects/wp-plugins/post-types-order diff --git a/arrive.min.js b/arrive.min.js new file mode 100644 index 0000000..c27808d --- /dev/null +++ b/arrive.min.js @@ -0,0 +1,10 @@ +/* + * arrive.js + * v2.4.1 + * https://github.com/uzairfarooq/arrive + * MIT licensed + * + * Copyright (c) 2014-2017 Uzair Farooq + */ + +var Arrive=function(e,t,n){"use strict";function r(e,t,n){l.addMethod(t,n,e.unbindEvent),l.addMethod(t,n,e.unbindEventWithSelectorOrCallback),l.addMethod(t,n,e.unbindEventWithSelectorAndCallback)}function i(e){e.arrive=f.bindEvent,r(f,e,"unbindArrive"),e.leave=d.bindEvent,r(d,e,"unbindLeave")}if(e.MutationObserver&&"undefined"!=typeof HTMLElement){var o=0,l=function(){var t=HTMLElement.prototype.matches||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector;return{matchesSelector:function(e,n){return e instanceof HTMLElement&&t.call(e,n)},addMethod:function(e,t,r){var i=e[t];e[t]=function(){return r.length==arguments.length?r.apply(this,arguments):"function"==typeof i?i.apply(this,arguments):n}},callCallbacks:function(e,t){t&&t.options.onceOnly&&1==t.firedElems.length&&(e=[e[0]]);for(var n,r=0;n=e[r];r++)n&&n.callback&&n.callback.call(n.elem,n.elem);t&&t.options.onceOnly&&1==t.firedElems.length&&t.me.unbindEventWithSelectorAndCallback.call(t.target,t.selector,t.callback)},checkChildNodesRecursively:function(e,t,n,r){for(var i,o=0;i=e[o];o++)n(i,t,r)&&r.push({callback:t.callback,elem:i}),i.childNodes.length>0&&l.checkChildNodesRecursively(i.childNodes,t,n,r)},mergeArrays:function(e,t){var n,r={};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r},toElementsArray:function(t){return n===t||"number"==typeof t.length&&t!==e||(t=[t]),t}}}(),c=function(){var e=function(){this._eventsBucket=[],this._beforeAdding=null,this._beforeRemoving=null};return e.prototype.addEvent=function(e,t,n,r){var i={target:e,selector:t,options:n,callback:r,firedElems:[]};return this._beforeAdding&&this._beforeAdding(i),this._eventsBucket.push(i),i},e.prototype.removeEvent=function(e){for(var t,n=this._eventsBucket.length-1;t=this._eventsBucket[n];n--)if(e(t)){this._beforeRemoving&&this._beforeRemoving(t);var r=this._eventsBucket.splice(n,1);r&&r.length&&(r[0].callback=null)}},e.prototype.beforeAdding=function(e){this._beforeAdding=e},e.prototype.beforeRemoving=function(e){this._beforeRemoving=e},e}(),a=function(t,r){var i=new c,o=this,a={fireOnAttributesModification:!1};return i.beforeAdding(function(n){var i,l=n.target;(l===e.document||l===e)&&(l=document.getElementsByTagName("html")[0]),i=new MutationObserver(function(e){r.call(this,e,n)});var c=t(n.options);i.observe(l,c),n.observer=i,n.me=o}),i.beforeRemoving(function(e){e.observer.disconnect()}),this.bindEvent=function(e,t,n){t=l.mergeArrays(a,t);for(var r=l.toElementsArray(this),o=0;o0?l.checkChildNodesRecursively(n,t,r,o):"attributes"===e.type&&r(i,t,o)&&o.push({callback:t.callback,elem:i}),l.callCallbacks(o,t)})}function r(e,t){return l.matchesSelector(e,t.selector)&&(e._id===n&&(e._id=o++),-1==t.firedElems.indexOf(e._id))?(t.firedElems.push(e._id),!0):!1}var i={fireOnAttributesModification:!1,onceOnly:!1,existing:!1};f=new a(e,t);var c=f.bindEvent;return f.bindEvent=function(e,t,r){n===r?(r=t,t=i):t=l.mergeArrays(i,t);var o=l.toElementsArray(this);if(t.existing){for(var a=[],s=0;s0&&l.checkChildNodesRecursively(n,t,r,i),l.callCallbacks(i,t)})}function r(e,t){return l.matchesSelector(e,t.selector)}var i={};d=new a(e,t);var o=d.bindEvent;return d.bindEvent=function(e,t,r){n===r?(r=t,t=i):t=l.mergeArrays(i,t),o.call(this,e,t,r)},d},f=new s,d=new u;t&&i(t.fn),i(HTMLElement.prototype),i(NodeList.prototype),i(HTMLCollection.prototype),i(HTMLDocument.prototype),i(Window.prototype);var h={};return r(f,h,"unbindAllArrive"),r(d,h,"unbindAllLeave"),h}}(window,"undefined"==typeof jQuery?null:jQuery,void 0); \ No newline at end of file diff --git a/shrinkwrap_images.css b/shrinkwrap_images.css index 08844fa..42c37fa 100644 --- a/shrinkwrap_images.css +++ b/shrinkwrap_images.css @@ -1,12 +1,14 @@ .eol_si_shrink { display: inline-block; position: relative; + height:100%; } .eol_si_clear { - display: block; - height: 100%; - position: absolute; - transform: translateY(-100%); - width: 100%; + display: block !important; + height: 100% !important; + position: absolute !important; + transform: translateY(-100%) !important; + width: 100% !important; + background:none !important; } \ No newline at end of file diff --git a/shrinkwrap_images.js b/shrinkwrap_images.js index db3ac70..827724d 100644 --- a/shrinkwrap_images.js +++ b/shrinkwrap_images.js @@ -5,30 +5,13 @@ var plugindir = php_vars.plugindir; var gifpath = ''; // Use jQuery to wrap each img tag in the shrinkwrap div -var eol_si_img = function() { - jQuery("img").wrap('
'); - jQuery("img").after(gifpath); - -}; - -var eol_si_test = function() { - alert("yes"); -}; - - - - -// Run shrinkwrap on doc load -jQuery(document).on('load', function() { - eol_si_img(); - - jQuery(document).on('ready', '#swipebox-slider', function(){ - alert("yes"); -}); - +jQuery(document).on('ready', function() { + jQuery('img').wrap('
').after(gifpath); }); - - - - +// Run shrinkwrap when lightbox openend +document.arrive('img', function(){ + if(!jQuery(this).closest(".eol_si_shrink").length) { + jQuery(this).wrap('
').after(gifpath); +}; +}); \ No newline at end of file diff --git a/shrinkwrap_images.php b/shrinkwrap_images.php index 135c0c9..23cb176 100644 --- a/shrinkwrap_images.php +++ b/shrinkwrap_images.php @@ -1,21 +1,26 @@ plugin_dir_url(__FILE__) . 'clear.gif'