Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging master to keep up to date. #1

Merged
merged 57 commits into from
Mar 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c90b0f2
Fix-live-widget-#26
BE-Webdesign Feb 14, 2016
bee7c4d
Changed poll method to use POST instead of GET to work around HTTP2 b…
jeffreydwalter Feb 23, 2016
01f8815
Changed spaces to tabs.
jeffreydwalter Feb 23, 2016
b23747f
Merge pull request #30 from jeffreydwalter/master
Mar 5, 2016
314592d
Changed poll request body data format to reduce size.
jeffreydwalter Mar 4, 2016
8654fc9
Merge pull request #31 from jeffreydwalter/o2-request-size-reduction
Mar 11, 2016
bbb13f9
Live Comments: ensure defaults are set for first time widget is added
Mar 11, 2016
ecb3aff
Live Comments: ensure defaults are set for first time widget is added
Mar 11, 2016
2c3cda7
Merge branch 'master' of https://github.com/Automattic/o2
Mar 11, 2016
243e369
Merge pull request #28 from BE-Webdesign/Fix-live-widget-#26
lancewillett Mar 11, 2016
541065e
Fix https://github.com/Automattic/o2/issues/16
jeffreydwalter Mar 21, 2016
7201106
Merge pull request #33 from jeffreydwalter/master
Mar 24, 2016
2750dbf
Tidy up how we're using `plugins_url()`
georgestephanis Mar 24, 2016
c98930a
Don't use `__DIR__`
georgestephanis Mar 24, 2016
5e06eeb
Revert "Changed modelClass to use hash instead of userLogin."
Mar 24, 2016
f9ebecc
Merge pull request #35 from Automattic/revert-33-master
Mar 24, 2016
f48649a
For consistency, let's use O2___ constants
georgestephanis Mar 24, 2016
f3e8b65
Use absolute includes, not relative includes.
georgestephanis Mar 24, 2016
5d7070f
Double commas are not as cool as double rainbows.
georgestephanis Mar 24, 2016
01aebf5
Again, double commas and double rainbows.
georgestephanis Mar 24, 2016
f00f5d7
Add Grunt functionality, with some basic settings.
georgestephanis Mar 24, 2016
608f7fb
Stop manually translating days of the week and months of the year.
georgestephanis Mar 25, 2016
afcba0d
Convert indents, and minor tidying with specifying of files.
georgestephanis Mar 25, 2016
245bdef
Add missing textdomains.
georgestephanis Mar 25, 2016
4d3bab6
Makepot!
georgestephanis Mar 25, 2016
c3be31b
Make o2 a global for jshint
georgestephanis Mar 25, 2016
e64d943
Apply WordPress Core's JSHint code style to `to-do` module.
georgestephanis Mar 25, 2016
7c7927a
JSHint `modules/suggestions`
georgestephanis Mar 25, 2016
57333d2
Move the Cocktail global up to the .jshintrc
georgestephanis Mar 25, 2016
5445bbb
JSHint `modules/sticky-posts`
georgestephanis Mar 25, 2016
9807403
JSHint recent-comments
georgestephanis Mar 25, 2016
5488e5f
JSHint post-actions
georgestephanis Mar 25, 2016
8b5b37a
JSHint performance
georgestephanis Mar 25, 2016
d0782b7
JSHint offline
georgestephanis Mar 25, 2016
263a087
JSHint notifications
georgestephanis Mar 25, 2016
f8a9e29
JSHint live-comments
georgestephanis Mar 25, 2016
4d5db7c
Add some more external libraries to the ignore list.
georgestephanis Mar 25, 2016
76eeb69
JSHint wp-locale.js
georgestephanis Mar 25, 2016
d1dcf96
JSHint follow module
georgestephanis Mar 25, 2016
a72c02f
JSHint filter-widget
georgestephanis Mar 25, 2016
901d049
JSHint: Remove three unused local variables.
georgestephanis Mar 25, 2016
9212eed
JSHint checklists module
georgestephanis Mar 25, 2016
ceb6fc6
JSHint four minor views.
georgestephanis Mar 25, 2016
fa607e2
JSHint: four utils
georgestephanis Mar 25, 2016
f766e09
JSHint all the models.
georgestephanis Mar 25, 2016
52bbcf5
JSHint `jquery.autoresize.js`
georgestephanis Mar 25, 2016
1723394
Remove deprecated variable declarations.
georgestephanis Mar 26, 2016
561f321
JSHint views/posts?.js
georgestephanis Mar 26, 2016
5ec456c
JSHint
georgestephanis Mar 29, 2016
6c8f024
Simplify how we're handling the ScrollTo.
georgestephanis Mar 29, 2016
9b79dcb
JSHint
georgestephanis Mar 29, 2016
4e802a3
JSHint
georgestephanis Mar 29, 2016
da5c116
Whitespace!
georgestephanis Mar 29, 2016
7c9632f
Merge pull request #36 from Automattic/fix/better-asset-routing
Mar 29, 2016
1110a2e
Merge pull request #37 from Automattic/add/grunt
Mar 29, 2016
9fd0221
Merge in r133168-wpcom
georgestephanis Mar 29, 2016
3f9d31f
Backbone returns success as `1` not `'1'` -- correct the comparison
georgestephanis Mar 30, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ inc/a8c.php
inc/wpcom.php
bin/autortl
sftp-config.json

