Merge pull request #1583 from lostdalek/frontendRefactoring

PHRAS-833
This commit is contained in:
Benoît Burnichon
2015-12-02 18:37:59 +01:00
1178 changed files with 15266 additions and 50760 deletions

View File

@@ -1,3 +1,3 @@
{ {
"directory" : "tmp-assets" "directory" : "www/bower_components"
} }

4
.gitignore vendored
View File

@@ -4,6 +4,7 @@
# Exclude javascript dependencies folder # Exclude javascript dependencies folder
/www/assets /www/assets
/www/bower_components
/tmp-assets /tmp-assets
# Exclude thumbnails folder # Exclude thumbnails folder
@@ -12,9 +13,6 @@
# Exclude node.js dependencies folder # Exclude node.js dependencies folder
/node_modules /node_modules
# Exclude compiled LESS folder
/www/skins/build
# Exclude compiled javascript test fixture folder # Exclude compiled javascript test fixture folder
/www/scripts/tests/fixtures /www/scripts/tests/fixtures

View File

@@ -19,6 +19,7 @@ services:
- memcached - memcached
- redis - redis
before_install: before_install:
- nvm install 0.12.0
- phpenv config-rm xdebug.ini - phpenv config-rm xdebug.ini
- composer self-update --no-progress --no-interaction - composer self-update --no-progress --no-interaction
- sudo apt-get purge elasticsearch - sudo apt-get purge elasticsearch
@@ -34,8 +35,6 @@ before_install:
install: install:
- travis_retry npm install - travis_retry npm install
- travis_retry composer install --optimize-autoloader --dev --prefer-source - travis_retry composer install --optimize-autoloader --dev --prefer-source
- travis_retry ./node_modules/.bin/grunt install-assets
- "./bin/developer assets:compile-less"
before_script: before_script:
- mysql -e 'CREATE DATABASE update39_test;CREATE DATABASE ab_test;CREATE DATABASE db_test;SET @@global.sql_mode=STRICT_ALL_TABLES;SET @@global.max_allowed_packet=33554432;SET @@global.wait_timeout=999999;' - mysql -e 'CREATE DATABASE update39_test;CREATE DATABASE ab_test;CREATE DATABASE db_test;SET @@global.sql_mode=STRICT_ALL_TABLES;SET @@global.max_allowed_packet=33554432;SET @@global.wait_timeout=999999;'
- "./bin/developer system:uninstall" - "./bin/developer system:uninstall"
@@ -51,7 +50,7 @@ before_script:
- "./bin/developer phraseanet:regenerate-sqlite" - "./bin/developer phraseanet:regenerate-sqlite"
- "./bin/developer phraseanet:generate-js-fixtures" - "./bin/developer phraseanet:generate-js-fixtures"
script: script:
- "./node_modules/.bin/grunt test" - "./node_modules/.bin/gulp test"
- | - |
if [ "$TEST_SUITE" = "1" ]; then if [ "$TEST_SUITE" = "1" ]; then
"./bin/phpunit" "tests/classes/"; "./bin/phpunit" "tests/classes/";

View File

@@ -1,438 +0,0 @@
module.exports = function(grunt) {
grunt.initConfig({
"pkg": grunt.file.readJSON("package.json"),
"path": {
"bower": "tmp-assets",
"asset": "www/assets"
},
mocha_phantomjs: {
options: {
'reporter': 'dot',
'setting': [
'loadImages=false'
]
},
all: [
'www/scripts/tests/*.html'
]
},
qunit: {
all: ['www/include/js/tests/*.html']
},
clean: {
"assets": ["<%= path.asset %>"],
"bower": ["<%= path.bower %>"]
},
bower: {
install: {
options: {
"copy": false
}
}
},
bower_postinst: {
dist: {
options: {
components: {
"bootstrap": ["npm", {"make": "bootstrap"}]
}
}
}
},
copy: {
"autobahn": {
"expand": true,
"src": [
"<%= path.bower %>/autobahn/index.js",
],
"dest": "<%= path.asset %>/autobahn/",
"flatten": true,
"rename": function(dest, src) {
return dest + "autobahn.js"
}
},
"backbone": {
"expand": true,
"src": [
"<%= path.bower %>/backbone-amd/LICENSE",
"<%= path.bower %>/backbone-amd/backbone.js"
],
"dest": "<%= path.asset %>/backbone-amd/",
"flatten": true
},
"fancytree": {
"expand": true,
"src": [
"dist/*",
"dist/**/*"
],
"cwd": "<%= path.bower %>/fancytree",
"dest": "<%= path.asset %>/fancytree/"
},
"blueimp": {
"expand": true,
"src": "js/load-image.js",
"dest": "<%= path.asset %>/blueimp-load-image/",
"cwd": "<%= path.bower %>/blueimp-load-image",
"flatten": true
},
"bootstrap": {
"expand": true,
"cwd": "<%= path.bower %>/bootstrap",
"src": [
"bootstrap/css/*",
"bootstrap/js/*",
"bootstrap/img/*",
"less/*.less",
"LICENSE"
],
"rename": function(dest, src) {
return dest + src.replace("bootstrap", "");
},
"dest": "<%= path.asset %>/bootstrap/"
},
"bootstrap-multiselect": {
"expand": true,
"cwd": "<%= path.bower %>/bootstrap-multiselect/dist",
"src": [
"css/bootstrap-multiselect.css",
"js/bootstrap-multiselect.js"
],
"dest": "<%= path.asset %>/bootstrap-multiselect/"
},
"chai": {
"expand": true,
"src": "<%= path.bower %>/chai/chai.js",
"dest": "<%= path.asset %>/chai/",
"flatten": true
},
"font-awesome": {
"expand": true,
"cwd": "<%= path.bower %>/font-awesome",
"src": ["css/*", "font/*"],
"dest": "<%= path.asset %>/font-awesome/"
},
"geonames-server-jquery-plugin": {
"expand": true,
"flatten": true,
"src": [
"<%= path.bower %>/geonames-server-jquery-plugin/LICENSE",
"<%= path.bower %>/geonames-server-jquery-plugin/jquery.geonames.js"
],
"dest": "<%= path.asset %>/geonames-server-jquery-plugin"
}
,
"humane-js": {
"expand": true,
"src": ["humane.js", "themes/libnotify.css"],
"dest": "<%= path.asset %>/humane-js/",
"cwd": "<%= path.bower %>/humane-js/"
},
"i18next": {
"expand": true,
"src": [
"<%= path.bower %>/i18next/release/i18next.amd-1.6.3.js",
"<%= path.bower %>/i18next/license"
],
"dest": "<%= path.asset %>/i18next/",
"flatten": true
},
"jquery": {
"expand": true,
"src": "<%= path.bower %>/jquery/jquery.js",
"dest": "<%= path.asset %>/jquery/",
"flatten": true
},
"jquery-galleria": {
"expand": true,
"src": [
"<%= path.bower %>/jquery-galleria/src/galleria.js",
"<%= path.bower %>/jquery-galleria/src/themes/classic/!(classic-demo.html)*",
"<%= path.bower %>/jquery-galleria/LICENSE"
],
"dest": "<%= path.asset %>/jquery-galleria/",
"flatten": true
},
"jquery-file-upload": {
"expand": true,
"src": [
"<%= path.bower %>/jquery-file-upload/js/vendor/*",
"<%= path.bower %>/jquery-file-upload/js/jquery.fileupload.js",
"<%= path.bower %>/jquery-file-upload/js/jquery.iframe-transport.js",
"<%= path.bower %>/jquery-file-upload/css/jquery.fileupload-ui.css"
],
"dest": "<%= path.asset %>/jquery-file-upload/",
"flatten": true
},
"jquery.treeview": {
"expand": true,
"cwd": "<%= path.bower %>/jquery.treeview",
"src": [
"images/*",
"jquery.treeview*"
],
"dest": "<%= path.asset %>/jquery.treeview/"
},
"jquery-mobile": {
"expand": true,
"cwd": "<%= path.bower %>/jquery-mobile-bower/",
"src": [
"images/*",
"css/jquery.mobile-1.3.2.css",
"js/jquery.mobile-1.3.2.js"
],
"flatten": true,
"dest": "<%= path.asset %>/jquery-mobile/"
},
"jquery.cookie": {
"expand": true,
"cwd": "<%= path.bower %>/jquery.cookie",
"src": [
"jquery.cookie.js"
],
"dest": "<%= path.asset %>/jquery.cookie/"
},
"jquery-ui": {
"expand": true,
"cwd": "<%= path.bower %>/jquery-ui",
"src": [
"ui/i18n/*",
"ui/*",
"themes/base/*",
"themes/base/images/*",
"MIT-LICENSE.txt"
],
"rename": function(dest, src) {
var dest = dest + src.replace("ui/", "/");
return dest.replace("themes/base/", "/")
},
"dest": "<%= path.asset %>/jquery.ui/"
},
"js-fixtures": {
"expand": true,
"src": [
"<%= path.bower %>/js-fixtures/LICENSE",
"<%= path.bower %>/js-fixtures/fixtures.js"
],
"dest": "<%= path.asset %>/js-fixtures/",
"flatten": true
},
"json2": {
"expand": true,
"src": "<%= path.bower %>/json2/json2.js",
"dest": "<%= path.asset %>/json2/",
"flatten": true
},
"mocha": {
"expand": true,
"src": [
"<%= path.bower %>/mocha/LICENSE",
"<%= path.bower %>/mocha/mocha.js",
"<%= path.bower %>/mocha/mocha.css"
],
"dest": "<%= path.asset %>/mocha/",
"flatten": true
},
"modernizr": {
"expand": true,
"src": "<%= path.bower %>/modernizr/modernizr.js",
"dest": "<%= path.asset %>/modernizr/",
"flatten": true
},
"normalize": {
"expand": true,
"src": [
"<%= path.bower %>/normalize-css/normalize.css",
"<%= path.bower %>/normalize-css/LICENSE.md"
],
"dest": "<%= path.asset %>/normalize-css/",
"flatten": true
},
"sinon-chai": {
"expand": true,
"src": [
"<%= path.bower %>/sinon-chai/lib/sinon-chai.js",
"<%= path.bower %>/sinon-chai/LICENCE.txt",
],
"dest": "<%= path.asset %>/sinon-chai/",
"flatten": true
},
"sinonjs": {
"expand": true,
"src": [
"<%= path.bower %>/sinonjs/sinon.js"
],
"dest": "<%= path.asset %>/sinonjs/",
"flatten": true
},
"squire": {
"expand": true,
"src": [
"<%= path.bower %>/squire/src/Squire.js",
"<%= path.bower %>/squire/LICENCE"
],
"dest": "<%= path.asset %>/squire/",
"flatten": true
},
"qunit": {
"expand": true,
"src": [
"qunit/qunit.css",
"qunit/qunit.js",
"addons/phantomjs/*"
],
"dest": "<%= path.asset %>/qunit/",
"cwd": "<%= path.bower %>/qunit/",
"rename": function(dest, src) {
return dest + src.replace("qunit", "");
}
},
"requirejs": {
"expand": true,
"src": [
"<%= path.bower %>/requirejs/LICENSE",
"<%= path.bower %>/requirejs/require.js"
],
"dest": "<%= path.asset %>/requirejs/",
"flatten": true
},
"swfobject": {
"expand": true,
"src": "<%= path.bower %>/swfobject/swfobject/swfobject.js",
"dest": "<%= path.asset %>/swfobject",
"flatten": true
},
"tinymce": {
"expand": true,
"cwd": "<%= path.bower %>/tinymce/",
"src": [
"plugins/**",
"skins/**",
"themes/**",
"*.js",
"changelog.txt",
"license.txt"
],
"dest": "<%= path.asset %>/tinymce"
},
"underscore": {
"expand": true,
"src": [
"<%= path.bower %>/underscore-amd/LICENSE",
"<%= path.bower %>/underscore-amd/underscore.js"
],
"dest": "<%= path.asset %>/underscore-amd/",
"flatten": true
},
"zxcvbn": {
"expand": true,
"src": [
"<%= path.bower %>/zxcvbn/LICENSE.txt",
"<%= path.bower %>/zxcvbn/zxcvbn-async.js"
],
"dest": "<%= path.asset %>/zxcvbn",
"flatten": true
}
},
csslint: {
options: {
// Possible Errors
"box-model": false,
"duplicate-properties": false,
"empty-rules": false,
"errors": false,
"known-properties": false,
"display-property-grouping": false,
"non-link-hover": false,
// Compatibility
"adjoining-classes": false,
"box-sizing": false,
"compatible-vendor-prefixes": false,
"gradients": false,
"text-indent": false,
"fallback-colors": false,
"vendor-prefix": false,
"star-property-hack": false,
"underscore-property-hack": false,
"bulletproof-font-face": false,
// Performance
"font-faces": false,
"regex-selectors": false,
"unqualified-attributes": false,
"universal-selector": false,
"zero-units": false,
"overqualified-elements": false,
"duplicate-background-images": false,
"import": false,
// Maintainability & Duplication
"important": false,
"floats": false,
"font-sizes": false,
"ids": false,
// Accessibility
"outline-none": false,
// OOCSS
"qualified-headings": false,
"unique-headings": false,
// Others
"shorthand": false
},
all: {
src: ['www/skins/**/*.css']
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks("grunt-bower-task");
grunt.loadNpmTasks("grunt-bower-postinst");
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.registerTask("copy-assets", [
"copy:autobahn",
"copy:backbone",
"copy:blueimp",
"copy:bootstrap",
"copy:bootstrap-multiselect",
"copy:chai",
"copy:font-awesome",
"copy:geonames-server-jquery-plugin",
"copy:humane-js",
"copy:i18next",
"copy:jquery",
"copy:jquery-galleria",
"copy:jquery-file-upload",
"copy:jquery-mobile",
"copy:jquery.cookie",
"copy:jquery-ui",
"copy:jquery.treeview",
"copy:json2",
"copy:js-fixtures",
"copy:fancytree",
"copy:modernizr",
"copy:normalize",
"copy:normalize",
"copy:qunit",
"copy:mocha",
"copy:requirejs",
"copy:sinon-chai",
"copy:sinonjs",
"copy:squire",
"copy:swfobject",
"copy:tinymce",
"copy:underscore",
"copy:zxcvbn"
]);
grunt.registerTask("install-assets", [
"clean:assets",
"bower",
"bower_postinst",
"copy-assets",
"clean:bower"
]);
// js fixtures should be present (./bin/developer phraseanet:generate-js-fixtures)
grunt.registerTask('test', ["qunit", "mocha_phantomjs"]);
};

View File

@@ -4,9 +4,7 @@ install:
php bin/console system:clear-cache php bin/console system:clear-cache
npm install npm install
composer install -o composer install -o
./node_modules/.bin/grunt install-assets
php bin/console system:clear-cache php bin/console system:clear-cache
php bin/developer assets:compile-less
config: config:
@php bin/console compile:configuration @php bin/console compile:configuration

View File

@@ -13,9 +13,7 @@ use Alchemy\Phrasea\CLI;
use Alchemy\Phrasea\Core\Version; use Alchemy\Phrasea\Core\Version;
use Alchemy\Phrasea\Command\Developer\APIRoutesDumper; use Alchemy\Phrasea\Command\Developer\APIRoutesDumper;
use Alchemy\Phrasea\Command\Developer\Behat; use Alchemy\Phrasea\Command\Developer\Behat;
use Alchemy\Phrasea\Command\Developer\BowerInstall;
use Alchemy\Phrasea\Command\Developer\ComposerInstall; use Alchemy\Phrasea\Command\Developer\ComposerInstall;
use Alchemy\Phrasea\Command\Developer\LessCompiler;
use Alchemy\Phrasea\Command\Developer\IniReset; use Alchemy\Phrasea\Command\Developer\IniReset;
use Alchemy\Phrasea\Command\Developer\InstallAll; use Alchemy\Phrasea\Command\Developer\InstallAll;
use Alchemy\Phrasea\Command\Developer\JsFixtures; use Alchemy\Phrasea\Command\Developer\JsFixtures;
@@ -71,13 +69,11 @@ $cli = new CLI("
$cli->command(new TranslationDumper()); $cli->command(new TranslationDumper());
$cli->command(new InstallAll()); $cli->command(new InstallAll());
$cli->command(new BowerInstall());
$cli->command(new ComposerInstall()); $cli->command(new ComposerInstall());
$cli->command(new RegenerateSqliteDb()); $cli->command(new RegenerateSqliteDb());
$cli->command(new APIRoutesDumper()); $cli->command(new APIRoutesDumper());
$cli->command(new RoutesDumper()); $cli->command(new RoutesDumper());
$cli->command(new Behat()); $cli->command(new Behat());
$cli->command(new LessCompiler());
$cli->command(new Uninstaller()); $cli->command(new Uninstaller());
$cli->command(new JsFixtures()); $cli->command(new JsFixtures());
$cli->command(new IniReset()); $cli->command(new IniReset());

View File

@@ -1,46 +1,44 @@
{ {
"name": "Phraseanet", "name": "Phraseanet",
"version": "3.9.0", "version": "4.0.0",
"dependencies": { "dependencies": {
"bootstrap": "2.3.2", "jquery": "~1.11.3",
"jquery": "~1.8.3", "jquery-ui": "~1.10.4",
"jquery-ui": "~1.10.0", "jquery-mobile-bower": "~1.3.0",
"jquery-mobile-bower": "~1.3.0", "underscore": "~1.4.4",
"underscore": "~1.4.4", "font-awesome": "~3.2.1",
"font-awesome": "~3.0.2", "modernizr": "~2.8.3",
"modernizr": "~2.6.2", "normalize-css": "~2.1.3",
"normalize-css": "~2.1.0", "json2": "latest",
"json2": "latest", "humane-js": "~3.0.6",
"humane-js": "~3.0.6", "jquery-file-upload": "~8.3.2",
"jquery-file-upload": "~8.3.2", "blueimp-load-image": "latest",
"blueimp-load-image": "latest", "requirejs": "~2.1",
"requirejs": "~2.1", "backbone-amd": "~1.0",
"backbone-amd": "~1.0", "underscore-amd": "~1.4",
"underscore-amd": "~1.4", "i18next": "~1.6",
"i18next": "~1.6", "bootstrap-multiselect": "v0.9",
"bootstrap-multiselect": "v0.9", "zxcvbn": "https://github.com/lowe/zxcvbn.git",
"zxcvbn": "https://github.com/lowe/zxcvbn.git", "geonames-server-jquery-plugin": "~0.2",
"geonames-server-jquery-plugin": "~0.2", "swfobject": "latest",
"swfobject": "latest", "tinymce": "~4.0",
"tinymce": "~4.0", "jquery-galleria": "1.2.9",
"jquery-galleria": "1.2.9", "jquery.cookie": "~1.4",
"jquery.cookie": "~1.4", "fancytree": "~2.7",
"autobahn": "http://autobahn.s3.amazonaws.com/js/autobahn.min.js", "bootstrap-sass": "v2.3.2.2",
"when": "~2.7.0", "jquery.lazyload": "~1.9.7",
"jquery.treeview": "1.4.1", "jquery-treeview": "~1.4.2"
"fancytree": "~2.7", },
"joyride": "https://github.com/zurb/joyride/archive/v2.0.0.zip" "devDependencies": {
}, "mocha": "latest",
"devDependencies": { "sinonjs": "~1.7.0",
"mocha": "latest", "chai": "~1.6",
"sinonjs": "~1.7.0", "squire": "~0",
"chai": "~1.6", "sinon-chai": "~2.5",
"squire": "~0", "qunit": "https://github.com/jquery/qunit.git#1.11.0",
"sinon-chai": "~2.5", "js-fixtures": "https://github.com/badunk/js-fixtures/archive/master.zip"
"qunit": "https://github.com/jquery/qunit.git#1.11.0", },
"js-fixtures": "https://github.com/badunk/js-fixtures/archive/master.zip" "resolutions": {
}, "jquery": "~1.11.3"
"resolutions": { }
"jquery": "1.8.3" }
}
}

View File

@@ -8,6 +8,8 @@ general:
machine: machine:
php: php:
version: 5.5.21 version: 5.5.21
node:
version: 0.12.0
services: services:
- memcached - memcached
- redis - redis
@@ -25,8 +27,6 @@ dependencies:
post: post:
- if [[ ! -e elasticsearch-1.6.0 ]]; then wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.tar.gz && tar -xvf elasticsearch-1.6.0.tar.gz && elasticsearch-1.6.0/bin/plugin install elasticsearch/elasticsearch-analysis-icu/2.6.0; fi - if [[ ! -e elasticsearch-1.6.0 ]]; then wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.tar.gz && tar -xvf elasticsearch-1.6.0.tar.gz && elasticsearch-1.6.0/bin/plugin install elasticsearch/elasticsearch-analysis-icu/2.6.0; fi
- elasticsearch-1.6.0/bin/elasticsearch: {background: true} - elasticsearch-1.6.0/bin/elasticsearch: {background: true}
- ./node_modules/.bin/grunt install-assets
- "./bin/developer assets:compile-less"
database: database:
@@ -42,5 +42,5 @@ database:
test: test:
override: override:
- case $CIRCLE_NODE_INDEX in 0) php -d memory_limit=-1 bin/phpunit --exclude-group legacy ;; 1) grunt test ;; 2) php -d memory_limit=-1 bin/phpunit --group legacy --exclude-group web ;; 3) php -d memory_limit=-1 bin/phpunit --group web ;; esac: - case $CIRCLE_NODE_INDEX in 0) php -d memory_limit=-1 bin/phpunit --exclude-group legacy ;; 1) ./node_modules/.bin/gulp test ;; 2) php -d memory_limit=-1 bin/phpunit --group legacy --exclude-group web ;; 3) php -d memory_limit=-1 bin/phpunit --group web ;; esac:
parallel: true parallel: true

