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
/****************************************************************************** | |
Japan Marc Dat file | |
******************************************************************************/ | |
const MATERIALS = new Map([ | |
['a','図書'], | |
['c','楽譜'], | |
['e','地図資料'], | |
['g','映像資料'], |
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
/***************************************************************************** | |
* | |
* table to json | |
* | |
*****************************************************************************/ | |
(function() { | |
HTMLTableElement.prototype.toJSON = toJSON; | |
HTMLTableElement.prototype.toArray = toArray; | |
function toJSON(indent,fn,headers) |
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
/******************************************************************************* | |
description: | |
ローカルのエクセルファイルを選択すると(<input type="file" id="select-file">、 | |
選択したエクセルファイルへシートを追加し、テーブル要素(<table id="table-0">)を書込み、 | |
そのエクセルシートをダウンロードするためのリンクをdocument.body に追加します。 | |
※このままのコードだと、セルの書式属性は全部消えます。 | |
*******************************************************************************/ | |
(function($) { |
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
importScripts('./node_modules/comlink/dist/umd/comlink.min.js'); | |
async function resizer(file,offscreencanvas,max) | |
{ | |
let width = max,height = max; | |
let img = await createImageBitmap(file); | |
let ratio = img.width / img.height; | |
if(ratio < 1 && img.width <= max) | |
return file; |
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
/************************************************************************** | |
* resize image in file | |
**************************************************************************/ | |
import * as Comlink from "./node_modules/comlink/dist/esm/comlink.min.mjs" | |
export default async function(file,max) | |
{ | |
let canvas = document.createElement('canvas'); | |
let offscreencanvas = canvas.transferControlToOffscreen(); |
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
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "run nmake", | |
"type": "shell", | |
"command": "nmake.exe", | |
"args": [ | |
"debug=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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "cl.exe デバッグ", | |
"type": "cppvsdbg", | |
"request": "launch", | |
"program": "${fileDirname}\\output\\${fileBasenameNoExtension}.exe", | |
"args": [], | |
"stopAtEntry": false, |
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
Show hidden characters
{ | |
"presets": [ | |
["@babel/preset-env",{ | |
"useBuiltIns": "usage", | |
"corejs": 3, | |
"targets": [ "last 2 versions","> 2%","ie 11" ] | |
} | |
] | |
] | |
} |
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
/****************************************************************************** | |
file name : index.js | |
画像を縮小して ajax でアップロードする。 | |
usage : | |
<input type="file" name="sample" accept="image/png,image/jpeg"> | |
<script type="module" src="index.js"></script> | |
******************************************************************************/ | |
import ResizeImage from './resize.image.js'; |
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
/************************************************************************** | |
* resize image in file | |
**************************************************************************/ | |
export default async function(file,max_pixcels) | |
{ | |
let canvas; | |
let done = () => false; | |
if('OffscreenCanvas' in window) | |
{ |