node_modules
28 changes: 28 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"es3": true,
"expr": true,
"immed": true,
"noarg": true,
"nonbsp": true,
"onevar": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"unused": true,

"browser": true,

"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"JSON": false,
"wp": false,
"Cocktail": false,
"o2": true
}
}
64 changes: 64 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* global module */
module.exports = function(grunt) {
var cfg = {
pkg: grunt.file.readJSON('package.json'),
phplint: {
files: [
'*.php',
'**/*.php'
]
},
jshint: {
options: grunt.file.readJSON('.jshintrc'),
src: [
'js/**/*.js',
'modules/**/*.js',
// External libraries:
'!js/utils/caret.js',
'!js/utils/cocktail.js',
'!js/utils/enquire.js',
'!js/utils/jquery.highlight.js',
'!js/utils/jquery.hotkeys.js',
'!js/utils/jquery.placeholder.js',
'!js/utils/moment.js'
]
},
makepot: {
o2: {
options: {
domainPath: '/languages',
exclude: [
'node_modules'
],
mainFile: 'o2.php',
potFilename: 'o2.pot'
}
}
},
addtextdomain: {
o2: {
options: {
textdomain: 'o2'
},
files: {
src: [
'*.php',
'**/*.php',
'!node_modules/**'
]
}
}
}
};

grunt.initConfig( cfg );

grunt.loadNpmTasks('grunt-phplint');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-wp-i18n');

grunt.registerTask('default', [
'phplint',
'jshint'
]);
};
6 changes: 3 additions & 3 deletions inc/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ function __construct() {
}

public function register_scripts() {
wp_enqueue_script( 'o2-jquery-hotkeys', plugins_url( 'o2/js/utils/jquery.hotkeys.js' ), array( 'jquery' ) );
wp_enqueue_script( 'o2-jquery-hotkeys', plugins_url( 'js/utils/jquery.hotkeys.js', O2__FILE__ ), array( 'jquery' ) );
// @todo Copy autoresize into position as part of the .org build process
if ( !defined( 'IS_WPCOM' ) || !IS_WPCOM ) {
wp_enqueue_script( 'jquery.autoresize', plugins_url( 'o2/js/editor/jquery.autoresize.js' ), array( 'jquery' ) );
wp_enqueue_script( 'jquery.autoresize', plugins_url( 'js/editor/jquery.autoresize.js', O2__FILE__ ), array( 'jquery' ) );
}
wp_enqueue_script( 'o2-editor', plugins_url( 'o2/js/editor/editor.js' ), array( 'jquery', 'o2-jquery-hotkeys', 'jquery.autoresize', 'o2-plugin-caret', 'o2-events' ) );
wp_enqueue_script( 'o2-editor', plugins_url( 'js/editor/editor.js', O2__FILE__ ), array( 'jquery', 'o2-jquery-hotkeys', 'jquery.autoresize', 'o2-plugin-caret', 'o2-events' ) );
}

