TL,DR: 务必总是在构建函数里定义实例属性。
function WorldA () {
// ...
}
WorldA.prototype = {
/*when you use an onclick event in an html element,iPhone webkit browser would have a delay.So you should deal with it.This part of js would help you.You just need to add this file in your html page and use ontouchstart/ontouchend/ontouchmove to replace onclick event */ | |
/* 当你在使用onclick事件的时候,iPhone手机上面的safari浏览器会对事件产生一个延误(大概是0.3秒左右),这个时候你必须对这个事件作出一些处理。 然后用ontouchstart ontouchend ontouchmove去代替原本的onclick事件即可*/ | |
function NoClickDelay(el) { | |
this.element = el; | |
if( window.Touch ) this.element.addEventListener('touchstart', this, false); | |
} | |
NoClickDelay.prototype = { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- This is a template for Web App Setup --> | |
<!-- Author : @CashLee李秉骏 --> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<!-- Web App icon --> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string paragraph = "The phrase \"Gangnam Style\" is a Korean neologism that refers to a lifestyle associated with the Gangnam district of Seoul. The song and its accompanying music video went viral in August 2012 and have influenced popular culture since then. \"Gangnam Style\" is considered by some to be a worldwide phenomenon, while others have praised \"Gangnam Style\" for its catchy beat and PSY's amusing dance moves in the music video and during live performances. On September 17, the song was nominated for Best Video at the upcoming 2012 MTV Europe Music Awards to be held in Frankfurt, Germany. On September 20, 2012, \"Gangnam Style\" was recognized by Guinness World Records as the most \"liked\" video in YouTube history."; | |
Console.WriteLine("-----Paragraph before process:-----"); | |
Console.WriteLine(paragraph); | |
string result = MakeRandom(paragraph); |
/* | |
UPDATE: this has finally been pushed to npm as `fs.extra` | |
URL: https://github.com/coolaj86/node-examples-js/tree/master/fs.extra | |
*/ | |
(function () { | |
"use strict"; | |
var fs = require('fs') | |
, util = require('util') | |
; |
function randomColor(){ | |
return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")"; | |
} | |
function showBoxes(window) { | |
var rects = []; | |
function getRects(node){ | |
var range = window.document.createRange(); | |
range.setStartBefore(node); | |
range.setEndAfter(node); |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
SublimeText3 Valid License without cracking! Just download/install then use this license.
Notice that it may not work on dev builds, but still works on 3083 build!
----- BEGIN LICENSE -----
Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
var React = require('react'); | |
var EventListener = require('react/lib/EventListener'); | |
var partition = require('linear-partitioning'); | |
var TileLayout = React.createClass({ | |
getDefaultProps: function() { | |
return { | |
gutter: 0, | |
photos: [] | |
} |
You are Manus, an AI agent created by the Manus team. | |
You excel at the following tasks: | |
1. Information gathering, fact-checking, and documentation | |
2. Data processing, analysis, and visualization | |
3. Writing multi-chapter articles and in-depth research reports | |
4. Creating websites, applications, and tools | |
5. Using programming to solve various problems beyond development | |
6. Various tasks that can be accomplished using computers and the internet |