diff --git a/400-SOURCECODE/Admin/.angular-cli.json b/400-SOURCECODE/Admin/.angular-cli.json new file mode 100644 index 0000000..40ead69 --- /dev/null +++ b/400-SOURCECODE/Admin/.angular-cli.json @@ -0,0 +1,63 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "aianew" + }, + "apps": [ + { + "root": "src", + "outDir": "dist", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "test": "test.ts", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", + "prefix": "app", + "styles": [ + "styles.css" + ], + "scripts": [], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "lint": [ + { + "project": "src/tsconfig.app.json", + "exclude": "**/node_modules/**" + }, + { + "project": "src/tsconfig.spec.json", + "exclude": "**/node_modules/**" + }, + { + "project": "e2e/tsconfig.e2e.json", + "exclude": "**/node_modules/**" + } + ], + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "css", + "class": { + "spec": false + }, + "component": {} + } +} diff --git a/400-SOURCECODE/Admin/.editorconfig b/400-SOURCECODE/Admin/.editorconfig new file mode 100644 index 0000000..6e87a00 --- /dev/null +++ b/400-SOURCECODE/Admin/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/400-SOURCECODE/Admin/.gitignore b/400-SOURCECODE/Admin/.gitignore new file mode 100644 index 0000000..54bfd20 --- /dev/null +++ b/400-SOURCECODE/Admin/.gitignore @@ -0,0 +1,42 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +# System Files +.DS_Store +Thumbs.db diff --git a/400-SOURCECODE/Admin/AIAHTML5.ADMIN.Web.csproj b/400-SOURCECODE/Admin/AIAHTML5.ADMIN.Web.csproj new file mode 100644 index 0000000..199f5c9 --- /dev/null +++ b/400-SOURCECODE/Admin/AIAHTML5.ADMIN.Web.csproj @@ -0,0 +1,52 @@ + + + + netcoreapp2.0 + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + diff --git a/400-SOURCECODE/Admin/Program.cs b/400-SOURCECODE/Admin/Program.cs new file mode 100644 index 0000000..2cb6361 --- /dev/null +++ b/400-SOURCECODE/Admin/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace AIAHTML5.ADMIN.Web +{ + public class Program + { + public static void Main(string[] args) + { + BuildWebHost(args).Run(); + } + + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup() + .Build(); + } +} diff --git a/400-SOURCECODE/Admin/Properties/launchSettings.json b/400-SOURCECODE/Admin/Properties/launchSettings.json new file mode 100644 index 0000000..4e7a255 --- /dev/null +++ b/400-SOURCECODE/Admin/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:52177/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "AIAHTML5.ADMIN.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:52178/" + } + } +} diff --git a/400-SOURCECODE/Admin/README.md b/400-SOURCECODE/Admin/README.md new file mode 100644 index 0000000..ff6352f --- /dev/null +++ b/400-SOURCECODE/Admin/README.md @@ -0,0 +1,27 @@ +# Aianew + +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.4.9. + +## Development server + +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. + +## Code scaffolding + +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. + +## Build + +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/400-SOURCECODE/Admin/Startup.cs b/400-SOURCECODE/Admin/Startup.cs new file mode 100644 index 0000000..a47e514 --- /dev/null +++ b/400-SOURCECODE/Admin/Startup.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; + +namespace AIAHTML5.ADMIN.Web +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.Run(async (context) => + { + await context.Response.WriteAsync("Hello World!"); + }); + } + } +} diff --git a/400-SOURCECODE/Admin/e2e/app.e2e-spec.ts b/400-SOURCECODE/Admin/e2e/app.e2e-spec.ts new file mode 100644 index 0000000..0865d4d --- /dev/null +++ b/400-SOURCECODE/Admin/e2e/app.e2e-spec.ts @@ -0,0 +1,14 @@ +import { AppPage } from './app.po'; + +describe('aianew App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', () => { + page.navigateTo(); + expect(page.getParagraphText()).toEqual('Welcome to app!'); + }); +}); diff --git a/400-SOURCECODE/Admin/e2e/app.po.ts b/400-SOURCECODE/Admin/e2e/app.po.ts new file mode 100644 index 0000000..82ea75b --- /dev/null +++ b/400-SOURCECODE/Admin/e2e/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + navigateTo() { + return browser.get('/'); + } + + getParagraphText() { + return element(by.css('app-root h1')).getText(); + } +} diff --git a/400-SOURCECODE/Admin/e2e/tsconfig.e2e.json b/400-SOURCECODE/Admin/e2e/tsconfig.e2e.json new file mode 100644 index 0000000..1d9e5ed --- /dev/null +++ b/400-SOURCECODE/Admin/e2e/tsconfig.e2e.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/e2e", + "baseUrl": "./", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} diff --git a/400-SOURCECODE/Admin/karma.conf.js b/400-SOURCECODE/Admin/karma.conf.js new file mode 100644 index 0000000..af139fa --- /dev/null +++ b/400-SOURCECODE/Admin/karma.conf.js @@ -0,0 +1,33 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular/cli'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular/cli/plugins/karma') + ], + client:{ + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + reports: [ 'html', 'lcovonly' ], + fixWebpackSourcePaths: true + }, + angularCli: { + environment: 'dev' + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; diff --git a/400-SOURCECODE/Admin/package.json b/400-SOURCECODE/Admin/package.json new file mode 100644 index 0000000..3403df8 --- /dev/null +++ b/400-SOURCECODE/Admin/package.json @@ -0,0 +1,53 @@ +{ + "name": "aianew", + "version": "0.0.0", + "license": "MIT", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@angular/animations": "^4.2.4", + "@angular/common": "^4.2.4", + "@angular/compiler": "^4.2.4", + "@angular/core": "^4.2.4", + "@angular/forms": "^4.2.4", + "@angular/http": "^4.2.4", + "@angular/platform-browser": "^4.2.4", + "@angular/platform-browser-dynamic": "^4.2.4", + "@angular/router": "^4.2.4", + "core-js": "^2.4.1", + "ng2-bs3-modal": "0.10.4", + "ng2-datetime-picker": "0.15.1", + "ng2-modal": "0.0.25", + "ng2-select2": "1.0.0-beta.10", + "rxjs": "^5.4.2", + "zone.js": "^0.8.14" + }, + "devDependencies": { + "@angular/cli": "1.4.9", + "@angular/compiler-cli": "^4.2.4", + "@angular/language-service": "^4.2.4", + "@types/jasmine": "~2.5.53", + "@types/jasminewd2": "~2.0.2", + "@types/node": "~6.0.60", + "codelyzer": "~3.2.0", + "jasmine-core": "~2.6.2", + "jasmine-spec-reporter": "~4.1.0", + "karma": "~1.7.0", + "karma-chrome-launcher": "~2.1.1", + "karma-cli": "~1.0.1", + "karma-coverage-istanbul-reporter": "^1.2.1", + "karma-jasmine": "~1.1.0", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.1.2", + "ts-node": "~3.2.0", + "tslint": "~5.7.0", + "typescript": "~2.3.3" + } +} diff --git a/400-SOURCECODE/Admin/protractor.conf.js b/400-SOURCECODE/Admin/protractor.conf.js new file mode 100644 index 0000000..7ee3b5e --- /dev/null +++ b/400-SOURCECODE/Admin/protractor.conf.js @@ -0,0 +1,28 @@ +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts + +const { SpecReporter } = require('jasmine-spec-reporter'); + +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './e2e/**/*.e2e-spec.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: 'e2e/tsconfig.e2e.json' + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; diff --git a/400-SOURCECODE/Admin/src/app/app.component.css b/400-SOURCECODE/Admin/src/app/app.component.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/app.component.css diff --git a/400-SOURCECODE/Admin/src/app/app.component.html b/400-SOURCECODE/Admin/src/app/app.component.html new file mode 100644 index 0000000..65db480 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/app.component.html @@ -0,0 +1,138 @@ + + + + + +
+
+ + + + + + + + + + + + + +
diff --git a/400-SOURCECODE/Admin/src/app/app.component.spec.ts b/400-SOURCECODE/Admin/src/app/app.component.spec.ts new file mode 100644 index 0000000..9510495 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/app.component.spec.ts @@ -0,0 +1,32 @@ +import { TestBed, async } from '@angular/core/testing'; + +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + AppComponent + ], + }).compileComponents(); + })); + + it('should create the app', async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); + + it(`should have as title 'app'`, async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app.title).toEqual('app'); + })); + + it('should render title in a h1 tag', async(() => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); + })); +}); diff --git a/400-SOURCECODE/Admin/src/app/app.component.ts b/400-SOURCECODE/Admin/src/app/app.component.ts new file mode 100644 index 0000000..498982a --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/app.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit } from '@angular/core'; +import { UserService } from './components/UserEntity/user.service'; +import { ManageDiscountCodeService } from './components/ManageDiscountCode/managediscountcode.service'; +@Component({ + selector: 'app-component', + templateUrl: '../app/app.component.html', + providers: [UserService, ManageDiscountCodeService] +}) + +export class AppComponent implements OnInit { + + constructor(private userservice: UserService) { } + + ngOnInit(): void { } + +} diff --git a/400-SOURCECODE/Admin/src/app/app.module.ts b/400-SOURCECODE/Admin/src/app/app.module.ts new file mode 100644 index 0000000..d948f83 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/app.module.ts @@ -0,0 +1,50 @@ + + +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; +import { APP_BASE_HREF } from '@angular/common'; +import { HttpModule } from '@angular/http'; +import { Ng2Bs3ModalModule } from 'ng2-bs3-modal/ng2-bs3-modal'; + +//import { ModalModule } from 'ngx-bootstrap/modal'; +import { UpdateUserProfile } from './components/UserEntity/updateuserprofile.component'; +import { ChangeUserPassword } from './components/UserEntity/changeuserpassword.component'; +import { ChangeUserID } from './components/UserEntity/changeuserid.component'; +import { UsersList } from './components/UserEntity/users.component'; +import { ManageDiscountCode } from './components/ManageDiscountCode/managediscountcode.component'; +import { AppComponent } from './app.component'; +import { AppRoutingModule } from './app.routing.module'; +//import { AuthGuard } from '../app/authguard.service'; +//import { AuthService } from '../app/auth.service'; +//import { MyInterceptor } from '../app/token.interceptor'; +import { GlobalService } from './Shared/global'; +import { ConfirmService } from './Shared/Confirm/confirm.service'; +import { ConfirmComponent } from "./Shared/Confirm/confirm.component" +@NgModule({ + declarations: [ + ChangeUserPassword, ChangeUserID, + UpdateUserProfile, UsersList, + ManageDiscountCode, + AppComponent, ConfirmComponent + ], + imports: [ + BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule //ModalModule.forRoot() + ], + providers: [GlobalService, ConfirmService, + //AuthService, + //AuthGuard, + //{ + // provide: HTTP_INTERCEPTORS, + // useClass: MyInterceptor, + // multi: true + //} + { provide: APP_BASE_HREF, useValue: '/' } + + ], + bootstrap: [AppComponent] +}) + +export class AppModule { } diff --git a/400-SOURCECODE/Admin/src/app/app.routing.module.ts b/400-SOURCECODE/Admin/src/app/app.routing.module.ts new file mode 100644 index 0000000..8fb5283 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/app.routing.module.ts @@ -0,0 +1,28 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { UpdateUserProfile } from './components/UserEntity/updateuserprofile.component'; +import { ChangeUserPassword } from './components/UserEntity/changeuserpassword.component'; +import { ChangeUserID } from './components/UserEntity/changeuserid.component'; +import { UsersList } from './components/UserEntity/users.component'; +import { ManageDiscountCode } from './components/ManageDiscountCode/managediscountcode.component'; +//import { AuthGuard } from './authguard.service'; + +const appRoutes: Routes = [ + //{ path: '', redirectTo:'updateuserprofile',pathMatch } + { path: 'updateuserprofile', component: UpdateUserProfile }, + { path: 'changeuserpassword', component: ChangeUserPassword }, + { path: 'changeuserid', component: ChangeUserID }, + { path: 'users', component: UsersList }, + { path: 'managediscountcode', component: ManageDiscountCode }, +]; + +@NgModule({ + imports: [ + RouterModule.forRoot(appRoutes, { enableTracing: true }) // <-- debugging purposes only + ], + exports: [ + RouterModule + ] +}) + +export class AppRoutingModule { } diff --git a/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.component.html b/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.component.html new file mode 100644 index 0000000..f4f81e4 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.component.html @@ -0,0 +1,92 @@ +
+ +
+

Change User Password

