diff options
Diffstat (limited to 'plugins/jetpack/modules/sharedaddy')
16 files changed, 272 insertions, 176 deletions
diff --git a/plugins/jetpack/modules/sharedaddy/admin-sharing-rtl.css b/plugins/jetpack/modules/sharedaddy/admin-sharing-rtl.css index 4e486211..04d10acc 100644 --- a/plugins/jetpack/modules/sharedaddy/admin-sharing-rtl.css +++ b/plugins/jetpack/modules/sharedaddy/admin-sharing-rtl.css @@ -97,6 +97,17 @@ body.settings_page_sharing ul.services-hidden { box-shadow: 0 1px 3px rgba(0,0,0,0.2); } +#available-services .service.share-deprecated, +#enabled-services .service.share-deprecated { + opacity: 0.5; + padding: 5px; + text-decoration: line-through; +} + +#available-services .service.share-deprecated { + display: none; +} + /* Generic style icons */ li.service span:before { color: #555; @@ -138,9 +149,6 @@ li.service.share-pocket span:before { li.service.share-pinterest span:before { content: '\f209'; } -li.service.share-google-plus-1 span:before { - content: '\f218'; -} li.service.share-facebook span:before { content: '\f203'; } @@ -320,13 +328,6 @@ body.settings_page_sharing .advanced input[type=submit] { height:20px; } -.preview-google-plus-1 .option-smart-on { - background: url(images/smart-googleplus1.png) no-repeat top left; - background-size: 96px 20px; - width: 96px; - height: 20px; -} - .preview-tumblr .option-smart-on { background: url(images/smart-tumblr.png) no-repeat top left; background-size: 62px 20px; @@ -354,6 +355,15 @@ body.settings_page_sharing .advanced input[type=submit] { width: 60px; height: 20px; } + +.preview-item.share-deprecated { + opacity: 0.5; +} + +.preview-item.share-deprecated a span { + text-decoration: line-through; +} + @media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) { @@ -377,10 +387,6 @@ body.settings_page_sharing .advanced input[type=submit] { background-image: url(images/linkedin-smart@2x.png); } - .preview-google-plus-1 .option-smart-on { - background-image: url(images/smart-googleplus1@2x.png); - } - .preview-tumblr .option-smart-on { background-image: url(images/smart-tumblr@2x.png); } diff --git a/plugins/jetpack/modules/sharedaddy/admin-sharing-rtl.min.css b/plugins/jetpack/modules/sharedaddy/admin-sharing-rtl.min.css index 8b3ba1ce..db5c3771 100644 --- a/plugins/jetpack/modules/sharedaddy/admin-sharing-rtl.min.css +++ b/plugins/jetpack/modules/sharedaddy/admin-sharing-rtl.min.css @@ -1 +1 @@ -#services-config{min-width:700px;width:100%;float:right}#services-config h3{font-weight:400;font-size:15px;margin:0;padding:8px 10px;overflow:hidden;white-space:nowrap;color:#464646}#available-services,#enabled-services,#live-preview{padding:0;width:100%;padding-top:20px;border-spacing:0}#enabled-services .ui-sortable{min-height:50px}#enabled-services{padding-bottom:20px}#available-services,#enabled-services{border-bottom:2px solid #ccc}#live-preview{border-bottom:1px solid #dfdfdf;padding-bottom:60px}#available-services h3,#enabled-services h3,#live-preview h3{padding:0;margin-top:0;margin-bottom:1em}body.settings_page_sharing .description{width:180px;vertical-align:top}body.settings_page_sharing .description p{font-size:13px;font-style:italic}body.settings_page_sharing .services{padding:0 20px;vertical-align:top}body.settings_page_sharing .services ul li{float:right;cursor:move}body.settings_page_sharing .services ul li.divider{border:none;padding:0;background:0 0;cursor:default}body.settings_page_sharing ul.services-hidden{margin-bottom:0}#available-services .service,#enabled-services .service{margin-left:10px;padding:5px 5px 5px 10px;border-radius:3px;border:1px solid #bbb;background:#f8f8f8;background-repeat:no-repeat;background-position:center center}#available-services .service:hover,#enabled-services .service:hover{background:#fff;border:1px solid #bbb;box-shadow:0 1px 3px rgba(0,0,0,.2)}li.service span:before{color:#555;display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 social-logos;vertical-align:top;position:relative;top:1px;margin-left:3px;width:16px;height:16px;text-align:center}li.service.share-print span:before{content:'\f469'}li.service.share-digg span:before{content:'\f221'}li.service.share-email span:before{content:'\f410'}li.service.share-linkedin span:before{content:'\f207'}li.service.share-twitter span:before{content:'\f202'}li.service.share-reddit span:before{content:'\f222'}li.service.share-tumblr span:before{content:'\f214'}li.service.share-pocket span:before{content:'\f224'}li.service.share-pinterest span:before{content:'\f209'}li.service.share-google-plus-1 span:before{content:'\f218'}li.service.share-facebook span:before{content:'\f203'}li.service.share-press-this span:before{content:'\f205'}li.service.share-telegram span:before{content:'\f606'}li.service.share-jetpack-whatsapp span:before{content:'\f608'}li.service.share-skype span:before{content:'\f220'}body.settings_page_sharing ul.preview{float:right;margin:0}body.settings_page_sharing ul.preview li.preview-item,body.settings_page_sharing ul.preview li.preview-item a{cursor:default;text-decoration:none}div.sd-social-icon .inner li.preview-item a span,div.sd-social-icon ul.preview li.preview-item a span{display:none}div.sd-social-icon ul.preview li.preview-item.preview-custom a span{display:inline-block}.services .preview li.share-custom a{text-decoration:none}.services ul li.end-fix{clear:both;float:none;visibility:hidden;padding:0;margin:0;height:20px;width:0}#enabled-services h2{font-size:20px;padding-top:0;font-weight:400!important;color:#999}body.settings_page_sharing #live-preview h2{font-size:20px;font-weight:400!important;color:#e3e3e3}body.settings_page_sharing .clearing{clear:both}body.settings_page_sharing .options .options-left{float:right}body.settings_page_sharing .input label{font-size:11px;line-height:16px}body.settings_page_sharing .advanced-form{padding:10px 10px 8px 14px;margin-right:-24px;display:none;border-top:1px #e3e3e3 solid;margin-top:4px}body.settings_page_sharing .utility{float:left;padding-top:10px;padding-left:10px;font-size:10px}body.settings_page_sharing .advanced input[type=submit]{float:right;margin-top:10px;margin-left:10px}.services li.dropzone{border:1px dashed #999;border-radius:3px;background:#e3e3e3;margin-left:10px;padding:5px;height:18px}.advanced-form .form-table th{width:auto!important}.advanced-form .button-secondary{margin-top:0!important}#hidden-drop-target{background:#e1e1e1;border:1px solid #cdcdcd;width:29%;padding:10px;vertical-align:top}#hidden-drop-target p{font-size:13px;font-style:italic;margin:0 0 10px 0}.preview li.preview-item{background-position:0 5px;cursor:default}.preview .option-smart-on{margin:3px 0 0 5px}.preview-digg .option-smart-on{background:url(images/smart-digg.png) no-repeat top left;background-size:76px 17px;width:76px;height:17px;margin-top:2px}.preview-reddit .option-smart-on{background:url(images/smart-reddit.png) no-repeat top left;background-size:104px 21px;width:104px;height:21px}.preview-facebook .option-smart-on{background:url(images/smart-like.png) no-repeat top left;background-size:85px 20px;width:85px;height:20px}.preview-twitter .option-smart-on{background:url(images/smart-twitter.png?1) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-linkedin .option-smart-on{background:url(images/linkedin-smart.png) no-repeat top center;background-size:99px 18px;width:99px;height:20px}.preview-google-plus-1 .option-smart-on{background:url(images/smart-googleplus1.png) no-repeat top left;background-size:96px 20px;width:96px;height:20px}.preview-tumblr .option-smart-on{background:url(images/smart-tumblr.png) no-repeat top left;background-size:62px 20px;width:62px;height:20px}.preview-pinterest .option-smart-on{background:url(images/smart-pinterest.png) no-repeat top left;background-size:39px 20px;width:39px;height:20px}.preview-pocket .option-smart-on{background:url(images/smart-pocket.png) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-skype .option-smart-on{background:url(images/smart-skype.png) no-repeat top left;background-size:60px 20px;width:60px;height:20px}@media (-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.preview-digg .option-smart-on{background-image:url(images/smart-digg@2x.png)}.preview-reddit .option-smart-on{background-image:url(images/smart-reddit@2x.png)}.preview-facebook .option-smart-on{background-image:url(images/smart-like@2x.png)}.preview-twitter .option-smart-on{background-image:url(images/smart-twitter@2x.png?1)}.preview-linkedin .option-smart-on{background-image:url(images/linkedin-smart@2x.png)}.preview-google-plus-1 .option-smart-on{background-image:url(images/smart-googleplus1@2x.png)}.preview-tumblr .option-smart-on{background-image:url(images/smart-tumblr@2x.png)}.preview-pinterest .option-smart-on{background-image:url(images/smart-pinterest@2x.png)}.preview-pocket .option-smart-on{background-image:url(images/smart-pocket@2x.png)}.preview-skype .option-smart-on{background-image:url(images/smart-skype@2x.png)}}.services .sharing-hidden li{background-color:transparent}.sharing-hidden li.share-end{clear:both;height:0;padding:0!important;margin:0!important;width:0;visibility:hidden;float:none}.preview .sharing-label{font-weight:700;border:0;padding:4px 0 0 6px}#services-config a.remove{background:#ddd;color:#fff;padding:0 4px 2px;border-radius:15px;-moz-border-radius:15px;-webkit-border-radius:15px;text-decoration:none;font-weight:700;font-size:10px}#services-config a.remove:hover{background:red}.sd-social-icon .inner a.sd-button span,.sd-social-icon .inner a.share-icon span{display:inline-block;overflow:hidden;width:0;text-indent:100%}
\ No newline at end of file +#services-config{min-width:700px;width:100%;float:right}#services-config h3{font-weight:400;font-size:15px;margin:0;padding:8px 10px;overflow:hidden;white-space:nowrap;color:#464646}#available-services,#enabled-services,#live-preview{padding:0;width:100%;padding-top:20px;border-spacing:0}#enabled-services .ui-sortable{min-height:50px}#enabled-services{padding-bottom:20px}#available-services,#enabled-services{border-bottom:2px solid #ccc}#live-preview{border-bottom:1px solid #dfdfdf;padding-bottom:60px}#available-services h3,#enabled-services h3,#live-preview h3{padding:0;margin-top:0;margin-bottom:1em}body.settings_page_sharing .description{width:180px;vertical-align:top}body.settings_page_sharing .description p{font-size:13px;font-style:italic}body.settings_page_sharing .services{padding:0 20px;vertical-align:top}body.settings_page_sharing .services ul li{float:right;cursor:move}body.settings_page_sharing .services ul li.divider{border:none;padding:0;background:0 0;cursor:default}body.settings_page_sharing ul.services-hidden{margin-bottom:0}#available-services .service,#enabled-services .service{margin-left:10px;padding:5px 5px 5px 10px;border-radius:3px;border:1px solid #bbb;background:#f8f8f8;background-repeat:no-repeat;background-position:center center}#available-services .service:hover,#enabled-services .service:hover{background:#fff;border:1px solid #bbb;box-shadow:0 1px 3px rgba(0,0,0,.2)}#available-services .service.share-deprecated,#enabled-services .service.share-deprecated{opacity:.5;padding:5px;text-decoration:line-through}#available-services .service.share-deprecated{display:none}li.service span:before{color:#555;display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 social-logos;vertical-align:top;position:relative;top:1px;margin-left:3px;width:16px;height:16px;text-align:center}li.service.share-print span:before{content:'\f469'}li.service.share-digg span:before{content:'\f221'}li.service.share-email span:before{content:'\f410'}li.service.share-linkedin span:before{content:'\f207'}li.service.share-twitter span:before{content:'\f202'}li.service.share-reddit span:before{content:'\f222'}li.service.share-tumblr span:before{content:'\f214'}li.service.share-pocket span:before{content:'\f224'}li.service.share-pinterest span:before{content:'\f209'}li.service.share-facebook span:before{content:'\f203'}li.service.share-press-this span:before{content:'\f205'}li.service.share-telegram span:before{content:'\f606'}li.service.share-jetpack-whatsapp span:before{content:'\f608'}li.service.share-skype span:before{content:'\f220'}body.settings_page_sharing ul.preview{float:right;margin:0}body.settings_page_sharing ul.preview li.preview-item,body.settings_page_sharing ul.preview li.preview-item a{cursor:default;text-decoration:none}div.sd-social-icon .inner li.preview-item a span,div.sd-social-icon ul.preview li.preview-item a span{display:none}div.sd-social-icon ul.preview li.preview-item.preview-custom a span{display:inline-block}.services .preview li.share-custom a{text-decoration:none}.services ul li.end-fix{clear:both;float:none;visibility:hidden;padding:0;margin:0;height:20px;width:0}#enabled-services h2{font-size:20px;padding-top:0;font-weight:400!important;color:#999}body.settings_page_sharing #live-preview h2{font-size:20px;font-weight:400!important;color:#e3e3e3}body.settings_page_sharing .clearing{clear:both}body.settings_page_sharing .options .options-left{float:right}body.settings_page_sharing .input label{font-size:11px;line-height:16px}body.settings_page_sharing .advanced-form{padding:10px 10px 8px 14px;margin-right:-24px;display:none;border-top:1px #e3e3e3 solid;margin-top:4px}body.settings_page_sharing .utility{float:left;padding-top:10px;padding-left:10px;font-size:10px}body.settings_page_sharing .advanced input[type=submit]{float:right;margin-top:10px;margin-left:10px}.services li.dropzone{border:1px dashed #999;border-radius:3px;background:#e3e3e3;margin-left:10px;padding:5px;height:18px}.advanced-form .form-table th{width:auto!important}.advanced-form .button-secondary{margin-top:0!important}#hidden-drop-target{background:#e1e1e1;border:1px solid #cdcdcd;width:29%;padding:10px;vertical-align:top}#hidden-drop-target p{font-size:13px;font-style:italic;margin:0 0 10px 0}.preview li.preview-item{background-position:0 5px;cursor:default}.preview .option-smart-on{margin:3px 0 0 5px}.preview-digg .option-smart-on{background:url(images/smart-digg.png) no-repeat top left;background-size:76px 17px;width:76px;height:17px;margin-top:2px}.preview-reddit .option-smart-on{background:url(images/smart-reddit.png) no-repeat top left;background-size:104px 21px;width:104px;height:21px}.preview-facebook .option-smart-on{background:url(images/smart-like.png) no-repeat top left;background-size:85px 20px;width:85px;height:20px}.preview-twitter .option-smart-on{background:url(images/smart-twitter.png?1) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-linkedin .option-smart-on{background:url(images/linkedin-smart.png) no-repeat top center;background-size:99px 18px;width:99px;height:20px}.preview-tumblr .option-smart-on{background:url(images/smart-tumblr.png) no-repeat top left;background-size:62px 20px;width:62px;height:20px}.preview-pinterest .option-smart-on{background:url(images/smart-pinterest.png) no-repeat top left;background-size:39px 20px;width:39px;height:20px}.preview-pocket .option-smart-on{background:url(images/smart-pocket.png) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-skype .option-smart-on{background:url(images/smart-skype.png) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-item.share-deprecated{opacity:.5}.preview-item.share-deprecated a span{text-decoration:line-through}@media (-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.preview-digg .option-smart-on{background-image:url(images/smart-digg@2x.png)}.preview-reddit .option-smart-on{background-image:url(images/smart-reddit@2x.png)}.preview-facebook .option-smart-on{background-image:url(images/smart-like@2x.png)}.preview-twitter .option-smart-on{background-image:url(images/smart-twitter@2x.png?1)}.preview-linkedin .option-smart-on{background-image:url(images/linkedin-smart@2x.png)}.preview-tumblr .option-smart-on{background-image:url(images/smart-tumblr@2x.png)}.preview-pinterest .option-smart-on{background-image:url(images/smart-pinterest@2x.png)}.preview-pocket .option-smart-on{background-image:url(images/smart-pocket@2x.png)}.preview-skype .option-smart-on{background-image:url(images/smart-skype@2x.png)}}.services .sharing-hidden li{background-color:transparent}.sharing-hidden li.share-end{clear:both;height:0;padding:0!important;margin:0!important;width:0;visibility:hidden;float:none}.preview .sharing-label{font-weight:700;border:0;padding:4px 0 0 6px}#services-config a.remove{background:#ddd;color:#fff;padding:0 4px 2px;border-radius:15px;-moz-border-radius:15px;-webkit-border-radius:15px;text-decoration:none;font-weight:700;font-size:10px}#services-config a.remove:hover{background:red}.sd-social-icon .inner a.sd-button span,.sd-social-icon .inner a.share-icon span{display:inline-block;overflow:hidden;width:0;text-indent:100%}
\ No newline at end of file diff --git a/plugins/jetpack/modules/sharedaddy/admin-sharing.css b/plugins/jetpack/modules/sharedaddy/admin-sharing.css index 3702d08c..f7093186 100644 --- a/plugins/jetpack/modules/sharedaddy/admin-sharing.css +++ b/plugins/jetpack/modules/sharedaddy/admin-sharing.css @@ -96,6 +96,17 @@ body.settings_page_sharing ul.services-hidden { box-shadow: 0 1px 3px rgba(0,0,0,0.2); } +#available-services .service.share-deprecated, +#enabled-services .service.share-deprecated { + opacity: 0.5; + padding: 5px; + text-decoration: line-through; +} + +#available-services .service.share-deprecated { + display: none; +} + /* Generic style icons */ li.service span:before { color: #555; @@ -137,9 +148,6 @@ li.service.share-pocket span:before { li.service.share-pinterest span:before { content: '\f209'; } -li.service.share-google-plus-1 span:before { - content: '\f218'; -} li.service.share-facebook span:before { content: '\f203'; } @@ -319,13 +327,6 @@ body.settings_page_sharing .advanced input[type=submit] { height:20px; } -.preview-google-plus-1 .option-smart-on { - background: url(images/smart-googleplus1.png) no-repeat top left; - background-size: 96px 20px; - width: 96px; - height: 20px; -} - .preview-tumblr .option-smart-on { background: url(images/smart-tumblr.png) no-repeat top left; background-size: 62px 20px; @@ -353,6 +354,15 @@ body.settings_page_sharing .advanced input[type=submit] { width: 60px; height: 20px; } + +.preview-item.share-deprecated { + opacity: 0.5; +} + +.preview-item.share-deprecated a span { + text-decoration: line-through; +} + @media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) { @@ -376,10 +386,6 @@ body.settings_page_sharing .advanced input[type=submit] { background-image: url(images/linkedin-smart@2x.png); } - .preview-google-plus-1 .option-smart-on { - background-image: url(images/smart-googleplus1@2x.png); - } - .preview-tumblr .option-smart-on { background-image: url(images/smart-tumblr@2x.png); } diff --git a/plugins/jetpack/modules/sharedaddy/admin-sharing.js b/plugins/jetpack/modules/sharedaddy/admin-sharing.js index f546c7fb..04a65f5a 100644 --- a/plugins/jetpack/modules/sharedaddy/admin-sharing.js +++ b/plugins/jetpack/modules/sharedaddy/admin-sharing.js @@ -128,7 +128,8 @@ !$( this ).hasClass( 'preview-print' ) && !$( this ).hasClass( 'preview-telegram' ) && !$( this ).hasClass( 'preview-jetpack-whatsapp' ) && - !$( this ).hasClass( 'share-custom' ) ) { + !$( this ).hasClass( 'share-custom' ) && + !$( this ).hasClass( 'share-deprecated' ) ) { $( this ).find( '.option a span' ).html( '' ).parent().removeClass( 'sd-button' ).parent().attr( 'class', 'option option-smart-on' ); } } ); diff --git a/plugins/jetpack/modules/sharedaddy/admin-sharing.min.css b/plugins/jetpack/modules/sharedaddy/admin-sharing.min.css index 649f3cf9..e572752d 100644 --- a/plugins/jetpack/modules/sharedaddy/admin-sharing.min.css +++ b/plugins/jetpack/modules/sharedaddy/admin-sharing.min.css @@ -1,2 +1,2 @@ /* Do not modify this file directly. It is concatenated from individual module CSS files. */ -#services-config{min-width:700px;width:100%;float:left}#services-config h3{font-weight:400;font-size:15px;margin:0;padding:8px 10px;overflow:hidden;white-space:nowrap;color:#464646}#available-services,#enabled-services,#live-preview{padding:0;width:100%;padding-top:20px;border-spacing:0}#enabled-services .ui-sortable{min-height:50px}#enabled-services{padding-bottom:20px}#available-services,#enabled-services{border-bottom:2px solid #ccc}#live-preview{border-bottom:1px solid #dfdfdf;padding-bottom:60px}#available-services h3,#enabled-services h3,#live-preview h3{padding:0;margin-top:0;margin-bottom:1em}body.settings_page_sharing .description{width:180px;vertical-align:top}body.settings_page_sharing .description p{font-size:13px;font-style:italic}body.settings_page_sharing .services{padding:0 20px;vertical-align:top}body.settings_page_sharing .services ul li{float:left;cursor:move}body.settings_page_sharing .services ul li.divider{border:none;padding:0;background:0 0;cursor:default}body.settings_page_sharing ul.services-hidden{margin-bottom:0}#available-services .service,#enabled-services .service{margin-right:10px;padding:5px 10px 5px 5px;border-radius:3px;border:1px solid #bbb;background:#f8f8f8;background-repeat:no-repeat;background-position:center center}#available-services .service:hover,#enabled-services .service:hover{background:#fff;border:1px solid #bbb;box-shadow:0 1px 3px rgba(0,0,0,.2)}li.service span:before{color:#555;display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 social-logos;vertical-align:top;position:relative;top:1px;margin-right:3px;width:16px;height:16px;text-align:center}li.service.share-print span:before{content:'\f469'}li.service.share-digg span:before{content:'\f221'}li.service.share-email span:before{content:'\f410'}li.service.share-linkedin span:before{content:'\f207'}li.service.share-twitter span:before{content:'\f202'}li.service.share-reddit span:before{content:'\f222'}li.service.share-tumblr span:before{content:'\f214'}li.service.share-pocket span:before{content:'\f224'}li.service.share-pinterest span:before{content:'\f209'}li.service.share-google-plus-1 span:before{content:'\f218'}li.service.share-facebook span:before{content:'\f203'}li.service.share-press-this span:before{content:'\f205'}li.service.share-telegram span:before{content:'\f606'}li.service.share-jetpack-whatsapp span:before{content:'\f608'}li.service.share-skype span:before{content:'\f220'}body.settings_page_sharing ul.preview{float:left;margin:0}body.settings_page_sharing ul.preview li.preview-item,body.settings_page_sharing ul.preview li.preview-item a{cursor:default;text-decoration:none}div.sd-social-icon .inner li.preview-item a span,div.sd-social-icon ul.preview li.preview-item a span{display:none}div.sd-social-icon ul.preview li.preview-item.preview-custom a span{display:inline-block}.services .preview li.share-custom a{text-decoration:none}.services ul li.end-fix{clear:both;float:none;visibility:hidden;padding:0;margin:0;height:20px;width:0}#enabled-services h2{font-size:20px;padding-top:0;font-weight:400!important;color:#999}body.settings_page_sharing #live-preview h2{font-size:20px;font-weight:400!important;color:#e3e3e3}body.settings_page_sharing .clearing{clear:both}body.settings_page_sharing .options .options-left{float:left}body.settings_page_sharing .input label{font-size:11px;line-height:16px}body.settings_page_sharing .advanced-form{padding:10px 14px 8px 10px;margin-left:-24px;display:none;border-top:1px #e3e3e3 solid;margin-top:4px}body.settings_page_sharing .utility{float:right;padding-top:10px;padding-right:10px;font-size:10px}body.settings_page_sharing .advanced input[type=submit]{float:left;margin-top:10px;margin-right:10px}.services li.dropzone{border:1px dashed #999;border-radius:3px;background:#e3e3e3;margin-right:10px;padding:5px;height:18px}.advanced-form .form-table th{width:auto!important}.advanced-form .button-secondary{margin-top:0!important}#hidden-drop-target{background:#e1e1e1;border:1px solid #cdcdcd;width:29%;padding:10px;vertical-align:top}#hidden-drop-target p{font-size:13px;font-style:italic;margin:0 0 10px 0}.preview li.preview-item{background-position:0 5px;cursor:default}.preview .option-smart-on{margin:3px 5px 0 0}.preview-digg .option-smart-on{background:url(images/smart-digg.png) no-repeat top left;background-size:76px 17px;width:76px;height:17px;margin-top:2px}.preview-reddit .option-smart-on{background:url(images/smart-reddit.png) no-repeat top left;background-size:104px 21px;width:104px;height:21px}.preview-facebook .option-smart-on{background:url(images/smart-like.png) no-repeat top left;background-size:85px 20px;width:85px;height:20px}.preview-twitter .option-smart-on{background:url(images/smart-twitter.png?1) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-linkedin .option-smart-on{background:url(images/linkedin-smart.png) no-repeat top center;background-size:99px 18px;width:99px;height:20px}.preview-google-plus-1 .option-smart-on{background:url(images/smart-googleplus1.png) no-repeat top left;background-size:96px 20px;width:96px;height:20px}.preview-tumblr .option-smart-on{background:url(images/smart-tumblr.png) no-repeat top left;background-size:62px 20px;width:62px;height:20px}.preview-pinterest .option-smart-on{background:url(images/smart-pinterest.png) no-repeat top left;background-size:39px 20px;width:39px;height:20px}.preview-pocket .option-smart-on{background:url(images/smart-pocket.png) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-skype .option-smart-on{background:url(images/smart-skype.png) no-repeat top left;background-size:60px 20px;width:60px;height:20px}@media (-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.preview-digg .option-smart-on{background-image:url(images/smart-digg@2x.png)}.preview-reddit .option-smart-on{background-image:url(images/smart-reddit@2x.png)}.preview-facebook .option-smart-on{background-image:url(images/smart-like@2x.png)}.preview-twitter .option-smart-on{background-image:url(images/smart-twitter@2x.png?1)}.preview-linkedin .option-smart-on{background-image:url(images/linkedin-smart@2x.png)}.preview-google-plus-1 .option-smart-on{background-image:url(images/smart-googleplus1@2x.png)}.preview-tumblr .option-smart-on{background-image:url(images/smart-tumblr@2x.png)}.preview-pinterest .option-smart-on{background-image:url(images/smart-pinterest@2x.png)}.preview-pocket .option-smart-on{background-image:url(images/smart-pocket@2x.png)}.preview-skype .option-smart-on{background-image:url(images/smart-skype@2x.png)}}.services .sharing-hidden li{background-color:transparent}.sharing-hidden li.share-end{clear:both;height:0;padding:0!important;margin:0!important;width:0;visibility:hidden;float:none}.preview .sharing-label{font-weight:700;border:0;padding:4px 6px 0 0}#services-config a.remove{background:#ddd;color:#fff;padding:0 4px 2px;border-radius:15px;-moz-border-radius:15px;-webkit-border-radius:15px;text-decoration:none;font-weight:700;font-size:10px}#services-config a.remove:hover{background:red}.sd-social-icon .inner a.sd-button span,.sd-social-icon .inner a.share-icon span{display:inline-block;overflow:hidden;width:0;text-indent:100%}
\ No newline at end of file +#services-config{min-width:700px;width:100%;float:left}#services-config h3{font-weight:400;font-size:15px;margin:0;padding:8px 10px;overflow:hidden;white-space:nowrap;color:#464646}#available-services,#enabled-services,#live-preview{padding:0;width:100%;padding-top:20px;border-spacing:0}#enabled-services .ui-sortable{min-height:50px}#enabled-services{padding-bottom:20px}#available-services,#enabled-services{border-bottom:2px solid #ccc}#live-preview{border-bottom:1px solid #dfdfdf;padding-bottom:60px}#available-services h3,#enabled-services h3,#live-preview h3{padding:0;margin-top:0;margin-bottom:1em}body.settings_page_sharing .description{width:180px;vertical-align:top}body.settings_page_sharing .description p{font-size:13px;font-style:italic}body.settings_page_sharing .services{padding:0 20px;vertical-align:top}body.settings_page_sharing .services ul li{float:left;cursor:move}body.settings_page_sharing .services ul li.divider{border:none;padding:0;background:0 0;cursor:default}body.settings_page_sharing ul.services-hidden{margin-bottom:0}#available-services .service,#enabled-services .service{margin-right:10px;padding:5px 10px 5px 5px;border-radius:3px;border:1px solid #bbb;background:#f8f8f8;background-repeat:no-repeat;background-position:center center}#available-services .service:hover,#enabled-services .service:hover{background:#fff;border:1px solid #bbb;box-shadow:0 1px 3px rgba(0,0,0,.2)}#available-services .service.share-deprecated,#enabled-services .service.share-deprecated{opacity:.5;padding:5px;text-decoration:line-through}#available-services .service.share-deprecated{display:none}li.service span:before{color:#555;display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 social-logos;vertical-align:top;position:relative;top:1px;margin-right:3px;width:16px;height:16px;text-align:center}li.service.share-print span:before{content:'\f469'}li.service.share-digg span:before{content:'\f221'}li.service.share-email span:before{content:'\f410'}li.service.share-linkedin span:before{content:'\f207'}li.service.share-twitter span:before{content:'\f202'}li.service.share-reddit span:before{content:'\f222'}li.service.share-tumblr span:before{content:'\f214'}li.service.share-pocket span:before{content:'\f224'}li.service.share-pinterest span:before{content:'\f209'}li.service.share-facebook span:before{content:'\f203'}li.service.share-press-this span:before{content:'\f205'}li.service.share-telegram span:before{content:'\f606'}li.service.share-jetpack-whatsapp span:before{content:'\f608'}li.service.share-skype span:before{content:'\f220'}body.settings_page_sharing ul.preview{float:left;margin:0}body.settings_page_sharing ul.preview li.preview-item,body.settings_page_sharing ul.preview li.preview-item a{cursor:default;text-decoration:none}div.sd-social-icon .inner li.preview-item a span,div.sd-social-icon ul.preview li.preview-item a span{display:none}div.sd-social-icon ul.preview li.preview-item.preview-custom a span{display:inline-block}.services .preview li.share-custom a{text-decoration:none}.services ul li.end-fix{clear:both;float:none;visibility:hidden;padding:0;margin:0;height:20px;width:0}#enabled-services h2{font-size:20px;padding-top:0;font-weight:400!important;color:#999}body.settings_page_sharing #live-preview h2{font-size:20px;font-weight:400!important;color:#e3e3e3}body.settings_page_sharing .clearing{clear:both}body.settings_page_sharing .options .options-left{float:left}body.settings_page_sharing .input label{font-size:11px;line-height:16px}body.settings_page_sharing .advanced-form{padding:10px 14px 8px 10px;margin-left:-24px;display:none;border-top:1px #e3e3e3 solid;margin-top:4px}body.settings_page_sharing .utility{float:right;padding-top:10px;padding-right:10px;font-size:10px}body.settings_page_sharing .advanced input[type=submit]{float:left;margin-top:10px;margin-right:10px}.services li.dropzone{border:1px dashed #999;border-radius:3px;background:#e3e3e3;margin-right:10px;padding:5px;height:18px}.advanced-form .form-table th{width:auto!important}.advanced-form .button-secondary{margin-top:0!important}#hidden-drop-target{background:#e1e1e1;border:1px solid #cdcdcd;width:29%;padding:10px;vertical-align:top}#hidden-drop-target p{font-size:13px;font-style:italic;margin:0 0 10px 0}.preview li.preview-item{background-position:0 5px;cursor:default}.preview .option-smart-on{margin:3px 5px 0 0}.preview-digg .option-smart-on{background:url(images/smart-digg.png) no-repeat top left;background-size:76px 17px;width:76px;height:17px;margin-top:2px}.preview-reddit .option-smart-on{background:url(images/smart-reddit.png) no-repeat top left;background-size:104px 21px;width:104px;height:21px}.preview-facebook .option-smart-on{background:url(images/smart-like.png) no-repeat top left;background-size:85px 20px;width:85px;height:20px}.preview-twitter .option-smart-on{background:url(images/smart-twitter.png?1) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-linkedin .option-smart-on{background:url(images/linkedin-smart.png) no-repeat top center;background-size:99px 18px;width:99px;height:20px}.preview-tumblr .option-smart-on{background:url(images/smart-tumblr.png) no-repeat top left;background-size:62px 20px;width:62px;height:20px}.preview-pinterest .option-smart-on{background:url(images/smart-pinterest.png) no-repeat top left;background-size:39px 20px;width:39px;height:20px}.preview-pocket .option-smart-on{background:url(images/smart-pocket.png) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-skype .option-smart-on{background:url(images/smart-skype.png) no-repeat top left;background-size:60px 20px;width:60px;height:20px}.preview-item.share-deprecated{opacity:.5}.preview-item.share-deprecated a span{text-decoration:line-through}@media (-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.preview-digg .option-smart-on{background-image:url(images/smart-digg@2x.png)}.preview-reddit .option-smart-on{background-image:url(images/smart-reddit@2x.png)}.preview-facebook .option-smart-on{background-image:url(images/smart-like@2x.png)}.preview-twitter .option-smart-on{background-image:url(images/smart-twitter@2x.png?1)}.preview-linkedin .option-smart-on{background-image:url(images/linkedin-smart@2x.png)}.preview-tumblr .option-smart-on{background-image:url(images/smart-tumblr@2x.png)}.preview-pinterest .option-smart-on{background-image:url(images/smart-pinterest@2x.png)}.preview-pocket .option-smart-on{background-image:url(images/smart-pocket@2x.png)}.preview-skype .option-smart-on{background-image:url(images/smart-skype@2x.png)}}.services .sharing-hidden li{background-color:transparent}.sharing-hidden li.share-end{clear:both;height:0;padding:0!important;margin:0!important;width:0;visibility:hidden;float:none}.preview .sharing-label{font-weight:700;border:0;padding:4px 6px 0 0}#services-config a.remove{background:#ddd;color:#fff;padding:0 4px 2px;border-radius:15px;-moz-border-radius:15px;-webkit-border-radius:15px;text-decoration:none;font-weight:700;font-size:10px}#services-config a.remove:hover{background:red}.sd-social-icon .inner a.sd-button span,.sd-social-icon .inner a.share-icon span{display:inline-block;overflow:hidden;width:0;text-indent:100%}
\ No newline at end of file diff --git a/plugins/jetpack/modules/sharedaddy/images/googleplus1.png b/plugins/jetpack/modules/sharedaddy/images/googleplus1.png Binary files differdeleted file mode 100644 index 7f07e5bc..00000000 --- a/plugins/jetpack/modules/sharedaddy/images/googleplus1.png +++ /dev/null diff --git a/plugins/jetpack/modules/sharedaddy/images/googleplus1@2x.png b/plugins/jetpack/modules/sharedaddy/images/googleplus1@2x.png Binary files differdeleted file mode 100644 index 41c0096f..00000000 --- a/plugins/jetpack/modules/sharedaddy/images/googleplus1@2x.png +++ /dev/null diff --git a/plugins/jetpack/modules/sharedaddy/images/icon-googleplus-2x.png b/plugins/jetpack/modules/sharedaddy/images/icon-googleplus-2x.png Binary files differdeleted file mode 100644 index 60dd1c03..00000000 --- a/plugins/jetpack/modules/sharedaddy/images/icon-googleplus-2x.png +++ /dev/null diff --git a/plugins/jetpack/modules/sharedaddy/images/icon-googleplus.png b/plugins/jetpack/modules/sharedaddy/images/icon-googleplus.png Binary files differdeleted file mode 100644 index ee687af1..00000000 --- a/plugins/jetpack/modules/sharedaddy/images/icon-googleplus.png +++ /dev/null diff --git a/plugins/jetpack/modules/sharedaddy/images/smart-googleplus1.png b/plugins/jetpack/modules/sharedaddy/images/smart-googleplus1.png Binary files differdeleted file mode 100644 index 8fd1a836..00000000 --- a/plugins/jetpack/modules/sharedaddy/images/smart-googleplus1.png +++ /dev/null diff --git a/plugins/jetpack/modules/sharedaddy/images/smart-googleplus1@2x.png b/plugins/jetpack/modules/sharedaddy/images/smart-googleplus1@2x.png Binary files differdeleted file mode 100644 index 1708c484..00000000 --- a/plugins/jetpack/modules/sharedaddy/images/smart-googleplus1@2x.png +++ /dev/null diff --git a/plugins/jetpack/modules/sharedaddy/sharing-service.php b/plugins/jetpack/modules/sharedaddy/sharing-service.php index ec7bb0b6..3f86053e 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing-service.php +++ b/plugins/jetpack/modules/sharedaddy/sharing-service.php @@ -41,7 +41,6 @@ class Sharing_Service { * Gets a list of all available service names and classes */ public function get_all_services( $include_custom = true ) { - global $wp_version; // Default services // if you update this list, please update the REST API tests // in bin/tests/api/suites/SharingTest.php @@ -51,13 +50,15 @@ class Sharing_Service { 'linkedin' => 'Share_LinkedIn', 'reddit' => 'Share_Reddit', 'twitter' => 'Share_Twitter', - 'google-plus-1' => 'Share_GooglePlus1', 'tumblr' => 'Share_Tumblr', 'pinterest' => 'Share_Pinterest', 'pocket' => 'Share_Pocket', 'telegram' => 'Share_Telegram', 'jetpack-whatsapp' => 'Jetpack_Share_WhatsApp', 'skype' => 'Share_Skype', + + // Deprecated + 'google-plus-1' => 'Share_GooglePlus1', ); /** @@ -74,7 +75,7 @@ class Sharing_Service { $services['email'] = 'Share_Email'; } - if ( is_multisite() && ( version_compare( $wp_version, '4.9-RC1-42107', '<' ) || is_plugin_active( 'press-this/press-this-plugin.php' ) ) ) { + if ( is_multisite() && is_plugin_active( 'press-this/press-this-plugin.php' ) ) { $services['press-this'] = 'Share_PressThis'; } @@ -577,6 +578,10 @@ function sharing_maybe_enqueue_scripts() { } function sharing_add_footer() { + if ( Jetpack_AMP_Support::is_amp_request() ) { + return; + } + global $jetpack_sharing_counts; /** @@ -792,8 +797,15 @@ function sharing_display( $text = '', $echo = false ) { // Visible items $visible = ''; foreach ( $enabled['visible'] as $id => $service ) { + $klasses = array( 'share-' . $service->get_class() ); + if ( $service->is_deprecated() ) { + if ( ! current_user_can( 'manage_options' ) ) { + continue; + } + $klasses[] = 'share-deprecated'; + } // Individual HTML for sharing service - $visible .= '<li class="share-' . $service->get_class() . '">' . $service->get_display( $post ) . '</li>'; + $visible .= '<li class="' . implode( ' ', $klasses ) . '">' . $service->get_display( $post ) . '</li>'; } $parts = array(); @@ -832,7 +844,14 @@ function sharing_display( $text = '', $echo = false ) { $count = 1; foreach ( $enabled['hidden'] as $id => $service ) { // Individual HTML for sharing service - $sharing_content .= '<li class="share-' . $service->get_class() . '">'; + $klasses = array( 'share-' . $service->get_class() ); + if ( $service->is_deprecated() ) { + if ( ! current_user_can( 'manage_options' ) ) { + continue; + } + $klasses[] = 'share-deprecated'; + } + $sharing_content .= '<li class="' . implode( ' ', $klasses ) . '">'; $sharing_content .= $service->get_display( $post ); $sharing_content .= '</li>'; diff --git a/plugins/jetpack/modules/sharedaddy/sharing-sources.php b/plugins/jetpack/modules/sharedaddy/sharing-sources.php index a77a6cbf..4ed1d270 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing-sources.php +++ b/plugins/jetpack/modules/sharedaddy/sharing-sources.php @@ -30,6 +30,10 @@ abstract class Sharing_Source { } } + public function is_deprecated() { + return false; + } + public function http() { return is_ssl() ? 'https' : 'http'; } @@ -263,11 +267,21 @@ abstract class Sharing_Source { $klasses[] = 'no-icon'; } + $is_deprecated = $this->is_deprecated(); + $link = sprintf( '<a rel="nofollow" class="%s" href="javascript:void(0)" title="%s"><span>%s</span></a>', implode( ' ', $klasses ), - $this->get_name(), - $text + esc_attr( + $is_deprecated + ? sprintf( __( 'The %1$s service has shut down. This sharing button is not displayed to your visitors and should be removed.', 'jetpack' ), $this->get_name() ) + : $this->get_name() + ), + esc_html( + $is_deprecated + ? sprintf( __( '%1$s has shut down', 'jetpack' ), $this->get_name() ) + : $text + ) ); $smart = ( $this->smart || $force_smart ) ? 'on' : 'off'; @@ -358,6 +372,62 @@ abstract class Sharing_Source { } } +abstract class Deprecated_Sharing_Source extends Sharing_Source { + public $button_style = 'text'; + public $smart = false; + protected $open_link_in_new = false; + protected $id; + protected $deprecated = true; + + final public function __construct( $id, array $settings ) { + $this->id = $id; + + if ( isset( $settings['button_style'] ) ) { + $this->button_style = $settings['button_style']; + } + } + + final public function is_deprecated() { + return true; + } + + final public function get_share_url( $post_id ) { + return get_permalink( $post_id ); + } + + final public function display_preview( $echo = true, $force_smart = false, $button_style = null ) { + return parent::display_preview( $echo, false, $button_style ); + } + + final public function get_total( $post = false ) { + return 0; + } + + final public function get_posts_total() { + return 0; + } + + final public function process_request( $post, array $post_data ) { + parent::process_request( $post, $post_data ); + } + + final public function get_display( $post ) { + if ( current_user_can( 'manage_options' ) ) { + return $this->display_deprecated( $post ); + } + + return ''; + } + + public function display_deprecated( $post ) { + return $this->get_link( + $this->get_share_url( $post->ID ), + sprintf( __( '%1$s has shut down', 'jetpack' ), $this->get_name() ), + sprintf( __( 'The %1$s service has shut down. This sharing button is not displayed to your visitors and should be removed.', 'jetpack' ), $this->get_name() ) + ); + } +} + abstract class Sharing_Advanced_Source extends Sharing_Source { public function has_advanced_options() { return true; @@ -1057,7 +1127,7 @@ class Share_PressThis extends Sharing_Source { } public function process_request( $post, array $post_data ) { - global $current_user, $wp_version; + global $current_user; $primary_blog = (int) get_user_meta( $current_user->ID, 'primary_blog', true ); if ( $primary_blog ) { @@ -1088,16 +1158,8 @@ class Share_PressThis extends Sharing_Source { 'u' => rawurlencode( $this->get_share_url( $post->ID ) ), ); - if ( version_compare( $wp_version, '4.9-RC1-42107', '>=' ) ) { - $args[ 'url-scan-submit' ] = 'Scan'; - $args[ '_wpnonce' ] = wp_create_nonce( 'scan-site' ); - - } else { // Remove once 4.9 is the minimum. - $args['t'] = rawurlencode( $this->get_share_title( $post->ID ) ); - if ( isset( $_GET['sel'] ) ) { - $args['s'] = rawurlencode( $_GET['sel'] ); - } - } + $args[ 'url-scan-submit' ] = 'Scan'; + $args[ '_wpnonce' ] = wp_create_nonce( 'scan-site' ); $url = $blog->siteurl . '/wp-admin/press-this.php'; $url = add_query_arg( $args, $url ); @@ -1115,110 +1177,11 @@ class Share_PressThis extends Sharing_Source { } } -class Share_GooglePlus1 extends Sharing_Source { +class Share_GooglePlus1 extends Deprecated_Sharing_Source { public $shortname = 'googleplus1'; - public $icon = '\f218'; - private $state = false; - - public function __construct( $id, array $settings ) { - parent::__construct( $id, $settings ); - - if ( 'official' == $this->button_style ) { - $this->smart = true; - } else { - $this->smart = false; - } - } public function get_name() { - return __( 'Google', 'jetpack' ); - } - - public function has_custom_button_style() { - return $this->smart; - } - - public function get_display( $post ) { - - if ( $this->smart ) { - $share_url = $this->get_share_url( $post->ID ); - return '<div class="googleplus1_button"><div class="g-plus" data-action="share" data-annotation="bubble" data-href="' . esc_url( $share_url ) . '"></div></div>'; - } else { - return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'Google', 'share to', 'jetpack' ), __( 'Click to share on Google+', 'jetpack' ), 'share=google-plus-1', 'sharing-google-' . $post->ID ); - } - } - - public function get_state() { - return $this->state; - } - - public function process_request( $post, array $post_data ) { - - if ( isset( $post_data['state'] ) ) { - $this->state = $post_data['state']; - } - // Record stats - parent::process_request( $post, $post_data ); - - // Redirect to Google +'s sharing endpoint - $url = 'https://plus.google.com/share?url=' . rawurlencode( $this->get_share_url( $post->ID ) ); - wp_redirect( $url ); - die(); - } - - public function display_footer() { - global $post; - - if ( $this->smart ) { ?> - <script> - function renderGooglePlus1() { - if ( 'undefined' === typeof gapi ) { - return; - } - - jQuery( '.g-plus' ).each(function() { - var $button = jQuery( this ); - - if ( ! $button.data( 'gplus-rendered' ) ) { - gapi.plusone.render( this, { - href: $button.attr( 'data-href' ), - size: $button.attr( 'data-size' ), - annotation: $button.attr( 'data-annotation' ) - }); - - $button.data( 'gplus-rendered', true ); - } - }); - } - - (function() { - var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; - po.src = 'https://apis.google.com/js/platform.js'; - po.innerHTML = '{"parsetags": "explicit"}'; - po.onload = renderGooglePlus1; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); - })(); - - jQuery( document.body ).on( 'post-load', renderGooglePlus1 ); - </script> - <?php - } else { - $this->js_dialog( 'google-plus-1', array( 'width' => 480, 'height' => 550 ) ); - } - } - - public function get_total( $post = false ) { - global $wpdb, $blog_id; - - $name = strtolower( $this->get_id() ); - - if ( $post == false ) { - // get total number of shares for service - return $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s', $blog_id, $name ) ); - } - - // get total shares for a post - return $wpdb->get_var( $wpdb->prepare( 'SELECT count FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s', $blog_id, $post->ID, $name ) ); + return __( 'Google+', 'jetpack' ); } } @@ -1440,7 +1403,28 @@ class Share_Tumblr extends Sharing_Source { $target = '_blank'; } - return '<a target="' . $target . '" href="https://www.tumblr.com/share/link/?url=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&name=' . rawurlencode( $this->get_share_title( $post->ID ) ) . '" title="' . __( 'Share on Tumblr', 'jetpack' ) . '" style="display:inline-block; text-indent:-9999px; overflow:hidden; width:62px; height:20px; background:url(\'https://platform.tumblr.com/v1/share_2.png\') top left no-repeat transparent;">' . __( 'Share on Tumblr', 'jetpack' ) . '</a>'; + /** + * If we are looking at a single post, let Tumblr figure out the post type (text, photo, link, quote, chat, or video) + * based on the content available on the page. + * If we are not looking at a single post, content from other posts can appear on the page and Tumblr will pick that up. + * In this case, we want Tumblr to focus on our current post, so we will limit the post type to link, where we can give Tumblr a link to our post. + */ + if ( ! is_single() ) { + $posttype = 'data-posttype="link"'; + } else { + $posttype = ''; + } + + // Documentation: https://www.tumblr.com/docs/en/share_button + return sprintf( + '<a class="tumblr-share-button" target="%1$s" href="%2$s" data-title="%3$s" data-content="%4$s" title="%5$s"%6$s>%5$s</a>', + $target, + 'https://www.tumblr.com/share', + $this->get_share_title( $post->ID ), + $this->get_share_url( $post->ID ), + __( 'Share on Tumblr', 'jetpack' ), + $posttype + ); } else { return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'Tumblr', 'share to', 'jetpack' ), __( 'Click to share on Tumblr', 'jetpack' ), 'share=tumblr' ); } @@ -1455,10 +1439,10 @@ class Share_Tumblr extends Sharing_Source { wp_redirect( $url ); die(); } - // http://www.tumblr.com/share?v=3&u=URL&t=TITLE&s= + public function display_footer() { if ( $this->smart ) { - ?><script type="text/javascript" src="https://platform.tumblr.com/v1/share.js"></script><?php + ?><script id="tumblr-js" type="text/javascript" src="https://assets.tumblr.com/share-button.js"></script><?php } else { $this->js_dialog( $this->shortname, array( 'width' => 450, 'height' => 450 ) ); } @@ -1719,7 +1703,15 @@ class Jetpack_Share_WhatsApp extends Sharing_Source { } public function get_display( $post ) { - return $this->get_link( 'https://api.whatsapp.com/send?text=' . rawurlencode( $this->get_share_title( $post->ID ) . ' ' . $this->get_share_url( $post->ID ) ), _x( 'WhatsApp', 'share to', 'jetpack' ), __( 'Click to share on WhatsApp', 'jetpack' ) ); + return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'WhatsApp', 'share to', 'jetpack' ), __( 'Click to share on WhatsApp', 'jetpack' ), 'share=jetpack-whatsapp' ); + } + + public function process_request( $post, array $post_data ) { + // Record stats + parent::process_request( $post, $post_data ); + $url = 'https://api.whatsapp.com/send?text=' . rawurlencode( $this->get_share_title( $post->ID ) . ' ' . $this->get_share_url( $post->ID ) ); + wp_redirect( $url ); + exit; } } diff --git a/plugins/jetpack/modules/sharedaddy/sharing.css b/plugins/jetpack/modules/sharedaddy/sharing.css index 68ce779a..6bd41be9 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.css +++ b/plugins/jetpack/modules/sharedaddy/sharing.css @@ -55,6 +55,14 @@ body.highlander-dark h3.sd-title:before { display: inline-block; } +.sd-content ul li.share-deprecated { + opacity: 0.5; +} + +.sd-content ul li.share-deprecated a span { + text-decoration: line-through; +} + .sd-block.sd-gplus { margin: 0 0 .5em 0; } @@ -286,12 +294,6 @@ body .sd-content ul li.share-custom.no-icon a span { .sd-social-icon-text .sd-content li.share-pinterest a:before { content: '\f210'; } -.sd-social-icon .sd-content ul li.share-google-plus-1 a:before, -.sd-social-text .sd-content ul li.share-google-plus-1 a:before, -.sd-content ul li.share-google-plus-1 div.option.option-smart-off a:before, -.sd-social-icon-text .sd-content li.share-google-plus-1 a:before { - content: '\f218'; -} .sd-social-icon .sd-content ul li.share-facebook a:before, .sd-social-text .sd-content ul li.share-facebook a:before, .sd-content ul li.share-facebook div.option.option-smart-off a:before, @@ -350,6 +352,16 @@ body .sd-content ul li.share-custom.no-icon a span { color: #fff !important; } + +.sd-social-icon .sd-content ul li.share-deprecated a:before, +.sd-social-icon-text .sd-content li.share-deprecated a:before, +.sd-social-official .sd-content li.share-deprecated a:before, +.sd-content ul li.share-deprecated div.option.option-smart-off a:before { + width: 1em; + height: 1em; + content: "\1F6AB"; +} + /* Share count */ .sd-social .sd-button .share-count { background: #2ea2cc; @@ -402,15 +414,11 @@ body .sd-content ul li.share-custom.no-icon a span { /* Individual official buttons */ -.googleplus1_button .g-plus { - vertical-align: top !important; -} - .reddit_button iframe { margin-top: 1px; } -.pocket_button iframe, .googleplus1_button iframe, .pinterest_button, .twitter_button, .linkedin_button>span { +.pocket_button iframe, .pinterest_button, .twitter_button, .linkedin_button>span { margin: 0 !important; } @@ -620,11 +628,6 @@ body .sd-social-icon .sd-content li.share-custom a span { color: #fff !important; } -.sd-social-icon .sd-content ul li[class*='share-'].share-google-plus-1 a.sd-button { - background: #dd4b39; - color: #fff !important; -} - .sd-social-icon .sd-content ul li[class*='share-'].share-pocket a.sd-button { background: #ee4056; color: #fff !important; diff --git a/plugins/jetpack/modules/sharedaddy/sharing.js b/plugins/jetpack/modules/sharedaddy/sharing.js index 52430634..c38877b6 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.js +++ b/plugins/jetpack/modules/sharedaddy/sharing.js @@ -192,11 +192,6 @@ if ( sharing_js_options && sharing_js_options.counts ) { $more_sharing_pane.data( 'justSlid', false ); }, 300 ); - if ( $more_sharing_pane.find( '.share-google-plus-1' ).length ) { - // The pane needs to stay open for the Google+ Button - return; - } - $more_sharing_pane.mouseleave( handler_item_leave ).mouseenter( handler_item_enter ); $more_sharing_button.mouseleave( handler_original_leave ).mouseenter( handler_original_enter ); } ); diff --git a/plugins/jetpack/modules/sharedaddy/sharing.php b/plugins/jetpack/modules/sharedaddy/sharing.php index 0e3d7ee5..b2d4872c 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.php +++ b/plugins/jetpack/modules/sharedaddy/sharing.php @@ -51,6 +51,11 @@ class Sharing_Admin { wp_enqueue_style( 'social-logos' ); wp_enqueue_script( 'sharing-js-fe', WP_SHARING_PLUGIN_URL . 'sharing.js', array(), 4 ); add_thickbox(); + + // On Jetpack sites, make sure we include CSS to style the admin page. + if ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) { + Jetpack_Admin_Page::load_wrapper_styles(); + } } public function admin_init() { @@ -148,11 +153,15 @@ class Sharing_Admin { } public function output_preview( $service ) { + $klasses = array( 'advanced', 'preview-item' ); if ( $service->button_style != 'text' || $service->has_custom_button_style() ) { $klasses[] = 'preview-' . $service->get_class(); $klasses[] = 'share-' . $service->get_class(); + if ( $service->is_deprecated() ) { + $klasses[] = 'share-deprecated'; + } if ( $service->get_class() != $service->get_id() ) { $klasses[] = 'preview-' . $service->get_id(); @@ -165,8 +174,15 @@ class Sharing_Admin { } public function output_service( $id, $service, $show_dropdown = false ) { + $title = ''; + $klasses = array( 'service', 'advanced', 'share-' . $service->get_class() ); + if ( $service->is_deprecated() ) { + $title = sprintf( __( 'The %1$s service has shut down. This sharing button is not displayed to your visitors and should be removed.', 'jetpack' ), $service->get_name() ); + $klasses[] = 'share-deprecated'; + } + ?> - <li class="service advanced share-<?php echo $service->get_class(); ?>" id="<?php echo $service->get_id(); ?>" tabindex="0"> + <li class="<?php echo implode( ' ', $klasses ); ?>" id="<?php echo $service->get_id(); ?>" tabindex="0" title="<?php echo esc_attr( $title ); ?>"> <span class="options-left"><?php echo esc_html( $service->get_name() ); ?></span> <?php if ( 0 === strpos( $service->get_id(), 'custom-' ) || $service->has_advanced_options() ) : ?> <span class="close"><a href="#" class="remove">×</a></span> @@ -536,6 +552,64 @@ class Sharing_Admin { } } +/** + * Callback to get the value for the jetpack_sharing_enabled field. + * + * When the sharing_disabled post_meta is unset, we follow the global setting in Sharing. + * When it is set to 1, we disable sharing on the post, regardless of the global setting. + * It is not possible to enable sharing on a post if it is disabled globally. + */ +function jetpack_post_sharing_get_value( array $post ) { + // if sharing IS disabled on this post, enabled=false, so negate the meta + return (bool) ! get_post_meta( $post['id'], 'sharing_disabled', true ); +} + +/** + * Callback to set sharing_disabled post_meta when the + * jetpack_sharing_enabled field is updated. + * + * When the sharing_disabled post_meta is unset, we follow the global setting in Sharing. + * When it is set to 1, we disable sharing on the post, regardless of the global setting. + * It is not possible to enable sharing on a post if it is disabled globally. + * + */ +function jetpack_post_sharing_update_value( $enable_sharing, $post_object ) { + if ( $enable_sharing ) { + // delete the override if we want to enable sharing + return delete_post_meta( $post_object->ID, 'sharing_disabled' ); + } else { + return update_post_meta( $post_object->ID, 'sharing_disabled', true ); + } +} + +/** + * Add Sharing post_meta to the REST API Post response. + * + * @action rest_api_init + * @uses register_rest_field + * @link https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/ + */ +function jetpack_post_sharing_register_rest_field() { + $post_types = get_post_types( array( 'public' => true ) ); + foreach ( $post_types as $post_type ) { + register_rest_field( + $post_type, + 'jetpack_sharing_enabled', + array( + 'get_callback' => 'jetpack_post_sharing_get_value', + 'update_callback' => 'jetpack_post_sharing_update_value', + 'schema' => array( + 'description' => __( 'Are sharing buttons enabled?', 'jetpack' ), + 'type' => 'boolean', + ), + ) + ); + } +} + +// Add Sharing post_meta to the REST API Post response. +add_action( 'rest_api_init', 'jetpack_post_sharing_register_rest_field' ); + function sharing_admin_init() { global $sharing_admin; |