├── src ├── assets │ ├── .gitkeep │ ├── images │ │ ├── logo.png │ │ ├── opml.png │ │ ├── rss.png │ │ ├── plurk.png │ │ ├── twitter.png │ │ ├── weibo.png │ │ ├── MCPD_1372.png │ │ ├── MCTS_1370.png │ │ ├── facebook.png │ │ ├── rssButton.png │ │ ├── googleplus.png │ │ └── MVP_FullColor_ForBlog.jpg │ ├── fonts │ │ └── glyphicons-halflings-regular.woff │ ├── scripts │ │ ├── zh-tw.res.axd │ │ ├── shActivator.js │ │ ├── 02-jquery.cookie.js │ │ ├── 05-json2.min.js │ │ ├── shAutoloader.js │ │ ├── jquery.lazyload.mini.js │ │ ├── 04-jquery-jtemplates.js │ │ ├── jquery.fancybox.pack.js │ │ ├── blog.js │ │ └── bootstrap.min.js │ └── styles │ │ ├── responsive.css │ │ ├── shThemeDefault.css │ │ ├── Global.css │ │ ├── jquery.fancybox.css │ │ ├── shCore.css │ │ └── main.css ├── app │ ├── app.component.css │ ├── article │ │ ├── article-body │ │ │ ├── article-body.component.css │ │ │ ├── article-body.component.html │ │ │ ├── article-body.component.ts │ │ │ └── article-body.component.spec.ts │ │ ├── article-list │ │ │ ├── article-list.component.css │ │ │ ├── article-list.component.html │ │ │ ├── article-list.component.ts │ │ │ └── article-list.component.spec.ts │ │ ├── article-header │ │ │ ├── article-header.component.css │ │ │ ├── article-header.component.spec.ts │ │ │ ├── article-header.component.html │ │ │ └── article-header.component.ts │ │ ├── data.service.spec.ts │ │ ├── data.service.ts │ │ └── article.module.ts │ ├── footer │ │ ├── footer.component.css │ │ ├── footer.component.ts │ │ ├── footer.component.spec.ts │ │ └── footer.component.html │ ├── header │ │ ├── header.component.css │ │ ├── header.component.ts │ │ ├── header.component.spec.ts │ │ └── header.component.html │ ├── app.component.ts │ ├── app.module.ts │ ├── app.component.spec.ts │ └── app.component.html ├── favicon.ico ├── styles.css ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── typings.d.ts ├── tsconfig.app.json ├── tsconfig.spec.json ├── main.ts ├── test.ts ├── index.html ├── polyfills.ts └── api │ ├── articles.json │ └── db.json ├── e2e ├── app.po.ts ├── tsconfig.e2e.json └── app.e2e-spec.ts ├── .editorconfig ├── tsconfig.json ├── .gitignore ├── protractor.conf.js ├── karma.conf.js ├── package.json ├── .angular-cli.json ├── README.md └── tslint.json /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/article/article-body/article-body.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/article/article-list/article-list.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/article/article-header/article-header.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | .credit { 2 | color: yellow !important; 3 | } 4 | -------------------------------------------------------------------------------- /src/app/header/header.component.css: -------------------------------------------------------------------------------- 1 | .highlight { 2 | background-color: yellow; 3 | } 4 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/favicon.ico -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/logo.png -------------------------------------------------------------------------------- /src/assets/images/opml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/opml.png -------------------------------------------------------------------------------- /src/assets/images/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/rss.png -------------------------------------------------------------------------------- /src/assets/images/plurk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/plurk.png -------------------------------------------------------------------------------- /src/assets/images/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/twitter.png -------------------------------------------------------------------------------- /src/assets/images/weibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/weibo.png -------------------------------------------------------------------------------- /src/assets/images/MCPD_1372.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/MCPD_1372.png -------------------------------------------------------------------------------- /src/assets/images/MCTS_1370.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/MCTS_1370.png -------------------------------------------------------------------------------- /src/assets/images/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/facebook.png -------------------------------------------------------------------------------- /src/assets/images/rssButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/rssButton.png -------------------------------------------------------------------------------- /src/assets/images/googleplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/googleplus.png -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/images/MVP_FullColor_ForBlog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/images/MVP_FullColor_ForBlog.jpg -------------------------------------------------------------------------------- /src/assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggy8088/angular-zero/master/src/assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/app/article/article-body/article-body.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
{{item|json}}
4 | -------------------------------------------------------------------------------- /e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/app/article/article-list/article-list.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('demo1 App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | keyword = ''; 10 | 11 | constructor() { 12 | } 13 | keywordReset() { 14 | this.keyword = ''; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "types": [ 8 | "jasmine", 9 | "node" 10 | ] 11 | }, 12 | "files": [ 13 | "test.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewEncapsulation } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'], 7 | encapsulation: ViewEncapsulation.None 8 | }) 9 | export class FooterComponent implements OnInit { 10 | 11 | constructor() { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/app/article/data.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { DataService } from './data.service'; 4 | 5 | describe('DataService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [DataService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([DataService], (service: DataService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /src/app/article/article-list/article-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { DataService } from '../data.service'; 3 | import { Observable } from 'rxjs/Observable'; 4 | 5 | @Component({ 6 | selector: 'app-article-list', 7 | templateUrl: './article-list.component.html', 8 | styleUrls: ['./article-list.component.css'] 9 | }) 10 | export class ArticleListComponent implements OnInit { 11 | 12 | counter = 0; 13 | data$: Observable; 14 | 15 | constructor(public datasvc: DataService) { 16 | } 17 | 18 | ngOnInit() { 19 | this.data$ = this.datasvc.getData(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/app/article/data.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | 4 | @Injectable() 5 | export class DataService { 6 | 7 | constructor(private http: HttpClient) { 8 | } 9 | 10 | getData() { 11 | return this.http.get('http://localhost:4200/api/articles.json') 12 | } 13 | run() { 14 | console.log('DataService'); 15 | } 16 | 17 | doDelete(item) { 18 | return this.http.delete('http://localhost:4200/api/articles/'+item.id); 19 | } 20 | 21 | doModify(post: any) { 22 | return this.http.put('http://localhost:4200/api/articles/'+post.id, post); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/app/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | title = 'app'; 10 | url = 'http://blog.miniasp.com/'; 11 | imgurl = '/assets/images/logo.png'; 12 | counter = 0; 13 | 14 | constructor() { } 15 | 16 | ngOnInit() { 17 | } 18 | 19 | getStyle() { 20 | return { 'font-size': (12 + this.counter) + 'px' }; 21 | } 22 | 23 | changeTitle(altKey: boolean) { 24 | if (altKey) { 25 | this.title = 'The Will Will Web'; 26 | } 27 | this.counter++; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { AppComponent } from './app.component'; 5 | import { HeaderComponent } from './header/header.component'; 6 | import { FooterComponent } from './footer/footer.component'; 7 | import { ArticleModule } from './article/article.module'; 8 | 9 | @NgModule({ 10 | declarations: [ 11 | AppComponent, 12 | HeaderComponent, 13 | FooterComponent 14 | ], 15 | imports: [ 16 | BrowserModule, 17 | FormsModule, 18 | ArticleModule 19 | ], 20 | providers: [], 21 | bootstrap: [AppComponent] 22 | }) 23 | export class AppModule { } 24 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /dist-server 6 | /tmp 7 | /out-tsc 8 | 9 | # dependencies 10 | /node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | *.sublime-workspace 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | yarn-error.log 35 | testem.log 36 | /typings 37 | 38 | # e2e 39 | /e2e/*.js 40 | /e2e/*.map 41 | 42 | # System Files 43 | .DS_Store 44 | Thumbs.db 45 | -------------------------------------------------------------------------------- /src/app/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/article/article-body/article-body.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, OnChanges } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-article-body', 5 | templateUrl: './article-body.component.html', 6 | styleUrls: ['./article-body.component.css'] 7 | }) 8 | export class ArticleBodyComponent implements OnInit, OnChanges { 9 | 10 | @Input() 11 | item; 12 | 13 | @Input() 14 | counter; 15 | 16 | constructor() { 17 | console.log('ArticleBodyComponent: constructor'); 18 | } 19 | 20 | ngOnInit() { 21 | console.log('ArticleBodyComponent '+this.item.id+': ngOnInit'); 22 | } 23 | 24 | ngOnChanges(changes) { 25 | console.log('ArticleBodyComponent'+this.item.id+': ngOnChanges'); 26 | console.log(changes); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/app/article/article-body/article-body.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ArticleBodyComponent } from './article-body.component'; 4 | 5 | describe('ArticleBodyComponent', () => { 6 | let component: ArticleBodyComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ArticleBodyComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ArticleBodyComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/article/article-list/article-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ArticleListComponent } from './article-list.component'; 4 | 5 | describe('ArticleListComponent', () => { 6 | let component: ArticleListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ArticleListComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ArticleListComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/article/article-header/article-header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ArticleHeaderComponent } from './article-header.component'; 4 | 5 | describe('ArticleHeaderComponent', () => { 6 | let component: ArticleHeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ArticleHeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ArticleHeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /src/app/article/article.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { ArticleListComponent } from './article-list/article-list.component'; 4 | import { ArticleHeaderComponent } from './article-header/article-header.component'; 5 | import { ArticleBodyComponent } from './article-body/article-body.component'; 6 | import { FormsModule } from '@angular/forms'; 7 | import { DataService } from './data.service'; 8 | import { HttpClientModule } from '@angular/common/http'; 9 | 10 | @NgModule({ 11 | imports: [ 12 | CommonModule, 13 | FormsModule, 14 | HttpClientModule 15 | ], 16 | declarations: [ArticleListComponent, ArticleHeaderComponent, ArticleBodyComponent], 17 | exports: [ArticleListComponent], 18 | providers: [DataService] 19 | }) 20 | export class ArticleModule { } 21 | -------------------------------------------------------------------------------- /src/assets/scripts/zh-tw.res.axd: -------------------------------------------------------------------------------- 1 | BlogEngineRes = {webRoot: '/',applicationWebRoot: '/',blogInstanceId: '96d5b379-7e1d-4dac-a6ba-1e50db561b04',fileExtension: '.aspx',i18n: {"apmlDescription":"Enter the URL to your website or to your APML document","beTheFirstToRate":"成為第一個評分者吧","cancel":"取消","comments":"評論","commentWaitingModeration":"感謝您的回覆,此評論等待處理","commentWasSaved":"您的評論已保存,感謝您的回應。","couldNotSaveQuickPost":"Could not save quick post","currentlyRated":"目前評分 {0}, 共有 {1} 人參與","defaultPostCategory":"Default post category","doDelete":"刪除","filter":"過濾器","hasRated":"You already rated this post.","noNotesYet":"You do not have any notes yet.","notAuthorizedToCreateNewPosts":"Not authorized to create new Posts.","or":"或","postSaved":"Post saved","publish":"發表","rateThisXStars":"給他{0}分!","ratingHasBeenRegistered":"您的評分已記錄,感謝您!","save":"儲存","savingTheComment":"正在儲存評論...","tagsCommaDelimited":"Tags (comma delimited)"}}; -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/article/article-header/article-header.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | {{item.title}} 4 | 7 |

8 | 25 |
26 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | The Will Will Web | 記載著 Will 在網路世界的學習心得與技術分享 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/app/article/article-header/article-header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy, Input, Output, EventEmitter, OnChanges } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-article-header', 5 | templateUrl: './article-header.component.html', 6 | styleUrls: ['./article-header.component.css'] 7 | }) 8 | export class ArticleHeaderComponent implements OnInit, OnDestroy, OnChanges { 9 | 10 | @Input() 11 | item; 12 | 13 | orig_item; 14 | 15 | @Output() 16 | delete = new EventEmitter(); 17 | 18 | @Output() 19 | titleChanged = new EventEmitter(); 20 | 21 | isEdit = false; 22 | newTitle = ''; 23 | 24 | constructor() { } 25 | 26 | ngOnInit() { 27 | } 28 | 29 | ngOnChanges(changes) { 30 | if (changes.item) { 31 | this.orig_item = changes.item.currentValue; 32 | this.item = Object.assign({}, changes.item.currentValue); 33 | } 34 | } 35 | 36 | ngOnDestroy() { 37 | } 38 | 39 | doEdit(title) { 40 | this.titleChanged.emit(this.item); 41 | } 42 | 43 | doCancel() { 44 | this.item = Object.assign({}, this.orig_item); 45 | this.isEdit = false; 46 | } 47 | 48 | deleteArticle() { 49 | this.delete.emit(this.item); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/assets/styles/responsive.css: -------------------------------------------------------------------------------- 1 | @media screen and (max-width:767px) { 2 | .header .title-wrapper { padding: 25px 0 30px; } 3 | .header .title-wrapper .logo { display: none; } 4 | .header .title-wrapper .pull-left, 5 | .header .title-wrapper .pull-right { float: none !important; text-align: center; margin: 0; padding: 0; } 6 | .header .title-wrapper hgroup { height: auto; margin-bottom: 10px; } 7 | #q-notes { display: none !important; } 8 | .header .nav > li {border-bottom:1px solid #333;} 9 | .header .nav > li.page-menu {width:100%; position:relative;} 10 | .header .nav > li.page-menu .dropdown-toggle {float:right !important; position:absolute; right:0; top:0;} 11 | .header .nav > li.page-menu .dropdown-m {float:none !important;} 12 | } 13 | 14 | @media screen and (max-width:640px) { 15 | .post .post-info .post-author, .post .post-info .post-comment-link, .archive-page .rating, .archive-page .comments, .navigation-posts { display: none; } 16 | .widgets-footer .widget { margin: 0; float: none; width: 100%; } 17 | .footer .end-line { min-height: auto; line-height: 25px; padding: 10px 50px; } 18 | } 19 | 20 | @media screen and (max-width:480px) { 21 | .widgets-footer { display: none; } 22 | .comment-gravatar { display: none; } 23 | } 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo1", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build --prod", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "^5.2.0", 16 | "@angular/common": "^5.2.0", 17 | "@angular/compiler": "^5.2.0", 18 | "@angular/core": "^5.2.0", 19 | "@angular/forms": "^5.2.0", 20 | "@angular/http": "^5.2.0", 21 | "@angular/platform-browser": "^5.2.0", 22 | "@angular/platform-browser-dynamic": "^5.2.0", 23 | "@angular/router": "^5.2.0", 24 | "core-js": "^2.4.1", 25 | "rxjs": "^5.5.6", 26 | "zone.js": "^0.8.19" 27 | }, 28 | "devDependencies": { 29 | "@angular/cli": "~1.7.1", 30 | "@angular/compiler-cli": "^5.2.0", 31 | "@angular/language-service": "^5.2.0", 32 | "@types/jasmine": "~2.8.3", 33 | "@types/jasminewd2": "~2.0.2", 34 | "@types/node": "~6.0.60", 35 | "codelyzer": "^4.0.1", 36 | "jasmine-core": "~2.8.0", 37 | "jasmine-spec-reporter": "~4.2.1", 38 | "karma": "~2.0.0", 39 | "karma-chrome-launcher": "~2.2.0", 40 | "karma-coverage-istanbul-reporter": "^1.2.1", 41 | "karma-jasmine": "~1.1.0", 42 | "karma-jasmine-html-reporter": "^0.2.2", 43 | "protractor": "~5.1.2", 44 | "ts-node": "~4.1.0", 45 | "tslint": "~5.9.1", 46 | "typescript": "~2.5.3" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "demo1" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "api", 12 | "assets", 13 | "favicon.ico" 14 | ], 15 | "index": "index.html", 16 | "main": "main.ts", 17 | "polyfills": "polyfills.ts", 18 | "test": "test.ts", 19 | "tsconfig": "tsconfig.app.json", 20 | "testTsconfig": "tsconfig.spec.json", 21 | "prefix": "app", 22 | "styles": [ 23 | "styles.css" 24 | ], 25 | "scripts": [], 26 | "environmentSource": "environments/environment.ts", 27 | "environments": { 28 | "dev": "environments/environment.ts", 29 | "prod": "environments/environment.prod.ts" 30 | } 31 | } 32 | ], 33 | "e2e": { 34 | "protractor": { 35 | "config": "./protractor.conf.js" 36 | } 37 | }, 38 | "lint": [ 39 | { 40 | "project": "src/tsconfig.app.json", 41 | "exclude": "**/node_modules/**" 42 | }, 43 | { 44 | "project": "src/tsconfig.spec.json", 45 | "exclude": "**/node_modules/**" 46 | }, 47 | { 48 | "project": "e2e/tsconfig.e2e.json", 49 | "exclude": "**/node_modules/**" 50 | } 51 | ], 52 | "test": { 53 | "karma": { 54 | "config": "./karma.conf.js" 55 | } 56 | }, 57 | "defaults": { 58 | "styleExt": "css", 59 | "component": {} 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/assets/scripts/shActivator.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | var root = BlogEngineRes.applicationWebRoot + 'scripts/syntaxhighlighter/scripts/'; 3 | SyntaxHighlighter.autoloader( 4 | 'applescript ' + root + 'shBrushAppleScript.js', 5 | 'actionscript3 as3 ' + root + 'shBrushAS3.js', 6 | 'bash shell ' + root + 'shBrushBash.js', 7 | 'coldfusion cf ' + root + 'shBrushColdFusion.js', 8 | 'cpp c ' + root + 'shBrushCpp.js', 9 | 'c# c-sharp csharp ' + root + 'shBrushCSharp.js', 10 | 'css ' + root + 'shBrushCss.js', 11 | 'delphi pascal ' + root + 'shBrushDelphi.js', 12 | 'diff patch pas ' + root + 'shBrushDiff.js', 13 | 'erl erlang ' + root + 'shBrushErlang.js', 14 | 'groovy ' + root + 'shBrushGroovy.js', 15 | 'haxe ' + root + 'shBrushHaxe.js', 16 | 'java ' + root + 'shBrushJava.js', 17 | 'jfx javafx ' + root + 'shBrushJavaFX.js', 18 | 'js jscript javascript ' + root + 'shBrushJScript.js', 19 | 'perl pl ' + root + 'shBrushPerl.js', 20 | 'php ' + root + 'shBrushPhp.js', 21 | 'text plain ' + root + 'shBrushPlain.js', 22 | 'ps powershell ' + root + 'shBrushPowerShell.js', 23 | 'py python ' + root + 'shBrushPython.js', 24 | 'ruby rails ror rb ' + root + 'shBrushRuby.js', 25 | 'sass scss ' + root + 'shBrushSass.js', 26 | 'scala ' + root + 'shBrushScala.js', 27 | 'sql ' + root + 'shBrushSql.js', 28 | 'vb vbnet ' + root + 'shBrushVb.js', 29 | 'xml xhtml xslt html ' + root + 'shBrushXml.js' 30 | ); 31 | SyntaxHighlighter.all(); 32 | }); -------------------------------------------------------------------------------- /src/assets/scripts/02-jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.3.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function ($, document, undefined) { 9 | 10 | var pluses = /\+/g; 11 | 12 | function raw(s) { 13 | return s; 14 | } 15 | 16 | function decoded(s) { 17 | return unRfc2068(decodeURIComponent(s.replace(pluses, ' '))); 18 | } 19 | 20 | function unRfc2068(value) { 21 | if (value.indexOf('"') === 0) { 22 | // This is a quoted cookie as according to RFC2068, unescape 23 | value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 24 | } 25 | return value; 26 | } 27 | 28 | function fromJSON(value) { 29 | return config.json ? JSON.parse(value) : value; 30 | } 31 | 32 | var config = $.cookie = function (key, value, options) { 33 | 34 | // write 35 | if (value !== undefined) { 36 | options = $.extend({}, config.defaults, options); 37 | 38 | if (value === null) { 39 | options.expires = -1; 40 | } 41 | 42 | if (typeof options.expires === 'number') { 43 | var days = options.expires, t = options.expires = new Date(); 44 | t.setDate(t.getDate() + days); 45 | } 46 | 47 | value = config.json ? JSON.stringify(value) : String(value); 48 | 49 | return (document.cookie = [ 50 | encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), 51 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 52 | options.path ? '; path=' + options.path : '', 53 | options.domain ? '; domain=' + options.domain : '', 54 | options.secure ? '; secure' : '' 55 | ].join('')); 56 | } 57 | 58 | // read 59 | var decode = config.raw ? raw : decoded; 60 | var cookies = document.cookie.split('; '); 61 | var result = key ? null : {}; 62 | for (var i = 0, l = cookies.length; i < l; i++) { 63 | var parts = cookies[i].split('='); 64 | var name = decode(parts.shift()); 65 | var cookie = decode(parts.join('=')); 66 | 67 | if (key && key === name) { 68 | result = fromJSON(cookie); 69 | break; 70 | } 71 | 72 | if (!key) { 73 | result[name] = fromJSON(cookie); 74 | } 75 | } 76 | 77 | return result; 78 | }; 79 | 80 | config.defaults = {}; 81 | 82 | $.removeCookie = function (key, options) { 83 | if ($.cookie(key) !== null) { 84 | $.cookie(key, null, options); 85 | return true; 86 | } 87 | return false; 88 | }; 89 | 90 | })(jQuery, document); 91 | -------------------------------------------------------------------------------- /src/assets/scripts/05-json2.min.js: -------------------------------------------------------------------------------- 1 | var JSON;JSON||(JSON={}),(function(){"use strict";function i(n){return n<10?"0"+n:n}function f(n){return o.lastIndex=0,o.test(n)?'"'+n.replace(o,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(i,e){var h,l,c,a,v=n,s,o=e[i];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(i)),typeof t=="function"&&(o=t.call(e,i,o));switch(typeof o){case"string":return f(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";n+=u,s=[];if(Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,h=0;h tags to the document body 65 | for (i = 0; i < elements.length; i++) 66 | { 67 | var url = brushes[elements[i].params.brush]; 68 | 69 | if (!url) 70 | continue; 71 | 72 | scripts[url] = false; 73 | loadScript(url); 74 | } 75 | 76 | function loadScript(url) 77 | { 78 | var script = document.createElement('script'), 79 | done = false 80 | ; 81 | 82 | script.src = url; 83 | script.type = 'text/javascript'; 84 | script.language = 'javascript'; 85 | script.onload = script.onreadystatechange = function() 86 | { 87 | if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) 88 | { 89 | done = true; 90 | scripts[url] = true; 91 | checkAll(); 92 | 93 | // Handle memory leak in IE 94 | script.onload = script.onreadystatechange = null; 95 | script.parentNode.removeChild(script); 96 | } 97 | }; 98 | 99 | // sync way of adding script tags to the page 100 | document.body.appendChild(script); 101 | }; 102 | 103 | function checkAll() 104 | { 105 | for(var url in scripts) 106 | if (scripts[url] == false) 107 | return; 108 | 109 | if (allCalled) 110 | SyntaxHighlighter.highlight(allParams); 111 | }; 112 | }; 113 | 114 | })(); 115 | -------------------------------------------------------------------------------- /src/assets/scripts/jquery.lazyload.mini.js: -------------------------------------------------------------------------------- 1 | 2 | (function($){$.fn.lazyload=function(options){var settings={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(options){$.extend(settings,options);} 3 | var elements=this;if("scroll"==settings.event){$(settings.container).bind("scroll",function(event){var counter=0;elements.each(function(){if($.abovethetop(this,settings)||$.leftofbegin(this,settings)){}else if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$(this).trigger("appear");}else{if(counter++>settings.failurelimit){return false;}}});var temp=$.grep(elements,function(element){return!element.loaded;});elements=$(temp);});} 4 | this.each(function(){var self=this;if(undefined==$(self).attr("original")){$(self).attr("original",$(self).attr("src"));} 5 | if("scroll"!=settings.event||undefined==$(self).attr("src")||settings.placeholder==$(self).attr("src")||($.abovethetop(self,settings)||$.leftofbegin(self,settings)||$.belowthefold(self,settings)||$.rightoffold(self,settings))){if(settings.placeholder){$(self).attr("src",settings.placeholder);}else{$(self).removeAttr("src");} 6 | self.loaded=false;}else{self.loaded=true;} 7 | $(self).one("appear",function(){if(!this.loaded){$("").bind("load",function(){$(self).hide().attr("src",$(self).attr("original")) 8 | [settings.effect](settings.effectspeed);self.loaded=true;}).attr("src",$(self).attr("original"));};});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});$(settings.container).trigger(settings.event);return this;};$.belowthefold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).height()+$(window).scrollTop();}else{var fold=$(settings.container).offset().top+$(settings.container).height();} 9 | return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).width()+$(window).scrollLeft();}else{var fold=$(settings.container).offset().left+$(settings.container).width();} 10 | return fold<=$(element).offset().left-settings.threshold;};$.abovethetop=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollTop();}else{var fold=$(settings.container).offset().top;} 11 | return fold>=$(element).offset().top+settings.threshold+$(element).height();};$.leftofbegin=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollLeft();}else{var fold=$(settings.container).offset().left;} 12 | return fold>=$(element).offset().left+settings.threshold+$(element).width();};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"});})(jQuery); -------------------------------------------------------------------------------- /src/assets/styles/shThemeDefault.css: -------------------------------------------------------------------------------- 1 | .syntaxhighlighter { 2 | background-color: white !important; 3 | } 4 | .syntaxhighlighter .line.alt1 { 5 | background-color: white !important; 6 | } 7 | .syntaxhighlighter .line.alt2 { 8 | background-color: white !important; 9 | } 10 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 11 | background-color: #e0e0e0 !important; 12 | } 13 | .syntaxhighlighter .line.highlighted.number { 14 | color: black !important; 15 | } 16 | .syntaxhighlighter table caption { 17 | color: black !important; 18 | } 19 | .syntaxhighlighter .gutter { 20 | color: #afafaf !important; 21 | } 22 | .syntaxhighlighter .gutter .line { 23 | border-right: 3px solid #6ce26c !important; 24 | } 25 | .syntaxhighlighter .gutter .line.highlighted { 26 | background-color: #6ce26c !important; 27 | color: white !important; 28 | } 29 | .syntaxhighlighter.printing .line .content { 30 | border: none !important; 31 | } 32 | .syntaxhighlighter.collapsed { 33 | overflow: visible !important; 34 | } 35 | .syntaxhighlighter.collapsed .toolbar { 36 | color: blue !important; 37 | background: white !important; 38 | border: 1px solid #6ce26c !important; 39 | } 40 | .syntaxhighlighter.collapsed .toolbar a { 41 | color: blue !important; 42 | } 43 | .syntaxhighlighter.collapsed .toolbar a:hover { 44 | color: red !important; 45 | } 46 | .syntaxhighlighter .toolbar { 47 | color: white !important; 48 | background: #6ce26c !important; 49 | border: none !important; 50 | } 51 | .syntaxhighlighter .toolbar a { 52 | color: white !important; 53 | } 54 | .syntaxhighlighter .toolbar a:hover { 55 | color: black !important; 56 | } 57 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 58 | color: black !important; 59 | } 60 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 61 | color: #008200 !important; 62 | } 63 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 64 | color: blue !important; 65 | } 66 | .syntaxhighlighter .keyword { 67 | color: #006699 !important; 68 | } 69 | .syntaxhighlighter .preprocessor { 70 | color: gray !important; 71 | } 72 | .syntaxhighlighter .variable { 73 | color: #aa7700 !important; 74 | } 75 | .syntaxhighlighter .value { 76 | color: #009900 !important; 77 | } 78 | .syntaxhighlighter .functions { 79 | color: #ff1493 !important; 80 | } 81 | .syntaxhighlighter .constants { 82 | color: #0066cc !important; 83 | } 84 | .syntaxhighlighter .script { 85 | font-weight: bold !important; 86 | color: #006699 !important; 87 | background-color: none !important; 88 | } 89 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 90 | color: gray !important; 91 | } 92 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 93 | color: #ff1493 !important; 94 | } 95 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 96 | color: red !important; 97 | } 98 | 99 | .syntaxhighlighter .keyword { 100 | font-weight: bold !important; 101 | } 102 | -------------------------------------------------------------------------------- /src/app/header/header.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 33 |
34 |
35 | 36 | 38 | 39 |
40 |

41 | {{ title }} 42 |

43 |

記載著 Will 在網路世界的學習心得與技術分享 {{ counter }}

44 |
45 | 46 | 73 | 74 |
75 |
76 |
77 | 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 簡介 2 | 此儲存庫是【[Angular 開發實戰:從零開始](https://www.udemy.com/angular-zero/)】線上課程的範例程式碼,以下是課程介紹與近期優惠訊息。   3 | 4 | ## Angular 開發實戰:從零開始 5 | 掌握 Angular 開發框架的重要知識與觀念 6 | 7 | ## 說明 8 | Angular 框架經過數年的發展,框架本身已經相當成熟,不但進入門檻越來越低,在執行速度、開發效率、學習曲線方面,也都得到了一個相當不錯的平衡點。我們都知道,網頁前端技術日新月異,但就我長期觀察下來,近兩年來 Angular 框架發展已經相當穩定,官方團隊也不斷精進整個開發生態,無論是在開發工具的支援,或是透過 Angular CLI 加速大型專案管理,都已經有相當程度的效益。現在,就是投入 Angular 學習的最佳時機! 9 | 10 | 本課程歷經數月的精心策劃、製作、剪輯,並特別強調新手入門 Angular 開發框架所需注意的各項細節,課程中穿插著理論與實務,幫助學員更快的理解 Angular 正確的開發觀念,也透過影片中的實際操作,教導學員一些實用的開發技巧。只要你認真學習,並動手實作,相信可以大幅提升 Angular 應用程式的開發效率,縮短自己嘗試錯誤的時間,提高學習效率。 11 | 12 | ## 目標受眾是誰? 13 | * Web 開發人員 14 | * 網頁前端工程師 15 | * 網頁設計師 16 | 17 | ## 課程大綱 18 | * 建立 Angular 開發環境 19 | * 安裝 Chocolatey 套件管理器 (Windows) 20 | * 安裝必要的 Angular 開發工具 (Windows) 21 | * 使用 Angular CLI 建立 Angular 專案骨架 22 | * 認識 Angular CLI 建立的專案架構 23 | * 認識 Visual Studio Code 開發環境 24 | 25 | * 簡介 Angular 開發框架 26 | * 關於 AngularJS 與 Angular 開發框架 27 | * 了解 Angular 的優點與主要特色 28 | * 認識 Angular 開發語言:TypeScript 29 | * 理解 Angular 應用程式與元件 30 | * 隨堂測驗 31 | 32 | * 了解 Angular 基本架構與啟動流程 33 | * 認識 Angular 應用程式啟動流程 34 | * 使用 Angular CLI 快速建立元件與範本 35 | * 將靜態檔案加入 Angular CLI 建立的專案 36 | * 將網頁 HTML 加入到 Angular 應用程式 37 | * 發行與部署 Angular 應用程式的方法 38 | * 升級 Angular 應用程式到新版的方法 39 | 40 | * 掌握 Angular 範本語法與資料繫結 41 | * 學習資料繫結方法:內嵌繫結 (Interpolation) 42 | * 學習資料繫結方法:屬性繫結 (Property Binding) 43 | * 學習資料繫結方法:事件繫結 (Event Binding) 44 | * 學習資料繫結方法:事件繫結 - 使用 $event 參數 45 | * 學習資料繫結方法:事件繫結 - 使用具有型別的 $event 參數 46 | * 嘗試運用 Angular 資料繫結方法 47 | * 學習資料繫結方法:雙向繫結 (Two-way Binding) 48 | * 認識範本參考變數 (Template reference variables) 49 | * 學習 Angular 元件型指令 (Component Directives) 50 | * 學習 Angular 屬性型指令 (Attribute Directives) - NgStyle 51 | * 學習 Angular 屬性型指令 (Attribute Directives) - NgClass 52 | * 學習 Angular 結構型指令 (Structural Directives) - NgIf 53 | * 學習 Angular 結構型指令 (Structural Directives) - NgSwitch 54 | * 學習 Angular 結構型指令 (Structural Directives) - NgFor 55 | * 學習 Angular 使用 Pipes 管線元件 - uppercase 與 lowercase 56 | * 學習 Angular 使用 Pipes 管線元件 - number 57 | * 學習 Angular 使用 Pipes 管線元件 - currency 58 | * 學習 Angular 使用 Pipes 管線元件 - percent 59 | * 學習 Angular 使用 Pipes 管線元件 - date 60 | * 學習 Angular 使用 Pipes 管線元件 - json 61 | * 學習 Angular 使用 Pipes 管線元件 - slice 62 | * 在範本中使用安全導覽運算子 (safe navigation operator) 63 | * 如何避免在範本中出現 TypeScript 型別錯誤 64 | 65 | * 認識 Angular 元件架構與模組 66 | * 簡介 Angular 元件架構 67 | * 建立 Angular 功能模組 68 | * 將現有 Angular 元件加入功能模組 69 | * 定義 Angular 元件的輸入介面 - @Input() 70 | * 介紹 ngOnInit 與 ngOnDestroy 生命週期 Hook 71 | * 定義 Angular 元件的輸出介面 - @Output() 72 | * 解釋單向資料流與實作不可變的物件 73 | * 實作單向資料流與實作不可變的物件 - 1 74 | * 實作單向資料流與實作不可變的物件 - 2 75 | * 介紹 ngOnChanges 生命週期 Hook 76 | * 講解 ngOnChanges 生命週期 Hook 的實務運用 77 | 78 | * 認識 Angular 服務元件、相依注入與 HttpClient 79 | * 建立 Angular 服務元件與實作相依注入 80 | * 透過服務元件重構現有元件的程式碼 81 | * 了解 @Injectable() 裝飾器與注入 HttpClient 服務元件 82 | * 學習 HttpClient 基本使用方法 - get() 83 | * 重構 DataService 服務元件 - 回傳 Observable 物件 84 | * 使用 async 管道元件訂閱 Observable 物件 85 | 86 | ## 我會學些什麼呢? 87 | * 了解 Angular 開發框架與其優勢 88 | * 學會有效率的利用 Angular 開發前端應用 89 | * 掌握開發 Angular 的重要觀念與開發技巧 90 | 91 | ## 要求 92 | * 了解基礎 HTML / CSS / JavaScript 語法 93 | * 具有基礎的程式設計概念 (寫過任何一種程式語言即可) 94 | 95 | ## 最新優惠 96 | * 推廣價:1980 元 97 | * 優惠期限:即日起至 2018/5/1 0:00 98 | * 優惠代碼:GH1980 99 | * 優惠連結:[Angular 開發實戰:從零開始](https://www.udemy.com/angular-zero/?couponCode=GH1980) 100 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Required to support Web Animations `@angular/platform-browser/animations`. 51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 52 | **/ 53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 54 | 55 | /** 56 | * By default, zone.js will patch all possible macroTask and DomEvents 57 | * user can disable parts of macroTask/DomEvents patch by setting following flags 58 | */ 59 | 60 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 61 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 62 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 63 | 64 | /* 65 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 66 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 67 | */ 68 | // (window as any).__Zone_enable_cross_context_check = true; 69 | 70 | /*************************************************************************************************** 71 | * Zone JS is required by default for Angular itself. 72 | */ 73 | import 'zone.js/dist/zone'; // Included with Angular CLI. 74 | 75 | 76 | 77 | /*************************************************************************************************** 78 | * APPLICATION IMPORTS 79 | */ 80 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs", 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": [ 26 | true, 27 | "spaces" 28 | ], 29 | "interface-over-type-literal": true, 30 | "label-position": true, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-access": false, 36 | "member-ordering": [ 37 | true, 38 | { 39 | "order": [ 40 | "static-field", 41 | "instance-field", 42 | "static-method", 43 | "instance-method" 44 | ] 45 | } 46 | ], 47 | "no-arg": true, 48 | "no-bitwise": true, 49 | "no-console": [ 50 | true, 51 | "debug", 52 | "info", 53 | "time", 54 | "timeEnd", 55 | "trace" 56 | ], 57 | "no-construct": true, 58 | "no-debugger": true, 59 | "no-duplicate-super": true, 60 | "no-empty": false, 61 | "no-empty-interface": true, 62 | "no-eval": true, 63 | "no-inferrable-types": [ 64 | true, 65 | "ignore-params" 66 | ], 67 | "no-misused-new": true, 68 | "no-non-null-assertion": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "unified-signatures": true, 111 | "variable-name": false, 112 | "whitespace": [ 113 | true, 114 | "check-branch", 115 | "check-decl", 116 | "check-operator", 117 | "check-separator", 118 | "check-type" 119 | ], 120 | "directive-selector": [ 121 | true, 122 | "attribute", 123 | "app", 124 | "camelCase" 125 | ], 126 | "component-selector": [ 127 | true, 128 | "element", 129 | "app", 130 | "kebab-case" 131 | ], 132 | "no-output-on-prefix": true, 133 | "use-input-property-decorator": true, 134 | "use-output-property-decorator": true, 135 | "use-host-property-decorator": true, 136 | "no-input-rename": true, 137 | "no-output-rename": true, 138 | "use-life-cycle-interface": true, 139 | "use-pipe-transform-interface": true, 140 | "component-class-suffix": true, 141 | "directive-class-suffix": true 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/assets/styles/Global.css: -------------------------------------------------------------------------------- 1 | p { } 2 | /* DO NOT START CSS WITH A COMMENT! */ 3 | 4 | /*[ Star rater ]*/ 5 | .rating { margin-bottom: 10px; } 6 | .rating p { display: inline; position: relative; top: 14px; left: 55px; } 7 | .star-rating { position: relative; width: 125px; height: 25px; overflow: hidden; list-style: none; margin: 0; padding: 0; background-position: left top; } 8 | .star-rating li { display: inline; } 9 | .star-rating a, .star-rating .current-rating { position: absolute; top: 0; left: 0; text-indent: -1000em; height: 25px; line-height: 25px; outline: none; overflow: hidden; border: none; } 10 | .star-rating a:hover, .star-rating a:active, .star-rating a:focus { background-position: left bottom; } 11 | .star-rating a.one-star { width: 20%; z-index: 6; } 12 | .star-rating a.two-stars { width: 40%; z-index: 5; } 13 | .star-rating a.three-stars { width: 60%; z-index: 4; } 14 | .star-rating a.four-stars { width: 80%; z-index: 3; } 15 | .star-rating a.five-stars { width: 100%;z-index: 2; } 16 | .star-rating .current-rating{ z-index: 1; background-position: left center; } 17 | /* smaller star */ 18 | .small-star { width: 50px; height: 10px; } 19 | .small-star, .small-star a:hover, .small-star a:active, .small-star a:focus, .small-star .current-rating { background-image: url(../../Content/images/blog/star_small.gif); line-height: 10px; height: 10px; } 20 | 21 | /*[ Syntax highlighter ]*/ 22 | .code { font-size: 12px; color: #000; font-family: Consolas, "Courier New", Courier, Monospace; background-color: #F1F1F1; line-height: normal; } 23 | .code p { padding: 5px; } 24 | .code .rem { color: #008000; } 25 | .code .kwrd { color: #0000ff; } 26 | .code .str { color: #006080; } 27 | .code .op { color: #0000c0; } 28 | .code .preproc { color: #0000ff; } 29 | .code .asp { background-color: #ffff00; } 30 | .code .html { color: #800000; } 31 | .code .attr { color: #ff0000; } 32 | .code .alt { background-color: #f4f4f4; } 33 | .code .lnum { color: #606060; } 34 | 35 | /*[ XFN tags ]*/ 36 | div.post .text a[rel] { background-repeat: no-repeat; background-position: right center; } 37 | div.post .text a[rel="me"] { background-image:url('../../Content/images/blog/xfn/me.gif'); } 38 | /*-------- [ These should cascade to pick the correct icon for the contact ]--*/ 39 | /*-------- [ Normal contacts ]--*/ 40 | div.post .text a[rel~="contact"], div.post .text a[rel~="acquaintance"], div.post .text a[rel~="friend"] { background-image:url('../../Content/images/blog/xfn/contact.gif'); padding-right:11px; } 41 | /*-------- [ Normal contacts youve met ]--*/ 42 | div.post .text a[rel~="contact"][rel~="met"], div.post .text a[rel~="acquaintance"][rel~="met"], div.post .text a[rel~="friend"][rel~="met"] { background-image:url('../../Content/images/blog/xfn/contactMet.gif'); padding-right:11px; } 43 | /*-------- [ Colleague and co worker icon more important than contact ]--*/ 44 | div.post .text a[rel~="colleague"], div.post .text a[rel~="co-worker"] { background-image:url('../../Content/images/blog/xfn/colleague.gif'); padding-right:11px; } 45 | /*-------- [ Colleague and co worker icon when met ]--*/ 46 | div.post .text a[rel~="colleague"][rel~="met"], div.post .text a[rel~="co-worker"][rel~="met"] { background-image:url('../../Content/images/blog/xfn/colleagueMet.gif'); padding-right:11px; } 47 | /*-------- [ Sweethearts are more important than work!!! ]--*/ 48 | div.post .text a[rel~="muse"], div.post .text a[rel~="crush"], div.post .text a[rel~="date"], a[rel~="sweetheart"] { background-image:url('../../Content/images/blog/xfn/sweet.gif'); padding-right:11px; } 49 | /*-------- [ ...and if youve met them thats even better ]--*/ 50 | div.post .text a[rel~="muse"][rel~="met"], div.post .text a[rel~="crush"][rel~="met"], div.post .text a[rel~="date"][rel~="met"], div.post .text a[rel~="sweetheart"][rel~="met"] { background-image:url('../../Content/images/blog/xfn/sweetMet.gif'); padding-right:11px; } 51 | 52 | /*[ Post Pager ]*/ 53 | #PostPager { display: block; text-align: center; } 54 | #PostPager li { display:inline; border: 1px solid #ccc; margin: 1px; padding: 2px; } 55 | #PostPager li a { padding: 2px; text-decoration:none; font-weight: bold; } 56 | #PostPager .PagerLinkCurrent { background-color: #5C80B1; color: #fff; padding: 2px 5px; border: 1px solid #ccc; } 57 | #PostPager .PagerLinkCurrent li { padding: 2px } 58 | #PostPager .PagerLinkDisabled { color: #ccc; padding: 2px; } 59 | #PostPager .PagerEllipses { border:0; padding: 2px; } 60 | #commentPreview { display:none; clear:both; min-height: 150px; } 61 | .LoginRequired { margin: 10px 0 10px 0; } 62 | 63 | /*[ Widget action buttons ]*/ 64 | .imgDelete { background-image:url('../../Content/images/blog/actions/action-delete-small-lt.png'); } 65 | .imgDelete:hover{ background-image:url('../../Content/images/blog/actions/action-delete-small.png'); } 66 | .imgMove { background-image:url('../../Content/images/blog/actions/action-tools-small-lt.png'); } 67 | .imgMove:hover { background-image:url('../../Content/images/blog/actions/action-tools-small.png'); } 68 | .imgEdit { background-image:url('../../Content/images/blog/actions/action-edit-small-lt.png'); } 69 | .imgEdit:hover { background-image:url('../../Content/images/blog/actions/action-edit-small.png'); } 70 | .widgetImg { width: 16px; height: 16px; display:inline-block; } 71 | .widget a:hover { text-decoration: none; } 72 | #comment-form p { margin: 1px; display: inline-table; width: 100%; } -------------------------------------------------------------------------------- /src/api/articles.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "href": "http://blog.miniasp.com/post/2016/04/30/Visual-Studio-Code-from-Command-Prompt-notes.aspx", 5 | "title": "從命令提示字元中開啟 Visual Studio Code 如何避免顯示惱人的偵錯訊息", 6 | "date": "2016/04/30 18:05", 7 | "author": "Will 保哥", 8 | "category": "Visual Studio", 9 | "category-link": "http://blog.miniasp.com/category/Visual-Studio.aspx", 10 | "summary": "

由於我的 Visual Studio Code 大部分時候都是在命令提示字元下啟動,所以只要用 code .就可以快速啟動 Visual Studio Code 並自動開啟目前所在資料夾。不過不知道從哪個版本開始,我在啟動 Visual Studio Code 之後,卻開始在原本所在的命令提示字元視窗中出現一堆惱人的偵錯訊息,本篇文章試圖解析這個現象,並提出解決辦法。

... 繼續閱讀...

" 11 | }, 12 | { 13 | "id": 2, 14 | "href": "http://blog.miniasp.com/post/2016/03/22/Does-Certification-Exam-Useful.aspx", 15 | "title": "考證照真的沒用嗎?一個從業 20 年的 IT 主管告訴你他怎麼看!", 16 | "date": "2016/03/22 19:28", 17 | "author": "Will 保哥", 18 | "category": "心得分享", 19 | "category-link": "http://blog.miniasp.com/category/%E5%BF%83%E5%BE%97%E5%88%86%E4%BA%AB.aspx", 20 | "summary": "

其實無論在哪個國家都有推行證照制度,且行之有年,台灣當然也不例外,這件事一開始的立意都是好的,就是希望透過一套公平的考試制度,評估一個人的技術能力是否達到一定程度水準,不但能當成一個人的能力指標,也可以讓大家有個明確目標朝專業之路邁進。其他的行業我不清楚,但就我本身熟悉的 IT 產業來說,不知何年何月開始,大家開始對證照制度嗤之以鼻、不屑一顧,甚至覺得是一個人能力的負指標 (也就是能力不好的人才需要靠證照證明自己)。你說這現象是何等的詭異?是什麼樣的天時、地利、人和,可以讓一個原本立意良善的制度,變成人人喊打的落水狗,可能連有張證照都還不敢承認的地步。今天,就來談談我的個人見解。

... 繼續閱讀...

" 21 | }, 22 | { 23 | "id": 3, 24 | "href": "http://blog.miniasp.com/post/2016/03/14/ASPNET-MVC-Developer-Note-Part-28-Understanding-ModelState.aspx", 25 | "title": "ASP.NET MVC 開發心得分享 (28):深入瞭解 ModelState 內部細節", 26 | "date": "2016/03/14 12:14", 27 | "author": "Will 保哥", 28 | "category": "ASP.NET MVC", 29 | "category-link": "http://blog.miniasp.com/category/ASPNET-MVC.aspx", 30 | "summary": "

在 ASP.NET MVC 的 模型繫結 (Model Binding) 完成之後,我們可以在 Controller / Action 中取得 ModelState 物件,一般來說我們都會用 ModelState.IsValid 來檢查在「模型繫結」的過程中所做的輸入驗證 (Input Validation) 與 模型驗證 (Model Validation) 是否成功。不過,這個 ModelState物件的用途很廣,裡面存有非常多模型繫結過程的狀態資訊,不但在 Controller 中能用,在 View 裡面也能使用,用的好的話,可以讓你的 Controller 更輕、View 也更乾淨,本篇文章將分享幾個 ModelState 的使用技巧。

... 繼續閱讀...

" 31 | }, 32 | { 33 | "id": 4, 34 | "href": "http://blog.miniasp.com/post/2016/03/06/ASPNET-MVC-5-View-Roslyn-problem-workaround.aspx", 35 | "title": "ASP.NET MVC 5.2.3 的 View 使用 Roslyn (C# 6.0) 編譯時的問題", 36 | "date": "2016/03/06 17:11", 37 | "author": "Will 保哥", 38 | "category": "ASP.NET MVC", 39 | "category-link": "http://blog.miniasp.com/category/ASPNET-MVC.aspx", 40 | "summary": "

最近發現目前的 ASP.NET MVC 5 最新版 (v5.2.3) 在搭配 Visual Studio 2015 進行開發時,在 View 頁面中使用 @Html.IdFor() 或 @Html.NameFor()在搭配使用特定 Lambda 語法時會輸出奇怪的字元,由於所有強型別的 HtmlHeper 表單欄位輸出的內部都會用到 IdFor() 與 Namefor() 這兩個 API,所以這個問題將會導致這些表單欄位 HTML 輸出的時候產生錯誤的 id 與 name 屬性,當表單 POST 回 Controller 時將無法正確執行模型繫結 (Model Binding),所以會有接不到資料的情況,本篇文章將詳加說明發生的原因與暫時的解決方案。

... 繼續閱讀...

" 41 | }, 42 | { 43 | "id": 5, 44 | "href": "http://blog.miniasp.com/post/2016/02/19/Useful-tool-PackageManagement-OneGet.aspx", 45 | "title": "介紹好用工具:Win 10 內建的 PackageManagement 套件管理器 (OneGet)", 46 | "date": "2016/02/19 11:55", 47 | "author": "Will 保哥", 48 | "category": "介紹好用工具", 49 | "category-link": "http://blog.miniasp.com/category/%E4%BB%8B%E7%B4%B9%E5%A5%BD%E7%94%A8%E5%B7%A5%E5%85%B7.aspx", 50 | "summary": "

OneGet 是微軟新一代 Windows 套件管理器 ( 類似 Ubuntu Linux 底下的 apt-get 工具 ),這名字還蠻漂亮的,不過前陣子卻把名稱改為PackageManagement,但無論如何,我覺得 OneGet 比較好聽,你只要知道這兩個是一樣的東西就好了。 目前這套工具已經內建於 Windows 10 作業系統中,透過 PowerShell 的 Cmdlet 就可以呼叫使用,這個鮮為人知的全新工具試圖解決未來所有軟體安裝的問題,本篇文章將詳細介紹 OneGet 的基本概念與使用方式。

... 繼續閱讀...

" 51 | }, 52 | { 53 | "id": 6, 54 | "href": "http://blog.miniasp.com/post/2016/02/02/JavaScript-novice-advice-and-learning-resources.aspx", 55 | "title": "我要成為前端工程師!給 JavaScript 新手的建議與學習資源整理", 56 | "date": "2016/02/02 17:48", 57 | "author": "Will 保哥", 58 | "category": "前端工程研究", 59 | "category-link": "http://blog.miniasp.com/category/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E7%A0%94%E7%A9%B6.aspx", 60 | "summary": "

今年有越來越多企業開始跟我們接洽企業內訓的事,想請我幫他們培訓前端工程師,但你知道一個好的前端工程師絕對不是兩三個月可以養成的,需要多年的努力與磨練才會有點成績。而這幾年可謂前端正夯,有為數不少的人開始大規模的往前端開發移動,而我被問到最多的問題就是「請問 JavaScript 要怎麼學?」或「請問 JavaScript 該怎樣入門?」諸如此類的問題。大家都知道,對於一門程式技術來說,「會寫」與「會教」是兩個截然不同的領域,會寫 JavaScript 的人到處都是,但是會教的人就相對少很多了。我這幾年教授 JavaScript 開發實戰課程已經超過 15 梯次,在將近 500 位學員裡面,我所看到的大部分學員都是對 JavaScript 不勝理解,普遍處於一種一知半解、模糊不清的狀態。另一方面,我在公司內部也帶過不少工程師,總是有人會想學習 JavaScript 但不知道如何入門的情況,這讓我陷入深思,該如何幫助一個人學習 JavaScript 從入門到精通呢?本篇文章將說說我個人的一些想法與建議。

... 繼續閱讀...

" 61 | } 62 | ] 63 | -------------------------------------------------------------------------------- /src/api/db.json: -------------------------------------------------------------------------------- 1 | { 2 | "articles": [ 3 | { 4 | "id": 1, 5 | "href": "http://blog.miniasp.com/post/2016/04/30/Visual-Studio-Code-from-Command-Prompt-notes.aspx", 6 | "title": "從命令提示字元中開啟 Visual Studio Code 如何避免顯示惱人的偵錯訊息", 7 | "date": "2016/04/30 18:05", 8 | "author": "Will 保哥", 9 | "category": "Visual Studio", 10 | "category-link": "http://blog.miniasp.com/category/Visual-Studio.aspx", 11 | "summary": "

由於我的 Visual Studio Code 大部分時候都是在命令提示字元下啟動,所以只要用 code .就可以快速啟動 Visual Studio Code 並自動開啟目前所在資料夾。不過不知道從哪個版本開始,我在啟動 Visual Studio Code 之後,卻開始在原本所在的命令提示字元視窗中出現一堆惱人的偵錯訊息,本篇文章試圖解析這個現象,並提出解決辦法。

... 繼續閱讀...

" 12 | }, 13 | { 14 | "id": 2, 15 | "href": "http://blog.miniasp.com/post/2016/03/22/Does-Certification-Exam-Useful.aspx", 16 | "title": "考證照真的沒用嗎?一個從業 20 年的 IT 主管告訴你他怎麼看!", 17 | "date": "2016/03/22 19:28", 18 | "author": "Will 保哥", 19 | "category": "心得分享", 20 | "category-link": "http://blog.miniasp.com/category/%E5%BF%83%E5%BE%97%E5%88%86%E4%BA%AB.aspx", 21 | "summary": "

其實無論在哪個國家都有推行證照制度,且行之有年,台灣當然也不例外,這件事一開始的立意都是好的,就是希望透過一套公平的考試制度,評估一個人的技術能力是否達到一定程度水準,不但能當成一個人的能力指標,也可以讓大家有個明確目標朝專業之路邁進。其他的行業我不清楚,但就我本身熟悉的 IT 產業來說,不知何年何月開始,大家開始對證照制度嗤之以鼻、不屑一顧,甚至覺得是一個人能力的負指標 (也就是能力不好的人才需要靠證照證明自己)。你說這現象是何等的詭異?是什麼樣的天時、地利、人和,可以讓一個原本立意良善的制度,變成人人喊打的落水狗,可能連有張證照都還不敢承認的地步。今天,就來談談我的個人見解。

... 繼續閱讀...

" 22 | }, 23 | { 24 | "id": 3, 25 | "href": "http://blog.miniasp.com/post/2016/03/14/ASPNET-MVC-Developer-Note-Part-28-Understanding-ModelState.aspx", 26 | "title": "ASP.NET MVC 開發心得分享 (28):深入瞭解 ModelState 內部細節", 27 | "date": "2016/03/14 12:14", 28 | "author": "Will 保哥", 29 | "category": "ASP.NET MVC", 30 | "category-link": "http://blog.miniasp.com/category/ASPNET-MVC.aspx", 31 | "summary": "

在 ASP.NET MVC 的 模型繫結 (Model Binding) 完成之後,我們可以在 Controller / Action 中取得 ModelState 物件,一般來說我們都會用 ModelState.IsValid 來檢查在「模型繫結」的過程中所做的輸入驗證 (Input Validation) 與 模型驗證 (Model Validation) 是否成功。不過,這個 ModelState物件的用途很廣,裡面存有非常多模型繫結過程的狀態資訊,不但在 Controller 中能用,在 View 裡面也能使用,用的好的話,可以讓你的 Controller 更輕、View 也更乾淨,本篇文章將分享幾個 ModelState 的使用技巧。

... 繼續閱讀...

" 32 | }, 33 | { 34 | "id": 4, 35 | "href": "http://blog.miniasp.com/post/2016/03/06/ASPNET-MVC-5-View-Roslyn-problem-workaround.aspx", 36 | "title": "ASP.NET MVC 5.2.3 的 View 使用 Roslyn (C# 6.0) 編譯時的問題", 37 | "date": "2016/03/06 17:11", 38 | "author": "Will 保哥", 39 | "category": "ASP.NET MVC", 40 | "category-link": "http://blog.miniasp.com/category/ASPNET-MVC.aspx", 41 | "summary": "

最近發現目前的 ASP.NET MVC 5 最新版 (v5.2.3) 在搭配 Visual Studio 2015 進行開發時,在 View 頁面中使用 @Html.IdFor() 或 @Html.NameFor()在搭配使用特定 Lambda 語法時會輸出奇怪的字元,由於所有強型別的 HtmlHeper 表單欄位輸出的內部都會用到 IdFor() 與 Namefor() 這兩個 API,所以這個問題將會導致這些表單欄位 HTML 輸出的時候產生錯誤的 id 與 name 屬性,當表單 POST 回 Controller 時將無法正確執行模型繫結 (Model Binding),所以會有接不到資料的情況,本篇文章將詳加說明發生的原因與暫時的解決方案。

... 繼續閱讀...

" 42 | }, 43 | { 44 | "id": 5, 45 | "href": "http://blog.miniasp.com/post/2016/02/19/Useful-tool-PackageManagement-OneGet.aspx", 46 | "title": "介紹好用工具:Win 10 內建的 PackageManagement 套件管理器 (OneGet)", 47 | "date": "2016/02/19 11:55", 48 | "author": "Will 保哥", 49 | "category": "介紹好用工具", 50 | "category-link": "http://blog.miniasp.com/category/%E4%BB%8B%E7%B4%B9%E5%A5%BD%E7%94%A8%E5%B7%A5%E5%85%B7.aspx", 51 | "summary": "

OneGet 是微軟新一代 Windows 套件管理器 ( 類似 Ubuntu Linux 底下的 apt-get 工具 ),這名字還蠻漂亮的,不過前陣子卻把名稱改為PackageManagement,但無論如何,我覺得 OneGet 比較好聽,你只要知道這兩個是一樣的東西就好了。 目前這套工具已經內建於 Windows 10 作業系統中,透過 PowerShell 的 Cmdlet 就可以呼叫使用,這個鮮為人知的全新工具試圖解決未來所有軟體安裝的問題,本篇文章將詳細介紹 OneGet 的基本概念與使用方式。

... 繼續閱讀...

" 52 | }, 53 | { 54 | "id": 6, 55 | "href": "http://blog.miniasp.com/post/2016/02/02/JavaScript-novice-advice-and-learning-resources.aspx", 56 | "title": "我要成為前端工程師!給 JavaScript 新手的建議與學習資源整理", 57 | "date": "2016/02/02 17:48", 58 | "author": "Will 保哥", 59 | "category": "前端工程研究", 60 | "category-link": "http://blog.miniasp.com/category/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E7%A0%94%E7%A9%B6.aspx", 61 | "summary": "

今年有越來越多企業開始跟我們接洽企業內訓的事,想請我幫他們培訓前端工程師,但你知道一個好的前端工程師絕對不是兩三個月可以養成的,需要多年的努力與磨練才會有點成績。而這幾年可謂前端正夯,有為數不少的人開始大規模的往前端開發移動,而我被問到最多的問題就是「請問 JavaScript 要怎麼學?」或「請問 JavaScript 該怎樣入門?」諸如此類的問題。大家都知道,對於一門程式技術來說,「會寫」與「會教」是兩個截然不同的領域,會寫 JavaScript 的人到處都是,但是會教的人就相對少很多了。我這幾年教授 JavaScript 開發實戰課程已經超過 15 梯次,在將近 500 位學員裡面,我所看到的大部分學員都是對 JavaScript 不勝理解,普遍處於一種一知半解、模糊不清的狀態。另一方面,我在公司內部也帶過不少工程師,總是有人會想學習 JavaScript 但不知道如何入門的情況,這讓我陷入深思,該如何幫助一個人學習 JavaScript 從入門到精通呢?本篇文章將說說我個人的一些想法與建議。

... 繼續閱讀...

" 62 | } 63 | ] 64 | } 65 | -------------------------------------------------------------------------------- /src/assets/styles/jquery.fancybox.css: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2 | .fancybox-wrap, 3 | .fancybox-skin, 4 | .fancybox-outer, 5 | .fancybox-inner, 6 | .fancybox-image, 7 | .fancybox-wrap iframe, 8 | .fancybox-wrap object, 9 | .fancybox-nav, 10 | .fancybox-nav span, 11 | .fancybox-tmp 12 | { 13 | padding: 0; 14 | margin: 0; 15 | border: 0; 16 | outline: none; 17 | vertical-align: top; 18 | } 19 | 20 | .fancybox-wrap { 21 | position: absolute; 22 | top: 0; 23 | left: 0; 24 | z-index: 8020; 25 | } 26 | 27 | .fancybox-skin { 28 | position: relative; 29 | background: #f9f9f9; 30 | color: #444; 31 | text-shadow: none; 32 | -webkit-border-radius: 4px; 33 | -moz-border-radius: 4px; 34 | border-radius: 4px; 35 | } 36 | 37 | .fancybox-opened { 38 | z-index: 8030; 39 | } 40 | 41 | .fancybox-opened .fancybox-skin { 42 | -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 43 | -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 44 | box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 45 | } 46 | 47 | .fancybox-outer, .fancybox-inner { 48 | position: relative; 49 | } 50 | 51 | .fancybox-inner { 52 | overflow: hidden; 53 | } 54 | 55 | .fancybox-type-iframe .fancybox-inner { 56 | -webkit-overflow-scrolling: touch; 57 | } 58 | 59 | .fancybox-error { 60 | color: #444; 61 | font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; 62 | margin: 0; 63 | padding: 15px; 64 | white-space: nowrap; 65 | } 66 | 67 | .fancybox-image, .fancybox-iframe { 68 | display: block; 69 | width: 100%; 70 | height: 100%; 71 | } 72 | 73 | .fancybox-image { 74 | max-width: 100%; 75 | max-height: 100%; 76 | } 77 | 78 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { 79 | background-image: url('fancybox_sprite.png'); 80 | } 81 | 82 | #fancybox-loading { 83 | position: fixed; 84 | top: 50%; 85 | left: 50%; 86 | margin-top: -22px; 87 | margin-left: -22px; 88 | background-position: 0 -108px; 89 | opacity: 0.8; 90 | cursor: pointer; 91 | z-index: 8060; 92 | } 93 | 94 | #fancybox-loading div { 95 | width: 44px; 96 | height: 44px; 97 | background: url('fancybox_loading.gif') center center no-repeat; 98 | } 99 | 100 | .fancybox-close { 101 | position: absolute; 102 | top: -18px; 103 | right: -18px; 104 | width: 36px; 105 | height: 36px; 106 | cursor: pointer; 107 | z-index: 8040; 108 | } 109 | 110 | .fancybox-nav { 111 | position: absolute; 112 | top: 0; 113 | width: 40%; 114 | height: 100%; 115 | cursor: pointer; 116 | text-decoration: none; 117 | background: transparent url('blank.gif'); /* helps IE */ 118 | -webkit-tap-highlight-color: rgba(0,0,0,0); 119 | z-index: 8040; 120 | } 121 | 122 | .fancybox-prev { 123 | left: 0; 124 | } 125 | 126 | .fancybox-next { 127 | right: 0; 128 | } 129 | 130 | .fancybox-nav span { 131 | position: absolute; 132 | top: 50%; 133 | width: 36px; 134 | height: 34px; 135 | margin-top: -18px; 136 | cursor: pointer; 137 | z-index: 8040; 138 | visibility: hidden; 139 | } 140 | 141 | .fancybox-prev span { 142 | left: 10px; 143 | background-position: 0 -36px; 144 | } 145 | 146 | .fancybox-next span { 147 | right: 10px; 148 | background-position: 0 -72px; 149 | } 150 | 151 | .fancybox-nav:hover span { 152 | visibility: visible; 153 | } 154 | 155 | .fancybox-tmp { 156 | position: absolute; 157 | top: -99999px; 158 | left: -99999px; 159 | visibility: hidden; 160 | max-width: 99999px; 161 | max-height: 99999px; 162 | overflow: visible !important; 163 | } 164 | 165 | /* Overlay helper */ 166 | 167 | .fancybox-lock { 168 | overflow: hidden !important; 169 | width: auto; 170 | } 171 | 172 | .fancybox-lock body { 173 | overflow: hidden !important; 174 | } 175 | 176 | .fancybox-lock-test { 177 | overflow-y: hidden !important; 178 | } 179 | 180 | .fancybox-overlay { 181 | position: absolute; 182 | top: 0; 183 | left: 0; 184 | overflow: hidden; 185 | display: none; 186 | z-index: 8010; 187 | background: url('fancybox_overlay.png'); 188 | } 189 | 190 | .fancybox-overlay-fixed { 191 | position: fixed; 192 | bottom: 0; 193 | right: 0; 194 | } 195 | 196 | .fancybox-lock .fancybox-overlay { 197 | overflow: auto; 198 | overflow-y: scroll; 199 | } 200 | 201 | /* Title helper */ 202 | 203 | .fancybox-title { 204 | visibility: hidden; 205 | font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; 206 | position: relative; 207 | text-shadow: none; 208 | z-index: 8050; 209 | } 210 | 211 | .fancybox-opened .fancybox-title { 212 | visibility: visible; 213 | } 214 | 215 | .fancybox-title-float-wrap { 216 | position: absolute; 217 | bottom: 0; 218 | right: 50%; 219 | margin-bottom: -35px; 220 | z-index: 8050; 221 | text-align: center; 222 | } 223 | 224 | .fancybox-title-float-wrap .child { 225 | display: inline-block; 226 | margin-right: -100%; 227 | padding: 2px 20px; 228 | background: transparent; /* Fallback for web browsers that doesn't support RGBa */ 229 | background: rgba(0, 0, 0, 0.8); 230 | -webkit-border-radius: 15px; 231 | -moz-border-radius: 15px; 232 | border-radius: 15px; 233 | text-shadow: 0 1px 2px #222; 234 | color: #FFF; 235 | font-weight: bold; 236 | line-height: 24px; 237 | white-space: nowrap; 238 | } 239 | 240 | .fancybox-title-outside-wrap { 241 | position: relative; 242 | margin-top: 10px; 243 | color: #fff; 244 | } 245 | 246 | .fancybox-title-inside-wrap { 247 | padding-top: 10px; 248 | } 249 | 250 | .fancybox-title-over-wrap { 251 | position: absolute; 252 | bottom: 0; 253 | left: 0; 254 | color: #fff; 255 | padding: 10px; 256 | background: #000; 257 | background: rgba(0, 0, 0, .8); 258 | } 259 | 260 | /*Retina graphics!*/ 261 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5), 262 | only screen and (min--moz-device-pixel-ratio: 1.5), 263 | only screen and (min-device-pixel-ratio: 1.5){ 264 | 265 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { 266 | background-image: url('fancybox_sprite@2x.png'); 267 | background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/ 268 | } 269 | 270 | #fancybox-loading div { 271 | background-image: url('fancybox_loading@2x.gif'); 272 | background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/ 273 | } 274 | } -------------------------------------------------------------------------------- /src/assets/styles/shCore.css: -------------------------------------------------------------------------------- 1 | .syntaxhighlighter a, 2 | .syntaxhighlighter div, 3 | .syntaxhighlighter code, 4 | .syntaxhighlighter table, 5 | .syntaxhighlighter table td, 6 | .syntaxhighlighter table tr, 7 | .syntaxhighlighter table tbody, 8 | .syntaxhighlighter table thead, 9 | .syntaxhighlighter table caption, 10 | .syntaxhighlighter textarea { 11 | -moz-border-radius: 0 0 0 0 !important; 12 | -webkit-border-radius: 0 0 0 0 !important; 13 | background: none !important; 14 | border: 0 !important; 15 | bottom: auto !important; 16 | float: none !important; 17 | height: auto !important; 18 | left: auto !important; 19 | line-height: 1.1em !important; 20 | margin: 0 !important; 21 | outline: 0 !important; 22 | overflow: visible !important; 23 | padding: 0 !important; 24 | position: static !important; 25 | right: auto !important; 26 | text-align: left !important; 27 | top: auto !important; 28 | vertical-align: baseline !important; 29 | width: auto !important; 30 | box-sizing: content-box !important; 31 | font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; 32 | font-weight: normal !important; 33 | font-style: normal !important; 34 | font-size: 1em !important; 35 | min-height: inherit !important; 36 | min-height: auto !important; 37 | } 38 | 39 | .syntaxhighlighter { 40 | width: 100% !important; 41 | margin: 1em 0 1em 0 !important; 42 | position: relative !important; 43 | overflow: auto !important; 44 | font-size: 1em !important; 45 | } 46 | .syntaxhighlighter.source { 47 | overflow: hidden !important; 48 | } 49 | .syntaxhighlighter .bold { 50 | font-weight: bold !important; 51 | } 52 | .syntaxhighlighter .italic { 53 | font-style: italic !important; 54 | } 55 | .syntaxhighlighter .line { 56 | white-space: pre !important; 57 | } 58 | .syntaxhighlighter table { 59 | width: 100% !important; 60 | } 61 | .syntaxhighlighter table caption { 62 | text-align: left !important; 63 | padding: .5em 0 0.5em 1em !important; 64 | } 65 | .syntaxhighlighter table td.code { 66 | width: 100% !important; 67 | } 68 | .syntaxhighlighter table td.code .container { 69 | position: relative !important; 70 | } 71 | .syntaxhighlighter table td.code .container textarea { 72 | box-sizing: border-box !important; 73 | position: absolute !important; 74 | left: 0 !important; 75 | top: 0 !important; 76 | width: 100% !important; 77 | height: 100% !important; 78 | border: none !important; 79 | background: white !important; 80 | padding-left: 1em !important; 81 | overflow: hidden !important; 82 | white-space: pre !important; 83 | } 84 | .syntaxhighlighter table td.gutter .line { 85 | text-align: right !important; 86 | padding: 0 0.5em 0 1em !important; 87 | } 88 | .syntaxhighlighter table td.code .line { 89 | padding: 0 1em !important; 90 | } 91 | .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { 92 | padding-left: 0em !important; 93 | } 94 | .syntaxhighlighter.show { 95 | display: block !important; 96 | } 97 | .syntaxhighlighter.collapsed table { 98 | display: none !important; 99 | } 100 | .syntaxhighlighter.collapsed .toolbar { 101 | padding: 0.1em 0.8em 0em 0.8em !important; 102 | font-size: 1em !important; 103 | position: static !important; 104 | width: auto !important; 105 | height: auto !important; 106 | } 107 | .syntaxhighlighter.collapsed .toolbar span { 108 | display: inline !important; 109 | margin-right: 1em !important; 110 | } 111 | .syntaxhighlighter.collapsed .toolbar span a { 112 | padding: 0 !important; 113 | display: none !important; 114 | } 115 | .syntaxhighlighter.collapsed .toolbar span a.expandSource { 116 | display: inline !important; 117 | } 118 | .syntaxhighlighter .toolbar { 119 | position: absolute !important; 120 | right: 1px !important; 121 | top: 1px !important; 122 | width: 11px !important; 123 | height: 11px !important; 124 | font-size: 10px !important; 125 | z-index: 10 !important; 126 | } 127 | .syntaxhighlighter .toolbar span.title { 128 | display: inline !important; 129 | } 130 | .syntaxhighlighter .toolbar a { 131 | display: block !important; 132 | text-align: center !important; 133 | text-decoration: none !important; 134 | padding-top: 1px !important; 135 | } 136 | .syntaxhighlighter .toolbar a.expandSource { 137 | display: none !important; 138 | } 139 | .syntaxhighlighter.ie { 140 | font-size: .9em !important; 141 | padding: 1px 0 1px 0 !important; 142 | } 143 | .syntaxhighlighter.ie .toolbar { 144 | line-height: 8px !important; 145 | } 146 | .syntaxhighlighter.ie .toolbar a { 147 | padding-top: 0px !important; 148 | } 149 | .syntaxhighlighter.printing .line.alt1 .content, 150 | .syntaxhighlighter.printing .line.alt2 .content, 151 | .syntaxhighlighter.printing .line.highlighted .number, 152 | .syntaxhighlighter.printing .line.highlighted.alt1 .content, 153 | .syntaxhighlighter.printing .line.highlighted.alt2 .content { 154 | background: none !important; 155 | } 156 | .syntaxhighlighter.printing .line .number { 157 | color: #bbbbbb !important; 158 | } 159 | .syntaxhighlighter.printing .line .content { 160 | color: black !important; 161 | } 162 | .syntaxhighlighter.printing .toolbar { 163 | display: none !important; 164 | } 165 | .syntaxhighlighter.printing a { 166 | text-decoration: none !important; 167 | } 168 | .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { 169 | color: black !important; 170 | } 171 | .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { 172 | color: #008200 !important; 173 | } 174 | .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { 175 | color: blue !important; 176 | } 177 | .syntaxhighlighter.printing .keyword { 178 | color: #006699 !important; 179 | font-weight: bold !important; 180 | } 181 | .syntaxhighlighter.printing .preprocessor { 182 | color: gray !important; 183 | } 184 | .syntaxhighlighter.printing .variable { 185 | color: #aa7700 !important; 186 | } 187 | .syntaxhighlighter.printing .value { 188 | color: #009900 !important; 189 | } 190 | .syntaxhighlighter.printing .functions { 191 | color: #ff1493 !important; 192 | } 193 | .syntaxhighlighter.printing .constants { 194 | color: #0066cc !important; 195 | } 196 | .syntaxhighlighter.printing .script { 197 | font-weight: bold !important; 198 | } 199 | .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { 200 | color: gray !important; 201 | } 202 | .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { 203 | color: #ff1493 !important; 204 | } 205 | .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { 206 | color: red !important; 207 | } 208 | .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { 209 | color: black !important; 210 | } 211 | -------------------------------------------------------------------------------- /src/assets/scripts/04-jquery-jtemplates.js: -------------------------------------------------------------------------------- 1 | /* jTemplates 0.7.8 (http://jtemplates.tpython.com) Copyright (c) 2009 Tomasz Gloc */ 2 | eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('a(37.b&&!37.b.38){(9(b){6 m=9(s,A,f){5.1M=[];5.1u={};5.2p=E;5.1N={};5.1c={};5.f=b.1m({1Z:1f,3a:1O,2q:1f,2r:1f,3b:1O,3c:1O},f);5.1v=(5.f.1v!==F)?(5.f.1v):(13.20);5.Y=(5.f.Y!==F)?(5.f.Y):(13.3d);5.3e(s,A);a(s){5.1w(5.1c[\'21\'],A,5.f)}5.1c=E};m.y.2s=\'0.7.8\';m.R=1O;m.y.3e=9(s,A){6 2t=/\\{#14 *(\\w*?)( .*)*\\}/g;6 22,1x,M;6 1y=E;6 2u=[];2v((22=2t.3N(s))!=E){1y=2t.1y;1x=22[1];M=s.2w(\'{#/14 \'+1x+\'}\',1y);a(M==-1){C j Z(\'15: m "\'+1x+\'" 2x 23 3O.\');}5.1c[1x]=s.2y(1y,M);2u[1x]=13.2z(22[2])}a(1y===E){5.1c[\'21\']=s;c}N(6 i 24 5.1c){a(i!=\'21\'){5.1N[i]=j m()}}N(6 i 24 5.1c){a(i!=\'21\'){5.1N[i].1w(5.1c[i],b.1m({},A||{},5.1N||{}),b.1m({},5.f,2u[i]));5.1c[i]=E}}};m.y.1w=9(s,A,f){a(s==F){5.1M.B(j 1g(\'\',1,5));c}s=s.U(/[\\n\\r]/g,\'\');s=s.U(/\\{\\*.*?\\*\\}/g,\'\');5.2p=b.1m({},5.1N||{},A||{});5.f=j 2A(f);6 p=5.1M;6 1P=s.1h(/\\{#.*?\\}/g);6 16=0,M=0;6 e;6 1i=0;6 25=0;N(6 i=0,l=(1P)?(1P.V):(0);i16){p.B(j 1g(s.2y(16,M),1,5))}16=M+11;1i=0;i=b.3Q(\'{#/1z}\',1P);1R}M=s.2w(17,16);a(M>16){p.B(j 1g(s.2y(16,M),1i,5))}6 3R=17.1h(/\\{#([\\w\\/]+).*?\\}/);6 26=I.$1;2B(26){q\'3S\':++25;p.27();q\'a\':e=j 1A(17,p);p.B(e);p=e;D;q\'J\':p.27();D;q\'/a\':2v(25){p=p.28();--25}q\'/N\':q\'/29\':p=p.28();D;q\'29\':e=j 1n(17,p,5);p.B(e);p=e;D;q\'N\':e=2a(17,p,5);p.B(e);p=e;D;q\'1R\':q\'D\':p.B(j 18(26));D;q\'2C\':p.B(j 2D(17,5.2p));D;q\'h\':p.B(j 2E(17));D;q\'2F\':p.B(j 2G(17));D;q\'3T\':p.B(j 1g(\'{\',1,5));D;q\'3U\':p.B(j 1g(\'}\',1,5));D;q\'1z\':1i=1;D;q\'/1z\':a(m.R){C j Z("15: 3V 2H 3f 1z.");}D;2I:a(m.R){C j Z(\'15: 3W 3X: \'+26+\'.\');}}16=M+17.V}a(s.V>16){p.B(j 1g(s.3Y(16),1i,5))}};m.y.K=9(d,h,z,H){++H;6 $T=d,2b,2c;a(5.f.3b){$T=5.1v(d,{2d:(5.f.3a&&H==1),1S:5.f.1Z},5.Y)}a(!5.f.3c){2b=5.1u;2c=h}J{2b=5.1v(5.1u,{2d:(5.f.2q),1S:1f},5.Y);2c=5.1v(h,{2d:(5.f.2q&&H==1),1S:1f},5.Y)}6 $P=b.1m({},2b,2c);6 $Q=(z!=F)?(z):({});$Q.2s=5.2s;6 19=\'\';N(6 i=0,l=5.1M.V;i/g,\'&3h;\').U(/0)?(1):(-1))}}6 19=\'\';6 i,l;a(5.W.1W){6 2S=s+1V(10(5.W.1W));e=(2S>e)?(e):(2S)}a((e>s&&12>0)||(e0)?(se));s+=12,++1K){1s=1U[s];a(1J!=\'9\'){1k=1r[s]}J{1k=1r(s);a(1k===F||1k===E){D}}a((1E 1k==\'9\')&&(5.1d.f.1Z||!5.1d.f.2r)){1R}a((1J==\'3q\')&&(1s 24 2A)){1R}6 3s=u[5.x];u[5.x]=1k;u[5.x+\'$3t\']=s;u[5.x+\'$1K\']=1K;u[5.x+\'$3u\']=(1K==0);u[5.x+\'$3v\']=(s+12>=e);u[5.x+\'$3w\']=3r;u[5.x+\'$1U\']=(1s!==F&&1s.2K==2M)?(5.1d.Y(1s)):(1s);u[5.x+\'$1E\']=1E 1k;N(i=0,l=5.1p.V;i")}s=b.4p(s);s=s.U(/^<\\!\\[4q\\[([\\s\\S]*)\\]\\]>$/3A,\'$1\');s=s.U(/^<\\!--([\\s\\S]*)-->$/3A,\'$1\');c b(5).1w(s,A,f)};b.1a.4r=9(){6 1W=0;b(5).1e(9(){a(b.2j(5)){++1W}});c 1W};b.1a.4s=9(){b(5).3B();c b(5).1e(9(){b.3C(5,\'2i\')})};b.1a.2J=9(1T,1o){c b(5).1e(9(){6 t=b.2j(5);a(t===F){a(m.R)C j Z(\'15: m 2x 23 3D.\');J c}t.2J(1T,1o)})};b.1a.31=9(d,h){c b(5).1e(9(){6 t=b.2j(5);a(t===F){a(m.R)C j Z(\'15: m 2x 23 3D.\');J c}b.O(5,\'1X\',b.O(5,\'1X\')+1);b(5).3z(t.K(d,h,5,0))})};b.1a.4t=9(1L,h,G){6 X=5;G=b.1m({1j:\'4u\',1Y:1O,32:1f},G);b.2Z({1t:1L,1j:G.1j,O:G.O,3E:G.3E,1Y:G.1Y,32:G.32,3F:G.3F,4v:\'4w\',4x:9(d){6 r=b(X).31(d,h);a(G.2k){G.2k(r)}},4y:G.4z,4A:G.4B});c 5};6 2l=9(1t,h,2m,2n,1b,G){5.3G=1t;5.1u=h;5.3H=2m;5.3I=2n;5.1b=1b;5.3J=E;5.33=G||{};6 X=5;b(1b).1e(9(){b.O(5,\'34\',X)});5.35()};2l.y.35=9(){5.3K();a(5.1b.V==0){c}6 X=5;b.4C(5.3G,5.3I,9(d){6 r=b(X.1b).31(d,X.1u);a(X.33.2k){X.33.2k(r)}});5.3J=4D(9(){X.35()},5.3H)};2l.y.3K=9(){5.1b=b.3L(5.1b,9(o){a(b.4E.4F){6 n=o.36;2v(n&&n!=4G){n=n.36}c n!=E}J{c o.36!=E}})};b.1a.4H=9(1t,h,2m,2n,G){c j 2l(1t,h,2m,2n,5,G)};b.1a.3B=9(){c b(5).1e(9(){6 2o=b.O(5,\'34\');a(2o==E){c}6 X=5;2o.1b=b.3L(2o.1b,9(o){c o!=X});b.3C(5,\'34\')})};b.1m({38:9(s,A,f){c j m(s,A,f)},4I:9(1L,A,f){6 s=b.2Z({1t:1L,1Y:1f}).3y;c j m(s,A,f)},2j:9(z){c b.O(z,\'2i\')},4J:9(14,O,3M){c 14.K(O,3M,F,0)},4K:9(1o){m.R=1o}})})(b)}',62,295,'|||||this|var|||function|if|jQuery|return|||settings||param||new|||Template|||node|case||||extData|||_name|prototype|element|includes|push|throw|break|null|undefined|options|deep|RegExp|else|get|oper|se|for|data|||DEBUG_MODE|||replace|length|_option|that|f_escapeString|Error|eval||step|TemplateUtils|template|jTemplates|ss|this_op|JTException|ret|fn|objs|_templates_code|_template|each|false|TextNode|match|literalMode|type|cval|delete|extend|opFOREACH|value|_onTrue|_onFalse|fcount|ckey|url|_param|f_cloneData|setTemplate|tname|lastIndex|literal|opIF|filter|try|__tmp|typeof|catch|instanceof|par|_currentState|mode|iteration|url_|_tree|_templates|true|op|end|continue|noFunc|name|key|Number|count|jTemplateSID|async|disallow_functions|cloneData|MAIN|iter|not|in|elseif_level|op_|switchToElse|getParent|foreach|opFORFactory|_param1|_param2|escapeData|optionText|_value|__t|_parent|jTemplate|getTemplate|on_success|Updater|interval|args|updater|_includes|filter_params|runnable_functions|version|reg|_template_settings|while|indexOf|is|substring|optionToObject|Object|switch|include|Include|UserParam|cycle|Cycle|begin|default|setParam|constructor|toString|String|obj|val|__template|tab|arr|tmp|ex|_values|_length|_index|_lastSessionID|sid|ajax|elementName|processTemplate|cache|_options|jTemplateUpdater|run|parentNode|window|createTemplate||filter_data|clone_data|clone_params|escapeHTML|splitTemplates|of|txt|gt|lt|_literalMode|__1|_cond|funcIterator|as|find|_arg|object|_total|prevValue|index|first|last|total|_root|responseText|html|im|processTemplateStop|removeData|defined|dataFilter|timeout|_url|_interval|_args|timer|detectDeletedNodes|grep|parameter|exec|closed|No|inArray|ppp|elseif|ldelim|rdelim|Missing|unknown|tag|substr|amp|quot|hasOwnProperty|Array|Function|Functions|are|allowed|split|shift|__0|subtemplate|to|Operator|failed|MAX_VALUE|Math|ceil|root|Cannot|values|has|no|elements|setTemplateURL|setTemplateElement|trim|CDATA|hasTemplate|removeTemplate|processTemplateURL|GET|dataType|json|success|error|on_error|complete|on_complete|getJSON|setTimeout|browser|msie|document|processTemplateStart|createTemplateURL|processTemplateToText|jTemplatesDebugMode'.split('|'),0,{})) -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 |
7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 191 | 192 |
193 |
194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 178 | 179 | -------------------------------------------------------------------------------- /src/assets/styles/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | Standard Theme 2015 - Version 1.0 3 | http://dotnetblogengine.net/ 4 | 5 | Content: 6 | 01.header 15.categorylist 7 | 02.well-global 16.linklist 8 | 03.post 17.monthlist 9 | 04.comment-item 18.mostcomments 10 | 05.comment-form 19.newsletter 11 | 06.related-posts 20.pagelist 12 | 07.postpaging 21.recentcomments 13 | 08.navigation-posts 22.recentposts 14 | 09.widget 23.search 15 | 10.administration 24.tagcloud 16 | 11.authorlist 25.archive-page 17 | 12.bloglist 26.contact-page 18 | 13.blogroll 27.search-page 19 | 14.calendar 28.syntaxhighlighter 20 | 15.categorylist 29.q-notes 21 | 16.linklist 30.footer 22 | */ 23 | 24 | body { line-height: 1.8; color: #333333; background-color: #eeeeee; cursor: default; font-family: "Segoe UI", "微軟正黑體"; font-size: 12pt; font-weight: 300; } 25 | h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: "Segoe UI", "微軟正黑體", "Lato","Helvetica Neue", Helvetica, Arial, sans-serif !important; font-weight: 700; } 26 | h1, .h1 { font-size: 32px; } 27 | h2, .h2 { font-size: 26px; } 28 | h3, .h3 { font-size: 20px; } 29 | h4, .h4 { font-size: 18px; } 30 | h5, .h5 { font-size: 14px; } 31 | h6, .h6 { font-size: 12px; } 32 | img { max-width: 100%; } 33 | .glyphicon { margin-right: 3px; } 34 | table { width: 100%; } 35 | .btn-wrapper { border-top: 1px solid #EEE; padding-top: 25px; margin-top: 15px; } 36 | .required-field { color: #e83232; margin-right: 4px; margin-left: 4px; } 37 | .text-uppercase { text-transform: uppercase; } 38 | 39 | /*[01.header]*/ 40 | .header .container > .navbar-header, 41 | .header .container > .navbar-collapse { margin-right: -15px !important; margin-left: -15px !important; } 42 | .header .logo { margin-right: 10px; } 43 | .header .title-wrapper { background-color: #ffffff; padding: 30px 0; margin-bottom: 35px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); } 44 | .header .title-wrapper hgroup { height: 80px; } 45 | .header .title-wrapper hgroup h1 { font-size: 40px; line-height: 40px; margin: 4px 0 8px; font-weight: 700; } 46 | .header .title-wrapper hgroup h1 A { color: #000000; text-decoration: none !important; } 47 | .header .title-wrapper hgroup h3 { font-size: 16px; font-weight: normal; margin: 0; color: #666666; } 48 | .header .social-icon { margin-top: 10px; } 49 | .header .social-icon a { text-decoration: none; } 50 | .header .navbar { margin: 0; border-radius: 0; } 51 | .header .navbar-inverse .navbar-nav > .open > a { color: rgb(153, 153, 153); } 52 | .header .nav > li > a.dropdown-m { padding: 15px 7px 15px 10px !important; } 53 | .header .nav > li > a { padding: 15px 10px !important; } 54 | .header .nav > li > a.dropdown-toggle { padding: 15px 10px !important; } 55 | 56 | /*[02.well-global]*/ 57 | .well-global,#trackbacks { background-color: #ffffff; padding: 4%; margin-bottom: 20px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); } 58 | .well-global .well-global-title { margin: 0; font-weight: 700; margin-bottom: 20px; border-bottom: 1px solid #eeeeee; padding-bottom: 20px; } 59 | .well-global .well-global-title h3 { margin: 0; font-weight: 700; } 60 | .page-global { background-color: #ffffff !important; padding: 4% !important; margin-bottom: 20px !important; border-radius: 6px !important; box-shadow: 0 1px 2px rgba(0,0,0,0.1); } 61 | .page-global .page-global-title { border-bottom: 1px solid #eee !important; margin: 0 0 20px 0 !important; padding-bottom: 15px !important; font-weight: bold !important; font-size: 26px !important; } 62 | 63 | /*[03.post]*/ 64 | .post { background-color: #ffffff; padding: 2% 4% 4%; margin-bottom: 20px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); } 65 | .post .post-header { margin-bottom: 15px; padding-bottom: 5px; border-bottom: 1px solid #ddd; } 66 | .post .post-header .post-title { line-height: 20px; font-size: 20px; margin: 15px 0 10px; } 67 | .post .post-header .post-title a { text-decoration: none; font-weight: bold; } 68 | .post .post-info { font-size: 13px; color: #AAA; } 69 | .post .post-info span { margin-right: 7px; } 70 | .post .post-info a { color: #AAA; } 71 | .post .post-footer { margin-top: 30px; padding: 15px; background-color: #eeeeee; font-size: 13px; min-height: 35px; border-radius: 4px; border: 1px solid #eeeeee; } 72 | .post .post-footer:hover { border-color: #ddd; } 73 | .post .post-rating { height: 21px; max-width: 50%; } 74 | .post .post-rating * { margin: 0; padding: 0; top: 0; line-height: 10px; } 75 | .post .post-rating p { top: 9px; } 76 | 77 | /*[04.comment-item]*/ 78 | .comment-item .comment-content { border: 1px solid #CCC; border-radius: 4px; padding: 2%; margin-bottom:10px !important } 79 | .comment-item .comment-gravatar { position: relative; } 80 | .comment-item .comment-gravatar img { border-radius: 4px; } 81 | .comment-item .comment-header { border-bottom: 1px solid #EEE; padding-bottom: 5px; } 82 | .comment-item .comment-header h4 { font-weight: bold; font-size: 18px; color: #333; } 83 | .comment-item .comment-header h4 a { color: #333; } 84 | .comment-item .comment-content.self { background-color: #ebffe5; border-color: #c0e0b2 !important; } 85 | .comment-item .self .comment-header { border-bottom-color: #c0e0b2; } 86 | .comment-item .self .comment-header h4 a, 87 | .comment-item .self .comment-header h4 { color: #376f1d !important; } 88 | .comment-item .self a { color: #74af5a; } 89 | .comment-item .self .comment-header .text-uppercase { color: #c0e0b2; } 90 | .comment-item .comment-form { border: 1px solid #CCC; margin: 15px 0; } 91 | .comment-item .carrow { background: url(../images/carrow.png) no-repeat 0 0; width: 9px; height: 17px; position: absolute; right: -11px; top: 14px; z-index: 999; } 92 | .comment-item .self .carrow { background: url(../images/sarrow.png) no-repeat 0 0 !important; } 93 | #commentlist .media, #commentlist ul, #commentlist ol { margin:0 !important;} 94 | 95 | /*[05.comment-form]*/ 96 | .comment-form { } 97 | #comment-form .success { background: #27ae60; border-radius: 4px; color: #fff; display: block; padding: 15px; } 98 | .comment-form .comment-menu { } 99 | .comment-form .comment-menu a { padding: 0 !important; } 100 | .comment-form .comment-menu a span { padding: 2px 7px; min-width: 70px; } 101 | .comment-form .comment-preview { height: auto !important; } 102 | .comment-form .comment-preview .comment-content { border: none; } 103 | .comment-form .comment-preview .comment-header small { display: none; } 104 | 105 | /*[06.related-posts]*/ 106 | .related-posts h3 { } 107 | .related-posts ul li div { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; color: rgb(136, 136, 136); margin-bottom: 10px; } 108 | 109 | /*[07.postpaging]*/ 110 | #postPaging > div { } 111 | #PostPager { display: block; text-align: center; margin: 0 0 10px; background-color: #ffffff; padding: 4%; margin-bottom: 20px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); } 112 | #PostPager li { display: inline-block !important; border: 1px solid #DDD !important; margin: 1px; padding: 5px 7px !important; font-size: 13px; font-weight: normal; background: #fff; border-radius: 3px; } 113 | #PostPager li a { padding: 2px; text-decoration: none; } 114 | #PostPager .PagerLinkCurrent { color: #fff; padding: 5px 14px; background-color: #0681ea !important; border: 1px solid #0861ea !important; } 115 | #PostPager .PagerLinkCurrent li { padding: 2px !important; } 116 | #PostPager .PagerLinkDisabled { color: #ccc; padding: 5px 14px; background: #fff; border-color: #DDD !important; } 117 | #PostPager .PagerEllipses { border: 0; padding: 2px; } 118 | 119 | /*[08.navigation-posts]*/ 120 | .navigation-posts a { text-decoration: none; outline: none; } 121 | 122 | /*[09.widget]*/ 123 | .widget { background-color: #ffffff; padding: 6%; margin-bottom: 20px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); } 124 | .widget .widget-header { margin: 0 0 15px 0; border-bottom: 1px solid #eeeeee; padding-bottom: 4%; font-weight: bold; font-size: 16px; } 125 | .widget ul { list-style: none; padding: 0; } 126 | .widget ul li { border-bottom: 1px solid #eee; padding: 4px 0; } 127 | .widget ul ul li { border: none; } 128 | 129 | /*[10.administration]*/ 130 | .administration .widget-header { margin-bottom: 0 !important; } 131 | 132 | /*[11.authorlist]*/ 133 | .authorlist .widget-header { margin-bottom: 0; } 134 | .authorlist li { } 135 | .authorlist li A.authorlink { margin-left: 5px; } 136 | 137 | /*[12.bloglist]*/ 138 | .bloglist .widget-header { margin-bottom: 0; } 139 | 140 | /*[13.blogroll]*/ 141 | .blogroll .widget-header { margin-bottom: 0; } 142 | .blogroll ul li A { padding-right: 3px; } 143 | .blogroll ul li img { margin-top: -3px; } 144 | .blogroll ul ul { margin-left: 15px !important; } 145 | .blogroll ul ul li { margin: 0; border-bottom: 1px dotted #DDD; line-height: 24px; } 146 | .blogroll ul ul li A { display: block; } 147 | .blogroll a[title="Download OPML file"] { margin: 10px 0 0 0; } 148 | 149 | /*[14.calendar]*/ 150 | #calendarContainer { text-transform: capitalize; text-align: center; } 151 | .calendar table { width: 100%; text-align: center; } 152 | .calendar td, .calendar table { background-color: #FFF !important; text-align: center; } 153 | .calendar .header { background: none !important; width: auto !important; height: auto !important; } 154 | .calendar .weekend { background-color: #F1F1F1; } 155 | .calendar .other { color: silver; } 156 | .calendar a.exist { display: inline-block; padding: 0 5px; border-radius: 104px; color: #fff; font-weight: normal; background-color: #0681ea; } 157 | .calendar td { vertical-align: top; background: white; } 158 | 159 | /*[15.categorylist]*/ 160 | .categorylist .widget-header { margin-bottom: 0; } 161 | .categorylist ul li A { padding-right: 3px; } 162 | 163 | /*[16.linklist]*/ 164 | .linklist .widget-header { margin-bottom: 0; } 165 | 166 | /*[17.monthlist]*/ 167 | .monthlist .widget-header { margin-bottom: 0; } 168 | .monthlist li { font-weight: normal; } 169 | .monthlist .year { cursor: pointer; font-weight: bold; } 170 | .monthlist .year li { margin: 0 10px; } 171 | .monthlist ul ul { display: none; } 172 | .monthlist .open { display: block; } 173 | 174 | /*[18.mostcomments]*/ 175 | .mostcomments table td { border: none; border-bottom: 1px solid #CCC; background: none; } 176 | .mostcomments table tr td:first-child { width: 50px; } 177 | .mostcomments table tr td:first-child img { position: relative; top: 2px; } 178 | 179 | /*[19.newsletter]*/ 180 | .newsletter input[type=text] { margin-bottom: 15px; } 181 | .newsletter #newsletteraction { font-size: 22px; color: #00c759; } 182 | .newsletter #newsletterform input[type="text"] { direction: ltr !important; } 183 | .footer .newsletter #newsletterform input[type="text"] { background-color: #333; border-color: #111; color: #CCC; box-shadow: none; } 184 | 185 | /*[20.pagelist]*/ 186 | .pagelist .widget-header { margin-bottom: 0; } 187 | 188 | /*[21.recentcomments]*/ 189 | .recentcomments .widget-header { margin-bottom: 0; } 190 | .recentcomments li { color: #AAA; font-size: 12px; } 191 | .recentcomments li a { font-size: 14px; } 192 | 193 | /*[22.recentposts]*/ 194 | .recentposts .widget-header { margin-bottom: 0; } 195 | .recentposts li { color: #AAA; font-size: 12px; } 196 | .recentposts li a { font-size: 14px; margin-right: 4px; display: block; } 197 | .recentposts li span { margin-right: 5px; } 198 | 199 | /*[23.search]*/ 200 | .search { padding: 4px; background: #fff; } 201 | .search input[type=text] { background-color: #fff; border: none; padding: 2%; height: 40px; width: 75%; outline: none !important; } 202 | .search input[type=button] { border: none; padding: 0; height: 40px; width: 25%; background-color: #428bca; color: #fff; border-radius: 4px; } 203 | .search input[type=button]:hover { background-color: #3276b1; } 204 | 205 | /*[24.tagcloud]*/ 206 | .tagcloud ul li { display: inline-block; margin: 1px; border: none; padding: 3px; } 207 | .tagcloud ul li A { padding: 3px; border-radius: 3px; } 208 | .tagcloud ul li A:hover { background: #0681ea; color: #fff; } 209 | .tagcloud ul li A.biggest { font-size: 120%; } 210 | .tagcloud ul li A.big { font-size: 110%; } 211 | .tagcloud ul li A.medium { font-size: 100%; } 212 | .tagcloud ul li A.small { font-size: 90%; } 213 | .tagcloud ul li A.smallest { font-size: 80%; } 214 | 215 | /*[25.archive-page]*/ 216 | .archive-page .archive-page-content h2 { font-size: 16px; height: 30px; line-height: 35px; font-weight: bold; } 217 | .archive-page .archive-page-content h2 img { margin: 0 3px; position: relative; top: -2px; } 218 | .archive-page ul { list-style-type: square; margin: 0 10px; padding: 10px; } 219 | .archive-page table { width: 100%; border-collapse: collapse; } 220 | .archive-page table th:first-child { width: 90px; } 221 | .archive-page table th { background: #F1F1F1; font-size: 14px; font-weight: bold; text-transform: uppercase; border: 1px solid #DDD; padding: 3px; text-align: center; } 222 | .archive-page table td { border: 1px solid #DDD; font-size: 14px; padding: 3px; } 223 | .archive-page .date { width: 90px; text-align: center; } 224 | .archive-page .comments { width: 70px; text-align: center; } 225 | .archive-page .rating { width: 70px; text-align: center; } 226 | 227 | /*[26.contact-page]*/ 228 | .contact-page { } 229 | .contact-page .required-field[style="visibility:hidden;"] { display: none; } 230 | 231 | /*[27.search-page]*/ 232 | .search-page .search-page-searchbox { background: #fff; padding: 3px; border-radius: 6px; border: 1px solid #CCC; margin-bottom: 15px; } 233 | .search-page .search-page-searchbox input[type=button] { float: right; width: 20%; border: none; height: 100%; padding: 8px 0; } 234 | .search-page .search-page-searchbox input[type=text] { border: none; width: 76%; border-radius: 3px; padding: 4px 1%; outline:none !important; } 235 | .search-page .searchresult { border-bottom: 1px dotted #CCC; padding: 10px 0; font-size: 14px; } 236 | .search-page .searchresult a { font-weight: normal; font-size: 16px; } 237 | .search-page .searchresult span.text { clear: both; line-height: 35px; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: #555; } 238 | .search-page .searchresult span.type { font-size: 13px; display: none; } 239 | .search-page .searchresult span.url { color: #00802a; } 240 | .search-page .searchpage ul.paging { list-style-type: none; margin: 20px auto; padding: 0px; text-align: center; display: block; } 241 | .search-page .searchpage ul.paging li { display: inline-block; width: 30px; text-align: center; height: 30px; border: 1px solid #CCC; background: #FFF; margin-right: 2px; } 242 | .search-page .searchpage ul.paging li a { display: block; height: 100%; line-height: 30px; } 243 | .search-page .searchpage ul.paging li.active { border-width: 1px; border-style: solid; } 244 | .search-page .searchpage ul.paging li.active A { color: #FFF; } 245 | 246 | /*[28.syntaxhighlighter]*/ 247 | .syntaxhighlighter { padding: 15px 3px; direction: ltr !important; } 248 | .syntaxhighlighter .alt1 { background: #d6ebff !important; } 249 | .syntaxhighlighter .line { font-size: 13px !important; line-height: 20px !important; background: #CCC !important; } 250 | .syntaxhighlighter .container textarea { font-size: 13px !important; line-height: 20px !important; } 251 | /*.syntaxhighlighter table td.code .container { top: -15px !important; }*/ 252 | 253 | /*[29.q-notes]*/ 254 | #q-notes { height: 0; } 255 | #q-notes .q-tab { height: 0; } 256 | #q-notes #q-toggle { padding: 0; width: 40px; height: 30px; text-align: center; background-color: #fff; border: 2px solid #DDD; border-top: none; position: relative; top: -2px; margin-right: 5px; z-index: 1000; } 257 | #q-notes #q-toggle a { padding: 0 !important; margin: 0 !important; float: none !important; } 258 | #q-notes * { -moz-border-radius: 0 !important; -webkit-border-radius: 0 !important; border-radius: 0 !important; } 259 | #q-notes input[type=text], 260 | #q-notes select { padding: 5px !important; width: 200px; } 261 | #q-notes #q-listbox { width: 100% !important; } 262 | #q-notes input[type=submit] { background-color: #428bca !important; color: #fff; border: none !important; font-weight: normal !important; border-radius: 3px !important; } 263 | #q-panel {height:180px ;} 264 | 265 | /*[30.footer]*/ 266 | .footer { background-color: #222; margin: 0; padding: 0; } 267 | .footer a { color: #AAA; } 268 | .footer .widgets-footer .widget { margin-right: 3%; width: 31.3%; float: left; background: none; color: #AAA; padding: 2% 0; box-shadow: none; } 269 | .footer .widgets-footer .widget .widget-header { border-color: #0681ea; border-width: 2px; } 270 | .footer .widgets-footer .widget ul li { border-color: #111; } 271 | .footer .widgets-footer .widget:last-child { margin: 0; } 272 | .footer .end-line { min-height: 50px; background-color: #111; line-height: 50px; text-transform: uppercase; font-size: 12px; } 273 | .footer .end-line p { margin: 0; color: #AAA; } 274 | 275 | /*[31.post-list]*/ 276 | .postList img { margin-right: 10px; float: left; } 277 | .postList a { display: inline-block; clear: both; } -------------------------------------------------------------------------------- /src/assets/scripts/jquery.fancybox.pack.js: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2 | (function(s,H,f,w){var K=f("html"),q=f(s),p=f(H),b=f.fancybox=function(){b.open.apply(this,arguments)},J=navigator.userAgent.match(/msie/i),C=null,t=H.createTouch!==w,u=function(a){return a&&a.hasOwnProperty&&a instanceof f},r=function(a){return a&&"string"===f.type(a)},F=function(a){return r(a)&&0
',image:'',iframe:'",error:'

The requested content cannot be loaded.
Please try again later.

',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, 6 | openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, 7 | isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=u(a)?f(a).get():[a]),f.each(a,function(e,c){var l={},g,h,k,n,m;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),u(c)?(l={href:c.data("fancybox-href")||c.attr("href"),title:f("
").text(c.data("fancybox-title")||c.attr("title")).html(),isDom:!0,element:c}, 8 | f.metadata&&f.extend(!0,l,c.metadata())):l=c);g=d.href||l.href||(r(c)?c:null);h=d.title!==w?d.title:l.title||"";n=(k=d.content||l.content)?"html":d.type||l.type;!n&&l.isDom&&(n=c.data("fancybox-type"),n||(n=(n=c.prop("class").match(/fancybox\.(\w+)/))?n[1]:null));r(g)&&(n||(b.isImage(g)?n="image":b.isSWF(g)?n="swf":"#"===g.charAt(0)?n="inline":r(c)&&(n="html",k=c)),"ajax"===n&&(m=g.split(/\s+/,2),g=m.shift(),m=m.shift()));k||("inline"===n?g?k=f(r(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):l.isDom&&(k=c): 9 | "html"===n?k=g:n||g||!l.isDom||(n="inline",k=c));f.extend(l,{href:g,type:n,content:k,title:h,selector:m});a[e]=l}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==w&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1===b.trigger("onCancel")||(b.hideLoading(),a&&(b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(), 10 | b.coming=null,b.current||b._afterZoomOut(a)))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&& 11 | (b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==w&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,l;c&&(l=b._getPosition(d),a&&"scroll"===a.type?(delete l.position,c.stop(!0,!0).animate(l,200)):(c.css(l),e.pos=f.extend({},e.dim,l)))}, 13 | update:function(a){var d=a&&a.originalEvent&&a.originalEvent.type,e=!d||"orientationchange"===d;e&&(clearTimeout(C),C=null);b.isOpen&&!C&&(C=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),C=null)},e&&!t?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,t&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"), 14 | b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}));b.trigger("onLoading")},getViewport:function(){var a=b.current&& 15 | b.current.locked||!1,d={x:q.scrollLeft(),y:q.scrollTop()};a&&a.length?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=t&&s.innerWidth?s.innerWidth:q.width(),d.h=t&&s.innerHeight?s.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&u(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(t?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c= 16 | e.which||e.keyCode,l=e.target||e.srcElement;if(27===c&&b.coming)return!1;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||l&&(l.type||f(l).is("[contenteditable]"))||f.each(d,function(d,l){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();0!==c&&!k&&1g||0>l)&&b.next(0>g?"up":"right"),d.preventDefault())}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&& 18 | b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,{},b.helpers[d].defaults,e),c)})}p.trigger(a)},isImage:function(a){return r(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return r(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=m(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c, 19 | c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"=== 20 | c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&t&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(t?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady"); 21 | if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width= 22 | this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming, 23 | d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",t?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);t||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload|| 24 | b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,l,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()); 25 | b.unbindEvents();e=a.content;c=a.type;l=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
").html(e).find(a.selector):u(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", 26 | !1)}));break;case "image":e=a.tpl.image.replace(/\{href\}/g,g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}u(e)&&e.parent().is(a.inner)||a.inner.append(e);b.trigger("beforeShow"); 27 | a.inner.css("overflow","yes"===l?"scroll":"no"===l?"hidden":l);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(!b.isOpened)f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();else if(d.prevMethod)b.transitions[d.prevMethod]();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,l=b.skin,g=b.inner,h=b.current,c=h.width,k=h.height,n=h.minWidth,v=h.minHeight,p=h.maxWidth, 28 | q=h.maxHeight,t=h.scrolling,r=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,z=m(y[1]+y[3]),s=m(y[0]+y[2]),w,A,u,D,B,G,C,E,I;e.add(l).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=m(l.outerWidth(!0)-l.width());w=m(l.outerHeight(!0)-l.height());A=z+y;u=s+w;D=F(c)?(a.w-A)*m(c)/100:c;B=F(k)?(a.h-u)*m(k)/100:k;if("iframe"===h.type){if(I=h.content,h.autoHeight&&1===I.data("ready"))try{I[0].contentWindow.document.location&&(g.width(D).height(9999),G=I.contents().find("body"),r&&G.css("overflow-x", 29 | "hidden"),B=G.outerHeight(!0))}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=m(D);k=m(B);E=D/B;n=m(F(n)?m(n,"w")-A:n);p=m(F(p)?m(p,"w")-A:p);v=m(F(v)?m(v,"h")-u:v);q=m(F(q)?m(q,"h")-u:q);G=p;C=q;h.fitToView&&(p=Math.min(a.w-A,p),q=Math.min(a.h-u,q));A=a.w-z;s=a.h-s;h.aspectRatio?(c>p&&(c=p,k=m(c/E)),k>q&&(k=q,c=m(k*E)),cA||z>s)&&c>n&&k>v&&!(19p&&(c=p,k=m(c/E)),g.width(c).height(k),e.width(c+y),a=e.width(),z=e.height();else c=Math.max(n,Math.min(c,c-(a-A))),k=Math.max(v,Math.min(k,k-(z-s)));r&&"auto"===t&&kA||z>s)&&c>n&&k>v;c=h.aspectRatio?cv&&k
').appendTo(d&&d.lenth?d:"body");this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay", 40 | function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){q.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%"); 41 | J?(b=Math.max(H.documentElement.offsetWidth,H.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>q.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&this.fixed&&b.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&f("*").filter(function(){return"fixed"=== 42 | f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=q.scrollTop(),this.scrollH=q.scrollLeft(),this.el.addClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float", 43 | position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(r(e)&&""!==f.trim(e)){d=f('
'+e+"
");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),J&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(m(d.css("margin-bottom")))}d["top"===a.position?"prependTo": 44 | "appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",l=function(g){var h=f(this).blur(),k=d,l,m;g.ctrlKey||g.altKey||g.shiftKey||g.metaKey||h.is(".fancybox-wrap")||(l=a.groupAttr||"data-fancybox-group",m=h.attr(l),m||(l="rel",m=h.get(0)[l]),m&&""!==m&&"nofollow"!==m&&(h=c.length?f(c):e,h=h.filter("["+l+'="'+m+'"]'),k=h.index(this)),a.index=k,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;c&&!1!==a.live?p.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')", 45 | "click.fb-start",l):e.unbind("click.fb-start").bind("click.fb-start",l);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===w&&(f.scrollbarWidth=function(){var a=f('
').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});f.support.fixedPosition===w&&(f.support.fixedPosition=function(){var a=f('
').appendTo("body"), 46 | b=20===a[0].offsetTop||15===a[0].offsetTop;a.remove();return b}());f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(s).width();K.addClass("fancybox-lock-test");d=f(s).width();K.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery); -------------------------------------------------------------------------------- /src/assets/scripts/blog.js: -------------------------------------------------------------------------------- 1 | // global object 2 | BlogEngine = { 3 | $: function (id) { 4 | return document.getElementById(id); 5 | } 6 | , 7 | setFlag: function (iso) { 8 | if (iso.length > 0) 9 | BlogEngine.comments.flagImage.src = BlogEngineRes.webRoot + "Content/images/blog/flags/" + iso + ".png"; 10 | else 11 | BlogEngine.comments.flagImage.src = BlogEngineRes.webRoot + "Content/images/blog/pixel.gif"; 12 | } 13 | , 14 | 15 | // Shows the preview of the comment 16 | showCommentPreview: function () { 17 | var oPreview = this.$('preview'); 18 | var oCompose = this.$('compose'); 19 | 20 | if (oPreview) oPreview.className = 'selected'; 21 | if (oCompose) oCompose.className = ''; 22 | this.$('commentCompose').style.display = 'none'; 23 | this.$('commentPreview').style.display = 'block'; 24 | this.$('commentPreview').innerHTML = 'Loading'; 25 | var argument = this.$('commentPreview').innerHTML; 26 | this.addComment(true); 27 | return false; 28 | } 29 | , 30 | composeComment: function () { 31 | var oPreview = this.$('preview'); 32 | var oCompose = this.$('compose'); 33 | 34 | if (oPreview) oPreview.className = ''; 35 | if (oCompose) oCompose.className = 'selected'; 36 | if (this.$('commentPreview')) { 37 | this.$('commentPreview').style.display = 'none'; 38 | } 39 | if (this.$('commentCompose')) { 40 | this.$('commentCompose').style.display = 'block'; 41 | } 42 | return false; 43 | } 44 | , 45 | endShowPreview: function (arg, context) { 46 | if (BlogEngine.$('commentPreview')) { 47 | BlogEngine.$('commentPreview').innerHTML = arg; 48 | } 49 | } 50 | , 51 | toggleCommentSavingIndicators: function (bSaving) { 52 | BlogEngine.$("btnSaveAjax").disabled = bSaving; 53 | BlogEngine.$("ajaxLoader").style.display = bSaving ? "inline" : "none"; 54 | BlogEngine.$("status").className = ""; 55 | BlogEngine.$("status").innerHTML = ""; 56 | if (!bSaving) { 57 | if (BlogEngine.$('commentPreview')) { 58 | BlogEngine.$('commentPreview').innerHTML = ""; 59 | } 60 | BlogEngine.composeComment(); 61 | } 62 | } 63 | , 64 | onCommentError: function (error, context) { 65 | BlogEngine.toggleCommentSavingIndicators(false); 66 | error = error || "Unknown error occurred."; 67 | var iDelimiterPos = error.indexOf("|"); 68 | if (iDelimiterPos > 0) { 69 | error = error.substr(0, iDelimiterPos); 70 | // Remove numbers from end of error message. 71 | while (error.length > 0 && error.substr(error.length - 1, 1).match(/\d/)) { 72 | error = error.substr(0, error.length - 1); 73 | } 74 | } 75 | 76 | if (document.getElementById('recaptcha_response_field')) { 77 | Recaptcha.reload(); 78 | } 79 | if (document.getElementById("spnSimpleCaptchaIncorrect")) document.getElementById("spnSimpleCaptchaIncorrect").style.display = "none"; 80 | 81 | alert("Sorry, the following error occurred while processing your comment:\n\n" + error); 82 | } 83 | , 84 | addComment: function (preview) { 85 | var isPreview = preview == true; 86 | if (!isPreview) { 87 | BlogEngine.toggleCommentSavingIndicators(true); 88 | this.$("status").innerHTML = BlogEngineRes.i18n.savingTheComment; 89 | } 90 | var author = BlogEngine.comments.nameBox.value; 91 | var email = BlogEngine.comments.emailBox.value; 92 | var content = BlogEngine.comments.contentBox.value; 93 | var captcha = BlogEngine.comments.captchaField.value; 94 | 95 | var website = BlogEngine.comments.websiteBox ? BlogEngine.comments.websiteBox.value : ""; 96 | var country = BlogEngine.comments.countryDropDown ? BlogEngine.comments.countryDropDown.value : ""; 97 | var notify = BlogEngine.$("cbNotify") ? BlogEngine.$("cbNotify").checked : false; 98 | var replyToId = BlogEngine.comments.replyToId ? BlogEngine.comments.replyToId.value : ""; 99 | 100 | var recaptchaResponseField = document.getElementById('recaptcha_response_field'); 101 | var recaptchaResponse = recaptchaResponseField ? recaptchaResponseField.value : ""; 102 | 103 | var recaptchaChallengeField = document.getElementById('recaptcha_challenge_field'); 104 | var recaptchaChallenge = recaptchaChallengeField ? recaptchaChallengeField.value : ""; 105 | 106 | var simpleCaptchaChallengeField = document.getElementById('simpleCaptchaValue'); 107 | var simpleCaptchaChallenge = simpleCaptchaChallengeField ? simpleCaptchaChallengeField.value : ""; 108 | 109 | var avatarInput = BlogEngine.$("avatarImgSrc"); 110 | var avatar = (avatarInput && avatarInput.value) ? avatarInput.value : ""; 111 | 112 | var callback = isPreview ? BlogEngine.endShowPreview : BlogEngine.appendComment; 113 | var argument = author + "-|-" + email + "-|-" + website + "-|-" + country + "-|-" + content + "-|-" + notify + "-|-" + isPreview + "-|-" + captcha + "-|-" + replyToId + "-|-" + avatar + "-|-" + recaptchaResponse + "-|-" + recaptchaChallenge + "-|-" + simpleCaptchaChallenge; 114 | 115 | WebForm_DoCallback(BlogEngine.comments.controlId, argument, callback, 'comment', BlogEngine.onCommentError, false); 116 | 117 | if (!isPreview && typeof (OnComment) != "undefined") 118 | OnComment(author, email, website, country, content); 119 | } 120 | , 121 | cancelReply: function () { 122 | this.replyToComment(''); 123 | } 124 | , 125 | replyToComment: function (id) { 126 | 127 | // set hidden value 128 | BlogEngine.comments.replyToId.value = id; 129 | 130 | // move comment form into position 131 | var commentForm = BlogEngine.$('comment-form'); 132 | if (!id || id == '' || id == null || id == '00000000-0000-0000-0000-000000000000') { 133 | // move to after comment list 134 | var base = BlogEngine.$("commentlist"); 135 | base.appendChild(commentForm); 136 | // hide cancel button 137 | BlogEngine.$('cancelReply').style.display = 'none'; 138 | } else { 139 | // show cancel 140 | BlogEngine.$('cancelReply').style.display = ''; 141 | 142 | // move to nested position 143 | var parentComment = BlogEngine.$('id_' + id); 144 | var replies = BlogEngine.$('replies_' + id); 145 | 146 | // add if necessary 147 | if (replies == null) { 148 | replies = document.createElement('div'); 149 | replies.className = 'comment-replies'; 150 | replies.id = 'replies_' + id; 151 | parentComment.appendChild(replies); 152 | } 153 | replies.style.display = ''; 154 | replies.appendChild(commentForm); 155 | } 156 | 157 | BlogEngine.comments.nameBox.focus(); 158 | } 159 | , 160 | appendComment: function (args, context) { 161 | if (context == "comment") { 162 | 163 | if (document.getElementById('recaptcha_response_field')) { 164 | Recaptcha.reload(); 165 | } 166 | if (document.getElementById("spnSimpleCaptchaIncorrect")) document.getElementById("spnSimpleCaptchaIncorrect").style.display = "none"; 167 | 168 | if (args == "RecaptchaIncorrect" || args == "SimpleCaptchaIncorrect") { 169 | if (document.getElementById("spnCaptchaIncorrect")) document.getElementById("spnCaptchaIncorrect").style.display = ""; 170 | if (document.getElementById("spnSimpleCaptchaIncorrect")) document.getElementById("spnSimpleCaptchaIncorrect").style.display = ""; 171 | BlogEngine.toggleCommentSavingIndicators(false); 172 | } 173 | else { 174 | 175 | 176 | if (document.getElementById("spnCaptchaIncorrect")) document.getElementById("spnCaptchaIncorrect").style.display = "none"; 177 | if (document.getElementById("spnSimpleCaptchaIncorrect")) document.getElementById("spnSimpleCaptchaIncorrect").style.display = "none"; 178 | 179 | var commentList = BlogEngine.$("commentlist"); 180 | if (commentList.innerHTML.length < 10) 181 | commentList.innerHTML = "

" + BlogEngineRes.i18n.comments + "

" 182 | 183 | // add comment html to the right place 184 | var id = BlogEngine.comments.replyToId ? BlogEngine.comments.replyToId.value : ''; 185 | 186 | if (id != '') { 187 | var replies = BlogEngine.$('replies_' + id); 188 | replies.innerHTML += args; 189 | } else { 190 | commentList.innerHTML += args; 191 | commentList.style.display = 'block'; 192 | } 193 | 194 | // reset form values 195 | BlogEngine.comments.contentBox.value = ""; 196 | BlogEngine.comments.contentBox = BlogEngine.$(BlogEngine.comments.contentBox.id); 197 | BlogEngine.toggleCommentSavingIndicators(false); 198 | BlogEngine.$("status").className = "success"; 199 | 200 | if (!BlogEngine.comments.moderation) 201 | BlogEngine.$("status").innerHTML = BlogEngineRes.i18n.commentWasSaved; 202 | else 203 | BlogEngine.$("status").innerHTML = BlogEngineRes.i18n.commentWaitingModeration; 204 | 205 | // move form back to bottom 206 | var commentForm = BlogEngine.$('comment-form'); 207 | commentList.appendChild(commentForm); 208 | // reset reply to 209 | if (BlogEngine.comments.replyToId) BlogEngine.comments.replyToId.value = ''; 210 | if (BlogEngine.$('cancelReply')) BlogEngine.$('cancelReply').style.display = 'none'; 211 | 212 | } 213 | } 214 | 215 | BlogEngine.$("btnSaveAjax").disabled = false; 216 | } 217 | , 218 | validateAndSubmitCommentForm: function () { 219 | 220 | if (BlogEngine.comments.nameBox.value.length < 1) { 221 | BlogEngine.$("status").innerHTML = "Required"; 222 | BlogEngine.$("status").className = "warning"; 223 | BlogEngine.$("txtName").focus(); 224 | return false; 225 | } 226 | if (BlogEngine.comments.emailBox.value.length < 1) { 227 | BlogEngine.$("status").innerHTML = "Required"; 228 | BlogEngine.$("txtEmail").focus(); 229 | return false; 230 | } 231 | if (BlogEngine.comments.contentBox.value.length < 1) { 232 | BlogEngine.$("status").innerHTML = "Required"; 233 | BlogEngine.$("txtContent").focus(); 234 | return false; 235 | } 236 | 237 | //var bBuiltInValidationPasses = Page_ClientValidate('AddComment'); 238 | //var bNameIsValid = BlogEngine.comments.nameBox.value.length > 0; 239 | 240 | //document.getElementById('spnNameRequired').style.display = bNameIsValid ? 'none' : ''; 241 | //var bAuthorNameIsValid = true; 242 | //if (BlogEngine.comments.checkName) { 243 | // var author = BlogEngine.comments.postAuthor; 244 | // var visitor = BlogEngine.comments.nameBox.value; 245 | // bAuthorNameIsValid = !this.equal(author, visitor); 246 | //} 247 | 248 | //document.getElementById('spnChooseOtherName').style.display = bAuthorNameIsValid ? 'none' : ''; 249 | //if (bBuiltInValidationPasses && bNameIsValid && bAuthorNameIsValid) { 250 | // BlogEngine.addComment(); 251 | // return true; 252 | //} 253 | 254 | BlogEngine.addComment(); 255 | return true; 256 | } 257 | 258 | , 259 | 260 | addBbCode: function (v) { 261 | try { 262 | var contentBox = BlogEngine.comments.contentBox; 263 | if (contentBox.selectionStart) // firefox 264 | { 265 | var pretxt = contentBox.value.substring(0, contentBox.selectionStart); 266 | var therest = contentBox.value.substr(contentBox.selectionEnd); 267 | var sel = contentBox.value.substring(contentBox.selectionStart, contentBox.selectionEnd); 268 | contentBox.value = pretxt + "[" + v + "]" + sel + "[/" + v + "]" + therest; 269 | contentBox.focus(); 270 | } 271 | else if (document.selection && document.selection.createRange) // IE 272 | { 273 | var str = document.selection.createRange().text; 274 | contentBox.focus(); 275 | var sel = document.selection.createRange(); 276 | sel.text = "[" + v + "]" + str + "[/" + v + "]"; 277 | } 278 | } 279 | catch (ex) { } 280 | 281 | return; 282 | } 283 | , 284 | // Searches the blog based on the entered text and 285 | // searches comments as well if chosen. 286 | search: function (root, searchfield) { 287 | if (!searchfield) { 288 | searchfield = 'searchfield'; 289 | } 290 | var input = this.$(searchfield); 291 | var check = this.$("searchcomments"); 292 | 293 | var searchPageExtension = typeof BlogEngineRes.fileExtension === "undefined" ? ".aspx" : BlogEngineRes.fileExtension; 294 | var search = "search" + searchPageExtension + "?q=" + encodeURIComponent(input.value); 295 | if (check != null && check.checked) 296 | search += "&comment=true"; 297 | 298 | top.location.href = root + search; 299 | 300 | return false; 301 | } 302 | , 303 | // Clears the search fields on focus. 304 | searchClear: function (defaultText, searchfield) { 305 | if (!searchfield) { 306 | searchfield = 'searchfield'; 307 | } 308 | var input = this.$(searchfield); 309 | if (input.value == defaultText) 310 | input.value = ""; 311 | else if (input.value == "") 312 | input.value = defaultText; 313 | } 314 | , 315 | rate: function (blogId, id, rating) { 316 | this.createCallback("rating.axd?id=" + id + "&rating=" + rating, BlogEngine.ratingCallback, blogId); 317 | } 318 | , 319 | ratingCallback: function (response) { 320 | var rating = response.substring(0, 1); 321 | var status = response.substring(1); 322 | 323 | if (status == "OK") { 324 | if (typeof OnRating != "undefined") 325 | OnRating(rating); 326 | 327 | alert(BlogEngineRes.i18n.ratingHasBeenRegistered); 328 | } 329 | else if (status == "HASRATED") { 330 | alert(BlogEngineRes.i18n.hasRated); 331 | } 332 | else { 333 | alert("An error occured while registering your rating. Please try again"); 334 | } 335 | } 336 | , 337 | /// 338 | /// Creates a client callback back to the requesting page 339 | /// and calls the callback method with the response as parameter. 340 | /// 341 | createCallback: function (url, callback, blogId) { 342 | var http = BlogEngine.getHttpObject(); 343 | http.open("GET", url, true); 344 | 345 | if (blogId && http.setRequestHeader) { 346 | http.setRequestHeader('x-blog-instance', blogId.toString()); 347 | } 348 | 349 | http.onreadystatechange = function () { 350 | if (http.readyState == 4) { 351 | if (http.responseText.length > 0 && callback != null) 352 | callback(http.responseText); 353 | } 354 | }; 355 | 356 | http.send(null); 357 | } 358 | , 359 | /// 360 | /// Creates a XmlHttpRequest object. 361 | /// 362 | getHttpObject: function () { 363 | if (typeof XMLHttpRequest != 'undefined') 364 | return new XMLHttpRequest(); 365 | 366 | try { 367 | return new ActiveXObject("Msxml2.XMLHTTP"); 368 | } 369 | catch (e) { 370 | try { 371 | return new ActiveXObject("Microsoft.XMLHTTP"); 372 | } 373 | catch (e) { } 374 | } 375 | 376 | return false; 377 | } 378 | , 379 | // Updates the calendar from client-callback 380 | updateCalendar: function (args, context) { 381 | var cal = BlogEngine.$('calendarContainer'); 382 | cal.innerHTML = args; 383 | BlogEngine.Calendar.months[context] = args; 384 | } 385 | , 386 | toggleMonth: function (year) { 387 | var monthList = BlogEngine.$("monthList"); 388 | var years = monthList.getElementsByTagName("ul"); 389 | for (i = 0; i < years.length; i++) { 390 | if (years[i].id == year) { 391 | var state = years[i].className == "open" ? "" : "open"; 392 | years[i].className = state; 393 | break; 394 | } 395 | } 396 | } 397 | , 398 | // Adds a trim method to all strings. 399 | equal: function (first, second) { 400 | var f = first.toLowerCase().replace(new RegExp(' ', 'gi'), ''); 401 | var s = second.toLowerCase().replace(new RegExp(' ', 'gi'), ''); 402 | return f == s; 403 | } 404 | , 405 | /*----------------------------------------------------------------------------- 406 | XFN HIGHLIGHTER 407 | -----------------------------------------------------------------------------*/ 408 | xfnRelationships: ['friend', 'acquaintance', 'contact', 'met' 409 | , 'co-worker', 'colleague', 'co-resident' 410 | , 'neighbor', 'child', 'parent', 'sibling' 411 | , 'spouse', 'kin', 'muse', 'crush', 'date' 412 | , 'sweetheart', 'me'] 413 | , 414 | // Applies the XFN tags of a link to the title tag 415 | hightLightXfn: function () { 416 | var content = BlogEngine.$('content'); 417 | if (content == null) 418 | return; 419 | 420 | var links = content.getElementsByTagName('a'); 421 | for (i = 0; i < links.length; i++) { 422 | var link = links[i]; 423 | var rel = link.getAttribute('rel'); 424 | if (rel && rel != "nofollow") { 425 | for (j = 0; j < BlogEngine.xfnRelationships.length; j++) { 426 | if (rel.indexOf(BlogEngine.xfnRelationships[j]) > -1) { 427 | link.title = 'XFN relationship: ' + rel; 428 | break; 429 | } 430 | } 431 | } 432 | } 433 | } 434 | , 435 | 436 | showRating: function (container, id, raters, rating, blogId) { 437 | var div = document.createElement('div'); 438 | div.className = 'rating'; 439 | 440 | var p = document.createElement('p'); 441 | div.appendChild(p); 442 | if (raters == 0) { 443 | p.innerHTML = BlogEngineRes.i18n.beTheFirstToRate; 444 | } 445 | else { 446 | p.innerHTML = BlogEngineRes.i18n.currentlyRated.replace('{0}', new Number(rating).toFixed(1)).replace('{1}', raters); 447 | } 448 | 449 | var ul = document.createElement('ul'); 450 | ul.className = 'star-rating small-star'; 451 | div.appendChild(ul); 452 | 453 | var li = document.createElement('li'); 454 | li.className = 'current-rating'; 455 | li.style.width = Math.round(rating * 20) + '%'; 456 | li.innerHTML = 'Currently ' + rating + '/5 Stars.'; 457 | ul.appendChild(li); 458 | 459 | for (var i = 1; i <= 5; i++) { 460 | var l = document.createElement('li'); 461 | var a = document.createElement('a'); 462 | a.innerHTML = i; 463 | a.href = 'rate/' + i; 464 | a.className = this.englishNumber(i); 465 | a.title = BlogEngineRes.i18n.rateThisXStars.replace('{0}', i.toString()).replace('{1}', i == 1 ? '' : 's'); 466 | a.rel = "nofollow"; 467 | a.onclick = function () { 468 | BlogEngine.rate(blogId, id, this.innerHTML); 469 | return false; 470 | }; 471 | 472 | l.appendChild(a); 473 | ul.appendChild(l); 474 | } 475 | 476 | container.innerHTML = ''; 477 | container.appendChild(div); 478 | container.style.visibility = 'visible'; 479 | } 480 | , 481 | 482 | applyRatings: function () { 483 | var divs = document.getElementsByTagName('div'); 484 | for (var i = 0; i < divs.length; i++) { 485 | if (divs[i].className == 'ratingcontainer') { 486 | var args = divs[i].innerHTML.split('|'); 487 | BlogEngine.showRating(divs[i], args[0], args[1], args[2], args[3]); 488 | } 489 | } 490 | }, 491 | 492 | englishNumber: function (number) { 493 | if (number == 1) 494 | return 'one-star'; 495 | 496 | if (number == 2) 497 | return 'two-stars'; 498 | 499 | if (number == 3) 500 | return 'three-stars'; 501 | 502 | if (number == 4) 503 | return 'four-stars'; 504 | 505 | return 'five-stars'; 506 | } 507 | , 508 | // Adds event to window.onload without overwriting currently assigned onload functions. 509 | // Function found at Simon Willison's weblog - http://simon.incutio.com/ 510 | addLoadEvent: function (func) { 511 | var oldonload = window.onload; 512 | if (typeof window.onload != 'function') { 513 | window.onload = func; 514 | } 515 | else { 516 | window.onload = function () { 517 | oldonload(); 518 | func(); 519 | } 520 | } 521 | } 522 | , 523 | filterByAPML: function () { 524 | var width = document.documentElement.clientWidth + document.documentElement.scrollLeft; 525 | var height = document.documentElement.clientHeight + document.documentElement.scrollTop; 526 | document.body.style.position = 'static'; 527 | 528 | var layer = document.createElement('div'); 529 | layer.style.zIndex = 2; 530 | layer.id = 'layer'; 531 | layer.style.position = 'absolute'; 532 | layer.style.top = '0px'; 533 | layer.style.left = '0px'; 534 | layer.style.height = document.documentElement.scrollHeight + 'px'; 535 | layer.style.width = width + 'px'; 536 | layer.style.backgroundColor = 'black'; 537 | layer.style.opacity = '.6'; 538 | layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=60)"); 539 | document.body.appendChild(layer); 540 | 541 | var div = document.createElement('div'); 542 | div.style.zIndex = 3; 543 | div.id = 'apmlfilter'; 544 | div.style.position = (navigator.userAgent.indexOf('MSIE 6') > -1) ? 'absolute' : 'fixed'; 545 | div.style.top = '200px'; 546 | div.style.left = (width / 2) - (400 / 2) + 'px'; 547 | div.style.height = '50px'; 548 | div.style.width = '400px'; 549 | div.style.backgroundColor = 'white'; 550 | div.style.border = '2px solid silver'; 551 | div.style.padding = '20px'; 552 | document.body.appendChild(div); 553 | 554 | var p = document.createElement('p'); 555 | p.innerHTML = BlogEngineRes.i18n.apmlDescription; 556 | p.style.margin = '0px'; 557 | div.appendChild(p); 558 | 559 | var form = document.createElement('form'); 560 | form.method = 'get'; 561 | form.style.display = 'inline'; 562 | form.action = BlogEngineRes.webRoot; 563 | div.appendChild(form); 564 | 565 | var textbox = document.createElement('input'); 566 | textbox.type = 'text'; 567 | textbox.value = BlogEngine.getCookieValue('url') || 'http://'; 568 | textbox.style.width = '320px'; 569 | textbox.id = 'txtapml'; 570 | textbox.name = 'apml'; 571 | textbox.style.background = 'url(' + BlogEngineRes.webRoot + 'Content/images/blog/apml.png) no-repeat 2px center'; 572 | textbox.style.paddingLeft = '16px'; 573 | form.appendChild(textbox); 574 | textbox.focus(); 575 | 576 | var button = document.createElement('input'); 577 | button.type = 'submit'; 578 | button.value = BlogEngineRes.i18n.filter; 579 | button.onclick = function () { location.href = BlogEngineRes.webRoot + '?apml=' + encodeURIComponent(BlogEngine.$('txtapml').value); }; 580 | form.appendChild(button); 581 | 582 | var br = document.createElement('br'); 583 | div.appendChild(br); 584 | 585 | var a = document.createElement('a'); 586 | a.innerHTML = BlogEngineRes.i18n.cancel; 587 | a.href = 'javascript:void(0)'; 588 | a.onclick = function () { document.body.removeChild(BlogEngine.$('layer')); document.body.removeChild(BlogEngine.$('apmlfilter')); document.body.style.position = ''; }; 589 | div.appendChild(a); 590 | } 591 | , 592 | getCookieValue: function (name) { 593 | var cookie = new String(document.cookie); 594 | 595 | if (cookie != null && cookie.indexOf('comment=') > -1) { 596 | var start = cookie.indexOf(name + '=') + name.length + 1; 597 | var end = cookie.indexOf('&', start); 598 | if (end > start && start > -1) 599 | return cookie.substring(start, end); 600 | } 601 | 602 | return null; 603 | } 604 | , 605 | test: function () { 606 | alert('test'); 607 | } 608 | , 609 | comments: { 610 | flagImage: null, 611 | contentBox: null, 612 | moderation: null, 613 | checkName: null, 614 | postAuthor: null, 615 | nameBox: null, 616 | emailBox: null, 617 | websiteBox: null, 618 | countryDropDown: null, 619 | captchaField: null, 620 | controlId: null, 621 | replyToId: null 622 | } 623 | }; 624 | 625 | BlogEngine.addLoadEvent(BlogEngine.hightLightXfn); 626 | 627 | // add this to global if it doesn't exist yet 628 | if (typeof ($) == 'undefined') 629 | window.$ = BlogEngine.$; 630 | 631 | // apply ratings after registerVariables. 632 | BlogEngine.addLoadEvent(BlogEngine.applyRatings); 633 | -------------------------------------------------------------------------------- /src/assets/scripts/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.0.2 by @fat and @mdo 3 | * Copyright 2013 Twitter, Inc. 4 | * Licensed under http://www.apache.org/licenses/LICENSE-2.0 5 | * 6 | * Designed and built with all the love in the world by @mdo and @fat. 7 | */ 8 | 9 | if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); --------------------------------------------------------------------------------