This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const fs = require('fs'); | |
| const dir = './src/diff'; | |
| fs.readdir(dir, function(err, files){ | |
| if(err){ | |
| throw err; | |
| } | |
| files.forEach(function(file){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default () => { | |
| const ua = window.navigator.userAgent.toLowerCase(); | |
| const obj = {}; | |
| //ieかどうか判定 | |
| obj.isIE = (ua.indexOf('msie') >= 0 || ua.indexOf('trident') >= 0); | |
| //firefoxかどうかの判定 | |
| obj.isFirefox = (ua.indexOf('firefox') >= 0); | |
| //chromeかどうかの判定 | |
| obj.isChrome = (ua.indexOf('chrome') >= 0); | |
| //safariかどうかの判定 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class { | |
| constructor() { | |
| this.flg = false; | |
| } | |
| toggle() { | |
| return this.flg = !this.flg; | |
| } | |
| get() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class { | |
| constructor() { | |
| this.ua = window.navigator.userAgent.toLowerCase(); | |
| } | |
| isIE() { | |
| return this.ua.indexOf('msie') >= 0 || this.ua.indexOf('trident') >= 0; | |
| } | |
| isFF() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Promise = require('es6-promise').Promise; | |
| export default (path, param) => { | |
| return new Promise(function(resolve, reject) { | |
| $.ajax({ | |
| url: path, | |
| data: param, | |
| type: 'GET', | |
| timeout: 60000, | |
| datatype: 'json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ドメインを取得 | |
| export default () => { | |
| return location.protocol + '//' + location.host; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default (name) => { | |
| const url = location.href; | |
| let params; | |
| let param = []; | |
| let str = url.replace(/[?&]/g, '<>'); | |
| params = str.split('<>'); | |
| for (let i = 0; i < params.length; i++) { | |
| param.push(params[i].split('=')); | |
| } | |
| for (let i = 0; i < param.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ファイル名やパラメータを除いたパス(ディレクトリ止まり)を取得 | |
| export default () => { | |
| return location.pathname.replace(location.pathname.match(/[^/]+?$/g), ''); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.onload = function(){ | |
| console.log('hello, world'); | |
| }; |