diff --git a/README.txt b/README.txt index e9c6cda..761daf6 100644 --- a/README.txt +++ b/README.txt @@ -1,114 +1,25 @@ -=== Plugin Name === -Contributors: (this should be a list of wordpress.org userid's) -Donate link: http://example.com/ -Tags: comments, spam -Requires at least: 3.0.1 -Tested up to: 3.4 -Stable tag: 4.3 +=== Griddable === +Contributors: pixelgrade, euthelup +Tags: grid, preview, render, row, column +Requires at least: 4.6.1 +Tested up to: 4.6.1 +Stable tag: 4.6.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html -Here is a short description of the plugin. This should be no more than 150 characters. No markup here. +The Missing WordPress Grid Content Editor == Description == -This is the long description. No limit, and you can use Markdown (as well as in the following sections). - -For backwards compatibility, if this section is missing, the full length of the short description will be used, and -Markdown parsed. - -A few notes about the sections above: - -* "Contributors" is a comma separated list of wp.org/wp-plugins.org usernames -* "Tags" is a comma separated list of tags that apply to the plugin -* "Requires at least" is the lowest version that the plugin will work on -* "Tested up to" is the highest version that you've *successfully used to test the plugin*. Note that it might work on -higher versions... this is just the highest one you've verified. -* Stable tag should indicate the Subversion "tag" of the latest stable version, or "trunk," if you use `/trunk/` for -stable. - - Note that the `readme.txt` of the stable tag is the one that is considered the defining one for the plugin, so -if the `/trunk/readme.txt` file says that the stable tag is `4.3`, then it is `/tags/4.3/readme.txt` that'll be used -for displaying information about the plugin. In this situation, the only thing considered from the trunk `readme.txt` -is the stable tag pointer. Thus, if you develop in trunk, you can update the trunk `readme.txt` to reflect changes in -your in-development version, without having that information incorrectly disclosed about the current stable version -that lacks those changes -- as long as the trunk's `readme.txt` points to the correct stable tag. - - If no stable tag is provided, it is assumed that trunk is stable, but you should specify "trunk" if that's where -you put the stable version, in order to eliminate any doubt. +This plugin is taking the griding in WordPress to the next level. == Installation == -This section describes how to install the plugin and get it working. - -e.g. - -1. Upload `gridable.php` to the `/wp-content/plugins/` directory 1. Activate the plugin through the 'Plugins' menu in WordPress -1. Place `` in your templates - -== Frequently Asked Questions == - -= A question that someone might have = - -An answer to that question. - -= What about foo bar? = - -Answer to foo bar dilemma. - -== Screenshots == - -1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from -the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets -directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png` -(or jpg, jpeg, gif). -2. This is the second screen shot +2. Edit a post, page or a custom post type +3. Enjoy the "Add Row" button == Changelog == -= 1.0 = -* A change since the previous version. -* Another change. - -= 0.5 = -* List versions from most recent at top to oldest at bottom. - -== Upgrade Notice == - -= 1.0 = -Upgrade notices describe the reason a user should upgrade. No more than 300 characters. - -= 0.5 = -This version fixes a security related bug. Upgrade immediately. - -== Arbitrary section == - -You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated -plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or -"installation." Arbitrary sections will be shown below the built-in sections outlined above. - -== A brief Markdown Example == - -Ordered list: - -1. Some feature -1. Another feature -1. Something else about the plugin - -Unordered list: - -* something -* something else -* third thing - -Here's a link to [WordPress](http://wordpress.org/ "Your favorite software") and one to [Markdown's Syntax Documentation][markdown syntax]. -Titles are optional, naturally. - -[markdown syntax]: http://daringfireball.net/projects/markdown/syntax - "Markdown is what the parser uses to process much of the readme file" - -Markdown uses email style notation for blockquotes and I've been told: -> Asterisks for *emphasis*. Double it up for **strong**. - -`` \ No newline at end of file += 0.0.1 = +Plugin init diff --git a/admin/class-gridable-admin.php b/admin/class-gridable-admin.php index 2358fd6..8d9e9b6 100644 --- a/admin/class-gridable-admin.php +++ b/admin/class-gridable-admin.php @@ -3,7 +3,7 @@ /** * The admin-specific functionality of the plugin. * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable @@ -18,7 +18,7 @@ * * @package Gridable * @subpackage Gridable/admin - * @author Your Name + * @author PixelGrade */ class Gridable_Admin { @@ -83,8 +83,8 @@ function add_media_button( $editor_id ) { function wp_print_grider_tinymce_templates() { $row_classes = array( - 'pixcode', - 'pixcode--grid', + 'gridable', + 'gridable--grid', 'grid' ); $col_classes = array( diff --git a/admin/css/gridable-style.css b/admin/css/gridable-style.css new file mode 100644 index 0000000..ba67545 --- /dev/null +++ b/admin/css/gridable-style.css @@ -0,0 +1,18 @@ +/** All of the CSS for your public-facing functionality should be included in this file. */ +[data-gridable-row], .gridable--row { display: -ms-flexbox; display: flex; -ms-flex-flow: row wrap; flex-flow: row wrap; } + +[data-sh-col-attr-size], .gridable--col { -ms-flex: 0 0 100%; flex: 0 0 100%; } + +[data-sh-col-attr-size="2"], .hand-span-2 { -ms-flex-preferred-size: 16.66667%; flex-basis: 16.66667%; } + +[data-sh-col-attr-size="4"], .hand-span-4 { -ms-flex-preferred-size: 33.33333%; flex-basis: 33.33333%; } + +[data-sh-col-attr-size="6"], .hand-span-6 { -ms-flex-preferred-size: 50%; flex-basis: 50%; } + +[data-sh-col-attr-size="8"], .hand-span-8 { -ms-flex-preferred-size: 66.66667%; flex-basis: 66.66667%; } + +[data-sh-col-attr-size="10"], .hand-span-10 { -ms-flex-preferred-size: 83.33333%; flex-basis: 83.33333%; } + +[data-sh-col-attr-size="12"], .hand-span-12 { -ms-flex-preferred-size: 100%; flex-basis: 100%; } + +[data-sh-col-attr-size], .gridable--col { box-sizing: border-box; background: #EEE; padding: 10px; } diff --git a/admin/css/gridable-style.css.map b/admin/css/gridable-style.css.map new file mode 100644 index 0000000..7d2616f --- /dev/null +++ b/admin/css/gridable-style.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAAA,2FAGG;AAIH,mCAAoC,GACnC,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,QAAQ;;AAGpB,uCAAwC,GACvC,IAAI,EAAE,QAAQ;;AAId,yCAAwD,GACvD,UAAU,EAAE,SACb;;AAFA,yCAAwD,GACvD,UAAU,EAAE,SACb;;AAFA,yCAAwD,GACvD,UAAU,EAAE,GACb;;AAFA,yCAAwD,GACvD,UAAU,EAAE,SACb;;AAFA,2CAAwD,GACvD,UAAU,EAAE,SACb;;AAFA,2CAAwD,GACvD,UAAU,EAAE,IACb;;AAGD,uCAAwC,GACvC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE,IAAI", +"sources": ["../gridable-style.scss"], +"names": [], +"file": "gridable-style.css" +} \ No newline at end of file diff --git a/admin/partials/plugin-name-admin-display.php b/admin/partials/plugin-name-admin-display.php index 723cc83..d7ba3eb 100644 --- a/admin/partials/plugin-name-admin-display.php +++ b/admin/partials/plugin-name-admin-display.php @@ -5,7 +5,7 @@ * * This file is used to markup the admin-facing aspects of the plugin. * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable diff --git a/gridable.php b/gridable.php index eb45559..a3350d9 100644 --- a/gridable.php +++ b/gridable.php @@ -7,17 +7,17 @@ * registers the activation and deactivation functions, and defines a function * that starts the plugin. * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * @package Gridable * * @wordpress-plugin * Plugin Name: Gridable - * Plugin URI: http://example.com/gridable-uri/ - * Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area. - * Version: 1.0.0 - * Author: Your Name or Your Company - * Author URI: http://example.com/ + * Plugin URI: https://pixelgrade.com/ + * Description: The Missed Grid Content Editor + * Version: 0.0.1 + * Author: PixelGrade + * Author URI: https://pixelgrade.com/ * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Text Domain: gridable diff --git a/gulpfile.js b/gulpfile.js index 6effa9b..2930258 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -87,6 +87,11 @@ gulp.task( 'build', ['copy-folder'], function() { files_to_remove = [ '**/codekit-config.json', 'node_modules', + 'tests', + '.travis.yml', + 'circle.yml', + 'phpunit.xml.dist', + '.sass-cache', 'config.rb', 'gulpfile.js', 'package.json', diff --git a/includes/class-gridable-activator.php b/includes/class-gridable-activator.php index 8ee3890..7d5c82a 100644 --- a/includes/class-gridable-activator.php +++ b/includes/class-gridable-activator.php @@ -3,7 +3,7 @@ /** * Fired during plugin activation * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable @@ -18,7 +18,7 @@ * @since 1.0.0 * @package Gridable * @subpackage Gridable/includes - * @author Your Name + * @author PixelGrade */ class Gridable_Activator { diff --git a/includes/class-gridable-deactivator.php b/includes/class-gridable-deactivator.php index 7800943..576b122 100644 --- a/includes/class-gridable-deactivator.php +++ b/includes/class-gridable-deactivator.php @@ -3,7 +3,7 @@ /** * Fired during plugin deactivation * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable @@ -18,7 +18,7 @@ * @since 1.0.0 * @package Gridable * @subpackage Gridable/includes - * @author Your Name + * @author PixelGrade */ class Gridable_Deactivator { diff --git a/includes/class-gridable-i18n.php b/includes/class-gridable-i18n.php index 76577e3..9d62f7f 100644 --- a/includes/class-gridable-i18n.php +++ b/includes/class-gridable-i18n.php @@ -6,7 +6,7 @@ * Loads and defines the internationalization files for this plugin * so that it is ready for translation. * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable @@ -22,7 +22,7 @@ * @since 1.0.0 * @package Gridable * @subpackage Gridable/includes - * @author Your Name + * @author PixelGrade */ class Gridable_i18n { diff --git a/includes/class-gridable-loader.php b/includes/class-gridable-loader.php index 8884db1..b206be2 100644 --- a/includes/class-gridable-loader.php +++ b/includes/class-gridable-loader.php @@ -3,7 +3,7 @@ /** * Register all actions and filters for the plugin * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable @@ -19,7 +19,7 @@ * * @package Gridable * @subpackage Gridable/includes - * @author Your Name + * @author PixelGrade */ class Gridable_Loader { diff --git a/includes/class-gridable.php b/includes/class-gridable.php index 37544e4..6c7f834 100644 --- a/includes/class-gridable.php +++ b/includes/class-gridable.php @@ -6,7 +6,7 @@ * A class definition that includes attributes and functions used across both the * public-facing side of the site and the admin area. * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable @@ -25,7 +25,7 @@ * @since 1.0.0 * @package Gridable * @subpackage Gridable/includes - * @author Your Name + * @author PixelGrade */ class Gridable { @@ -171,10 +171,11 @@ private function define_public_hooks() { $plugin_public = new Gridable_Public( $this->get_gridable(), $this->get_version() ); - add_filter( 'gridable_sh_col_attr_size', array( $plugin_public, 'mce_sh_col_size_classes' ) ); +// add_filter( 'gridable_sh_col_attr_size', array( $plugin_public, 'mce_sh_col_size_classes' ) ); - add_shortcode( 'col', array( $plugin_public, 'add_column_shortcode' ) ); + add_action( 'wp_enqueue_scripts', array( $plugin_public, 'enqueue_styles' ) ); add_shortcode( 'row', array( $plugin_public, 'add_row_shortcode' ) ); + add_shortcode( 'col', array( $plugin_public, 'add_column_shortcode' ) ); } /** diff --git a/public/class-gridable-public.php b/public/class-gridable-public.php index 0e53bf3..962113d 100644 --- a/public/class-gridable-public.php +++ b/public/class-gridable-public.php @@ -3,7 +3,7 @@ /** * The public-facing functionality of the plugin. * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable @@ -18,7 +18,7 @@ * * @package Gridable * @subpackage Gridable/public - * @author Your Name + * @author PixelGrade */ class Gridable_Public { @@ -54,8 +54,8 @@ public function __construct( $gridable, $version ) { } public function add_row_shortcode( $atts, $content ) { ?> -
- +
+
-
- +
+
gridable, plugin_dir_url( __FILE__ ) . 'css/gridable-public.css', array(), $this->version, 'all' ); -// -// } + /** + * Register the stylesheets for the public-facing side of the site. + * + * @since 1.0.0 + */ + public function enqueue_styles() { + + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Gridable_Loader as all of the hooks are defined + * in that particular class. + * + * The Gridable_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + + wp_enqueue_style( $this->gridable, plugin_dir_url( __FILE__ ) . 'css/gridable-style.css', array(), $this->version, 'all' ); + + } // // /** // * Register the JavaScript for the public-facing side of the site. diff --git a/public/css/editor-style.css b/public/css/editor-style.css index 618677c..e1686f2 100644 --- a/public/css/editor-style.css +++ b/public/css/editor-style.css @@ -1 +1,21 @@ -.row { background: #ebebeb; } +.row.gridable-mceItem { background: #ebebeb; border: 1px dashed #bbb; padding: 5px; position: relative; } + +.col.gridable-mceItem { position: relative; background: #fefefe; border: 1px dashed #bbb; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } + +[data-gridable-row] { display: -ms-flexbox; display: flex; -ms-flex-flow: row wrap; flex-flow: row wrap; } + +[data-sh-col-attr-size] { -ms-flex: 0 0 100%; flex: 0 0 100%; } + +[data-sh-col-attr-size="2"] { -ms-flex-preferred-size: 16.66667%; flex-basis: 16.66667%; } + +[data-sh-col-attr-size="4"] { -ms-flex-preferred-size: 33.33333%; flex-basis: 33.33333%; } + +[data-sh-col-attr-size="6"] { -ms-flex-preferred-size: 50%; flex-basis: 50%; } + +[data-sh-col-attr-size="8"] { -ms-flex-preferred-size: 66.66667%; flex-basis: 66.66667%; } + +[data-sh-col-attr-size="10"] { -ms-flex-preferred-size: 83.33333%; flex-basis: 83.33333%; } + +[data-sh-col-attr-size="12"] { -ms-flex-preferred-size: 100%; flex-basis: 100%; } + +[data-sh-col-attr-size] { box-sizing: border-box; background: #EEE; padding: 10px; } diff --git a/public/css/editor-style.css.map b/public/css/editor-style.css.map index cea630f..bf28f1e 100644 --- a/public/css/editor-style.css.map +++ b/public/css/editor-style.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAAA,IAAK,GACJ,UAAU,EAAE,OAAO", +"mappings": "AAAA,qBAAsB,GACrB,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,QAAQ;;AAGnB,qBAAsB,GACrB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,eAAe,EAEvB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,UAAU,EAC3B,kBAAkB,EAAE,UAAU;;AAI/B,mBAAoB,GACnB,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,QAAQ;;AAGpB,uBAAwB,GACvB,IAAI,EAAE,QAAQ;;AAId,2BAAoC,GACnC,UAAU,EAAE,SACb;;AAFA,2BAAoC,GACnC,UAAU,EAAE,SACb;;AAFA,2BAAoC,GACnC,UAAU,EAAE,GACb;;AAFA,2BAAoC,GACnC,UAAU,EAAE,SACb;;AAFA,4BAAoC,GACnC,UAAU,EAAE,SACb;;AAFA,4BAAoC,GACnC,UAAU,EAAE,IACb;;AAGD,uBAAwB,GACvB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE,IAAI", "sources": ["../editor-style.scss"], "names": [], "file": "editor-style.css" diff --git a/public/css/gridable-style.css b/public/css/gridable-style.css index 833963f..ba67545 100644 --- a/public/css/gridable-style.css +++ b/public/css/gridable-style.css @@ -1 +1,18 @@ /** All of the CSS for your public-facing functionality should be included in this file. */ +[data-gridable-row], .gridable--row { display: -ms-flexbox; display: flex; -ms-flex-flow: row wrap; flex-flow: row wrap; } + +[data-sh-col-attr-size], .gridable--col { -ms-flex: 0 0 100%; flex: 0 0 100%; } + +[data-sh-col-attr-size="2"], .hand-span-2 { -ms-flex-preferred-size: 16.66667%; flex-basis: 16.66667%; } + +[data-sh-col-attr-size="4"], .hand-span-4 { -ms-flex-preferred-size: 33.33333%; flex-basis: 33.33333%; } + +[data-sh-col-attr-size="6"], .hand-span-6 { -ms-flex-preferred-size: 50%; flex-basis: 50%; } + +[data-sh-col-attr-size="8"], .hand-span-8 { -ms-flex-preferred-size: 66.66667%; flex-basis: 66.66667%; } + +[data-sh-col-attr-size="10"], .hand-span-10 { -ms-flex-preferred-size: 83.33333%; flex-basis: 83.33333%; } + +[data-sh-col-attr-size="12"], .hand-span-12 { -ms-flex-preferred-size: 100%; flex-basis: 100%; } + +[data-sh-col-attr-size], .gridable--col { box-sizing: border-box; background: #EEE; padding: 10px; } diff --git a/public/css/gridable-style.css.map b/public/css/gridable-style.css.map index 9dec9ed..7d2616f 100644 --- a/public/css/gridable-style.css.map +++ b/public/css/gridable-style.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAAA,2FAGG", +"mappings": "AAAA,2FAGG;AAIH,mCAAoC,GACnC,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,QAAQ;;AAGpB,uCAAwC,GACvC,IAAI,EAAE,QAAQ;;AAId,yCAAwD,GACvD,UAAU,EAAE,SACb;;AAFA,yCAAwD,GACvD,UAAU,EAAE,SACb;;AAFA,yCAAwD,GACvD,UAAU,EAAE,GACb;;AAFA,yCAAwD,GACvD,UAAU,EAAE,SACb;;AAFA,2CAAwD,GACvD,UAAU,EAAE,SACb;;AAFA,2CAAwD,GACvD,UAAU,EAAE,IACb;;AAGD,uCAAwC,GACvC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE,IAAI", "sources": ["../gridable-style.scss"], "names": [], "file": "gridable-style.css" diff --git a/public/partials/plugin-name-public-display.php b/public/partials/plugin-name-public-display.php index ae8b16c..f78d720 100644 --- a/public/partials/plugin-name-public-display.php +++ b/public/partials/plugin-name-public-display.php @@ -5,7 +5,7 @@ * * This file is used to markup the public-facing aspects of the plugin. * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable diff --git a/public/scss/gridable-style.scss b/public/scss/gridable-style.scss index 1c63bb7..b8a001b 100644 --- a/public/scss/gridable-style.scss +++ b/public/scss/gridable-style.scss @@ -5,22 +5,22 @@ // The Grid -[data-gridable-row] { +[data-gridable-row], .gridable--row { display: flex; flex-flow: row wrap; } -[data-sh-col-attr-size] { +[data-sh-col-attr-size], .gridable--col { flex: 0 0 100%; } @for $i from 1 through 6 { - [data-sh-col-attr-size="#{2*$i}"] { + [data-sh-col-attr-size="#{2*$i}"], .hand-span-#{2*$i} { flex-basis: percentage($i/6) } } -[data-sh-col-attr-size] { +[data-sh-col-attr-size], .gridable--col { box-sizing: border-box; background: #EEE; padding: 10px; diff --git a/uninstall.php b/uninstall.php index 80e2c57..aa70a6a 100644 --- a/uninstall.php +++ b/uninstall.php @@ -19,7 +19,7 @@ * For more information, see the following discussion: * https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913 * - * @link http://example.com + * @link https://pixelgrade.com * @since 1.0.0 * * @package Gridable