Commit ba8350da authored by ozin's avatar ozin Committed by Robert Ragas

Issue #2747541 by ozin: Update js with the latest version of the YoastSEO.js

parent 840bd053
#edit-yoast-seo {
border: 1px solid #ddd;
margin: 20px 0;
padding: 20px 0; }
#edit-yoast-seo .wrapper-title {
padding-left: 20px; }
#wpseo-plugin-loading {
display: block;
height: auto;
display: none; }
#edit-yoast-seo-und:after {
display: block;
content: '';
clear: both; }
#edit-yoast-seo-und .form-item {
display: inline-block;
float: left;
margin: 20px 0;
padding: 0 0 0 20px; }
#edit-yoast-seo-und #yoast-overallscore {
float: left;
padding-top: 20px;
margin-top: 20px;
margin-left: 10px; }
#yoast-overallscore {
display: inline-block; }
#yoast-overallscore .score_circle {
display: inline-block;
width: 12px;
height: 12px;
margin: 4px 5px 0 3px;
vertical-align: top;
border-radius: 50%;
background: #888; }
#yoast-overallscore.good .score_circle {
background: #7ad03a; }
#yoast-overallscore.ok .score_circle {
background: #ffba00; }
#yoast-overallscore.poor .score_circle {
background: #ee7c1b; }
#yoast-overallscore.bad .score_circle {
background: #dd3d36; }
#yoast-overallscore .score_title {
font-weight: normal; }
#yoast-overallscore .score_title strong {
font-weight: bold; }
#yoast-wrapper {
clear: both;
padding: 0 20px; }
#yoast-wrapper > label {
font-size: inherit; }
#yoast-wrapper .inputForm label {
line-height: 20px;
float: left;
width: 250px;
text-transform: capitalize;
color: #777; }
#yoast-wrapper .inputForm input {
line-height: 20px;
float: left;
width: 300px;
margin: 5px 0; }
#yoast-wrapper .inputForm textarea {
float: left;
#snippet_preview {
border: 1px solid #f7f7f7;
border-radius: 20px;
background-color: #fff;
position: relative;
width: 552px
}
.snippet_container:after:before, .snippet_container:after:after {
content: ' ';
display: table
}
.snippet_container:after:after {
clear: both
}
.snippet-editor__container {
position: relative;
cursor: pointer
}
.snippet-editor__heading {
padding: 8px 20px;
font-size: 0.9rem;
margin: 0;
border-bottom: 1px solid #f7f7f7;
font-family: "Open Sans", sans-serif;
font-weight: 300;
color: #555
}
.snippet-editor__heading-editor {
border-top: 1px solid #f7f7f7
}
.snippet-editor__heading-icon-eye {
background: url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1664%20960q%2D152%2D236%2D381%2D353%2061%20104%2061%20225%200%20185%2D131%2E5%20316%2E5t%2D316%2E5%20131%2E5%2D316%2E5%2D131%2E5%2D131%2E5%2D316%2E5q0%2D121%2061%2D225%2D229%20117%2D381%20353%20133%20205%20333%2E5%20326%2E5t434%2E5%20121%2E5%20434%2E5%2D121%2E5%20333%2E5%2D326%2E5zm%2D720%2D384q0%2D20%2D14%2D34t%2D34%2D14q%2D125%200%2D214%2E5%2089%2E5t%2D89%2E5%20214%2E5q0%2020%2014%2034t34%2014%2034%2D14%2014%2D34q0%2D86%2061%2D147t147%2D61q20%200%2034%2D14t14%2D34zm848%20384q0%2034%2D20%2069%2D140%20230%2D376%2E5%20368%2E5t%2D499%2E5%20138%2E5%2D499%2E5%2D139%2D376%2E5%2D368q%2D20%2D35%2D20%2D69t20%2D69q140%2D229%20376%2E5%2D368t499%2E5%2D139%20499%2E5%20139%20376%2E5%20368q20%2035%2020%2069z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 20px center;
background-size: 16px;
padding-left: 45px
}
.snippet-editor__heading-icon-edit {
background: url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M491%201536l91%2D91%2D235%2D235%2D91%2091v107h128v128h107zm523%2D928q0%2D22%2D22%2D22%2D10%200%2D17%207l%2D542%20542q%2D7%207%2D7%2017%200%2022%2022%2022%2010%200%2017%2D7l542%2D542q7%2D7%207%2D17zm%2D54%2D192l416%20416%2D832%20832h%2D416v%2D416zm683%2096q0%2053%2D37%2090l%2D166%20166%2D416%2D416%20166%2D165q36%2D38%2090%2D38%2053%200%2091%2038l235%20234q37%2039%2037%2091z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 20px center;
background-size: 16px;
padding-left: 45px
}
.snippet-editor__container:hover:before {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23bfbfbf%22%20d%3D%22M1152%20896q0%2026%2D19%2045l%2D448%20448q%2D19%2019%2D45%2019t%2D45%2D19%2D19%2D45v%2D896q0%2D26%2019%2D45t45%2D19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E");
position: absolute;
content: '';
top: -3px;
left: -22px;
display: block;
width: 24px;
height: 24px;
background-size: 25px
}
.snippet-editor__container--focus:hover:before, .snippet-editor__container--focus:before {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1152%20896q0%2026%2D19%2045l%2D448%20448q%2D19%2019%2D45%2019t%2D45%2D19%2D19%2D45v%2D896q0%2D26%2019%2D45t45%2D19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E");
position: absolute;
content: '';
top: -3px;
left: -22px;
display: block;
width: 24px;
height: 24px;
background-size: 25px
}
.snippet-editor__preview {
padding: 15px 20px
}
.snippet-editor__button {
background: #f7f7f7;
border: 1px solid #dbdbdb;
border-radius: 4px;
color: #555;
padding: 8px 10px;
cursor: pointer;
font-size: 0.8rem
}
.snippet-editor__edit-button {
background: #f7f7f7 url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M491%201536l91%2D91%2D235%2D235%2D91%2091v107h128v128h107zm523%2D928q0%2D22%2D22%2D22%2D10%200%2D17%207l%2D542%20542q%2D7%207%2D7%2017%200%2022%2022%2022%2010%200%2017%2D7l542%2D542q7%2D7%207%2D17zm%2D54%2D192l416%20416%2D832%20832h%2D416v%2D416zm683%2096q0%2053%2D37%2090l%2D166%20166%2D416%2D416%20166%2D165q36%2D38%2090%2D38%2053%200%2091%2038l235%20234q37%2039%2037%2091z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 8px center;
background-size: 16px;
padding-left: 32px;
display: block;
margin-top: 1em
}
.snippet-editor__form {
padding: 20px
}
.snippet-editor__label {
display: block;
width: 100%;
height: 400px;
margin: 5px 0; }
#yoast-wrapper li .score {
list-style-type: none; }
#yoast-wrapper .wpseoanalysis {
margin-left: 0;
list-style: none; }
#yoast-wrapper .wpseoanalysis li {
margin: 3px 0;
line-height: auto; }
#yoast-wrapper .wpseo-score-text {
display: inline-block;
width: 90%; }
#yoast-wrapper .wpseo-score-icon {
display: inline-block;
width: 12px;
height: 12px;
margin: 3px 10px 0 3px;
vertical-align: top;
border-radius: 50%;
background: #888; }
#yoast-wrapper .wpseo-score-icon.good {
background-color: #7ad03a; }
#yoast-wrapper .wpseo-score-icon.ok {
background-color: #ffba00; }
#yoast-wrapper .wpseo-score-icon.poor {
background-color: #ee7c1b; }
#yoast-wrapper .wpseo-score-icon.bad {
background-color: #dd3d36; }
#yoast-wrapper .wpseo-score-icon.na {
background-color: #999; }
#yoast-wrapper .wpseo-score-icon.noindex {
background-color: #1e8cbe; }
#yoast-wrapper .wpseo_msg {
margin: 5px 0 10px 0;
padding: 0 5px;
border: 1px solid #e6db55;
background-color: #ffffe0; }
#yoast-wrapper #snippet_preview {
font-family: Arial, sans-serif;
margin-top: 1em;
position: relative
}
.snippet-editor__label:first-child {
margin-top: 0
}
.snippet-editor__label--hover:before {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23bfbfbf%22%20d%3D%22M1152%20896q0%2026%2D19%2045l%2D448%20448q%2D19%2019%2D45%2019t%2D45%2D19%2D19%2D45v%2D896q0%2D26%2019%2D45t45%2D19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E");
position: absolute;
content: '';
top: -3px;
left: -22px;
display: block;
width: 24px;
height: 24px;
background-size: 25px;
top: 20px
}
.snippet-editor__label--focus:before {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%231074a8%22%20d%3D%22M1152%20896q0%2026%2D19%2045l%2D448%20448q%2D19%2019%2D45%2019t%2D45%2D19%2D19%2D45v%2D896q0%2D26%2019%2D45t45%2D19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E");
position: absolute;
content: '';
top: -3px;
left: -22px;
display: block;
width: 24px;
height: 24px;
background-size: 25px;
top: 20px
}
.snippet-editor__input {
display: block;
width: 100%;
padding: 20px;
margin: 0 0 20px; }
#yoast-wrapper .title {
font-size: 18px;
font-weight: normal;
line-height: 1.2;
margin-top: 5px;
border: 1px solid #bfbfbf;
max-width: 100%;
box-sizing: border-box
}
.snippet-editor__input:focus {
border: 1px solid #1074a8;
outline: none
}
.snippet-editor__meta-description {
height: 70px
}
.snippet-editor__submit {
margin-top: 1em
}
#snippet_cite {
min-width: 20px
}
#meta_container {
clear: both;
min-height: 20px
}
.snippet_container .title {
color: #1e0fbe;
display: block;
overflow: hidden;
width: 512px;
margin: 0;
white-space: nowrap;
text-decoration: none;
text-overflow: ellipsis;
color: #1e0fbe; }
#yoast-wrapper .title:visited {
color: #609; }
#yoast-wrapper .url, #yoast-wrapper .desc {
text-decoration: none;
white-space: nowrap;
width: 512px;
font-size: 18px;
line-height: 1.2;
font-weight: normal;
margin: 0
}
.snippet_container .url, .snippet_container .desc {
font-size: 13px;
line-height: 1.4;
display: block; }
#yoast-wrapper .url {
font-size: 14px;
font-style: normal;
line-height: 16px;
color: #006621; }
#yoast-wrapper .urlBase {
float: left; }
#yoast-wrapper .desc {
color: #545454; }
#yoast-wrapper input {
font-size: 14px;
line-height: 1.4
}
.snippet_container .url {
display: block;
width: 540px;
margin: 5px 5px 5px 0;
padding: 5px; }
#yoast-wrapper textarea {
font-size: 14px;
line-height: 16px;
color: #006621;
font-style: normal
}
.snippet_container .urlBase {
float: left
}
.snippet_container .desc-default {
color: #333
}
.snippet_container .desc-render {
color: #777
}
.snippet_container .tooLong {
color: #f00 !important
}
.snippet-editor__field--invalid {
color: #f00
}
.snippet-editor__progress {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border: none;
box-sizing: border-box;
display: block;
width: 540px;
height: 60px;
margin: 5px 5px 5px 0;
padding: 5px; }
#yoast-wrapper #snippet_preview {
font-family: Arial, sans-serif;
width: 512px;
padding: 20px;
border: 1px solid #ddd; }
#yoast-wrapper .screen-reader-text {
position: absolute !important;
overflow: hidden;
margin-top: 5px;
height: 8px;
width: 100%
}
.snippet-editor__progress::-webkit-progress-bar {
background-color: #f7f7f7;
height: 8px;
border: 1px solid #bfbfbf
}
.snippet-editor__progress--fallback {
background-color: #f7f7f7;
height: 8px;
border: 1px solid #bfbfbf
}
.snippet-editor__progress-bar {
width: 0;
height: 100%;
max-width: 100%
}
.snippet-editor__date {
color: #808080;
font-size: 13px;
line-height: 1.4
}
.snippet-editor--hidden {
display: none
}
.snippet-editor__progress--bad[value] {
color: #dc3232
}
.snippet-editor__progress--bad[value]::-webkit-progress-value {
background-color: #dc3232;
transition: width 250ms
}
.snippet-editor__progress--bad[value]::-moz-progress-bar {
background-color: #dc3232
}
.snippet-editor__progress--bad[value] .snippet-editor__progress-bar {
background-color: #dc3232
}
.snippet-editor__progress--ok[value] {
color: #ee7c1b
}
.snippet-editor__progress--ok[value]::-webkit-progress-value {
background-color: #ee7c1b;
transition: width 250ms
}
.snippet-editor__progress--ok[value]::-moz-progress-bar {
background-color: #ee7c1b
}
.snippet-editor__progress--ok[value] .snippet-editor__progress-bar {
background-color: #ee7c1b
}
.snippet-editor__progress--good[value] {
color: #7ad03a
}
.snippet-editor__progress--good[value]::-webkit-progress-value {
background-color: #7ad03a;
transition: width 250ms
}
.snippet-editor__progress--good[value]::-moz-progress-bar {
background-color: #7ad03a
}
.snippet-editor__progress--good[value] .snippet-editor__progress-bar {
background-color: #7ad03a
}
.wpseoanalysis {
padding-right: 0px
}
.wpseo-score-text {
display: inline-block;
width: 90%
}
.wpseo-score-icon {
display: inline-block;
width: 12px;
height: 12px;
margin: 3px 10px 0 3px;
border-radius: 50%;
background: #888;
vertical-align: top
}
.yoast-seo-form.form-wrapper {
border: 1px solid #ccc;
padding: 10px;
background-color: #fdfdfd;
}
.wpseo-score-icon.good {
background-color: #7ad03a
}
.wpseo-score-icon.ok {
background-color: #ee7c1b
}
.wpseo-score-icon.bad {
background-color: #dc3232
}
.wpseo-score-icon.na {
background-color: #999
}
.wpseo-score-icon.noindex {
background-color: #1e8cbe
}
li.score {
list-style-type: none !important
}
.screen-reader-text {
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
height: 1px;
width: 1px;
height: 1px; }
#yoast-wrapper #snippet_preview:hover {
background-color: #f5f5f5; }
#yoast-wrapper #snippet_preview *[contenteditable='true']:hover {
cursor: pointer;
background: #bbdefb; }
#yoast-wrapper #snippet_preview *[contenteditable='true']:focus {
cursor: text;
background-color: #bbdefb; }
overflow: hidden
}
.yoast_newsletter_subscription {
margin: 20px 20px 0 20px;
.overallScore .score_circle {
background: #999;
display: inline-block;
width: 12px;
height: 12px;
margin: 3px 4px 0 3px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
vertical-align: top;
}
.yoast_newsletter_subscription h3{
margin: 0;
#yoast-overallscore{
display: inline-block;
vertical-align: -5px;
}
div.form-item-yoast-seo-und-focus-keyword{
display: inline-block;
vertical-align: middle;
}
.overallScore #score_circle_shadow {
background: #777
}
.overallScore.good .score_circle {
background: #77b227
}
.overallScore.ok .score_circle{
background: #f49a00
}
.overallScore.bad .score_circle {
background: #ff4e47;
}
.YoastSEO_msg .right, .YoastSEO_msg .left {
display: none
}
@keyframes animatedBackground {
from {
background-position: 0 0
}
to {
background-position: 100% 0
}
}
.YoastSEO_msg .bufferbar {
display: block;
width: 100%;
height: 12px;
background-image: linear-gradient(to left, #fff, #0063ff, #fff, #0063ff);
background-size: 300% 100%;
background-position: 0px 0px;
margin: 10px 0 10px 0;
border: 1px solid #dfdfdf;
animation: animatedBackground 5s linear infinite
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* JavaScript file that handles initializing and firing the Yoast
* js-text-analysis library.
* Support YoastSEO.js v1.2.2.
*/
(function ($) {
Drupal.yoast_seo = Drupal.yoast_seo || {};
......@@ -27,12 +28,12 @@
snippet: settings.yoast_seo.targets.snippet
},
snippetFields: {
title: "snippet_title",
url: "snippet_cite",
meta: "snippet_meta"
title: "snippet-editor-title",
url: "snippet-editor-slug",
meta: "snippet-editor-meta-description"
},
sampleText: {
url: settings.yoast_seo.defaultText.url,
baseUrl: settings.yoast_seo.baseRoot + '/',
title: settings.yoast_seo.defaultText.title,
keyword: settings.yoast_seo.defaultText.keyword,
meta: settings.yoast_seo.defaultText.meta,
......@@ -63,9 +64,8 @@
// Declaring the callback functions, for now we bind DrupalSource.
YoastSEO.analyzerArgs.callbacks = {
getData: DrupalSource.getData.bind(DrupalSource),
getAnalyzerInput: DrupalSource.getAnalyzerInput.bind(DrupalSource),
bindElementEvents: DrupalSource.bindElementEvents.bind(DrupalSource),
updateSnippetValues: DrupalSource.updateSnippetValues.bind(DrupalSource),
saveSnippetData: DrupalSource.saveSnippetData.bind(DrupalSource),
saveScores: DrupalSource.saveScores.bind(DrupalSource)
};
......@@ -119,7 +119,6 @@ YoastSEO_DrupalSource = function(args) {
this.config = args;
this.refObj = {};
this.analyzerData = {};
this.formattedData = {};
};
/**
......@@ -135,7 +134,7 @@ YoastSEO_DrupalSource.prototype.triggerEvent = function(field) {
else {
document.getElementById(field).fireEvent("input");
}
}
};
/**
* Parses the input in snippet preview fields on input evt to data in the metatag and path fields
......@@ -146,11 +145,11 @@ YoastSEO_DrupalSource.prototype.parseSnippetData = function(source, target) {
var listener = function ( ev ) {
// textContent support for FF and if both innerText and textContent are
// undefined we use an empty string.
document.getElementById(target).value = (ev.target.innerText || ev.target.textContent || "");
document.getElementById(target).value = (ev.target.value || "");
this.triggerEvent(target);
}.bind(this);
document.getElementById(source).addEventListener("blur", listener);
}
};
/**
......@@ -164,7 +163,6 @@ YoastSEO_DrupalSource.prototype.getData = function() {
meta: this.getDataFromInput( "meta" ),
snippetMeta: this.getDataFromInput( "meta" ),
text: this.getDataFromInput( "text" ),
snippetTitle: this.getDataFromInput( "title" ),
pageTitle: this.getDataFromInput( "title" ),
baseUrl: this.config.baseRoot + '/',
url: this.config.baseRoot + '/' + this.getDataFromInput( "url" ),
......@@ -175,9 +173,6 @@ YoastSEO_DrupalSource.prototype.getData = function() {