View File

@@ -53,7 +53,6 @@ main:
ffprobe_binary: null ffprobe_binary: null
mp4box_binary: null mp4box_binary: null
pdftotext_binary: null pdftotext_binary: null
recess_binary: null
ffmpeg_timeout: 3600 ffmpeg_timeout: 3600
ffprobe_timeout: 60 ffprobe_timeout: 60
gs_timeout: 60 gs_timeout: 60

18
gulpfile.js Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
var gulp = require('gulp');
var wrench = require('wrench');
/**
* This will load all js or coffee files in the gulp directory
* in order to load all gulp tasks
*/
wrench.readdirSyncRecursive('./resources/gulp').filter(function(file) {
return (/\.(js)$/i).test(file);
}).map(function(file) {
require('./resources/gulp/' + file);
});
gulp.task('default', ['install-assets']);

View File

@@ -20,7 +20,6 @@ use Symfony\Component\Console;
use Alchemy\Phrasea\Core\CLIProvider\CLIDriversServiceProvider; use Alchemy\Phrasea\Core\CLIProvider\CLIDriversServiceProvider;
use Alchemy\Phrasea\Core\CLIProvider\ComposerSetupServiceProvider; use Alchemy\Phrasea\Core\CLIProvider\ComposerSetupServiceProvider;
use Alchemy\Phrasea\Core\CLIProvider\DoctrineMigrationServiceProvider; use Alchemy\Phrasea\Core\CLIProvider\DoctrineMigrationServiceProvider;
use Alchemy\Phrasea\Core\CLIProvider\LessBuilderServiceProvider;
use Alchemy\Phrasea\Core\CLIProvider\PluginServiceProvider; use Alchemy\Phrasea\Core\CLIProvider\PluginServiceProvider;
use Alchemy\Phrasea\Core\CLIProvider\SignalHandlerServiceProvider; use Alchemy\Phrasea\Core\CLIProvider\SignalHandlerServiceProvider;
use Alchemy\Phrasea\Core\CLIProvider\TaskManagerServiceProvider; use Alchemy\Phrasea\Core\CLIProvider\TaskManagerServiceProvider;
@@ -68,7 +67,6 @@ class CLI extends Application
$this->register(new PluginServiceProvider()); $this->register(new PluginServiceProvider());
$this->register(new ComposerSetupServiceProvider()); $this->register(new ComposerSetupServiceProvider());
$this->register(new CLIDriversServiceProvider()); $this->register(new CLIDriversServiceProvider());
$this->register(new LessBuilderServiceProvider());
$this->register(new SignalHandlerServiceProvider()); $this->register(new SignalHandlerServiceProvider());
$this->register(new TaskManagerServiceProvider()); $this->register(new TaskManagerServiceProvider());
$this->register(new TranslationExtractorServiceProvider()); $this->register(new TranslationExtractorServiceProvider());

View File

@@ -1,78 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Developer;
use Alchemy\Phrasea\Command\Command;
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
use Alchemy\Phrasea\Exception\RuntimeException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
use vierbergenlars\SemVer\version;
class BowerInstall extends Command
{
public function __construct()
{
parent::__construct('dependencies:bower');
$this
->setDescription('Installs bower dependencies')
->addOption('no-dev', 'd', InputOption::VALUE_NONE, 'Do not install dev dependencies')
->addOption('clear-cache', null, InputOption::VALUE_NONE, 'If defined forces to clear the cache before installation');
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$grunt = $this->container['driver.grunt'];
$grunt->getProcessBuilderFactory()->setTimeout(600);
$bower = $this->container['driver.bower'];
$output->writeln("Using <info>".$grunt->getProcessBuilderFactory()->getBinary()."</info> for driver");
$output->writeln("Using <info>".$bower->getProcessBuilderFactory()->getBinary()."</info> for driver");
$version = trim($bower->command('-v'));
if (version::lt($version, '1.0.0-alpha.1')) {
throw new RuntimeException(sprintf(
'Bower version 1.0.0-alpha.1 is required (version %s provided), please install bower-canary : `npm install -g bower-canary or run npm install from root directory`', $version
));
}
$version = trim($grunt->command('--version'));
if (!version_compare('0.4.0', substr($version, -5), '<=')) {
throw new RuntimeException(sprintf(
'Grunt version >= 0.4.0 is required (version %s provided), please install grunt `http://gruntjs.com/getting-started`', $version
));
}
if ($input->getOption('clear-cache')) {
$output->write("Cleaning bower cache... ");
$bower->command(['cache', 'clean']);
$output->writeln("<comment>OK</comment>");
}
try {
$output->write("Installing assets...");
$grunt->command('install-assets');
$output->write(" <comment>OK</comment>");
$output->writeln("");
$this->container['console']->get('assets:compile-less')->execute($input, $output);
} catch (ExecutionFailureException $e) {
throw new RuntimeException('Unable to install bower dependencies', $e->getCode(), $e);
}
return 0;
}
}

