Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
yoast_seo
Commits
1309762f
Commit
1309762f
authored
Nov 10, 2017
by
Kingdutch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't hardcode analysis preview route in Javascript
parent
a7d1fe66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
js/yoast_seo.js
js/yoast_seo.js
+1
-2
src/Plugin/Field/FieldWidget/YoastSeoWidget.php
src/Plugin/Field/FieldWidget/YoastSeoWidget.php
+3
-0
No files found.
js/yoast_seo.js
View file @
1309762f
...
@@ -215,8 +215,7 @@
...
@@ -215,8 +215,7 @@
var
self
=
this
;
var
self
=
this
;
this
.
$form
.
ajaxSubmit
({
this
.
$form
.
ajaxSubmit
({
// TODO: This endpoint probably shouldn't be static.
url
:
this
.
config
.
analysis_endpoint
,
url
:
'
/yoast_seo/preview
'
,
data
:
{
data
:
{
yoast_seo_preview
:
{
yoast_seo_preview
:
{
path
:
drupalSettings
.
path
.
currentPath
,
path
:
drupalSettings
.
path
.
currentPath
,
...
...
src/Plugin/Field/FieldWidget/YoastSeoWidget.php
View file @
1309762f
...
@@ -10,6 +10,7 @@ use Drupal\Core\Field\WidgetBase;
...
@@ -10,6 +10,7 @@ use Drupal\Core\Field\WidgetBase;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Field\FieldDefinitionInterface
;
use
Drupal\Core\Field\FieldDefinitionInterface
;
use
Drupal\Core\Plugin\ContainerFactoryPluginInterface
;
use
Drupal\Core\Plugin\ContainerFactoryPluginInterface
;
use
Drupal\Core\Url
;
use
Drupal\yoast_seo
\
SeoManager
;
use
Drupal\yoast_seo
\
SeoManager
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
@@ -177,6 +178,8 @@ class YoastSeoWidget extends WidgetBase implements ContainerFactoryPluginInterfa
...
@@ -177,6 +178,8 @@ class YoastSeoWidget extends WidgetBase implements ContainerFactoryPluginInterfa
'base_root'
=>
$base_root
,
'base_root'
=>
$base_root
,
// Set up score to indiciator word rules.
// Set up score to indiciator word rules.
'score_status'
=>
$score_to_status_rules
,
'score_status'
=>
$score_to_status_rules
,
// Set up our analysis endpoint.
'analysis_endpoint'
=>
Url
::
fromRoute
(
'yoast_seo.entity_preview'
)
->
toString
(),
];
];
// Set up the names of the text outputs.
// Set up the names of the text outputs.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment