Skip to content

Commit

Permalink
Updated TravisCI, eslint configs. Added readme.txt and markdown conve…
Browse files Browse the repository at this point in the history
…rted.
  • Loading branch information
cssjoe committed Nov 1, 2018
1 parent f755aec commit 8a2def1
Show file tree
Hide file tree
Showing 9 changed files with 1,956 additions and 52 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// http://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
env: {
browser: true
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'wordpress',
plugins: [
'html'
],
// Add your custom rules here
'rules': {
'space-in-parens': ['error', 'always'],
"wrap-iife": [2, "any"],
// Allow async-await
'generator-star-spacing': 0,
// Allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
};
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 100,
"bracketSpacing": true,
"useTabs": true,
"singleQuote": true
}
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,24 @@ env:
- WP_VERSION=latest WP_MULTISITE=0

before_script:
- npm install -g gulp-cli
- yarn install
- gulp

script:
- find . -name composer -prune -o -name node_modules -prune -o -name '*.php' -exec php -lf {} \; >/dev/null
- yarn run php-codesniffer
- yarn run js-lint

deploy:
- provider: script
script: chmod +x ./node_modules/@boldgrid/wordpress-tag-sync/release.sh && ./node_modules/@boldgrid/wordpress-tag-sync/release.sh
skip_cleanup: true
on:
tags: true
- provider: releases
api_key: "${GITHUB_TOKEN}"
file: "shrinkwrap_images.zip"
skip_cleanup: true
on:
tags: true
- provider: script
script: chmod +x ./node_modules/@boldgrid/wordpress-tag-sync/release.sh && ./node_modules/@boldgrid/wordpress-tag-sync/release.sh
skip_cleanup: true
on:
tags: true
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
=== Shrinkwrap Images ===
Contributors: EmpireOfLight, joemoto
Tags: image, anti-piracy
Requires at least: 2.8
Tested up to: 4.9.8
Stable tag: 1.2.3
# Shrinkwrap Images #
**Contributors:** EmpireOfLight, joemoto
**Tags:** image, anti-piracy
**Requires at least:** 2.8
**Tested up to:** 4.9.8
**Stable tag:** 1.2.3

Add a protective coating onto your images to discourage downloading.

== Description ==
## Description ##

This plugin will automatically add a tiny, invisible image on top of all of the images in your site. If a visitor right-clicks on one of your images, they will download the clear tiny image instead of the image that appears.
In no way does the plugin claim to prevent downloads entirely; it is merely an added protective measure for your images.

= Usage =
### Usage ###

* Install the plugin through the Install Plugins interface or by uploading the `shrinkwrap_images` folder to your `/wp-content/plugins/` directory.
* Activate the Shrinkwrap Images plugin.
* That's it! Any image on your site is now coated with a clear, protective layer :)

== Installation ==
## Installation ##

1. Install the plugin through the Install Plugins interface or by uploading the `shrinkwrap_images` folder to your `/wp-content/plugins/` directory.
2. Activate the Shrinkwrap Images plugin.
3, That's it! Any image on your site is now coated with a clear, protective layer :)

== Frequently Asked Questions ==
## Frequently Asked Questions ##

Contact [email protected] with any questions.

= Does this plugin prevent image downloads? =
### Does this plugin prevent image downloads? ###

No. It is just a preventative step for image authors who want to do whatever they can to prevent downloads.

= Why did you make this plugin? =
### Why did you make this plugin? ###

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.

== Changelog ==

= 1.2.3 =
### 1.2.3 ###
* Added dev tools (PHPCS, ESLINT, and TravisCI).

= 1.2.2 =
### 1.2.2 ###
* Optimized php (thanks joemoto).

= 1.2.0 =
### 1.2.0 ###
* Bug fixes.
* Added plugin banner.

= 1.1.0 =
### 1.1.0 ###
* Now overlays clear.gif onto lightboxed images.
* Added plugin icon.

= 1.0.0 =
### 1.0.0 ###
* Initial Release.

== Upgrade Notice ==
## Upgrade Notice ##

Make sure you get the latest version.

== Localization ==
## Localization ##

Want to contribute with a translation to your language? Please check at https://translate.wordpress.org/projects/wp-plugins/post-types-order
http://www.nsp-code.com
11 changes: 11 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var gulp = require( 'gulp' ),
readme = require( 'gulp-readme-to-markdown' );

gulp.task( 'readme', function() {
gulp
.src( [ 'readme.txt' ] )
.pipe( readme() )
.pipe( gulp.dest( '.' ) );
} );

gulp.task( 'default', [ 'readme' ] );
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"eslint": "^4.19.1",
"eslint-config-wordpress": "^2.0.0",
"eslint-plugin-html": "^4.0.2",
"gulp": "^3.9.1",
"gulp-cli": "^2.0.1",
"gulp-readme-to-markdown": "^0.2.0",
"prettier-eslint": "^8.8.1",
"prettier-eslint-cli": "^4.7.1"
}
Expand Down
65 changes: 65 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
=== Shrinkwrap Images ===
Contributors: EmpireOfLight, joemoto
Tags: image, anti-piracy
Requires at least: 2.8
Tested up to: 4.9.8
Stable tag: 1.2.3

Add a protective coating onto your images to discourage downloading.

== Description ==

This plugin will automatically add a tiny, invisible image on top of all of the images in your site. If a visitor right-clicks on one of your images, they will download the clear tiny image instead of the image that appears.
In no way does the plugin claim to prevent downloads entirely; it is merely an added protective measure for your images.

= Usage =

* Install the plugin through the Install Plugins interface or by uploading the `shrinkwrap_images` folder to your `/wp-content/plugins/` directory.
* Activate the Shrinkwrap Images plugin.
* That's it! Any image on your site is now coated with a clear, protective layer :)

== Installation ==

1. Install the plugin through the Install Plugins interface or by uploading the `shrinkwrap_images` folder to your `/wp-content/plugins/` directory.
2. Activate the Shrinkwrap Images plugin.
3, That's it! Any image on your site is now coated with a clear, protective layer :)

== Frequently Asked Questions ==

Contact [email protected] with any questions.

= Does this plugin prevent image downloads? =

No. It is just a preventative step for image authors who want to do whatever they can to prevent downloads.

= Why did you make this plugin? =

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.

== Changelog ==

= 1.2.3 =
* Added dev tools (PHPCS, ESLINT, and TravisCI).

= 1.2.2 =
* Optimized php (thanks joemoto).

= 1.2.0 =
* Bug fixes.
* Added plugin banner.

= 1.1.0 =
* Now overlays clear.gif onto lightboxed images.
* Added plugin icon.

= 1.0.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
http://www.nsp-code.com
24 changes: 12 additions & 12 deletions shrinkwrap-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ 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
jQuery(document).on("ready", function() {
jQuery("img")
.wrap('<div class="eol_si_shrink"></div>')
.after(gifpath);
});
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);
}
});
document.arrive( 'img', function() {
if ( ! jQuery( this ).closest( '.eol_si_shrink' ).length ) {
jQuery( this )
.wrap( '<div class="eol_si_shrink"></div>' )
.after( gifpath );
}
} );
Loading

0 comments on commit 8a2def1

Please sign in to comment.