View File

@@ -34,7 +34,6 @@ class InstallAll extends Command
$ret = 0; $ret = 0;
$ret += $this->container['console']->get('dependencies:composer')->execute($input, $output); $ret += $this->container['console']->get('dependencies:composer')->execute($input, $output);
$ret += $this->container['console']->get('dependencies:bower')->execute($input, $output);
return min($ret, 255); return min($ret, 255);
} }

View File

@@ -1,45 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Developer;
use Alchemy\Phrasea\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* This command builds less file
*/
class LessCompiler extends Command
{
public function __construct()
{
parent::__construct('assets:compile-less');
$this->setDescription('Compiles Phraseanet LESS files');
}
/**
* {@inheritdoc}
*/
protected function doExecute(InputInterface $input, OutputInterface $output)
{
foreach ($this->container['phraseanet.less-assets'] as $source => $target) {
$this->container['filesystem']->mkdir(dirname($target));
$this->container['filesystem']->copy($source, $target);
}
$output->writeln('Building LESS assets');
$this->container['phraseanet.less-builder']->build($this->container['phraseanet.less-mapping'], $output);
return 0;
}
}

View File

@@ -1,45 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Developer\Utils;
use Alchemy\BinaryDriver\AbstractBinary;
use Alchemy\BinaryDriver\Configuration;
use Alchemy\BinaryDriver\ConfigurationInterface;
use Psr\Log\LoggerInterface;
class BowerDriver extends AbstractBinary
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'bower';
}
/**
* @param array|ConfigurationInterface $conf
* @param LoggerInterface $logger
*
* @return BowerDriver
*/
public static function create($conf = [], LoggerInterface $logger = null)
{
if (!$conf instanceof ConfigurationInterface) {
$conf = new Configuration($conf);
}
$binaries = $conf->get('bower.binaries', ['bower']);
return static::load($binaries, $logger, $conf);
}
}

View File

@@ -1,48 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Developer\Utils;
use Alchemy\BinaryDriver\AbstractBinary;
use Alchemy\BinaryDriver\Configuration;
use Alchemy\BinaryDriver\ConfigurationInterface;
use Psr\Log\LoggerInterface;
class GruntDriver extends AbstractBinary
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'grunt';
}
/**
* @param array|ConfigurationInterface $conf
* @param LoggerInterface $logger
*
* @return GruntDriver
*/
public static function create($conf = [], LoggerInterface $logger = null)
{
if (!$conf instanceof ConfigurationInterface) {
$conf = new Configuration($conf);
}
$binaries = $conf->get('grunt.binaries', ['grunt']);
$driver = static::load($binaries, $logger, $conf);
$driver->getProcessBuilderFactory()->getBuilder()->setWorkingDirectory(__DIR__.'/../../../../../..');
return $driver;
}
}

View File

@@ -1,45 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Developer\Utils;
use Alchemy\BinaryDriver\AbstractBinary;
use Psr\Log\LoggerInterface;
use Alchemy\BinaryDriver\Configuration;
use Alchemy\BinaryDriver\ConfigurationInterface;
class RecessDriver extends AbstractBinary
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'recess';
}
/**
* @param array|ConfigurationInterface $conf
* @param LoggerInterface $logger
*
* @return RecessDriver
*/
public static function create($conf = [], LoggerInterface $logger = null)
{
if (!$conf instanceof ConfigurationInterface) {
$conf = new Configuration($conf);
}
$binaries = $conf->get('recess.binaries', ['recess']);
return static::load($binaries, $logger, $conf);
}
}

View File

@@ -1,45 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Developer\Utils;
use Alchemy\BinaryDriver\AbstractBinary;
use Alchemy\BinaryDriver\Configuration;
use Alchemy\BinaryDriver\ConfigurationInterface;
use Psr\Log\LoggerInterface;
class UglifyJsDriver extends AbstractBinary
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'uglifyjs';
}
/**
* @param array|ConfigurationInterface $conf
* @param LoggerInterface $logger
*
* @return UglifyJsDriver
*/
public static function create($conf = [], LoggerInterface $logger = null)
{
if (!$conf instanceof ConfigurationInterface) {
$conf = new Configuration($conf);
}
$binaries = $conf->get('uglifyjs.binaries', ['uglifyjs']);
return static::load($binaries, $logger, $conf);
}
}

View File

@@ -50,9 +50,5 @@ abstract class AbstractPluginCommand extends Command
$output->write("Updating config files..."); $output->write("Updating config files...");
$this->container['plugins.autoloader-generator']->write($manifests); $this->container['plugins.autoloader-generator']->write($manifests);
$output->writeln(" <comment>OK</comment>"); $output->writeln(" <comment>OK</comment>");
$output->write('Building LESS assets ...');
$this->container['phraseanet.less-builder']->build($this->container['phraseanet.less-mapping.customizable']);
$output->writeln(" <comment>OK</comment>");
} }
} }

View File

@@ -311,7 +311,6 @@ class Install extends Command
'mp4box_binary' => $this->executableFinder->find('MP4Box'), 'mp4box_binary' => $this->executableFinder->find('MP4Box'),
'pdftotext_binary' => $this->executableFinder->find('pdftotext'), 'pdftotext_binary' => $this->executableFinder->find('pdftotext'),
'ghostscript_binary' => $this->executableFinder->find('gs'), 'ghostscript_binary' => $this->executableFinder->find('gs'),
'recess_binary' => $this->executableFinder->find('recess'),
]; ];
} }
} }

View File

@@ -37,7 +37,7 @@ class DataboxesController extends Controller
foreach ($sbasIds as $sbasId) { foreach ($sbasIds as $sbasId) {
$sbas[$sbasId] = [ $sbas[$sbasId] = [
'version' => 'unknown', 'version' => 'unknown',
'image' => '/skins/icons/db-remove.png', 'image' => '/assets/common/images/icons/db-remove.png',
'server_info' => '', 'server_info' => '',
'name' => $this->app->trans('Unreachable server') 'name' => $this->app->trans('Unreachable server')
]; ];
@@ -49,7 +49,7 @@ class DataboxesController extends Controller
$pdoConnection = $databox->get_connection()->getWrappedConnection(); $pdoConnection = $databox->get_connection()->getWrappedConnection();
$sbas[$sbasId] = [ $sbas[$sbasId] = [
'version' => $databox->get_version(), 'version' => $databox->get_version(),
'image' => '/skins/icons/foldph20close_0.gif', 'image' => '/assets/common/images/icons/foldph20close_0.gif',
'server_info' => $pdoConnection->getAttribute(\PDO::ATTR_SERVER_VERSION), 'server_info' => $pdoConnection->getAttribute(\PDO::ATTR_SERVER_VERSION),
'name' => \phrasea::sbas_labels($sbasId, $this->app) 'name' => \phrasea::sbas_labels($sbasId, $this->app)
]; ];

View File

@@ -323,7 +323,6 @@ class V1Controller extends Controller
'ffprobe' => isset($binaries['ffprobe_binary']) ? $binaries['ffprobe_binary'] : null, 'ffprobe' => isset($binaries['ffprobe_binary']) ? $binaries['ffprobe_binary'] : null,
'mp4box' => isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : null, 'mp4box' => isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : null,
'pdftotext' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null, 'pdftotext' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null,
'recess' => isset($binaries['recess_binary']) ? $binaries['recess_binary'] : null,
'pdfmaxpages' => $conf->get(['registry', 'executables', 'pdf-max-pages']), 'pdfmaxpages' => $conf->get(['registry', 'executables', 'pdf-max-pages']),
], ],
'mainConfiguration' => [ 'mainConfiguration' => [

View File

@@ -138,7 +138,7 @@ class QueryController extends Controller
$explain = "<div id=\"explainResults\" class=\"myexplain\">"; $explain = "<div id=\"explainResults\" class=\"myexplain\">";
$explain .= "<img src=\"/skins/icons/answers.gif\" /><span><b>"; $explain .= "<img src=\"/assets/common/images/icons/answers.gif\" /><span><b>";
if ($result->getTotal() != $result->getAvailable()) { if ($result->getTotal() != $result->getAvailable()) {
$explain .= $this->app->trans('reponses:: %available% Resultats rappatries sur un total de %total% trouves', ['available' => $result->getAvailable(), '%total%' => $result->getTotal()]); $explain .= $this->app->trans('reponses:: %available% Resultats rappatries sur un total de %total% trouves', ['available' => $result->getAvailable(), '%total%' => $result->getTotal()]);

View File

@@ -45,7 +45,7 @@ class RootController extends Controller
return $this->app->redirectPath('logout'); return $this->app->redirectPath('logout');
} }
$cssPath = $this->app['root.path'] . '/www/skins/prod/'; $cssPath = $this->app['root.path'] . '/www/assets/prod/skins';
$css = []; $css = [];

View File

@@ -169,7 +169,6 @@ class SetupController extends Controller
'ffmpeg_binary' => $request->request->get('binary_ffmpeg'), 'ffmpeg_binary' => $request->request->get('binary_ffmpeg'),
'mp4box_binary' => $request->request->get('binary_MP4Box'), 'mp4box_binary' => $request->request->get('binary_MP4Box'),
'pdftotext_binary' => $request->request->get('binary_xpdf'), 'pdftotext_binary' => $request->request->get('binary_xpdf'),
'recess_binary' => $request->request->get('binary_recess'),
] as $key => $path) { ] as $key => $path) {
$binaryData[$key] = $path; $binaryData[$key] = $path;
} }

View File

@@ -11,11 +11,7 @@
namespace Alchemy\Phrasea\Core\CLIProvider; namespace Alchemy\Phrasea\Core\CLIProvider;
use Alchemy\Phrasea\Command\Developer\Utils\BowerDriver;
use Alchemy\Phrasea\Command\Developer\Utils\ComposerDriver; use Alchemy\Phrasea\Command\Developer\Utils\ComposerDriver;
use Alchemy\Phrasea\Command\Developer\Utils\GruntDriver;
use Alchemy\Phrasea\Command\Developer\Utils\RecessDriver;
use Alchemy\Phrasea\Command\Developer\Utils\UglifyJsDriver;
use Alchemy\Phrasea\Exception\RuntimeException; use Alchemy\Phrasea\Exception\RuntimeException;
use Silex\Application; use Silex\Application;
use Silex\ServiceProviderInterface; use Silex\ServiceProviderInterface;
@@ -47,26 +43,6 @@ class CLIDriversServiceProvider implements ServiceProviderInterface
return $app['executable-finder']->find($name, null, $extraDirs); return $app['executable-finder']->find($name, null, $extraDirs);
}); });
$app['driver.bower'] = $app->share(function (Application $app) {
$bowerBinary = $app['driver.binary-finder']('bower', 'bower_binary');
if (null === $bowerBinary) {
throw new RuntimeException('Unable to find bower executable.');
}
return BowerDriver::create(['bower.binaries' => $bowerBinary, 'timeout' => 300], $app['monolog']);
});
$app['driver.recess'] = $app->share(function (Application $app) {
$recessBinary = $app['driver.binary-finder']('recess', 'recess_binary');
if (null === $recessBinary) {
throw new RuntimeException('Unable to find recess executable.');
}
return RecessDriver::create(['recess.binaries' => $recessBinary], $app['monolog']);
});
$app['driver.composer'] = $app->share(function (Application $app) { $app['driver.composer'] = $app->share(function (Application $app) {
$composerBinary = $app['driver.binary-finder']('composer', 'composer_binary'); $composerBinary = $app['driver.binary-finder']('composer', 'composer_binary');
@@ -76,26 +52,6 @@ class CLIDriversServiceProvider implements ServiceProviderInterface
return ComposerDriver::create(['composer.binaries' => $composerBinary, 'timeout' => 300], $app['monolog']); return ComposerDriver::create(['composer.binaries' => $composerBinary, 'timeout' => 300], $app['monolog']);
}); });
$app['driver.uglifyjs'] = $app->share(function (Application $app) {
$uglifyJsBinary = $app['driver.binary-finder']('uglifyjs', 'uglifyjs_binary');
if (null === $uglifyJsBinary) {
throw new RuntimeException('Unable to find uglifyJs executable.');
}
return UglifyJsDriver::create(['uglifyjs.binaries' => $uglifyJsBinary], $app['monolog']);
});
$app['driver.grunt'] = $app->share(function (Application $app) {
$gruntBinary = $app['driver.binary-finder']('grunt', 'grunt_binary');
if (null === $gruntBinary) {
throw new RuntimeException('Unable to find grunt executable.');
}
return GruntDriver::create(['grunt.binaries' => $gruntBinary], $app['monolog']);
});
} }
public function boot(Application $app) public function boot(Application $app)