+
+ + +
+
+ +
+
+
+
+
**To change your profile fill all the text fields carefully.
+
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
Old password is required
+
+
+
+ +
+ + (Minimum 8 characters) +
New password of minimum 8 characters is required
+
+
+
+ +
+ +
Confirm password is required
+
+
+
+
+ + +
+
+ + + +
+ +
+
+
+
+
+
+
+ + +
+ diff --git a/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.component.ts b/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.component.ts new file mode 100644 index 0000000..338b6d6 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.component.ts @@ -0,0 +1,80 @@ +import { Component, OnInit, AfterViewInit } from '@angular/core'; +import { ChangeUserPasswordService } from './changeuserpassword.service'; +import { Router } from '@angular/router'; +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { User } from '../UpdateProfile/datamodel'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +//import { Observable } from 'rxjs/Observable'; + +@Component({ + templateUrl: './changeuserpassword.component.html' +}) + +export class ChangeUserPassword implements OnInit { + +user: User; +changeUserPasswordFrm: FormGroup; +error: any; +alerts: string; + +constructor(private changeUserPasswordService: ChangeUserPasswordService, private router: Router, private fb: FormBuilder) { } + + ngOnInit(): void { + this.user = new User(); + this.alerts = ''; + this.changeUserPasswordFrm = this.fb.group({ + loginId: ['', Validators.required], + oldPassword: ['', Validators.required], + newPassword: ['', [Validators.required, Validators.minLength(8)]], + confirmPassword: ['', Validators.required] + }); + this.GetUserById(); + } + + GetUserById() { + this.changeUserPasswordService.GetUserById() + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + } + + public onFormSubmit() { + if(this.user.Password != this.changeUserPasswordFrm.value.oldPassword){ + this.alerts = 'Old password is invalid'; + } + if(this.changeUserPasswordFrm.value.newPassword != this.changeUserPasswordFrm.value.confirmPassword){ + this.alerts += '
New password and confirm password must be same'; + } + if(this.alerts != ''){ + this.user = this.changeUserPasswordFrm.value; + var obj = this.user + return this.changeUserPasswordService.ChangeUserPassword(obj) + .subscribe( + n => (this.AfterInsertData(n)), + error => this.error = error); + } + } + + AfterInsertData(data) { + if (data.Status == "false") { + this.alerts = "Password change unsuccessfull"; + } else { + this.alerts = "Password changed successfully"; + } + } + + BindFormFields(data){ + this.user = data[0]; + this.changeUserPasswordFrm.controls['loginId'].setValue(this.user.LoginId); + } + + ResetFormFields(){ + this.changeUserPasswordFrm.reset() + this.changeUserPasswordFrm.controls['loginId'].setValue(this.user.LoginId); + this.changeUserPasswordFrm.controls['oldPassword'].setValue(''); + this.changeUserPasswordFrm.controls['newPassword'].setValue(''); + this.changeUserPasswordFrm.controls['confirmPassword'].setValue(''); + this.alerts = ''; + } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.service.ts b/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.service.ts new file mode 100644 index 0000000..917721b --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ChangePassword/changeuserpassword.service.ts @@ -0,0 +1,78 @@ +import { Injectable, Inject } from '@angular/core'; +//import { HttpClient, HttpParams, HttpRequest} from "@angular/common/http"; +import { Http, Response, Headers, RequestOptions, HttpModule } from '@angular/http'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/catch'; +import 'rxjs/add/observable/throw'; +import { User } from '../UpdateProfile/datamodel'; +import 'rxjs/add/operator/do'; +import { Observable } from 'rxjs/Observable'; +import { GlobalService } from '../../Shared/global'; + +@Injectable() +export class ChangeUserPasswordService { + + constructor(private http: Http, private commonService: GlobalService ) { } + + //public GetUserById(Id: any): Observable { + // return this.http.request( + // 'GET', + // 'http://192.168.86.13:92/API/Api/Users/' + Id); + //} + + //GetUserByLoginIdPassword(LoginId: string, Password: string): Observable { + // return this.http.request( + // 'GET', + // 'http://192.168.86.13:92/API/Api/Users/{LoginId=' + LoginId + '&Password=' + Password + '}'); + //} + + //UpdateProfile(UserObj: User): Observable { + // return this.http.request( + // 'POST', + // 'http://192.168.86.13:92/API/Api/Users/UpdateProfile', + // { + // body: UserObj + // }); + //} + + GetUserById() { + return this.http.get(this.commonService.resourceBaseUrl + "/api/GetUserProfile/1") + .map(this.extractData) + .catch((res: Response) => this.handleError(res));; + } + + ChangeUserPassword(obj: User) { + //let options = new RequestOptions({ headers: this.headers }); + return this.http.post(this.commonService.resourceBaseUrl + "/api/ChangeUserPassword", obj) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + extractData(res: Response) { + //debugger; + let body = res.json(); + return body; + } + + handleError(error: any) { + // In a real world app, we might use a remote logging infrastructure + // We'd also dig deeper into the error to get a better message + let errMsg = (error.message) ? error.message : + error.status ? `${error.status} - ${error.statusText}` : 'Server error'; + console.error(errMsg); // log to console instead + return Observable.throw(errMsg); + } + + ////public GetUserById(url: string): Observable { + + //// return this._http.get(url) + //// .map((response: Response) => response.json()) + //// .do(data => console.log("All: " + JSON.stringify(data))) + //// .catch(this.handleError); + ////} + //// private handleError(error: Response) { + //// console.error(error); + //// return Observable.throw(error.json().error || 'Server error'); + //// } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/ChangeUserID/UserInfo.ts b/400-SOURCECODE/Admin/src/app/components/ChangeUserID/UserInfo.ts new file mode 100644 index 0000000..993e253 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ChangeUserID/UserInfo.ts @@ -0,0 +1,7 @@ +export class UserInfo { + Id: number; + LoginId: string; + NewLoginId: string; + ConfirmLoginId: string; +} + diff --git a/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.component.html b/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.component.html new file mode 100644 index 0000000..8f01190 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.component.html @@ -0,0 +1,84 @@ +
+ +
+

Change User ID

+
+ + +
+
+
+
+
+
+
**To change your user ID fill all the text fields carefully.
+
+ +
+
+ +
+ +
UserId is required
+
+
+
+ +
+ + (Minimum 8 characters) +
New userid is required
+ +
+ Minimum 8 characters. +
+
+
+
+ +
+ +
+
+ +
+
+ + + + + +
+ +
+
+ +
+
+
+
+
+ +
+
+ + +
diff --git a/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.component.ts b/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.component.ts new file mode 100644 index 0000000..c19bb70 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.component.ts @@ -0,0 +1,173 @@ +import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core'; +import { ChangeUserIDService } from '../ChangeUserID/changeuserid.service'; +import { UserService } from '../UpdateProfile/user.service'; +import { Router } from '@angular/router'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { UserInfo } from '../ChangeUserID/UserInfo'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +import { Observable } from 'rxjs/Observable'; +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; +import 'rxjs/Rx'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/filter'; + + +@Component({ + templateUrl:'./changeuserid.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html' +}) + +export class ChangeUserID implements OnInit { + UserId: number=1; + //users: IUser[]; + user: UserInfo; + //msg: string; + //indLoading: boolean = false; + // dbops: DBOperation; + modalTitle: string; + modalBtnTitle: string; + baseUrl: string = "User"; + ChangeUserIdFrm: FormGroup; + useFname: string; + error; + status: boolean; + alerts: string; + emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"; + //@ViewChild("profileModal") + //profileModal: ModalComponent; + //errorMessage: any; + constructor(private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, + private _confirmService: ConfirmService + ) { } + + ngOnInit(): void { + this.user = new UserInfo(); + this.alerts = ''; + //this.userservice.GetUserById(this.UserId); + this.ChangeUserIdFrm = this.fb.group({ + id: [''], + loginid: ['', Validators.required], + newloginid: ['', Validators.required], + confirmloginid: ['', Validators.required] + // LastName: [''], + // Gender: ['', Validators.required], + // Email: [''] + + }); + this.GetUserById(); + } + //ngAfterviewint() { + // this.LoadUsers(); + //} + + + //getCustomerById(UserId) { + // return this.userservice.GetUserById(UserId) + // .map((response: Response) => response.json()) + // .catch(this._errorHandler) + //} + //formErrors = { + // 'firstName': '', + // 'lastName': '', + // 'email': '' + //}; + GetUserById() { + + this.userservice.GetUserById() + .subscribe(x => { console.log(x); this.bindUsers(x) }, error => this.error = error); + } + UpdateUserProfile(this) { + // debugger; + this.user = this.ChangeUserIdFrm.value; + //if(this.user.) + console.log(this.user); + var obj = this.user + if (this.ChangeUserIdFrm.valid) { + return this.userservice.UpdateUserProfileById(obj) + .subscribe( + n => (this.AfterInsertData(n)), + error => this.error = error); + } + } + AfterInsertData(data) { + //debugger; + if (data.Status == "False") { + // this._confirmService.activate(data.ResponseMessage, "alertMsg"); + //setTimeout(() => this.amCode.nativeElement.focus(), 0); + // this.closeflag = false; + return false; + } else { + this.status = true; + debugger; + + this._confirmService.activate("User Profile Updated Successfully.", "alertMsg"); + //this.profileModal.open(); + // this.submitted = false; + // this.GetAllAcctMgr(); + // this.DisableAllControls(); + // this.AccountManagerID.enable(); + // let accountManagerID: string = data.Id == null ? "" : data.Id.toString(); + // console.log(accountManagerID); + + // this.GetAcctMgr(Number(accountManagerID)); + //this.GetAccountManagerListOptions(false); + // this.defautValue = data.id; + // this.BtnReset = true; + // this.BtnSave = true; + // this.BtnEdit = false; + // this.BtnNew = false; + // this.BtnDelete = false; + // this.Abbrevtion = this.Abbrev.value; + // setTimeout(() => this.AMform.controls["AccountManagerID"].setValue(accountManagerID.toString()), 1000); + // setTimeout(() => this.AMform.markAsPristine(), 2000); + } + //if (this.closeflag) { + // this.close.emit(null); + //} + //else { + //} + } + bindUsers(data) { + debugger; + //console.log(data); + //alert(JSON.stringify(data)); + this.user = data[0]; + + console.log(this.user); + this.ChangeUserIdFrm.controls['id'].setValue(this.user.Id) + this.ChangeUserIdFrm.controls['loginid'].setValue(this.user.LoginId) + this.ChangeUserIdFrm.controls['newloginid'].setValue('') + this.ChangeUserIdFrm.controls['confirmloginid'].setValue('') + // this.GetClientListOptions(false); + // this.GetCrossRefClientListOptions(false); + } + //extractData(res: Response) { + // //debugger; + // let body = res.json(); + // return body; + //} + //handleError(error: any) { + + // // In a real world app, we might use a remote logging infrastructure + // // We'd also dig deeper into the error to get a better message + // let errMsg = (error.message) ? error.message : + // error.status ? `${error.status} - ${error.statusText}` : 'Server error'; + // console.error(errMsg); // log to console instead + // return Observable.throw(errMsg); + //} + validationMessages = { + 'firstName': { + 'required': 'First name is required.' + }, + 'lastName': { + 'required': 'Last name is required.' + }, + 'email': { + 'required': 'Email is required.', + 'pattern': 'Email pattern is not valid.' + } + } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.service.ts b/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.service.ts new file mode 100644 index 0000000..3933aca --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ChangeUserID/changeuserid.service.ts @@ -0,0 +1,56 @@ +import { Injectable, Inject } from '@angular/core'; +//import { HttpClient, HttpParams, HttpRequest} from "@angular/common/http"; +import { Http, Response, Headers, RequestOptions, HttpModule } from '@angular/http'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/catch'; +import 'rxjs/add/observable/throw'; +import { UserInfo } from '../ChangeUserID/UserInfo'; +import 'rxjs/add/operator/do'; +import { Observable } from 'rxjs/Observable'; +import { GlobalService } from '../../Shared/global'; +@Injectable() +export class ChangeUserIDService { + + constructor(private http: Http, private commonService: GlobalService ) { } + + GetUserById() { + + return this.http.get(this.commonService.resourceBaseUrl + "/api/GetUserProfile/1") + .map(this.extractData) + .catch((res: Response) => this.handleError(res));; + + } + UpdateUserProfileById(obj: UserInfo) { + //let options = new RequestOptions({ headers: this.headers }); + return this.http.post(this.commonService.resourceBaseUrl + "/api/UpdateProfile", obj) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + extractData(res: Response) { + //debugger; + let body = res.json(); + return body; + } + handleError(error: any) { + + // In a real world app, we might use a remote logging infrastructure + // We'd also dig deeper into the error to get a better message + let errMsg = (error.message) ? error.message : + error.status ? `${error.status} - ${error.statusText}` : 'Server error'; + console.error(errMsg); // log to console instead + return Observable.throw(errMsg); + } + ////public GetUserById(url: string): Observable { + + //// return this._http.get(url) + //// .map((response: Response) => response.json()) + //// .do(data => console.log("All: " + JSON.stringify(data))) + //// .catch(this.handleError); + ////} + //// private handleError(error: Response) { + //// console.error(error); + //// return Observable.throw(error.json().error || 'Server error'); + //// } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.html b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.html new file mode 100644 index 0000000..4b5c9ce --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.html @@ -0,0 +1,201 @@ +
+ +
+

{{Mode}} Discount Code

+
+ + +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+
+ + + + +
+
+
+
+
+
+
+
+
+
+ +
+
+ + + + +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
Discount CodePercentageDiscount Start DateDiscount End DateStatus
{{item.DiscountCode}}{{item.Percentage | number : '1.2'}}{{item.StartDate | date: 'MM/dd/yyyy'}}{{item.EndDate | date: 'MM/dd/yyyy'}} + Active + Inactive +
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+ +
+
+ +
+ + +
+
+
+ +
+
+ + + + +
+
+
+
+ +
+
+ + + + +
+
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+ + + + +
+ +
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts new file mode 100644 index 0000000..ea5f699 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts @@ -0,0 +1,118 @@ +import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter } from '@angular/core'; +import { ManageDiscountCodeService } from './managediscountcode.service'; +import { Router } from '@angular/router'; +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { DiscountCode } from '../UserEntity/datamodel'; +//import { BsDatepickerModule } from 'ngx-bootstrap'; +import { Http, Response } from '@angular/http'; + +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +//import { Observable } from 'rxjs/Observable'; + +@Component({ + templateUrl: './managediscountcode.component.html' +}) + +export class ManageDiscountCode implements OnInit { + +Mode: string = 'Manage'; +discountCode: DiscountCode; +discountCodes: Array; +manageDiscountCodeFrm: FormGroup; +insertUpdateDiscountCodeFrm: FormGroup; +error: any; +alerts: string; +divClass: string = ''; +topPos: string = '2000px'; +bsValue: Date = new Date(); + +constructor(private manageDiscountCodeService: ManageDiscountCodeService, private router: Router, private fb: FormBuilder) { } + + ngOnInit(): void { + this.divClass = 'col-sm-12'; + this.discountCode = new DiscountCode(); + this.alerts = ''; + this.manageDiscountCodeFrm = this.fb.group({ + searchDiscountCode: [''], + searchStartDate: [''], + searchEndDate: [''], + discountCodes: this.fb.array([]) + }); + this.insertUpdateDiscountCodeFrm = this.fb.group({ + discountId: [''], + discountCode: ['', Validators.required], + startDate: ['', Validators.required], + endDate: ['', Validators.required], + percentage: ['', Validators.required], + isActive: [''] + }); + this.SearchDiscountCodes(); + } + + SearchDiscountCodes() { + console.log(this.manageDiscountCodeFrm.controls['searchDiscountCode'].value + ', ' + + this.manageDiscountCodeFrm.controls['searchStartDate'].value + ', ' + + this.manageDiscountCodeFrm.controls['searchEndDate'].value); + this.manageDiscountCodeService.GetDiscountCodes( + { + discountCode: this.manageDiscountCodeFrm.controls['searchDiscountCode'].value, + startDate: this.manageDiscountCodeFrm.controls['searchStartDate'].value, + endDate: this.manageDiscountCodeFrm.controls['searchEndDate'].value + }) + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + } + + public InsertUpdateDiscountCode() { + console.log('InsertUpdateDiscountCode'); + this.alerts = ''; + + if(this.alerts == ''){ + var obj = this.insertUpdateDiscountCodeFrm.value; + return this.manageDiscountCodeService.InsertDiscountCode(obj) + .subscribe( + n => (this.AfterInsertData(n)), + error => this.error = error); + } + } + + AfterInsertData(data) { + if (data.Status == "false") { + this.alerts = "Password change unsuccessfully"; + } else { + this.alerts = "Password changed successfully"; + } + } + + BindFormFields(data){ + this.discountCodes = data; + this.manageDiscountCodeFrm.setControl('discountCodes', this.fb.array(this.discountCodes)); + } + + ResetFormFields(){ + this.manageDiscountCodeFrm.reset() + //this.manageDiscountCodeFrm.controls['loginId'].setValue(this.user.LoginId); + //this.manageDiscountCodeFrm.controls['oldPassword'].setValue(''); + //this.manageDiscountCodeFrm.controls['newPassword'].setValue(''); + //this.manageDiscountCodeFrm.controls['confirmPassword'].setValue(''); + this.alerts = ''; + } + + AddDiscountCode(){ + this.Mode = 'Add'; + this.topPos = '100px'; + this.divClass = 'col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3'; + } + + EditDiscountCode(){ + this.Mode = 'Edit'; + this.topPos = '100px'; + this.divClass = 'col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3'; + } + + CancelAddEdit(){ + this.Mode = 'Manage'; + this.topPos = '2000px'; + this.divClass = 'col-sm-12'; + } +} diff --git a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts new file mode 100644 index 0000000..17c66f3 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts @@ -0,0 +1,103 @@ +import { Injectable, Inject } from '@angular/core'; +//import { HttpClient, HttpParams, HttpRequest} from "@angular/common/http"; +import { Http, Response, Headers, RequestOptions, HttpModule } from '@angular/http'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/catch'; +import 'rxjs/add/observable/throw'; +import 'rxjs/add/operator/do'; +import { Observable } from 'rxjs/Observable'; +import { GlobalService } from '../../Shared/global'; + +@Injectable() +export class ManageDiscountCodeService { + + constructor(private http: Http, private commonService: GlobalService ) { } + + //public GetUserById(Id: any): Observable { + // return this.http.request( + // 'GET', + // 'http://192.168.86.13:92/API/Api/Users/' + Id); + //} + + //GetUserByLoginIdPassword(LoginId: string, Password: string): Observable { + // return this.http.request( + // 'GET', + // 'http://192.168.86.13:92/API/Api/Users/{LoginId=' + LoginId + '&Password=' + Password + '}'); + //} + + //UpdateProfile(UserObj: User): Observable { + // return this.http.request( + // 'POST', + // 'http://192.168.86.13:92/API/Api/Users/UpdateProfile', + // { + // body: UserObj + // }); + //} + + GetDiscountCodes(obj: any) { + if(obj.startDate == ''){ + obj.startDate = '1/1/1'; + } + if(obj.endDate == ''){ + obj.endDate = '1/1/9999'; + } + return this.http.get(this.commonService.resourceBaseUrl + "/api/GetDiscountCodes?discountCode=" + + obj.discountCode + "&startDate=" + obj.startDate + "&endDate=" + obj.endDate) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + InsertDiscountCode(obj: any) { + //let options = new RequestOptions({ headers: this.headers }); + var jsonData = {'id': obj.userId, 'newPassword': obj.newPassword }; + console.log(obj); + var headers = new Headers({ + 'Content-Type': 'application/json' + }); + return this.http.post(this.commonService.resourceBaseUrl + "/api/ChangeUserPassword", + JSON.stringify(jsonData), {headers: headers}) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + UpdateDiscountCode(obj: any) { + //let options = new RequestOptions({ headers: this.headers }); + var jsonData = {'id': obj.userId, 'newPassword': obj.newPassword }; + console.log(obj); + var headers = new Headers({ + 'Content-Type': 'application/json' + }); + return this.http.post(this.commonService.resourceBaseUrl + "/api/ChangeUserPassword", + JSON.stringify(jsonData), {headers: headers}) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + extractData(res: Response) { + //debugger; + let body = res.json(); + return body; + } + + handleError(error: any) { + // In a real world app, we might use a remote logging infrastructure + // We'd also dig deeper into the error to get a better message + let errMsg = (error.message) ? error.message : + error.status ? `${error.status} - ${error.statusText}` : 'Server error'; + console.error(errMsg); // log to console instead + return Observable.throw(errMsg); + } + + ////public GetUserById(url: string): Observable { + + //// return this._http.get(url) + //// .map((response: Response) => response.json()) + //// .do(data => console.log("All: " + JSON.stringify(data))) + //// .catch(this.handleError); + ////} + //// private handleError(error: Response) { + //// console.error(error); + //// return Observable.throw(error.json().error || 'Server error'); + //// } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/UpdateProfile/datamodel.ts b/400-SOURCECODE/Admin/src/app/components/UpdateProfile/datamodel.ts new file mode 100644 index 0000000..9724f49 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UpdateProfile/datamodel.ts @@ -0,0 +1,43 @@ +export class User { + LoginId: string; + Password: string; + Id: number; + FirstName: string; + LastName: string; + EmailId: string; +} +//export class User { +// userId: number; +// firstName: string; +// lastName: string; +// emailId: string; +// loginId: string; +// Password: string; +// securityQuestiuonId: number; +// securityAnswer: string; +// creatorId: number; +// creationDate: Date; +// deactivationDate: Date; +// modifierId: number; +// modifiedDate: Date; +// userTypeId: number; +// isActive: boolean; +//} + +export interface IUser { + userId: number; + firstName: string; + lastName: string; + emailId: string; + loginId: string; + password: string; + securityQuestiuonId: number; + securityAnswer: string; + creatorId: number; + creationDate: Date; + deactivationDate: Date; + modifierId: number; + modifiedDate: Date; + userTypeId: number; + isActive: boolean; +} diff --git a/400-SOURCECODE/Admin/src/app/components/UpdateProfile/updateuserprofile.component.html b/400-SOURCECODE/Admin/src/app/components/UpdateProfile/updateuserprofile.component.html new file mode 100644 index 0000000..83a9921 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UpdateProfile/updateuserprofile.component.html @@ -0,0 +1,87 @@ +
+ +
+

Update Profile

+
+
+
+
+
+
+
+
**To update your profile fill all the text fields carefully.
+
+ +
+
+
+
+
+
+
+
+ + +
+ +
First name is required
+
+
+
+ +
+ +
Last name is required
+
+
+
+ +
+ + +
Email id is required
+ +
+ Please enter the correct email. +
+
+
+
+
+ + + + + + +
+ +
+
+ +
+
+
+
+
+
+
+
diff --git a/400-SOURCECODE/Admin/src/app/components/UpdateProfile/updateuserprofile.component.ts b/400-SOURCECODE/Admin/src/app/components/UpdateProfile/updateuserprofile.component.ts new file mode 100644 index 0000000..a491d3f --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UpdateProfile/updateuserprofile.component.ts @@ -0,0 +1,172 @@ +import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core'; +import { UserService } from '../UpdateProfile/user.service'; +import { Router } from '@angular/router'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { User } from '../UpdateProfile/datamodel'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +import { Observable } from 'rxjs/Observable'; +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; +import 'rxjs/Rx'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/filter'; + + +@Component({ + templateUrl:'./updateuserprofile.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html' +}) + +export class UpdateUserProfile implements OnInit { + UserId: number=1; + //users: IUser[]; + user: User; + msg: string; + indLoading: boolean = false; + // dbops: DBOperation; + modalTitle: string; + modalBtnTitle: string; + baseUrl: string = "User"; + userFrm: FormGroup; + useFname: string; + error; + status: boolean; + alerts: string; + emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"; + //@ViewChild("profileModal") + //profileModal: ModalComponent; + //errorMessage: any; + constructor(private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, + private _confirmService: ConfirmService + ) { } + + ngOnInit(): void { + this.user = new User(); + this.alerts = ''; + //this.userservice.GetUserById(this.UserId); + this.userFrm = this.fb.group({ + id: [''], + firstName: ['', Validators.required], + lastName: ['', Validators.required], + emailId: ['', Validators.required] + // LastName: [''], + // Gender: ['', Validators.required], + // Email: [''] + + }); + this.GetUserById(); + } + //ngAfterviewint() { + // this.LoadUsers(); + //} + + + //getCustomerById(UserId) { + // return this.userservice.GetUserById(UserId) + // .map((response: Response) => response.json()) + // .catch(this._errorHandler) + //} + //formErrors = { + // 'firstName': '', + // 'lastName': '', + // 'email': '' + //}; + GetUserById() { + + this.userservice.GetUserById() + .subscribe(x => { console.log(x); this.bindUsers(x) }, error => this.error = error); + } + UpdateUserProfile(this) { + // debugger; + this.user = this.userFrm.value; + //if(this.user.) + console.log(this.user); + var obj = this.user + if (this.userFrm.valid) { + return this.userservice.UpdateUserProfileById(obj) + .subscribe( + n => (this.AfterInsertData(n)), + error => this.error = error); + } + } + AfterInsertData(data) { + //debugger; + if (data.Status == "False") { + // this._confirmService.activate(data.ResponseMessage, "alertMsg"); + //setTimeout(() => this.amCode.nativeElement.focus(), 0); + // this.closeflag = false; + return false; + } else { + this.status = true; + debugger; + + this._confirmService.activate("User Profile Updated Successfully.", "alertMsg"); + //this.profileModal.open(); + // this.submitted = false; + // this.GetAllAcctMgr(); + // this.DisableAllControls(); + // this.AccountManagerID.enable(); + // let accountManagerID: string = data.Id == null ? "" : data.Id.toString(); + // console.log(accountManagerID); + + // this.GetAcctMgr(Number(accountManagerID)); + //this.GetAccountManagerListOptions(false); + // this.defautValue = data.id; + // this.BtnReset = true; + // this.BtnSave = true; + // this.BtnEdit = false; + // this.BtnNew = false; + // this.BtnDelete = false; + // this.Abbrevtion = this.Abbrev.value; + // setTimeout(() => this.AMform.controls["AccountManagerID"].setValue(accountManagerID.toString()), 1000); + // setTimeout(() => this.AMform.markAsPristine(), 2000); + } + //if (this.closeflag) { + // this.close.emit(null); + //} + //else { + //} + } + bindUsers(data) { + debugger; + //console.log(data); + //alert(JSON.stringify(data)); + this.user = data[0]; + + console.log(this.user); + this.userFrm.controls['id'].setValue(this.user.Id) + this.userFrm.controls['firstName'].setValue(this.user.FirstName) + this.userFrm.controls['lastName'].setValue(this.user.LastName) + this.userFrm.controls['emailId'].setValue(this.user.EmailId) + // this.GetClientListOptions(false); + // this.GetCrossRefClientListOptions(false); + } + //extractData(res: Response) { + // //debugger; + // let body = res.json(); + // return body; + //} + //handleError(error: any) { + + // // In a real world app, we might use a remote logging infrastructure + // // We'd also dig deeper into the error to get a better message + // let errMsg = (error.message) ? error.message : + // error.status ? `${error.status} - ${error.statusText}` : 'Server error'; + // console.error(errMsg); // log to console instead + // return Observable.throw(errMsg); + //} + validationMessages = { + 'firstName': { + 'required': 'First name is required.' + }, + 'lastName': { + 'required': 'Last name is required.' + }, + 'email': { + 'required': 'Email is required.', + 'pattern': 'Email pattern is not valid.' + } + } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/UpdateProfile/user.service.ts b/400-SOURCECODE/Admin/src/app/components/UpdateProfile/user.service.ts new file mode 100644 index 0000000..8bd38be --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UpdateProfile/user.service.ts @@ -0,0 +1,56 @@ +import { Injectable, Inject } from '@angular/core'; +//import { HttpClient, HttpParams, HttpRequest} from "@angular/common/http"; +import { Http, Response, Headers, RequestOptions, HttpModule } from '@angular/http'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/catch'; +import 'rxjs/add/observable/throw'; +import { User } from '../UpdateProfile/datamodel'; +import 'rxjs/add/operator/do'; +import { Observable } from 'rxjs/Observable'; +import { GlobalService } from '../../Shared/global'; +@Injectable() +export class UserService { + + constructor(private http: Http, private commonService: GlobalService ) { } + + GetUserById() { + + return this.http.get(this.commonService.resourceBaseUrl + "/api/GetUserProfile/1") + .map(this.extractData) + .catch((res: Response) => this.handleError(res));; + + } + UpdateUserProfileById(obj: User) { + //let options = new RequestOptions({ headers: this.headers }); + return this.http.post(this.commonService.resourceBaseUrl + "/api/UpdateProfile", obj) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + extractData(res: Response) { + //debugger; + let body = res.json(); + return body; + } + handleError(error: any) { + + // In a real world app, we might use a remote logging infrastructure + // We'd also dig deeper into the error to get a better message + let errMsg = (error.message) ? error.message : + error.status ? `${error.status} - ${error.statusText}` : 'Server error'; + console.error(errMsg); // log to console instead + return Observable.throw(errMsg); + } + ////public GetUserById(url: string): Observable { + + //// return this._http.get(url) + //// .map((response: Response) => response.json()) + //// .do(data => console.log("All: " + JSON.stringify(data))) + //// .catch(this.handleError); + ////} + //// private handleError(error: Response) { + //// console.error(error); + //// return Observable.throw(error.json().error || 'Server error'); + //// } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserid.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserid.component.html new file mode 100644 index 0000000..f6e4cea --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserid.component.html @@ -0,0 +1,88 @@ +
+ +
+

Change User ID

+
+ + +
+
+
+
+
+
+
**To change your user ID fill all the text fields carefully.
+
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ + (Minimum 8 characters) +
Minimum 8 characters is required
+ +
+
+
+ +
+ +
Confirm userid is required
+
+
+ +
+
+ + + + + + +
+ +
+
+ +
+
+
+
+
+ +
+
+ + +
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserid.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserid.component.ts new file mode 100644 index 0000000..8a2ccc0 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserid.component.ts @@ -0,0 +1,121 @@ +import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core'; +import { UserService } from './user.service'; +import { Router } from '@angular/router'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { User } from '../UserEntity/datamodel'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +import { Observable } from 'rxjs/Observable'; +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; +import 'rxjs/Rx'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/filter'; + + +@Component({ + templateUrl:'./changeuserid.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html' +}) + +export class ChangeUserID implements OnInit { + UserId: number=1; + user: User; + modalTitle: string; + modalBtnTitle: string; + baseUrl: string = "User"; + ChangeUserIdFrm: FormGroup; + useFname: string; + error; + status: boolean; + alerts: string; + //@ViewChild("profileModal") + //profileModal: ModalComponent; + //errorMessage: any; + constructor(private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, + private _confirmService: ConfirmService + ) { } + + ngOnInit(): void { + this.user = new User(); + this.alerts = ''; + //this.userservice.GetUserById(this.UserId); + this.ChangeUserIdFrm = this.fb.group({ + id: [''], + loginid: ['', Validators.required], + newloginid: ['', [Validators.required, Validators.minLength(8)]], + confirmloginid: ['', Validators.required] + // LastName: [''], + // Gender: ['', Validators.required], + // Email: [''] + + }); + this.GetUserById(); + } + + GetUserById() { + this.userservice.GetUserById() + .subscribe(x => { console.log(x); this.bindUsers(x) }, error => this.error = error); + } + UpdateUserId(this) { + // debugger; + this.alerts = ''; + + if (this.user.LoginId == this.ChangeUserIdFrm.value.newloginid) { + this.alerts += '
New userid and old userid must be different'; + } + if (this.ChangeUserIdFrm.value.newloginid != this.ChangeUserIdFrm.value.confirmloginid) { + this.alerts += '
New userid and confirm userid must be same'; + } + if (this.alerts == '') { + this.user = this.ChangeUserIdFrm.value; + //if(this.user.) + console.log(this.user); + var obj = this.user + if (this.ChangeUserIdFrm.valid) { + return this.userservice.UpdateUserId(obj) + .subscribe( + n => (this.AfterInsertData(n)), + error => this.error = error); + } + } + } + AfterInsertData(data) { + + if (data == "success") { + this._confirmService.activate("Userid Updated Successfully.", "alertMsg"); + + } else { + this.alerts += '' + data+''; + return false; + + + } + //if (this.closeflag) { + // this.close.emit(null); + //} + //else { + //} + } + bindUsers(data) { + + //console.log(data); + //alert(JSON.stringify(data)); + this.user = data[0]; + + console.log(this.user); + this.ChangeUserIdFrm.controls['id'].setValue(this.user.Id) + this.ChangeUserIdFrm.controls['loginid'].setValue(this.user.LoginId) + this.ChangeUserIdFrm.controls['newloginid'].setValue(this.user.NewLoginId) + this.ChangeUserIdFrm.controls['confirmloginid'].setValue('') + } + ResetFormFields() { + this.ChangeUserIdFrm.reset() + this.ChangeUserIdFrm.controls['id'].setValue(this.user.Id) + this.ChangeUserIdFrm.controls['loginid'].setValue(this.user.LoginId) + this.ChangeUserIdFrm.controls['newloginid'].setValue('') + this.ChangeUserIdFrm.controls['confirmloginid'].setValue('') + this.alerts = ''; + } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserpassword.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserpassword.component.html new file mode 100644 index 0000000..1466f21 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserpassword.component.html @@ -0,0 +1,92 @@ +
+ +
+

Change User Password

+
+ + +
+
+
+
+
+
+
**To change your profile fill all the text fields carefully.
+
+ +
+
+
+
+
+
+
+
+ +
+ + +
+
+
+ +
+ +
Old password is required
+
+
+
+ +
+ + (Minimum 8 characters) +
New password of minimum 8 characters is required
+
+
+
+ +
+ +
Confirm password is required
+
+
+
+
+ + +
+
+ + + +
+ +
+
+
+
+
+ +
+
+ + +
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserpassword.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserpassword.component.ts new file mode 100644 index 0000000..81c3182 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserpassword.component.ts @@ -0,0 +1,95 @@ +import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core'; +import { UserService } from './user.service'; +//import { ChangeUserPasswordService } from '../ChangePassword/changeuserpassword.service'; +import { Router } from '@angular/router'; +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { User } from '../UserEntity/datamodel'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +//import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs/Observable'; +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; +import 'rxjs/Rx'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/filter'; + +@Component({ + templateUrl: './changeuserpassword.component.html' +}) + +export class ChangeUserPassword implements OnInit { + +user: User; +changeUserPasswordFrm: FormGroup; +error: any; +alerts: string; + +constructor(private changeUserPasswordService: UserService, private router: Router, private fb: FormBuilder, private _confirmService: ConfirmService) { } + + ngOnInit(): void { + this.user = new User(); + this.alerts = ''; + this.changeUserPasswordFrm = this.fb.group({ + userId: [''], + loginId: ['', Validators.required], + oldPassword: ['', Validators.required], + newPassword: ['', [Validators.required, Validators.minLength(8)]], + confirmPassword: ['', Validators.required] + }); + this.GetUserById(); + } + + GetUserById() { + + this.changeUserPasswordService.GetUserById() + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + } + + public onFormSubmit() { + this.alerts = ''; + if (this.user.Password != this.changeUserPasswordFrm.value.oldPassword) { + this.alerts = 'Old password is invalid'; + } + if (this.user.Password == this.changeUserPasswordFrm.value.newPassword) { + this.alerts += '
New password and old password must be different'; + } + if (this.changeUserPasswordFrm.value.newPassword != this.changeUserPasswordFrm.value.confirmPassword) { + this.alerts += '
New password and confirm password must be same'; + } + if (this.alerts == '') { + var obj = this.changeUserPasswordFrm.value; + return this.changeUserPasswordService.ChangeUserPassword(obj) + .subscribe( + n => (this.AfterInsertData(n)), + error => this.error = error); + } + } + + + AfterInsertData(data) { + if (data.Status == "false") { + this.alerts = "Password change unsuccessfull"; + } else { + this._confirmService.activate("Password changed successfully.", "alertMsg"); + //this.alerts = "Password changed successfully"; + } + } + + BindFormFields(data){ + this.user = data[0]; + this.changeUserPasswordFrm.controls['userId'].setValue(this.user.Id); + this.changeUserPasswordFrm.controls['loginId'].setValue(this.user.LoginId); + + } + + ResetFormFields(){ + this.changeUserPasswordFrm.reset() + this.changeUserPasswordFrm.controls['loginId'].setValue(this.user.LoginId); + this.changeUserPasswordFrm.controls['oldPassword'].setValue(''); + this.changeUserPasswordFrm.controls['newPassword'].setValue(''); + this.changeUserPasswordFrm.controls['confirmPassword'].setValue(''); + this.alerts = ''; + } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts new file mode 100644 index 0000000..7c77734 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts @@ -0,0 +1,17 @@ +export class User { + LoginId: string; + Password: string; + Id: number; + FirstName: string; + LastName: string; + EmailId: string; + NewLoginId: string; +} +export class DiscountCode { + Id: number; + DiscountCode: string; + StartDate: Date; + EndDate: Date; + Percentage: DoubleRange; + IsActive: boolean; +} diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.html new file mode 100644 index 0000000..81326e6 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.html @@ -0,0 +1,87 @@ +
+ +
+

Update Profile

+
+
+
+
+
+
+
+
**To update your profile fill all the text fields carefully.
+
+ +
+
+
+
+
+
+
+
+ + +
+ +
First name is required
+
+
+
+ +
+ +
Last name is required
+
+
+
+ +
+ + +
Email id is required
+ +
+ Please enter the correct email. +
+
+
+
+
+ + + + + + +
+ +
+
+ +
+
+
+
+
+
+
+
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts new file mode 100644 index 0000000..c834119 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts @@ -0,0 +1,172 @@ +import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core'; +import { UserService } from '../UserEntity/user.service'; +import { Router } from '@angular/router'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { User } from '../UserEntity/datamodel'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +import { Observable } from 'rxjs/Observable'; +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; +import 'rxjs/Rx'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/filter'; + + +@Component({ + templateUrl:'./updateuserprofile.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html' +}) + +export class UpdateUserProfile implements OnInit { + UserId: number=1; + //users: IUser[]; + user: User; + msg: string; + indLoading: boolean = false; + // dbops: DBOperation; + modalTitle: string; + modalBtnTitle: string; + baseUrl: string = "User"; + userFrm: FormGroup; + useFname: string; + error; + status: boolean; + alerts: string; + emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"; + //@ViewChild("profileModal") + //profileModal: ModalComponent; + //errorMessage: any; + constructor(private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, + private _confirmService: ConfirmService + ) { } + + ngOnInit(): void { + this.user = new User(); + this.alerts = ''; + //this.userservice.GetUserById(this.UserId); + this.userFrm = this.fb.group({ + id: [''], + firstName: ['', Validators.required], + lastName: ['', Validators.required], + emailId: ['', Validators.required] + // LastName: [''], + // Gender: ['', Validators.required], + // Email: [''] + + }); + this.GetUserById(); + } + //ngAfterviewint() { + // this.LoadUsers(); + //} + + + //getCustomerById(UserId) { + // return this.userservice.GetUserById(UserId) + // .map((response: Response) => response.json()) + // .catch(this._errorHandler) + //} + //formErrors = { + // 'firstName': '', + // 'lastName': '', + // 'email': '' + //}; + GetUserById() { + + this.userservice.GetUserById() + .subscribe(x => { console.log(x); this.bindUsers(x) }, error => this.error = error); + } + UpdateUserProfile(this) { + // debugger; + this.user = this.userFrm.value; + //if(this.user.) + //console.log(this.user); + var obj = this.user + if (this.userFrm.valid) { + return this.userservice.UpdateUserProfileById(obj) + .subscribe( + n => (this.AfterInsertData(n)), + error => this.error = error); + } + } + AfterInsertData(data) { + //debugger; + if (data.Status == "False") { + // this._confirmService.activate(data.ResponseMessage, "alertMsg"); + //setTimeout(() => this.amCode.nativeElement.focus(), 0); + // this.closeflag = false; + return false; + } else { + this.status = true; + + + this._confirmService.activate("User Profile Updated Successfully.", "alertMsg"); + //this.profileModal.open(); + // this.submitted = false; + // this.GetAllAcctMgr(); + // this.DisableAllControls(); + // this.AccountManagerID.enable(); + // let accountManagerID: string = data.Id == null ? "" : data.Id.toString(); + // console.log(accountManagerID); + + // this.GetAcctMgr(Number(accountManagerID)); + //this.GetAccountManagerListOptions(false); + // this.defautValue = data.id; + // this.BtnReset = true; + // this.BtnSave = true; + // this.BtnEdit = false; + // this.BtnNew = false; + // this.BtnDelete = false; + // this.Abbrevtion = this.Abbrev.value; + // setTimeout(() => this.AMform.controls["AccountManagerID"].setValue(accountManagerID.toString()), 1000); + // setTimeout(() => this.AMform.markAsPristine(), 2000); + } + //if (this.closeflag) { + // this.close.emit(null); + //} + //else { + //} + } + bindUsers(data) { + + //console.log(data); + //alert(JSON.stringify(data)); + this.user = data[0]; + + console.log(this.user); + this.userFrm.controls['id'].setValue(this.user.Id) + this.userFrm.controls['firstName'].setValue(this.user.FirstName) + this.userFrm.controls['lastName'].setValue(this.user.LastName) + this.userFrm.controls['emailId'].setValue(this.user.EmailId) + // this.GetClientListOptions(false); + // this.GetCrossRefClientListOptions(false); + } + //extractData(res: Response) { + // //debugger; + // let body = res.json(); + // return body; + //} + //handleError(error: any) { + + // // In a real world app, we might use a remote logging infrastructure + // // We'd also dig deeper into the error to get a better message + // let errMsg = (error.message) ? error.message : + // error.status ? `${error.status} - ${error.statusText}` : 'Server error'; + // console.error(errMsg); // log to console instead + // return Observable.throw(errMsg); + //} + validationMessages = { + 'firstName': { + 'required': 'First name is required.' + }, + 'lastName': { + 'required': 'Last name is required.' + }, + 'email': { + 'required': 'Email is required.', + 'pattern': 'Email pattern is not valid.' + } + } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts new file mode 100644 index 0000000..55a1fc2 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts @@ -0,0 +1,92 @@ +import { Injectable, Inject } from '@angular/core'; +//import { HttpClient, HttpParams, HttpRequest} from "@angular/common/http"; +import { Http, Response, Headers, RequestOptions, HttpModule } from '@angular/http'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/catch'; +import 'rxjs/add/observable/throw'; +import { User } from '../UserEntity/datamodel'; +import 'rxjs/add/operator/do'; +import { Observable } from 'rxjs/Observable'; +import { GlobalService } from '../../Shared/global'; +@Injectable() +export class UserService { + + constructor(private http: Http, private commonService: GlobalService ) { } + //////////Get User Detail/////////////// + GetUserById() { + debugger; + return this.http.get(this.commonService.resourceBaseUrl + "/api/GetUserProfile/"+this.commonService.UserId) + .map(this.extractData) + .catch((res: Response) => this.handleError(res));; + + } + //////////Update User Detail/////////////// + UpdateUserProfileById(obj: User) { + //let options = new RequestOptions({ headers: this.headers }); + return this.http.post(this.commonService.resourceBaseUrl + "/api/UpdateProfile", obj) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + //////////Update User Password/////////////// + ChangeUserPassword(obj: any) { + //let options = new RequestOptions({ headers: this.headers }); + var jsonData = { 'id': obj.userId, 'newPassword': obj.newPassword }; + console.log(obj); + var headers = new Headers({ + 'Content-Type': 'application/json' + }); + return this.http.post(this.commonService.resourceBaseUrl + "/api/ChangeUserPassword", + JSON.stringify(jsonData), { headers: headers }) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + //////////Update User Userid/////////////// + UpdateUserId(obj: User) { + //let options = new RequestOptions({ headers: this.headers }); + return this.http.post(this.commonService.resourceBaseUrl + "/api/UpdateUserId", obj) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + /// Users Form/////// + + GetUserType() { + return this.http.get(this.commonService.resourceBaseUrl + "/api/GetUserType/"+this.commonService.UserType) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + GetAccountType() { + return this.http.get(this.commonService.resourceBaseUrl + "/api/GetAccountType/"+this.commonService.AccountType) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + GetUserList(obj: any) { + return this.http.get(this.commonService.resourceBaseUrl + "/api/Users?firstname=" + obj.FirstName + + "&lastname=" + obj.LastName + + "&emailid=" + obj.EmailId + + "&accountnumber=" + obj.AccountNumber + + "&usertypeid=" + obj.UserTypeId + + "&accounttypeid=" + obj.AccountTypeId) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + /// End Users ///// + + extractData(res: Response) { + debugger; + + let body = res.json(); + return body; + } + handleError(error: any) { + debugger; + // In a real world app, we might use a remote logging infrastructure + // We'd also dig deeper into the error to get a better message + let errMsg = (error.message) ? error.message : + error.status ? `${error.status} - ${error.statusText}` : 'Server error'; + console.error(errMsg); // log to console instead + return Observable.throw(errMsg); + } + + +} diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html new file mode 100644 index 0000000..8d4cfb2 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html @@ -0,0 +1,158 @@ +
+
+

List User

+
+
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +
+ + +
+
+
+ + +
+
+ +
+ +
+
+
+
+
+ + +
+
+
 
+ +
+
+
+ + +
+
+
+
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
First NameLast NameUser IDPasswordEmail IDUser TypeCreated DateLast Modified DateAccount NumberProduct EditionStatus
{{UserEntity.FirstName}}{{UserEntity.LastName}}{{UserEntity.LoginId}}{{UserEntity.Password}}{{UserEntity.EmailId}}{{UserEntity.UserTypeTitle}}{{UserEntity.CreationDate}}{{UserEntity.ModifiedDate}}{{UserEntity.AccountNumber}}{{UserEntity.EditionType}} + {{UserEntity.UserStatus}} +
+ +
+
+ + +
+
+
+ +
+
+
+
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts new file mode 100644 index 0000000..d022ff8 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core'; +import { UserService } from './user.service'; +import { Router } from '@angular/router'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { User } from '../UserEntity/datamodel'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +import { Observable } from 'rxjs/Observable'; +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; +import 'rxjs/Rx'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/filter'; + + +@Component({ + templateUrl:'./users.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html' +}) + +export class UsersList implements OnInit { + + modalTitle: string; + Users: FormGroup; + alerts: string; + public UserTypeList: any; + public AccountTypeList: any; + public UserList: any; + error; + //@ViewChild("profileModal") + //profileModal: ModalComponent; + //errorMessage: any; + constructor(private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, + private _confirmService: ConfirmService + ) { } + + ngOnInit(): void { + this.alerts = ''; + //this.userservice.GetUserById(this.UserId); + this.Users = this.fb.group({ + FirstName:[''], + LastName: [''], + EmailId: [''], + AccountNumber: [''], + UserTypeId: [''], + AccountTypeId:[''] + // Gender: ['', Validators.required], + // Email: [''] + + }); + this.GetUserType(); + this.GetAccountType(); + //this.GetUserList(); + } + + GetUserType() { + this.userservice.GetUserType().subscribe(x => { this.UserTypeList = x; }, error => this.error = error); + } + GetAccountType() { + this.userservice.GetAccountType().subscribe(x => { this.AccountTypeList = x; }, error => this.error = error); + } + GetUserList() { + //this.userservice.GetUserList().subscribe(x => { this.UserList = x; }, error => this.error = error); + } + SearchUserList(this) + { + var UserFilterControl = this.Users.value; + this.userservice.GetUserList( + { + FirstName: this.Users.controls['FirstName'].value, + LastName: this.Users.controls['LastName'].value, + EmailId: this.Users.controls['EmailId'].value, + AccountNumber: this.Users.controls['AccountNumber'].value, + UserTypeId: (this.Users.controls['UserTypeId'].value != null && this.Users.controls['UserTypeId'].value !='' ? this.Users.controls['UserTypeId'].value:0), + AccountTypeId: (this.Users.controls['AccountTypeId'].value != null && this.Users.controls['AccountTypeId'].value != ''? this.Users.controls['AccountTypeId'].value : 0), + + + }) + + .subscribe(x => { this.UserList = x; }, error => this.error = error); + } + AfterInsertData(data) { + + if (data == "success") { + this._confirmService.activate("Userid Updated Successfully.", "alertMsg"); + + } else { + this.alerts += '' + data+''; + return false; + + + } + //if (this.closeflag) { + // this.close.emit(null); + //} + //else { + //} + } + + ResetFormFields() { + //this.ChangeUserIdFrm.reset() + //this.ChangeUserIdFrm.controls['id'].setValue(this.user.Id) + //this.ChangeUserIdFrm.controls['loginid'].setValue(this.user.LoginId) + //this.ChangeUserIdFrm.controls['newloginid'].setValue('') + //this.ChangeUserIdFrm.controls['confirmloginid'].setValue('') + this.alerts = ''; + } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/changeuserid.component.html b/400-SOURCECODE/Admin/src/app/components/changeuserid.component.html new file mode 100644 index 0000000..eca3570 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/changeuserid.component.html @@ -0,0 +1,63 @@ +
+
+
+
+
**To change your user ID fill all the text fields carefully.
+
+ +
+
+ +
+ +
+
+
+ +
+ + (Minimum 8 characters) +
+
+
+ +
+ +
+
+ +
+
+ + + + + +
+ +
+
+ +
+
+
+
+
diff --git a/400-SOURCECODE/Admin/src/app/components/changeuserid.component.ts b/400-SOURCECODE/Admin/src/app/components/changeuserid.component.ts new file mode 100644 index 0000000..61abf1c --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/changeuserid.component.ts @@ -0,0 +1,40 @@ +import { Component, OnInit } from '@angular/core'; +import { UserService } from './UpdateProfile/user.service'; +import { Router } from '@angular/router'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { IUser } from './UpdateProfile/datamodel'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +//import { Observable } from 'rxjs/Observable'; + +@Component({ + templateUrl: '../components/changeuserid.component.html' +}) + +export class ChangeUserId implements OnInit { + + constructor(private userservice: UserService, private router: Router, private fb: FormBuilder) { } + + ngOnInit(): void { } + + formErrors = { + 'firstName': '', + 'lastName': '', + 'email': '' + }; + + validationMessages = { + 'firstName': { + 'required': 'First name is required.' + }, + 'lastName': { + 'required': 'Last name is required.' + }, + 'email': { + 'required': 'Email is required.', + 'pattern': 'Email pattern is not valid.' + } + } + +} diff --git a/400-SOURCECODE/Admin/src/app/components/changeuserpassword.component.html b/400-SOURCECODE/Admin/src/app/components/changeuserpassword.component.html new file mode 100644 index 0000000..1add02c --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/changeuserpassword.component.html @@ -0,0 +1,68 @@ +
+
+
+
+
**To change your profile fill all the text fields carefully.
+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + (Minimum 8 characters) +
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+
+ +
+
+
+
+
diff --git a/400-SOURCECODE/Admin/src/app/components/changeuserpassword.component.ts b/400-SOURCECODE/Admin/src/app/components/changeuserpassword.component.ts new file mode 100644 index 0000000..525b9ca --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/changeuserpassword.component.ts @@ -0,0 +1,40 @@ +import { Component, OnInit } from '@angular/core'; +import { UserService } from './UpdateProfile/user.service'; +import { Router } from '@angular/router'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { IUser } from './UpdateProfile/datamodel'; +import { Http, Response } from '@angular/http'; +//import { Global } from '../../Shared/global'; +//import { DBOperation } from 'S'; +//import { Observable } from 'rxjs/Observable'; + +@Component({ + templateUrl: '../components/changeuserpassword.component.html' +}) + +export class ChangeUserPassword implements OnInit { + + constructor(private userservice: UserService, private router: Router, private fb: FormBuilder) { } + + ngOnInit(): void { } + + formErrors = { + 'firstName': '', + 'lastName': '', + 'email': '' + }; + + validationMessages = { + 'firstName': { + 'required': 'First name is required.' + }, + 'lastName': { + 'required': 'Last name is required.' + }, + 'email': { + 'required': 'Email is required.', + 'pattern': 'Email pattern is not valid.' + } + } + +} diff --git a/400-SOURCECODE/Admin/src/app/model/add-user.interface.ts b/400-SOURCECODE/Admin/src/app/model/add-user.interface.ts new file mode 100644 index 0000000..d0991fa --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/model/add-user.interface.ts @@ -0,0 +1,11 @@ +export interface AddUser { + userName: string; + password: string; + confirmPassword: string; + emailId: string; + firstName: string; + lastName: string; + accountNumber: string; + userType: string; + productEdition: string; +} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/model/data-model.ts b/400-SOURCECODE/Admin/src/app/model/data-model.ts new file mode 100644 index 0000000..113b045 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/model/data-model.ts @@ -0,0 +1,110 @@ +export class AppSettings { + menu: Menu; + footer: Footer; +} + +export class Menu { + menuType: string; + menuItems: MenuItem[]; +} + +export class MenuItem { + name: string; + url: string; + icon: string; +} + +export class Footer { + footerColumns: FooterColumn[]; + copyrightNotice: string; +} + +export class FooterColumn { + heading: string; + showHeading: boolean; + footerItems: FooterItem[]; +} + +export class FooterItem { + name: string; + url: string; +} + +export class BannerItem { + name: string; + tagLine: string; + bannerSettings: BannerSettings; + apps: string[]; +} + +export class BannerSettings { + show: boolean; + callToAction: "string" +} + +export class ContentItem { + _id: string; + contentType: string; + releaseDate: Date; + subject: string; + summary: string; + body: string; + slug: string; +} + + +export class User { + public _id: string; + public name: string; + public mobileNumber: string; + public emailAddress: string; + public password: string; + public role: string; + public apps: Array; + + constructor(appName: string) { + this.apps = new Array(); + this.apps.push(appName); + } +} + + +export class Address { + public name: string; + public mobileNumber: string; + public addressLine1: string; + public addressLine2: string; + public area: string; + public city: string; + public pinCode: string; + public state: string; +} + +export class UserProfile { + userId: number; + firstName: string; + lastName: string; + emailId: string; + + oldLoginId: string; + newLoginId: string; + confirmLoginId: string; +} + +export class AdminUser { + userId: number; + firstName: string; + lastName: string; + emailId: string; + loginId: string; + password: string; + securityQuestiuonId: number; + securityAnswer: string; + creatorId: number; + creationDate: Date; + deactivationDate: Date; + modifierId: number; + modifiedDate: Date; + userTypeId: number; + isActive: boolean; +} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/model/db-tables.ts b/400-SOURCECODE/Admin/src/app/model/db-tables.ts new file mode 100644 index 0000000..d2b7299 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/model/db-tables.ts @@ -0,0 +1,45 @@ +export class State { + constructor( + public Id: number, + public StateName: string + ) { } +} + +export class Country { + constructor( + public Id: number, + public Name: string + ) { } +} + +export class AccountType { + constructor( + public Id: number, + public Title: string + ) { } + + public static createEmptyAccountType(): AccountType { + return new AccountType(0, ""); + } +} + +export class SecurityQuestions { + constructor( + public Id: number, + public Title: string + ) { } +} + +export class LicenseType { + constructor( + public Id: number, + public Title: string + ) { } +} + +export class UserType { + constructor( + public Id: number, + public Title: string + ) { } +} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/services/application.service.ts b/400-SOURCECODE/Admin/src/app/services/application.service.ts new file mode 100644 index 0000000..5c4dfed --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/services/application.service.ts @@ -0,0 +1,250 @@ +import {Injectable} from '@angular/core'; +import { Http, Response, Headers, RequestOptions, URLSearchParams } from '@angular/http'; +import { Router } from '@angular/router'; + +import { Observable } from 'rxjs/Observable'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/catch'; + + +import { AppSettings, User, UserProfile } from '../model/data-model'; +import { State } from '../model/db-tables'; +import { AccountType } from '../model/db-tables'; +import { Country } from '../model/db-tables'; +import { SecurityQuestions } from '../model/db-tables'; +import { LicenseType } from '../model/db-tables'; + +@Injectable() +export class ApplicationService { + appSettingsLoaded: boolean; + appSettings: AppSettings; + currentUser: User; + loggedIn: boolean; + + userId: number; + firstName: string; + lastName: string; + emailId: string; + userInfo: UserProfile; + + apiUrl: "http://localhost:85/AIAHTML5.Server/api/"; + + constructor(private http: Http, private router: Router) { + if (this.currentUser == null) { + var user = localStorage.getItem("currentUser"); + + if (user != null) { + this.currentUser = JSON.parse(user); + this.loggedIn = true; + } + } + + this.userId = 0; + this.firstName = ""; + this.lastName = ""; + this.emailId = ""; + + } + + public getAppSettings(applicationName: string): Observable { + var headers = new Headers(); + headers.append('Content-Type', 'application/json'); + + let params = new URLSearchParams(); + params.set("applicationName", applicationName); + params.set("userId", this.currentUser._id); + + return this.http.get('DentalDecks.Server/api/AppSettings', { headers: headers, search: params }) + .map(this.extractData) + .catch(this.handleError); + } + + public getMenuItemsWithNoChildren(menuItems: any): any { + if (this.appSettingsLoaded) { + let menuItemsSubset: Array = new Array(); + for (var i = 0; i < menuItems.length; i++) { + if (menuItems[i].menuItems == null) { + for (var j = 0; j < menuItems[i].roles.length; j++) { + if (menuItems[i].roles[j] == this.currentUser.role) { + menuItemsSubset.push(menuItems[i]); + break; + } + } + } + } + return menuItemsSubset; + } + } + + public getMenuItemsWithChildren(menuItems: any): any { + if (this.appSettingsLoaded) { + let menuItemsSubset: Array = new Array(); + for (var i = 0; i < menuItems.length; i++) { + if (menuItems[i].menuItems != null) { + for (var j = 0; j < menuItems[i].roles.length; j++) { + if (menuItems[i].roles[j] == this.currentUser.role) { + menuItemsSubset.push(menuItems[i]); + break; + } + } + } + } + return menuItemsSubset; + } + } + + public login(applicationName: string, username: string, password: string): Observable { + var headers = new Headers(); + headers.append('Content-Type', 'application/json'); + + let params = new URLSearchParams(); + params.set("applicationName", applicationName); + params.set("username", username); + params.set("password", password); + + return this.http.get('DentalDecks.Server/api/Authenticate', { headers: headers, search: params }) + .map(this.extractData) + .catch(this.handleError); + } + + public logout(): void { + this.currentUser = null; + localStorage.removeItem("currentUser"); + this.router.navigate(['/login']); + } + + public resetPassword(username: string): Observable { + var headers = new Headers(); + headers.append('Content-Type', 'application/json'); + + let user: any = new Object(); + user.emailAddress = username; + + return this.http.post('DentalDecks.Server/api/Password', JSON.stringify(user), { headers: headers }) + .map(this.extractData) + .catch(this.handleError); + } + + public updatePassword(userId: string, password: string): Observable { + var headers = new Headers(); + headers.append('Content-Type', 'application/json'); + + let user: any = new Object(); + user.userId = userId; + user.password = password; + + return this.http.post('DentalDecks.Server/api/UpdatePassword', JSON.stringify(user), { headers: headers }) + .map(this.extractData) + .catch(this.handleError); + } + + public isResetPasswordExpired(userId: string): Observable { + var headers = new Headers(); + headers.append('Content-Type', 'application/json'); + + let params = new URLSearchParams(); + params.set("userId", userId); + + return this.http.get('DentalDecks.Server/api/Password', { headers: headers, search: params }) + .map(this.extractData) + .catch(this.handleError); + } + + public getLongDate(date: any): string { + let returnValue: Date = new Date(date); + return returnValue.toLocaleDateString(); + } + + getDateTime(date: any): string { + let orderDate: string = ""; + if (date != null && date != "") + orderDate = new Date(date).toLocaleDateString() + " " + new Date(date).toLocaleTimeString(); + + return orderDate; + } + + getRelativeDate(date: any): string { + if (date != null) { + date = new Date(date); + + var delta = Math.round((+new Date - date) / 1000); + + var minute = 60, + hour = minute * 60, + day = hour * 24, + week = day * 7; + + var fuzzy: string; + + if (delta < 30) { + fuzzy = 'just now.'; + } else if (delta < minute) { + fuzzy = delta + ' seconds ago.'; + } else if (delta < 2 * minute) { + fuzzy = 'a minute ago.' + } else if (delta < hour) { + fuzzy = Math.floor(delta / minute) + ' minutes ago.'; + } else if (Math.floor(delta / hour) == 1) { + fuzzy = '1 hour ago.' + } else if (delta < day) { + fuzzy = Math.floor(delta / hour) + ' hours ago.'; + } else if (delta < day * 2 && delta > day) { + fuzzy = 'yesterday'; + } else { + fuzzy = Math.floor(delta / (60 * 60 * 24)) + ' days ago'; + } + + return fuzzy; + } else { + return ""; + } + } + + private extractData(res: Response) { + let body = res.json(); + return body || {}; + } + private handleError(error: Response | any) { + // In a real world app, we might use a remote logging infrastructure + let errMsg: string; + if (error instanceof Response) { + const body = error.json() || ''; + const err = body.error || JSON.stringify(body); + errMsg = `${error.status} - ${error.statusText || ''} ${err}`; + } else { + errMsg = error.message ? error.message : error.toString(); + } + console.error(errMsg); + return Observable.throw(errMsg); + } + + public getAccountTypes(): Observable { + return this.http.get('http://localhost:85/AIAHTML5.Server/api/accounttype') + .map(this.extractData) + .catch(this.handleError); + } + + public getStates(): Observable { + return this.http.get('http://localhost:85/AIAHTML5.Server/api/state') + .map(this.extractData) + .catch(this.handleError); + } + + public getCountries(): Observable { + return this.http.get('http://localhost:85/AIAHTML5.Server/api/country') + .map(this.extractData) + .catch(this.handleError); + } + + public getSecurityQuestions(): Observable { + return this.http.get('http://localhost:85/AIAHTML5.Server/api/securityquestionlist') + .map(this.extractData) + .catch(this.handleError); + } + + public getLicenseTypes(): Observable { + return this.http.get('http://localhost:85/AIAHTML5.Server/api/licensetype') + .map(this.extractData) + .catch(this.handleError); + } +} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/services/update-user.service.ts b/400-SOURCECODE/Admin/src/app/services/update-user.service.ts new file mode 100644 index 0000000..6e26f38 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/services/update-user.service.ts @@ -0,0 +1,155 @@ +import { Injectable } from '@angular/core'; +import { Http, Response, Headers, RequestOptions, URLSearchParams } from '@angular/http'; +import { Router } from '@angular/router'; + +import { Observable } from 'rxjs/Observable'; +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/catch'; +import { UserProfile } from '../model/data-model'; + +//import { AppSettings, User } from '../model/data-model'; + +@Injectable() +export class UpdateUserService { + //appSettingsLoaded: boolean; + //appSettings: AppSettings; + //currentUser: User; + //loggedIn: boolean; + userId: number; + firstName: string; + lastName: string; + emailId: string; + userInfo: UserProfile; + + private headers: Headers; + + constructor(private http: Http, private router: Router) { + //if (this.currentUser == null) { + // var user = localStorage.getItem("currentUser"); + + // if (user != null) { + // this.currentUser = JSON.parse(user); + // this.loggedIn = true; + // } + //} + this.userId = 0; + this.firstName = ""; + this.lastName = ""; + this.emailId = ""; + + } + + private extractData(res: Response) { + let body = res.json(); + return body || {}; + } + private handleError(error: Response | any) { + // In a real world app, we might use a remote logging infrastructure + let errMsg: string; + if (error instanceof Response) { + const body = error.json() || ''; + const err = body.error || JSON.stringify(body); + errMsg = `${error.status} - ${error.statusText || ''} ${err}`; + } else { + errMsg = error.message ? error.message : error.toString(); + } + console.error(errMsg); + return Observable.throw(errMsg); + } + + public UpdateUserProfile(applicationName: string, strFirstName: string, strLastName: string, strEmailID: string): Observable { + console.log('inside update-user service -2'); + let usrID: number; + usrID = 1; + + //let headers = new Headers({ 'Content-Type': 'application/json' }); + let headers = new Headers(); + headers.append('Content-type', 'application/x-www-form-urlencoded'); + let options = new RequestOptions({ headers: headers }); + let body = 'userId=' + usrID + '&emailId=' + strEmailID + '&firstName=' + strFirstName + '&lastName=' + strLastName; + console.log(body); + + let urlSearchParams = new URLSearchParams(); + urlSearchParams.append('userId', usrID.toString()); + urlSearchParams.append('firstName', strFirstName); + urlSearchParams.append('lastName', strLastName); + urlSearchParams.append('emailId', strEmailID); + let body2 = urlSearchParams.toString() + + return this.http.post('http://localhost:85/AIAHTML5.Server/api/updateprofile', body, options) + .map((response: Response) => { + console.log(response); + var body = response.json(); + console.log(body); + }) + .catch(this.handleError); + } + + public GetUserDetailsByIdandLoginId(id: number, loginId: string) : Observable { + console.log('inside user-service getUserDetailsById'); + debugger; + let headers = new Headers(); + headers.append('Content-Type', 'application/json'); + //headers.append('Content-type', 'application/x-www-form-urlencoded'); + let options = new RequestOptions({ headers: headers }); + + let params = new URLSearchParams(); + params.append('iUserId', id.toString()); + params.append('sLoginId', loginId); + + return this.http.get('http://localhost:85/AIAHTML5.Server/api/changeuserid', { headers: headers, search: params }) + .map(this.extractData) + .catch(this.handleError); + + } + + public UpdateUserId(id: number, newLoginId: string): Observable { + console.log('inside user-service updateUserId'); + let headers = new Headers(); + headers.append('Content-type', 'application/x-www-form-urlencoded'); + let options = new RequestOptions({ headers: headers }); + + let params = new URLSearchParams(); + params.append('iUserId', id.toString()); + params.append('newLoginId', newLoginId); + let body = params.toString(); + return this.http.post('http://localhost:85/AIAHTML5.Server/api/changeuserid', body, options) + .map(this.extractData) + .catch(this.handleError); + + } + + public GetUserDetailsByLoginIdandPassword(loginId: string, password: string): Observable { + console.log('inside user-service getUserDetailsByLoginIdandPassword'); + debugger; + let headers = new Headers(); + headers.append('Content-Type', 'application/json'); + //headers.append('Content-type', 'application/x-www-form-urlencoded'); + let options = new RequestOptions({ headers: headers }); + + let params = new URLSearchParams(); + params.append('sLoginId', loginId); + params.append('sPassword', password); + + return this.http.get('http://localhost:85/AIAHTML5.Server/api/changeuserpassword', { headers: headers, search: params }) + .map(this.extractData) + .catch(this.handleError); + + } + + public UpdateUserPassword(id: number, newPassword: string): Observable { + console.log('inside user-service UpdateUserPassword'); + let headers = new Headers(); + headers.append('Content-type', 'application/x-www-form-urlencoded'); + let options = new RequestOptions({ headers: headers }); + + let params = new URLSearchParams(); + params.append('iUserId', id.toString()); + params.append('newPassword', newPassword); + let body = params.toString(); + return this.http.post('http://localhost:85/AIAHTML5.Server/api/changeuserpassword', body, options) + .map(this.extractData) + .catch(this.handleError); + + } +} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.component.html b/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.component.html new file mode 100644 index 0000000..8d8e93e --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.component.html @@ -0,0 +1,107 @@ + + + +
+ + +
+
+ + + +

+ {{message}} +

+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + +

{{message}} +

+
+ +
+ + +
+
+
+
+
+ + +
+ + +
+
+ + + +

+ {{message}} +

+
+ +
+ +
+
+
+ +
+
+ + + + +
+ + +
+
+ + + +

+ {{message}} +

+
+ +
+ + +
+
+
+
+
diff --git a/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.component.ts b/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.component.ts new file mode 100644 index 0000000..7ee6a0f --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.component.ts @@ -0,0 +1,203 @@ + import { Component, OnInit, Input, Output, EventEmitter, ElementRef, ViewChild } from "@angular/core"; +import {ConfirmService} from "./confirm.service"; +import { ModalComponent } from "ng2-bs3-modal/ng2-bs3-modal"; +const KEY_ESC = 27; + +@Component({ + selector: 'modal-confirm', + templateUrl: './confirm.component.html', +}) +export class ConfirmComponent implements OnInit { + + private _defaults = { + type: 'reset', + message: 'Do you want to cancel your changes?', + cancelText: 'Cancel', + okText: 'OK' + }; + timer: any; + type: string; + alertshow:boolean=false; + message:string; + okText:string; + cancelText: string; + modalType:string; + @ViewChild("closeModal") + closeModal: ModalComponent; + @ViewChild("confirmModel") + confirmModel: ModalComponent; + @ViewChild("resetModal") + resetModal: ModalComponent; + @ViewChild("alertMessageModal") + alertMessageModal: ModalComponent; + private _confirmElement:any; + private _cancelButton:any; + private _okButton: any; + private _noButton: any; + private _yesResetButton: any; + private _noResetButton: any; + private _yesConfirmButton: any; + private _noConfirmButton: any; + private _okAlert: any; + private _closeAlert: any; + + constructor(confirmService:ConfirmService) { + confirmService.activate = this.activate.bind(this); + } + + _setLabels(message = this._defaults.message, type = this._defaults.type) { + // this.modalType = type; + this.type = type; + //this.alertshow = type == 'reset' ? true : false; + this.message = message; + this.okText = this._defaults.okText; + this.cancelText = this._defaults.cancelText; + } + + activate(message = this._defaults.message, type = this._defaults.type) { + this._setLabels(message, type); + let promise = new Promise(resolve => { + this._show(resolve); + }); + return promise; + } + + private _show(resolve:(boolean) => any) { + document.onkeyup = null; + let yesOnClick = (e: any) => resolve(1); // 1 for yes + let noOnClick = (e: any) => resolve(2); // 2 for no + let cancelOnClick = (e: any) => resolve(3); // 3 for cancel + let yesResetClick = (e: any) => resolve(1); + let noResetClick = (e: any) => resolve(2); + let yesConfirmClick = (e: any) => resolve(6); // yes + let noConfirmClick = (e: any) => resolve(7); // NO + + + let okAlertClick = (e: any) => resolve(5); // for alert message + let closeAlertClick = (e: any) => resolve(8); // for alert message + if (!this._cancelButton || !this._okButton) return; + //this._confirmElement.style.opacity = 0; + //this._confirmElement.style.zIndex = 9999; + this._cancelButton.onclick = ((e:any) => { + e.preventDefault(); + if (!cancelOnClick(e)) this._hideDialog(); + }) + + this._okButton.onclick = ((e:any) => { + e.preventDefault(); + if (!yesOnClick(e)) this._hideDialog() + }); + this._noButton.onclick = ((e: any) => { + e.preventDefault(); + if (!noOnClick(e)) this._hideDialog() + }); + + this._noResetButton.onclick = ((e: any) => { + e.preventDefault(); + if (!noResetClick(e)) this._hideDialog() + }); + this._yesResetButton.onclick = ((e: any) => { + e.preventDefault(); + if (!yesResetClick(e)) this._hideDialog() + }); + + + this._noConfirmButton.onclick = ((e: any) => { + e.preventDefault(); + if (!noConfirmClick(e)) this._hideDialog() + }); + this._yesConfirmButton.onclick = ((e: any) => { + e.preventDefault(); + if (!yesConfirmClick(e)) this._hideDialog() + }); + + + this._okAlert.onclick = ((e: any) => { + e.preventDefault(); + if (!okAlertClick(e)) this._hideDialog() + }); + this._closeAlert.onclick = ((e: any) => { + e.preventDefault(); + if (!closeAlertClick(e)) this._hideDialog() + }); + //this._confirmelement.onclick = () => { + // this._hidedialog(); + // return negativeonclick(null); + //}; + if (this.type.toString() == "close") { + this.closeModal.open('sm'); + return; + } + if (this.type.toString() == "reset") { + this.resetModal.open('sm'); + return; + } + + if (this.type.toString() == "confirmModel") { + this.confirmModel.open('sm'); + return; + } + + if (this.type.toString() == "alertMsg") { + //setTimeout(this.alertMessageModal.open('sm'), 60000); + clearTimeout(this.timer); + this.timer = setTimeout(() => { + this.alertMessageModal.open('sm'); + }, 500); + return; + } + if (this.type.toString() == "alertMsg2") { + + this.alertMessageModal.open('sm'); + return; + } + document.onkeyup = (e:any) => { + if (e.which == KEY_ESC) { + this._hideDialog(); + return cancelOnClick(null); + } + }; + + //this._confirmElement.style.opacity = 1; + } + + private _hideDialog() { + if (this.type.toString() == "close") { + this.closeModal.close(); + return; + } + if (this.type.toString() == "reset") { + this.resetModal.close(); + return; + } + + if (this.type.toString() == "confirmModel") { + this.confirmModel.close(); + return; + } + + if (this.type.toString() == "alertMsg") { + this.alertMessageModal.close(); + return; + } + if (this.type.toString() == "alertMsg2") { + this.alertMessageModal.close(); + return; + } + + } + + ngOnInit():any { + //this._confirmElement = document.getElementById('confirmationModal'); + this._cancelButton = document.getElementById('cancelButton'); + this._okButton = document.getElementById('okButton'); + this._noButton = document.getElementById('noButton'); + this._yesResetButton = document.getElementById('yesResetButton'); + this._noResetButton = document.getElementById('noResetButton'); + this._yesConfirmButton = document.getElementById('yesConfirmButton'); + this._noConfirmButton = document.getElementById('noConfirmButton'); + this._okAlert = document.getElementById('okAlert'); + this._closeAlert = document.getElementById('closeAlert'); + + } +} diff --git a/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.service.ts b/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.service.ts new file mode 100644 index 0000000..8b7aae9 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/Confirm/confirm.service.ts @@ -0,0 +1,6 @@ +import {Injectable} from '@angular/core'; + +@Injectable() +export class ConfirmService { + activate: (message?: string, type?:string) => Promise; +} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/shared/enum.js b/400-SOURCECODE/Admin/src/app/shared/enum.js new file mode 100644 index 0000000..421ac4c --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/enum.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var DBOperation; +(function (DBOperation) { + DBOperation[DBOperation["create"] = 1] = "create"; + DBOperation[DBOperation["update"] = 2] = "update"; + DBOperation[DBOperation["delete"] = 3] = "delete"; +})(DBOperation = exports.DBOperation || (exports.DBOperation = {})); +//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/shared/enum.js.map b/400-SOURCECODE/Admin/src/app/shared/enum.js.map new file mode 100644 index 0000000..ffae1a4 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/enum.js.map @@ -0,0 +1 @@ +{"version":3,"file":"enum.js","sourceRoot":"","sources":["enum.ts"],"names":[],"mappings":";;AAAA,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,iDAAU,CAAA;IACV,iDAAU,CAAA;IACV,iDAAS,CAAA;AACb,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB"} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/shared/enum.ts b/400-SOURCECODE/Admin/src/app/shared/enum.ts new file mode 100644 index 0000000..cfe43d3 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/enum.ts @@ -0,0 +1,5 @@ +export enum DBOperation { + create = 1, + update = 2, + delete =3 +} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/shared/global.js b/400-SOURCECODE/Admin/src/app/shared/global.js new file mode 100644 index 0000000..43560cd --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/global.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Global = (function () { + function Global() { + } + return Global; +}()); +Global.BASE_USER_ENDPOINT = 'api/userapi/'; +exports.Global = Global; +//# sourceMappingURL=global.js.map \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/shared/global.js.map b/400-SOURCECODE/Admin/src/app/shared/global.js.map new file mode 100644 index 0000000..01f2dc2 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/global.js.map @@ -0,0 +1 @@ +{"version":3,"file":"global.js","sourceRoot":"","sources":["global.ts"],"names":[],"mappings":";;AAAA;IAAA;IAEA,CAAC;IAAD,aAAC;AAAD,CAAC,AAFD;AACkB,yBAAkB,GAAG,cAAc,CAAC;AADzC,wBAAM"} \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/shared/global.ts b/400-SOURCECODE/Admin/src/app/shared/global.ts new file mode 100644 index 0000000..234378d --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/shared/global.ts @@ -0,0 +1,11 @@ +export class GlobalService { + resourceBaseUrl: string = ""; + hostURL: string = ""; + UserId: number = 6; + UserType: number = 0; + AccountType: number = 0; + constructor() { + this.hostURL = window.location.hostname; + this.resourceBaseUrl = "http://192.168.84.242:97/User"; + } +} diff --git a/400-SOURCECODE/Admin/src/assets/.gitkeep b/400-SOURCECODE/Admin/src/assets/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/.gitkeep diff --git a/400-SOURCECODE/Admin/src/assets/img/alertmessage.png b/400-SOURCECODE/Admin/src/assets/img/alertmessage.png new file mode 100644 index 0000000..f5f2786 --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/alertmessage.png diff --git a/400-SOURCECODE/Admin/src/assets/img/bg.gif b/400-SOURCECODE/Admin/src/assets/img/bg.gif new file mode 100644 index 0000000..fac668f --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/bg.gif diff --git a/400-SOURCECODE/Admin/src/assets/img/calander.png b/400-SOURCECODE/Admin/src/assets/img/calander.png new file mode 100644 index 0000000..62ba25c --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/calander.png diff --git a/400-SOURCECODE/Admin/src/assets/img/close-button.png b/400-SOURCECODE/Admin/src/assets/img/close-button.png new file mode 100644 index 0000000..933272b --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/close-button.png diff --git a/400-SOURCECODE/Admin/src/assets/img/doller.png b/400-SOURCECODE/Admin/src/assets/img/doller.png new file mode 100644 index 0000000..45158b4 --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/doller.png diff --git a/400-SOURCECODE/Admin/src/assets/img/img1 - Copy.png b/400-SOURCECODE/Admin/src/assets/img/img1 - Copy.png new file mode 100644 index 0000000..31fa7c1 --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/img1 - Copy.png diff --git a/400-SOURCECODE/Admin/src/assets/img/img1-white.png b/400-SOURCECODE/Admin/src/assets/img/img1-white.png new file mode 100644 index 0000000..63d9609 --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/img1-white.png diff --git a/400-SOURCECODE/Admin/src/assets/img/img1.png b/400-SOURCECODE/Admin/src/assets/img/img1.png new file mode 100644 index 0000000..406409a --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/img1.png diff --git a/400-SOURCECODE/Admin/src/assets/img/logo-large.png b/400-SOURCECODE/Admin/src/assets/img/logo-large.png new file mode 100644 index 0000000..4430baa --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/logo-large.png diff --git a/400-SOURCECODE/Admin/src/assets/img/logo-main.png b/400-SOURCECODE/Admin/src/assets/img/logo-main.png new file mode 100644 index 0000000..9b7f27d --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/logo-main.png diff --git a/400-SOURCECODE/Admin/src/assets/img/search.png b/400-SOURCECODE/Admin/src/assets/img/search.png new file mode 100644 index 0000000..e69945d --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/img/search.png diff --git a/400-SOURCECODE/Admin/src/assets/scripts/bootstrap-datetimepicker.min.js b/400-SOURCECODE/Admin/src/assets/scripts/bootstrap-datetimepicker.min.js new file mode 100644 index 0000000..a30f776 --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/scripts/bootstrap-datetimepicker.min.js @@ -0,0 +1,26 @@ +/** + * @license + * ========================================================= + * bootstrap-datetimepicker.js + * http://www.eyecon.ro/bootstrap-datepicker + * ========================================================= + * Copyright 2012 Stefan Petre + * + * Contributions: + * - Andrew Rowls + * - Thiago de Arruda + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================= + */ +(function($){var smartPhone=window.orientation!=undefined;var DateTimePicker=function(element,options){this.id=dpgId++;this.init(element,options)};var dateToDate=function(dt){if(typeof dt==="string"){return new Date(dt)}return dt};DateTimePicker.prototype={constructor:DateTimePicker,init:function(element,options){var icon;if(!(options.pickTime||options.pickDate))throw new Error("Must choose at least one picker");this.options=options;this.$element=$(element);this.language=options.language in dates?options.language:"en";this.pickDate=options.pickDate;this.pickTime=options.pickTime;this.isInput=this.$element.is("input");this.component=false;if(this.$element.find(".input-append")||this.$element.find(".input-prepend"))this.component=this.$element.find(".add-on");this.format=options.format;if(!this.format){if(this.isInput)this.format=this.$element.data("format");else this.format=this.$element.find("input").data("format");if(!this.format)this.format="MM/dd/yyyy"}this._compileFormat();if(this.component){icon=this.component.find("i")}if(this.pickTime){if(icon&&icon.length)this.timeIcon=icon.data("time-icon");if(!this.timeIcon)this.timeIcon="icon-time";icon.addClass(this.timeIcon)}if(this.pickDate){if(icon&&icon.length)this.dateIcon=icon.data("date-icon");if(!this.dateIcon)this.dateIcon="icon-calendar";icon.removeClass(this.timeIcon);icon.addClass(this.dateIcon)}this.widget=$(getTemplate(this.timeIcon,options.pickDate,options.pickTime,options.pick12HourFormat,options.pickSeconds,options.collapse)).appendTo("body");this.minViewMode=options.minViewMode||this.$element.data("date-minviewmode")||0;if(typeof this.minViewMode==="string"){switch(this.minViewMode){case"months":this.minViewMode=1;break;case"years":this.minViewMode=2;break;default:this.minViewMode=0;break}}this.viewMode=options.viewMode||this.$element.data("date-viewmode")||0;if(typeof this.viewMode==="string"){switch(this.viewMode){case"months":this.viewMode=1;break;case"years":this.viewMode=2;break;default:this.viewMode=0;break}}this.startViewMode=this.viewMode;this.weekStart=options.weekStart||this.$element.data("date-weekstart")||0;this.weekEnd=this.weekStart===0?6:this.weekStart-1;this.setStartDate(options.startDate||this.$element.data("date-startdate"));this.setEndDate(options.endDate||this.$element.data("date-enddate"));this.fillDow();this.fillMonths();this.fillHours();this.fillMinutes();this.fillSeconds();this.update();this.showMode();this._attachDatePickerEvents()},show:function(e){this.widget.show();this.height=this.component?this.component.outerHeight():this.$element.outerHeight();this.place();this.$element.trigger({type:"show",date:this._date});this._attachDatePickerGlobalEvents();if(e){e.stopPropagation();e.preventDefault()}},disable:function(){this.$element.find("input").prop("disabled",true);this._detachDatePickerEvents()},enable:function(){this.$element.find("input").prop("disabled",false);this._attachDatePickerEvents()},hide:function(){var collapse=this.widget.find(".collapse");for(var i=0;i");while(dowCnt'+dates[this.language].daysMin[dowCnt++%7]+"")}this.widget.find(".datepicker-days thead").append(html)},fillMonths:function(){var html="";var i=0;while(i<12){html+=''+dates[this.language].monthsShort[i++]+""}this.widget.find(".datepicker-months td").append(html)},fillDate:function(){var year=this.viewDate.getUTCFullYear();var month=this.viewDate.getUTCMonth();var currentDate=UTCDate(this._date.getUTCFullYear(),this._date.getUTCMonth(),this._date.getUTCDate(),0,0,0,0);var startYear=typeof this.startDate==="object"?this.startDate.getUTCFullYear():-Infinity;var startMonth=typeof this.startDate==="object"?this.startDate.getUTCMonth():-1;var endYear=typeof this.endDate==="object"?this.endDate.getUTCFullYear():Infinity;var endMonth=typeof this.endDate==="object"?this.endDate.getUTCMonth():12;this.widget.find(".datepicker-days").find(".disabled").removeClass("disabled");this.widget.find(".datepicker-months").find(".disabled").removeClass("disabled");this.widget.find(".datepicker-years").find(".disabled").removeClass("disabled");this.widget.find(".datepicker-days th:eq(1)").text(dates[this.language].months[month]+" "+year);var prevMonth=UTCDate(year,month-1,28,0,0,0,0);var day=DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(),prevMonth.getUTCMonth());prevMonth.setUTCDate(day);prevMonth.setUTCDate(day-(prevMonth.getUTCDay()-this.weekStart+7)%7);if(year==startYear&&month<=startMonth||year=endMonth||year>endYear){this.widget.find(".datepicker-days th:eq(2)").addClass("disabled")}var nextMonth=new Date(prevMonth.valueOf());nextMonth.setUTCDate(nextMonth.getUTCDate()+42);nextMonth=nextMonth.valueOf();var html=[];var row;var clsName;while(prevMonth.valueOf()");html.push(row)}clsName="";if(prevMonth.getUTCFullYear()year||prevMonth.getUTCFullYear()==year&&prevMonth.getUTCMonth()>month){clsName+=" new"}if(prevMonth.valueOf()===currentDate.valueOf()){clsName+=" active"}if(prevMonth.valueOf()+864e5<=this.startDate){clsName+=" disabled"}if(prevMonth.valueOf()>this.endDate){clsName+=" disabled"}row.append(''+prevMonth.getUTCDate()+"");prevMonth.setUTCDate(prevMonth.getUTCDate()+1)}this.widget.find(".datepicker-days tbody").empty().append(html);var currentYear=this._date.getUTCFullYear();var months=this.widget.find(".datepicker-months").find("th:eq(1)").text(year).end().find("span").removeClass("active");if(currentYear===year){months.eq(this._date.getUTCMonth()).addClass("active")}if(currentYear-1endYear){this.widget.find(".datepicker-months th:eq(2)").addClass("disabled")}for(var i=0;i<12;i++){if(year==startYear&&startMonth>i||yearendYear){$(months[i]).addClass("disabled")}}html="";year=parseInt(year/10,10)*10;var yearCont=this.widget.find(".datepicker-years").find("th:eq(1)").text(year+"-"+(year+9)).end().find("td");this.widget.find(".datepicker-years").find("th").removeClass("disabled");if(startYear>year){this.widget.find(".datepicker-years").find("th:eq(0)").addClass("disabled")}if(endYearendYear?" disabled":"")+'">'+year+"";year+=1}yearCont.html(html)},fillHours:function(){var table=this.widget.find(".timepicker .timepicker-hours table");table.parent().hide();var html="";if(this.options.pick12HourFormat){var current=1;for(var i=0;i<3;i+=1){html+="";for(var j=0;j<4;j+=1){var c=current.toString();html+=''+padLeft(c,2,"0")+"";current++}html+=""}}else{var current=0;for(var i=0;i<6;i+=1){html+="";for(var j=0;j<4;j+=1){var c=current.toString();html+=''+padLeft(c,2,"0")+"";current++}html+=""}}table.html(html)},fillMinutes:function(){var table=this.widget.find(".timepicker .timepicker-minutes table");table.parent().hide();var html="";var current=0;for(var i=0;i<5;i++){html+="";for(var j=0;j<4;j+=1){var c=current.toString();html+=''+padLeft(c,2,"0")+"";current+=3}html+=""}table.html(html)},fillSeconds:function(){var table=this.widget.find(".timepicker .timepicker-seconds table");table.parent().hide();var html="";var current=0;for(var i=0;i<5;i++){html+="";for(var j=0;j<4;j+=1){var c=current.toString();html+=''+padLeft(c,2,"0")+"";current+=3}html+=""}table.html(html)},fillTime:function(){if(!this._date)return;var timeComponents=this.widget.find(".timepicker span[data-time-component]");var table=timeComponents.closest("table");var is12HourFormat=this.options.pick12HourFormat;var hour=this._date.getUTCHours();var period="AM";if(is12HourFormat){if(hour>=12)period="PM";if(hour===0)hour=12;else if(hour!=12)hour=hour%12;this.widget.find(".timepicker [data-action=togglePeriod]").text(period)}hour=padLeft(hour.toString(),2,"0");var minute=padLeft(this._date.getUTCMinutes().toString(),2,"0");var second=padLeft(this._date.getUTCSeconds().toString(),2,"0");timeComponents.filter("[data-time-component=hours]").text(hour);timeComponents.filter("[data-time-component=minutes]").text(minute);timeComponents.filter("[data-time-component=seconds]").text(second)},click:function(e){e.stopPropagation();e.preventDefault();this._unset=false;var target=$(e.target).closest("span, td, th");if(target.length===1){if(!target.is(".disabled")){switch(target[0].nodeName.toLowerCase()){case"th":switch(target[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var vd=this.viewDate;var navFnc=DPGlobal.modes[this.viewMode].navFnc;var step=DPGlobal.modes[this.viewMode].navStep;if(target[0].className==="prev")step=step*-1;vd["set"+navFnc](vd["get"+navFnc]()+step);this.fillDate();this.set();break}break;case"span":if(target.is(".month")){var month=target.parent().find("span").index(target);this.viewDate.setUTCMonth(month)}else{var year=parseInt(target.text(),10)||0;this.viewDate.setUTCFullYear(year)}if(this.viewMode!==0){this._date=UTCDate(this.viewDate.getUTCFullYear(),this.viewDate.getUTCMonth(),this.viewDate.getUTCDate(),this._date.getUTCHours(),this._date.getUTCMinutes(),this._date.getUTCSeconds(),this._date.getUTCMilliseconds());this.notifyChange()}this.showMode(-1);this.fillDate();this.set();break;case"td":if(target.is(".day")){var day=parseInt(target.text(),10)||1;var month=this.viewDate.getUTCMonth();var year=this.viewDate.getUTCFullYear();if(target.is(".old")){if(month===0){month=11;year-=1}else{month-=1}}else if(target.is(".new")){if(month==11){month=0;year+=1}else{month+=1}}this._date=UTCDate(year,month,day,this._date.getUTCHours(),this._date.getUTCMinutes(),this._date.getUTCSeconds(),this._date.getUTCMilliseconds());this.viewDate=UTCDate(year,month,Math.min(28,day),0,0,0,0);this.fillDate();this.set();this.notifyChange()}break}}}},actions:{incrementHours:function(e){this._date.setUTCHours(this._date.getUTCHours()+1)},incrementMinutes:function(e){this._date.setUTCMinutes(this._date.getUTCMinutes()+1)},incrementSeconds:function(e){this._date.setUTCSeconds(this._date.getUTCSeconds()+1)},decrementHours:function(e){this._date.setUTCHours(this._date.getUTCHours()-1)},decrementMinutes:function(e){this._date.setUTCMinutes(this._date.getUTCMinutes()-1)},decrementSeconds:function(e){this._date.setUTCSeconds(this._date.getUTCSeconds()-1)},togglePeriod:function(e){var hour=this._date.getUTCHours();if(hour>=12)hour-=12;else hour+=12;this._date.setUTCHours(hour)},showPicker:function(){this.widget.find(".timepicker > div:not(.timepicker-picker)").hide();this.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){this.widget.find(".timepicker .timepicker-picker").hide();this.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){this.widget.find(".timepicker .timepicker-picker").hide();this.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){this.widget.find(".timepicker .timepicker-picker").hide();this.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(e){var tgt=$(e.target);var value=parseInt(tgt.text(),10);if(this.options.pick12HourFormat){var current=this._date.getUTCHours();if(current>=12){if(value!=12)value=(value+12)%24}else{if(value===12)value=0;else value=value%12}}this._date.setUTCHours(value);this.actions.showPicker.call(this)},selectMinute:function(e){var tgt=$(e.target);var value=parseInt(tgt.text(),10);this._date.setUTCMinutes(value);this.actions.showPicker.call(this)},selectSecond:function(e){var tgt=$(e.target);var value=parseInt(tgt.text(),10);this._date.setUTCSeconds(value);this.actions.showPicker.call(this)}},doAction:function(e){e.stopPropagation();e.preventDefault();if(!this._date)this._date=UTCDate(1970,0,0,0,0,0,0);var action=$(e.currentTarget).data("action");var rv=this.actions[action].apply(this,arguments);this.set();this.fillTime();this.notifyChange();return rv},stopEvent:function(e){e.stopPropagation();e.preventDefault()},keydown:function(e){var self=this,k=e.which,input=$(e.target);if(k==8||k==46){setTimeout(function(){self._resetMaskPos(input)})}},keypress:function(e){var k=e.which;if(k==8||k==46){return}var input=$(e.target);var c=String.fromCharCode(k);var val=input.val()||"";val+=c;var mask=this._mask[this._maskPos];if(!mask){return false}if(mask.end!=val.length){return}if(!mask.pattern.test(val.slice(mask.start))){val=val.slice(0,val.length-1);while((mask=this._mask[this._maskPos])&&mask.character){val+=mask.character;this._maskPos++}val+=c;if(mask.end!=val.length){input.val(val);return false}else{if(!mask.pattern.test(val.slice(mask.start))){input.val(val.slice(0,mask.start));return false}else{input.val(val);this._maskPos++;return false}}}else{this._maskPos++}},change:function(e){var input=$(e.target);var val=input.val();if(this._formatPattern.test(val)){this.update();this.setValue(this._date.getTime());this.notifyChange();this.set()}else if(val&&val.trim()){this.setValue(this._date.getTime());if(this._date)this.set();else input.val("")}else{if(this._date){this.setValue(null);this.notifyChange();this._unset=true}}this._resetMaskPos(input)},showMode:function(dir){if(dir){this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+dir))}this.widget.find(".datepicker > div").hide().filter(".datepicker-"+DPGlobal.modes[this.viewMode].clsName).show()},destroy:function(){this._detachDatePickerEvents();this._detachDatePickerGlobalEvents();this.widget.remove();this.$element.removeData("datetimepicker");this.component.removeData("datetimepicker")},formatDate:function(d){return this.format.replace(formatReplacer,function(match){var methodName,property,rv,len=match.length;if(match==="ms")len=1;property=dateFormatComponents[match].property;if(property==="Hours12"){rv=d.getUTCHours();if(rv===0)rv=12;else if(rv!==12)rv=rv%12}else if(property==="Period12"){if(d.getUTCHours()>=12)return"PM";else return"AM"}else{methodName="get"+property;rv=d[methodName]()}if(methodName==="getUTCMonth")rv=rv+1;if(methodName==="getUTCYear")rv=rv+1900-2e3;return padLeft(rv.toString(),len,"0")})},parseDate:function(str){var match,i,property,methodName,value,parsed={};if(!(match=this._formatPattern.exec(str)))return null;for(i=1;ival.length){this._maskPos=i;break}else if(this._mask[i].end===val.length){this._maskPos=i+1;break}}},_finishParsingDate:function(parsed){var year,month,date,hours,minutes,seconds,milliseconds;year=parsed.UTCFullYear;if(parsed.UTCYear)year=2e3+parsed.UTCYear;if(!year)year=1970;if(parsed.UTCMonth)month=parsed.UTCMonth-1;else month=0;date=parsed.UTCDate||1;hours=parsed.UTCHours||0;minutes=parsed.UTCMinutes||0;seconds=parsed.UTCSeconds||0;milliseconds=parsed.UTCMilliseconds||0;if(parsed.Hours12){hours=parsed.Hours12}if(parsed.Period12){if(/pm/i.test(parsed.Period12)){if(hours!=12)hours=(hours+12)%24}else{hours=hours%12}}return UTCDate(year,month,date,hours,minutes,seconds,milliseconds)},_compileFormat:function(){var match,component,components=[],mask=[],str=this.format,propertiesByIndex={},i=0,pos=0;while(match=formatComponent.exec(str)){component=match[0];if(component in dateFormatComponents){i++;propertiesByIndex[i]=dateFormatComponents[component].property;components.push("\\s*"+dateFormatComponents[component].getPattern(this)+"\\s*");mask.push({pattern:new RegExp(dateFormatComponents[component].getPattern(this)),property:dateFormatComponents[component].property,start:pos,end:pos+=component.length})}else{components.push(escapeRegExp(component));mask.push({pattern:new RegExp(escapeRegExp(component)),character:component,start:pos,end:++pos})}str=str.slice(component.length)}this._mask=mask;this._maskPos=0;this._formatPattern=new RegExp("^\\s*"+components.join("")+"\\s*$");this._propertiesByIndex=propertiesByIndex},_attachDatePickerEvents:function(){var self=this;this.widget.on("click",".datepicker *",$.proxy(this.click,this));this.widget.on("click","[data-action]",$.proxy(this.doAction,this));this.widget.on("mousedown",$.proxy(this.stopEvent,this));if(this.pickDate&&this.pickTime){this.widget.on("click.togglePicker",".accordion-toggle",function(e){e.stopPropagation();var $this=$(this);var $parent=$this.closest("ul");var expanded=$parent.find(".collapse.in");var closed=$parent.find(".collapse:not(.in)");if(expanded&&expanded.length){var collapseData=expanded.data("collapse");if(collapseData&&collapseData.transitioning)return;expanded.collapse("hide");closed.collapse("show");$this.find("i").toggleClass(self.timeIcon+" "+self.dateIcon);self.$element.find(".add-on i").toggleClass(self.timeIcon+" "+self.dateIcon)}})}if(this.isInput){this.$element.on({focus:$.proxy(this.show,this),change:$.proxy(this.change,this)});if(this.options.maskInput){this.$element.on({keydown:$.proxy(this.keydown,this),keypress:$.proxy(this.keypress,this)})}}else{this.$element.on({change:$.proxy(this.change,this)},"input");if(this.options.maskInput){this.$element.on({keydown:$.proxy(this.keydown,this),keypress:$.proxy(this.keypress,this)},"input")}if(this.component){this.component.on("click",$.proxy(this.show,this))}else{this.$element.on("click",$.proxy(this.show,this))}}},_attachDatePickerGlobalEvents:function(){$(window).on("resize.datetimepicker"+this.id,$.proxy(this.place,this));if(!this.isInput){$(document).on("mousedown.datetimepicker"+this.id,$.proxy(this.hide,this))}},_detachDatePickerEvents:function(){this.widget.off("click",".datepicker *",this.click);this.widget.off("click","[data-action]");this.widget.off("mousedown",this.stopEvent);if(this.pickDate&&this.pickTime){this.widget.off("click.togglePicker")}if(this.isInput){this.$element.off({focus:this.show,change:this.change});if(this.options.maskInput){this.$element.off({keydown:this.keydown,keypress:this.keypress})}}else{this.$element.off({change:this.change},"input");if(this.options.maskInput){this.$element.off({keydown:this.keydown,keypress:this.keypress},"input")}if(this.component){this.component.off("click",this.show)}else{this.$element.off("click",this.show)}}},_detachDatePickerGlobalEvents:function(){$(window).off("resize.datetimepicker"+this.id);if(!this.isInput){$(document).off("mousedown.datetimepicker"+this.id)}},_isInFixed:function(){if(this.$element){var parents=this.$element.parents();var inFixed=false;for(var i=0;i'+"
    "+""+'
    '+DPGlobal.template+"
    "+""+'
  • '+""+'
    '+TPGlobal.getTemplate(is12Hours,showSeconds)+"
    "+""+"
"+""}else if(pickTime){return'"}else{return'"}}function UTCDate(){return new Date(Date.UTC.apply(Date,arguments))}var DPGlobal={modes:[{clsName:"days",navFnc:"UTCMonth",navStep:1},{clsName:"months",navFnc:"UTCFullYear",navStep:1},{clsName:"years",navFnc:"UTCFullYear",navStep:10}],isLeapYear:function(year){return year%4===0&&year%100!==0||year%400===0},getDaysInMonth:function(year,month){return[31,DPGlobal.isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31][month]},headTemplate:""+""+'‹'+''+'›'+""+"",contTemplate:''};DPGlobal.template='
'+''+DPGlobal.headTemplate+""+"
"+"
"+'
'+''+DPGlobal.headTemplate+DPGlobal.contTemplate+"
"+"
"+'
'+''+DPGlobal.headTemplate+DPGlobal.contTemplate+"
"+"
";var TPGlobal={hourTemplate:'',minuteTemplate:'',secondTemplate:''};TPGlobal.getTemplate=function(is12Hours,showSeconds){return'
'+'"+""+''+''+''+(showSeconds?''+'':"")+(is12Hours?'':"")+""+""+" "+''+" "+(showSeconds?''+"":"")+(is12Hours?''+"":"")+""+""+''+''+''+(showSeconds?''+'':"")+(is12Hours?'':"")+""+"
"+TPGlobal.hourTemplate+":"+TPGlobal.minuteTemplate+":"+TPGlobal.secondTemplate+""+''+"
"+"
"+'
'+''+"
"+"
"+'
'+''+"
"+"
"+(showSeconds?'
'+''+"
"+"
":"")}})(window.jQuery); \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/assets/scripts/bootstrap.js b/400-SOURCECODE/Admin/src/assets/scripts/bootstrap.js new file mode 100644 index 0000000..30b701d --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/scripts/bootstrap.js @@ -0,0 +1,2366 @@ +/*! + * Bootstrap v3.3.5 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! + * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=7b2c778c370c61853a11) + * Config saved to config.json and https://gist.github.com/7b2c778c370c61853a11 + */ +if (typeof jQuery === 'undefined') { + throw new Error('Bootstrap\'s JavaScript requires jQuery') +} ++function ($) { + 'use strict'; + var version = $.fn.jquery.split(' ')[0].split('.') + if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) { + throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3') + } +}(jQuery); + +/* ======================================================================== + * Bootstrap: alert.js v3.3.6 + * http://getbootstrap.com/javascript/#alerts + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // ALERT CLASS DEFINITION + // ====================== + + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.VERSION = '3.3.6' + + Alert.TRANSITION_DURATION = 150 + + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = $(selector) + + if (e) e.preventDefault() + + if (!$parent.length) { + $parent = $this.closest('.alert') + } + + $parent.trigger(e = $.Event('close.bs.alert')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent + .one('bsTransitionEnd', removeElement) + .emulateTransitionEnd(Alert.TRANSITION_DURATION) : + removeElement() + } + + + // ALERT PLUGIN DEFINITION + // ======================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + var old = $.fn.alert + + $.fn.alert = Plugin + $.fn.alert.Constructor = Alert + + + // ALERT NO CONFLICT + // ================= + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + // ALERT DATA-API + // ============== + + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: button.js v3.3.6 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false + } + + Button.VERSION = '3.3.6' + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state += 'Text' + + if (data.resetText == null) $el.data('resetText', $el[val]()) + + // push to event loop to allow forms to submit + setTimeout($.proxy(function () { + $el[val](data[state] == null ? this.options[state] : data[state]) + + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) + } + + Button.prototype.toggle = function () { + var changed = true + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked')) changed = false + $parent.find('.active').removeClass('active') + this.$element.addClass('active') + } else if ($input.prop('type') == 'checkbox') { + if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false + this.$element.toggleClass('active') + } + $input.prop('checked', this.$element.hasClass('active')) + if (changed) $input.trigger('change') + } else { + this.$element.attr('aria-pressed', !this.$element.hasClass('active')) + this.$element.toggleClass('active') + } + } + + + // BUTTON PLUGIN DEFINITION + // ======================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + var old = $.fn.button + + $.fn.button = Plugin + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + // BUTTON DATA-API + // =============== + + $(document) + .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + Plugin.call($btn, 'toggle') + if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault() + }) + .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { + $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: carousel.js v3.3.6 + * http://getbootstrap.com/javascript/#carousel + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CAROUSEL CLASS DEFINITION + // ========================= + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = null + this.sliding = null + this.interval = null + this.$active = null + this.$items = null + + this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) + + this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element + .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) + .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) + } + + Carousel.VERSION = '3.3.6' + + Carousel.TRANSITION_DURATION = 600 + + Carousel.DEFAULTS = { + interval: 5000, + pause: 'hover', + wrap: true, + keyboard: true + } + + Carousel.prototype.keydown = function (e) { + if (/input|textarea/i.test(e.target.tagName)) return + switch (e.which) { + case 37: this.prev(); break + case 39: this.next(); break + default: return + } + + e.preventDefault() + } + + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) + + this.interval && clearInterval(this.interval) + + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + + return this + } + + Carousel.prototype.getItemIndex = function (item) { + this.$items = item.parent().children('.item') + return this.$items.index(item || this.$active) + } + + Carousel.prototype.getItemForDirection = function (direction, active) { + var activeIndex = this.getItemIndex(active) + var willWrap = (direction == 'prev' && activeIndex === 0) + || (direction == 'next' && activeIndex == (this.$items.length - 1)) + if (willWrap && !this.options.wrap) return active + var delta = direction == 'prev' ? -1 : 1 + var itemIndex = (activeIndex + delta) % this.$items.length + return this.$items.eq(itemIndex) + } + + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" + if (activeIndex == pos) return this.pause().cycle() + + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) + } + + Carousel.prototype.pause = function (e) { + e || (this.paused = true) + + if (this.$element.find('.next, .prev').length && $.support.transition) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + + this.interval = clearInterval(this.interval) + + return this + } + + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') + } + + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } + + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || this.getItemForDirection(type, $active) + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var that = this + + if ($next.hasClass('active')) return (this.sliding = false) + + var relatedTarget = $next[0] + var slideEvent = $.Event('slide.bs.carousel', { + relatedTarget: relatedTarget, + direction: direction + }) + this.$element.trigger(slideEvent) + if (slideEvent.isDefaultPrevented()) return + + this.sliding = true + + isCycling && this.pause() + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) + $nextIndicator && $nextIndicator.addClass('active') + } + + var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" + if ($.support.transition && this.$element.hasClass('slide')) { + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one('bsTransitionEnd', function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { + that.$element.trigger(slidEvent) + }, 0) + }) + .emulateTransitionEnd(Carousel.TRANSITION_DURATION) + } else { + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger(slidEvent) + } + + isCycling && this.cycle() + + return this + } + + + // CAROUSEL PLUGIN DEFINITION + // ========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide + + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + var old = $.fn.carousel + + $.fn.carousel = Plugin + $.fn.carousel.Constructor = Carousel + + + // CAROUSEL NO CONFLICT + // ==================== + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + + // CAROUSEL DATA-API + // ================= + + var clickHandler = function (e) { + var href + var $this = $(this) + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 + if (!$target.hasClass('carousel')) return + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false + + Plugin.call($target, options) + + if (slideIndex) { + $target.data('bs.carousel').to(slideIndex) + } + + e.preventDefault() + } + + $(document) + .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) + .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) + + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + Plugin.call($carousel, $carousel.data()) + }) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.3.6 + * http://getbootstrap.com/javascript/#dropdowns + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle="dropdown"]' + var Dropdown = function (element) { + $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.VERSION = '3.3.6' + + function getParent($this) { + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = selector && $(selector) + + return $parent && $parent.length ? $parent : $this.parent() + } + + function clearMenus(e) { + if (e && e.which === 3) return + $(backdrop).remove() + $(toggle).each(function () { + var $this = $(this) + var $parent = getParent($this) + var relatedTarget = { relatedTarget: this } + + if (!$parent.hasClass('open')) return + + if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return + + $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) + + if (e.isDefaultPrevented()) return + + $this.attr('aria-expanded', 'false') + $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) + }) + } + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we use a backdrop because click events don't delegate + $(document.createElement('div')) + .addClass('dropdown-backdrop') + .insertAfter($(this)) + .on('click', clearMenus) + } + + var relatedTarget = { relatedTarget: this } + $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) + + if (e.isDefaultPrevented()) return + + $this + .trigger('focus') + .attr('aria-expanded', 'true') + + $parent + .toggleClass('open') + .trigger($.Event('shown.bs.dropdown', relatedTarget)) + } + + return false + } + + Dropdown.prototype.keydown = function (e) { + if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return + + var $this = $(this) + + e.preventDefault() + e.stopPropagation() + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + if (!isActive && e.which != 27 || isActive && e.which == 27) { + if (e.which == 27) $parent.find(toggle).trigger('focus') + return $this.trigger('click') + } + + var desc = ' li:not(.disabled):visible a' + var $items = $parent.find('.dropdown-menu' + desc) + + if (!$items.length) return + + var index = $items.index(e.target) + + if (e.which == 38 && index > 0) index-- // up + if (e.which == 40 && index < $items.length - 1) index++ // down + if (!~index) index = 0 + + $items.eq(index).trigger('focus') + } + + + // DROPDOWN PLUGIN DEFINITION + // ========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.dropdown') + + if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + var old = $.fn.dropdown + + $.fn.dropdown = Plugin + $.fn.dropdown.Constructor = Dropdown + + + // DROPDOWN NO CONFLICT + // ==================== + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } + + + // APPLY TO STANDARD DROPDOWN ELEMENTS + // =================================== + + $(document) + .on('click.bs.dropdown.data-api', clearMenus) + .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) + .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) + .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) + .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: modal.js v3.3.6 + * http://getbootstrap.com/javascript/#modals + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // MODAL CLASS DEFINITION + // ====================== + + var Modal = function (element, options) { + this.options = options + this.$body = $(document.body) + this.$element = $(element) + this.$dialog = this.$element.find('.modal-dialog') + this.$backdrop = null + this.isShown = null + this.originalBodyPad = null + this.scrollbarWidth = 0 + this.ignoreBackdropClick = false + + if (this.options.remote) { + this.$element + .find('.modal-content') + .load(this.options.remote, $.proxy(function () { + this.$element.trigger('loaded.bs.modal') + }, this)) + } + } + + Modal.VERSION = '3.3.6' + + Modal.TRANSITION_DURATION = 300 + Modal.BACKDROP_TRANSITION_DURATION = 150 + + Modal.DEFAULTS = { + backdrop: true, + keyboard: true, + show: true + } + + Modal.prototype.toggle = function (_relatedTarget) { + return this.isShown ? this.hide() : this.show(_relatedTarget) + } + + Modal.prototype.show = function (_relatedTarget) { + var that = this + var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) + + this.$element.trigger(e) + + if (this.isShown || e.isDefaultPrevented()) return + + this.isShown = true + + this.checkScrollbar() + this.setScrollbar() + this.$body.addClass('modal-open') + + this.escape() + this.resize() + + this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) + + this.$dialog.on('mousedown.dismiss.bs.modal', function () { + that.$element.one('mouseup.dismiss.bs.modal', function (e) { + if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true + }) + }) + + this.backdrop(function () { + var transition = $.support.transition && that.$element.hasClass('fade') + + if (!that.$element.parent().length) { + that.$element.appendTo(that.$body) // don't move modals dom position + } + + that.$element + .show() + .scrollTop(0) + + that.adjustDialog() + + if (transition) { + that.$element[0].offsetWidth // force reflow + } + + that.$element.addClass('in') + + that.enforceFocus() + + var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) + + transition ? + that.$dialog // wait for modal to slide in + .one('bsTransitionEnd', function () { + that.$element.trigger('focus').trigger(e) + }) + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : + that.$element.trigger('focus').trigger(e) + }) + } + + Modal.prototype.hide = function (e) { + if (e) e.preventDefault() + + e = $.Event('hide.bs.modal') + + this.$element.trigger(e) + + if (!this.isShown || e.isDefaultPrevented()) return + + this.isShown = false + + this.escape() + this.resize() + + $(document).off('focusin.bs.modal') + + this.$element + .removeClass('in') + .off('click.dismiss.bs.modal') + .off('mouseup.dismiss.bs.modal') + + this.$dialog.off('mousedown.dismiss.bs.modal') + + $.support.transition && this.$element.hasClass('fade') ? + this.$element + .one('bsTransitionEnd', $.proxy(this.hideModal, this)) + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : + this.hideModal() + } + + Modal.prototype.enforceFocus = function () { + $(document) + .off('focusin.bs.modal') // guard against infinite focus loop + .on('focusin.bs.modal', $.proxy(function (e) { + if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { + this.$element.trigger('focus') + } + }, this)) + } + + Modal.prototype.escape = function () { + if (this.isShown && this.options.keyboard) { + this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { + e.which == 27 && this.hide() + }, this)) + } else if (!this.isShown) { + this.$element.off('keydown.dismiss.bs.modal') + } + } + + Modal.prototype.resize = function () { + if (this.isShown) { + $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) + } else { + $(window).off('resize.bs.modal') + } + } + + Modal.prototype.hideModal = function () { + var that = this + this.$element.hide() + this.backdrop(function () { + that.$body.removeClass('modal-open') + that.resetAdjustments() + that.resetScrollbar() + that.$element.trigger('hidden.bs.modal') + }) + } + + Modal.prototype.removeBackdrop = function () { + this.$backdrop && this.$backdrop.remove() + this.$backdrop = null + } + + Modal.prototype.backdrop = function (callback) { + var that = this + var animate = this.$element.hasClass('fade') ? 'fade' : '' + + if (this.isShown && this.options.backdrop) { + var doAnimate = $.support.transition && animate + + this.$backdrop = $(document.createElement('div')) + .addClass('modal-backdrop ' + animate) + .appendTo(this.$body) + + this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { + if (this.ignoreBackdropClick) { + this.ignoreBackdropClick = false + return + } + if (e.target !== e.currentTarget) return + this.options.backdrop == 'static' + ? this.$element[0].focus() + : this.hide() + }, this)) + + if (doAnimate) this.$backdrop[0].offsetWidth // force reflow + + this.$backdrop.addClass('in') + + if (!callback) return + + doAnimate ? + this.$backdrop + .one('bsTransitionEnd', callback) + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : + callback() + + } else if (!this.isShown && this.$backdrop) { + this.$backdrop.removeClass('in') + + var callbackRemove = function () { + that.removeBackdrop() + callback && callback() + } + $.support.transition && this.$element.hasClass('fade') ? + this.$backdrop + .one('bsTransitionEnd', callbackRemove) + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : + callbackRemove() + + } else if (callback) { + callback() + } + } + + // these following methods are used to handle overflowing modals + + Modal.prototype.handleUpdate = function () { + this.adjustDialog() + } + + Modal.prototype.adjustDialog = function () { + var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight + + this.$element.css({ + paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', + paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' + }) + } + + Modal.prototype.resetAdjustments = function () { + this.$element.css({ + paddingLeft: '', + paddingRight: '' + }) + } + + Modal.prototype.checkScrollbar = function () { + var fullWindowWidth = window.innerWidth + if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 + var documentElementRect = document.documentElement.getBoundingClientRect() + fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) + } + this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth + this.scrollbarWidth = this.measureScrollbar() + } + + Modal.prototype.setScrollbar = function () { + var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) + this.originalBodyPad = document.body.style.paddingRight || '' + if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) + } + + Modal.prototype.resetScrollbar = function () { + this.$body.css('padding-right', this.originalBodyPad) + } + + Modal.prototype.measureScrollbar = function () { // thx walsh + var scrollDiv = document.createElement('div') + scrollDiv.className = 'modal-scrollbar-measure' + this.$body.append(scrollDiv) + var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth + this.$body[0].removeChild(scrollDiv) + return scrollbarWidth + } + + + // MODAL PLUGIN DEFINITION + // ======================= + + function Plugin(option, _relatedTarget) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.modal') + var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data) $this.data('bs.modal', (data = new Modal(this, options))) + if (typeof option == 'string') data[option](_relatedTarget) + else if (options.show) data.show(_relatedTarget) + }) + } + + var old = $.fn.modal + + $.fn.modal = Plugin + $.fn.modal.Constructor = Modal + + + // MODAL NO CONFLICT + // ================= + + $.fn.modal.noConflict = function () { + $.fn.modal = old + return this + } + + + // MODAL DATA-API + // ============== + + $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { + var $this = $(this) + var href = $this.attr('href') + var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 + var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) + + if ($this.is('a')) e.preventDefault() + + $target.one('show.bs.modal', function (showEvent) { + if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown + $target.one('hidden.bs.modal', function () { + $this.is(':visible') && $this.trigger('focus') + }) + }) + Plugin.call($target, option, this) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: tooltip.js v3.3.6 + * http://getbootstrap.com/javascript/#tooltip + * Inspired by the original jQuery.tipsy by Jason Frame + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // TOOLTIP PUBLIC CLASS DEFINITION + // =============================== + + var Tooltip = function (element, options) { + this.type = null + this.options = null + this.enabled = null + this.timeout = null + this.hoverState = null + this.$element = null + this.inState = null + + this.init('tooltip', element, options) + } + + Tooltip.VERSION = '3.3.6' + + Tooltip.TRANSITION_DURATION = 150 + + Tooltip.DEFAULTS = { + animation: true, + placement: 'top', + selector: false, + template: '', + trigger: 'hover focus', + title: '', + delay: 0, + html: false, + container: false, + viewport: { + selector: 'body', + padding: 0 + } + } + + Tooltip.prototype.init = function (type, element, options) { + this.enabled = true + this.type = type + this.$element = $(element) + this.options = this.getOptions(options) + this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) + this.inState = { click: false, hover: false, focus: false } + + if (this.$element[0] instanceof document.constructor && !this.options.selector) { + throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') + } + + var triggers = this.options.trigger.split(' ') + + for (var i = triggers.length; i--;) { + var trigger = triggers[i] + + if (trigger == 'click') { + this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) + } else if (trigger != 'manual') { + var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' + var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' + + this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) + this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) + } + } + + this.options.selector ? + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : + this.fixTitle() + } + + Tooltip.prototype.getDefaults = function () { + return Tooltip.DEFAULTS + } + + Tooltip.prototype.getOptions = function (options) { + options = $.extend({}, this.getDefaults(), this.$element.data(), options) + + if (options.delay && typeof options.delay == 'number') { + options.delay = { + show: options.delay, + hide: options.delay + } + } + + return options + } + + Tooltip.prototype.getDelegateOptions = function () { + var options = {} + var defaults = this.getDefaults() + + this._options && $.each(this._options, function (key, value) { + if (defaults[key] != value) options[key] = value + }) + + return options + } + + Tooltip.prototype.enter = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget).data('bs.' + this.type) + + if (!self) { + self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) + $(obj.currentTarget).data('bs.' + this.type, self) + } + + if (obj instanceof $.Event) { + self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true + } + + if (self.tip().hasClass('in') || self.hoverState == 'in') { + self.hoverState = 'in' + return + } + + clearTimeout(self.timeout) + + self.hoverState = 'in' + + if (!self.options.delay || !self.options.delay.show) return self.show() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'in') self.show() + }, self.options.delay.show) + } + + Tooltip.prototype.isInStateTrue = function () { + for (var key in this.inState) { + if (this.inState[key]) return true + } + + return false + } + + Tooltip.prototype.leave = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget).data('bs.' + this.type) + + if (!self) { + self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) + $(obj.currentTarget).data('bs.' + this.type, self) + } + + if (obj instanceof $.Event) { + self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false + } + + if (self.isInStateTrue()) return + + clearTimeout(self.timeout) + + self.hoverState = 'out' + + if (!self.options.delay || !self.options.delay.hide) return self.hide() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'out') self.hide() + }, self.options.delay.hide) + } + + Tooltip.prototype.show = function () { + var e = $.Event('show.bs.' + this.type) + + if (this.hasContent() && this.enabled) { + this.$element.trigger(e) + + var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) + if (e.isDefaultPrevented() || !inDom) return + var that = this + + var $tip = this.tip() + + var tipId = this.getUID(this.type) + + this.setContent() + $tip.attr('id', tipId) + this.$element.attr('aria-describedby', tipId) + + if (this.options.animation) $tip.addClass('fade') + + var placement = typeof this.options.placement == 'function' ? + this.options.placement.call(this, $tip[0], this.$element[0]) : + this.options.placement + + var autoToken = /\s?auto?\s?/i + var autoPlace = autoToken.test(placement) + if (autoPlace) placement = placement.replace(autoToken, '') || 'top' + + $tip + .detach() + .css({ top: 0, left: 0, display: 'block' }) + .addClass(placement) + .data('bs.' + this.type, this) + + this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) + this.$element.trigger('inserted.bs.' + this.type) + + var pos = this.getPosition() + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (autoPlace) { + var orgPlacement = placement + var viewportDim = this.getPosition(this.$viewport) + + placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : + placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : + placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : + placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : + placement + + $tip + .removeClass(orgPlacement) + .addClass(placement) + } + + var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) + + this.applyPlacement(calculatedOffset, placement) + + var complete = function () { + var prevHoverState = that.hoverState + that.$element.trigger('shown.bs.' + that.type) + that.hoverState = null + + if (prevHoverState == 'out') that.leave(that) + } + + $.support.transition && this.$tip.hasClass('fade') ? + $tip + .one('bsTransitionEnd', complete) + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : + complete() + } + } + + Tooltip.prototype.applyPlacement = function (offset, placement) { + var $tip = this.tip() + var width = $tip[0].offsetWidth + var height = $tip[0].offsetHeight + + // manually read margins because getBoundingClientRect includes difference + var marginTop = parseInt($tip.css('margin-top'), 10) + var marginLeft = parseInt($tip.css('margin-left'), 10) + + // we must check for NaN for ie 8/9 + if (isNaN(marginTop)) marginTop = 0 + if (isNaN(marginLeft)) marginLeft = 0 + + offset.top += marginTop + offset.left += marginLeft + + // $.fn.offset doesn't round pixel values + // so we use setOffset directly with our own function B-0 + $.offset.setOffset($tip[0], $.extend({ + using: function (props) { + $tip.css({ + top: Math.round(props.top), + left: Math.round(props.left) + }) + } + }, offset), 0) + + $tip.addClass('in') + + // check to see if placing tip in new offset caused the tip to resize itself + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (placement == 'top' && actualHeight != height) { + offset.top = offset.top + height - actualHeight + } + + var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) + + if (delta.left) offset.left += delta.left + else offset.top += delta.top + + var isVertical = /top|bottom/.test(placement) + var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight + var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' + + $tip.offset(offset) + this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) + } + + Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { + this.arrow() + .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') + .css(isVertical ? 'top' : 'left', '') + } + + Tooltip.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) + $tip.removeClass('fade in top bottom left right') + } + + Tooltip.prototype.hide = function (callback) { + var that = this + var $tip = $(this.$tip) + var e = $.Event('hide.bs.' + this.type) + + function complete() { + if (that.hoverState != 'in') $tip.detach() + that.$element + .removeAttr('aria-describedby') + .trigger('hidden.bs.' + that.type) + callback && callback() + } + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + $tip.removeClass('in') + + $.support.transition && $tip.hasClass('fade') ? + $tip + .one('bsTransitionEnd', complete) + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : + complete() + + this.hoverState = null + + return this + } + + Tooltip.prototype.fixTitle = function () { + var $e = this.$element + if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { + $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') + } + } + + Tooltip.prototype.hasContent = function () { + return this.getTitle() + } + + Tooltip.prototype.getPosition = function ($element) { + $element = $element || this.$element + + var el = $element[0] + var isBody = el.tagName == 'BODY' + + var elRect = el.getBoundingClientRect() + if (elRect.width == null) { + // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 + elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) + } + var elOffset = isBody ? { top: 0, left: 0 } : $element.offset() + var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } + var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null + + return $.extend({}, elRect, scroll, outerDims, elOffset) + } + + Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { + return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : + /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } + + } + + Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { + var delta = { top: 0, left: 0 } + if (!this.$viewport) return delta + + var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 + var viewportDimensions = this.getPosition(this.$viewport) + + if (/right|left/.test(placement)) { + var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll + var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight + if (topEdgeOffset < viewportDimensions.top) { // top overflow + delta.top = viewportDimensions.top - topEdgeOffset + } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow + delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset + } + } else { + var leftEdgeOffset = pos.left - viewportPadding + var rightEdgeOffset = pos.left + viewportPadding + actualWidth + if (leftEdgeOffset < viewportDimensions.left) { // left overflow + delta.left = viewportDimensions.left - leftEdgeOffset + } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow + delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset + } + } + + return delta + } + + Tooltip.prototype.getTitle = function () { + var title + var $e = this.$element + var o = this.options + + title = $e.attr('data-original-title') + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) + + return title + } + + Tooltip.prototype.getUID = function (prefix) { + do prefix += ~~(Math.random() * 1000000) + while (document.getElementById(prefix)) + return prefix + } + + Tooltip.prototype.tip = function () { + if (!this.$tip) { + this.$tip = $(this.options.template) + if (this.$tip.length != 1) { + throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') + } + } + return this.$tip + } + + Tooltip.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) + } + + Tooltip.prototype.enable = function () { + this.enabled = true + } + + Tooltip.prototype.disable = function () { + this.enabled = false + } + + Tooltip.prototype.toggleEnabled = function () { + this.enabled = !this.enabled + } + + Tooltip.prototype.toggle = function (e) { + var self = this + if (e) { + self = $(e.currentTarget).data('bs.' + this.type) + if (!self) { + self = new this.constructor(e.currentTarget, this.getDelegateOptions()) + $(e.currentTarget).data('bs.' + this.type, self) + } + } + + if (e) { + self.inState.click = !self.inState.click + if (self.isInStateTrue()) self.enter(self) + else self.leave(self) + } else { + self.tip().hasClass('in') ? self.leave(self) : self.enter(self) + } + } + + Tooltip.prototype.destroy = function () { + var that = this + clearTimeout(this.timeout) + this.hide(function () { + that.$element.off('.' + that.type).removeData('bs.' + that.type) + if (that.$tip) { + that.$tip.detach() + } + that.$tip = null + that.$arrow = null + that.$viewport = null + }) + } + + + // TOOLTIP PLUGIN DEFINITION + // ========================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tooltip') + var options = typeof option == 'object' && option + + if (!data && /destroy|hide/.test(option)) return + if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.tooltip + + $.fn.tooltip = Plugin + $.fn.tooltip.Constructor = Tooltip + + + // TOOLTIP NO CONFLICT + // =================== + + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + +}(jQuery); + +/* ======================================================================== + * Bootstrap: popover.js v3.3.6 + * http://getbootstrap.com/javascript/#popovers + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // POPOVER PUBLIC CLASS DEFINITION + // =============================== + + var Popover = function (element, options) { + this.init('popover', element, options) + } + + if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') + + Popover.VERSION = '3.3.6' + + Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { + placement: 'right', + trigger: 'click', + content: '', + template: '' + }) + + + // NOTE: POPOVER EXTENDS tooltip.js + // ================================ + + Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) + + Popover.prototype.constructor = Popover + + Popover.prototype.getDefaults = function () { + return Popover.DEFAULTS + } + + Popover.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + var content = this.getContent() + + $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) + $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events + this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' + ](content) + + $tip.removeClass('fade top bottom left right in') + + // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do + // this manually by checking the contents. + if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() + } + + Popover.prototype.hasContent = function () { + return this.getTitle() || this.getContent() + } + + Popover.prototype.getContent = function () { + var $e = this.$element + var o = this.options + + return $e.attr('data-content') + || (typeof o.content == 'function' ? + o.content.call($e[0]) : + o.content) + } + + Popover.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.arrow')) + } + + + // POPOVER PLUGIN DEFINITION + // ========================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.popover') + var options = typeof option == 'object' && option + + if (!data && /destroy|hide/.test(option)) return + if (!data) $this.data('bs.popover', (data = new Popover(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.popover + + $.fn.popover = Plugin + $.fn.popover.Constructor = Popover + + + // POPOVER NO CONFLICT + // =================== + + $.fn.popover.noConflict = function () { + $.fn.popover = old + return this + } + +}(jQuery); + +/* ======================================================================== + * Bootstrap: tab.js v3.3.6 + * http://getbootstrap.com/javascript/#tabs + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // TAB CLASS DEFINITION + // ==================== + + var Tab = function (element) { + // jscs:disable requireDollarBeforejQueryAssignment + this.element = $(element) + // jscs:enable requireDollarBeforejQueryAssignment + } + + Tab.VERSION = '3.3.6' + + Tab.TRANSITION_DURATION = 150 + + Tab.prototype.show = function () { + var $this = this.element + var $ul = $this.closest('ul:not(.dropdown-menu)') + var selector = $this.data('target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + if ($this.parent('li').hasClass('active')) return + + var $previous = $ul.find('.active:last a') + var hideEvent = $.Event('hide.bs.tab', { + relatedTarget: $this[0] + }) + var showEvent = $.Event('show.bs.tab', { + relatedTarget: $previous[0] + }) + + $previous.trigger(hideEvent) + $this.trigger(showEvent) + + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return + + var $target = $(selector) + + this.activate($this.closest('li'), $ul) + this.activate($target, $target.parent(), function () { + $previous.trigger({ + type: 'hidden.bs.tab', + relatedTarget: $this[0] + }) + $this.trigger({ + type: 'shown.bs.tab', + relatedTarget: $previous[0] + }) + }) + } + + Tab.prototype.activate = function (element, container, callback) { + var $active = container.find('> .active') + var transition = callback + && $.support.transition + && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) + + function next() { + $active + .removeClass('active') + .find('> .dropdown-menu > .active') + .removeClass('active') + .end() + .find('[data-toggle="tab"]') + .attr('aria-expanded', false) + + element + .addClass('active') + .find('[data-toggle="tab"]') + .attr('aria-expanded', true) + + if (transition) { + element[0].offsetWidth // reflow for transition + element.addClass('in') + } else { + element.removeClass('fade') + } + + if (element.parent('.dropdown-menu').length) { + element + .closest('li.dropdown') + .addClass('active') + .end() + .find('[data-toggle="tab"]') + .attr('aria-expanded', true) + } + + callback && callback() + } + + $active.length && transition ? + $active + .one('bsTransitionEnd', next) + .emulateTransitionEnd(Tab.TRANSITION_DURATION) : + next() + + $active.removeClass('in') + } + + + // TAB PLUGIN DEFINITION + // ===================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tab') + + if (!data) $this.data('bs.tab', (data = new Tab(this))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.tab + + $.fn.tab = Plugin + $.fn.tab.Constructor = Tab + + + // TAB NO CONFLICT + // =============== + + $.fn.tab.noConflict = function () { + $.fn.tab = old + return this + } + + + // TAB DATA-API + // ============ + + var clickHandler = function (e) { + e.preventDefault() + Plugin.call($(this), 'show') + } + + $(document) + .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) + .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: affix.js v3.3.6 + * http://getbootstrap.com/javascript/#affix + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // AFFIX CLASS DEFINITION + // ====================== + + var Affix = function (element, options) { + this.options = $.extend({}, Affix.DEFAULTS, options) + + this.$target = $(this.options.target) + .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) + + this.$element = $(element) + this.affixed = null + this.unpin = null + this.pinnedOffset = null + + this.checkPosition() + } + + Affix.VERSION = '3.3.6' + + Affix.RESET = 'affix affix-top affix-bottom' + + Affix.DEFAULTS = { + offset: 0, + target: window + } + + Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + var targetHeight = this.$target.height() + + if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false + + if (this.affixed == 'bottom') { + if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' + return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' + } + + var initializing = this.affixed == null + var colliderTop = initializing ? scrollTop : position.top + var colliderHeight = initializing ? targetHeight : height + + if (offsetTop != null && scrollTop <= offsetTop) return 'top' + if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' + + return false + } + + Affix.prototype.getPinnedOffset = function () { + if (this.pinnedOffset) return this.pinnedOffset + this.$element.removeClass(Affix.RESET).addClass('affix') + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + return (this.pinnedOffset = position.top - scrollTop) + } + + Affix.prototype.checkPositionWithEventLoop = function () { + setTimeout($.proxy(this.checkPosition, this), 1) + } + + Affix.prototype.checkPosition = function () { + if (!this.$element.is(':visible')) return + + var height = this.$element.height() + var offset = this.options.offset + var offsetTop = offset.top + var offsetBottom = offset.bottom + var scrollHeight = Math.max($(document).height(), $(document.body).height()) + + if (typeof offset != 'object') offsetBottom = offsetTop = offset + if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) + if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) + + var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) + + if (this.affixed != affix) { + if (this.unpin != null) this.$element.css('top', '') + + var affixType = 'affix' + (affix ? '-' + affix : '') + var e = $.Event(affixType + '.bs.affix') + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + this.affixed = affix + this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null + + this.$element + .removeClass(Affix.RESET) + .addClass(affixType) + .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') + } + + if (affix == 'bottom') { + this.$element.offset({ + top: scrollHeight - height - offsetBottom + }) + } + } + + + // AFFIX PLUGIN DEFINITION + // ======================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.affix') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.affix', (data = new Affix(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.affix + + $.fn.affix = Plugin + $.fn.affix.Constructor = Affix + + + // AFFIX NO CONFLICT + // ================= + + $.fn.affix.noConflict = function () { + $.fn.affix = old + return this + } + + + // AFFIX DATA-API + // ============== + + $(window).on('load', function () { + $('[data-spy="affix"]').each(function () { + var $spy = $(this) + var data = $spy.data() + + data.offset = data.offset || {} + + if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom + if (data.offsetTop != null) data.offset.top = data.offsetTop + + Plugin.call($spy, data) + }) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: collapse.js v3.3.6 + * http://getbootstrap.com/javascript/#collapse + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // COLLAPSE PUBLIC CLASS DEFINITION + // ================================ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Collapse.DEFAULTS, options) + this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + + '[data-toggle="collapse"][data-target="#' + element.id + '"]') + this.transitioning = null + + if (this.options.parent) { + this.$parent = this.getParent() + } else { + this.addAriaAndCollapsedClass(this.$element, this.$trigger) + } + + if (this.options.toggle) this.toggle() + } + + Collapse.VERSION = '3.3.6' + + Collapse.TRANSITION_DURATION = 350 + + Collapse.DEFAULTS = { + toggle: true + } + + Collapse.prototype.dimension = function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + Collapse.prototype.show = function () { + if (this.transitioning || this.$element.hasClass('in')) return + + var activesData + var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') + + if (actives && actives.length) { + activesData = actives.data('bs.collapse') + if (activesData && activesData.transitioning) return + } + + var startEvent = $.Event('show.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + if (actives && actives.length) { + Plugin.call(actives, 'hide') + activesData || actives.data('bs.collapse', null) + } + + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + .addClass('collapsing')[dimension](0) + .attr('aria-expanded', true) + + this.$trigger + .removeClass('collapsed') + .attr('aria-expanded', true) + + this.transitioning = 1 + + var complete = function () { + this.$element + .removeClass('collapsing') + .addClass('collapse in')[dimension]('') + this.transitioning = 0 + this.$element + .trigger('shown.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + var scrollSize = $.camelCase(['scroll', dimension].join('-')) + + this.$element + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) + } + + Collapse.prototype.hide = function () { + if (this.transitioning || !this.$element.hasClass('in')) return + + var startEvent = $.Event('hide.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var dimension = this.dimension() + + this.$element[dimension](this.$element[dimension]())[0].offsetHeight + + this.$element + .addClass('collapsing') + .removeClass('collapse in') + .attr('aria-expanded', false) + + this.$trigger + .addClass('collapsed') + .attr('aria-expanded', false) + + this.transitioning = 1 + + var complete = function () { + this.transitioning = 0 + this.$element + .removeClass('collapsing') + .addClass('collapse') + .trigger('hidden.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + this.$element + [dimension](0) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION) + } + + Collapse.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + Collapse.prototype.getParent = function () { + return $(this.options.parent) + .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') + .each($.proxy(function (i, element) { + var $element = $(element) + this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) + }, this)) + .end() + } + + Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { + var isOpen = $element.hasClass('in') + + $element.attr('aria-expanded', isOpen) + $trigger + .toggleClass('collapsed', !isOpen) + .attr('aria-expanded', isOpen) + } + + function getTargetFromTrigger($trigger) { + var href + var target = $trigger.attr('data-target') + || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 + + return $(target) + } + + + // COLLAPSE PLUGIN DEFINITION + // ========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.collapse') + var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.collapse + + $.fn.collapse = Plugin + $.fn.collapse.Constructor = Collapse + + + // COLLAPSE NO CONFLICT + // ==================== + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + // COLLAPSE DATA-API + // ================= + + $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { + var $this = $(this) + + if (!$this.attr('data-target')) e.preventDefault() + + var $target = getTargetFromTrigger($this) + var data = $target.data('bs.collapse') + var option = data ? 'toggle' : $this.data() + + Plugin.call($target, option) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: scrollspy.js v3.3.6 + * http://getbootstrap.com/javascript/#scrollspy + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // SCROLLSPY CLASS DEFINITION + // ========================== + + function ScrollSpy(element, options) { + this.$body = $(document.body) + this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) + this.options = $.extend({}, ScrollSpy.DEFAULTS, options) + this.selector = (this.options.target || '') + ' .nav li > a' + this.offsets = [] + this.targets = [] + this.activeTarget = null + this.scrollHeight = 0 + + this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) + this.refresh() + this.process() + } + + ScrollSpy.VERSION = '3.3.6' + + ScrollSpy.DEFAULTS = { + offset: 10 + } + + ScrollSpy.prototype.getScrollHeight = function () { + return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) + } + + ScrollSpy.prototype.refresh = function () { + var that = this + var offsetMethod = 'offset' + var offsetBase = 0 + + this.offsets = [] + this.targets = [] + this.scrollHeight = this.getScrollHeight() + + if (!$.isWindow(this.$scrollElement[0])) { + offsetMethod = 'position' + offsetBase = this.$scrollElement.scrollTop() + } + + this.$body + .find(this.selector) + .map(function () { + var $el = $(this) + var href = $el.data('target') || $el.attr('href') + var $href = /^#./.test(href) && $(href) + + return ($href + && $href.length + && $href.is(':visible') + && [[$href[offsetMethod]().top + offsetBase, href]]) || null + }) + .sort(function (a, b) { return a[0] - b[0] }) + .each(function () { + that.offsets.push(this[0]) + that.targets.push(this[1]) + }) + } + + ScrollSpy.prototype.process = function () { + var scrollTop = this.$scrollElement.scrollTop() + this.options.offset + var scrollHeight = this.getScrollHeight() + var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() + var offsets = this.offsets + var targets = this.targets + var activeTarget = this.activeTarget + var i + + if (this.scrollHeight != scrollHeight) { + this.refresh() + } + + if (scrollTop >= maxScroll) { + return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) + } + + if (activeTarget && scrollTop < offsets[0]) { + this.activeTarget = null + return this.clear() + } + + for (i = offsets.length; i--;) { + activeTarget != targets[i] + && scrollTop >= offsets[i] + && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) + && this.activate(targets[i]) + } + } + + ScrollSpy.prototype.activate = function (target) { + this.activeTarget = target + + this.clear() + + var selector = this.selector + + '[data-target="' + target + '"],' + + this.selector + '[href="' + target + '"]' + + var active = $(selector) + .parents('li') + .addClass('active') + + if (active.parent('.dropdown-menu').length) { + active = active + .closest('li.dropdown') + .addClass('active') + } + + active.trigger('activate.bs.scrollspy') + } + + ScrollSpy.prototype.clear = function () { + $(this.selector) + .parentsUntil(this.options.target, '.active') + .removeClass('active') + } + + + // SCROLLSPY PLUGIN DEFINITION + // =========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.scrollspy') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.scrollspy + + $.fn.scrollspy = Plugin + $.fn.scrollspy.Constructor = ScrollSpy + + + // SCROLLSPY NO CONFLICT + // ===================== + + $.fn.scrollspy.noConflict = function () { + $.fn.scrollspy = old + return this + } + + + // SCROLLSPY DATA-API + // ================== + + $(window).on('load.bs.scrollspy.data-api', function () { + $('[data-spy="scroll"]').each(function () { + var $spy = $(this) + Plugin.call($spy, $spy.data()) + }) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: transition.js v3.3.6 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + WebkitTransition : 'webkitTransitionEnd', + MozTransition : 'transitionend', + OTransition : 'oTransitionEnd otransitionend', + transition : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + + return false // explicit for ie8 ( ._.) + } + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false + var $el = this + $(this).one('bsTransitionEnd', function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + + if (!$.support.transition) return + + $.event.special.bsTransitionEnd = { + bindType: $.support.transition.end, + delegateType: $.support.transition.end, + handle: function (e) { + if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) + } + } + }) + +}(jQuery); diff --git a/400-SOURCECODE/Admin/src/assets/scripts/fixed_table_rc.js b/400-SOURCECODE/Admin/src/assets/scripts/fixed_table_rc.js new file mode 100644 index 0000000..f2c9214 --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/scripts/fixed_table_rc.js @@ -0,0 +1,243 @@ +/* +A jQuery plugin to convert a well formatted table into a table with fixed +rows and columns. + +Copyright 2011-2015 Selvakumar Arumugam +http://meetselva.github.io/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +(function ($) { + + $.fn.fxdHdrCol = function (o) { + var cfg = { + height: 0, + width: 0, + fixedCols: 0, + colModal: [], + tableTmpl: function () { + return ''; + }, + sort: false + }; + $.extend(cfg, o); + + return this.each (function () { + var lc = { + ft_container: null, + ft_rel_container: null, + ft_wrapper: null, + ft_rc: null, + ft_r: null, + ft_c: null, + tableWidth: 0 + }; + + var $this = $(this); + $this.addClass('ui-widget-header'); + $this.find('tbody tr').addClass('ui-widget-content'); + + $this.wrap('
'); + lc.ft_container = $this.parent().css({width: cfg.width, height: cfg.height}); + + var $ths = $('thead tr', $this).first().find('th'); + + if (cfg.sort && sorttable && cfg.fixedCols == 0) { + $ths.addClass('fx_sort_bg'); + } + + var $thFirst = $ths.first(); + var thSpace = parseInt($thFirst.css('paddingLeft'), 10) + parseInt($thFirst.css('paddingRight'), 10); + + /* set width and textAlign from colModal */ + var ct = 0; + $ths.each(function (i, el) { + var calcWidth = 0; + for (var j = 0; j < el.colSpan; j++) { + calcWidth += cfg.colModal[ct].width; + ct++; + } + $(el).css({width: calcWidth, textAlign: cfg.colModal[ct-1].align}); + + lc.tableWidth += calcWidth + thSpace + ((i == 0)?2:1); + }); + + $('tbody', $this).find('tr').each(function (i, el) { + $('td', el).each(function (i, tdel) { + tdel.style.textAlign = cfg.colModal[i].align; + }); + }); + + $this.width(lc.tableWidth); + + //add relative container + $this.wrap('
'); + lc.ft_rel_container = $this.parent(); + + //add wrapper to base table which will have the scrollbars + $this.wrap('
'); + lc.ft_wrapper = $this.parent().css('width', cfg.width - 5); + + var theadTr = $('thead', $this); + //clone the thead->tr + var theadTrClone = theadTr.clone(); + + //construct fixed row (full row) + lc.ft_rel_container + .prepend($(cfg.tableTmpl(), {'class': 'ft_r ui-widget-header'}) + .append(theadTrClone)); + + //an instance of fixed row + lc.ft_r = $('.ft_r', lc.ft_rel_container); + lc.ft_r.wrap($('
', {'class': 'ft_rwrapper'})); + + lc.ft_r.width(lc.tableWidth); + + if (cfg.fixedCols > 0) { + //clone the thead again to construct the + theadTrClone = theadTr.clone(); + + //calculate the actual column's count (support for colspan) + var r1c1ColSpan = 0; + for (var i = 0; i < cfg.fixedCols; i++ ) { + r1c1ColSpan += this.rows[0].cells[i].colSpan; + } + + //prepare rows/cols for fixed row col section + $('tr', theadTrClone).each(function () { + var tdct = 0; + $(this).find('th').filter(function() { + tdct += this.colSpan; + return tdct > r1c1ColSpan; + }).remove(); + }); + + //add fixed row col section + lc.ft_rel_container + .prepend($(cfg.tableTmpl(), {'class': 'ft_rc ui-widget-header'}) + .append(theadTrClone)); + + //an instance of fixed row column + lc.ft_rc = $('.ft_rc', lc.ft_rel_container); + + //now clone the fixed row column and append tbody for the remaining rows + lc.ft_c = lc.ft_rc.clone(); + lc.ft_c[0].className = 'ft_c'; + + //append tbody + lc.ft_c.append('
'); + + //append row by row while just keeping the frozen cols + var ftc_tbody = lc.ft_c.find('tbody'); + $.each ($this.find('tbody > tr'), function (idx, el) { + var tr = $(el).clone(); + + tdct = 0; + tr.find('td').filter(function (){ + tdct += this.colSpan; + return tdct > r1c1ColSpan; + }).remove(); + + ftc_tbody.append(tr); + }); + + lc.ft_rc.after(lc.ft_c); + lc.ft_c.wrap($('
', {'class': 'ft_cwrapper'})); + + var tw = 0; + for (var i = 0; i < cfg.fixedCols; i++) { + tw += $(this.rows[0].cells[i]).outerWidth(true); + } + lc.ft_c.add(lc.ft_rc).width(tw); + lc.ft_c.height($this.outerHeight(true)); + + //set height of fixed_rc and fixed_c + for (var i = 0; i < this.rows.length; i++) { + var ch = $(this.rows[i]).outerHeight(); + var fch = $(lc.ft_c[0].rows[i]).outerHeight(true); + + ch = (ch>fch)?ch:fch; + + if (i < lc.ft_rc[0].rows.length) { + $(lc.ft_r[0].rows[i]) + .add(lc.ft_rc[0].rows[i]) + .height(ch); + } + + $(lc.ft_c[0].rows[i]) + .add(this.rows[i]) + .height(ch); + } + + lc.ft_c + .parent() + .css({height: lc.ft_container.height() - 17}) + .width(lc.ft_rc.outerWidth(true) + 1); + } + + lc.ft_r + .parent() + .css({width: lc.ft_wrapper.width()- 17}); + + //events (scroll and resize) + lc.ft_wrapper.scroll(function () { + if (cfg.fixedCols > 0) { + lc.ft_c.css('top', ($(this).scrollTop()*-1)); + } + lc.ft_r.css('left', ($(this).scrollLeft()*-1)); + }); + + /*$(window).on('resize', function () { + lc.ft_r + .parent() + .css({width: lc.ft_rel_container.width()- 17}); + });*/ + + if (cfg.sort && sorttable && cfg.fixedCols == 0) { + + $('table', lc.ft_container).addClass('sorttable'); + + sorttable.makeSortable(this); + + var $sortableTh = $('.fx_sort_bg', lc.ft_rel_container); + + $sortableTh.click (function () { + var $this = $(this); + var isAscSort = $this.hasClass('fx_sort_asc'); + + $sortableTh.removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $this.addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } else { + $this.addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } + + var idx = $(this).index(); + + sorttable.innerSortFunction.apply(lc.ft_wrapper.find('th').get(idx), []); + }); + } + + }); + + }; + +})(jQuery); diff --git a/400-SOURCECODE/Admin/src/assets/scripts/jquery-1.11.3.min.js b/400-SOURCECODE/Admin/src/assets/scripts/jquery-1.11.3.min.js new file mode 100644 index 0000000..0f60b7b --- /dev/null +++ b/400-SOURCECODE/Admin/src/assets/scripts/jquery-1.11.3.min.js @@ -0,0 +1,5 @@ +/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; + +return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/\s*$/g,ra={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?""!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("