Skip to content

Commit 8a2def1

Browse files
author
Joe Cartonia
committed
Updated TravisCI, eslint configs. Added readme.txt and markdown converted.
1 parent f755aec commit 8a2def1

File tree

9 files changed

+1956
-52
lines changed

9 files changed

+1956
-52
lines changed

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// http://eslint.org/docs/user-guide/configuring
2+
3+
module.exports = {
4+
root: true,
5+
env: {
6+
browser: true
7+
},
8+
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
9+
extends: 'wordpress',
10+
plugins: [
11+
'html'
12+
],
13+
// Add your custom rules here
14+
'rules': {
15+
'space-in-parens': ['error', 'always'],
16+
"wrap-iife": [2, "any"],
17+
// Allow async-await
18+
'generator-star-spacing': 0,
19+
// Allow debugger during development
20+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
21+
}
22+
};

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 100,
3+
"bracketSpacing": true,
4+
"useTabs": true,
5+
"singleQuote": true
6+
}

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,24 @@ env:
1212
- WP_VERSION=latest WP_MULTISITE=0
1313

1414
before_script:
15+
- npm install -g gulp-cli
1516
- yarn install
17+
- gulp
1618

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

2224
deploy:
23-
- provider: script
24-
script: chmod +x ./node_modules/@boldgrid/wordpress-tag-sync/release.sh && ./node_modules/@boldgrid/wordpress-tag-sync/release.sh
25-
skip_cleanup: true
26-
on:
27-
tags: true
2825
- provider: releases
2926
api_key: "${GITHUB_TOKEN}"
3027
file: "shrinkwrap_images.zip"
3128
skip_cleanup: true
3229
on:
3330
tags: true
31+
- provider: script
32+
script: chmod +x ./node_modules/@boldgrid/wordpress-tag-sync/release.sh && ./node_modules/@boldgrid/wordpress-tag-sync/release.sh
33+
skip_cleanup: true
34+
on:
35+
tags: true

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
=== Shrinkwrap Images ===
2-
Contributors: EmpireOfLight, joemoto
3-
Tags: image, anti-piracy
4-
Requires at least: 2.8
5-
Tested up to: 4.9.8
6-
Stable tag: 1.2.3
1+
# Shrinkwrap Images #
2+
**Contributors:** EmpireOfLight, joemoto
3+
**Tags:** image, anti-piracy
4+
**Requires at least:** 2.8
5+
**Tested up to:** 4.9.8
6+
**Stable tag:** 1.2.3
77

88
Add a protective coating onto your images to discourage downloading.
99

10-
== Description ==
10+
## Description ##
1111

1212
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.
1313
In no way does the plugin claim to prevent downloads entirely; it is merely an added protective measure for your images.
1414

15-
= Usage =
15+
### Usage ###
1616

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

21-
== Installation ==
21+
## Installation ##
2222

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

27-
== Frequently Asked Questions ==
27+
## Frequently Asked Questions ##
2828

2929
Contact [email protected] with any questions.
3030

31-
= Does this plugin prevent image downloads? =
31+
### Does this plugin prevent image downloads? ###
3232

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

35-
= Why did you make this plugin? =
35+
### Why did you make this plugin? ###
3636

3737
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.
3838

3939
== Changelog ==
4040

41-
= 1.2.3 =
41+
### 1.2.3 ###
4242
* Added dev tools (PHPCS, ESLINT, and TravisCI).
4343

44-
= 1.2.2 =
44+
### 1.2.2 ###
4545
* Optimized php (thanks joemoto).
4646

47-
= 1.2.0 =
47+
### 1.2.0 ###
4848
* Bug fixes.
4949
* Added plugin banner.
5050

51-
= 1.1.0 =
51+
### 1.1.0 ###
5252
* Now overlays clear.gif onto lightboxed images.
5353
* Added plugin icon.
5454

55-
= 1.0.0 =
55+
### 1.0.0 ###
5656
* Initial Release.
5757

58-
== Upgrade Notice ==
58+
## Upgrade Notice ##
5959

6060
Make sure you get the latest version.
6161

62-
== Localization ==
62+
## Localization ##
6363

6464
Want to contribute with a translation to your language? Please check at https://translate.wordpress.org/projects/wp-plugins/post-types-order
6565
http://www.nsp-code.com

