Better Click To Tweet - Version 5.5

Version Description

  • Enhancement added compatibility with WordPress 5.0's new editor, codenamed Gutenberg (thanks to Ajit Bohra @ajitbohra for all the great work!)
  • Enhancement Some CSS modifications to make the plugin play nicely with the new editor.
  • Enhancement changed the twitter bird icon for an updated one on the front end. (Thanks to @oliverpitsch for the PR on Github.)
Download this release

Release Info

Developer ben.meredith@gmail.com
Plugin Icon 128x128 Better Click To Tweet
Version 5.5
Comparing to
See all releases

Code changes from version 5.4.3 to 5.5

Files changed (48) hide show
  1. assets/block/build/editor.css +0 -0
  2. assets/block/build/editor.rtl.css +0 -0
  3. assets/block/build/script.js +6 -0
  4. assets/block/init.php +76 -0
  5. assets/css/styles.css +16 -0
  6. assets/img/birdy.png +0 -0
  7. assets/img/birdy_button.png +0 -0
  8. better-click-to-tweet.php +10 -1
  9. readme.txt +6 -0
  10. trunk/admin-nags.php +117 -0
  11. trunk/assets/block/build/editor.css +0 -0
  12. trunk/assets/block/build/editor.rtl.css +0 -0
  13. trunk/assets/block/build/script.js +6 -0
  14. trunk/assets/block/init.php +76 -0
  15. trunk/assets/css/bctt-admin.css +14 -0
  16. trunk/assets/css/bcttstyle.css +60 -0
  17. trunk/assets/css/styles.css +81 -0
  18. trunk/assets/img/birdy.png +0 -0
  19. trunk/assets/img/birdy_button.png +0 -0
  20. trunk/assets/img/empty.gif +0 -0
  21. trunk/assets/img/premium_style.png +0 -0
  22. trunk/assets/tinymce/bctt-tinymce.php +109 -0
  23. trunk/assets/tinymce/css/bctt-admin.css +18 -0
  24. trunk/assets/tinymce/js/tinymce-bctt.js +71 -0
  25. trunk/assets/tinymce/languages/bctt-mce-locale.php +25 -0
  26. trunk/bctt-i18n.php +7 -0
  27. trunk/bctt_options.php +261 -0
  28. trunk/better-click-to-tweet.php +347 -0
  29. trunk/i18n-module.php +280 -0
  30. trunk/languages/better-click-to-tweet-de_DE.mo +0 -0
  31. trunk/languages/better-click-to-tweet-de_DE.po +199 -0
  32. trunk/languages/better-click-to-tweet-el.mo +0 -0
  33. trunk/languages/better-click-to-tweet-el.po +230 -0
  34. trunk/languages/better-click-to-tweet-es_ES.mo +0 -0
  35. trunk/languages/better-click-to-tweet-es_ES.po +234 -0
  36. trunk/languages/better-click-to-tweet-fi.mo +0 -0
  37. trunk/languages/better-click-to-tweet-fi.po +226 -0
  38. trunk/languages/better-click-to-tweet-it_IT.mo +0 -0
  39. trunk/languages/better-click-to-tweet-it_IT.po +230 -0
  40. trunk/languages/better-click-to-tweet-ru_RU.mo +0 -0
  41. trunk/languages/better-click-to-tweet-ru_RU.po +197 -0
  42. trunk/languages/better-click-to-tweet-sr_RS.mo +0 -0
  43. trunk/languages/better-click-to-tweet-sr_RS.po +155 -0
  44. trunk/languages/better-click-to-tweet-sv_SE.mo +0 -0
  45. trunk/languages/better-click-to-tweet-sv_SE.po +187 -0
  46. trunk/languages/better-click-to-tweet.pot +202 -0
  47. trunk/readme.txt +355 -0
  48. webpack.config.js +103 -0
