├── .babelrc ├── .eslintignore ├── .eslintrc ├── .eslintrc.js ├── .gitignore ├── README.md ├── build.js ├── dist ├── CapTube.user.js ├── HeatSync.user.js ├── MaskedWatch.user.js ├── MylistFilter.user.js ├── MylistPocket.user.js ├── WatchDump.user.js ├── ZenzaAdvancedSettings.user.js ├── ZenzaBlogPartsButton.user.js ├── ZenzaGamePad.user.js ├── ZenzaHLS.user.js ├── ZenzaWatch-dev.user.js ├── ZenzaWatch.user.js └── uQuery.user.js ├── gulpfile.babel.js ├── loader.html ├── make.bat ├── package.json ├── packages ├── components │ ├── .babelrc │ ├── dist │ │ └── main.js │ ├── mock │ │ ├── MatrixRankingData.js │ │ ├── StoryboardMockData.js │ │ ├── VideoInfoRawData.js │ │ ├── channelInfoData.js │ │ ├── commonsTreeData.js │ │ ├── config.js │ │ ├── deflistData.js │ │ ├── flapiMylistData.js │ │ ├── followeesData.js │ │ ├── mylistGroupData.js │ │ ├── mymylistData.js │ │ ├── nicorepoVideoData.js │ │ ├── recommendApiDeflistData.js │ │ ├── recommendApiMylistData.js │ │ ├── recommendApiSeriesData.js │ │ ├── recommentApiUserData.js │ │ ├── seriesInfoData.js │ │ ├── uploadedVideoData.js │ │ └── videoSearchData.js │ ├── package.json │ ├── src │ │ ├── dll.js │ │ ├── element │ │ │ ├── BaseCommandElement.js │ │ │ ├── DialogElement.js │ │ │ ├── NoWebComponent.js │ │ │ ├── OwnerInfoElement.js │ │ │ ├── RangeBarElement.js │ │ │ ├── SettingPanelElement.js │ │ │ ├── VideoItemElement.js │ │ │ ├── VideoListElement.js │ │ │ ├── VideoSearchFormElement.js │ │ │ └── VideoSeriesLabel.js │ │ ├── index.js │ │ ├── template.txt │ │ ├── test.html │ │ ├── test.js │ │ └── util │ │ │ ├── ZenzaDetector.js │ │ │ └── util.js │ └── webpack.config.js ├── lib │ └── src │ │ ├── Emitter.js │ │ ├── css │ │ ├── StyleSwitcher.js │ │ └── css.js │ │ ├── dom │ │ ├── ClassListWrapper.js │ │ ├── Clipboard.js │ │ ├── Fullscreen.js │ │ ├── MediaTimeline.js │ │ ├── VideoCaptureUtil.js │ │ ├── defineElement.js │ │ ├── domEvent.js │ │ ├── domUtil.js │ │ └── watchResize.js │ │ ├── infra │ │ ├── AntiPrototype-js.js │ │ ├── CacheStorage.js │ │ ├── CrossDomainGate.js │ │ ├── DataStorage.js │ │ ├── IndexedDbStorage.js │ │ ├── MediaSessionApi.js │ │ ├── ObjectObserver.js │ │ ├── Observable.js │ │ ├── RequestAnimationFrame.js │ │ ├── StorageWriter.js │ │ ├── bounce.js │ │ ├── dimport.js │ │ ├── env.js │ │ ├── netUtil.js │ │ ├── objUtil.js │ │ ├── sleep.js │ │ ├── speech.js │ │ └── workerUtil.js │ │ ├── message │ │ ├── gate.js │ │ └── messageUtil.js │ │ ├── nico │ │ ├── CommonsTreeLoader.js │ │ ├── GateAPI.js │ │ ├── IchibaLoader.js │ │ ├── LikeApi.js │ │ ├── MatrixRankingLoader.js │ │ ├── MylistApiLoader.js │ │ ├── NVApi.js │ │ ├── NVWatchCaller.js │ │ ├── NicoQuery.js │ │ ├── NicoRssLoader.js │ │ ├── NicoVideoApi.js │ │ ├── PlaybackPosition.js │ │ ├── RecommendAPILoader.js │ │ ├── StoryboardCacheDb.js │ │ ├── StoryboardInfoLoader.js │ │ ├── TagEditApi.js │ │ ├── ThreadLoader.js │ │ ├── ThumbInfoCacheDb.js │ │ ├── ThumbInfoLoader.js │ │ ├── UaaLoader.js │ │ ├── UploadedVideoApiLoader.js │ │ ├── VideoInfoLoader.js │ │ ├── VideoItemObserver.js │ │ ├── VideoSearch.js │ │ ├── VideoSessionWorker.js │ │ ├── WatchInfoCacheDb.js │ │ ├── loader.js │ │ ├── modernLazyload.js │ │ ├── nicoUtil.js │ │ └── parseThumbInfo.js │ │ ├── text │ │ ├── reg.js │ │ └── textUtil.js │ │ ├── uQuery.js │ │ └── ui │ │ ├── PopupMessage.js │ │ └── TextLabel.js └── zenza │ └── src │ ├── Playlist │ ├── PlayList.js │ ├── PlayListModel.js │ ├── PlayListSession.js │ ├── PlayListView.js │ ├── RelatedVideoList.js │ ├── VideoList.js │ ├── VideoListItem.js │ ├── VideoListItemView.js │ ├── VideoListModel.js │ └── VideoListView.js │ ├── ShortcutKeyEmitter.js │ ├── commentLayer │ ├── CommentLayer.js │ ├── CommentLayoutWorker.js │ ├── NicoChat.js │ ├── NicoChatCss3View.js │ ├── NicoChatFilter.js │ ├── NicoChatGroup.js │ ├── NicoChatGroupViewModel.js │ ├── NicoChatParseWorker.js │ ├── NicoChatViewModel.js │ ├── NicoComment.js │ ├── NicoCommentCss3PlayerView.js │ ├── NicoCommentViewModel.js │ ├── NicoScripter.js │ ├── NicoTextParser.js │ ├── OffscreenLayer.js │ └── SlotLayoutWorker.js │ ├── heatMap │ └── HeatMapWorker.js │ ├── init │ ├── MylistPocketDetector.js │ ├── PlayerSession.js │ ├── WatchPageHistory.js │ ├── inintCssProps.js │ └── replaceRedirectLinks.js │ ├── menu │ └── HoverMenu.js │ ├── parts │ ├── BaseViewComponent.js │ ├── CustomElements.js │ ├── FrameLayer.js │ └── saveMymemory.js │ ├── storyboard │ ├── SeekBarThumbnail.js │ ├── Storyboard.js │ ├── StoryboardInfoModel.js │ ├── StoryboardView.js │ └── StoryboardWorker.js │ └── videoPlayer │ ├── YouTubeWrapper.js │ └── createVideoElement.js ├── sample ├── 1342524674-mikusan.html ├── 765Pro!.html ├── CA-TEST.html ├── CA-TEST2.html ├── CA-TEST3.html ├── CA-TEST4.html ├── CA_TEST.playlist.json ├── FontTest.html └── capture-test.html ├── src ├── CommentInputPanel.js ├── CommentPanel.js ├── CommentPlayer.js ├── Config.js ├── GinzaSlayer.js ├── NicoVideoPlayer.js ├── NicoVideoPlayerDialog.js ├── RootDispatcher.js ├── SettingPanel.js ├── State.js ├── StoryBoard.js ├── TagListView.js ├── VideoControlBar.js ├── VideoInfo.js ├── VideoInfoPanel.js ├── ZenzaWatchIndex.js ├── _blog.js ├── _captube.js ├── _gamepad.js ├── _heatsync.js ├── _hls.js ├── _jshintrc ├── _my4.js ├── _pocket.js ├── _setting.js ├── _shape.js ├── _template.js ├── _uquery.js ├── baselib.js ├── boot.js ├── browser.js ├── constant.js ├── initializer.js ├── util.js └── yomi │ ├── Shuriken.js │ └── YomiPage.js ├── test ├── baselibTest.js ├── browser │ ├── index.html │ ├── index.js │ ├── index.user.js │ └── utilTest.js ├── fixtures │ └── VideoInfoRawData.json ├── mocha.opts ├── setup.js └── unit │ ├── NicoScripterTest.js │ ├── StoryboardTest.js │ ├── VideoInfoTest.js │ ├── VideoSearchTest.js │ ├── baselibTest.js │ └── utilTest.js └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | // "es2015" 4 | // ["@babel/preset-env", { 5 | // "targets": { 6 | // "browsers": "last 2 Chrome versions", 7 | // "node": "current" 8 | // } 9 | // }] 10 | ], 11 | "env": { 12 | "test": { 13 | "presets": [ 14 | [ 15 | "es2015" 16 | ] 17 | ] 18 | }, 19 | "development": { 20 | "presets": [ 21 | [ 22 | "@babel/preset-env", 23 | { 24 | "targets": { 25 | "browsers": "Chrome 52", 26 | "node": "current" 27 | } 28 | } 29 | ] 30 | ] 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .eslintignore.js 2 | *.user.js 3 | gulpfile.babel.js 4 | build.js 5 | webpack.config.js 6 | lib/* 7 | ZenzaWatch.user\ *.js 8 | dist/* 9 | *-dev.user.js -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true, 5 | "moocha": true, 6 | "node6": true 7 | }, 8 | "parserOptions": { 9 | "sourceType": "module", 10 | "ecmaVersion": 2019 11 | }, 12 | "globals": { 13 | "jQuery": false, 14 | "$": false, 15 | "WatchApp": false, 16 | "WatchJsApi": false, 17 | "unsafeWindow": false, 18 | "GM_setValue": false, 19 | "GM_getValue": false, 20 | "GM_xmlhttpRequest": false, 21 | "self": true, 22 | "PRODUCT": true, 23 | "TOKEN": true, 24 | "global": true, 25 | "globalThis": true 26 | } 27 | } -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | "extends": "eslint:recommended", 7 | // "parser": "babel-eslint", 8 | "parserOptions": { 9 | "sourceType": "module", 10 | "ecmaVersion": 2018 11 | }, 12 | "rules": { 13 | "indent": [ 14 | 0, //"warn", // "error", 15 | 2, 16 | {"SwitchCase": 1} 17 | ], 18 | "linebreak-style": [ 19 | "error", 20 | "unix" 21 | ], 22 | "quotes": [ 23 | "error", 24 | "single" 25 | ], 26 | "semi": [ 27 | "error", 28 | "always" 29 | ], 30 | "no-unused-vars": 1, 31 | "no-console": 0, 32 | "no-extra-boolean-cast": 0, 33 | "no-empty": 1, 34 | "no-var": 1 35 | }, 36 | "globals": { 37 | "_": true, 38 | "$": true, 39 | "describe": true, 40 | "it": true, 41 | "beforeEach": true, 42 | "global": true, 43 | "globalThis": true, 44 | "jQuery": true, 45 | "SharedArrayBuffer": true, 46 | "Atomics": true, 47 | "CSSUnitValue": true, 48 | "CSSImageValue": true, 49 | "CSSStyleValue": true, 50 | "CSSKeywordValue": true 51 | } 52 | }; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | setting.json 2 | *cp.sh* 3 | .jshintrc 4 | *.swp 5 | *.bk 6 | *.lnk 7 | ./test.js 8 | ZenzaWatch.user\ *.js 9 | .DS_Store 10 | *.lnk 11 | node_modules/ 12 | .gitkeep 13 | session/* 14 | .idea/* 15 | ./lib/* 16 | ./botsu/* 17 | package-lock.json -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZenzaWatch 2 | 3 | Ginzaから独立して単体で動くHTML5版ニコニコ動画プレイヤーです。 4 | Greasemonkeyスクリプトとして動作します。 5 | 6 | 配布はこちら。 7 | https://greasyfork.org/ja/scripts/14391-zenzawatch 8 | 9 | 10 | # ライセンス 11 | 12 | 特に権利を主張する気はないので、こっちに迷惑かけなければ勝手に使ってください。 13 | 作者名の表記もしなくていいです。 14 | 15 | -------------------------------------------------------------------------------- /dist/WatchDump.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name WatchDump 3 | // @namespace https://github.com/segabito/ 4 | // @description 動画データをコンソールにダンプする. デバッグ用のヘルパー 5 | // @include http://*.nicovideo.jp/watch/* 6 | // @version 0.1 7 | // @grant none 8 | // ==/UserScript== 9 | 10 | (function() { 11 | var monkey = (function() { 12 | 'use strict'; 13 | class Util { 14 | static parseQuery(query) { 15 | const result = {}; 16 | query.split('&').forEach(item => { 17 | const sp = item.split('='); 18 | const key = decodeURIComponent(sp[0]); 19 | const val = decodeURIComponent(sp.slice(1).join('=')); 20 | result[key] = val; 21 | }); 22 | return result; 23 | } 24 | } 25 | 26 | 27 | (function() { 28 | const container = document.getElementById('watchAPIDataContainer'); 29 | if (!container) { return; } 30 | console.info('%cver GINZA', 'font-size: 150%;'); 31 | 32 | const data = JSON.parse(container.textContent); 33 | 34 | const flvInfo = Util.parseQuery(decodeURIComponent(data.flashvars.flvInfo)); 35 | const dmcInfo = JSON.parse(decodeURIComponent(data.flashvars.dmcInfo || '{}')); 36 | 37 | window.watchData = { 38 | data, 39 | flvInfo, 40 | dmcInfo 41 | }; 42 | console.log('watchData:', window.watchData); 43 | })(); 44 | 45 | (function() { 46 | const container = document.getElementById('js-initial-watch-data'); 47 | if (!container) { return; } 48 | console.info('%cver HTML5', 'font-size: 150%;'); 49 | const data = JSON.parse(container.getAttribute('data-api-data')); 50 | const env = JSON.parse(document.getElementById('js-initial-watch-data').getAttribute('data-environment')); 51 | 52 | window.watchData = { 53 | data, 54 | env, 55 | dmcInfo: data.video.dmcInfo 56 | }; 57 | console.log('watchData:', window.watchData); 58 | })(); 59 | 60 | }); 61 | 62 | var script = document.createElement('script'); 63 | script.id = 'WatchDumpLoader'; 64 | script.setAttribute('type', 'text/javascript'); 65 | script.setAttribute('charset', 'UTF-8'); 66 | script.appendChild(document.createTextNode('(' + monkey + ')()')); 67 | document.body.appendChild(script); 68 | 69 | })(); 70 | -------------------------------------------------------------------------------- /dist/ZenzaBlogPartsButton.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name ZenzaBlogPartsButton 3 | // @namespace https://github.com/segabito/ 4 | // @description ニコニコ動画のブログパーツにZenzaWatch起動用ボタンを追加 5 | // @match *://ext.nicovideo.jp/thumb/* 6 | // @grant none 7 | // @author segabito macmoto 8 | // @license public domain 9 | // @version 0.0.3 10 | // ==/UserScript== 11 | /* eslint-disable */ 12 | 13 | 14 | (window => { 15 | const addStyle = (styles, id) => { 16 | const elm = document.createElement('style'); 17 | elm.type = 'text/css'; 18 | if (id) { elm.id = id; } 19 | elm.append(styles); 20 | document.head.append(elm); 21 | return elm; 22 | }; 23 | 24 | const postMessage = (type, message, token) => { 25 | const origin = document.referrer; 26 | const {command, watchId} = message; 27 | try { 28 | parent.postMessage(JSON.stringify({ // 互換のため冗長 29 | id: 'ZenzaWatch', 30 | type, 31 | token, 32 | body: { 33 | token, 34 | url: location.href, 35 | message: {command, watchId}, 36 | command: 'message', params: { 37 | command, params: { watchId } 38 | } 39 | } 40 | }), 41 | origin); 42 | } catch (e) { 43 | alert(e); 44 | console.log('err', e); 45 | } 46 | }; 47 | 48 | const __css__ = (` 49 | #zenzaButton { 50 | position: fixed; 51 | left: 0; 52 | top: 0; 53 | z-index: 10000; 54 | line-height: 24px; 55 | padding: 4px 4px; 56 | cursor: pointer; 57 | font-weight: bolder; 58 | display: none; 59 | } 60 | body:hover #zenzaButton { 61 | display: inline-block; 62 | } 63 | `).trim(); 64 | 65 | const blogPartsApi = () => { 66 | const [watchId] = location.href.split('/').reverse(); 67 | 68 | const [,,parentHost] = document.referrer.split('/'); 69 | if (!parentHost.endsWith('.nicovideo.jp')) { 70 | window.console.log('disable bridge'); 71 | return; 72 | } 73 | 74 | addStyle(__css__); 75 | const button = document.createElement('button'); 76 | button.innerHTML = 'Zen'; 77 | button.id = 'zenzaButton'; 78 | document.body.append(button); 79 | button.onclick = e => { 80 | postMessage('blogParts', { 81 | command: e.shiftKey ? 'send' : 'open', 82 | watchId 83 | }); 84 | }; 85 | }; 86 | 87 | blogPartsApi(); 88 | })(globalThis ? globalThis.window : window); 89 | -------------------------------------------------------------------------------- /gulpfile.babel.js: -------------------------------------------------------------------------------- 1 | import gulp from 'gulp'; 2 | import mocha from 'gulp-mocha'; 3 | import 'espower-babel/guess'; 4 | 5 | gulp.task('test', () => { 6 | gulp.src('./test/**/*Test.js').pipe(mocha()); 7 | }); 8 | -------------------------------------------------------------------------------- /loader.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loader 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /make.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem make.bat 3 | node build.js 4 | 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ZenzaWatch", 3 | "description": "niconico HTML5 Player", 4 | "version": "0.0.0", 5 | "author": "segabito", 6 | "bugs": { 7 | "url": "https://github.com/segabito/ZenzaWatch/issues" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": { 11 | "@babel/cli": "^7.4.4", 12 | "@babel/core": "^7.4.5", 13 | "@babel/preset-env": "^7.4.5", 14 | "@babel/preset-es2015": "^7.0.0-beta.42", 15 | "@babel/register": "^7.0.0-beta.42", 16 | "babel-cli": "^6.26.0", 17 | "babel-core": "^6.26.0", 18 | "babel-eslint": "^8.2.2", 19 | "babel-loader": "^8.0.4", 20 | "babel-plugin-syntax-dynamic-import": "^6.18.0", 21 | "babel-polyfill": "^6.26.0", 22 | "babel-preset-env": "^1.6.1", 23 | "babel-preset-es2015": "^6.24.1", 24 | "babel-preset-power-assert": "^2.0.0", 25 | "babel-preset-stage-3": "^6.24.1", 26 | "babel-register": "^6.26.0", 27 | "emitter": "0.0.5", 28 | "eslint": "^4.19.0", 29 | "eslint-config-google": "^0.9.1", 30 | "eslint-config-standard": "^11.0.0", 31 | "eslint-plugin-import": "^2.9.0", 32 | "eslint-plugin-node": "^6.0.1", 33 | "eslint-plugin-promise": "^3.7.0", 34 | "eslint-plugin-standard": "^3.0.1", 35 | "espower-babel": "^4.0.3", 36 | "event-emitter": "^0.3.5", 37 | "gulp": "^3.9.0", 38 | "gulp-concat": "^2.6.1", 39 | "gulp-mocha": "^2.2.0", 40 | "intelli-espower-loader": "^1.0.1", 41 | "jquery": "^3.3.1", 42 | "jsdom": "^11.6.2", 43 | "lit-html": "^1.1.0", 44 | "lodash": "^4.17.5", 45 | "mocha": "^3.5.3", 46 | "mock-local-storage": "^1.0.5", 47 | "node-notifier": "^5.4.0", 48 | "power-assert": "^1.4.4", 49 | "sinon": "^1.17.7", 50 | "uglify-save-license": "^0.4.1", 51 | "webpack": "^4.27.1", 52 | "webpack-cli": "^3.1.2", 53 | "webpack-dev-server": "^3.1.10" 54 | }, 55 | "directories": { 56 | "test": "test/" 57 | }, 58 | "files": [ 59 | "README.MD", 60 | "package.json", 61 | "lib", 62 | "test" 63 | ], 64 | "homepage": "https://github.com/segabito/ZenzaWatch", 65 | "keywords": [ 66 | "ES6", 67 | "test" 68 | ], 69 | "license": "MIT", 70 | "main": "src/ZenzaWatchIndex.js", 71 | "repository": { 72 | "type": "git", 73 | "url": "git://github.com/segabito/ZenzaWatch.git" 74 | }, 75 | "scripts": { 76 | "build": "NODE_ENV=development babel src --out-dir lib --compilers js:@babel/register --source-maps", 77 | "watch": "NODE_ENV=development babel src --out-dir lib --compilers js:@babel/register --source-maps inline --watch", 78 | "test": "NODE_ENV=test mocha --require ./test/setup.js test/**/unit/*.js", 79 | "test:browser": "webpack-dev-server --inline", 80 | "build:production": "node ./build.js", 81 | "build:monkey": "node ./build.js --dev", 82 | "watch:monkey": "node ./build.js --dev --watch" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /packages/components/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "test": { 4 | "presets": [ 5 | [ 6 | "es2015" 7 | ] 8 | ] 9 | }, 10 | "development": { 11 | "plugins": [ 12 | "dynamic-import-webpack" 13 | ], 14 | "presets": [ 15 | ] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /packages/components/mock/channelInfoData.js: -------------------------------------------------------------------------------- 1 | // https://public.api.nicovideo.jp/v1/channels.json?channelIds=2632720&responseGroup=detail 2 | 3 | export const channelInfoData = { 4 | 'meta': { 5 | 'status': 200 6 | }, 7 | 'data': [ 8 | { 9 | 'id': 2632720, 10 | 'name': 'dアニメストア ニコニコ支店', 11 | 'description': '「dアニメストア ニコニコ支店」は1,500以上のアニメ作品が月額432円(税込)の定額で見放題!\r\nテレビで放送中の最新のアニメから定番アニメまで幅広い作品をコメントつきで楽しめます。', 12 | 'isFree': false, 13 | 'screenName': 'danime', 14 | 'ownerName': '株式会社NTTドコモ', 15 | 'price': 432, 16 | 'bodyPrice': 400, 17 | 'url': 'https://ch.nicovideo.jp/danime', 18 | 'thumbnailUrl': 'https://secure-dcdn.cdn.nimg.jp/comch/channel-icon/128x128/ch2632720.jpg?1561107667', 19 | 'thumbnailSmallUrl': 'https://secure-dcdn.cdn.nimg.jp/comch/channel-icon/64x64/ch2632720.jpg?1561107667', 20 | 'canAdmit': true, 21 | 'isAdult': false, 22 | 'detail': { 23 | 'tags': [ 24 | { 25 | 'text': 'dアニメストア' 26 | }, 27 | { 28 | 'text': 'アニメ' 29 | }, 30 | { 31 | 'text': 'ドコモ' 32 | }, 33 | { 34 | 'text': 'ニコニコ支店' 35 | } 36 | ], 37 | 'category': { 38 | 'categoryId': 7, 39 | 'categoryName': 'アニメ', 40 | 'categoryTopPageUrl': 'https://ch.nicovideo.jp/portal/anime' 41 | } 42 | } 43 | } 44 | ] 45 | }; -------------------------------------------------------------------------------- /packages/components/mock/commonsTreeData.js: -------------------------------------------------------------------------------- 1 | // https://api.commons.nicovideo.jp/tree/summary/get?id=sm33824596&limit=200&callback=jsonp_1561173348292_76356 2 | 3 | 4 | export const commonsTreeData = { 5 | 'countparent': '8', 6 | 'countchild': '2', 7 | 'parent': [ 8 | { 9 | 'thumbnail': 'http://deliver.commons.nicovideo.jp/thumbnail/nc159942', 10 | 'registered_date': '2018-09-08 22:00:48', 11 | 'parentid': 'nc159942', 12 | 'url': 'http://commons.nicovideo.jp/material/nc159942', 13 | 'title': 'けものフレンズシーンチェンジっぽいものBB音あり' 14 | }, 15 | { 16 | 'thumbnail': 'http://commons.nicovideo.jp/images/base/128_128/audio00.gif', 17 | 'registered_date': '2018-09-08 22:00:48', 18 | 'parentid': 'nc162639', 19 | 'url': 'http://commons.nicovideo.jp/material/nc162639', 20 | 'title': 'けものフレンズ シーン切り替え効果音(短)' 21 | }, 22 | { 23 | 'thumbnail': 'http://tn.smilevideo.jp/smile?i=33416354', 24 | 'registered_date': '2018-09-08 22:00:48', 25 | 'parentid': 'sm33416354', 26 | 'url': 'https://www.nicovideo.jp/watch/sm33416354', 27 | 'title': '【演奏してみた】けものフレンズから「ぼくのフレンド」【インスト】' 28 | }, 29 | { 30 | 'thumbnail': 'http://tn.smilevideo.jp/smile?i=33085187', 31 | 'registered_date': '2018-09-08 22:00:48', 32 | 'parentid': 'sm33085187', 33 | 'url': 'https://www.nicovideo.jp/watch/sm33085187', 34 | 'title': 'コメントアートを見てみよう ~けもフレ編~' 35 | }, 36 | { 37 | 'thumbnail': 'http://tn.smilevideo.jp/smile?i=31142913', 38 | 'registered_date': '2018-09-08 22:00:48', 39 | 'parentid': 'sm31142913', 40 | 'url': 'https://www.nicovideo.jp/watch/sm31142913', 41 | 'title': 'けもフレ1話コメントアートまとめ' 42 | }, 43 | { 44 | 'thumbnail': 'http://tn.smilevideo.jp/smile?i=31070870', 45 | 'registered_date': '2018-09-08 22:00:48', 46 | 'parentid': 'sm31070870', 47 | 'url': 'https://www.nicovideo.jp/watch/sm31070870', 48 | 'title': 'けものフレンズ コメントアート解説!!' 49 | }, 50 | { 51 | 'thumbnail': 'http://tn.smilevideo.jp/smile?i=32537080', 52 | 'registered_date': '2018-09-09 09:02:04', 53 | 'parentid': 'so30413239', 54 | 'url': 'https://www.nicovideo.jp/watch/so30413239', 55 | 'title': 'けものフレンズ 1話「さばんなちほー」' 56 | }, 57 | { 58 | 'thumbnail': 'http://tn.smilevideo.jp/smile?i=33835370', 59 | 'registered_date': '2018-09-13 17:47:00', 60 | 'parentid': 'sm33835370', 61 | 'url': 'https://www.nicovideo.jp/watch/sm33835370', 62 | 'title': 'けものフレンズでコメントアート(動画キャプチャー版)' 63 | } 64 | ] 65 | }; -------------------------------------------------------------------------------- /packages/components/mock/config.js: -------------------------------------------------------------------------------- 1 | 2 | const config = { 3 | setValue: function(key, value) { 4 | sessionStorage.setItem(key, JSON.stringify(value)); 5 | }, 6 | getValue: function(key, value) { 7 | return JSON.parse(sessionStorage.getItem(key)); 8 | } 9 | 10 | }; 11 | 12 | 13 | export {config}; -------------------------------------------------------------------------------- /packages/components/mock/followeesData.js: -------------------------------------------------------------------------------- 1 | // https://public.api.nicovideo.jp/v1/user/followees/niconico-users/${userId}.json 2 | 3 | export const followeesData = { 4 | 'meta': { 5 | 'status': 200 6 | }, 7 | 'data': { 8 | 'following': false 9 | } 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /packages/components/mock/seriesInfoData.js: -------------------------------------------------------------------------------- 1 | const seriesInfoData = { 2 | 'id': 16189, 3 | 'title': 'オリとくらやみの森', 4 | 'thumbnailUrl': 'https://dcdn.cdn.nimg.jp/nicovideo/series/tmb/0/1472081/16189.1560497466', 5 | 'createdAt': '2019-06-14T16:27:59+09:00', 6 | 'updatedAt': '2019-06-14T16:31:20+09:00' 7 | }; -------------------------------------------------------------------------------- /packages/components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@zenza/components", 3 | "version": "1.0.0", 4 | "description": "Custom Elements", 5 | "main": "src/index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "cross-env NODE_ENV=development webpack", 9 | "build:production": "cross-env NODE_ENV=production webpack", 10 | "watch": "cross-env NODE_ENV=development webpack --watch", 11 | "start": "cross-env NODE_ENV=development webpack-dev-server" 12 | }, 13 | "author": "guest", 14 | "license": "MIT", 15 | "devDependencies": { 16 | "@babel/core": "^7.2.0", 17 | "@babel/preset-env": "^7.2.0", 18 | "babel-loader": "^8.0.4", 19 | "cross-env": "^5.2.0", 20 | "dynamic-cdn-webpack-plugin": "^4.0.0", 21 | "lit-html": "^0.14.0", 22 | "module-to-cdn": "^3.1.2", 23 | "uglify-save-license": "^0.4.1", 24 | "webpack": "^4.27.1", 25 | "webpack-cli": "^3.1.2", 26 | "webpack-dev-server": "^3.1.10" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/components/src/dll.js: -------------------------------------------------------------------------------- 1 | import * as lit from 'https://unpkg.com/lit-html?module'; 2 | import {repeat} from 'https://unpkg.com/lit-html/directives/repeat?module'; 3 | import {classMap} from 'https://unpkg.com/lit-html/directives/class-map?module'; 4 | 5 | const dll = { directives: {}}; 6 | //===BEGIN=== 7 | dll.lit = lit; 8 | dll.directives.repeat = repeat; 9 | dll.directives.classMap = classMap; 10 | //===END=== 11 | export {dll}; -------------------------------------------------------------------------------- /packages/components/src/element/NoWebComponent.js: -------------------------------------------------------------------------------- 1 | 2 | //===BEGIN=== 3 | //