added src folders for assets css & js + added contributing doc + added install instructions for stylus

This commit is contained in:
Jonathan Labreuille
2015-07-15 20:03:05 +02:00
parent 71c367d9b0
commit 99ad7d66af
10 changed files with 76 additions and 58 deletions

9
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,9 @@
# Contributing
## Coding guidelines
- Two spaces indentation, Ruby style.
- CamelCase for classes.
- snake_case for methods & variables.
- Max line length at 80 chars.
- Composition over Inheritance.
- ...

View File

@@ -11,6 +11,7 @@ Not another MP2 a.k.a MP3 done the right way.
- Clone the repo in wp-content/plugins. - Clone the repo in wp-content/plugins.
- Install PHP (OSX comes with it). - Install PHP (OSX comes with it).
- Install NodeJS.
- Install composer. - Install composer.
```sh ```sh
$ curl -sS https://getcomposer.org/installer | php $ curl -sS https://getcomposer.org/installer | php
@@ -20,6 +21,14 @@ $ php composer.phar install
```sh ```sh
$ php composer.phar install $ php composer.phar install
``` ```
- Instal NPM
```sh
$ npm install npm -g
```
- Install Stylus
```sh
$ npm install stylus -g
```
# Structure. # Structure.
@@ -43,13 +52,4 @@ $subscriber = new \MailPoet\Models\Subscriber();
Acceptance and spec tests. Acceptance and spec tests.
- /mailpoet.php - /mailpoet.php
Kickstart file. Kickstart file.
# Rules.
- Two spaces indentation, Ruby style.
- CamelCase for classes.
- snake_case for methods.
- Max line length at 80 chars.
- Composition over Inheritance.
- ...

View File

@@ -1,23 +1,3 @@
/* clearfix */
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
overflow: hidden;
}
.clearfix {
display: inline-table;
}
* html .clearfix {
height: 1%;
}
.clearfix {
display: block;
}
/* hide scrollbars on background when a modal window is opened */ /* hide scrollbars on background when a modal window is opened */
body.mailpoet_modal_opened { body.mailpoet_modal_opened {
overflow: hidden; overflow: hidden;

View File

@@ -0,0 +1,19 @@
// clearfix
.clearfix:after
content: "."
display: block
height: 0
clear: both
visibility: hidden
overflow: hidden
.clearfix
display: inline-table
* html .clearfix
height: 1%
.clearfix
display: block
// colors

View File

@@ -0,0 +1,6 @@
body-color = invert(#333)
body-background = invert(#ccc)
body
color body-color
background-color: body-background

40
composer.lock generated
View File

@@ -67,22 +67,22 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "codeception/codeception", "name": "codeception/codeception",
"version": "2.1.0", "version": "2.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Codeception/Codeception.git", "url": "https://github.com/Codeception/Codeception.git",
"reference": "b5af3aac061ffaeb65ed023534b3c50558e90d07" "reference": "6c22380326421947fba0d6116c13a5c24d214adb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/b5af3aac061ffaeb65ed023534b3c50558e90d07", "url": "https://api.github.com/repos/Codeception/Codeception/zipball/6c22380326421947fba0d6116c13a5c24d214adb",
"reference": "b5af3aac061ffaeb65ed023534b3c50558e90d07", "reference": "6c22380326421947fba0d6116c13a5c24d214adb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"facebook/webdriver": "~0.4|~0.5", "facebook/webdriver": "~1.0",
"guzzlehttp/guzzle": ">=4.0|<7.0", "guzzlehttp/guzzle": ">=4.0|<7.0",
"guzzlehttp/psr7": "~1.0", "guzzlehttp/psr7": "~1.0",
"php": ">=5.4.0", "php": ">=5.4.0",
@@ -115,9 +115,7 @@
], ],
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": []
"dev-master": "2.1-dev"
}
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -145,7 +143,7 @@
"functional testing", "functional testing",
"unit testing" "unit testing"
], ],
"time": "2015-06-30 03:38:01" "time": "2015-07-14 11:24:17"
}, },
{ {
"name": "codeception/specify", "name": "codeception/specify",
@@ -274,36 +272,38 @@
}, },
{ {
"name": "facebook/webdriver", "name": "facebook/webdriver",
"version": "v0.6.0", "version": "1.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/facebook/php-webdriver.git", "url": "https://github.com/facebook/php-webdriver.git",
"reference": "2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5" "reference": "7cfa09f0a50b5e93087a9dc0eb669bc559eb9961"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/facebook/php-webdriver/zipball/2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5", "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/7cfa09f0a50b5e93087a9dc0eb669bc559eb9961",
"reference": "2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5", "reference": "7cfa09f0a50b5e93087a9dc0eb669bc559eb9961",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.19" "php": ">=5.3.19"
}, },
"require-dev": { "require-dev": {
"phpdocumentor/phpdocumentor": "2.*", "phpunit/phpunit": "4.6.*"
"phpunit/phpunit": "3.7.*" },
"suggest": {
"phpdocumentor/phpdocumentor": "2.*"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
"classmap": [ "psr-4": {
"lib/" "Facebook\\WebDriver\\": "lib/"
] }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"Apache-2.0" "Apache-2.0"
], ],
"description": "A php client for WebDriver", "description": "A PHP client for WebDriver",
"homepage": "https://github.com/facebook/php-webdriver", "homepage": "https://github.com/facebook/php-webdriver",
"keywords": [ "keywords": [
"facebook", "facebook",
@@ -311,7 +311,7 @@
"selenium", "selenium",
"webdriver" "webdriver"
], ],
"time": "2015-02-09 19:39:34" "time": "2015-06-09 17:06:08"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",

View File

@@ -9,8 +9,8 @@ class Initializer {
public $version; public $version;
public $shortname; public $shortname;
public $file; public $file;
public $dir; public $path;
public $assets_dir; public $assets_path;
public $assets_url; public $assets_url;
@@ -22,23 +22,26 @@ class Initializer {
$this->version = $params['version']; $this->version = $params['version'];
$this->shortname = 'mailpoet'; $this->shortname = 'mailpoet';
$this->file = $params['file']; $this->file = $params['file'];
$this->dir = (dirname($this->file)); $this->path = (dirname($this->file));
$this->assets_dir = $this->dir . '/assets'; $this->views_path = $this->path . '/views';
$this->assets_path = $this->path . '/assets';
$this->assets_url = plugins_url( $this->assets_url = plugins_url(
'/assets', '/assets',
$this->file $this->file
); );
$this->lib_dir = $this->dir .'/lib'; $this->lib_path = $this->path .'/lib';
// instantiate renderer // -------------------
// Template renderer
// -------------------
$this->renderer = new \Twig_Environment( $this->renderer = new \Twig_Environment(
new \Twig_Loader_Filesystem($this->dir . '/views'), new \Twig_Loader_Filesystem($this->views_path),
array( array(
// 'cache' => '/path/to/compilation_cache', // 'cache' => '/path/to/compilation_cache',
) )
); );
// renderer global variables // renderer: global variables
$this->renderer->addGlobal('assets_url', $this->assets_url); $this->renderer->addGlobal('assets_url', $this->assets_url);
register_activation_hook( register_activation_hook(

View File

@@ -1,5 +1,6 @@
<?php <?php
use \MailPoet\Config\Initializer; use \MailPoet\Config\Initializer;
if (!defined('ABSPATH')) exit; if (!defined('ABSPATH')) exit;
/* /*