assets/block/build/editor.css ADDED
File without changes
assets/block/build/editor.rtl.css ADDED
File without changes
assets/block/build/script.js ADDED
@@ -0,0 +1,6 @@
1
+ this.bctt=this.bctt||{},this.bctt.main=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e){!function(){t.exports=this.wp.i18n}()},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(7),o=n(8);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(33);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){!function(){t.exports=this.wp.editor}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=(n.n(r),n(12)),u=(n.n(o),n(13)),c=n(14),i=n(49);e.default=Object(o.registerBlockType)("bctt/clicktotweet",{title:Object(r.__)("Better Click to Tweet"),description:Object(r.__)("Add text for your readers to tweet, calling them to action on your behalf."),category:"widgets",icon:"twitter",keywords:[Object(r.__)("Twitter"),Object(r.__)("Tweet")],attributes:u.a,edit:c.a,save:i.a})},function(t,e){!function(){t.exports=this.wp.blocks}()},function(t,e,n){"use strict";var r=n(0),o=(n.n(r),{tweet:{type:"string"},username:{type:"string",default:bctt_options_js.username},via:{type:"boolean",default:!0},url:{type:"boolean",default:!0},urlcustom:{type:"string"},nofollow:{type:"boolean",default:!1},prompt:{type:"string",default:Object(r.__)("Click To Tweet")}});e.a=o},function(t,e,n){"use strict";var r=n(15),o=n.n(r),u=n(44),c=n.n(u),i=n(0),a=(n.n(i),n(45)),f=(n.n(a),n(10)),l=(n.n(f),n(46)),s=n(48),p=(n.n(s),function(t){var e=t.attributes,n=t.setAttributes,r=t.className,u=e.tweet,s=e.prompt,p=function(t){n({tweet:t})},v=function(){return!1};return wp.element.createElement(a.Fragment,null,wp.element.createElement(l.a,o()({},t)),wp.element.createElement("span",{className:c()(r,"bctt-click-to-tweet")},wp.element.createElement("span",{className:"bctt-ctt-text"},wp.element.createElement(f.RichText,{format:"string",formattingControls:[],tagName:"div",placeholder:Object(i.__)("Enter text for readers to Tweet"),onChange:p,value:u})),wp.element.createElement("a",{href:"#",onClick:v,className:"bctt-ctt-btn"},s)))});e.a=p},function(t,e,n){"use strict";e.__esModule=!0;var r=n(16),o=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=o.default||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}},function(t,e,n){t.exports={default:n(17),__esModule:!0}},function(t,e,n){n(18),t.exports=n(5).Object.assign},function(t,e,n){var r=n(19);r(r.S+r.F,"Object",{assign:n(29)})},function(t,e,n){var r=n(1),o=n(5),u=n(20),c=n(22),i=function(t,e,n){var a,f,l,s=t&i.F,p=t&i.G,v=t&i.S,b=t&i.P,m=t&i.B,h=t&i.W,y=p?o:o[e]||(o[e]={}),w=y.prototype,_=p?r:v?r[e]:(r[e]||{}).prototype;p&&(n=e);for(a in n)(f=!s&&_&&void 0!==_[a])&&a in y||(l=f?_[a]:n[a],y[a]=p&&"function"!=typeof _[a]?n[a]:m&&f?u(l,r):h&&_[a]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):b&&"function"==typeof l?u(Function.call,l):l,b&&((y.virtual||(y.virtual={}))[a]=l,t&i.R&&w&&!w[a]&&c(w,a,l)))};i.F=1,i.G=2,i.S=4,i.P=8,i.B=16,i.W=32,i.U=64,i.R=128,t.exports=i},function(t,e,n){var r=n(21);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(23),o=n(28);t.exports=n(3)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(24),o=n(25),u=n(27),c=Object.defineProperty;e.f=n(3)?Object.defineProperty:function(t,e,n){if(r(t),e=u(e,!0),r(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(2);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(3)&&!n(4)(function(){return 7!=Object.defineProperty(n(26)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(2),o=n(1).document,u=r(o)&&r(o.createElement);t.exports=function(t){return u?o.createElement(t):{}}},function(t,e,n){var r=n(2);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var r=n(30),o=n(41),u=n(42),c=n(43),i=n(7),a=Object.assign;t.exports=!a||n(4)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=a({},t)[n]||Object.keys(a({},e)).join("")!=r})?function(t,e){for(var n=c(t),a=arguments.length,f=1,l=o.f,s=u.f;a>f;)for(var p,v=i(arguments[f++]),b=l?r(v).concat(l(v)):r(v),m=b.length,h=0;m>h;)s.call(v,p=b[h++])&&(n[p]=v[p]);return n}:a},function(t,e,n){var r=n(31),o=n(40);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(32),o=n(6),u=n(34)(!1),c=n(37)("IE_PROTO");t.exports=function(t,e){var n,i=o(t),a=0,f=[];for(n in i)n!=c&&r(i,n)&&f.push(n);for(;e.length>a;)r(i,n=e[a++])&&(~u(f,n)||f.push(n));return f}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(6),o=n(35),u=n(36);t.exports=function(t){return function(e,n,c){var i,a=r(e),f=o(a.length),l=u(c,f);if(t&&n!=n){for(;f>l;)if((i=a[l++])!=i)return!0}else for(;f>l;l++)if((t||l in a)&&a[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(9),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(9),o=Math.max,u=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):u(t,e)}},function(t,e,n){var r=n(38)("keys"),o=n(39);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(1),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(8);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r,o;/*!
2
+ Copyright (c) 2016 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */
6
+ !function(){"use strict";function n(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var o=typeof r;if("string"===o||"number"===o)t.push(r);else if(Array.isArray(r))t.push(n.apply(null,r));else if("object"===o)for(var c in r)u.call(r,c)&&r[c]&&t.push(c)}}return t.join(" ")}var u={}.hasOwnProperty;void 0!==t&&t.exports?t.exports=n:(r=[],void 0!==(o=function(){return n}.apply(e,r))&&(t.exports=o))}()},function(t,e){!function(){t.exports=this.wp.element}()},function(t,e,n){"use strict";var r=n(0),o=(n.n(r),n(10)),u=(n.n(o),n(47)),c=(n.n(u),function(t){var e=t.attributes,n=t.setAttributes,c=e.username,i=e.via,a=e.url,f=e.urlcustom,l=e.nofollow,s=e.prompt,p=function(t){n({username:t})},v=function(){n({via:!i})},b=function(){n({url:!a})},m=function(t){n({urlcustom:t})},h=function(){n({nofollow:!l})},y=function(t){n({prompt:t})};return wp.element.createElement(o.InspectorControls,{key:"inspector"},wp.element.createElement(u.PanelBody,{Title:Object(r.__)("Tweet Settings")},wp.element.createElement(u.TextControl,{label:Object(r.__)("Twitter Username"),value:c,onChange:p}),wp.element.createElement(u.ToggleControl,{label:Object(r.__)("Include the username in Tweet?"),checked:!!i,onChange:v}),wp.element.createElement(u.ToggleControl,{label:Object(r.__)("Include URL in tweet?"),checked:!!a,onChange:b}),wp.element.createElement(u.TextControl,{label:Object(r.__)("Custom URL"),value:f,onChange:m,help:Object(r.__)("Custom URL to use instead of post")}),wp.element.createElement(u.ToggleControl,{label:Object(r.__)("Nofollow"),checked:!!l,onChange:h,help:Object(r.__)("Make links nofollow")}),wp.element.createElement(u.TextControl,{label:Object(r.__)("Prompt"),value:s,onChange:y,help:Object(r.__)("Text for action/prompt link")})))});e.a=c},function(t,e){!function(){t.exports=this.wp.components}()},function(t,e){},function(t,e,n){"use strict";var r=function(){return null};e.a=r}]);
assets/block/init.php ADDED
@@ -0,0 +1,76 @@
1
+ <?php
2
+ /**
3
+ * Blocks Registration
4
+ *
5
+ * Enqueue CSS/JS for the blocks & register callback to render shortcode on frontend
6
+ */
7
+ // Exit if accessed directly.
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ // Enqueue Block assets
13
+ function bctt_block_editor_assets() {
14
+ wp_enqueue_script('bctt-block-js', plugins_url('block/build/script.js', dirname(__FILE__)), array( 'wp-i18n', 'wp-blocks', 'wp-components' ));
15
+ if ( ! bctt_is_default_styles_dequeued() ) {
16
+ $stylesheet_url = bctt_get_stylesheet_url();
17
+
18
+ wp_enqueue_style( 'bctt-block-editor-css', $stylesheet_url, array(), 'all' );
19
+ }
20
+ // Add plugin options for block
21
+ $bctt_data = array(
22
+ 'username' => get_option( 'bctt-twitter-handle' ),
23
+ );
24
+ wp_localize_script( 'bctt-block-js', 'bctt_options_js', $bctt_data );
25
+ }
26
+
27
+ // Hook assets to editor
28
+ add_action('enqueue_block_editor_assets', 'bctt_block_editor_assets');
29
+
30
+ // Server side rendering callback to output shortcode
31
+ register_block_type('bctt/clicktotweet', [
32
+ 'render_callback' => 'bctt_block_callback',
33
+ 'attributes' => array(
34
+ 'tweet' => array(
35
+ 'type' => 'string',
36
+ ),
37
+ 'username' => array(
38
+ 'type' => 'string',
39
+ 'default' => get_option( 'bctt-twitter-handle' )
40
+ ),
41
+ 'via' => array(
42
+ 'type' => 'boolean',
43
+ 'default' => true
44
+ ),
45
+ 'url' => array(
46
+ 'type' => 'boolean',
47
+ 'default' => true
48
+ ),
49
+ 'urlcustom' => array(
50
+ 'type' => 'string'
51
+ ),
52
+ 'nofollow' => array(
53
+ 'type' => 'boolean',
54
+ 'default' => false
55
+ ),
56
+ 'prompt' => array(
57
+ 'type' => 'string',
58
+ 'default' => sprintf( _x( 'Click To Tweet', 'Text for the box on the reader-facing box', 'better-click-to-tweet' ) )
59
+ ),
60
+ ),
61
+ ]);
62
+
63
+ // Callback function to render bctt on frontend
64
+ function bctt_block_callback( $attributes ) {
65
+
66
+ //echo var_dump($attributes);
67
+ //exit;
68
+ extract( $attributes );
69
+
70
+ $url = ($url ? 'yes' : 'no');
71
+
72
+ $shortcode_string = '[bctt tweet="%s" url="%s" via="%s" username="%s" nofollow="%s" prompt="%s"]';
73
+
74
+ return sprintf( $shortcode_string, $tweet, ($urlcustom ? $urlcustom : $url), ( $via ? 'yes' : 'no' ), $username, ( $nofollow ? 'yes' : 'no' ), $prompt);
75
+ }
76
+
assets/css/styles.css CHANGED
@@ -20,6 +20,22 @@
20
height: 0;
21
}
22
23
.bctt-ctt-text a {
24
padding: 15px 0;
25
margin: 15px 0;
20
height: 0;
21
}
22
23
+ /* For compatibility with the new editor in version 5.0 codenamed Gutenberg */
24
+
25
+ .bctt-click-to-tweet .mce-content-body {
26
+ position: relative;
27
+ color: #000 !important;
28
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
29
+ font-size: 1.5em;
30
+ line-height: 140%;
31
+ font-weight: 100;
32
+ text-decoration: none !important;
33
+ text-transform: none !important;
34
+ word-wrap: break-word;
35
+ border-bottom: none !important;
36
+ box-shadow: none !important;
37
+ }
38
+
39
.bctt-ctt-text a {
40
padding: 15px 0;
41
margin: 15px 0;
assets/img/birdy.png CHANGED
Binary file
assets/img/birdy_button.png CHANGED
Binary file
better-click-to-tweet.php CHANGED
@@ -2,7 +2,7 @@
2
/*
3
Plugin Name: Better Click To Tweet
4
Description: Add Click to Tweet boxes simply and elegantly to your posts or pages. All the features of a premium plugin, for FREE!
5
- Version: 5.4.3
6
Author: Ben Meredith
7
Author URI: https://www.betterclicktotweet.com
8
Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
@@ -336,3 +336,12 @@ function bctt_options_link( $links ) {
336
337
$bcttlink = plugin_basename( __FILE__ );
338
add_filter( "plugin_action_links_$bcttlink", 'bctt_options_link' );
2
/*
3
Plugin Name: Better Click To Tweet
4
Description: Add Click to Tweet boxes simply and elegantly to your posts or pages. All the features of a premium plugin, for FREE!
5
+ Version: 5.5
6
Author: Ben Meredith
7
Author URI: https://www.betterclicktotweet.com
8
Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
336
337
$bcttlink = plugin_basename( __FILE__ );
338
add_filter( "plugin_action_links_$bcttlink", 'bctt_options_link' );
339
+
340
+ /**
341
+ * Register Block
342
+ */
343
+ add_action( 'plugins_loaded', function () {
344
+ if ( function_exists( 'register_block_type' ) ) {
345
+ require_once( plugin_dir_path( __FILE__ ) . 'assets/block/init.php' );
346
+ }
347
+ } );
readme.txt CHANGED
@@ -101,6 +101,12 @@ Donations: http://benlikes.us/donate
101
102
== Changelog ==
103
104
= 5.4.3 =
105
* Security fix — added a line to the output that secures the target _blank vulnerability. Thanks to @dmv912 on the wordpress forums for the call-out!
106
101
102
== Changelog ==
103
104
+ = 5.5 =
105
+ * Enhancement — added compatibility with WordPress 5.0's new editor, codenamed Gutenberg (thanks to Ajit Bohra @ajitbohra for all the great work!)
106
+ * Enhancement — Some CSS modifications to make the plugin play nicely with the new editor.
107
+ * Enhancement — changed the twitter bird icon for an updated one on the front end. (Thanks to @oliverpitsch for the PR on Github.)
108
+
109
+
110
= 5.4.3 =
111
* Security fix — added a line to the output that secures the target _blank vulnerability. Thanks to @dmv912 on the wordpress forums for the call-out!
112
trunk/admin-nags.php ADDED
@@ -0,0 +1,117 @@
1
+ <?php
2
+
3
+ function bctt_alerts() {
4
+ if (is_plugin_active('better-click-to-tweet-premium-styles/better-click-to-tweet-premium-styles.php')) {
5
+ return;
6
+ }
7
+
8
+ $screen = get_current_screen();
9
+
10
+ $screenparent = $screen->parent_file;
11
+
12
+
13
+ if ( $screenparent == 'plugins.php' && current_user_can( 'install_plugins' ) ) {
14
+
15
+ $user_id = wp_get_current_user()->ID;
16
+ $has_dismissed = get_user_meta( $user_id, 'bctt_has_dismissed_nag', true );
17
+
18
+ if ( ! $has_dismissed && ! bctt_add_custom_style_option() ) {
19
+ //add style inline so that it isn't enqueued if not used
20
+ ?>
21
+ <style>
22
+ span.bctt-addon-nag-header {
23
+ font-size: large;
24
+ font-weight: bold;
25
+ }
26
+
27
+ .updated.bctt-addon-nag {
28
+ padding: 1em;
29
+ }
30
+
31
+ p.bctt-addon-nag-copy {
32
+
33
+ }
34
+
35
+ ul.bctt-addon-nag-list {
36
+ list-style-type: none;
37
+ margin-left: 2em;
38
+ }
39
+
40
+ .bctt-addon-nag-list li:before {
41
+ content: "\f155";
42
+ display: inline-block;
43
+ -webkit-font-smoothing: antialiased;
44
+ font: normal 16px/1 'dashicons';
45
+ color: #46b450;
46
+ margin-right: 10px;
47
+ word-wrap: break-word;
48
+ }
49
+
50
+ .bctt-addon-nag-dismiss {
51
+ float: right;
52
+ text-decoration: none;
53
+ }
54
+ .bctt-nag-photo {
55
+ float: right;
56
+ margin:0;
57
+ max-height:105px;
58
+ max-width:98%;
59
+ }
60
+ @media screen and (max-width: 782px) {
61
+ .bctt-nag-photo {
62
+ float:none;
63
+ }
64
+ }
65
+ .bctt-nag-purchase-link {
66
+ font-size: large;
67
+ }
68
+ </style>
69
+ <div class="updated bctt-addon-nag">
70
+
71
+ <a href="<?php
72
+ //The Dismiss Button.
73
+ $nag_meta_key = 'bctt_has_dismissed_nag';
74
+ $nag_admin_dismiss_url = 'plugins.php?' . $nag_meta_key . '=0';
75
+ echo esc_url( admin_url( $nag_admin_dismiss_url ) ); ?>" class="dismiss bctt-addon-nag-dismiss">Dismiss this <span
76
+ class="dashicons dashicons-dismiss"></span></a>
77
+ <h3
78
+ class="bctt-addon-nag-header"><?php esc_html_e( 'Add Premium Style to your Better Click To Tweet boxes!', 'better-click-to-tweet' ) ?></h3>
79
+
80
+ <a href="http://benlikes.us/bcttnag"
81
+ target="_blank"><img class="bctt-nag-photo" src="<?php echo esc_url( plugins_url() . '/better-click-to-tweet/assets/img/premium_style.png' ); ?>"/></a>
82
+
83
+ <p class="bctt-addon-nag-copy"><?php esc_attr_e( 'Choose from multiple options when styling your Better Click To Tweet boxes, with no code.', 'better-click-to-tweet' ) ?></p>
84
+ <ul class="bctt-addon-nag-list">
85
+ <li><?php esc_html_e( 'Make your Better Click To Tweet boxes stand out.', 'better-click-to-tweet' ) ?></li>
86
+ <li><?php esc_html_e( 'Get more clicks and tweets.', 'better-click-to-tweet' ) ?></li>
87
+ <li><?php esc_html_e( 'Support the development of Better Click To Tweet!', 'better-click-to-tweet' ) ?></li>
88
+ </ul>
89
+ <p class="bctt-addon-nag-copy">
90
+ <a class="bctt-nag-purchase-link" href="http://benlikes.us/bcttnag"
91
+ target="_blank"><?php esc_html_e( 'Purchase it today', 'better-click-to-tweet' ) ?></a> <?php esc_html_e( 'Save 8% with the code NAGSareTHEbest', 'better-click-to-tweet') ?></p>
92
+ </div>
93
+ <?php
94
+ }
95
+ }
96
+ }
97
+
98
+ add_action( 'admin_notices', 'bctt_alerts' );
99
+
100
+ function bctt_addon_notice_ignore() {
101
+
102
+ /**
103
+ * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not.
104
+ * See here: http://codex.wordpress.org/Function_Reference/add_user_meta
105
+ */
106
+
107
+ if ( isset( $_GET['bctt_has_dismissed_nag'] ) && '0' == $_GET['bctt_has_dismissed_nag'] ) {
108
+
109
+ //Get the global user
110
+ $current_user = wp_get_current_user();
111
+ $user_id = $current_user->ID;
112
+
113
+ add_user_meta( $user_id, 'bctt_has_dismissed_nag', 'true', true );
114
+ }
115
+ }
116
+
117
+ add_action( 'current_screen', 'bctt_addon_notice_ignore' );
trunk/assets/block/build/editor.css ADDED
File without changes
trunk/assets/block/build/editor.rtl.css ADDED
File without changes
trunk/assets/block/build/script.js ADDED
@@ -0,0 +1,6 @@
1
+ this.bctt=this.bctt||{},this.bctt.main=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e){!function(){t.exports=this.wp.i18n}()},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(7),o=n(8);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(33);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){!function(){t.exports=this.wp.editor}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=(n.n(r),n(12)),u=(n.n(o),n(13)),c=n(14),i=n(49);e.default=Object(o.registerBlockType)("bctt/clicktotweet",{title:Object(r.__)("Better Click to Tweet"),description:Object(r.__)("Add text for your readers to tweet, calling them to action on your behalf."),category:"widgets",icon:"twitter",keywords:[Object(r.__)("Twitter"),Object(r.__)("Tweet")],attributes:u.a,edit:c.a,save:i.a})},function(t,e){!function(){t.exports=this.wp.blocks}()},function(t,e,n){"use strict";var r=n(0),o=(n.n(r),{tweet:{type:"string"},username:{type:"string",default:bctt_options_js.username},via:{type:"boolean",default:!0},url:{type:"boolean",default:!0},urlcustom:{type:"string"},nofollow:{type:"boolean",default:!1},prompt:{type:"string",default:Object(r.__)("Click To Tweet")}});e.a=o},function(t,e,n){"use strict";var r=n(15),o=n.n(r),u=n(44),c=n.n(u),i=n(0),a=(n.n(i),n(45)),f=(n.n(a),n(10)),l=(n.n(f),n(46)),s=n(48),p=(n.n(s),function(t){var e=t.attributes,n=t.setAttributes,r=t.className,u=e.tweet,s=e.prompt,p=function(t){n({tweet:t})},v=function(){return!1};return wp.element.createElement(a.Fragment,null,wp.element.createElement(l.a,o()({},t)),wp.element.createElement("span",{className:c()(r,"bctt-click-to-tweet")},wp.element.createElement("span",{className:"bctt-ctt-text"},wp.element.createElement(f.RichText,{format:"string",formattingControls:[],tagName:"div",placeholder:Object(i.__)("Enter text for readers to Tweet"),onChange:p,value:u})),wp.element.createElement("a",{href:"#",onClick:v,className:"bctt-ctt-btn"},s)))});e.a=p},function(t,e,n){"use strict";e.__esModule=!0;var r=n(16),o=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=o.default||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}},function(t,e,n){t.exports={default:n(17),__esModule:!0}},function(t,e,n){n(18),t.exports=n(5).Object.assign},function(t,e,n){var r=n(19);r(r.S+r.F,"Object",{assign:n(29)})},function(t,e,n){var r=n(1),o=n(5),u=n(20),c=n(22),i=function(t,e,n){var a,f,l,s=t&i.F,p=t&i.G,v=t&i.S,b=t&i.P,m=t&i.B,h=t&i.W,y=p?o:o[e]||(o[e]={}),w=y.prototype,_=p?r:v?r[e]:(r[e]||{}).prototype;p&&(n=e);for(a in n)(f=!s&&_&&void 0!==_[a])&&a in y||(l=f?_[a]:n[a],y[a]=p&&"function"!=typeof _[a]?n[a]:m&&f?u(l,r):h&&_[a]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):b&&"function"==typeof l?u(Function.call,l):l,b&&((y.virtual||(y.virtual={}))[a]=l,t&i.R&&w&&!w[a]&&c(w,a,l)))};i.F=1,i.G=2,i.S=4,i.P=8,i.B=16,i.W=32,i.U=64,i.R=128,t.exports=i},function(t,e,n){var r=n(21);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(23),o=n(28);t.exports=n(3)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(24),o=n(25),u=n(27),c=Object.defineProperty;e.f=n(3)?Object.defineProperty:function(t,e,n){if(r(t),e=u(e,!0),r(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(2);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(3)&&!n(4)(function(){return 7!=Object.defineProperty(n(26)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(2),o=n(1).document,u=r(o)&&r(o.createElement);t.exports=function(t){return u?o.createElement(t):{}}},function(t,e,n){var r=n(2);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var r=n(30),o=n(41),u=n(42),c=n(43),i=n(7),a=Object.assign;t.exports=!a||n(4)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=a({},t)[n]||Object.keys(a({},e)).join("")!=r})?function(t,e){for(var n=c(t),a=arguments.length,f=1,l=o.f,s=u.f;a>f;)for(var p,v=i(arguments[f++]),b=l?r(v).concat(l(v)):r(v),m=b.length,h=0;m>h;)s.call(v,p=b[h++])&&(n[p]=v[p]);return n}:a},function(t,e,n){var r=n(31),o=n(40);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(32),o=n(6),u=n(34)(!1),c=n(37)("IE_PROTO");t.exports=function(t,e){var n,i=o(t),a=0,f=[];for(n in i)n!=c&&r(i,n)&&f.push(n);for(;e.length>a;)r(i,n=e[a++])&&(~u(f,n)||f.push(n));return f}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(6),o=n(35),u=n(36);t.exports=function(t){return function(e,n,c){var i,a=r(e),f=o(a.length),l=u(c,f);if(t&&n!=n){for(;f>l;)if((i=a[l++])!=i)return!0}else for(;f>l;l++)if((t||l in a)&&a[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(9),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(9),o=Math.max,u=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):u(t,e)}},function(t,e,n){var r=n(38)("keys"),o=n(39);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(1),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(8);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r,o;/*!
2
+ Copyright (c) 2016 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */
6
+ !function(){"use strict";function n(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var o=typeof r;if("string"===o||"number"===o)t.push(r);else if(Array.isArray(r))t.push(n.apply(null,r));else if("object"===o)for(var c in r)u.call(r,c)&&r[c]&&t.push(c)}}return t.join(" ")}var u={}.hasOwnProperty;void 0!==t&&t.exports?t.exports=n:(r=[],void 0!==(o=function(){return n}.apply(e,r))&&(t.exports=o))}()},function(t,e){!function(){t.exports=this.wp.element}()},function(t,e,n){"use strict";var r=n(0),o=(n.n(r),n(10)),u=(n.n(o),n(47)),c=(n.n(u),function(t){var e=t.attributes,n=t.setAttributes,c=e.username,i=e.via,a=e.url,f=e.urlcustom,l=e.nofollow,s=e.prompt,p=function(t){n({username:t})},v=function(){n({via:!i})},b=function(){n({url:!a})},m=function(t){n({urlcustom:t})},h=function(){n({nofollow:!l})},y=function(t){n({prompt:t})};return wp.element.createElement(o.InspectorControls,{key:"inspector"},wp.element.createElement(u.PanelBody,{Title:Object(r.__)("Tweet Settings")},wp.element.createElement(u.TextControl,{label:Object(r.__)("Twitter Username"),value:c,onChange:p}),wp.element.createElement(u.ToggleControl,{label:Object(r.__)("Include the username in Tweet?"),checked:!!i,onChange:v}),wp.element.createElement(u.ToggleControl,{label:Object(r.__)("Include URL in tweet?"),checked:!!a,onChange:b}),wp.element.createElement(u.TextControl,{label:Object(r.__)("Custom URL"),value:f,onChange:m,help:Object(r.__)("Custom URL to use instead of post")}),wp.element.createElement(u.ToggleControl,{label:Object(r.__)("Nofollow"),checked:!!l,onChange:h,help:Object(r.__)("Make links nofollow")}),wp.element.createElement(u.TextControl,{label:Object(r.__)("Prompt"),value:s,onChange:y,help:Object(r.__)("Text for action/prompt link")})))});e.a=c},function(t,e){!function(){t.exports=this.wp.components}()},function(t,e){},function(t,e,n){"use strict";var r=function(){return null};e.a=r}]);
trunk/assets/block/init.php ADDED
@@ -0,0 +1,76 @@
1
+ <?php
2
+ /**
3
+ * Blocks Registration
4
+ *
5
+ * Enqueue CSS/JS for the blocks & register callback to render shortcode on frontend
6
+ */
7
+ // Exit if accessed directly.
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ // Enqueue Block assets
13
+ function bctt_block_editor_assets() {
14
+ wp_enqueue_script('bctt-block-js', plugins_url('block/build/script.js', dirname(__FILE__)), array( 'wp-i18n', 'wp-blocks', 'wp-components' ));
15
+ if ( ! bctt_is_default_styles_dequeued() ) {
16
+ $stylesheet_url = bctt_get_stylesheet_url();
17
+
18
+ wp_enqueue_style( 'bctt-block-editor-css', $stylesheet_url, array(), 'all' );
19
+ }
20
+ // Add plugin options for block
21
+ $bctt_data = array(
22
+ 'username' => get_option( 'bctt-twitter-handle' ),
23
+ );
24
+ wp_localize_script( 'bctt-block-js', 'bctt_options_js', $bctt_data );
25
+ }
26
+
27
+ // Hook assets to editor
28
+ add_action('enqueue_block_editor_assets', 'bctt_block_editor_assets');
29
+
30
+ // Server side rendering callback to output shortcode
31
+ register_block_type('bctt/clicktotweet', [
32
+ 'render_callback' => 'bctt_block_callback',
33
+ 'attributes' => array(
34
+ 'tweet' => array(
35
+ 'type' => 'string',
36
+ ),
37
+ 'username' => array(
38
+ 'type' => 'string',
39
+ 'default' => get_option( 'bctt-twitter-handle' )
40
+ ),
41
+ 'via' => array(
42
+ 'type' => 'boolean',
43
+ 'default' => true
44
+ ),
45
+ 'url' => array(
46
+ 'type' => 'boolean',
47
+ 'default' => true
48
+ ),
49
+ 'urlcustom' => array(
50
+ 'type' => 'string'
51
+ ),
52
+ 'nofollow' => array(
53
+ 'type' => 'boolean',
54
+ 'default' => false
55
+ ),
56
+ 'prompt' => array(
57
+ 'type' => 'string',
58
+ 'default' => sprintf( _x( 'Click To Tweet', 'Text for the box on the reader-facing box', 'better-click-to-tweet' ) )
59
+ ),
60
+ ),
61
+ ]);
62
+
63
+ // Callback function to render bctt on frontend
64
+ function bctt_block_callback( $attributes ) {
65
+
66
+ //echo var_dump($attributes);
67
+ //exit;
68
+ extract( $attributes );
69
+
70
+ $url = ($url ? 'yes' : 'no');
71
+
72
+ $shortcode_string = '[bctt tweet="%s" url="%s" via="%s" username="%s" nofollow="%s" prompt="%s"]';
73
+
74
+ return sprintf( $shortcode_string, $tweet, ($urlcustom ? $urlcustom : $url), ( $via ? 'yes' : 'no' ), $username, ( $nofollow ? 'yes' : 'no' ), $prompt);
75
+ }
76
+
trunk/assets/css/bctt-admin.css ADDED
@@ -0,0 +1,14 @@
1
+ #post-box-container-1 {
2
+ float:right;
3
+ margin-right: -300px;
4
+ }
5
+ .bctt-signup {
6
+ font-size:unset;
7
+ }
8
+
9
+ @media only screen and (max-width: 850px) {
10
+ #post-box-container-1 {
11
+
12
+ margin-right: 0;
13
+ }
14
+ }
trunk/assets/css/bcttstyle.css ADDED
@@ -0,0 +1,60 @@
1
+ .bctt-click-to-tweet {
2
+ display: block;
3
+ background-color: #FFF;
4
+ position: relative;
5
+ border-top: 2px solid black;
6
+ border-bottom: 2px solid black;
7
+ padding: 19px 12px 19px 18px;
8
+ margin-bottom: 1em;
9
+ }
10
+
11
+ .bctt-click-to-tweet:after {
12
+ content: ".";
13
+ display: block;
14
+ clear: both;
15
+ visibility: hidden;
16
+ line-height: 0;
17
+ height: 0;
18
+ }
19
+
20
+ .bctt-ctt-text a {
21
+ padding: 15px 0px;
22
+ margin: 15px 0;
23
+ position: relative;
24
+ color: #000 !important;
25
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
26
+ font-size: 1.5em;
27
+ line-height: 140%;
28
+ font-weight: 100;
29
+ text-decoration: none !important;
30
+ text-transform: none !important;
31
+ word-wrap: break-word;
32
+ border-bottom: none !important;
33
+ box-shadow: none !important;
34
+ }
35
+
36
+ .bctt-ctt-text a:hover {
37
+ text-decoration: none;
38
+ color: #999 !important;
39
+ }
40
+
41
+ a.bctt-ctt-btn {
42
+ border-bottom: none !important;
43
+ box-shadow: none !important;
44
+ margin: 0;
45
+ padding: 18px 0 0 0;
46
+ position: relative;
47
+ display: block;
48
+ text-transform: uppercase;
49
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
50
+ font-size: .7em;
51
+ font-weight: bold;
52
+ color: #999999 !important;
53
+ float: right;
54
+ text-decoration: none !important;
55
+ }
56
+
57
+ .bctt-ctt-btn:hover {
58
+ text-decoration: none;
59
+ color: #666666 !important;
60
+ }
trunk/assets/css/styles.css ADDED
@@ -0,0 +1,81 @@
1
+
2
+ .bctt-click-to-tweet {
3
+ display: block;
4
+ background-color: #fff;
5
+ position: relative;
6
+ border: 1px solid #dddddd;
7
+ -moz-border-radius: 4px;
8
+ border-radius: 4px;
9
+ padding: 15px 15px 15px 30px;
10
+ margin-bottom: 1em;
11
+ margin-top: 1.75em;
12
+ }
13
+
14
+ .bctt-click-to-tweet:after {
15
+ content: ".";
16
+ display: block;
17
+ clear: both;
18
+ visibility: hidden;
19
+ line-height: 0;
20
+ height: 0;
21
+ }
22
+
23
+ /* For compatibility with the new editor in version 5.0 codenamed Gutenberg */
24
+
25
+ .bctt-click-to-tweet .mce-content-body {
26
+ position: relative;
27
+ color: #000 !important;
28
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
29
+ font-size: 1.5em;
30
+ line-height: 140%;
31
+ font-weight: 100;
32
+ text-decoration: none !important;
33
+ text-transform: none !important;
34
+ word-wrap: break-word;
35
+ border-bottom: none !important;
36
+ box-shadow: none !important;
37
+ }
38
+
39
+ .bctt-ctt-text a {
40
+ padding: 15px 0;
41
+ margin: 15px 0;
42
+ position: relative;
43
+ color: #000 !important;
44
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
45
+ font-size: 1.5em;
46
+ line-height: 140%;
47
+ font-weight: 100;
48
+ text-decoration: none !important;
49
+ text-transform: none !important;
50
+ word-wrap: break-word;
51
+ border-bottom: none !important;
52
+ box-shadow: none !important;
53
+ }
54
+
55
+ .bctt-ctt-text a:hover {
56
+ text-decoration: none;
57
+ color: #999 !important;
58
+ }
59
+
60
+ a.bctt-ctt-btn {
61
+ border-bottom: none !important;
62
+ margin: 0;
63
+ padding: 11px 24px 0 0;
64
+ position: relative;
65
+ display: block;
66
+ text-transform: uppercase;
67
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
68
+ font-size: .7em;
69
+ font-weight: bold;
70
+ color: #999999 !important;
71
+ float: right;
72
+ text-decoration: none !important;
73
+ background: transparent url(../img/birdy.png) no-repeat right top 10px;
74
+ box-shadow: none !important;
75
+ }
76
+
77
+ .bctt-ctt-btn:hover {
78
+ text-decoration: none;
79
+ color: #666666 !important;
80
+ background: transparent url(../img/birdy.png) no-repeat right top 8px;
81
+ }
trunk/assets/img/birdy.png ADDED
Binary file
trunk/assets/img/birdy_button.png ADDED
Binary file
trunk/assets/img/empty.gif ADDED
Binary file
trunk/assets/img/premium_style.png ADDED
Binary file
trunk/assets/tinymce/bctt-tinymce.php ADDED
@@ -0,0 +1,109 @@
1
+ <?php
2
+ /**
3
+ * This file for use with the Better Click To Tweet Plugin. http://wordpress.org/plugins/better-click-to-tweet
4
+ * Huge thanks to Andrew Norcross @norcross for pretty much every bit of code you see here:
5
+ *
6
+ * @since 4.0
7
+ * @author Andrew Norcross
8
+ */
9
+
10
+ defined( 'ABSPATH' ) or die( "No soup for you. You leave now." );
11
+
12
+ if ( ! class_exists( 'BCTT_TinyMCE' ) ) {
13
+
14
+ // Start up the engine
15
+ class BCTT_TinyMCE {
16
+
17
+ /**
18
+ * This is our constructor
19
+ *
20
+ * @return BCTT_TinyMCE
21
+ */
22
+ public function __construct() {
23
+ add_action( 'admin_init', array( $this, 'tinymce_loader' ) );
24
+ add_action( 'admin_enqueue_scripts', array( $this, 'tinymce_css' ), 10 );
25
+ }
26
+
27
+ /**
28
+ * load our CSS file
29
+ * @return [type] [description]
30
+ */
31
+ public function tinymce_css() {
32
+
33
+ wp_enqueue_style( 'bctt-admin', plugins_url( '/css/bctt-admin.css', __FILE__ ), array(), null, 'all' );
34
+ }
35
+
36
+ /**
37
+ * load the TinyMCE button
38
+ *
39
+ * @return [type] [description]
40
+ */
41
+ public function tinymce_loader() {
42
+ add_filter( 'mce_external_languages', array( __class__, 'bctt_tinymce_languages' ) );
43
+ add_filter( 'mce_external_plugins', array( __class__, 'bctt_tinymce_core' ) );
44
+ add_filter( 'mce_buttons', array( __class__, 'bctt_tinymce_buttons' ) );
45
+ }
46
+
47
+ /**
48
+ * loader for the language strings
49
+ *
50
+ */
51
+ public static function bctt_tinymce_languages( $bctt_locales ) {
52
+ $bctt_locales['bctt'] = plugin_dir_path( __FILE__ ) . '/languages/bctt-mce-locale.php';
53
+
54
+ return $bctt_locales;
55
+ }
56
+
57
+ /**
58
+ * loader for the required JS
59
+ *
60
+ * @param [type] $plugin_array [description]
61
+ *
62
+ * @return [type] [description]
63
+ */
64
+ public static function bctt_tinymce_core( $plugin_array ) {
65
+
66
+ // add our JS file
67
+ $plugin_array['bctt'] = plugins_url( '/js/tinymce-bctt.js', __FILE__ );
68
+
69
+ // return the array
70
+ return $plugin_array;
71
+ }
72
+
73
+ /**
74
+ * Add the button key for event link via JS
75
+ *
76
+ * @param [type] $buttons [description]
77
+ *
78
+ * @return [type] [description]
79
+ */
80
+ public static function bctt_tinymce_buttons( $buttons ) {
81
+
82
+ // set the 'kitchen sink' button as a variable for later
83
+ $sink = array_search( 'wp_adv', $buttons );
84
+
85
+ // remove the sink
86
+ if ( ! empty( $sink ) ) {
87
+ unset( $buttons[ $sink ] );
88
+ }
89
+
90
+ // push our buttons to the end
91
+ array_push( $buttons, 'bctt' );
92
+
93
+ // now add back the sink
94
+ if ( ! empty( $sink ) ) {
95
+ $buttons[] = 'wp_adv';
96
+ }
97
+
98
+ // send them back
99
+ return $buttons;
100
+ }
101
+
102
+ // end class
103
+ }
104
+
105
+ // end exists check
106
+ }
107
+
108
+ // Instantiate our class
109
+ new BCTT_TinyMCE();
trunk/assets/tinymce/css/bctt-admin.css ADDED
@@ -0,0 +1,18 @@
1
+ .mce-i-bctt-tweet {
2
+ font-family: "dashicons";
3
+ }
4
+
5
+ .mce-i-bctt-tweet:before {
6
+ display: inline-block;
7
+ -webkit-font-smoothing: antialiased;
8
+ text-align: center;
9
+ font-weight: 400;
10
+ font-size: 20px;
11
+ line-height: 1;
12
+ font-family: "dashicons";
13
+ content: "\f301";
14
+ color: #4099ff;
15
+ speak: none;
16
+ vertical-align: top;
17
+ position: relative;
18
+ }
trunk/assets/tinymce/js/tinymce-bctt.js ADDED
@@ -0,0 +1,71 @@
1
+ ( function() {
2
+ tinymce.PluginManager.add( 'bctt', function( editor, url ) {
3
+
4
+ // Add a button that opens a window
5
+ editor.addButton( 'bctt', {
6
+
7
+ text: '',
8
+ tooltip: editor.getLang( 'bctt.toolTip', 'Better Click To Tweet Shortcode Generator' ),
9
+ icon: 'bctt-tweet',
10
+ onclick: function() {
11
+ // Open window
12
+ editor.windowManager.open( {
13
+ title: editor.getLang( 'bctt.windowTitle', 'Better Click To Tweet Shortcode Generator' ),
14
+ body: [
15
+ {
16
+ type: 'textbox',
17
+ name: 'tweet',
18
+ label: editor.getLang( 'bctt.tweetableQuote', 'Tweetable Quote' ),
19
+ multiline : true,
20
+ minHeight : 60
21
+ },
22
+ {
23
+ type: 'checkbox',
24
+ checked: true,
25
+ name: 'viamark',
26
+ value: true,
27
+ text: editor.getLang( 'bctt.viaExplainer', 'Add the username below to this tweet'),
28
+ label: editor.getLang( 'bctt.viaPrompt', 'Include "via"?'),
29
+ },
30
+ {
31
+ type: 'textbox',
32
+ name: 'username',
33
+ label: editor.getLang( 'bctt.usernameExplainer', 'Which Twitter username?'),
34
+ multiline: false,
35
+ value: editor.getLang( 'bctt.userPrePopulated', ''),
36
+ }
37
+ ],
38
+ width: 800,
39
+ height: 180,
40
+ onsubmit: function( e ) {
41
+
42
+ // bail without tweet text
43
+ if ( e.data.tweet === '' ) {
44
+ return;
45
+ }
46
+
47
+ // build my content
48
+ var bcttBuild = '';
49
+
50
+ // set initial
51
+ bcttBuild += '[bctt tweet="' + e.data.tweet + '"';
52
+
53
+ // check for via
54
+ if ( e.data.viamark === false ) {
55
+ bcttBuild += ' via="no"';
56
+
57
+ } else {
58
+ bcttBuild += ' username="' + e.data.username + '"';
59
+ }
60
+
61
+ // close it up
62
+ bcttBuild += ']';
63
+
64
+ // Insert content when the window form is submitted
65
+ editor.insertContent( bcttBuild );
66
+ }
67
+ });
68
+ }
69
+ });
70
+ });
71
+ })();
trunk/assets/tinymce/languages/bctt-mce-locale.php ADDED
@@ -0,0 +1,25 @@
1
+ <?php
2
+ /**
3
+ * This file dynamically creates MCE locales, based on .po/.mo files loaded in the plugin's translation folder.
4
+ * It interfaces with the TinyMCE API using the tinyMCE.addI18n() function,
5
+ * which adds a language pack to TinyMCE
6
+ *
7
+ * @var string $strings a JavaScript snippet to add another language pack to TinyMCE
8
+ * @var string $mce_locale an ISO 639-1 formated string of the current language e.g. en, de...
9
+ * @deprecated wp_tiny_mce() at wp-admin/includes/post.php (for versions prior WP 3.3)
10
+ * @see _WP_Editors::editor_settings in wp-includes/class-wp-editor.php
11
+ */
12
+ $strings =
13
+ 'tinyMCE.addI18n(
14
+ "' . $mce_locale . '.bctt",
15
+ {
16
+ toolTip : "' . esc_js( _x( 'Better Click To Tweet Shortcode Generator', 'Text that shows on mouseover for visual editor button', 'better-click-to-tweet' ) ) . '",
17
+ windowTitle : "' . esc_js( _x( 'Better Click To Tweet Shortcode Generator', 'Text for title of the popup box when creating tweetable quote in the visual editor', 'better-click-to-tweet' ) ) . '",
18
+ tweetableQuote : "' . esc_js( _x( 'Tweetable Quote', 'Text for label on input box on popup box in visual editor', 'better-click-to-tweet' ) ) . '",
19
+ viaExplainer : "' . esc_js( _x( 'Add the username below to this tweet', 'Text explaining the checkbox on the visual editor', 'better-click-to-tweet' ) ) . '",
20
+ viaPrompt : "' . esc_js( _x( 'Include via?', 'Checkbox label in visual editor', 'better-click-to-tweet' ) ) . '",
21
+ usernameExplainer : "' . esc_js( _x( 'Which Twitter username?', 'Help text for label in visual editor', 'better-click-to-tweet' ) ) . '",
22
+ userPrePopulated : "' . esc_js( get_option( 'bctt-twitter-handle' ) ) . '",
23
+ }
24
+ );
25
+ ';
trunk/bctt-i18n.php ADDED
@@ -0,0 +1,7 @@
1
+ <?php
2
+
3
+ add_action( 'plugins_loaded', 'bctt_load_textdomain' );
4
+
5
+ function bctt_load_textdomain() {
6
+ load_plugin_textdomain( 'better-click-to-tweet', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
7
+ }
trunk/bctt_options.php ADDED
@@ -0,0 +1,261 @@
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
+
4
+
5
+ // Cache bust tinymce
6
+ add_filter( 'tiny_mce_version', 'refresh_mce' );
7
+
8
+ // Add button to visual editor
9
+ include dirname( __FILE__ ) . '/assets/tinymce/bctt-tinymce.php';
10
+
11
+
12
+ // instantiate i18n encouragement module
13
+ $bctt_i18n = new bctt_i18n(
14
+ array(
15
+ 'textdomain' => 'better-click-to-tweet',
16
+ 'project_slug' => '/wp-plugins/better-click-to-tweet/stable',
17
+ 'plugin_name' => 'Better Click To Tweet',
18
+ 'hook' => 'bctt_settings_top',
19
+ 'glotpress_url' => 'https://translate.wordpress.org/',
20
+ 'glotpress_name' => 'Translating WordPress',
21
+ 'glotpress_logo' => 'https://plugins.svn.wordpress.org/better-click-to-tweet/assets/icon-256x256.png',
22
+ 'register_url ' => 'https://translate.wordpress.org/projects/wp-plugins/better-click-to-tweet/',
23
+ )
24
+ );
25
+
26
+ // Add Settings Link
27
+ add_action( 'admin_menu', 'bctt_admin_menu' );
28
+
29
+
30
+ function bctt_admin_menu() {
31
+ add_action( 'admin_init', 'bctt_register_settings', 100, 1 );
32
+ add_menu_page( 'Better Click To Tweet Options', 'Better Click To Tweet', 'manage_options', 'better-click-to-tweet', null, 'dashicons-twitter' );
33
+ add_submenu_page('better-click-to-tweet', 'Better Click To Tweet Main Settings', 'Settings', 'manage_options', 'better-click-to-tweet', 'bctt_settings_page' );
34
+ }
35
+
36
+ function bctt_register_settings() {
37
+ register_setting( 'bctt_clicktotweet-options', 'bctt-twitter-handle', 'bctt_validate_settings' );
38
+ register_setting( 'bctt_clicktotweet-options', 'bctt-short-url', 'bctt_validate_checkbox' );
39
+ }
40
+
41
+ function bctt_validate_settings( $input ) {
42
+ return preg_replace('/[^0-9a-zA-Z_]/', '', $input);
43
+ }
44
+
45
+ function bctt_validate_checkbox( $input ) {
46
+ if ( ! isset( $input ) || $input != '1' ) {
47
+ return 0;
48
+ } else {
49
+ return 1;
50
+ }
51
+ }
52
+
53
+ function bctt_add_custom_style_option() {
54
+ $bctt_dequeued_with_custom_funtion = bctt_is_default_styles_dequeued();
55
+
56
+ $bctt_custom_style = bctt_is_custom_stylesheet();
57
+
58
+ if ( $bctt_dequeued_with_custom_funtion || $bctt_custom_style ) {
59
+ return true;
60
+ } else {
61
+ return false;
62
+ }
63
+
64
+ }
65
+
66
+ function bctt_admin_styles() {
67
+ wp_register_style( 'bctt_admin_style', plugins_url( 'assets/css/bctt-admin.css', __FILE__ ) );
68
+ wp_enqueue_style( 'bctt_admin_style' );
69
+ }
70
+
71
+ function bctt_settings_page() {
72
+ if ( ! current_user_can( 'manage_options' ) ) {
73
+ wp_die( __( 'You do not have sufficient permissions to access this page.', 'better-click-to-tweet' ) );
74
+ }
75
+
76
+ bctt_admin_styles();
77
+ ?>
78
+
79
+ <div class="wrap">
80
+
81
+ <h1 class="wp-heading-inline"><?php /* translators: Treat "Better Click To Tweet" as a brand name, don't translate it */
82
+ _e( 'Better Click To Tweet — a plugin by Ben Meredith', 'better-click-to-tweet' ); ?></h1>
83
+
84
+ <hr/>
85
+ <?php do_action( 'bctt_settings_top' ); ?>
86
+
87
+
88
+ <div id="poststuff">
89
+ <div id="post-body" class="metabox-holder columns-2 ">
90
+ <div id="post-body-content" style="position: relative;">
91
+ <div id="bctt_instructions" class="postbox ">
92
+ <h2><?php _e( 'Instructions', 'better-click-to-tweet' ); ?></h2>
93
+ <div class="inside">
94
+
95
+ <p><?php /* translators: Treat "Better Click To Tweet" as a brand name, don't translate it */
96
+ _e( 'To add styled click-to-tweet quote boxes include the Better Click To Tweet shortcode in your post.', 'better-click-to-tweet' ); ?></p>
97
+
98
+ <p><?php _e( 'Here\'s how you format the shortcode:', 'better-click-to-tweet' ); ?></p>
99
+ <pre>[bctt tweet="<?php /* translators: This text shows up as a sample tweet in the instructions for how to use the plugin. */
100
+ _e( 'Meaningful, tweetable quote.', 'better-click-to-tweet' ); ?>"]</pre>
101
+ <p><?php /* translators: Also, treat "BCTT" as a brand name, don't translate it */
102
+ _e( 'If you are using the visual editor, click the BCTT birdie in the toolbar to add a pre-formatted shortcode to your post.', 'better-click-to-tweet' ); ?></p>
103
+
104
+ <p><?php _e( 'Tweet length is automatically shortened to 117 characters minus the length of your twitter name, to leave room for it and a link back to the post.', 'better-click-to-tweet' ); ?></p>
105
+ </div>
106
+ <!--/inside-->
107
+ </div>
108
+ <!--/bctt_instructions-->
109
+ <?php do_action( 'bctt_instructions_bottom' ); ?>
110
+ <div class="postbox">
111
+ <h2><?php _e( 'Settings', 'better-click-to-tweet' ); ?></h2>
112
+ <div class="inside">
113
+ <div class="main">
114
+ <p><?php _e( 'Enter your Twitter handle to add "via @yourhandle" to your tweets. Do not include the @ symbol.', 'better-click-to-tweet' ); ?></p>
115
+
116
+ <p><?php _e( 'Checking the box below will force the plugin to show the WordPress shortlink in place of the full URL. While this does not impact tweet character length, it is useful alongside plugins which customize the WordPress shortlink using services like bit.ly or yourls.org for tracking', 'better-click-to-tweet' ) ?> </p>
117
+
118
+ <form method="post" action="options.php" style="">
119
+ <?php settings_fields( 'bctt_clicktotweet-options' ); ?>
120
+
121
+ <table class="form-table">
122
+ <tr valign="top">
123
+ <th style="width: 200px;">
124
+ <label for="bctt-twitter-handle"><?php _ex( 'Your Twitter Handle', 'label for text input on settings screen', 'better-click-to-tweet' ); ?></label>
125
+ </th>
126
+ <td><input id="bctt-twitter-handle" type="text" name="bctt-twitter-handle"
127
+ value="<?php echo esc_attr( get_option( 'bctt-twitter-handle' ) ); ?>"/>
128
+ </td>
129
+ <tr valign="top">
130
+ <th style="width: 200px;">
131
+ <label for="bctt-short-url"><?php _ex( 'Use Short URL?', 'label for checkbox on settings screen', 'better-click-to-tweet' ); ?></label>
132
+ </th>
133
+ <td><input id="bctt-short-url" type="checkbox" name="bctt-short-url"
134
+ value="1" <?php if ( 1 == get_option( 'bctt-short-url' ) ) {
135
+ echo 'checked="checked"';
136
+ } ?>" />
137
+ </td>
138
+ </tr>
139
+
140
+ <?php if ( ! bctt_add_custom_style_option() ) { ?>
141
+ <tr valign="top">
142
+ <th style="width:200px;">
143
+ <label><?php _ex( 'Use Premium Styles?', 'label for checkbox on settings screen', 'better-click-to-tweet' ); ?></label>
144
+ </th>
145
+ <td><input type="checkbox" name="bctt-custom-style"
146
+ value="1" <?php if ( is_plugin_active( 'better-click-to-tweet-styles/better-click-to-tweet-premium-styles.php' ) ) {
147
+ echo 'checked="checked"';
148
+ } else {
149
+ echo 'disabled="disabled"';
150
+ } ?>" /> <span
151
+ style="font-size: .85em;"><em> <?php if ( ! is_plugin_active( 'better-click-to-tweet-styles/better-click-to-tweet-premium-styles.php' ) ) {
152
+ echo sprintf( __( 'Want Premium styles? Add the <a href=%s>Premium Styles add-on</a> today!', 'better-click-to-tweet' ), esc_url( 'http://benlikes.us/bcttpsdirect' ) );
153
+ } ?></em></span>
154
+
155
+ </td>
156
+ </tr>
157
+ <?php } ?>
158
+ </table>
159
+ <?php do_action( 'bctt_before_settings_submit' ); ?>
160
+ <br class="clear"/>
161
+
162
+ <p><input type="submit" class="button-primary"
163
+ value="<?php _e( 'Save Changes', 'better-click-to-tweet' ); ?>"/>
164
+ </p>
165
+ <br class="clear"/>
166
+ <em><?php $url = 'https://www.betterclicktotweet.com';
167
+ $link = sprintf( __( 'An open source plugin by <a href=%s>Ben Meredith</a>', 'better-click-to-tweet' ), esc_url( $url ) );
168
+ echo $link; ?></em>
169
+ </form>
170
+
171
+ </div>
172
+ <!--/main-->
173
+ </div>
174
+ <!--/inside-->
175
+ </div>
176
+ <!--/postbox-->
177
+ </div>
178
+ <!--/post-body-content-->
179
+ <?php do_action( 'bctt_after_settings' ); ?>
180
+
181
+ <div id="post-box-container-1" class="post-box-container">
182
+ <div id="side-sortables" class="meta-box-sortables ui-sortable">
183
+
184
+ <div id="bctt-author" class="postbox " style="display:block;">
185
+ <h2><?php _e( 'About the Author', 'better-click-to-tweet' ); ?> </h2>
186
+
187
+ <div id="bctt_signup" class="inside">
188
+ <form
189
+ action="//benandjacq.us1.list-manage.com/subscribe/post?u=8f88921110b81f81744101f4d&amp;id=bd909b5f89"
190
+ method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form"
191
+ class="validate" target="_blank" novalidate>
192
+ <div id="mc_embed_signup_scroll">
193
+ <p> <?php echo sprintf( __( 'This plugin is developed by <a href="%s">Ben Meredith</a>. I am a freelance developer specializing in <a href="%s">outrunning and outsmarting hackers</a>.', 'better-click-to-tweet' ), esc_url( 'https://www.wpsteward.com' ), esc_url( 'https://www.wpsteward.com/service-plans' ) ); ?></p>
194
+ <h3 class="bctt-signup"><?php _e( 'Sign up to receive my FREE web strategy guide', 'better-click-to-tweet' ); ?></h3>
195
+
196
+ <p><label for="bctt-email-signup" class="hidden">
197
+ Your Email Address
198
+ </label>
199
+ <input id="bctt-email-signup" type="email" value="" name="EMAIL" class="widefat" id="mce-EMAIL"
200
+ placeholder="<?php _ex( 'Your Email Address', 'placeholder text for input field', 'better-click-to-tweet' ); ?>">
201
+ <small><?php _e( 'No Spam. One-click unsubscribe in every message', 'better-click-to-tweet' ); ?></small>
202
+ </p>
203
+ <div style="position: absolute; left: -5000px;">
204
+ <label for="bctt-mailchimp-subscribe-hidden" class="hidden">
205
+ Hidden field for MailChimp verification
206
+ </label>
207
+ <input id="bctt-mailchimp-subscribe-hidden" type="text"
208
+ name="b_8f88921110b81f81744101f4d_bd909b5f89"
209
+ tabindex="-1" value="">
210
+ </div>
211
+ <p class="clear"><input type="submit" value="<?php _e( 'Subscribe', 'better-click-to-tweet' ); ?>" name="subscribe"
212
+ id="mc-embedded-subscribe" class="button-secondary"></p>
213
+
214
+ </div>
215
+ <!--/mc_embed_signup_scroll-->
216
+ </form>
217
+ </div>
218
+ <!--/bctt_signup-->
219
+ <?php do_action( 'bctt_author_box_bottom' ); ?>
220
+ </div>
221
+ <!--/bctt-author-->
222
+ </div>
223
+ <!--/side-sortables-->
224
+
225
+ <div id="side-sortables" class="meta-box-sortables ui-sortable">
226
+ <div id="bctt-contrib" class="postbox">
227
+ <div class="inside">
228
+ <p><?php $url2 = 'https://github.com/Benunc/better-click-to-tweet';
229
+ $link2 = sprintf( __( 'Are you a developer? I would love your help making this plugin better. Check out the <a href=%s>plugin on Github.</a>', 'better-click-to-tweet' ), esc_url( $url2 ) );
230
+ echo $link2; ?></p>
231
+
232
+ <p><?php $url3 = 'https://www.wpsteward.com/donations/plugin-support/';
233
+ $link3 = sprintf( __( 'The best way you can support this and other plugins is to <a href=%s>donate</a>', 'better-click-to-tweet' ), esc_url( $url3 ) );
234
+ echo $link3; ?>
235
+ . <?php $url4 = 'https://wordpress.org/support/view/plugin-reviews/better-click-to-tweet';
236
+ $link4 = sprintf( __( 'The second best way is to <a href=%s>leave an honest review.</a>', 'better-click-to-tweet' ), esc_url( $url4 ) );
237
+ echo $link4; ?></p>
238
+
239
+ <p><?php _e( 'Did this plugin save you enough time to be worth some money?', 'better-click-to-tweet' ); ?></p>
240
+
241
+ <p>
242
+ <a href="https://www.wpsteward.com/donations/plugin-support/"
243
+ target="_blank"><?php _e( 'Click here to buy me a Coke to say thanks.', 'better-click-to-tweet' ); ?></a>
244
+ </p>
245
+ </div>
246
+ <!--/inside-->
247
+ </div>
248
+ <!--/donate-contrib-->
249
+ <?php do_action( 'bctt_contrib_bottom' ); ?>
250
+ </div>
251
+ <!--side-sortables-->
252
+ </div>
253
+ <!--/post-box-container-1-->
254
+ </div>
255
+ <!--/post-body-->
256
+ </div>
257
+ <!--/wrap-->
258
+ <?php
259
+ }
260
+
261
+
trunk/better-click-to-tweet.php ADDED
@@ -0,0 +1,347 @@
1
+ <?php
2
+ /*
3
+ Plugin Name: Better Click To Tweet
4
+ Description: Add Click to Tweet boxes simply and elegantly to your posts or pages. All the features of a premium plugin, for FREE!
5
+ Version: 5.5
6
+ Author: Ben Meredith
7
+ Author URI: https://www.betterclicktotweet.com
8
+ Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
9
+ License: GPL2
10
+ Text Domain: better-click-to-tweet
11
+ */
12
+ include 'i18n-module.php';
13
+ include 'bctt_options.php';
14
+ include 'bctt-i18n.php';
15
+ include 'admin-nags.php';
16
+
17
+ defined( 'ABSPATH' ) or die( "No soup for you. You leave now." );
18
+
19
+ /*
20
+ * Strips the html, shortens the text (after checking for mb_internal_encoding compatibility)
21
+ * and adds an ellipsis if the text has been shortened
22
+ *
23
+ * @param string $input raw text string from the shortcode
24
+ * @param int $length length for truncation
25
+ * @param bool $ellipsis boolean for whether the text has been truncated
26
+ * @param bool $strip_html ensures that html is stripped from text string
27
+ */
28
+
29
+
30
+ function bctt_shorten( $input, $length, $ellipsis = true, $strip_html = true ) {
31
+
32
+ if ( $strip_html ) {
33
+ $input = strip_tags( $input );
34
+ }
35
+
36
+ /*
37
+ * Checks to see if the mbstring php extension is loaded, for optimal truncation.
38
+ * If it's not, it bails and counts the characters based on utf-8.
39
+ * What this means for users is that non-Roman characters will only be counted
40
+ * correctly if that extension is loaded. Contact your server admin to enable the extension.
41
+ */
42
+
43
+ if ( function_exists( 'mb_internal_encoding' ) ) {
44
+ if ( mb_strlen( $input ) <= $length ) {
45
+ return $input;
46
+ }
47
+
48
+ $last_space = mb_strrpos( mb_substr( $input, 0, $length ), ' ' );
49
+ $trimmed_text = mb_substr( $input, 0, $last_space );
50
+
51
+ if ( $ellipsis ) {
52
+ $trimmed_text .= "…";
53
+ }
54
+
55
+ return $trimmed_text;
56
+
57
+ } else {
58
+
59
+ if ( strlen( $input ) <= $length ) {
60
+ return $input;
61
+ }
62
+
63
+ $last_space = strrpos( substr( $input, 0, $length ), ' ' );
64
+ $trimmed_text = substr( $input, 0, $last_space );
65
+
66
+ if ( $ellipsis ) {
67
+ $trimmed_text .= "…";
68
+ }
69
+
70
+ return $trimmed_text;
71
+ }
72
+ }
73
+
74
+ ;
75
+
76
+ /*
77
+ * Creates the bctt shortcode
78
+ *
79
+ * @since 0.1
80
+ * @param array $atts an array of shortcode attributes
81
+ *
82
+ */
83
+
84
+ function bctt_shortcode( $atts ) {
85
+
86
+ $atts = shortcode_atts( apply_filters( 'bctt_atts', array(
87
+ 'tweet' => '',
88
+ 'via' => 'yes',
89
+ 'username' => 'not-a-real-user',
90
+ 'url' => 'yes',
91
+ 'nofollow' => 'no',
92
+ 'prompt' => sprintf( _x( 'Click To Tweet', 'Text for the box on the reader-facing box', 'better-click-to-tweet' ) )
93
+ ) ), $atts, 'bctt' );
94
+
95
+ //since 4.7: adds option to add in a per-box username to the tweet
96
+ if ( $atts['username'] != 'not-a-real-user' ) {
97
+
98
+ $handle = $atts['username'];
99
+
100
+ } else {
101
+
102
+ $handle = get_option( 'bctt-twitter-handle' );
103
+
104
+ }
105
+
106
+ if ( function_exists( 'mb_internal_encoding' ) ) {
107
+
108
+ $handle_length = ( 6 + mb_strlen( $handle ) );
109
+
110
+ } else {
111
+
112
+ $handle_length = ( 6 + strlen( $handle ) );
113
+
114
+ }
115
+
116
+ if ( ! empty( $handle ) && $atts['via'] != 'no' ) {
117
+
118
+ $via = $handle;
119
+ $related = $handle;
120
+ } else {
121
+
122
+ $via = null;
123
+ $related = '';
124
+
125
+ }
126
+
127
+ if ( $atts['via'] != 'yes' ) {
128
+ $via = null;
129
+ $handle_length = 0;
130
+
131
+ }
132
+
133
+ $text = $atts['tweet'];
134
+
135
+ if ( filter_var( $atts['url'], FILTER_VALIDATE_URL ) ) {
136
+
137
+ $bcttURL = $atts['url'];
138
+
139
+ } elseif ( $atts['url'] != 'no' ) {
140
+
141
+ if ( get_option( 'bctt-short-url' ) != false ) {
142
+
143
+ $bcttURL = wp_get_shortlink();
144
+
145
+ } else {
146
+
147
+ $bcttURL = get_permalink();
148
+
149
+ }
150
+
151
+ } else {
152
+
153
+ $bcttURL = null;
154
+
155
+ }
156
+
157
+ if ( $atts['url'] != 'no' ) {
158
+
159
+ $short = bctt_shorten( $text, ( 253 - ( $handle_length ) ) );
160
+
161
+ } else {
162
+
163
+ $short = bctt_shorten( $text, ( 280 - ( $handle_length ) ) );
164
+
165
+ }
166
+
167
+ if ( $atts['nofollow'] != 'no' ) {
168
+
169
+ $rel = 'rel="noopener noreferrer nofollow"';
170
+
171
+ } else {
172
+
173
+ $rel = 'rel="noopener noreferrer"';
174
+
175
+ }
176
+
177
+ $bctt_span_class = apply_filters( 'bctt_span_class', 'bctt-click-to-tweet' );
178
+ $bctt_text_span_class = apply_filters( 'bctt_text_span_class', 'bctt-ctt-text' );
179
+ $bctt_button_span_class = apply_filters( 'bctt_button_span_class', 'bctt-ctt-btn' );
180
+
181
+
182
+ $href = add_query_arg( array(
183
+ 'url' => $bcttURL,
184
+ 'text' => rawurlencode( html_entity_decode( $short ) ),
185
+ 'via' => $via,
186
+ 'related' => $related,
187
+ ), 'https://twitter.com/intent/tweet' );
188
+
189
+ if ( ! is_feed() ) {
190
+
191
+ $output = "<span class='" . esc_attr( $bctt_span_class ) . "'><span class='" . esc_attr( $bctt_text_span_class ) . "'><a href='" . esc_url( $href ) . "' target='_blank'" . $rel . ">" . esc_html( $short ) . " </a></span><a href='" . esc_url( $href ) . "' target='_blank' class='" . esc_attr( $bctt_button_span_class ) . "'" . $rel . ">" . esc_html( $atts['prompt'] ) . "</a></span>";
192
+ } else {
193
+
194
+ $output = "<hr /><p><em>" . esc_html( $short ) . "</em><br /><a href='" . esc_url( $href ) . "' target='_blank' " . $rel . " >" . esc_html( $atts['prompt'] ) . "</a><br /><hr />";
195
+
196
+ }
197
+ return apply_filters( 'bctt_output', $output, $short, $bctt_button_span_class, $bctt_span_class, $bctt_text_span_class, $href, $rel, $atts );
198
+ }
199
+
200
+ add_shortcode( 'bctt', 'bctt_shortcode' );
201
+
202
+ /*
203
+ * Load the stylesheet to style the output.
204
+ *
205
+ * As of v4.1, defaults to a custom stylesheet
206
+ * located in the root of the uploads folder at wp-content/uploads/bcttstyle.css and falls
207
+ * back to the stylesheet bundled with the plugin if the custom sheet is not present.
208
+ *
209
+ * @since 0.1
210
+ *
211
+ */
212
+
213
+ function bctt_scripts() {
214
+
215
+ if ( bctt_is_default_styles_dequeued() ) {
216
+ foreach ( wp_load_alloptions() as $option => $value ) {
217
+ if ( strpos( $option, 'bcct_' ) === 0 ) {
218
+ delete_option( $option );
219
+ }
220
+ }
221
+
222
+ return;
223
+ }
224
+
225
+ $custom = bctt_is_custom_stylesheet();
226
+
227
+ $tag = $custom ? 'bcct_custom_style' : 'bcct_style';
228
+ $location = bctt_get_stylesheet_url();
229
+
230
+ $version = $custom ? '1.0' : '3.0';
231
+
232
+ wp_register_style( $tag, $location, false, $version, 'all' );
233
+
234
+ wp_enqueue_style( $tag );
235
+ }
236
+
237
+
238
+ add_action( 'wp_enqueue_scripts', 'bctt_scripts', 10 );
239
+
240
+ /**
241
+ * Check if default stylesheet must not be enqueued
242
+ *
243
+ * @return bool
244
+ */
245
+ function bctt_is_default_styles_dequeued() {
246
+ return (bool) get_option( 'bctt_disable_css' );
247
+ }
248
+
249
+
250
+ /**
251
+ * Check if there's a custo stylesheet that will be enqueued
252
+ */
253
+ function bctt_is_custom_stylesheet() {
254
+ return file_exists( bctt_get_custom_styles_path() );
255
+ }
256
+
257
+ /**
258
+ * Return the BCTT stylesheet URL
259
+ *
260
+ * Return custom styles URL if the file exists or the default one otherwise
261
+ *
262
+ * @return string
263
+ */
264
+ function bctt_get_stylesheet_url() {
265
+ return bctt_is_custom_stylesheet() ? bctt_get_custom_styles_url() : bctt_get_styles_url();
266
+ }
267
+
268
+
269
+ /**
270
+ * Return the custom stylesheet path
271
+ *
272
+ * @return string
273
+ */
274
+ function bctt_get_custom_styles_path() {
275
+ $dir = wp_upload_dir();
276
+ return $dir['basedir'] . '/bcttstyle.css';
277
+ }
278
+
279
+ /**
280
+ * Return the custom stylesheet URL
281
+ *
282
+ * @return string
283
+ */
284
+ function bctt_get_custom_styles_url() {
285
+ $dir = wp_upload_dir();
286
+ return $dir['baseurl'] . '/bcttstyle.css';
287
+ }
288
+
289
+ /**
290
+ * Return the default stylesheet path
291
+ *
292
+ * @return string
293
+ */
294
+ function bctt_get_styles_url() {
295
+ return plugins_url( 'assets/css/styles.css', __FILE__ );
296
+ }
297
+
298
+ /*
299
+ * Delete options and shortcode on uninstall
300
+ *
301
+ * @since 0.1
302
+ */
303
+
304
+ function bctt_on_uninstall() {
305
+
306
+ delete_option( 'bctt-twitter-handle' );
307
+
308
+ delete_option( 'bctt-short-url' );
309
+
310
+ delete_option( 'bctt_disable_css' );
311
+
312
+ delete_option( 'bctt_style_enqueued' );
313
+
314
+ remove_shortcode( 'bctt' );
315
+
316
+ delete_metadata( 'user', 0, 'bctt_has_dismissed_nag', '', true );
317
+
318
+
319
+ }
320
+
321
+
322
+
323
+ register_uninstall_hook( __FILE__, 'bctt_on_uninstall' );
324
+
325
+ function bctt_options_link( $links ) {
326
+
327
+ $settingsText = sprintf( _x( 'Settings', 'text for the link on the plugins page', 'better-click-to-tweet' ) );
328
+
329
+ $settings_link = '<a href="admin.php?page=better-click-to-tweet">' . esc_html( $settingsText ) . '</a>';
330
+
331
+ array_unshift( $links, $settings_link );
332
+
333
+ return $links;
334
+
335
+ }
336
+
337
+ $bcttlink = plugin_basename( __FILE__ );
338
+ add_filter( "plugin_action_links_$bcttlink", 'bctt_options_link' );
339
+
340
+ /**
341
+ * Register Block
342
+ */
343
+ add_action( 'plugins_loaded', function () {
344
+ if ( function_exists( 'register_block_type' ) ) {
345
+ require_once( plugin_dir_path( __FILE__ ) . 'assets/block/init.php' );
346
+ }
347
+ } );
trunk/i18n-module.php ADDED
@@ -0,0 +1,280 @@
1
+ <?php
2
+
3
+ /**
4
+ * This class defines a promo box and checks your translation site's API for stats about it, then shows them to the user.
5
+ */
6
+ class bctt_i18n {
7
+
8
+ /**
9
+ * Your translation site's logo
10
+ *
11
+ * @var string
12
+ */
13
+ private $glotpress_logo;
14
+
15
+ /**
16
+ * Your translation site's name
17
+ *
18
+ * @var string
19
+ */
20
+ private $glotpress_name;
21
+
22
+ /**
23
+ * Your translation site's URL
24
+ *
25
+ * @var string
26
+ */
27
+ private $glotpress_url;
28
+
29
+ /**
30
+ * Hook where you want to show the promo box
31
+ *
32
+ * @var string
33
+ */
34
+ private $hook;
35
+
36
+ /**
37
+ * Will contain the site's locale
38
+ *
39
+ * @access private
40
+ * @var string
41
+ */
42
+ private $locale;
43
+
44
+ /**
45
+ * Will contain the locale's name, obtained from yoru translation site
46
+ *
47
+ * @access private
48
+ * @var string
49
+ */
50
+ private $locale_name;
51
+
52
+ /**
53
+ * Will contain the percentage translated for the plugin translation project in the locale
54
+ *
55
+ * @access private
56
+ * @var int
57
+ */
58
+ private $percent_translated;
59
+
60
+ /**
61
+ * Name of your plugin
62
+ *
63
+ * @var string
64
+ */
65
+ private $plugin_name;
66
+
67
+ /**
68
+ * Project slug for the project on your translation site
69
+ *
70
+ * @var string
71
+ */
72
+ private $project_slug;
73
+
74
+ /**
75
+ * URL to point to for registration links
76
+ *
77
+ * @var string
78
+ */
79
+ private $register_url;
80
+
81
+ /**
82
+ * Your plugins textdomain
83
+ *
84
+ * @var string
85
+ */
86
+ private $textdomain;
87
+
88
+ /**
89
+ * Indicates whether there's a translation available at all.
90
+ *
91
+ * @access private
92
+ * @var bool
93
+ */
94
+ private $translation_exists;
95
+
96
+ /**
97
+ * Indicates whether the translation's loaded.
98
+ *
99
+ * @access private
100
+ * @var bool
101
+ */
102
+ private $translation_loaded;
103
+
104
+ /**
105
+ * Class constructor
106
+ *
107
+ * @param array $args Contains the settings for the class.
108
+ */
109
+ public function __construct( $args ) {
110
+ if ( ! is_admin() ) {
111
+ return;
112
+ }
113
+
114
+ $this->locale = get_locale();
115
+ if ( 'en_US' === $this->locale ) {
116
+ return;
117
+ }
118
+
119
+ $this->init( $args );
120
+
121
+ if ( ! $this->hide_promo() ) {
122
+ add_action( $this->hook, array( $this, 'promo' ) );
123
+ }
124
+ }
125
+
126
+ /**
127
+ * This is where you decide where to display the messages and where you set the plugin specific variables.
128
+ *
129
+ * @access private
130
+ *
131
+ * @param array $args
132
+ */
133
+ private function init( $args ) {
134
+ foreach ( $args as $key => $arg ) {
135
+ $this->$key = $arg;
136
+ }
137
+ }
138
+
139
+ /**
140
+ * Check whether the promo should be hidden or not
141
+ *
142
+ * @access private
143
+ *
144
+ * @return bool
145
+ */
146
+ private function hide_promo() {
147
+ $hide_promo = get_transient( 'yoast_i18n_' . $this->project_slug . '_promo_hide' );
148
+ if ( ! $hide_promo ) {
149
+ if ( filter_input( INPUT_GET, 'remove_i18n_promo', FILTER_VALIDATE_INT ) === 1 ) {
150
+ // No expiration time, so this would normally not expire, but it wouldn't be copied to other sites etc.
151
+ set_transient( 'yoast_i18n_' . $this->project_slug . '_promo_hide', true );
152
+ $hide_promo = true;
153
+ }
154
+ }
155
+
156
+ return $hide_promo;
157
+ }
158
+
159
+ /**
160
+ * Generates a promo message
161
+ *
162
+ * @access private
163
+ *
164
+ * @return bool|string $message
165
+ */
166
+ private function promo_message() {
167
+ $message = false;
168
+
169
+ if ( $this->translation_exists && $this->translation_loaded && $this->percent_translated < 90 ) {
170
+ $message = __( 'As you can see, there is a translation of this plugin in %1$s. This translation is currently %3$d%% complete. We need your help to make it complete and to fix any errors. Please register at %4$s to help complete the translation to %1$s!', 'better-click-to-tweet' );
171
+ } else if ( ! $this->translation_loaded && $this->translation_exists ) {
172
+ $message = __( 'You\'re using WordPress in %1$s. While %2$s has been translated to %1$s for %3$d%%, it\'s not been shipped with the plugin yet. You can help! Register at %4$s to help complete the translation to %1$s!', 'better-click-to-tweet' );
173
+ } else if ( ! $this->translation_exists ) {
174
+ $message = __( 'You\'re using WordPress in a language we don\'t support yet. We\'d love for %2$s to be translated in that language too, but unfortunately, it isn\'t right now. You can change that! Register at %4$s to help translate it!', 'better-click-to-tweet' );
175
+ }
176
+
177
+ $registration_link = sprintf( '<a href="https://translate.wordpress.org/projects/wp-plugins/better-click-to-tweet/">%1$s</a>', esc_html( $this->glotpress_name ) );
178
+ $message = sprintf( $message, esc_html( $this->locale_name ), esc_html( $this->plugin_name ), $this->percent_translated, $registration_link );
179
+
180
+ return $message;
181
+ }
182
+
183
+ /**
184
+ * Outputs a promo box
185
+ */
186
+ public function promo() {
187
+ $this->translation_details();
188
+
189
+ $message = $this->promo_message();
190
+
191
+ if ( $message ) {
192
+ echo '<div id="i18n_promo_box" style="border:1px solid #ccc;background-color:#fff;padding:1em 2em;max-width:100%;min-height:220px;">';
193
+ echo '<a href="' . esc_url( add_query_arg( array( 'remove_i18n_promo' => '1' ) ) ) . '" style="color:#333;text-decoration:none;font-weight:bold;font-size:16px;border:1px solid #ccc;padding:1px 4px;" class="alignright">X</a>';
194
+ if ( isset( $this->glotpress_logo ) && '' != $this->glotpress_logo ) {
195
+ echo '<a href="https://translate.wordpress.org/projects/wp-plugins/better-click-to-tweet/"><img style="float: right;margin: 15px 5px 5px 5px;padding: 0 1em;width: 200px;" src="' . esc_url( $this->glotpress_logo ) . '" alt="' . esc_attr( $this->glotpress_name ) . '"/></a>';
196
+ }
197
+ echo '<h2>' . sprintf( __( 'Translation of %s', 'better-click-to-tweet' ), esc_html( $this->plugin_name ) ) . '</h2>';
198
+
199
+ echo '<p>' . esc_html( $message ) . '</p>';
200
+ echo '<p><a href="https://translate.wordpress.org/projects/wp-plugins/better-click-to-tweet/">' . __( 'Register now &raquo;', 'better-click-to-tweet' ) . '</a></p>';
201
+ echo '</div>';
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Try to find the transient for the translation set or retrieve them.
207
+ *
208
+ * @access private
209
+ *
210
+ * @return object|null
211
+ */
212
+ private function find_or_initialize_translation_details() {
213
+ $set = get_transient( 'yoast_i18n_' . $this->project_slug . '_' . $this->locale );
214
+
215
+ if ( ! $set ) {
216
+ $set = $this->retrieve_translation_details();
217
+ set_transient( 'yoast_i18n_' . $this->project_slug . '_' . $this->locale, $set, DAY_IN_SECONDS );
218
+ }
219
+
220
+ return $set;
221
+ }
222
+
223
+ /**
224
+ * Try to get translation details from cache, otherwise retrieve them, then parse them.
225
+ *
226
+ * @access private
227
+ */
228
+ private function translation_details() {
229
+ $set = $this->find_or_initialize_translation_details();
230
+
231
+ $this->translation_exists = ! is_null( $set );
232
+ $this->translation_loaded = is_textdomain_loaded( 'better-click-to-tweet' );
233
+
234
+ $this->parse_translation_set( $set );
235
+ }
236
+
237
+ /**
238
+ * Retrieve the translation details from Yoast Translate
239
+ *
240
+ * @access private
241
+ *
242
+ * @return object|null
243
+ */
244
+ private function retrieve_translation_details() {
245
+ $api_url = trailingslashit( $this->glotpress_url ) . 'api/projects/' . $this->project_slug;
246
+
247
+ $resp = wp_remote_get( $api_url );
248
+ $body = wp_remote_retrieve_body( $resp );
249
+ unset( $resp );
250
+
251
+ if ( $body ) {
252
+ $body = json_decode( $body );
253
+ foreach ( $body->translation_sets as $set ) {
254
+ if ( $this->locale == $set->wp_locale ) {
255
+ return $set;
256
+ }
257
+ }
258
+ }
259
+
260
+ return null;
261
+ }
262
+
263
+ /**
264
+ * Set the needed private variables based on the results from Yoast Translate
265
+ *
266
+ * @param object $set The translation set
267
+ *
268
+ * @access private
269
+ */
270
+ private function parse_translation_set( $set ) {
271
+ if ( $this->translation_exists && is_object( $set ) ) {
272
+ $this->locale_name = $set->name;
273
+ $this->percent_translated = $set->percent_translated;
274
+ } else {
275
+ $this->locale_name = '';
276
+ $this->percent_translated = '';
277
+ }
278
+ }
279
+
280
+ }
trunk/languages/better-click-to-tweet-de_DE.mo ADDED
Binary file
trunk/languages/better-click-to-tweet-de_DE.po ADDED
@@ -0,0 +1,199 @@
1
+ # Copyright (C) 2015 Better Click To Tweet
2
+ # This file is distributed under the same license as the Better Click To Tweet package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Better Click To Tweet 4.0\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/better-click-to-"
7
+ "tweet\n"
8
+ "POT-Creation-Date: 2015-07-05 08:56+0200\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2015-07-05 09:46+0200\n"
13
+ "Last-Translator: Christian Zumbrunnen <chzumbrunnen@gmx.ch>\n"
14
+ "Language-Team: \n"
15
+ "X-Generator: Poedit 1.8.2\n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "Language: de_DE\n"
18
+
19
+ #: bctt_options.php:40
20
+ msgid "You do not have sufficient permissions to access this page."
21
+ msgstr ""
22
+ "Du hast nicht die erforderlichen Rechte, um auf diese Seite zuzugreifen."
23
+
24
+ #. translators: Treat "Better Click To Tweet" as a brand name, don't translate
25
+ #. it
26
+ #: bctt_options.php:45
27
+ msgid "Better Click To Tweet — a plugin by Ben Meredith"
28
+ msgstr "Better Click To Tweet — ein Plugin von Ben Meredith"
29
+
30
+ #: bctt_options.php:53
31
+ msgid "About the Author"
32
+ msgstr "Über den Autor"
33
+
34
+ #: bctt_options.php:57
35
+ msgid ""
36
+ "This plugin is developed by <a href=\"%s\">Ben Meredith</a>. I am a "
37
+ "freelance developer specializing in <a href=\"%s\">outrunning and "
38
+ "outsmarting hackers</a>."
39
+ msgstr ""
40
+ "Dieses Plugin wurde vony <a href=\"%s\">Ben Meredith</a> entwickelt. Ich bin "
41
+ "ein Freelance Entwickler welcher sich darauf spezialisisert hat <a href=\"%s"
42
+ "\">Hacker zu übertreffen und überlisten</a>."
43
+
44
+ #: bctt_options.php:58
45
+ msgid "Sign up to receive my FREE web strategy guide"
46
+ msgstr "Melde dich an um meinen kostenlosen Web Strategie Führer zu erhalten"
47
+
48
+ #: bctt_options.php:59
49
+ msgctxt "placeholder text for input field"
50
+ msgid "Your Email Address"
51
+ msgstr "Deine E-Mail Adresse"
52
+
53
+ #: bctt_options.php:60
54
+ msgid "No Spam. One-click unsubscribe in every message"
55
+ msgstr "Kein Spam. Ein-Klick Abmeldung in jedem E-Mail."
56
+
57
+ #: bctt_options.php:74
58
+ msgid ""
59
+ "Are you a developer? I would love your help making this plugin better. Check "
60
+ "out the <a href=%s>plugin on Github.</a>"
61
+ msgstr ""
62
+ "Bist du ein Entwickler? Ich schätze deine Unterstützung beim Verbessern "
63
+ "dieses Plugins. Beachte dieses <a href=%s>Plugin auf Github.</a>"
64
+
65
+ #: bctt_options.php:75
66
+ msgid ""
67
+ "The best way you can support this and other plugins is to <a href=%s>donate</"
68
+ "a>"
69
+ msgstr ""
70
+ "Die beste Möglichkeit dieses und andere Plugins zu unterstützen, ist es zu "
71
+ "<a href=%s>spenden</a>"
72
+
73
+ #: bctt_options.php:75
74
+ msgid "The second best way is to <a href=%s>leave an honest review.</a>"
75
+ msgstr ""
76
+ "Die zweitbeste Möglichkeit ist es <a href=%s>eine ehrliche Bewertung zu "
77
+ "hinterlassen.</a>"
78
+
79
+ #: bctt_options.php:76
80
+ msgid "Did this plugin save you enough time to be worth some money?"
81
+ msgstr ""
82
+ "Hat dir dieses Plugin genug Zeitersparnis gebracht, dass du dafür etwas "
83
+ "zahlen möchtest?"
84
+
85
+ #: bctt_options.php:77
86
+ msgid "Click here to buy me a Coke to say thanks."
87
+ msgstr "Klicke hier um mir eine Cola zu kaufen um Danke zu sagen."
88
+
89
+ #: bctt_options.php:87
90
+ msgid "Instructions"
91
+ msgstr "Anleitung"
92
+
93
+ #. translators: Treat "Better Click To Tweet" as a brand name, don't translate
94
+ #. it
95
+ #: bctt_options.php:88
96
+ msgid ""
97
+ "To add styled click-to-tweet quote boxes include the Better Click To Tweet "
98
+ "shortcode in your post."
99
+ msgstr ""
100
+ "Um gestylte Klick-To-Tweet Boxen zu verwenden, nutze den Better Click To "
101
+ "Tweet Kurzcode in deinem Beitrag."
102
+
103
+ #: bctt_options.php:89
104
+ msgid "Here's how you format the shortcode:"
105
+ msgstr "So kannst du den Kurzcode nutzen:"
106
+
107
+ #. translators: This text shows up as a sample tweet in the instructions for
108
+ #. how to use the plugin.
109
+ #: bctt_options.php:89
110
+ msgid "Meaningful, tweetable quote."
111
+ msgstr "Bedeutungsvolles, tweetbares Zitat."
112
+
113
+ #. translators: Also, treat "BCTT" as a brand name, don't translate it
114
+ #: bctt_options.php:90
115
+ msgid ""
116
+ "If you are using the visual editor, click the BCTT birdie in the toolbar to "
117
+ "add a pre-formatted shortcode to your post."
118
+ msgstr ""
119
+ "Wenn du den Visuellen Editor nutzt, klicke auf das BCTT-Vögelchen in der "
120
+ "Werkzeugleiste um einen vorformatierten Kurzcode einzufügen."
121
+
122
+ #: bctt_options.php:91
123
+ msgid ""
124
+ "Tweet length is automatically shortened to 117 characters minus the length "
125
+ "of your twitter name, to leave room for it and a link back to the post."
126
+ msgstr ""
127
+ "Die Länge des Tweets wird automatisch auf 117 Zeichen minus der Länge deines "
128
+ "Twitter Namen gekürzt um Platz für den Text inklusive Link zum Beitrag zu "
129
+ "haben."
130
+
131
+ #: bctt_options.php:96
132
+ msgid "Settings"
133
+ msgstr "Einstellungen"
134
+
135
+ #: bctt_options.php:97
136
+ msgid ""
137
+ "Enter your Twitter handle to add \"via @yourhandle\" to your tweets. Do not "
138
+ "include the @ symbol."
139
+ msgstr ""
140
+ "Gib deinen Twitter Namen ein um deinen Tweets ein “via @Twittername” "
141
+ "anzufügen. (Ohne @ Symbol)."
142
+
143
+ #: bctt_options.php:98
144
+ msgid ""
145
+ "Checking the box below will force the plugin to show the WordPress shortlink "
146
+ "in place of the full URL. While this does not impact tweet character length, "
147
+ "it is useful alongside plugins which customize the WordPress shortlink using "
148
+ "services like bit.ly or yourls.org for tracking"
149
+ msgstr ""
150
+ "Ankreuzen der Checkbox bewirkt, dass anstelle der vollen URL der WordPress "
151
+ "Kurzlink angezeigt wird. Dies hat keine Auswirkung auf die Tweetlänge ist "
152
+ "aber nützlich im Zusammenspiel mit Diensten, wie bit.ly oder yourls.org "
153
+ "welche den Kurzlink zum Tracken verwenden."
154
+
155
+ #: bctt_options.php:104
156
+ msgctxt "label for text input on settings screen"
157
+ msgid "Your Twitter Handle"
158
+ msgstr "Dein Twitter Name"
159
+
160
+ #: bctt_options.php:107
161
+ msgctxt "label for checkbox on settings screen"
162
+ msgid "Use Short URL?"
163
+ msgstr "Kurzlink verwenden?"
164
+
165
+ #: bctt_options.php:112
166
+ msgid "Save Changes"
167
+ msgstr "Änderungen speichern"
168
+
169
+ #: bctt_options.php:114
170
+ msgid "An open source plugin by <a href=%s>Ben Meredith</a>"
171
+ msgstr "Ein Open Source Plugin von <a href=%s>Ben Meredith</a>"
172
+
173
+ #: better-click-to-tweet.php:138
174
+ msgctxt "Text for the box on the reader-facing box"
175
+ msgid "Click To Tweet"
176
+ msgstr "Klick um zu Tweeten"
177
+
178
+ #: better-click-to-tweet.php:209
179
+ msgctxt "text for the link on the plugins page"
180
+ msgid "Settings"
181
+ msgstr "Einstellungen"
182
+
183
+ #. Plugin Name of the plugin/theme
184
+ msgid "Better Click To Tweet"
185
+ msgstr "Better Click To Tweet"
186
+
187
+ #. Description of the plugin/theme
188
+ msgid ""
189
+ "The only Click To Tweet plugin to add translation support. The only Click To "
190
+ "Tweet plugin to take into account your Twitter username's length in "
191
+ "truncating long tweets, or to correctly take into account non-Roman "
192
+ "characters. Simply put, as Click To Tweet plugins go, this one is, well, "
193
+ "BETTER."
194
+ msgstr ""
195
+ "Das einzige Klick-um-zu-tweeten Plugin mit Unterstützung für Übersetzung. "
196
+ "Das einzige Klick-um-zu-tweeten Plugin welches die Länge deines Twitter "
197
+ "Namens beim Kürzen von langen Tweets berücksichtigt sowie nicht-lateinische "
198
+ "Zeichen korrekt behandelt. Einfach gesagt, was Klick-um-zu-tweeten Plugins "
199
+ "betrifft ist dieses - nun BESSER."
trunk/languages/better-click-to-tweet-el.mo ADDED
Binary file
trunk/languages/better-click-to-tweet-el.po ADDED
@@ -0,0 +1,230 @@