View File

@@ -1,60 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Core\CLIProvider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Alchemy\Phrasea\Utilities\Less\Builder as LessBuilder;
use Alchemy\Phrasea\Utilities\Less\Compiler as LessCompiler;
class LessBuilderServiceProvider implements ServiceProviderInterface
{
public function register(Application $app)
{
$app['phraseanet.less-assets'] = $app->share(function ($app) {
return [
$app['root.path'] . '/www/assets/bootstrap/img/glyphicons-halflings-white.png' => $app['root.path'] . '/www/skins/build/bootstrap/img/glyphicons-halflings-white.png',
$app['root.path'] . '/www/assets/bootstrap/img/glyphicons-halflings.png' => $app['root.path'] . '/www/skins/build/bootstrap/img/glyphicons-halflings.png',
];
});
$app['phraseanet.less-mapping.base'] = $app->share(function ($app) {
return [];
});
$app['phraseanet.less-mapping.customizable'] = $app->share(function ($app) {
return [
$app['root.path'] . '/www/skins/login/less/login.less' => $app['root.path'] . '/www/assets/build/login.css',
$app['root.path'] . '/www/skins/account/less/account.less' => $app['root.path'] . '/www/assets/build/account.css',
];
});
$app['phraseanet.less-mapping'] = $app->share(function ($app) {
return array_merge(
$app['phraseanet.less-mapping.base'],
$app['phraseanet.less-mapping.customizable']
);
});
$app['phraseanet.less-compiler'] = $app->share(function ($app) {
return new LessCompiler($app['filesystem'], $app['driver.recess']);
});
$app['phraseanet.less-builder'] = $app->share(function ($app) {
return new LessBuilder($app['phraseanet.less-compiler'], $app['filesystem']);
});
}
public function boot(Application $app)
{
}
}

View File

@@ -110,25 +110,25 @@ class PhraseaExceptionHandler extends SymfonyExceptionHandler
switch ($exception->getStatusCode()) { switch ($exception->getStatusCode()) {
case 403: case 403:
$errorImg = '/skins/error-pages/403.png'; $errorImg = '/assets/common/images/error-pages/403.png';
break; break;
case 404: case 404:
$errorImg = '/skins/error-pages/404.png'; $errorImg = '/assets/common/images/error-pages/404.png';
break; break;
case 500: case 500:
$errorImg = '/skins/error-pages/500.png'; $errorImg = '/assets/common/images/error-pages/500.png';
break; break;
case 503: case 503:
$errorImg = '/skins/error-pages/503.png'; $errorImg = '/assets/common/images/error-pages/503.png';
break; break;
default: default:
$errorImg = '/skins/error-pages/error.png'; $errorImg = '/assets/common/images/error-pages/error.png';
break; break;
} }
return <<<EOF return <<<EOF
html { html {
background-image:url("/skins/error-pages/background.png"); background-image:url("/assets/common/images/error-pages/background.png");
background-repeat:repeat; background-repeat:repeat;
padding-top:0px; padding-top:0px;
} }

View File

@@ -30,8 +30,8 @@ class AutoloaderGenerator
->doWrite('services.php', $this->createServices($manifests)) ->doWrite('services.php', $this->createServices($manifests))
->doWrite('commands.php', $this->createCommands($manifests)) ->doWrite('commands.php', $this->createCommands($manifests))
->doWrite('twig-paths.php', $this->createTwigPathsMap($manifests)) ->doWrite('twig-paths.php', $this->createTwigPathsMap($manifests))
->doWrite('login.less', $this->createLoginLess($manifests)) ->doWrite('login.scss', $this->createLoginStylesheet($manifests))
->doWrite('account.less', $this->createAccountLess($manifests)); ->doWrite('account.scss', $this->createAccountStylesheet($manifests));
return $this; return $this;
} }
@@ -40,16 +40,16 @@ class AutoloaderGenerator
* @param Manifest[] $manifests * @param Manifest[] $manifests
* @return string * @return string
*/ */
private function createLoginLess($manifests) private function createLoginStylesheet($manifests)
{ {
$buffer = <<<EOF $buffer = <<<EOF
// This file is automatically generated, please do not edit it. // This file is automatically generated, please do not edit it.
EOF; EOF;
foreach ($manifests as $manifest) { foreach ($manifests as $manifest) {
$filepath = $this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'login.less'; $filepath = $this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'scss' . DIRECTORY_SEPARATOR . 'login.scss';
if (is_file($filepath)) { if (is_file($filepath)) {
$relativePath = $manifest->getName() . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'login.less'; $relativePath = $manifest->getName() . DIRECTORY_SEPARATOR . 'scss' . DIRECTORY_SEPARATOR . 'login.scss';
$buffer .= <<<EOF $buffer .= <<<EOF
@import "$relativePath"; @import "$relativePath";
@@ -64,16 +64,16 @@ EOF;
* @param Manifest[] $manifests * @param Manifest[] $manifests
* @return string * @return string
*/ */
private function createAccountLess($manifests) private function createAccountStylesheet($manifests)
{ {
$buffer = <<<EOF $buffer = <<<EOF
// This file is automatically generated, please do not edit it. // This file is automatically generated, please do not edit it.
EOF; EOF;
foreach ($manifests as $manifest) { foreach ($manifests as $manifest) {
$filepath = $this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'account.less'; $filepath = $this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'scss' . DIRECTORY_SEPARATOR . 'account.scss';
if (is_file($filepath)) { if (is_file($filepath)) {
$relativePath = $manifest->getName() . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'account.less'; $relativePath = $manifest->getName() . DIRECTORY_SEPARATOR . 'scss' . DIRECTORY_SEPARATOR . 'account.scss';
$buffer .= <<<EOF $buffer .= <<<EOF
@import "$relativePath"; @import "$relativePath";

View File

@@ -28,7 +28,6 @@ class BinariesProbe extends BinariesRequirements implements ProbeInterface
'pdftotext_binary' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null, 'pdftotext_binary' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null,
'ffmpeg_binary' => isset($binaries['ffmpeg_binary']) ? $binaries['ffmpeg_binary'] : null, 'ffmpeg_binary' => isset($binaries['ffmpeg_binary']) ? $binaries['ffmpeg_binary'] : null,
'ffprobe_binary' => isset($binaries['ffprobe_binary']) ? $binaries['ffprobe_binary'] : null, 'ffprobe_binary' => isset($binaries['ffprobe_binary']) ? $binaries['ffprobe_binary'] : null,
'recess_binary' => isset($binaries['recess_binary']) ? $binaries['recess_binary'] : null,
])); ]));
} }

View File

@@ -215,13 +215,5 @@ class BinariesRequirements extends RequirementCollection implements RequirementI
'FFProbe (or avprobe) is required for Video processing', 'FFProbe (or avprobe) is required for Video processing',
'Please install FFProbe (or avprobe)' 'Please install FFProbe (or avprobe)'
); );
$recess = isset($binaries['recess_binary']) ? $binaries['recess_binary'] : $finder->find('recess');
$this->addRecommendation(
null !== $recess && is_executable($recess),
'Recess is required for compiling css or less files.',
'Please install Recess (https://github.com/twitter/recess)'
);
} }
} }

View File

