Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static msg(msg, type) {
type = type || 'info';
var config = {
timeOut: type == "error" ? 6000 : 3000,
positionClass: "toast-top-center",
closeButton: true,
newestOnTop: false,
type: type
};
var toastr = new ToasterService();
toastr.pop(config);
// toastr.options = {
// timeOut: type == 'error' ? '6000' : '3000',
// positionClass: "toast-top-center",
// closeButton: true,
// newestOnTop: false
// }
//toastr[type](msg, "")
}
}
KnowledgeIndexComponent,
PriorityIndexComponent,
ProjectViewerComponent,
PrologueComponent,
// Not in use
//BasicsComponent,
//ImplementationComponent,
//ReasonComponent,
//TotalCostIndexComponent
],
exports: [
RouterModule,
],
imports: [
ToasterModule.forRoot(),
MomentModule,
BackboneModule.configure(backboneConfig),
SharedModule,
RouterModule.forChild(coreRoutes),
Angulartics2Module.forRoot(),
ProjectEditorModule,
ProjectViewerModule,
],
providers: [
AppProjectService,
AuthGuard,
CanDeactivateGuard,
DynamicTitleResolve,
Title
]
this.header_components = [];
this.boxed_style = true;
var param = route.snapshot.data[0];
this.skin = this.paramExistOrDefault(param, 'skin', 'skin-blue');
this.display_control = this.paramExistOrDefault(param, 'display_control');
this.display_user = this.paramExistOrDefault(param, 'display_user');
this.display_tasks = this.paramExistOrDefault(param, 'display_tasks');
this.display_messages = this.paramExistOrDefault(param, 'display_messages');
this.display_notifications = this.paramExistOrDefault(param, 'display_notifications');
this.display_menu_user = this.paramExistOrDefault(param, 'display_menu_user');
this.display_menu_search = this.paramExistOrDefault(param, 'display_menu_search');
this.menu_title = this.paramExistOrDefault(param, 'menu_title', '');
this.display_logout = this.paramExistOrDefault(param, 'display_logout', false);
this.header_components = this.paramExistOrDefault(param, 'header_components', []);
this.boxed_style = this.paramExistOrDefault(param, 'boxed_style', true);
this.toastrConfig = new angular2_toaster_1.ToasterConfig({
newestOnTop: true,
showCloseButton: true,
tapToDismiss: false
});
// this.translate = translate.getTranslate();
// this.logger = new LoggerService( this.translate );
}
LayoutAuthComponent.prototype.paramExistOrDefault = function (param, index, default_value) {
constructor(
private userServ: UserService,
private toastr: ToasterService,
private translate: AdminLTETranslateService
) {
this.toastrConfig = new ToasterConfig( {
newestOnTop: true,
showCloseButton: true,
tapToDismiss: false
});
// this.translate = translate.getTranslate();
// this.logger = new LoggerService( this.translate );
}
var resource_pool_service_1 = require("./services/resource-pool-service");
var AppModule = (function () {
function AppModule() {
}
return AppModule;
}());
AppModule = __decorate([
core_1.NgModule({
imports: [
// Angular & External
platform_browser_1.BrowserModule,
forms_1.FormsModule,
http_1.HttpModule,
breeze_bridge_angular2_1.BreezeBridgeAngular2Module,
angular2_moment_1.MomentModule,
angular2_toaster_1.ToasterModule,
// Modules
app_routing_module_1.AppRoutingModule,
custom_error_handler_module_1.CustomErrorHandlerModule,
custom_http_module_1.CustomHttpModule,
ng_chart_module_1.NgChartModule
],
declarations: [
// App
app_component_1.AppComponent,
// Components - Account
account_edit_component_1.AccountEditComponent,
account_overview_component_1.AccountOverviewComponent,
add_password_component_1.AddPasswordComponent,
change_email_component_1.ChangeEmailComponent,
change_password_component_1.ChangePasswordComponent,
change_username_component_1.ChangeUserNameComponent,
ng_lottie_1.LottieAnimationViewModule.forRoot(),
material_1.MatAutocompleteModule,
material_1.MatCheckboxModule,
material_1.MatFormFieldModule,
material_1.MatInputModule,
material_1.MatRadioModule,
material_1.MatSelectModule,
material_1.MatSliderModule,
material_1.MatProgressBarModule,
material_1.MatTabsModule,
material_1.MatButtonToggleModule,
forms_1.ReactiveFormsModule,
table_1.TableModule,
angular2_text_mask_1.TextMaskModule,
ngx_echarts_1.NgxEchartsModule,
angular2_toaster_1.ToasterModule.forRoot(),
primeng_1.TooltipModule,
app_routing_module_1.AppRoutingModule,
dynamic_form_builder_module_1.DynamicFormBuilderModule,
ngx_json_viewer_1.NgxJsonViewerModule,
fusejs_module_1.FuseJsModule,
ngx_order_pipe_1.OrderModule,
ngx_pagination_1.NgxPaginationModule
],
providers: [
eosjs_service_1.EOSJSService,
accounts_service_1.AccountsService,
network_service_1.NetworkService,
crypto_service_1.CryptoService,
ram_service_1.RamService,
// LedgerHWService,
connect_service_1.ConnectService,
messages_box_1.MessagesBoxComponent,
notification_box_1.NotificationBoxComponent,
tasks_box_1.TasksBoxComponent,
user_box_1.UserBoxComponent,
component_loader_1.ComponentLoaderComponent,
// LAYOUTS
auth_1.LayoutAuthComponent,
login_component_1.LayoutLoginComponent,
register_component_1.LayoutRegisterComponent
],
imports: [
platform_browser_1.BrowserModule,
forms_1.FormsModule,
http_1.HttpModule,
router_1.RouterModule,
angular2_toaster_1.ToasterModule,
http_2.HttpClientModule,
core_2.TranslateModule.forRoot({
loader: {
provide: core_2.TranslateLoader,
useFactory: (HttpLoaderFactory),
deps: [http_2.HttpClient]
}
}),
],
exports: [
safe_html_pipes_1.SafeHtmlPipe,
],
providers: [
// SERVICES
user_service_1.UserService,
menu_service_1.MenuService,
// // Edge (IE 12+) => return version number
// // return parseInt( ua.substring( edge + 5, ua.indexOf( '.', edge ) ), 10 );
// return true;
// }
// // other browser
// return false;
return ua.includes('MSIE ') || ua.includes('Trident/') || ua.includes('Edge/');
};
LayoutAuthComponent = __decorate([
core_1.Component({
selector: 'app-layouts-auth',
templateUrl: './auth.html'
}),
__metadata("design:paramtypes", [user_service_1.UserService,
menu_service_1.MenuService,
angular2_toaster_1.ToasterService,
translate_service_1.TranslateService,
router_1.ActivatedRoute])
], LayoutAuthComponent);
return LayoutAuthComponent;
}());
exports.LayoutAuthComponent = LayoutAuthComponent;
popToastFromObject() {
var toast: Toast = {
type: 'info',
title: 'Test Title',
body: 'Test Body',
onHideCallback: () => console.log(toast.title + ' was closed!')
}
var toast2: Toast = {
type: 'success',
title: 'Yay',
body: TestComponent,
bodyOutputType: BodyOutputType.Component
}
var toast3: Toast = {
type: 'success',
title: 'close button',
showCloseButton: true
};
this.toasterService.pop(toast);
this.toasterService.pop(toast2);
this.toasterService.pop(toast3);
}
SendComponent.prototype.showToast = function (type, title, body) {
this.config = new angular2_toaster_1.ToasterConfig({
positionClass: 'toast-top-right',
timeout: 10000,
newestOnTop: true,
tapToDismiss: true,
preventDuplicates: false,
animation: 'slideDown',
limit: 1,
});
var toast = {
type: type,
title: title,
body: body,
timeout: 10000,
showCloseButton: true,
bodyOutputType: angular2_toaster_1.BodyOutputType.TrustedHtml,
};