Skip to content

Instantly share code, notes, and snippets.

View esmasui's full-sized avatar

Sosuke Masui esmasui

View GitHub Profile
test( "pressure", function() {
var backing = MOON.getCurrentPage().backing;
var paper = MOON.getPaperJSON(backing);
//console.log(paper);
paper.strokes = [];
var pressure = 1.0;
var w = paper.width;
@esmasui
esmasui / gist:6326571
Last active December 21, 2015 15:28
enchantMOONのローカルストレージに数値以外を保持する
/*
* Copyright (C) 2013 uPhyca Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
> test("hoge", function(){ok(true, "hogehoge")}) localhost:3000/:79
Object {} localhost:3000/:81
Object {name: "hoge"} localhost:3000/:81
Object {name: "hoge", result: true, message: "hogehoge"} localhost:3000/:81
Object {name: "hoge", failed: 0, passed: 1, total: 1, duration: 2} localhost:3000/:81
Object {failed: 0, passed: 3, total: 3, runtime: 30531} localhost:3000/:81
at <error: TypeError: Object [object builtins] has no method 'FunctionGetInferredName'>
at <error: TypeError: Object [object builtins] has no method 'FunctionGetInferredName'>
at <error: TypeError: Object [object builtins] has no method 'FunctionGetInferredName'>
at process (<anonymous>:1453:24)
at synchronize (<anonymous>:1440:3)
at run (<anonymous>:360:4)
at process (<anonymous>:1453:24)
at synchronize (<anonymous>:1440:3)"
[ {
"description": "",
"devtoolsFrontendUrl": "/devtools/devtools.html?ws=localhost:9222/devtools/page/3CDEE390-DE33-B5CD-9383-8B9E770F1FC0",
"faviconUrl": "",
"id": "3CDEE390-DE33-B5CD-9383-8B9E770F1FC0",
"thumbnailUrl": "/thumb/3CDEE390-DE33-B5CD-9383-8B9E770F1FC0",
"title": "localhost:9222/json",
"type": "page",
"url": "http://localhost:9222/json",
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/3CDEE390-DE33-B5CD-9383-8B9E770F1FC0"
MOON.openUrl(window.prompt());
@esmasui
esmasui / gist:6181845
Created August 8, 2013 05:56
enchantMOON window.utilsオブジェクトのダンプ
intercept=function (clazz,method,interceptor){var proto=clazz.prototype,_super=proto[method],unwrapArgs=interceptor.length>2;proto[method]=function(){if(unwrapArgs){var args=Array.prototype.slice.call(arguments);args.unshift(_super,arguments);return interceptor.apply(this,args)}else{return interceptor.call(this,_super,arguments)}}}
--------
_lvl1=[object Object]
--------
_lvl2=[object Object]
--------
_lvl2_events=[object Object]
--------
_htmlencoding=[object Object]
--------
@esmasui
esmasui / gist:6181811
Created August 8, 2013 05:48
enchantMOON window.nsオブジェクトのダンプ
validate=function (ns,URI){if(!ns){throw new core.DOMException(core.INVALID_CHARACTER_ERR,"namespace is undefined")}if(ns.match(/[^0-9a-z\.:\-_]/i)!==null){throw new core.DOMException(core.INVALID_CHARACTER_ERR,ns)}var msg=false,parts=ns.split(":");if(ns==="xmlns"&&URI!=="http://www.w3.org/2000/xmlns/"){msg="localName is 'xmlns' but the namespaceURI is invalid"}else if(ns==="xml"&&URI!=="http://www.w3.org/XML/1998/namespace"){msg="localName is 'xml' but the namespaceURI is invalid"}else if(ns[ns.length-1]===":"){msg="Namespace seperator found with no localName"}else if(ns[0]===":"){msg="Namespace seperator found, without a prefix"}else if(parts.length>2){msg="Too many namespace seperators"}if(msg){throw new core.DOMException(NAMESPACE_ERR,msg+" ("+ns+"@"+URI+")")}}
@esmasui
esmasui / gist:6181794
Created August 8, 2013 05:45
enchantMOON window.coreオブジェクトのダンプ
EventException=function (){if(arguments.length>0){this._code=arguments[0]}else{this._code=0}if(arguments.length>1){this._message=arguments[1]}else{this._message="Unspecified event type"}Error.call(this,this._message);if(Error.captureStackTrace){Error.captureStackTrace(this,events.EventException)}}
--------
Event=function (eventType){this._eventType=eventType;this._type=eventType;this._bubbles=null;this._cancelable=null;this._target=null;this._currentTarget=null;this._eventPhase=null;this._timeStamp=null;this._preventDefault=false;this._stopPropagation=false}
--------
UIEvent=function (eventType){events.Event.call(this,eventType);this.view=null;this.detail=null}
--------
MouseEvent=function (eventType){events.UIEvent.call(this,eventType);this.screenX=null;this.screenY=null;this.clientX=null;this.clientY=null;this.ctrlKey=null;this.shiftKey=null;this.altKey=null;this.metaKey=null;this.button=null;this.relatedTarget=null}
--------
MutationEvent=function (eventType){events.Event.call(this,eventType);this.relatedN
@esmasui
esmasui / gist:6163904
Created August 6, 2013 12:05
enchantMOON XMLHttpRequestのダンプ
responseXML = null
--------
responseText =
--------
response =
--------
responseType = text
--------
statusText =
--------