Skip to content

Commit

Permalink
Added cross-domain-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Plastiquewind committed Jan 17, 2018
1 parent bab0ba4 commit baa6ab2
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 7 deletions.
40 changes: 40 additions & 0 deletions app.d6ee7810cac7e6943ab8.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app.d6ee7810cac7e6943ab8.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<span>Загрузка...</span>
</div>
<script src="https://apis.google.com/js/api.js"></script>
<script type="text/javascript" src="/vendor.a344f66695cf6ad85514.js"></script><script type="text/javascript" src="/app.a344f66695cf6ad85514.js"></script></body>
<script type="text/javascript" src="/vendor.d6ee7810cac7e6943ab8.js"></script><script type="text/javascript" src="/app.d6ee7810cac7e6943ab8.js"></script></body>

</html>
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "youlikeapp",
"version": "1.0.1",
"version": "1.1.0",
"repository": {
"type": "git",
"url": "https://github.com/youlikeapp/youlikeapp.github.io"
},
"scripts": {
"build": "rimraf dist && webpack --bail --progress --profile --NODE_ENV=production",
"server": "webpack-dev-server --history-api-fallback --inline --hot --progress --NODE_ENV=dev",
"server": "webpack-dev-server --https --history-api-fallback --inline --hot --progress --NODE_ENV=dev",
"start": "npm run server"
},
"devDependencies": {
Expand All @@ -17,6 +17,7 @@
"@types/angular-cookies": "1.4.2",
"@types/angular-material": "1.1.39",
"@types/angular-resource": "1.5.6",
"@types/cross-storage": "^0.8.29",
"@types/es6-promise": "0.0.32",
"@types/gapi.auth2": "0.0.46",
"@types/gapi.client.youtube": "^3.0.0",
Expand Down Expand Up @@ -59,6 +60,7 @@
"angular-sanitize": "1.5.8",
"angular-socialshare": "^2.3.11",
"angular-ui-router": "1.0.0-beta.3",
"cross-storage": "^1.0.0",
"moment": "^2.20.1",
"query-string": "^5.0.1",
"toastr": "^2.1.4",
Expand Down
9 changes: 8 additions & 1 deletion src/app/components/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as angular from "angular";
import { CrossStorageHub, CrossStorageClient } from "cross-storage";
import { State, StateProvider, Ng1StateDeclaration } from "angular-ui-router";
import { MainComponent } from "./main.component";
import { NavService, NavItem } from "./../../common/nav/nav.service";
Expand All @@ -21,8 +22,14 @@ function runConfig(NavService: NavService): void {
label: "Восстановление",
icon: "thumb_up"
};
NavService.addNavItem(page);

NavService.addNavItem(page);
CrossStorageHub.init([
{
origin: /.*/,
allow: [ "get", "set", "del" ]
}
]);
}

const Main: ng.IModule = angular
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MainController implements ng.IComponentController {
}

public saveList(): void {
localStorage.videosList = this.videosList;
localStorage.videosList = JSON.stringify(this.videosList.split("\n"));

toastr.success("Список видео сохранён.");
}
Expand All @@ -119,7 +119,7 @@ class MainController implements ng.IComponentController {
}

public loadList(): void {
this.videosList = localStorage.videosList;
this.videosList = (<string[]>JSON.parse(localStorage.videosList)).join("\n");
this.videosListIsEmpty = false;
}

Expand Down
62 changes: 62 additions & 0 deletions vendor.d6ee7810cac7e6943ab8.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions vendor.d6ee7810cac7e6943ab8.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = (function makeWebpackConfig() {
path: isProd ? getPath("./") : getPath('./dist'),
filename: isProd ? '[name].[hash].js' : '[name].bundle.js',
chunkFilename: isProd ? '[name].[hash].js' : '[name].bundle.js',
publicPath: isProd ? '/' : 'http://localhost:8080/'
publicPath: isProd ? '/' : 'https://localhost:8080/'

};

Expand Down

0 comments on commit baa6ab2

Please sign in to comment.