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.
- Install PHP (OSX comes with it).
- Install NodeJS.
- Install composer.
```sh
$ curl -sS https://getcomposer.org/installer | php
@@ -20,6 +21,14 @@ $ php composer.phar install
```sh
$ php composer.phar install
```
- Instal NPM
```sh
$ npm install npm -g
```
- Install Stylus
```sh
$ npm install stylus -g
```
# Structure.
@@ -43,13 +52,4 @@ $subscriber = new \MailPoet\Models\Subscriber();
Acceptance and spec tests.
- /mailpoet.php
Kickstart file.
# Rules.
- Two spaces indentation, Ruby style.
- CamelCase for classes.
- snake_case for methods.
- Max line length at 80 chars.
- Composition over Inheritance.
- ...
Kickstart file.

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

View File

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

View File

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