Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Y
yoast_seo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
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 @@
var
self
=
this
;
this
.
$form
.
ajaxSubmit
({
// TODO: This endpoint probably shouldn't be static.
url
:
'
/yoast_seo/preview
'
,
url
:
this
.
config
.
analysis_endpoint
,
data
:
{
yoast_seo_preview
:
{
path
:
drupalSettings
.
path
.
currentPath
,
...
...
src/Plugin/Field/FieldWidget/YoastSeoWidget.php
View file @
1309762f
...
...
@@ -10,6 +10,7 @@ use Drupal\Core\Field\WidgetBase;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Field\FieldDefinitionInterface
;
use
Drupal\Core\Plugin\ContainerFactoryPluginInterface
;
use
Drupal\Core\Url
;
use
Drupal\yoast_seo
\
SeoManager
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -177,6 +178,8 @@ class YoastSeoWidget extends WidgetBase implements ContainerFactoryPluginInterfa
'base_root'
=>
$base_root
,
// Set up score to indiciator word 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.
...
...
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