Skip to content

Commit a73b586

Browse files
Resolve conflicts on merge
2 parents c8d2821 + e94c2c8 commit a73b586

17 files changed

Lines changed: 113 additions & 3 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ $RECYCLE.BIN/
1010

1111
vendor
1212
composer.lock
13-
nbproject
13+
nbproject
14+
15+
node_modules/

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,14 @@ a.google{color:#c0392b;font-weight:700;font-family:Verdana, 'Open Sans';font-siz
5757
<a href="http://Facebook.com" class="facebook" style="color: #8e44ad; margin: 300px;">Facebook</a>
5858
<a href="http://Outlook.com" id="outlook" style="color: #2980b9; padding: 50; position: absolute; top: 30px; left: 500px;">Outlook</a>
5959
```
60+
61+
### Or run it with node
62+
1. Install dependencies
63+
```js
64+
npm install
65+
```
66+
2. Run
67+
```js
68+
node index example myResult
69+
```
70+
A file myResult.html will be genereted in templates/example.

index.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
var request = require('request'),
2+
fs = require('fs'),
3+
myHost = 'http://cssinliner.dev/',
4+
myBody = null,
5+
myPath = null,
6+
myTemplatesPath = 'templates/',
7+
myOutput = 'output',
8+
myPrefix = '- ';
9+
10+
process.argv.forEach(
11+
function(val, index, array) {
12+
if(index == 2) myPath = val;
13+
if(index == 3) myOutput = val;
14+
}
15+
);
16+
17+
if(myPath != null){
18+
try {
19+
stats = fs.lstatSync(myTemplatesPath + myPath);
20+
if (stats.isDirectory()) {
21+
22+
request(myHost + myTemplatesPath + myPath + '/' + myPath + '.php',
23+
function(err, response, body) {
24+
25+
if(err) console.log(err);
26+
27+
myBody = body;
28+
console.log(myPrefix + 'Its works');
29+
30+
fs.writeFile(myTemplatesPath + myPath + '/' + myOutput + '.html', myBody,
31+
function(err) {
32+
if(err) {
33+
return console.log(err);
34+
}
35+
36+
console.log(myPrefix + 'The file was saved!');
37+
}
38+
);
39+
}
40+
);
41+
42+
}
43+
}catch (e){
44+
console.log(e);
45+
}
46+
}

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "CSSInliner",
3+
"description": "Simple PHP tools that inserts CSS from file into HTML tags.",
4+
"priavete": true,
5+
"dependencies": {
6+
"request": "~2.53.0"
7+
}
8+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

3-
require __DIR__ . '/../vendor/autoload.php';
4-
// require __DIR__ . '/../../../autoload.php';
3+
require __DIR__ . '/../../vendor/autoload.php';
54

65
use Northys\CSSInliner\CSSInliner;
76

File renamed without changes.

examples/images/newsletter_03_2014_profi_dj_02.jpg renamed to templates/example/images/newsletter_03_2014_profi_dj_02.jpg

File renamed without changes.

examples/images/newsletter_03_2014_profi_dj_03.jpg renamed to templates/example/images/newsletter_03_2014_profi_dj_03.jpg

File renamed without changes.

examples/images/newsletter_03_2014_profi_dj_04.jpg renamed to templates/example/images/newsletter_03_2014_profi_dj_04.jpg

File renamed without changes.

examples/images/newsletter_03_2014_profi_dj_05.jpg renamed to templates/example/images/newsletter_03_2014_profi_dj_05.jpg

File renamed without changes.

0 commit comments

Comments
 (0)