@@ -843,7 +843,7 @@ class ArchiveJob extends AbstractJob
if (!($rep = $node->getAttribute('grp_representation'))) { if (!($rep = $node->getAttribute('grp_representation'))) {
try { try {
$app['filesystem']->copy($app['root.path'] . '/www/skins/icons/substitution/regroup_doc.png', $genericdoc = ($path . '/group.jpg'), true); $app['filesystem']->copy($app['root.path'] . '/www/assets/common/images/icons/substitution/regroup_doc.png', $genericdoc = ($path . '/group.jpg'), true);
} catch (IOException $e) { } catch (IOException $e) {
$this->log('debug', $e->getMessage()); $this->log('debug', $e->getMessage());
} }

View File

@@ -187,7 +187,7 @@ class PhraseanetExtension extends \Twig_Extension
{ {
$src = $title = ''; $src = $title = '';
if ($record->isStory()) { if ($record->isStory()) {
$src = '/skins/icons/icon_story.gif'; $src = '/assets/common/images/icons/icon_story.gif';
$title = $this->app['translator']->trans('reportage'); $title = $this->app['translator']->trans('reportage');
return sprintf('<img src="%s" title="%s" />', $src, $title); return sprintf('<img src="%s" title="%s" />', $src, $title);
@@ -195,23 +195,23 @@ class PhraseanetExtension extends \Twig_Extension
switch ($record->getType()) { switch ($record->getType()) {
case 'image': case 'image':
$src = '/skins/icons/icon_image.png'; $src = '/assets/common/images/icons/icon_image.png';
$title = $this->app['translator']->trans('image'); $title = $this->app['translator']->trans('image');
break; break;
case 'document': case 'document':
$src = '/skins/icons/icon_document.png'; $src = '/assets/common/images/icons/icon_document.png';
$title = $this->app['translator']->trans('document'); $title = $this->app['translator']->trans('document');
break; break;
case 'video': case 'video':
$src = '/skins/icons/icon_video.png'; $src = '/assets/common/images/icons/icon_video.png';
$title = $this->app['translator']->trans('reportage'); $title = $this->app['translator']->trans('reportage');
break; break;
case 'audio': case 'audio':
$src = '/skins/icons/icon_audio.png'; $src = '/assets/common/images/icons/icon_audio.png';
$title = $this->app['translator']->trans('audio'); $title = $this->app['translator']->trans('audio');
break; break;
case 'flash': case 'flash':
$src = '/skins/icons/icon_flash.png'; $src = '/assets/common/images/icons/icon_flash.png';
$title = $this->app['translator']->trans('flash'); $title = $this->app['translator']->trans('flash');
break; break;
} }
@@ -249,7 +249,7 @@ class PhraseanetExtension extends \Twig_Extension
} }
} }
$path = sprintf('/skins/icons/substitution/%s.png', $path = sprintf('/assets/common/images/icons/substitution/%s.png',
str_replace('/', '_', $record->getMimeType()) str_replace('/', '_', $record->getMimeType())
); );

View File

@@ -1,52 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Utilities\Less;
use Alchemy\Phrasea\Utilities\Less\Compiler as LessCompiler;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
class Builder
{
/**
* @var LessCompiler
*/
protected $compiler;
/**
* @var Filesystem
*/
protected $filesystem;
public function __construct(LessCompiler $compiler, Filesystem $filesystem)
{
$this->compiler = $compiler;
$this->filesystem = $filesystem;
}
/**
* Build LESS files
*
* @param array $files
*
* @throws RuntimeException
*/
public function build($files, OutputInterface $output = null)
{
foreach ($files as $lessFile => $target) {
$this->filesystem->mkdir(dirname($target));
if (null !== $output) {
$output->writeln(" Building <info>" . basename($target) . "</info>... <comment>OK</comment>");
}
$this->compiler->compile($target, $lessFile);
}
}
}

View File

@@ -1,68 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Utilities\Less;
use Alchemy\Phrasea\Command\Developer\Utils\RecessDriver;
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
use Alchemy\Phrasea\Exception\RuntimeException;
use Symfony\Component\Filesystem\Filesystem;
class Compiler
{
private $filesystem;
private $recess;
public function __construct(Filesystem $filesystem, RecessDriver $recess)
{
$this->filesystem = $filesystem;
$this->recess = $recess;
}
/**
* Compile LESS files
*
* @param string $target
* @param string $files
*
* @throws RuntimeException
*/
public function compile($target, $files)
{
$this->filesystem->mkdir(dirname($target));
if (!$files instanceof \Traversable) {
$files = new \ArrayObject(is_array($files) ? $files : [$files]);
}
$files = (array) $files;
foreach ($files as $file) {
if (false === is_file($file)) {
throw new RuntimeException($file . ' does not exists.');
}
}
if (!is_writable(dirname($target))) {
throw new RuntimeException(dirname($target) . ' is not writable.');
}
$commands = $files;
array_unshift($commands, '--compile');
try {
$output = $this->recess->command($commands);
$this->filesystem->dumpFile($target, $output);
} catch (ExecutionFailureException $e) {
throw new RuntimeException('Could not execute recess command.', $e->getCode(), $e);
}
}
}

View File

@@ -108,7 +108,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
*/ */
public function get_icon_url() public function get_icon_url()
{ {
return '/skins/icons/dailymotion-small.gif'; return '/assets/common/images/icons/dailymotion-small.gif';
} }
/** /**
@@ -117,7 +117,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
*/ */
public function get_image_url() public function get_image_url()
{ {
return '/skins/icons/dailymotion-logo.png'; return '/assets/common/images/icons/dailymotion-logo.png';
} }
/** /**

View File

@@ -90,7 +90,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
*/ */
public function get_icon_url() public function get_icon_url()
{ {
return '/skins/icons/flickr-small.gif'; return '/assets/common/images/icons/flickr-small.gif';
} }
/** /**
@@ -99,7 +99,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
*/ */
public function get_image_url() public function get_image_url()
{ {
return '/skins/icons/flickr.gif'; return '/assets/common/images/icons/flickr.gif';
} }
/** /**

View File

@@ -93,7 +93,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
*/ */
public function get_icon_url() public function get_icon_url()
{ {
return '/skins/icons/youtube-small.gif'; return '/assets/common/images/icons/youtube-small.gif';
} }
/** /**
@@ -102,7 +102,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
*/ */
public function get_image_url() public function get_image_url()
{ {
return '/skins/icons/youtube-white.gif'; return '/assets/common/images/icons/youtube-white.gif';
} }
/** /**

View File

@@ -19,7 +19,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/user.png'; return '/assets/common/images/icons/user.png';
} }
/** /**

View File

@@ -19,7 +19,7 @@ class eventsmanager_notify_bridgeuploadfail extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/user.png'; return '/assets/common/images/icons/user.png';
} }
/** /**

View File

@@ -22,7 +22,7 @@ class eventsmanager_notify_downloadmailfail extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/user.png'; return '/assets/common/images/icons/user.png';
} }
/** /**

View File

@@ -19,7 +19,7 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/rss16.png'; return '/assets/common/images/icons/rss16.png';
} }
/** /**

View File

@@ -19,7 +19,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/user.png'; return '/assets/common/images/icons/user.png';
} }
/** /**

View File

@@ -26,7 +26,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/prod/000000/images/disktt_history.png'; return '/assets/common/images/icons/disktt_history.png';
} }
/** /**

View File

@@ -24,7 +24,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
public function icon_url() public function icon_url()
{ {
return '/skins/prod/000000/images/disktt_history.png'; return '/assets/common/images/icons/disktt_history.png';
} }
public function datas(array $data, $unread) public function datas(array $data, $unread)

View File

@@ -19,7 +19,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/push16.png'; return '/assets/common/images/icons/push16.png';
} }
/** /**

View File

@@ -19,7 +19,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/user.png'; return '/assets/common/images/icons/user.png';
} }
/** /**

View File

@@ -26,7 +26,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/push16.png'; return '/assets/common/images/icons/push16.png';
} }
/** /**

View File

@@ -26,7 +26,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/push16.png'; return '/assets/common/images/icons/push16.png';
} }
/** /**

View File

@@ -26,7 +26,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
*/ */
public function icon_url() public function icon_url()
{ {
return '/skins/icons/push16.png'; return '/assets/common/images/icons/push16.png';
} }
/** /**

View File

@@ -280,9 +280,9 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->mime = 'image/png'; $this->mime = 'image/png';
$this->width = 256; $this->width = 256;
$this->height = 256; $this->height = 256;
$this->path = $this->app['root.path'] . '/www/skins/icons/substitution/'; $this->path = $this->app['root.path'] . '/www/assets/common/images/icons/substitution/';
$this->file = 'regroup_thumb.png'; $this->file = 'regroup_thumb.png';
$this->url = Url::factory('/skins/icons/substitution/regroup_thumb.png'); $this->url = Url::factory('/assets/common/images/icons/substitution/regroup_thumb.png');
} else { } else {
$mime = $this->record->get_mime(); $mime = $this->record->get_mime();
$mime = trim($mime) != '' ? str_replace('/', '_', $mime) : 'application_octet-stream'; $mime = trim($mime) != '' ? str_replace('/', '_', $mime) : 'application_octet-stream';
@@ -290,17 +290,17 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->mime = 'image/png'; $this->mime = 'image/png';
$this->width = 256; $this->width = 256;
$this->height = 256; $this->height = 256;
$this->path = $this->app['root.path'] . '/www/skins/icons/substitution/'; $this->path = $this->app['root.path'] . '/www/assets/common/images/icons/substitution/';
$this->file = str_replace('+', '%20', $mime) . '.png'; $this->file = str_replace('+', '%20', $mime) . '.png';
$this->url = Url::factory('/skins/icons/substitution/' . $this->file); $this->url = Url::factory('/assets/common/images/icons/substitution/' . $this->file);
} }
$this->is_physically_present = false; $this->is_physically_present = false;
if ( ! file_exists($this->path . $this->file)) { if ( ! file_exists($this->path . $this->file)) {
$this->path = $this->app['root.path'] . '/www/skins/icons/'; $this->path = $this->app['root.path'] . '/www/assets/common/images/icons/';
$this->file = 'substitution.png'; $this->file = 'substitution.png';
$this->url = Url::factory('/skins/icons/' . $this->file); $this->url = Url::factory('/assets/common/images/icons/' . $this->file);
} }
return $this; return $this;

View File

@@ -59,10 +59,6 @@ class setup
'name' => 'FFmpeg', 'name' => 'FFmpeg',
'binary' => $finder->find('ffmpeg') 'binary' => $finder->find('ffmpeg')
], ],
'recess' => [
'name' => 'Recesss',
'binary' => $finder->find('recess')
],
]; ];
} }
} }

View File

@@ -53,7 +53,6 @@ main:
ffprobe_binary: null ffprobe_binary: null
mp4box_binary: null mp4box_binary: null
pdftotext_binary: null pdftotext_binary: null
recess_binary: null
ffmpeg_timeout: 3600 ffmpeg_timeout: 3600
ffprobe_timeout: 60 ffprobe_timeout: 60
gs_timeout: 60 gs_timeout: 60

View File

@@ -8,148 +8,6 @@
* You may wish to use the Minify URI Builder app to suggest * You may wish to use the Minify URI Builder app to suggest
* changes. http://yourdomain/min/builder/ * changes. http://yourdomain/min/builder/
* */ * */
$groups = [ $groups = [];
'account' => [
'//include/jslibs/jquery.contextmenu_scroll.js',
'//assets/jquery.cookie/jquery.cookie.js',
'//include/jquery.common.js',
'//assets/requirejs/require.js',
'//skins/account/account.js'
],
'authentication_css' => [
'//assets/normalize-css/normalize.css',
'//assets/build/login.css',
'//assets/font-awesome/css/font-awesome.css',
'//assets/jquery.ui/jquery.ui.autocomplete.css'
],
'authentication' => [
'//assets/modernizr/modernizr.js',
'//assets/requirejs/require.js',
'//scripts/apps/login/home/config.js'
],
'client' => [
'//assets/swfobject/swfobject.js'
, '//assets/jquery.ui/i18n/jquery-ui-i18n.js'
, '//assets/jquery.cookie/jquery.cookie.js'
, '//include/jquery.common.js'
, '//assets/json2/json2.js'
, '//include/jslibs/audio-player/audio-player-noswfobject.js'
, '//include/jslibs/jquery.form.2.49.js'
, '//skins/prod/jquery.Dialog.js'
, '//skins/client/jquery.p4client.1.0.js'
, '//include/jquery.tooltip.js'
, '//include/jquery.p4.preview.js'
, '//include/jquery.image_enhancer.js'
, '//include/jslibs/jquery.contextmenu_scroll.js'],
'admin' => [
'//assets/modernizr/modernizr.js'
, '//assets/underscore-amd/underscore.js'
, '//assets/jquery.cookie/jquery.cookie.js'
, '//assets/jquery.treeview/jquery.treeview.js'
, '//assets/jquery.ui/i18n/jquery-ui-i18n.js'
, '//include/jquery.kb-event.js'
, '//skins/admin/template-dialogs.js'
, '//include/jquery.common.js'
, '//include/jquery.tooltip.js'
, '//skins/prod/jquery.Dialog.js'
, '//include/jslibs/jquery.contextmenu_scroll.js'
, '//assets/blueimp-load-image/load-image.js'
, '//assets/jquery-file-upload/jquery.iframe-transport.js'
, '//assets/jquery-file-upload/jquery.fileupload.js'
],
'report' => [
'//assets/jquery.ui/i18n/jquery-ui-i18n.js'
, '//assets/jquery.cookie/jquery.cookie.js'
, '//include/jquery.common.js'
, '//include/jquery.tooltip.js'
, '//include/jslibs/jquery.contextmenu_scroll.js'
, '//include/jslibs/jquery.print.js'
, '//include/jslibs/jquery.cluetip.js'
, '//include/jquery.nicoslider.js'
, '//skins/report/report.js'
],
'modalBox' => [
'//assets/jquery.ui/i18n/jquery-ui-i18n.js'
],
'prod' => [
'//assets/swfobject/swfobject.js'
, '//assets/underscore-amd/underscore.js'
, '//assets/json2/json2.js'
, '//include/jslibs/colorpicker/js/colorpicker.js'
, '//include/jslibs/jquery.mousewheel.js'
, '//include/jslibs/jquery.lazyload/jquery.lazyload.1.8.1.js'
, '//assets/jquery.ui/i18n/jquery-ui-i18n.js'
, '//assets/jquery.cookie/jquery.cookie.js'
, '//include/jquery.common.js'
, '//assets/humane-js/humane.js'
, '//assets/blueimp-load-image/load-image.js'
, '//assets/jquery-file-upload/jquery.iframe-transport.js'
, '//assets/jquery-file-upload/jquery.fileupload.js'
, '//include/jslibs/jquery.form.2.49.js'
, '//include/jslibs/jquery.vertical.buttonset.js'
, '//include/js/jquery.Selection.js'
, '//include/js/jquery.Edit.js'
, '//include/js/jquery.lists.js'
, '//skins/prod/jquery.Prod.js'
, '//skins/prod/jquery.Dialog.js'
, '//skins/prod/jquery.Feedback.js'
, '//skins/prod/jquery.Results.js'
, '//skins/prod/jquery.main-prod.js'
, '//skins/prod/jquery.WorkZone.js'
, '//skins/prod/jquery.Alerts.js'
, '//skins/prod/jquery.Upload.js'
, '//include/jslibs/pixastic.custom.js'
, '//skins/prod/ThumbExtractor.js'
, '//skins/prod/publicator.js'
, '//include/jslibs/jquery.sprintf.1.0.3.js'
, '//include/jquery.tooltip.js'
, '//include/jslibs/flowplayer/flowplayer-3.2.13.min.js'
, '//include/jquery.p4.preview.js'
, '//skins/prod/jquery.edit.js'
, '//include/jslibs/jquery.color.animation.js'
, '//include/jquery.image_enhancer.js'
, '//include/jslibs/jquery.contextmenu_scroll.js'
, '//assets/jquery.treeview/jquery.treeview.js'
, '//assets/jquery.treeview/jquery.treeview.async.js'
, '//assets/requirejs/require.js'
],
'thesaurus' => [
'//assets/jquery.cookie/jquery.cookie.js'
, '//include/jslibs/jquery.contextmenu_scroll.js'
, '//include/jquery.common.js'
, '//skins/thesaurus/win.js'
, '//skins/thesaurus/xmlhttp.js'
, '//skins/thesaurus/thesaurus.js'
, '//skins/thesaurus/sprintf.js'
],
'lightbox' => [
'//include/jslibs/jquery.mousewheel.js'
, '//include/jquery.tooltip.js'
, '//assets/swfobject/swfobject.js'
, '//assets/jquery.ui/i18n/jquery-ui-i18n.js'
, '//assets/jquery.cookie/jquery.cookie.js'
, '//include/jslibs/jquery.contextmenu_scroll.js'
, '//include/jquery.common.js'
, '//skins/prod/jquery.Dialog.js'
, '//skins/lightbox/jquery.lightbox.js'
, '//include/jslibs/flowplayer/flowplayer-3.2.13.min.js'
],
'lightboxie6' => [
'//include/jslibs/jquery.mousewheel.js'
, '//include/jquery.tooltip.js'
, '//assets/swfobject/swfobject.js'
, '//assets/jquery.ui/i18n/jquery-ui-i18n.js'
, '//assets/jquery.cookie/jquery.cookie.js'
, '//include/jslibs/jquery.contextmenu_scroll.js'
, '//include/jquery.common.js'
, '//skins/prod/jquery.Dialog.js'
, '//skins/lightbox/jquery.lightbox.ie6.js'
, '//include/jslibs/flowplayer/flowplayer-3.2.13.min.js'
],
'uploadflash' => [
'//include/jslibs/SWFUpload/swfupload.js'
, '//include/jslibs/SWFUpload/plugins/swfupload.queue.js'
]
];
return $groups; return $groups;

View File

@@ -3,19 +3,33 @@
"version": "4.0.0", "version": "4.0.0",
"devDependencies": { "devDependencies": {
"bower": "~1.3", "bower": "~1.3",
"grunt": "~0.4.1", "bower-files": "^3.11.3",
"grunt-bower-postinst": "~0.2.0", "browser-sync": "^2.10.0",
"grunt-bower-task": "~0.4.0", "del": "^2.1.0",
"grunt-cli": "latest", "fs": "0.0.2",
"grunt-contrib-clean": "^0.6.0", "gulp": "^3.9.0",
"grunt-contrib-copy": "^0.8.2", "gulp-autoprefixer": "^3.1.0",
"grunt-contrib-qunit": "^0.7.0", "gulp-concat": "^2.6.0",
"grunt-mocha-phantomjs": "~0.3.0", "gulp-concat-util": "^0.5.4",
"grunt-shell": "~0.6", "gulp-cssmin": "^0.1.7",
"gulp-debug": "^2.1.2",
"gulp-install": "^0.6.0",
"gulp-qunit": "^1.2.1",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.1.0",
"gulp-uglify": "^1.4.2",
"gulp-util": "^3.0.7",
"gulp-watch": "^4.3.5",
"jake": "latest", "jake": "latest",
"mocha-phantomjs": ">=2.0 <3.0", "path": "^0.12.7",
"recess": ">=1.1.0 <1.1.7",
"tmp": "0.0.23", "tmp": "0.0.23",
"uglify-js": "latest" "wrench": "^1.5.8"
},
"engines" : {
"node" : ">=0.12"
},
"scripts": {
"build": "./node_modules/.bin/gulp build;",
"postinstall": "./node_modules/.bin/gulp install;"
} }
} }