gulpfile.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var gulp = require( 'gulp' ),
2+
readme = require( 'gulp-readme-to-markdown' );
3+
4+
gulp.task( 'readme', function() {
5+
gulp
6+
.src( [ 'readme.txt' ] )
7+
.pipe( readme() )
8+
.pipe( gulp.dest( '.' ) );
9+
} );
10+
11+
gulp.task( 'default', [ 'readme' ] );

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"eslint": "^4.19.1",
1313
"eslint-config-wordpress": "^2.0.0",
1414
"eslint-plugin-html": "^4.0.2",
15+
"gulp": "^3.9.1",
16+
"gulp-cli": "^2.0.1",
17+
"gulp-readme-to-markdown": "^0.2.0",
1518
"prettier-eslint": "^8.8.1",
1619
"prettier-eslint-cli": "^4.7.1"
1720
}

readme.txt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
=== Shrinkwrap Images ===
2+
Contributors: EmpireOfLight, joemoto
3+
Tags: image, anti-piracy
4+
Requires at least: 2.8
5+
Tested up to: 4.9.8
6+
Stable tag: 1.2.3
7+
8+
Add a protective coating onto your images to discourage downloading.
9+
10+
== Description ==
11+
12+
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.
13+
In no way does the plugin claim to prevent downloads entirely; it is merely an added protective measure for your images.
14+
15+
= Usage =
16+
17+
* Install the plugin through the Install Plugins interface or by uploading the `shrinkwrap_images` folder to your `/wp-content/plugins/` directory.
18+
* Activate the Shrinkwrap Images plugin.
19+
* That's it! Any image on your site is now coated with a clear, protective layer :)
20+
21+
== Installation ==
22+
23+
1. Install the plugin through the Install Plugins interface or by uploading the `shrinkwrap_images` folder to your `/wp-content/plugins/` directory.
24+
2. Activate the Shrinkwrap Images plugin.
25+
3, That's it! Any image on your site is now coated with a clear, protective layer :)
26+
27+
== Frequently Asked Questions ==
28+
29+
Contact [email protected] with any questions.
30+
31+
= Does this plugin prevent image downloads? =
32+
33+
No. It is just a preventative step for image authors who want to do whatever they can to prevent downloads.
34+
35+
= Why did you make this plugin? =
36+
37+
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.
38+
39+
== Changelog ==
40+
41+
= 1.2.3 =
42+
* Added dev tools (PHPCS, ESLINT, and TravisCI).
43+
44+
= 1.2.2 =
45+
* Optimized php (thanks joemoto).
46+
47+
= 1.2.0 =
48+
* Bug fixes.
49+
* Added plugin banner.
50+
51+
= 1.1.0 =
52+
* Now overlays clear.gif onto lightboxed images.
53+
* Added plugin icon.
54+
55+
= 1.0.0 =
56+
* Initial Release.
57+
58+
== Upgrade Notice ==
59+
60+
Make sure you get the latest version.
61+
62+
== Localization ==
63+
64+
Want to contribute with a translation to your language? Please check at https://translate.wordpress.org/projects/wp-plugins/post-types-order
65+
http://www.nsp-code.com

shrinkwrap-images.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ var plugindir = php_vars.plugindir;
55
var gifpath = '<img src="' + plugindir + '" class="eol_si_clear">';
66

77
// Use jQuery to wrap each img tag in the shrinkwrap div
8-
jQuery(document).on("ready", function() {
9-
jQuery("img")
10-
.wrap('<div class="eol_si_shrink"></div>')
11-
.after(gifpath);
12-
});
8+
jQuery( document ).on( 'ready', function() {
9+
jQuery( 'img' )
10+
.wrap( '<div class="eol_si_shrink"></div>' )
11+
.after( gifpath );
12+
} );
1313

1414
// Run shrinkwrap when lightbox openend
15-
document.arrive("img", function() {
16-
if (!jQuery(this).closest(".eol_si_shrink").length) {
17-
jQuery(this)
18-
.wrap('<div class="eol_si_shrink"></div>')
19-
.after(gifpath);
20-
}
21-
});
15+
document.arrive( 'img', function() {
16+
if ( ! jQuery( this ).closest( '.eol_si_shrink' ).length ) {
17+
jQuery( this )
18+
.wrap( '<div class="eol_si_shrink"></div>' )
19+
.after( gifpath );
20+
}
21+
} );

0 commit comments

Comments
 (0)