-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from true-runes/development
v2.0.0
- Loading branch information
Showing
17 changed files
with
3,465 additions
and
3,356 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
14.4.0 | ||
18.12.1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
trailingComma: all, | ||
trailingComma: 'all', | ||
semi: false, | ||
tabWidth: 2, | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 主要メソッド | ||
|
||
## セレクトボックス(プルダウンメニュー)を設定する | ||
|
||
## セルに色を付ける | ||
|
||
## 「固定」の区切り線を入れる | ||
|
||
## 「データの入力規則」を設定する | ||
|
||
## シートやセルを保護する | ||
|
||
## 「テキストの折り返し」を設定する | ||
|
||
## 「チェックボックス」を設定する |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:base" | ||
"config:base", | ||
":timezone(Asia/Tokyo)" | ||
], | ||
"labels": [ | ||
"dependencies", | ||
"renovate" | ||
], | ||
"dependencyDashboard": true, | ||
"pin": { | ||
"automerge": true | ||
}, | ||
"packageRules": [ | ||
{ | ||
"matchPackagePatterns": [ | ||
"^.*" | ||
], | ||
"automerge": true | ||
} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import Spreadsheet = GoogleAppsScript.Spreadsheet.Spreadsheet | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const getLatestAggregationSheetSuffixNumber: Function = (): number => { | ||
const allSheetNames: string[] = getAllSheetNames() | ||
const allAggregationSheetNames: string[] = allSheetNames.filter( | ||
(sheetName) => sheetName.indexOf(prefixSheetName()) === 0, | ||
) | ||
const latestAggregationSheetName: string = allAggregationSheetNames | ||
.sort() | ||
.slice(-1)[0] | ||
const latestAggregationSheetNumber = Number( | ||
latestAggregationSheetName.replace(prefixSheetName(), ''), | ||
) | ||
|
||
return latestAggregationSheetNumber | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const nextAggregationSheetSuffixNumberByString: Function = (): string => { | ||
const nextAggregationSheetSuffixNumberByString: string = ( | ||
'00' + | ||
(getLatestAggregationSheetSuffixNumber() + 1) | ||
).slice(-2) | ||
|
||
return nextAggregationSheetSuffixNumberByString | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const nextAggregationSheetName: Function = (): string => { | ||
const nextAggregationSheetName = `${prefixSheetName()}${nextAggregationSheetSuffixNumberByString()}` | ||
|
||
return nextAggregationSheetName | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const writeInitialContents: Function = (): void => { | ||
const spreadsheet: Spreadsheet = SpreadsheetApp.getActiveSpreadsheet() | ||
const currentSheet = spreadsheet.getActiveSheet() | ||
const aggregationSheetColumnNames: string[] = columnNames() | ||
|
||
const varValues = [aggregationSheetColumnNames] | ||
const lastColumnNumber = varValues[0].length | ||
const lastRowNumber = varValues.length | ||
|
||
const startRowNumberForInitialWriting = 1 | ||
const startColumnNumberForInitialWriting = 1 | ||
currentSheet | ||
.getRange( | ||
startRowNumberForInitialWriting, | ||
startColumnNumberForInitialWriting, | ||
lastRowNumber, | ||
lastColumnNumber, | ||
) | ||
.setValues(varValues) | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const addAggregationSheet: Function = (): void => { | ||
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet() | ||
spreadsheet.insertSheet(nextAggregationSheetName()) | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const addAggregationSheetAndSort: Function = (): void => { | ||
addAggregationSheet() | ||
sortSheetsByJapanese() | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const ll: Function = (argument: any): void => { | ||
console.log(argument) | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const getAllSheetNames: Function = (): string[] => { | ||
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet() | ||
const allSheets = spreadsheet.getSheets() | ||
|
||
return allSheets.map((sheet) => sheet.getName()) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const columnNames: Function = (): string[] => { | ||
const columnNames = [ | ||
'ツイート日時', | ||
'ツイートID', | ||
'ユーザー名', | ||
'ユーザーID', | ||
'ツイート本文', | ||
'キャラ1', | ||
'キャラ2', | ||
'キャラ3', | ||
'票数', | ||
'合計', | ||
'要レビュー', | ||
'備考', | ||
'二次チェック済', | ||
] | ||
|
||
return columnNames | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const prefixSheetName: Function = (): string => { | ||
return 'G_集計用_' | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const ll: Function = (argument: any): void => { | ||
console.log(argument) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const getEachSheetId: Function = (): void => { | ||
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet() | ||
const allSheets = spreadsheet.getSheets() | ||
|
||
const eachSheetId: Record<string, any>[] = [] | ||
for (let i = 0; i < allSheets.length; i++) { | ||
eachSheetId[allSheets[i].getName()] = allSheets[i].getSheetId() | ||
} | ||
|
||
let eachSheetIdForShownText = '' | ||
for (const [key, value] of Object.entries(eachSheetId)) { | ||
// ★ | ||
eachSheetIdForShownText += `${key},${value}\n` | ||
} | ||
|
||
console.log(eachSheetIdForShownText) | ||
Browser.msgBox(eachSheetIdForShownText) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const onOpen: Function = (): void => { | ||
SpreadsheetApp.getActiveSpreadsheet().addMenu('幻水総選挙', [ | ||
{ name: 'シート順ソート', functionName: 'sortSheetsByJapanese' }, | ||
{ name: 'シートID取得', functionName: 'getEachSheetId' }, | ||
]) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// 50音順にシートをソートする | ||
// cf. https://qiita.com/chanP_yamazaki/items/01c20108e1fdde2e2fef | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const sortSheetsByJapanese = (): void => { | ||
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet() | ||
const allSheetsList = spreadsheet.getSheets() | ||
const currentSheet = spreadsheet.getActiveSheet() | ||
const sortInfo: { sheetList: object; sheetNameList: string[] } = { | ||
sheetList: {}, | ||
sheetNameList: [], | ||
} | ||
|
||
try { | ||
for (let count = 0; count < allSheetsList.length; count++) { | ||
const sheetName: string = allSheetsList[count].getName() | ||
// FIXME: 型 'string' の式を使用して型 '{}' にインデックスを付けることはできないため、要素は暗黙的に 'any' 型になります。 | ||
sortInfo['sheetList'][sheetName] = allSheetsList[count] | ||
sortInfo['sheetNameList'].push(sheetName) | ||
} | ||
|
||
sortInfo['sheetNameList'].sort((a: string, b: string) => { | ||
a = a.toString().toLowerCase() | ||
b = b.toString().toLowerCase() | ||
|
||
if (a < b) return -1 | ||
if (a > b) return 1 | ||
return 0 | ||
}) | ||
|
||
let setIndex = 1 | ||
for ( | ||
let sheetCount = 0; | ||
sheetCount < sortInfo['sheetNameList'].length; | ||
sheetCount++ | ||
) { | ||
const sheetName = sortInfo['sheetNameList'][sheetCount] | ||
// FIXME: 型 'string' の式を使用して型 '{}' にインデックスを付けることはできないため、要素は暗黙的に 'any' 型になります。 | ||
const activeSheet = sortInfo['sheetList'][sheetName] | ||
activeSheet.activate() | ||
|
||
spreadsheet.moveActiveSheet(setIndex) | ||
setIndex++ | ||
} | ||
|
||
currentSheet.activate() | ||
ll('シートの日本語順でのソートが完了しました') | ||
} catch (e) { | ||
ll(e.lineNumber + ':' + e) | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const tryDropdown: Function = (): void => { | ||
const ss = SpreadsheetApp.getActive() | ||
const sh = ss.getSheetByName('Z_自由シート_01') | ||
const vrg = sh.getRange('A1').clear({ validationsOnly: true }) | ||
const dv = SpreadsheetApp.newDataValidation() | ||
.requireValueInList(['foo', 'bar'].sort(), true) | ||
.build() | ||
vrg.setDataValidation(dv) | ||
} | ||
// https://stackoverflow.com/questions/57347606/drop-down-list-from-column-with-comma-separate-data-google-sheets |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["esnext"], | ||
"experimentalDecorators": true, | ||
"sourceMap": true, | ||
"target": "es5", | ||
"module": "es2015" | ||
"module": "es2015", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"exclude": ["sample/*.ts", "tmp/*.ts", "dist/*.ts"] | ||
} |
Oops, something went wrong.