Skip to content

Commit

Permalink
Re-uploading from local work
Browse files Browse the repository at this point in the history
  • Loading branch information
field2 authored Jan 4, 2018
1 parent 2630bbb commit 854c5cf
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 39 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions arrive.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions shrinkwrap_images.css
Original file line number Diff line number Diff line change
@@ -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;
}
33 changes: 8 additions & 25 deletions shrinkwrap_images.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,13 @@ var plugindir = php_vars.plugindir;
var gifpath = '<img src="' + plugindir + '" class="eol_si_clear">';

// Use jQuery to wrap each img tag in the shrinkwrap div
var eol_si_img = function() {
jQuery("img").wrap('<div class="eol_si_shrink"></div><!-- /.eol_si_shrink -->');
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('<div class="eol_si_shrink"></div>').after(gifpath);
});





// Run shrinkwrap when lightbox openend
document.arrive('img', function(){
if(!jQuery(this).closest(".eol_si_shrink").length) {
jQuery(this).wrap('<div class="eol_si_shrink"></div>').after(gifpath);
};
});
13 changes: 9 additions & 4 deletions shrinkwrap_images.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
<?php
/**
* @package ShrinkWrap_Images
* @version 1.0
* @version 1.2
*/
/*
Plugin Name: Shrinkwrap Images
Plugin URI: https://github.com/field2/shrinkwrap_images
Description: This plugin will help prevent image downloads.
Author: Ben Dunkle
Version: 1.0
Author URI: http://bendunkle.com/
Version: 1.2
Author URI: https://bendunkle.com/
*/

function eol_si_enqueue_script() {
wp_enqueue_style( 'swimgcss', plugin_dir_url(__FILE__) . 'shrinkwrap_images.css' );
wp_register_script( 'swimgjs', plugin_dir_url(__FILE__) . 'shrinkwrap_images.js', array( 'jquery' ) );

wp_register_script( 'arrive', plugin_dir_url(__FILE__) . 'arrive.min.js' );
wp_enqueue_script( 'arrive');

wp_register_script( 'swimgjs', plugin_dir_url(__FILE__) . 'shrinkwrap_images.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'swimgjs');

$url = plugin_dir_url(__FILE__) . 'shrinkwrap_images.js';
$dataToBePassed = array(
'plugindir' => plugin_dir_url(__FILE__) . 'clear.gif'
Expand Down

0 comments on commit 854c5cf

Please sign in to comment.