View File

@@ -1 +0,0 @@
// This file is automatically generated, please do not edit it.

View File

@@ -1 +0,0 @@
// This file is automatically generated, please do not edit it.

50
resources/gulp/build.js Normal file
View File

@@ -0,0 +1,50 @@
var gulp = require('gulp');
var util = require('gulp-util');
var config = require('./config.js');
var debug = require('gulp-debug');
var fs = require('fs');
var utils = require('./utils.js');
gulp.task('build', ['build-vendors'], function(){
gulp.start('build-common');
gulp.start('build-oauth');
gulp.start('build-prod');
gulp.start('build-thesaurus');
gulp.start('build-uploadFlash');
gulp.start('build-lightbox');
gulp.start('build-admin');
gulp.start('build-report');
gulp.start('build-account');
gulp.start('build-permaview');
gulp.start('build-setup');
gulp.start('build-authentication');
});
// standalone vendors used across application
gulp.task('build-vendors', [
'build-bootstrap',
'build-colorpicker',
'build-jquery',
'build-jquery-ui', // will build themes too
'build-jquery-mobile',
'build-jquery-galleria',
'build-jquery-file-upload',
// 'build-jquery-image-enhancer', //bundled in prod only
'build-json2',
'build-modernizr',
'build-zxcvbn',
'build-tinymce',
'build-backbone',
'build-i18next',
'build-bootstrap-multiselect',
'build-blueimp-load-image',
'build-geonames-server-jquery-plugin',
'build-jquery-cookie',
'build-requirejs',
'build-jquery-treeview',
'build-jquery-lazyload',
'build-jquery-test-paths'
], function() {});

View File

@@ -0,0 +1,37 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-account-images', function(){
return gulp.src([config.paths.src + 'account/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'account/images'));
});
gulp.task('build-account-css', function(){
return utils.buildCssGroup([
config.paths.src + 'account/styles/main.scss'
], 'account', 'account/css/', debugMode);
});
gulp.task('build-account-js', function(){
var accountGroup = [
config.paths.vendors + 'requirejs/require.js',
config.paths.src + 'account/js/account.js'
];
return utils.buildJsGroup(accountGroup, 'account', 'account/js', debugMode);
});
gulp.task('watch-account-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'account/**/*.js', ['build-account-js']);
});
gulp.task('watch-account-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'account/**/*.scss', ['build-account-css']);
});
gulp.task('build-account', ['copy-account-images', 'build-account-css'], function(){
debugMode = false;
return gulp.start('build-account-js');
});

View File

@@ -0,0 +1,45 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-admin-images', function(){
return gulp.src([config.paths.src + 'admin/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'admin/images'));
});
gulp.task('build-admin-css', function(){
return utils.buildCssGroup([
config.paths.src + 'admin/styles/main.scss'
], 'admin', 'admin/css/', debugMode);
});
gulp.task('build-admin-js', function(){
var adminGroup = [
config.paths.vendors + 'underscore-amd/underscore.js',
config.paths.vendors + 'jquery-treeview/jquery.treeview.js',
// config.paths.vendors + 'jquery-file-upload/js/vendor/jquery.ui.widget.js',
// config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js',
// config.paths.vendors + 'jquery-file-upload/js/jquery.fileupload.js',
config.paths.src + 'admin/js/jquery.kb-event.js',
config.paths.src + 'admin/js/template-dialogs.js',
config.paths.vendors + 'requirejs/require.js',
config.paths.dist + 'scripts/apps/admin/require.config.js',
config.paths.dist + 'scripts/apps/admin/main/main.js'
];
utils.buildJsGroup(adminGroup, 'admin', 'admin/js', debugMode);
});
gulp.task('watch-admin-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'admin/**/*.js', ['build-admin-js']);
});
gulp.task('watch-admin-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'admin/**/*.scss', ['build-admin-css']);
});
gulp.task('build-admin', ['copy-admin-images', 'build-admin-css'], function(){
debugMode = false;
return gulp.start('build-admin-js');
});

View File

@@ -0,0 +1,37 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-authentication-images', function(){
return gulp.src([config.paths.src + 'authentication/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'authentication/images'));
});
gulp.task('build-authentication-css', function(){
return utils.buildCssGroup([
config.paths.src + 'authentication/styles/main.scss'
], 'authentication', 'authentication/css/', debugMode);
});
gulp.task('build-authentication-js', function(){
var authenticationGroup = [
config.paths.vendors + 'requirejs/require.js',
config.paths.dist + 'scripts/apps/login/home/config.js'
];
return utils.buildJsGroup(authenticationGroup, 'authentication', 'authentication/js', debugMode);
});
gulp.task('watch-authentication-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'authentication/**/*.js', ['build-authentication-js']);
});
gulp.task('watch-authentication-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'authentication/**/*.scss', ['build-authentication-css']);
});
gulp.task('build-authentication', ['copy-authentication-images', 'build-authentication-css'], function(){
debugMode = false;
return gulp.start('build-authentication-js');
});

View File

@@ -0,0 +1,62 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-common-images', function(){
return gulp.src([config.paths.src + 'common/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'common/images'));
});
gulp.task('copy-common-fonts',function(){
return gulp.src([config.paths.vendors + 'font-awesome/font/*'])
.pipe(gulp.dest( config.paths.build + 'common/font'));
});
gulp.task('build-common-font-css', ['copy-common-fonts'],function(){
return gulp.src([config.paths.vendors + 'font-awesome/css/font-awesome-ie7.min.css'])
.pipe(gulp.dest( config.paths.build + 'common/css'));
});
gulp.task('build-common-css', ['build-common-font-css'],function(){
return utils.buildCssGroup([
config.paths.src + 'common/styles/main.scss'
], 'common', 'common/css/', debugMode)
});
gulp.task('build-common-js', function(){
var commonGroup = [
// config.paths.dist + 'assets/bootstrap/js/bootstrap.js', // should append no conflict
config.paths.src + 'vendors/jquery-mousewheel/js/jquery.mousewheel.js',
// jquery ui date picker langs
config.paths.vendors + 'jquery-ui/ui/i18n/jquery.ui.datepicker-ar.js',
config.paths.vendors + 'jquery-ui/ui/i18n/jquery.ui.datepicker-de.js',
config.paths.vendors + 'jquery-ui/ui/i18n/jquery.ui.datepicker-es.js',
config.paths.vendors + 'jquery-ui/ui/i18n/jquery.ui.datepicker-fr.js',
config.paths.vendors + 'jquery-ui/ui/i18n/jquery.ui.datepicker-nl.js',
config.paths.vendors + 'jquery-ui/ui/i18n/jquery.ui.datepicker-en-GB.js',
config.paths.vendors + 'jquery.cookie/jquery.cookie.js',
config.paths.src + 'vendors/jquery-contextmenu/js/jquery.contextmenu_custom.js',
config.paths.src + 'common/js/jquery.common.js',
config.paths.src + 'common/js/jquery.tooltip.js',
config.paths.src + 'common/js/jquery.Dialog.js',
config.paths.vendors + 'swfobject/swfobject/swfobject.js', // @TODO: should be moved away (embed-bundle)
config.paths.dist + 'include/jslibs/flowplayer/flowplayer-3.2.13.min.js' // @TODO: should be moved away (embed-bundle)
];
return utils.buildJsGroup(commonGroup, 'common', 'common/js', debugMode);
});
gulp.task('watch-common-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'common/**/*.js', ['build-common-js']);
});
gulp.task('watch-common-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'common/**/*.scss', ['build-common-css']);
});
gulp.task('build-common', ['copy-common-images', 'build-common-css'], function(){
debugMode = false;
return gulp.start('build-common-js');
});

View File

@@ -0,0 +1,61 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-lightbox-images', function(){
return gulp.src([config.paths.src + 'lightbox/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'lightbox/images'));
});
gulp.task('build-lightbox-mobile-css', function(){
return utils.buildCssGroup([
config.paths.src + 'lightbox/styles/main-mobile.scss'
], 'lightbox-mobile', 'lightbox/css/', debugMode);
});
gulp.task('build-lightbox-mobile-js', function(){
return utils.buildJsGroup([
config.paths.src + 'lightbox/js/jquery.validator.mobile.js'
], 'lightbox-mobile', 'lightbox/js', debugMode);
});
gulp.task('build-lightbox-ie6-css', function(){
return utils.buildCssGroup([
config.paths.src + 'lightbox/styles/main-ie6.scss'
], 'lightbox-ie6', 'lightbox/css/', debugMode)
});
gulp.task('build-lightbox-css', ['build-lightbox-mobile-css', 'build-lightbox-ie6-css'], function(){
return utils.buildCssGroup([
config.paths.src + 'lightbox/styles/main.scss'
], 'lightbox', 'lightbox/css/', debugMode)
});
gulp.task('build-lightbox-js', ['build-lightbox-mobile-js'], function(){
var lightboxGroup = [
config.paths.src + 'lightbox/js/jquery.lightbox.js'
];
var lightboxIE6Group = [
config.paths.src + 'lightbox/js/jquery.lightbox.ie6.js'
];
utils.buildJsGroup(lightboxIE6Group, 'lightboxIe6', 'lightbox/js', debugMode);
return utils.buildJsGroup(lightboxGroup, 'lightbox', 'lightbox/js', debugMode);
});
gulp.task('watch-lightbox-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'lightbox/**/*.js', ['build-lightbox-js']);
});
gulp.task('watch-lightbox-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'lightbox/**/*.scss', ['build-lightbox-css']);
});
gulp.task('build-lightbox', ['copy-lightbox-images', 'build-lightbox-css'], function(){
debugMode = false;
return gulp.start('build-lightbox-js');
});

View File

@@ -0,0 +1,13 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('watch-oauth-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'oauth/**/*.scss', ['build-oauth']);
});
gulp.task('build-oauth', function () {
debugMode = false;
return utils.buildCssGroup([config.paths.src + 'oauth/main.scss'], 'oauth', 'oauth/css/', debugMode);
});

View File

