title |
---|
Playground新功能 |
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
setTimeout(() => { | |
let 时间数组 = document.querySelectorAll('td:nth-child(3) .colum-content') | |
let 链接数组 = document.querySelectorAll('a.danmu-content') | |
链接数组.forEach((链接, 序号) => { | |
let [s=0,m=0,h=0] = 时间数组[序号].textContent.split(':').reverse() | |
链接.href = 链接.href + `?t=${h}h${m}m${s}s` | |
}) | |
}, 1000) |
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
function fun(name, age){ | |
this.name = name || 'wonderful' | |
this.age = age || 18 | |
} | |
fun.prototype.getName = function(){ | |
return this.name | |
} | |
var me = new fun() |
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
var ffmpeg = require('fluent-ffmpeg'); | |
var chalk = require('chalk'); | |
var VIDEO_NAME = '01.rmvb' | |
var timeFormat = function (time,flag) { | |
var h = Math.floor(time / 3600) | |
var m = Math.floor(time / 60) % 60 | |
var s = time % 60 |
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
function clearString(s){ | |
var pattern = /[`~!@#$^&*()=|{}':;',\\[\\].<>\?~!@#¥……&*()&;|{}【】‘;:”“'。,、?]|\s/; | |
var rs = ""; | |
for (var i = 0; i < s.length; i++) { | |
rs = rs+s.substr(i, 1).replace(pattern, ''); | |
} | |
return rs; | |
} |
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
var imageSize = false | |
var inputElement = document.getElementById("input"); | |
inputElement.addEventListener("change", handleFiles, false); | |
function handleFiles() { | |
var fr = new FileReader; | |
fr.onload = function() { // file is loaded | |
var img = new Image; | |
img.onload = function() { |