Skip to content

Commit

Permalink
Merge pull request #24 from ssysm/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
ssysm committed Apr 15, 2018
2 parents c54ce52 + 44a0b4d commit f1343a8
Show file tree
Hide file tree
Showing 16 changed files with 2,491 additions and 1,049 deletions.
3,199 changes: 2,287 additions & 912 deletions client/package-lock.json

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starrysea-client",
"version": "1.0.8",
"version": "1.1.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -23,33 +23,33 @@
"@angular/platform-browser-dynamic": "^5.2.9",
"@angular/router": "^5.2.9",
"@angular/service-worker": "^5.2.9",
"bootstrap": "^4.0.0",
"core-js": "^2.5.4",
"bootstrap": "^4.1.0",
"core-js": "^2.5.5",
"jquery": "^3.3.1",
"popper.js": "^1.14.3",
"rxjs": "^5.5.8",
"rxjs": "^5.5.10",
"sweetalert": "^2.1.0",
"zone.js": "^0.8.25"
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/cli": "^1.7.3",
"@angular/cli": "^1.7.4",
"@angular/compiler-cli": "^5.2.9",
"@angular/language-service": "^5.2.9",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "^6.0.104",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^9.6.5",
"codelyzer": "^4.2.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"jasmine-core": "~3.1.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.2",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^1.0.0",
"protractor": "~5.3.1",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.8.1"
}
}
2 changes: 0 additions & 2 deletions client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {NotFoundComponent} from './view/partical/not-found/not-found.component';
import {HttpModule, BrowserXhr} from "@angular/http";
import {cros} from "./common/cros";
import {FooterComponent} from './view/partical/footer/footer.component';
import {VersionService} from "./service/version.service";
import {environment} from "../environments/environment";
import {SpinnerComponent} from './view/partical/spinner/spinner.component';
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
Expand All @@ -37,7 +36,6 @@ import {CookieService} from "./service/cookie.service";
ServiceWorkerModule.register('/ngsw-worker.js', {enabled: environment.production})
],
providers: [
VersionService,
LocaleService,
{
provide: BrowserXhr,
Expand Down
56 changes: 30 additions & 26 deletions client/src/app/service/locale.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Injectable } from '@angular/core';
import {CookieService} from "./cookie.service";
import {environment} from "../../environments/environment";
import {ActivatedRoute} from "@angular/router";

@Injectable()
export class LocaleService {

constructor(
private cookie:CookieService
private cookie:CookieService,
private router:ActivatedRoute
) { }

getUALang() : string{
Expand All @@ -29,32 +31,34 @@ export class LocaleService {
}
}

onInit():void{
if(this.cookie.getCookie("lang")===""&&!this.cookie.getCookie("auto_jump")){
this.saveLocale();
this.onInit();
}else{
if(this.cookie.getCookie("auto_jump")==="true"){
onInit():void {
if (window.location.pathname === '/') {
if (this.cookie.getCookie("lang") === "" && !this.cookie.getCookie("auto_jump")) {
this.saveLocale();
this.onInit();
} else {
if (this.cookie.getCookie("auto_jump") === "true") {

}
else {
switch (this.cookie.getCookie("lang")) {
case "en-us":
window.location.replace(environment.multiDomain.en);
this.cookie.setCookie("auto_jump", "true", 999);
break;
case "ja-jp":
window.location.replace(environment.multiDomain.jp);
this.cookie.setCookie("auto_jump", "true", 999);
break;
case "zh-cn":
window.location.replace(environment.multiDomain.cn);
this.cookie.setCookie("auto_jump", "true", 999);
break;
default:
window.location.replace(environment.multiDomain.en);
this.cookie.setCookie("auto_jump", "true", 999);
break;
}
else {
switch (this.cookie.getCookie("lang")) {
case "en-us":
window.location.replace(environment.multiDomain.en);
this.cookie.setCookie("auto_jump", "true", 999);
break;
case "ja-jp":
window.location.replace(environment.multiDomain.jp);
this.cookie.setCookie("auto_jump", "true", 999);
break;
case "zh-cn":
window.location.replace(environment.multiDomain.cn);
this.cookie.setCookie("auto_jump", "true", 999);
break;
default:
window.location.replace(environment.multiDomain.en);
this.cookie.setCookie("auto_jump", "true", 999);
break;
}
}
}
}
Expand Down
90 changes: 68 additions & 22 deletions client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<meta name="description" content="We Are Starry Sea Volunteers Association">
<meta name="keywords" content="Starrysea,星之海,星之海志愿者公会,Starry Sea,Starry Sea Volunteers Association">
<meta property="og:title" content="Starry Sea International"/>
<meta property="og:type" content="website" />
<meta property="og:image" content="/assets/icons/starrysea-512x512.png" />
<meta property="og:description" content="We Are Starry Sea Volunteers Association" />
<meta property="og:type" content="website"/>
<meta property="og:image" content="/assets/icons/starrysea-512x512.png"/>
<meta property="og:description" content="We Are Starry Sea Volunteers Association"/>
<meta property="og:site_name" content="Starry Sea Volunteers Association"/>
<meta name="robots" content="index, follow">
<!--PWA Setting-->
Expand All @@ -21,30 +21,76 @@
<meta name="msapplication-starturl" content="/">
<meta name="theme-color" content="#409cc3">
<link rel="manifest" href="/manifest.json">
<style>.splash{opacity: 0;position: fixed;height: 100%;width: 100%;margin-top: 15%;text-align: center;z-index: -1;font-family: Arial,"Times New Roman", sans-serif} app-root:empty + .splash {opacity: 1;z-index: 100;}</style>
<style>
.splash {
opacity: 0;
position: fixed;
height: 100%;
width: 100%;
margin-top: 15%;
text-align: center;
z-index: -1;
font-family: Arial, "Times New Roman", sans-serif
}

app-root:empty + .splash {
opacity: 1;
z-index: 100;
}

app-root:empty
</style>
<!-- Global site tag (gtag.js) - Google Analytics -->
<meta name="google-site-verification" content="BkGuw2UpVXrEkAGSZA4e4uSMjeWCylBq2oYogj_0ZSI" />
<meta name="google-site-verification" content="BkGuw2UpVXrEkAGSZA4e4uSMjeWCylBq2oYogj_0ZSI"/>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-113481030-1"></script>
<script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-113481030-1');</script>
<script>
window.dataLayer = window.dataLayer || [];

function gtag() {
dataLayer.push(arguments);
}

function isIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE '); // IE 10 or older
var trident = ua.indexOf('Trident/'); //IE 11

return (msie > 0 || trident > 0);
}

gtag('js', new Date());
gtag('config', 'UA-113481030-1');

window.onload = function () {
if (isIE()) {
document.write("<p>Sorry, your browser is not supported</p>" + "<p>抱歉,您的浏览器不受支持</p>" + "<p>申し訳ありません、ブラウザはサポートされていません</p>")
}
}
</script>
<!--Angular Routing-->
<base href="/">
</head>
<body>
<!--App Entry Point-->
<app-root></app-root>
<!--PWA Loading-->
<div class="splash">
<img src="/assets/img/starsea.png" alt="Starrysea Logo" style="width: 348px;height: auto;">
<h2>Starrysea International</h2>
<h3>Loading...</h3>
</div>
<!--No Script-->
<noscript>
<p>为了使用本网站的所有功能,您需要启用JavaScript。</p>
<p>For full functionality of this site it is necessary to enable JavaScript.</p>
<p>このWebサイトの全ての機能を利用するためにはJavaScriptを有効にする必要があります。</p>
<p>Para utilizar las funcionalidades completas de este sitio es necesario tener JavaScript habilitado.</p>
<p>Um den vollen Funktionsumfang dieser Webseite zu erfahren, benötigen Sie JavaScript.</p>
</noscript>
<!--App Entry Point-->
<app-root></app-root>
<!--PWA Loading-->
<div class="splash">
<img src="/assets/img/starsea.png" alt="Starrysea Logo" style="width: 348px;height: auto;">
<h2>Starrysea International</h2>
<h3>Loading...</h3>
</div>
<!--No Script-->
<noscript>
<p>为了使用本网站的所有功能,您需要启用JavaScript。</p>
<p>For full functionality of this site it is necessary to enable JavaScript.</p>
<p>このWebサイトの全ての機能を利用するためにはJavaScriptを有効にする必要があります。</p>
<p>Para utilizar las funcionalidades completas de este sitio es necesario tener JavaScript habilitado.</p>
<p>Pour accéder à toutes les fonctionnalités de ce site, vous devez activer JavaScript.</p>
<p>Um den vollen Funktionsumfang dieser Webseite zu erfahren, benötigen Sie JavaScript.</p>
<p>Для полной функциональности этого сайта необходимо включить JavaScript.</p>
<p>Per avere a disposizione tutte le funzionalità di questo sito è necessario abilitare Javascript.</p>
<p>เพื่อการใช้งานที่เต็มที่ของเว็บไซต์นี้ จำเป็นต้องเปิดการใช้งาน JavaScript</p>
<p> للحصول على الوظائف الكاملة لهذا الموقع من الضروري تمكين جافا سكريبت.</p>
</noscript>
</body>
</html>
3 changes: 2 additions & 1 deletion docs/content/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ POST /activity
`summary` | (必填) 活动简介
`endTime` | (必填) 结束时间
`cover` | (必填(*文件*)) 封面文件
`locale`| (必填)语言地区

#### Example response

Expand All @@ -41,7 +42,7 @@ POST /activity
按页面数和限制获取活动列表

```endpoint
GET /activity?page={页面数}&limit={限制数量}
GET /activity?page={页面数}&limit={限制数量}&locale={语言地区}
```

#### Example response
Expand Down
8 changes: 8 additions & 0 deletions docs/content/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ API主机地址: `api.starrysea.org`
活动静态文件地址: `api.starrysea.org/static/activity/`

作品静态文件地址: `api.starrysea.org/static/work/`

语言地区(默认en-us):

- en-us (英语)
- zh-cn (中文)
- ja-jp (日文)


2 changes: 2 additions & 0 deletions docs/content/qa.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ POST /qa/ask
属性 | 介绍
---|---
`question` | (必填) 提问的问题
`locale`| (必填)语言地区



#### Example Response
Expand Down
4 changes: 3 additions & 1 deletion docs/content/work.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ POST /work
`cover` | (必填(*文件*)) 封面文件
`pdf` | (必填(*文件*)) PDF文件
`images` | (必填(*文件*)) 图片文件,最多32张
`locale`| (必填)语言地区


#### Example response

Expand Down Expand Up @@ -48,7 +50,7 @@ POST /work
按页面数和限制获取作品列表

```endpoint
GET /work?page={页面数}&limit={限制数量}
GET /work?page={页面数}&limit={限制数量}&locale={语言地区}
```

#### Example response
Expand Down
9 changes: 3 additions & 6 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{
"name": "docbox",
"version": "1.0.9",
"description": "an api documentation website",
"name": "API Docs",
"version": "1.1.1",
"description": "Starrysea International API Docs",
"main": "index.js",
"scripts": {
"start": "budo src/index.js --serve=bundle.js --live",
"changelog": "standard-changelog -w CHANGELOG.md",
"test": "npm run test-unit && eslint src",
"test-unit": "mocha --compilers js:babel-register test",
"prerender": "babel src --out-dir lib && node lib/render.js",
"build": "browserify src/index.js | uglifyjs -c -m > bundle.js",
"release": "standard-version && git push --follow-tags origin master; npm publish"
},
"browserify": {
"transform": [
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starrysea",
"version": "1.0.8",
"version": "1.1.1",
"description": "新一代星之海官网",
"scripts": {
"test": "echo \"Welcome to Starrysea-NextGen Project!\" && exit 0",
Expand All @@ -21,7 +21,6 @@
"starrysea"
],
"author": "starrysea",
"license": "UNLICENSED",
"bugs": {
"url": "https://github.com/ssysm/starrysea-nextgen/issues"
},
Expand Down
Loading

0 comments on commit f1343a8

Please sign in to comment.