@@ -0,0 +1,130 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var qunit = require('gulp-qunit');
var debugMode = false;
// prod submodule
gulp.task('build-uploadFlash', function(){
var uploadFlashGroup = [
config.paths.dist + 'include/jslibs/SWFUpload/swfupload.js',
config.paths.dist + 'include/jslibs/SWFUpload/plugins/swfupload.queue.js'
];
return utils.buildJsGroup(uploadFlashGroup, 'uploadFlash', 'upload/js');
});
// prod submodule
gulp.task('build-permaview', function(){
var permaviewGroup = [
config.paths.src + 'vendors/jquery-mousewheel/js/jquery.mousewheel.js',
config.paths.src + 'vendors/jquery-image-enhancer/js/jquery.image_enhancer.js',
config.paths.vendors + 'swfobject/swfobject/swfobject.js', // @TODO: should be moved away (embed-bundle)
config.paths.dist + 'include/jslibs/flowplayer/flowplayer-3.2.13.min.js' // @TODO: should be moved away (embed-bundle)
];
return utils.buildJsGroup(permaviewGroup, 'permaview', 'permaview/js', debugMode);
});
gulp.task('copy-prod-skin-black-images', function(){
return gulp.src([
config.paths.src + 'prod/skins/000000/images/**/*'
])
.pipe(gulp.dest( config.paths.build + 'prod/skins/000000/images'));
});
gulp.task('copy-prod-skin-grey-images', function(){
return gulp.src([
config.paths.src + 'prod/skins/959595/images/**/*'
])
.pipe(gulp.dest( config.paths.build + 'prod/skins/959595/images'));
});
gulp.task('copy-prod-skin-white-images', function(){
return gulp.src([
config.paths.src + 'prod/skins/FFFFFF/images/**/*'
])
.pipe(gulp.dest( config.paths.build + 'prod/skins/FFFFFF/images'));
});
gulp.task('copy-prod-images', function(){
return gulp.src([config.paths.src + 'prod/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'prod/images'));
});
gulp.task('build-prod-skin-black', ['copy-prod-skin-black-images'], function(){
return utils.buildCssGroup([
config.paths.src + 'prod/skins/000000/skin-000000.scss'
], 'skin-000000', 'prod/skins/000000/', debugMode);
});
gulp.task('build-prod-skin-grey', ['copy-prod-skin-grey-images'], function(){
return utils.buildCssGroup([
config.paths.src + 'prod/skins/959595/skin-959595.scss'
], 'skin-959595', 'prod/skins/959595/', debugMode);
});
gulp.task('build-prod-skin-white', ['copy-prod-skin-white-images'], function(){
return utils.buildCssGroup([
config.paths.src + 'prod/skins/FFFFFF/skin-FFFFFF.scss'
], 'skin-FFFFFF', 'prod/skins/FFFFFF/', debugMode);
});
gulp.task('build-prod-css', ['build-prod-skin-black', 'build-prod-skin-grey', 'build-prod-skin-white'], function(){
return utils.buildCssGroup([
config.paths.src + 'prod/styles/main.scss'
], 'prod', 'prod/css/', debugMode);
});
gulp.task('build-prod-js', function(){
var prodGroup = [
config.paths.vendors + 'underscore-amd/underscore.js',
config.paths.src + 'vendors/colorpicker/js/colorpicker.js',
config.paths.vendors + 'jquery.lazyload/jquery.lazyload.js',
config.paths.vendors + 'humane-js/humane.js', // @TODO > extra files
config.paths.vendors + 'blueimp-load-image/js/load-image.js', // @TODO > extra files
config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js',
config.paths.vendors + 'jquery-file-upload/js/jquery.fileupload.js',
config.paths.vendors + 'geonames-server-jquery-plugin/jquery.geonames.js',
config.paths.src + 'prod/js/jquery.form.2.49.js',
config.paths.src + 'prod/js/jquery.Selection.js',
config.paths.src + 'prod/js/jquery.Edit.js',
config.paths.src + 'prod/js/jquery.lists.js',
config.paths.src + 'prod/js/jquery.Prod.js',
config.paths.src + 'prod/js/jquery.Feedback.js',
config.paths.src + 'prod/js/jquery.Results.js',
config.paths.src + 'prod/js/jquery.main-prod.js',
config.paths.src + 'prod/js/jquery.WorkZone.js',
config.paths.src + 'prod/js/jquery.Alerts.js',
config.paths.src + 'prod/js/jquery.Upload.js',
config.paths.src + 'prod/js/ThumbExtractor.js',
config.paths.src + 'prod/js/publicator.js',
config.paths.src + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js',
config.paths.src + 'prod/js/jquery.p4.preview.js',
config.paths.src + 'prod/js/record.editor.js',
config.paths.src + 'prod/js/jquery.color.animation.js',
config.paths.src + 'vendors/jquery-image-enhancer/js/jquery.image_enhancer.js',
config.paths.vendors + 'jquery-treeview/jquery.treeview.js',
config.paths.vendors + 'jquery-treeview/jquery.treeview.async.js',
config.paths.vendors + 'fancytree/dist/jquery.fancytree-all.min.js'
];
return utils.buildJsGroup(prodGroup, 'prod', 'prod/js', debugMode);
});
gulp.task('test-prod', function () {
return gulp.src(config.paths.src + 'prod/js/tests/*.html')
.pipe(qunit());
});
gulp.task('watch-prod-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'prod/**/*.js', ['build-prod-js']);
});
gulp.task('watch-prod-css', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'prod/**/*.scss', ['build-prod-css']);
});
gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){
debugMode = false;
return gulp.start('build-prod-js');
});

View File

@@ -0,0 +1,46 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-report-images', function(){
return gulp.src([config.paths.src + 'report/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'report/images'));
});
gulp.task('build-report-print-css', function(){
return utils.buildCssGroup([
config.paths.src + 'report/styles/main-print.scss'
], 'print', 'report/css/', debugMode);
});
gulp.task('build-report-css', ['build-report-print-css'], function(){
return utils.buildCssGroup([
config.paths.src + 'report/styles/main.scss'
], 'report', 'report/css/', debugMode);
});
gulp.task('build-report-js', function(){
var reportGroup = [
config.paths.src + 'report/js/jquery.print.js',
config.paths.src + 'report/js/jquery.cluetip.js',
config.paths.src + 'report/js/jquery.nicoslider.js',
config.paths.src + 'report/js/jquery.gvChart-0.1.js',
config.paths.src + 'report/js/report.js'
];
return utils.buildJsGroup(reportGroup, 'report', 'report/js', debugMode);
});
gulp.task('watch-report-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'report/**/*.js', ['build-report-js']);
});
gulp.task('watch-report-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'report/**/*.scss', ['build-report-css']);
});
gulp.task('build-report', ['copy-report-images', 'build-report-css'], function(){
return gulp.start('build-report-js');
});

View File

@@ -0,0 +1,39 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-setup-images', function(){
return gulp.src([config.paths.src + 'setup/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'setup/images'));
});
gulp.task('build-setup-css', function(){
utils.buildCssGroup([
config.paths.src + 'setup/styles/main.scss'
], 'setup', 'setup/css/', debugMode);
});
gulp.task('build-setup-js', function(){
var setupGroup = [
config.paths.vendors + 'jquery.cookie/jquery.cookie.js',
config.paths.src + 'vendors/jquery-validation/js/jquery.validate.js',
config.paths.src + 'vendors/jquery-validate.password/js/jquery.validate.password.js',
config.paths.src + 'vendors/jquery-test-paths/jquery.test-paths.js'
];
return utils.buildJsGroup(setupGroup, 'setup', 'setup/js', debugMode);
});
gulp.task('watch-setup-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'setup/**/*.js', ['build-setup-js']);
});
gulp.task('watch-setup-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'setup/**/*.scss', ['build-setup-css']);
});
gulp.task('build-setup', ['copy-setup-images', 'build-setup-css'], function(){
debugMode = false;
return gulp.start('build-setup-js');
});

View File

@@ -0,0 +1,39 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-thesaurus-images', function(){
return gulp.src([config.paths.src + 'thesaurus/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'thesaurus/images'));
});
gulp.task('build-thesaurus-css', function(){
return utils.buildCssGroup([
config.paths.src + 'thesaurus/styles/main.scss'
], 'thesaurus', 'thesaurus/css/', debugMode);
});
gulp.task('build-thesaurus-js', function(){
var thesaurusGroup = [
config.paths.src + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js',
config.paths.src + 'thesaurus/js/win.js',
config.paths.src + 'thesaurus/js/xmlhttp.js',
config.paths.src + 'thesaurus/js/thesaurus.js',
config.paths.src + 'thesaurus/js/sprintf.js'
];
return utils.buildJsGroup(thesaurusGroup, 'thesaurus', 'thesaurus/js', debugMode);
});
gulp.task('watch-thesaurus-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'thesaurus/**/*.js', ['build-thesaurus-js']);
});
gulp.task('watch-thesaurus-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'thesaurus/**/*.scss', ['build-thesaurus-css']);
});
gulp.task('build-thesaurus', ['copy-thesaurus-images', 'build-thesaurus-css'], function(){
return gulp.start('build-thesaurus-js');
});

View File

@@ -0,0 +1,17 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-underscore', function(){
return utils.buildJsGroup([
config.paths.vendors + 'underscore-amd/underscore.js'
], 'underscore', 'vendors/underscore');
});
gulp.task('build-backbone', ['build-underscore'], function(){
return utils.buildJsGroup([
config.paths.vendors + 'backbone-amd/backbone.js'
], 'backbone', 'vendors/backbone');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-blueimp-load-image', function(){
return utils.buildJsGroup([
config.paths.vendors + 'blueimp-load-image/js/load-image.js'
], 'load-image', 'vendors/blueimp-load-image');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-bootstrap-multiselect', function(){
return utils.buildJsGroup([
config.paths.vendors + 'bootstrap-multiselect/dist/js/bootstrap-multiselect.js'
], 'bootstrap-multiselect', 'vendors/bootstrap-multiselect');
});

View File

@@ -0,0 +1,55 @@
var gulp = require('gulp');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var cssmin = require('gulp-cssmin');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('bootstrap-js', function () {
var btSource = [
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-transition.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-alert.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-modal.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-dropdown.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-scrollspy.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-tab.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-tooltip.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-popover.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-button.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-collapse.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-carousel.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-typeahead.js',
config.paths.vendors + 'bootstrap-sass/vendor/assets/javascripts/bootstrap-affix.js'];
gulp.src(btSource)
.pipe(concat('bootstrap.js'))
.pipe(gulp.dest( config.paths.build + 'vendors/bootstrap/js'))
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest( config.paths.build + 'vendors/bootstrap/js'))
});
gulp.task('bootstrap-assets', function () {
gulp.src([config.paths.vendors + 'bootstrap-sass/vendor/assets/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'vendors/bootstrap/img'));
});
gulp.task('build-bootstrap', ['bootstrap-assets', 'bootstrap-js'], function () {
// build standalone version (not used, see: Common Component)
gulp.src(config.paths.vendors + 'bootstrap-sass/vendor/assets/stylesheets/bootstrap.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest( config.paths.build + 'vendors/bootstrap/css/'))
.pipe(cssmin())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest( config.paths.build + 'vendors/bootstrap/css'));
gulp.src([
config.paths.vendors + 'bootstrap-sass/vendor/assets/stylesheets/bootstrap-responsive.scss',
config.paths.vendors + 'bootstrap-sass/vendor/assets/stylesheets/bootstrap/_responsive-utilities.scss'
])
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest( config.paths.build + 'vendors/bootstrap/css/'))
.pipe(cssmin())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest( config.paths.build + 'vendors/bootstrap/css'));
});

View File

@@ -0,0 +1,20 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('copy-colorpicker-images', function(){
return gulp.src([config.paths.src + 'vendors/colorpicker/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'vendors/colorpicker/images'));
});
gulp.task('build-colorpicker-css', function(){
return utils.buildCssGroup([
config.paths.src + 'vendors/colorpicker/styles/colorpicker.scss'
], 'colorpicker', 'vendors/colorpicker');
});
gulp.task('build-colorpicker', ['build-colorpicker-css', 'copy-colorpicker-images'], function(){
return utils.buildJsGroup([
config.paths.src + 'vendors/colorpicker/js/colorpicker.js'
], 'colorpicker', 'vendors/colorpicker');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-geonames-server-jquery-plugin', function(){
return utils.buildJsGroup([
config.paths.vendors + 'geonames-server-jquery-plugin/jquery.geonames.js'
], 'jquery.geonames', 'vendors/jquery.geonames');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-i18next', function(){
return utils.buildJsGroup([
config.paths.vendors + 'i18next/release/i18next.amd-1.6.3.js'
], 'i18next', 'vendors/i18next');
});

View File

@@ -0,0 +1,18 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('copy-jquery-contextmenu-images', function(){
return gulp.src([config.paths.src + 'vendors/jquery-contextmenu/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'vendors/jquery-contextmenu/images'));
});
gulp.task('build-jquery-contextmenu-css', function(){
return utils.buildCssGroup([
config.paths.src + 'vendors/jquery-contextmenu/styles/jquery.contextmenu.scss'
], 'jquery-contextmenu', 'vendors/jquery-contextmenu');
});
gulp.task('build-jquery-contextmenu', ['build-jquery-contextmenu-css', 'copy-jquery-contextmenu-images'], function(){
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-jquery-cookie', function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery.cookie/jquery.cookie.js'
], 'jquery.cookie', 'vendors/jquery.cookie');
});

View File

@@ -0,0 +1,23 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-jquery-file-upload-widget', [], function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery-file-upload/js/vendor/jquery.ui.widget.js'
], 'jquery.ui.widget', 'vendors/jquery-file-upload');
});
gulp.task('build-jquery-file-transport', [], function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js'
], 'jquery.iframe-transport', 'vendors/jquery-file-upload');
});
gulp.task('build-jquery-file-upload', ['build-jquery-file-transport', 'build-jquery-file-upload-widget'], function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery-file-upload/js/jquery.fileupload.js'
], 'jquery.fileupload', 'vendors/jquery-file-upload');
});

View File

@@ -0,0 +1,26 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-galleria-css', function(){
return utils.buildCssGroup([
config.paths.vendors + 'jquery-galleria/src/themes/classic/galleria.classic.css'
], 'galleria.classic', 'vendors/jquery-galleria');
});
gulp.task('build-galleria-js-classic', function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery-galleria/src/themes/classic/galleria.classic.js'
], 'galleria.classic', 'vendors/jquery-galleria');
});
gulp.task('build-galleria-js', ['build-galleria-js-classic'], function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery-galleria/src/galleria.js'
], 'galleria', 'vendors/jquery-galleria');
});
gulp.task('build-jquery-galleria', ['build-galleria-js', 'build-galleria-css'], function(){
// copy jquery mobile assets
return gulp.src(config.paths.vendors + 'jquery-galleria/src/themes/classic/!(*.js|*.map|*.css|*.html)')
.pipe(gulp.dest( config.paths.build + 'vendors/jquery-galleria'));
});

