diff --git a/apps/maarch_entreprise/index.php b/apps/maarch_entreprise/index.php index b42fa22363b7700e8560b65002f0449d9f786f1b..4b2afae761a9d47ddef42c2d64507c903466e3ef 100644 --- a/apps/maarch_entreprise/index.php +++ b/apps/maarch_entreprise/index.php @@ -226,9 +226,27 @@ if(empty($_SESSION['current_basket'])){ ?> -<body ng-app="AppModule" ng-controller="mainCtrl" style="background: url('static.php?filename=loading_big.gif') no-repeat fixed center;" onload="$('maarch_body').style.background='f2f2f2';$('maarch_body').style.backgroundImage='';$('maarch_body').style.backgroundUrl='';$('maarch_content').style.display='block';session_expirate(<?php echo $time;?>, '<?php + +<!-- Polyfill(s) for older browsers --> +<!-- <script src="/node_modules/core-js/client/shim.js"></script> +<script src="/node_modules/zone.js/dist/zone.js"></script> +<script src="/node_modules/systemjs/dist/system.src.js"></script> +<script src="js/angular/systemjs.config.js"></script> --> +<!-- <script> + System.import('js/angular/main.js').catch(function(err){ console.error(err); }); +</script> --> + +<!--body ng-app="AppModule" ng-controller="mainCtrl" style="background: url('static.php?filename=loading_big.gif') no-repeat fixed center;" onload="$('maarch_body').style.background='f2f2f2';$('maarch_body').style.backgroundImage='';$('maarch_body').style.backgroundUrl='';$('maarch_content').style.display='block';session_expirate(<?php echo $time;?>, '<?php + echo $_SESSION['config']['businessappurl']; + ?>index.php?display=true&page=logout&logout=true');" id="maarch_body"--> + +<body style="background: url('static.php?filename=loading_big.gif') no-repeat fixed center;" onload="$('maarch_body').style.background='f2f2f2';$('maarch_body').style.backgroundImage='';$('maarch_body').style.backgroundUrl='';$('maarch_content').style.display='block';session_expirate(<?php echo $time;?>, '<?php echo $_SESSION['config']['businessappurl']; ?>index.php?display=true&page=logout&logout=true');" id="maarch_body"> + + +<my-app>Loading AppComponent content here ...</my-app> + <div id ="maarch_content" style="display:none;"> <?php diff --git a/apps/maarch_entreprise/js/angular/app/app.component.js b/apps/maarch_entreprise/js/angular/app/app.component.js new file mode 100644 index 0000000000000000000000000000000000000000..583c240d1f0686a6d38c9b6296b9a9a39450b99c --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/app.component.js @@ -0,0 +1,26 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var core_1 = require('@angular/core'); +var AppComponent = (function () { + function AppComponent() { + this.name = 'Angular'; + } + AppComponent = __decorate([ + core_1.Component({ + selector: 'my-app', + template: "<h1>Hello {{name}}</h1>", + }), + __metadata('design:paramtypes', []) + ], AppComponent); + return AppComponent; +}()); +exports.AppComponent = AppComponent; +//# sourceMappingURL=app.component.js.map \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/app/app.component.ts b/apps/maarch_entreprise/js/angular/app/app.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..7fb173cd011f70a288f7bb676d46d40762a0b08f --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/app.component.ts @@ -0,0 +1,7 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'my-app', + template: `<h1>Hello {{name}}</h1>`, +}) +export class AppComponent { name = 'Angular'; } diff --git a/apps/maarch_entreprise/js/angular/app/app.module.js b/apps/maarch_entreprise/js/angular/app/app.module.js new file mode 100644 index 0000000000000000000000000000000000000000..1715df39d557f00fb78f97270d536111b3e6c428 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/app.module.js @@ -0,0 +1,28 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var core_1 = require('@angular/core'); +var platform_browser_1 = require('@angular/platform-browser'); +var app_component_1 = require('./app.component'); +var AppModule = (function () { + function AppModule() { + } + AppModule = __decorate([ + core_1.NgModule({ + imports: [platform_browser_1.BrowserModule], + declarations: [app_component_1.AppComponent], + bootstrap: [app_component_1.AppComponent] + }), + __metadata('design:paramtypes', []) + ], AppModule); + return AppModule; +}()); +exports.AppModule = AppModule; +//# sourceMappingURL=app.module.js.map \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/app/app.module.ts b/apps/maarch_entreprise/js/angular/app/app.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..357b003a5ab73f172513c27892e700c4a1225d9d --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/app.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; + +import { AppComponent } from './app.component'; + +@NgModule({ + imports: [ BrowserModule ], + declarations: [ AppComponent ], + bootstrap: [ AppComponent ] +}) +export class AppModule { } diff --git a/apps/maarch_entreprise/js/angular/main.js b/apps/maarch_entreprise/js/angular/main.js new file mode 100644 index 0000000000000000000000000000000000000000..0c4c3b99e29620d995dde12d0e319ecae9b79ef5 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/main.js @@ -0,0 +1,5 @@ +"use strict"; +var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic'); +var app_module_1 = require('./app/app.module'); +platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule); +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/main.ts b/apps/maarch_entreprise/js/angular/main.ts new file mode 100644 index 0000000000000000000000000000000000000000..311c44b76de099dd1d52c73c77fb1d14cc27e774 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/main.ts @@ -0,0 +1,5 @@ +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; + +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/apps/maarch_entreprise/js/angular/systemjs.config.js b/apps/maarch_entreprise/js/angular/systemjs.config.js new file mode 100644 index 0000000000000000000000000000000000000000..c1ec656202317dba51cf7b1ce630f574e28391f9 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/systemjs.config.js @@ -0,0 +1,40 @@ +/** + * System configuration for Angular samples + * Adjust as necessary for your application needs. + */ +(function (global) { + System.config({ + paths: { + // paths serve as alias + 'npm:': '/node_modules/' + }, + // map tells the System loader where to look for things + map: { + // our app is within the app folder + app: 'js/angular/app', + + // angular bundles + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', + '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', + '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', + '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', + '@angular/http': 'npm:@angular/http/bundles/http.umd.js', + '@angular/router': 'npm:@angular/router/bundles/router.umd.js', + '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', + + // other libraries + 'rxjs': 'npm:rxjs', + 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js' + }, + // packages tells the System loader how to load when no filename and/or no extension + packages: { + app: { + defaultExtension: 'js' + }, + rxjs: { + defaultExtension: 'js' + } + } + }); +})(this); diff --git a/apps/maarch_entreprise/js/angular/tsconfig.json b/apps/maarch_entreprise/js/angular/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..f13f84d31fed8ffa2c1852d738dff12ec0c981c4 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "lib": [ "es2015", "dom" ], + "noImplicitAny": true, + "suppressImplicitAnyIndexErrors": true + } +} diff --git a/apps/maarch_entreprise/merged_jsAbstract.php b/apps/maarch_entreprise/merged_jsAbstract.php index 99fd0135fa9db140a9adfe512537a8ba2dcc68e7..090d67d48641acadb0214f3f0062b94aa5004987 100644 --- a/apps/maarch_entreprise/merged_jsAbstract.php +++ b/apps/maarch_entreprise/merged_jsAbstract.php @@ -44,9 +44,11 @@ class MergedJsAbstract { readfile('apps/maarch_entreprise/js/prototype.js'); readfile('apps/maarch_entreprise/js/scriptaculous.js'); readfile('apps/maarch_entreprise/js/jquery.min.js'); - readfile('apps/maarch_entreprise/js/angular.min.js'); - readfile('apps/maarch_entreprise/js/angular-route.js'); - readfile('apps/maarch_entreprise/js/ng-table.min.js'); + + // readfile('apps/maarch_entreprise/js/angular.min.js'); + // readfile('apps/maarch_entreprise/js/angular-route.js'); + // readfile('apps/maarch_entreprise/js/ng-table.min.js'); + readfile('apps/maarch_entreprise/js/indexing.js'); readfile('apps/maarch_entreprise/js/scrollbox.js'); readfile('apps/maarch_entreprise/js/effects.js'); @@ -58,12 +60,19 @@ class MergedJsAbstract { readfile('apps/maarch_entreprise/js/Chart.js'); readfile('apps/maarch_entreprise/js/chosen.proto.min.js'); readfile('apps/maarch_entreprise/js/event.simulate.js'); - readfile('apps/maarch_entreprise/js/RSVP.js'); - readfile('apps/maarch_entreprise/js/render.js'); - readfile('apps/maarch_entreprise/js/jio.js'); + + //for office.js + //readfile('apps/maarch_entreprise/js/RSVP.js'); + //readfile('apps/maarch_entreprise/js/render.js'); + //readfile('apps/maarch_entreprise/js/jio.js'); + + // readfile('apps/maarch_entreprise/js/app.module.js'); + // readfile('apps/maarch_entreprise/js/aController.js'); - readfile('apps/maarch_entreprise/js/app.module.js'); - readfile('apps/maarch_entreprise/js/aController.js'); + readfile('node_modules/core-js/client/shim.js'); + readfile('node_modules/zone.js/dist/zone.js'); + readfile('node_modules/systemjs/dist/system.src.js'); + readfile('apps/maarch_entreprise/js/angular/systemjs.config.js'); echo "\n"; } @@ -77,11 +86,11 @@ class MergedJsAbstract { { include('modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/functions.js'); } - if(file_exists($_SESSION['config']['corepath'].'custom/'.$_SESSION['custom_override_id'].'/modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js') - || file_exists($_SESSION['config']['corepath'].'/modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js')) - { - include('modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js'); - } + // if(file_exists($_SESSION['config']['corepath'].'custom/'.$_SESSION['custom_override_id'].'/modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js') + // || file_exists($_SESSION['config']['corepath'].'/modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js')) + // { + // include('modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js'); + // } } } } diff --git a/core/class/class_core_tools.php b/core/class/class_core_tools.php index 4380ef27c9ad3900602499efeefcde29cb3cf439..d63c502c5fe96d1fcea9718ca9720283d8840190 100755 --- a/core/class/class_core_tools.php +++ b/core/class/class_core_tools.php @@ -1580,6 +1580,9 @@ class core_tools extends functions var app_path = '<?php echo $_SESSION['config']['businessappurl'];?>static.php?filename='; </script>--> <script type="text/javascript" src="<?php echo $_SESSION['config']['businessappurl'];?>merged_js.php"></script> + <script> + System.import('js/angular/main.js').catch(function(err){ console.error(err); }); + </script> <?php } diff --git a/modules/basket/view_baskets.php b/modules/basket/view_baskets.php index 8585d4811718130e13710e87d924012ac8f4f71c..678b2a317a5addacada11e52dcfcabd8fa501891 100644 --- a/modules/basket/view_baskets.php +++ b/modules/basket/view_baskets.php @@ -313,7 +313,8 @@ if (count($_SESSION['user']['baskets']) > 0) { } ?> </h1> -<div id="inner_content" class="clearfix" ng-controller="basketCtrl"> +<!--div id="inner_content" class="clearfix" ng-controller="basketCtrl"--> +<div id="inner_content" class="clearfix"> <?php diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7de69bb497d8e8f79fdccb229d8fc19a900132f0 --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "MaarchCourrier", + "version": "1.0.0", + "description": "MaarchCourrier", + "scripts": { + "build": "tsc -p apps/maarch_entreprise/js/angular/", + "build:watch": "tsc -p apps/maarch_entreprise/js/angular/ -w" + }, + "keywords": [], + "author": "Maarch", + "license": "GPLV3", + "dependencies": { + "@angular/common": "~2.4.0", + "@angular/compiler": "~2.4.0", + "@angular/core": "~2.4.0", + "@angular/forms": "~2.4.0", + "@angular/http": "~2.4.0", + "@angular/platform-browser": "~2.4.0", + "@angular/platform-browser-dynamic": "~2.4.0", + "@angular/router": "~3.4.0", + + "angular-in-memory-web-api": "~0.2.4", + "systemjs": "0.19.40", + "core-js": "^2.4.1", + "rxjs": "5.0.1", + "zone.js": "^0.7.4" + }, + "devDependencies": { + "typescript": "~2.0.10" + }, + "repository": {} +}