function wp_footer() {
Expand Down
4 changes: 2 additions & 2 deletions inc/keyboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function __construct() {
}

public function register_scripts() {
wp_register_script( 'o2-hotkeys', plugins_url( 'o2/js/utils/jquery.hotkeys.js' ), array( 'jquery' ) );
wp_enqueue_script( 'o2-keyboard', plugins_url( 'o2/js/utils/keyboard.js' ), array( 'jquery' ) );
wp_register_script( 'o2-hotkeys', plugins_url( 'js/utils/jquery.hotkeys.js', O2__FILE__ ), array( 'jquery' ) );
wp_enqueue_script( 'o2-keyboard', plugins_url( 'js/utils/keyboard.js', O2__FILE__ ), array( 'jquery' ) );
}

public function help_link( $controls ) {
Expand Down
13 changes: 11 additions & 2 deletions inc/read-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ function o2_date_sort( $a, $b ) {
if ( isset( $_REQUEST['scripts'] ) ) {

// Parse and sanitize the script handles already output
$initial_scripts = isset( $_REQUEST['scripts'] ) && is_array( $_REQUEST['scripts'] ) ? array_map( 'sanitize_text_field', $_REQUEST['scripts'] ) : false;
if ( ! is_array( $_REQUEST['scripts'] ) ) {
$_REQUEST['scripts'] = explode( ',', $_REQUEST['scripts'] );
}

$initial_scripts = is_array( $_REQUEST['scripts'] ) ? array_map( 'sanitize_text_field', $_REQUEST['scripts'] ) : null;

if ( is_array( $initial_scripts ) ) {
global $wp_scripts;
Expand Down Expand Up @@ -167,8 +171,13 @@ function o2_date_sort( $a, $b ) {
// Attach styles
if ( isset( $_REQUEST['styles'] ) ) {

// Parse and sanitize the script handles already output
if ( ! is_array( $_REQUEST['styles'] ) ) {
$_REQUEST['styles'] = explode( ',', $_REQUEST['styles'] );
}

// Parse and sanitize the style handles already output
$initial_styles = isset( $_REQUEST['styles'] ) && is_array( $_REQUEST['styles'] ) ? array_map( 'sanitize_text_field', $_REQUEST['styles'] ) : false;
$initial_styles = is_array( $_REQUEST['styles'] ) ? array_map( 'sanitize_text_field', $_REQUEST['styles'] ) : null;

if ( is_array( $initial_styles ) ) {
global $wp_styles;
Expand Down
2 changes: 1 addition & 1 deletion inc/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public function tag_search() {
// translators: 'tag name (count)'
$label = sprintf( __( '%1$s (%2$s)', 'o2' ), $result->name, $result->count );

$count_posts = sprintf( _n( '1 post', '%s posts', $result->count ), number_format_i18n( $result->count ) );
$count_posts = sprintf( _n( '1 post', '%s posts', $result->count, 'o2' ), number_format_i18n( $result->count ) );

$tags[] = array(
'label' => $label, // @todo remove
Expand Down
2 changes: 1 addition & 1 deletion inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function o2_post_action_states_in_footer() {

if ( !function_exists( 'o2_post_actions_scripts' ) ) {
function o2_post_actions_scripts() {
wp_enqueue_script( 'jquery-actionstate', plugins_url( 'o2/js/utils/post-action-states.js' ), array( 'jquery' ) );
wp_enqueue_script( 'jquery-actionstate', plugins_url( 'js/utils/post-action-states.js', O2__FILE__ ), array( 'jquery' ) );
}

add_action( 'wp_enqueue_scripts', 'o2_post_actions_scripts' );
Expand Down
4 changes: 2 additions & 2 deletions inc/xposts.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,11 @@ function create_post( $_blog_id, $post, $tags = array(), $post_parent_id = 0 ) {
$post = get_post( $post->comment_post_ID );
$origin_post_id = $post->ID;
$x_permalink = get_comment_link( $comment->comment_ID );
$format = __( 'X-comment from %1$s: Comment on %2$s' );
$format = __( 'X-comment from %1$s: Comment on %2$s', 'o2' );
$author = $comment->user_id;
} else {
// It's a post
$format = __( 'X-post from %1$s: %2$s' );
$format = __( 'X-post from %1$s: %2$s', 'o2' );
$origin_post_id = $post->ID;
$x_permalink = get_permalink( $post->ID );
$author = $post->post_author;
Expand Down
Loading