View File

@@ -0,0 +1,17 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-jquery-image-enhancer-css', function(){
return utils.buildCssGroup([
config.paths.src + 'vendors/jquery-image-enhancer/styles/jquery.image_enhancer.scss'
], 'jquery-image-enhancer', 'vendors/jquery-image-enhancer');
});
gulp.task('build-jquery-image-enhancer', ['build-jquery-image-enhancer-css'], function(){
return utils.buildJsGroup([
config.paths.src + 'vendors/jquery-image-enhancer/js/jquery.image_enhancer.js'
], 'jquery-image-enhancer', 'vendors/jquery-image-enhancer');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-jquery-lazyload', function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery.lazyload/jquery.lazyload.js'
], 'jquery.lazyload', 'vendors/jquery.lazyload');
});

View File

@@ -0,0 +1,21 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-jquery-mobile-css', function(){
return utils.buildCssGroup([
config.paths.vendors + 'jquery-mobile-bower/css/jquery.mobile-1.3.2.css'
], 'jquery-mobile', 'vendors/jquery-mobile');
});
gulp.task('build-jquery-mobile-js', function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery-mobile-bower/js/jquery.mobile-1.3.2.js'
], 'jquery-mobile', 'vendors/jquery-mobile');
});
gulp.task('build-jquery-mobile', ['build-jquery-mobile-js', 'build-jquery-mobile-css'], function(){
// copy jquery mobile assets
return gulp.src(config.paths.vendors + 'jquery-mobile-bower/css/images/**/*')
.pipe(gulp.dest( config.paths.build + 'vendors/jquery-mobile/images'));
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-jquery-test-paths', function(){
return utils.buildJsGroup([
config.paths.src + 'vendors/jquery-test-paths/jquery.test-paths.js'
], 'jquery.test-paths', 'vendors/jquery-test-paths');
});

View File

@@ -0,0 +1,17 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('copy-jquery-treeview-images', function(){
return gulp.src([config.paths.vendors + 'jquery-treeview/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'vendors/jquery-treeview/images'));
});
gulp.task('build-jquery-treeview', ['copy-jquery-treeview-images'], function(){
// no standalone version used
/*utils.buildJsGroup([
config.paths.vendors + 'jquery-treeview/jquery.treeview.async.js'
], 'jquery.treeview.async', 'vendors/jquery-treeview');*/
return utils.buildJsGroup([
config.paths.vendors + 'jquery-treeview/jquery.treeview.js'
], 'jquery.treeview', 'vendors/jquery-treeview');
});

View File

@@ -0,0 +1,24 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('copy-jquery-ui-images', function(){
return gulp.src([config.paths.src + 'vendors/jquery-ui/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'vendors/jquery-ui/images'));
});
// DEPRECATED > theme is loaded in skin 000000
gulp.task('copy-jquery-ui-theme1', function(){
utils.buildCssGroup([config.paths.src + 'vendors/jquery-ui/dark-hive.scss'], 'dark-hive', 'vendors/jquery-ui/css/');
});
// DEPRECATED > theme is loaded in skin 959595
gulp.task('copy-jquery-ui-theme2', function(){
utils.buildCssGroup([config.paths.src + 'vendors/jquery-ui/ui-lightness.scss'], 'ui-lightness', 'vendors/jquery-ui/css/');
});
gulp.task('build-jquery-ui', ['copy-jquery-ui-images', 'copy-jquery-ui-theme1', 'copy-jquery-ui-theme2'], function(){
// copy jquery ui assets
return utils.buildJsGroup([
config.paths.vendors + 'jquery-ui/ui/jquery-ui.js'
], 'jquery-ui', 'vendors/jquery-ui');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-jquery', function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery/dist/jquery.js'
], 'jquery', 'vendors/jquery');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-json2', [], function(){
return utils.buildJsGroup([
config.paths.vendors + 'json2/json2.js'
], 'json2', 'vendors/json2');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-modernizr', [], function(){
return utils.buildJsGroup([
config.paths.vendors + 'modernizr/modernizr.js'
], 'modernizr', 'vendors/modernizr');
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-requirejs', function(){
return utils.buildJsGroup([
config.paths.vendors + 'requirejs/require.js'
], 'require', 'vendors/requirejs');
});

View File

@@ -0,0 +1,8 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-tinymce', [], function(){
return gulp.src([config.paths.vendors + 'tinymce/**'])
.pipe(gulp.dest(config.paths.build + 'vendors/tinymce'));
});

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-zxcvbn', [], function(){
return utils.buildJsGroup([
config.paths.vendors + 'zxcvbn/dist/zxcvbn.js'
], 'zxcvbn', 'vendors/zxcvbn');
});

39
resources/gulp/config.js Normal file
View File

@@ -0,0 +1,39 @@
var path = require("path");
var fs = require("fs");
var gutil = require("gulp-util");
var configPaths = {
src: 'resources/www/',
vendors: 'www/bower_components/',
build: 'www/assets/',
dist: 'www/'
};
exports.paths = configPaths;
/**
* ensure external override config is accessible
* @returns {boolean}
*/
exports.checkPath = function(userPath, log) {
"use strict";
try {
fs.statSync(path.resolve(userPath) );
if( log === true ) {
gutil.log(gutil.colors.green('[INFO]'), 'folder "'+userPath+'" exists');
}
return true;
} catch(e) {
if( log === true ) {
gutil.log(gutil.colors.red('[WARNING]'), 'folder "' + userPath + '" not found');
}
return false;
}
};
exports.errorHandler = function(title) {
'use strict';
return function(err) {
gutil.log(gutil.colors.red('[' + title + ']'), err.toString());
this.emit('end');
};
};

49
resources/gulp/install.js Normal file
View File

@@ -0,0 +1,49 @@
// TODO: bower, tmp-assets
// TODO: asset, www/assets
var gulp = require('gulp');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var cssmin = require('gulp-cssmin');
var install = require('gulp-install');
var sass = require('gulp-sass');
var del = require('del');
var config = require('./config.js');
gulp.task('clean:assetsPath', function(done){
return del([config.paths.build + '/**/*'], done);
});
gulp.task('install-bower-dependencies', function(){
return gulp.src(['./bower.json'])
.pipe(install());
});
gulp.task('build-dependencies', ['install-bower-dependencies'], function(){
gulp.start('build');
gulp.start('build-css');
});
gulp.task('init-plugins-folder', function(){
if( !config.checkPath('plugins', true)) {
// something to do in plugins folder?
}
});
/**
* base commands: install, install-assets
*/
gulp.task('install-assets', function(){
gulp.start('install');
});
gulp.task('install', ['clean:assetsPath'], function(){
// ensure plugins path exists
gulp.start('init-plugins-folder');
gulp.start('build-dependencies');
});

10
resources/gulp/styles.js Normal file
View File

@@ -0,0 +1,10 @@
var gulp = require('gulp');
var config = require('./config.js');
var utils = require('./utils.js');
gulp.task('build-css', function () {
utils.buildCssGroup([config.paths.src + 'oauth/main.scss'], 'oauth', 'oauth/css/');
});

13
resources/gulp/test.js Normal file
View File

@@ -0,0 +1,13 @@
var gulp = require('gulp');
var qunit = require('gulp-qunit');
var config = require('./config.js');
gulp.task('test-components', function () {
return gulp.start('test-prod');
});
// JS fixtures should be present (./bin/developer phraseanet:generate-js-fixtures)
// Note: fixture are loaded into scripts/tests/fixtures directory using
// bin/developer phraseanet:regenerate-js-fixtures
gulp.task('test', ['test-components']);

69
resources/gulp/utils.js Normal file
View File

@@ -0,0 +1,69 @@
var gulp = require('gulp');
var gutil = require('gulp-util');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var cssmin = require('gulp-cssmin');
var sass = require('gulp-sass');
var config = require('./config.js');
var debug = require('gulp-debug');
var autoprefixer = require('gulp-autoprefixer');
var fs = require('fs');
exports.buildJsGroup = function(srcGroup, name, dest, debugMode){
if( dest === undefined ) {
dest = name;
}
// ensure all required files exists:
srcGroup.forEach(fs.statSync); //will trow an error if file not found
// console.log('building group:', name, ' > ', config.paths.build + dest)
if( debugMode === true ) {
gutil.log(gutil.colors.red('[DEBUG MODE]'), ' "' + name + '" minified version has not been generated');
return gulp.src(srcGroup)
.pipe(concat(name + '.js', {newLine: ';'}))
.pipe(gulp.dest( config.paths.build + dest))
.pipe(gulp.dest( config.paths.build + dest))
}
return gulp.src(srcGroup)
.pipe(concat(name + '.js', {newLine: ';'}))
.pipe(gulp.dest( config.paths.build + dest))
.pipe(uglify({
compress: {
drop_console: true
}
}).on('error', config.errorHandler('UGLIFY ERROR'))) //util.log))
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest( config.paths.build + dest))
};
exports.buildCssGroup = function(srcGroup, name, dest, debugMode){
if( dest === undefined ) {
dest = name;
}
// ensure all required files exists:
srcGroup.forEach(fs.statSync); //will trow an error if file not found
// console.log('building group:', name, ' > ', config.paths.build + dest)
if( debugMode === true ) {
gutil.log(gutil.colors.red('[DEBUG MODE]'), ' "' + name + '" minified version has not been generated');
return gulp.src(srcGroup)
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(rename(name + '.css'))
.pipe(gulp.dest(config.paths.build + dest))
}
return gulp.src(srcGroup)
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(rename(name + '.css'))
.pipe(gulp.dest(config.paths.build + dest))
.pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(config.paths.build + dest));
};

52
resources/gulp/watch.js Normal file
View File

@@ -0,0 +1,52 @@
var gulp = require('gulp');
var util = require('gulp-util');
var config = require('./config.js');
var debug = require('gulp-debug');
var fs = require('fs');
var utils = require('./utils.js');
gulp.task('watch-css', function(){
gulp.start('watch-common-css');
gulp.start('watch-oauth-css');
gulp.start('watch-prod-css');
gulp.start('watch-thesaurus-css');
//gulp.start('watch-uploadFlash');
gulp.start('watch-lightbox-css');
gulp.start('watch-admin-css');
gulp.start('watch-report-css');
gulp.start('watch-account-css');
// gulp.start('watch-permaview');
gulp.start('watch-setup-css');
gulp.start('watch-authentication-css');
});
gulp.task('watch-js', function(){
gulp.start('watch-common-js');
// gulp.start('watch-oauth-js');
gulp.start('watch-prod-js');
gulp.start('watch-thesaurus-js');
//gulp.start('watch-uploadFlash');
gulp.start('watch-lightbox-js');
gulp.start('watch-admin-js');
gulp.start('watch-report-js');
gulp.start('watch-account-js');
// gulp.start('watch-permaview');
gulp.start('watch-setup-js');
gulp.start('watch-authentication-js');
});
gulp.task('watch', function(){
gulp.start('watch-css');
gulp.start('watch-js');
});
var browserSync = require('browser-sync').create();
gulp.task('sync', ['watch'], function(){
// will open browser in http://localhost:3000/
browserSync.init({
proxy: "phraseanet-php55-nginx"
});
gulp.watch(config.paths.build + '**/*.css').on('change', browserSync.reload);
gulp.watch(config.paths.build + '**/*.js').on('change', browserSync.reload);
});

View File

@@ -60,7 +60,6 @@ main:
ffprobe_binary: null ffprobe_binary: null
mp4box_binary: null mp4box_binary: null
pdftotext_binary: null pdftotext_binary: null
recess_binary: null
ffmpeg_timeout: 3600 ffmpeg_timeout: 3600
ffprobe_timeout: 60 ffprobe_timeout: 60
gs_timeout: 60 gs_timeout: 60

View File

@@ -70,10 +70,6 @@ find . -maxdepth 1 -type f -exec rm {} \;
sudo cp -rf * /usr/local/ sudo cp -rf * /usr/local/
# npm binaries # npm binaries
sudo npm install -g recess
sudo npm install -g grunt-cli
sudo npm install -g bower
sudo npm install -g uglify-js
#twig #twig
cd /tmp cd /tmp
@@ -116,8 +112,6 @@ then
cd /var/www/phraseanet cd /var/www/phraseanet
sudo -u vagrant composer install -n --prefer-source --dev sudo -u vagrant composer install -n --prefer-source --dev
sudo -u vagrant npm install sudo -u vagrant npm install
sudo -u vagrant grunt install-assets
sudo -u vagrant bin/developer assets:compile-less
sudo -u vagrant rm -f /var/www/phraseanet/lib/conf.d/configuration.yml sudo -u vagrant rm -f /var/www/phraseanet/lib/conf.d/configuration.yml
mv /var/www/phraseanet/lib/conf.d/configuration.yml.bkp /var/www/phraseanet/lib/conf.d/configuration.yml mv /var/www/phraseanet/lib/conf.d/configuration.yml.bkp /var/www/phraseanet/lib/conf.d/configuration.yml
fi fi

Some files were not shown because too many files have changed in this diff Show More