Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Fix some CS issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
miina committed Mar 30, 2018
1 parent d301cc0 commit f7ada7e
Show file tree
Hide file tree
Showing 7 changed files with 370 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/*.min.js
**/node_modules/**
**/vendor/**
**/assets/**
File renamed without changes.
353 changes: 353 additions & 0 deletions assets/js/editor-blocks.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions blocks/hero/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* globals travelGlobals */
// jscs:disable disallowMultipleLineStrings
// jscs:disable validateQuoteMarks
/* jscs:disable disallowMultipleLineStrings */
/* jscs:disable validateQuoteMarks */

/**
* Internal block libraries.
Expand Down Expand Up @@ -64,7 +64,6 @@ export default registerBlockType(
},
save: props => {

// Note: amp-mustache template content is not included in "save".
const ampValueProp = {
'[value]': 'fields_query'
};
Expand Down Expand Up @@ -112,7 +111,7 @@ export default registerBlockType(
{ wp.element.createElement(
'datalist',
{
id: 'locations',
id: 'locations'
},
'{{#predictions}}',
wp.element.createElement(
Expand Down
17 changes: 11 additions & 6 deletions functions.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<?php
/**
* Theme functions file.
*
* @package WPAMPTheme
*/

/**
* Enqueue JS for block editor only.
*/
function travel_enqueue_editor_scripts() {

// If Gutenberg doesn't exist, don't load any scripts.
if ( ! function_exists( 'gutenberg_init') ) {
if ( ! function_exists( 'gutenberg_init' ) ) {
return;
}

Expand All @@ -30,7 +35,7 @@ function travel_enqueue_editor_scripts() {
// @todo Use only style that's actually needed within the editor.
wp_enqueue_style(
'travel-editor-blocks-css',
get_template_directory_uri() . '/blocks/editor-blocks.css',
get_template_directory_uri() . '/assets/css/editor-blocks.css',
array( 'wp-blocks' )
);
}
Expand All @@ -41,18 +46,18 @@ function travel_enqueue_editor_scripts() {
/**
* Replaces data-ampsrc with [src].
* This is a workaround for React considering [src] as an invalid attribute.
* @todo Confirm if this makes sense / if there's a better way.
*
* @param string $content Content
* @todo Confirm if this makes sense / if there's a better way.
* @param string $content Content.
* @return mixed
*/
function travel_filter_the_content_amp_atts( $content ) {
if ( ! function_exists( 'gutenberg_init') ) {
if ( ! function_exists( 'gutenberg_init' ) ) {
return $content;
}

if ( is_singular() ) {
$content = str_replace('data-ampsrc=', '[src]=', $content );
$content = str_replace( 'data-ampsrc=', '[src]=', $content );
return $content;
}
}
Expand Down
2 changes: 2 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* @todo Create proper templates.
*/

// Ignore the issues of this file since that's just a copied HTML placeholder and contains some issues (e.g. including the scripts directly.)

// @codingStandardsIgnoreFile
?>
<!doctype html>
<html ⚡="">
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"cross-env": "^5.1.1",
"eslint": "^4.19.1",
"grunt-cli": "^1.2.0",
"jscs": "^3.0.7",
"jshint": "^2.9.5",
Expand Down

0 comments on commit f7ada7e

Please sign in to comment.