javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); このページをアンテナに追加 RSSフィード

2007年10月2日

Ten.js 10:52 Ten.js - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); を含むブックマーク はてなブックマーク - Ten.js - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); Ten.js - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); のブックマークコメント


/* Ten */
if (typeof(Ten) == 'undefined') {
    Ten = {};
}
Ten.NAME = 'Ten';
Ten.VERSION = 0.16;

/* Ten.Class */
Ten.Class = function(klass, prototype) {
    if (klass && klass.initialize) {
	var c = klass.initialize;
    } else if(klass && klass.base) {
        var c = function() { return klass.base[0].apply(this, arguments) };
    } else {
	var c = function() {};
    }
    c.prototype = prototype || {};
    c.prototype.constructor = c;
    Ten.Class.inherit(c, klass);
    if (klass && klass.base) {
        for (var i = 0;  i < klass.base.length; i++) {
	    var parent = klass.base[i];
            if (i == 0) {
                c.SUPER = parent;
                c.prototype.SUPER = parent.prototype;
            }
            Ten.Class.inherit(c, parent);
            Ten.Class.inherit(c.prototype, parent.prototype);
        }
    }
    return c;
}
Ten.Class.inherit = function(child,parent) {
    for (var prop in parent) {
        if (typeof(child[prop]) != 'undefined' || prop == 'initialize') continue;
        child[prop] = parent[prop];
    }
}

/*
// Basic Ten Classes
*/
/* Ten.Function */
Ten.Function = new Ten.Class({
    bind: function(f,o) {
        return function() {
            f.apply(o, arguments);
        }
    }
});

/* Ten.JSONP */
Ten.JSONP = new Ten.Class({
    initialize: function(uri,obj,method) {
        if (Ten.JSONP.Callbacks.length) {
            setTimeout(function() {new Ten.JSONP(uri,obj,method)}, 500);
            return;
        }
        var del = uri.match(/\?/) ? '&' : '?';
        uri += del + 'callback=Ten.JSONP.callback';
        if (!uri.match(/timestamp=/)) {
            uri += '&' + encodeURI(new Date());
        }
        if (typeof(obj) == 'function' && typeof(method) == 'undefined') {
            obj = {callback: obj};
            method = 'callback';
        }
        if (obj && method) Ten.JSONP.addCallback(obj,method);
        this.script = document.createElement('script');
        this.script.src = uri;
        this.script.type = 'text/javascript';
        document.getElementsByTagName('head')[0].appendChild(this.script);
    },
    addCallback: function(obj,method) {
        Ten.JSONP.Callbacks.push({object: obj, method: method});
    },
    callback: function(args) {
        // alert('callback called');
        var cbs = Ten.JSONP.Callbacks;
        for (var i = 0; i < cbs.length; i++) {
            var cb = cbs[i];
            cb.object[cb.method].call(cb.object, args);
        }
        Ten.JSONP.Callbacks = [];
    },
    MaxBytes: 1800,
    Callbacks: []
});

/* Ten.XHR */
Ten.XHR = new Ten.Class({
    initialize: function(uri,opts,obj,method) {
        if (!uri) return;
        this.request = Ten.XHR.getXMLHttpRequest();
        if (obj && method) this.callback = {object: obj, method: method};
        var xhr = this;
        var prc = this.processReqChange;
        this.request.onreadystatechange = function() {
            prc.apply(xhr, arguments);
        }
        var method = opts.method || 'GET';
        this.request.open(method, uri, true);
        if (method == 'POST') {
            this.request.setRequestHeader('Content-Type',
                                          'application/x-www-form-urlencoded');
        }
        var data = opts.data ? Ten.XHR.makePostData(opts.data) : null;
        this.request.send(data);
    },
    getXMLHttpRequest: function() {
        var xhr;
        var tryThese = [
            function () { return new XMLHttpRequest(); },
            function () { return new ActiveXObject('Msxml2.XMLHTTP'); },
            function () { return new ActiveXObject('Microsoft.XMLHTTP'); },
            function () { return new ActiveXObject('Msxml2.XMLHTTP.4.0'); },
        ];
        for (var i = 0; i < tryThese.length; i++) {
            var func = tryThese[i];
            try {
                xhr = func;
                return func();
            } catch (e) {
                //alert(e);
            }
        }
        return xhr;
    },
    makePostData: function(data) {
        var pairs = [];
        var regexp = /%20/g;
        for (var k in data) {
            var v = data[k].toString();
            var pair = encodeURIComponent(k).replace(regexp,'+') + '=' +
                encodeURIComponent(v).replace(regexp,'+');
            pairs.push(pair);
        }
        return pairs.join('&');
    }
},{
    processReqChange: function() {
        var req = this.request;
        if (req.readyState == 4) {
            if (req.status == 200) {
                var cb = this.callback;
                if (cb) cb.object[cb.method].call(cb.object, req);
            } else {
                // alert("There was a problem retrieving the XML data:\n" +
                //       req.statusText);
            }
        }
    }
});

/* Ten.Observer */
Ten.Observer = new Ten.Class({
    initialize: function(element,event,obj,method) {
        var func = obj;
        if (typeof(method) == 'string') {
            func = obj[method];
        }
        this.element = element;
        this.event = event;
        this.listener = function(event) {
            return func.call(obj, new Ten.Event(event || window.event));
        }
        if (this.element.addEventListener) {
            if (this.event.match(/^on(.+)$/)) {
                this.event = RegExp.$1;
            }
            this.element.addEventListener(this.event, this.listener, false);
        } else if (this.element.attachEvent) {
            this.element.attachEvent(this.event, this.listener);
        }
    }
},{
    stop: function() {
        if (this.element.removeEventListener) {
            this.element.removeEventListener(this.event,this.listener,false);
        } else if (this.element.detachEvent) {
            this.element.detachEvent(this.event,this.listener);
        }
    }
});

/* Ten.Event */
Ten.Event = new Ten.Class({
    initialize: function(e) {
        this.event = e;
        if (e) {
            this.target = e.target || e.srcElement;
            this.shiftKey = e.shiftKey;
            this.ctrlKey = e.ctrlKey;
            this.altKey = e.altKey;
        }
    },
    keyMap: {
        8:"backspace", 9:"tab", 13:"enter", 19:"pause", 27:"escape", 32:"space",
        33:"pageup", 34:"pagedown", 35:"end", 36:"home", 37:"left", 38:"up",
        39:"right", 40:"down", 44:"printscreen", 45:"insert", 46:"delete",
        112:"f1", 113:"f2", 114:"f3", 115:"f4", 116:"f5", 117:"f6", 118:"f7",
        119:"f8", 120:"f9", 121:"f10", 122:"f11", 123:"f12",
        144:"numlock", 145:"scrolllock"
    }
},{
    mousePosition: function() {
        if (!this.event.clientX) return;
        return Ten.Geometry.getMousePosition(this.event);
    },
    isKey: function(name) {
        var ecode = this.event.keyCode;
        if (!ecode) return;
        var ename = Ten.Event.keyMap[ecode];
        if (!ename) return;
        return (ename == name);
    },
    targetIsFormElements: function() {
        if (!this.target) return;
        var T = (this.target.tagName || '').toUpperCase();
        return (T == 'INPUT' || T == 'SELECT' || T == 'OPTION' ||
                T == 'BUTTON' || T == 'TEXTAREA');
    },
    stop: function() {
        var e = this.event;
        if (e.stopPropagation) {
            e.stopPropagation();
            e.preventDefault();
        } else {
            e.cancelBubble = true;
            e.returnValue = false;
        }
    }
});

/* Ten.EventDispatcher */
Ten.EventDispatcher = new Ten.Class({
    initialize: function() {
        this._eventListeners = {};
    }, 
    implementEventDispatcher: function(obj) {
        Ten.Class.inherit(obj, Ten.EventDispatcher.prototype);
        obj._eventListeners = {};
    }
}, {
    hasEventListener: function(type) {
        return (this._eventListeners[type] instanceof Array && this._eventListeners[type].length > 0);
    },
    addEventListener: function(type, listener) {
        if (!this.hasEventListener(type)) {
            this._eventListeners[type] = [];
        }
        var listeners = this._eventListeners[type];
        for (var i = 0;  i < listeners.length; i++) {
            if (listeners[i] == listener) {
                return;
            }
        }
        listeners.push(listener);
    },
    removeEventListener: function(type, listener) {
        if (this.hasEventListener(type)) {
            var listeners = this._eventListeners[type];
            for (var i = 0;  i < listeners.length; i++) {
                if (listeners[i] == listener) {
                    listeners.splice(i, 1);
                    return;
                }
            }
        }
    },
    dispatchEvent: function(type, opt) {
        if (!this.hasEventListener(type)) return false;
        var listeners = this._eventListeners[type];
        for (var i = 0;  i < listeners.length; i++) {
            listeners[i].call(this, opt);
        }
    }
});

/* Ten.DOM */
Ten.DOM = new Ten.Class({
    getElementsByTagAndClassName: function(tagName, className, parent) {
        if (typeof(parent) == 'undefined') parent = document;
        if (!tagName) return Ten.DOM.getElementsByClassName(className, parent);
        var children = parent.getElementsByTagName(tagName);
        if (className) { 
            var elements = [];
            for (var i = 0; i < children.length; i++) {
                var child = children[i];
                if (Ten.DOM.hasClassName(child, className)) {
                    elements.push(child);
                }
            }
            return elements;
        } else {
            return children;
        }
    },
    getElementsByClassName: function(className, parent) {
        if (typeof(parent) == 'undefined') parent = document;
        var ret = [];
        if (!className) return ret;
        (function(parent) {
            var elems = parent.childNodes;
            for (var i = 0; i < elems.length; i++) {
                var e = elems[i];
                if (Ten.DOM.hasClassName(e, className)) {
                    ret.push(e);
                }
                arguments.callee(e);
            }
        })(parent);
        ret = Ten.Array.flatten(ret);
        return ret;
    },
    hasClassName: function(element, className) {
        if (!element || !className) return;
        var cname = element.className;
        if (!cname) return false;
        var cnames = cname.split(/\s+/);
        className = className.toLowerCase();
        for (var i = 0; i < cnames.length; i++) {
            if (cnames[i].toLowerCase() == className) {
                return true;
            }
        }
    },
    removeEmptyTextNodes: function(element) {
        var nodes = element.childNodes;
        for (var i = 0; i < nodes.length; i++) {
            var node = nodes[i];
            if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) {
                node.parentNode.removeChild(node);
            }
        }
    },
    nextElement: function(elem) {
        do {
            elem = elem.nextSibling;
        } while (elem && elem.nodeType != 1);
        return elem;
    },
    prevElement: function(elem) {
        do {
            elem = elem.previousSibling;
        } while (elem && elem.nodeType != 1);
        return elem;
    },
    insertBefore: function(node, ref) {
        ref.parentNode.insertBefore(node, ref);
    },
    insertAfter: function(node, ref) {
        if (ref.nextSibling) {
            ref.parentNode.insertBefore(node, ref.nextSibling);
        } else {
            ref.parentNode.appendChild(node);
        }
    },
    replaceNode: function(newNode, oldNode) {
        Ten.DOM.insertBefore(newNode, oldNode);
        oldNode.parentNode.removeChild(oldNode);
    },
    scrapeText: function(node) {
        var rval = [];
        (function (node) {
            var cn = node.childNodes;
            if (cn) {
                for (var i = 0; i < cn.length; i++) {
                    arguments.callee.call(this, cn[i]);
                }
            }
            var nodeValue = node.nodeValue;
            if (typeof(nodeValue) == 'string') {
                rval.push(nodeValue);
            }
        })(node);
        return rval.join('');
    },
    getSelectedText: function() {
        if (window.getSelection)
            return window.getSelection().toString() || '';
        else if (document.getSelection)
            return document.getSelection();
        else if (document.selection)
            return document.selection.createRange().text;
        else
            return '';
    },
    show: function(elem) {
        elem.style.display = 'block';
    },
    hide: function(elem) {
        elem.style.display = 'none';
    },
    onLoadFunctions: [],
    loaded: false,
    timer: null,
    addEventListener: function(event,func) {
        if (event != 'load') return;
        Ten.DOM.onLoadFunctions.push(func);
        Ten.DOM.checkLoaded();
    },
    checkLoaded: function() {
        var c = Ten.DOM;
        if (c.loaded) return true;
        if (document && document.getElementsByTagName &&
            document.getElementById && document.body) {
            if (c.timer) {
                clearInterval(c.timer);
                c.timer = null;
            }
            for (var i = 0; i < c.onLoadFunctions.length; i++) {
                c.onLoadFunctions[i]();
            }
            c.onLoadFunctions = [];
            c.loaded = true;
        } else {
            c.timer = setInterval(c.checkLoaded, 13);
        }
    }
});

/* Ten.Array */
Ten.Array = new Ten.Class({
    flatten: function(arr) {
        var ret = [];
        (function(arr) {
            for (var i = 0; i < arr.length; i++) {
                var o = arr[i];
                if (Ten.Array.isArray(o)) {
                    arguments.callee(o);
                } else {
                    ret.push(o);
                }
            }
        })(arr);
        return ret;
    },
    isArray: function(o) {
        return (o instanceof Array ||
                (o && typeof(o.length) === 'number' && typeof(o) != 'string'));
    }
});

/* Ten.Selector */
Ten.Selector = new Ten.Class({
    initialize: function(selector) {
        this.selectorText = selector;
        var sels = selector.split(/\s+/);
        var child = null;
        var separator = null;
        for (var i = sels.length - 1; i >= 0; i--) {
            if (sels[i] == '>') {
                continue;
            } else if ((i > 0) && sels[i-1] == '>') {
                separator = sels[i-1];
            }
            var opt = separator ? {separator: separator} : null;
            separator = null;
            var node = new Ten.SelectorNode(sels[i],child,opt);
            child = node;
        }
        this.childNode = child;
    },
    getElementsBySelector: function(selector, parent) {
        sels = selector.split(/\s*,\s*/);
        var ret = [];
        for (var i = 0; i < sels.length; i++) {
            var sel = new Ten.Selector(sels[i]);
            ret = ret.concat(sel.getElements(parent));
        }
        ret = Ten.Array.flatten(ret);
        return ret;
    }
},{
    getElements: function(parent) {
        if (typeof(parent) == 'undefined') {
            parent = document;
        }
        return this.childNode.getElements(parent);
    }
});

/* Ten.SelectorNode */
Ten.SelectorNode = new Ten.Class({
    initialize: function(selector, child, opt) {
        if (selector) {
            selector = selector.replace(/\s/g,'');
        }
        this.option = opt;
        this.selectorText = selector;
        this.childNode = child;
        this.parseSelector();
    }
},{
    getElementsBySelector: null, // will be overridden by parser
    parseSelector: function() {
        var f = 'getElementsBySelector';
        var t = this.selectorText;
        var match;
        if (match = t.match(/^(.+)\:([\w-+()]+)$/)) {
            t = match[1];
            this.pseudoClass = match[2];
        }
        if (t.match(/^[\w-]+$/)) {
            this[f] = function(parent) {
                return parent.getElementsByTagName(t);
            };
        } else if (match = t.match(/^([\w-]+)?#([\w-]+)$/)) {
            var tname = match[1];
            var idname = match[2];
            this[f] = function(parent) {
                var e = document.getElementById(idname);
                if (!tname ||
                    e.tagName.toLowerCase() == tname.toLowerCase()) {
                        return [e];
                    } else {
                        return [];
                    }
            };
        } else if (match = t.match(/^([\w-]+)?\.([\w-]+)/)) {
            var tname = match[1];
            var cname = match[2];
            this[f] = function(parent) {
                return Ten.DOM.getElementsByTagAndClassName(tname,cname,parent);
            };
        }
        if (this.option && this.option.separator) this.parseSeparator();
        if (this.pseudoClass) this.parsePseudoClass();
    },
    parsePseudoClass: function() {
        if (!this.pseudoClass) return;
        var pseudo = this.pseudoClass;
        var f = 'getElementsBySelector';
        var func = this[f];
        var match;
        if (match = pseudo.match(/^(.+)-child(\((\d+)\))?$/)) {
            var type = match[1];
            var n = match[3];
            var index;
            if (type == 'first') {
                index = 0;
            } else if (type == 'last') {
                index = -1;
            } else if (type == 'nth' && n) {
                index = n - 1;
            }
            if (typeof index == 'number') {
                this[f] = function(parent) {
                    var elems = func(parent);
                    if (index < 0) index = elems.length + index;
                    if (elems[index]) {
                        return [elems[index]];
                    } else {
                        return [];
                    }
                }
            }
        } else if (match = pseudo.match(/^nth-child\((\d+)n\+(\d+)\)$/)) {
            var a = new Number(match[1]);
            var b = new Number(match[2]);
            this[f] = function(parent) {
                var elems = func(parent);
                var ret = [];
                for (var n = 0; n < 1000; n++) {
                    var i = a * n + b - 1;
                    if (i < 0) continue;
                    if (typeof elems[i] == 'undefined') break;
                    ret.push(elems[i]);
                }
                return ret;
            };
        }
    },
    parseSeparator: function() {
        if (!this.option) return;
        var sep = this.option.separator;
        if (!sep) return;
        var f = 'getElementsBySelector';
        var func = this[f];
        if (sep == '>') {
            this[f] = function(parent) {
                var elems = func(parent);
                var childs = parent.childNodes;
                var ret = [];
                var j0 = 0;
                for (var i = 0; i < elems.length; i++) {
                    for (var j = j0; j < childs.length; j++) {
                        if (elems[i] == childs[j]) {
                            ret.push(elems[i]);
                            j0 = j + 1;
                            break;
                        }
                    }
                }
                return ret;
            }
        }
    },
    getElements: function(parent) {
        if (typeof this.getElementsBySelector != 'function') return;
        var ret = [];
        var elems = this.getElementsBySelector(parent);
        if (elems && this.childNode) {
            for (var i = 0; i < elems.length; i++) {
                ret.push(this.childNode.getElements(elems[i]));
            }
            return ret;
        } else {
            return elems;
        }
    }
});

/* Ten.Color */
Ten.Color = new Ten.Class({
    initialize: function(r,g,b,a) {
        if (typeof(a) == 'undefined' || a === null) a = 1;
        this.r = r;
        this.g = g;
        this.b = b;
        this.a = a;
    },
    parseFromString: function(str) {
        var match;
        if (match = str.match(/^#([0-9a-f]{6}|[0-9a-f]{3})$/i)) {
            var hexstr = match[1];
            var w = hexstr.length / 3;
            var rgb = [];
            for (var i = 0; i < 3; i++) {
                var hex = hexstr.substr(w * i, w);
                if (hex.length == 1) hex += hex;
                rgb.push(parseInt(hex,16));
            }
            return new Ten.Color(rgb[0],rgb[1],rgb[2]);
        } else if (match = str.match(/^rgb\(([\d.,\s]+)\)/)) {
            var rdba = match[1].split(/[\s,]+/);
            return new Ten.Color(rdba[0],rdba[1],rdba[2],rdba[3]);
        }
        return null;
    },
    parseFromElementColor: function(elem,prop) {
        var ret;
        for (var color; elem; elem = elem.parentNode) {
            color = Ten.Style.getElementStyle(elem, prop);
            if (typeof(color) != 'undefined' && color != 'transparent') {
                ret = color;
                break;
            }
        }
        return ret ? Ten.Color.parseFromString(ret) : null;
    }
},{
    asRGBString: function() {
        if (this.a < 1) {
            return 'rgba(' + this.r + ',' + this.g + ',' + this.b +
                ',' + this.a + ')';
        } else {
            return 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')';
        }
    },
    asHexString: function() {
        var str = '#';
        var cls = ['r','g','b'];
        for (var i = 0; i < 3; i ++) {
            var c = Math.round(this[cls[i]]);
            var s = c.toString(16);
            if (c < 16) s = '0' + s;
            str += s;
        }
        return str;
    },
    overlay: function(color) {
        if (color.a == 1) return color;
        r = Math.round(color.r * color.a + this.r * this.a * (1 - color.a));
        g = Math.round(color.g * color.a + this.g * this.a * (1 - color.a));
        b = Math.round(color.b * color.a + this.b * this.a * (1 - color.a));
        return new Ten.Color(r,g,b);
    }
});

/* Ten.Style */
Ten.Style = new Ten.Class({
    applyStyle: function(elem, style) {
        for (prop in style) {
            elem.style[prop] = style[prop];
        }
    },
    getGlobalRule: function(selector) {
        selector = selector.toLowerCase();
        if (Ten.Style._cache[selector]) {
            return Ten.Style._cache[selector];
        } else if (Ten.Style._cache[selector] === null) {
            return null;
        } else {
            for (var i = document.styleSheets.length - 1; i >= 0; i--) {
                var ss = document.styleSheets[i];
                try {
                    var cssRules = ss.cssRules || ss.rules;
                } catch(e) {
                    continue;
                }
                for (var j = cssRules.length - 1; j >= 0; j--) {
                    var rule = cssRules[j];
                    if (rule.selectorText &&
                        rule.selectorText.toLowerCase() == selector) {
                            Ten.Style._cache[selector] = rule;
                            return rule;
                        }
                }
            }
        }
        Ten.Style._cache[selector] = null;
        return null;
    },
    getGlobalStyle: function(selector, prop) {
        var rule = Ten.Style.getGlobalRule(selector);
        if (rule && rule.style[prop]) {
            return rule.style[prop];
        } else {
            return null;
        }
    },
    getElementStyle: function(elem, prop) {
        var style = elem.style ? elem.style[prop] : null;
        if (!style) {
            var dv = document.defaultView;
            if (dv && dv.getComputedStyle) {
                try {
                    var styles = dv.getComputedStyle(elem, null);
                } catch(e) {
                    return null;
                }
                prop = prop.replace(/([A-Z])/g, '-$1').toLowerCase();
                style = styles ? styles.getPropertyValue(prop) : null;
            } else if (elem.currentStyle) {
                style = elem.currentStyle[prop];
            }
        }
        return style;
    },
    scrapeURL: function(url) {
        if (url.match(/url\((.+)\)/)) {
            url = RegExp.$1;
            url = url.replace(/['"<>]/g, '');
            return url;
        }
        return null;
    },
    _cache: {}
});

/* Ten.Geometry */
Ten.Geometry = new Ten.Class({
    initialize: function() {
        if (Ten.Geometry._initialized) return;
        var func = Ten.Geometry._functions;
        var de = document.documentElement;
        if (window.innerWidth) {
            func.getWindowWidth = function() { return window.innerWidth; }
            func.getWindowHeight = function() { return window.innerHeight; }
            func.getXScroll = function() { return window.pageXOffset; }
            func.getYScroll = function() { return window.pageYOffset; }
        } else if (de && de.clientWidth) {
            func.getWindowWidth = function() { return de.clientWidth; }
            func.getWindowHeight = function() { return de.clientHeight; }
            func.getXScroll = function() { return de.scrollLeft; }
            func.getYScroll = function() { return de.scrollTop; }
        } else if (document.body.clientWidth) {
            func.getWindowWidth = function() { return document.body.clientWidth; }
            func.getWindowHeight = function() { return document.body.clientHeight; }
            func.getXScroll = function() { return document.body.scrollLeft; }
            func.getYScroll = function() { return document.body.scrollTop; }
        }
        Ten.Geometry._initialized = true;
    },
    _initialized: false,
    _functions: {},
    getScroll: function() {
        if (!Ten.Geometry._initialized) new Ten.Geometry;
        return {
            x: Ten.Geometry._functions.getXScroll(),
            y: Ten.Geometry._functions.getYScroll()
        };
    },
    getMousePosition: function(pos) {
        // pos should have clientX, clientY same as mouse event
        if ((navigator.userAgent.indexOf('Safari') > -1) &&
            (navigator.userAgent.indexOf('Version/') < 0)) {
            return {
                x: pos.clientX,
                y: pos.clientY
            };
        } else {
            var scroll = Ten.Geometry.getScroll();
            return {
                x: pos.clientX + scroll.x,
                y: pos.clientY + scroll.y
            };
        }
    },
    getElementPosition: function(e) {
        return {
            x: e.offsetLeft,
            y: e.offsetTop
        };
    },
    getWindowSize: function() {
        if (!Ten.Geometry._initialized) new Ten.Geometry;
        return {
            w: Ten.Geometry._functions.getWindowWidth(),
            h: Ten.Geometry._functions.getWindowHeight()
        };
    }
});

/* Ten.Position */
Ten.Position = new Ten.Class({
    initialize: function(x,y) {
        this.x = x;
        this.y = y;
    },
    add: function(a,b) {
        return new Ten.Position(a.x + b.x, a.y + b.y);
    },
    subtract: function(a,b) {
        return new Ten.Position(a.x - b.x, a.y - b.y);
    }
});

EmberlynnEmberlynn2011/07/23 18:16I really wish there were more aicrtles like this on the web.

piumdgibsbpiumdgibsb2011/07/24 23:38gG8LTr , [url=http://toxlkdypogau.com/]toxlkdypogau[/url], [link=http://cdfqodqyansm.com/]cdfqodqyansm[/link], http://yoklmpzjcfxe.com/

fzadifxfzadifx2011/07/26 19:135n2oon <a href="http://mtwptdcqccjk.com/">mtwptdcqccjk</a>

qrvluqdqrvluqd2011/07/26 23:29bm59Pf , [url=http://aewkxeueuebx.com/]aewkxeueuebx[/url], [link=http://ebcwefwnxaci.com/]ebcwefwnxaci[/link], http://lelmnzwofuep.com/

SlipsSlips2013/03/31 17:44That's a subtle way of tnhkinig about it.

jinicvjinicv2013/04/02 01:187T3p9q , [url=http://vasxrovzugjn.com/]vasxrovzugjn[/url], [link=http://wgwxzjfkghjl.com/]wgwxzjfkghjl[/link], http://jxbsftdquicf.com/

bhxbbvqozzhbhxbbvqozzh2013/04/02 07:47vnQV5g <a href="http://bcuqqpryjcje.com/">bcuqqpryjcje</a>

jvjgfvjvjgfv2013/04/04 19:19pMU6nL , [url=http://mkljjgqyltsl.com/]mkljjgqyltsl[/url], [link=http://dfmpnvtzwing.com/]dfmpnvtzwing[/link], http://hmqruhnkigjm.com/

MauveMauve2016/04/29 12:10Although along with its reputation came up this speculations concerning their adverse reactions. The idea is when something is always that beneficial, then there must be something from the factor that can bring the alternative response. This is often one of the thought processes the novsco--ontinced consumers intend.

EmmaEmma2016/05/03 12:47Celso Azevedo • 31 de Janeiro de 2011 às 20:45Olá <a href="http://edftxaqryx.com">Gae,nblriifelizmente</a> eu também não uso nenhum metodo de pagamento usado aí noBrasil, só mesmo PayPal e por isso não posso ajuda-lo

TeiyaTeiya2016/05/03 20:17Elienai Luciano / Preliminares parece desculpa pra obter atenção. Eu apenas pergunto a ela, está pronta?, e a noite é sempre das.qlasuGoetei deste comentário ou não: 0 http://qurbbiuy.com [url=http://labmxxqkf.com]labmxxqkf[/url] [link=http://vryfha.com]vryfha[/link]

JamPlaycleJamPlaycle2017/05/08 00:00Viagra Ointment On Sale Sleepwell Worldwide Zentel 400mg Amex Real Order Kamagra Ireland Que Es Cialis Y Viagra Amitriptyline Overnight [url=http://byuvaigranonile.com]viagra[/url] Achetez Priligy 30 Mg Entrega Rapida Keflex Sulfa The Most Inexpensive Cialis Deals Propecia

KennFeceVietKennFeceViet2017/06/23 20:57Viagra A Poco Prezzo [url=http://doxycycline.ccrpdc.com/cheap-vibramycin-fast.php]Cheap Vibramycin Fast[/url] Honeymoon Cystitis Keflex Cheapeast Macrobid Ups No Prescription [url=http://levitra-buying.buylevi.com]Levitra Buying[/url] Prix Du Viagra Forum Viagra Kosten Mit Rezept [url=http://cial40mg.com/fast-delivery-cialis.php]Fast Delivery Cialis[/url] Propecia Halcon Viagra Generico Italia Si Puo Avere [url=http://cheap-generic-viagra.via100mg.com]Cheap Generic Viagra[/url] Viagra Frei Verkauflich 2013

AddtarkAddtark2018/04/25 23:46Cialis Cher [url=http://ciali5mg.com]generic cialis[/url] Viagra Buy Canada Rx Where Can I Buy Macrobid Bacterial Infections

DonnieatoveDonnieatove2018/07/17 05:06Gеt up tо $ 20,000 per dаy with our prоgrаm.
Wе аre а tеаm of expеrienсed prоgrаmmers, workеd morе thаn 14 mоnths оn this рrоgrаm and nоw еverything is rеadу аnd еvеrything wоrks pеrfectly. The РауPal sуstem is very vulnerable, instеаd of nоtifying the developеrs of РауРаl аbout this vulnеrаbility, we took advаntаgе оf it. We activelу usе our program for рersоnal еnriсhmеnt, tо shоw huge аmоunts оf mоney оn оur aссоunts, wе will nоt. you will not beliеvе until уou try аnd аs it is nоt in оur intеrest tо рrоve tо уou that sоmеthing is in уours. When we realizеd that this vulnеrаbilitу can bе usеd mаssivеlу withоut cоnsеquеnсes, wе dеcided tо help the rеst оf the рeорle. We dеcided nоt to inflаtе the priсе оf this gold рrogram аnd put a vеrу lоw рricе tag, only $ 550. In оrder for this progrаm tо bе аvаilable tо a largе numbеr оf pеople.
Аll the dеtails on оur blog: http://smart60.ru/go.php?url=https://www.pinterest.com/pin/690387817853172731/

DonnieatoveDonnieatove2018/07/17 13:24Gеt up to $ 20,000 рer day with оur рrogrаm.
We are a tеаm of expеriеnсed рrоgrammеrs, wоrkеd mоrе than 14 months оn this prоgram аnd now everything is reаdу and еverything works perfectlу. The РаyPal system is vеrу vulnerable, instеаd of nоtifying thе dеvеlopers of PaуPаl аbоut this vulnеrabilitу, wе tоok advantagе of it. Wе асtivеly use оur progrаm for реrsonаl еnrichmеnt, tо show huge аmоunts оf moneу on our ассounts, wе will not. уоu will not bеlieve until you trу аnd as it is not in оur intеrеst tо рrоvе to you thаt something is in yоurs. When wе realizеd thаt this vulnеrabilitу can bе usеd massivеly without сonsеquеnces, wе decidеd to hеlp the rest of thе peоplе. We dеcided nоt to inflаtе thе priсе of this gold progrаm and put a verу low priсе tаg, оnlу $ 550. In оrdеr fоr this prоgrаm tо bе аvаilаble to a largе number оf рeoрlе.
All the dеtails оn our blоg: http://skoli.ru/go?https://www.pinterest.com/pin/690387817853172731/

JamesCesteJamesCeste2018/08/05 21:07Help Jack please: http://ads.specificmedia.com/click/v=5%3Bm=2%3Bl=23470%3Bc=146418%3Bb=874880%3Bp=ui=ACXqoRFLEtwSFA%3Btr=DZeqTyQW0qH%3Btm=0-0%3Bts=20110427233838%3Bdct=https://vk.cc/8l7kvh

ptaletybkaptaletybka2018/08/07 04:03[url=http://bakerssign.com]order levitra online[/url] levitra prices walmart http://bakerssign.com

ftaletuglyftaletugly2018/08/07 19:25[url=http://motechautomotive.com]cheap cialis canadian[/url] generic cialis online pharmacy http://motechautomotive.com

vtaletjbmuvtaletjbmu2018/08/08 18:58[url=http://baymontelreno.com]how to buy cialis online[/url] buy cialis online http://baymontelreno.com

italetvkotitaletvkot2018/08/18 09:06[url=http://mphasset.com]how much does viagra cost without insurance[/url] viagra direct http://mphasset.com

htaletrfvghtaletrfvg2018/08/18 14:13[url=http://bakerssign.com]cost levitra[/url] cheapest levitra http://bakerssign.com

ataletqhmbataletqhmb2018/08/18 18:20[url=http://rabbitinahat.com]viagra levitra cialis[/url] cialis works best http://rabbitinahat.com

gtaletaivhgtaletaivh2018/08/18 21:57[url=http://gigawatt6.com]how long does it take cialis 5mg to work[/url] best website to buy cialis http://gigawatt6.com

wtaletxpeowtaletxpeo2018/08/19 01:09[url=http://missreplicawatches.com]prostatitis cialis[/url] cialis product monograph http://missreplicawatches.com

dtalettnuydtalettnuy2018/08/19 04:21[url=http://missreplicawatches.com]cialis price per pill[/url] counterfeit cialis pictures http://missreplicawatches.com

htaletpymthtaletpymt2018/08/19 15:43[url=http://bakerssign.com]uses for levitra[/url] levitra 20mg uk http://bakerssign.com

gtaletzdzpgtaletzdzp2018/08/19 18:29[url=http://missreplicawatches.com]online cialis store[/url] when should you take cialis http://missreplicawatches.com

ftalethdagftalethdag2018/09/11 12:27[url=http://gigawatt6.com]which is better viagra cialis or levitra[/url] cialis how long does it last http://gigawatt6.com

ntaletnbyfntaletnbyf2018/09/11 15:25[url=http://mphasset.com]generic for viagra name[/url] adverse effects of viagra http://mphasset.com

gtaletiprtgtaletiprt2018/09/11 22:33[url=http://gigawatt6.com]how to take cialis 20mg[/url] how fast does cialis 5mg work http://gigawatt6.com

ntaletugcbntaletugcb2018/09/12 05:25[url=http://missreplicawatches.com]buy real cialis[/url] order cialis from canadian pharmacy http://missreplicawatches.com

utaletvsvlutaletvsvl2018/09/12 08:06[url=http://viciolatino.com]viagra online paypal[/url] best online pharmacy for viagra http://viciolatino.com

wtaletmuxjwtaletmuxj2018/09/12 14:54[url=http://gigawatt6.com]cheap cialis black[/url] cheap cialis 20 mg http://gigawatt6.com

ztaletnhfxztaletnhfx2018/09/12 16:55[url=http://canadian-pharmabuy.com]viagra prices[/url] buy viagra 100mg http://canadian-pharmabuy.com

vtalethlumvtalethlum2018/09/12 22:09[url=http://buycialisonl1ne.us]cheap cialis sale online[/url] cialis 5 mg http://buycialisonl1ne.us

ftaletwqzvftaletwqzv2018/09/13 00:09[url=http://missreplicawatches.com]buy cialis with prescription[/url] cialis online with prescription http://missreplicawatches.com

ataletvgseataletvgse2018/09/13 04:24[url=http://rabbitinahat.com]viagra cialis online[/url] cialis canada http://rabbitinahat.com

ztaletqhtvztaletqhtv2018/09/13 08:53[url=http://motechautomotive.com]cheap cialis uk[/url] cialis for sale cheap http://motechautomotive.com

qtaletqkyaqtaletqkya2018/09/13 09:28[url=http://gigawatt6.com]order cialis online us[/url] order cialis no prescription http://gigawatt6.com

ftaletfqryftaletfqry2018/09/13 22:04[url=http://motechautomotive.com]canadian online pharmacy generic cialis[/url] order generic cialis online canada http://motechautomotive.com

vtaletamtyvtaletamty2018/09/14 01:59[url=http://rabbitinahat.com]how to buy cialis online[/url] order 5mg cialis http://rabbitinahat.com

jtalettqqujtalettqqu2018/09/14 04:36[url=http://canadian-pharmasale.com]can you order cialis online[/url] cialis online http://canadian-pharmasale.com

ctaletrrsuctaletrrsu2018/09/14 15:42[url=http://usedrestaurantequipmentaz.com]cheap brand cialis online[/url] order cialis from india http://usedrestaurantequipmentaz.com

gtaletumpsgtaletumps2018/09/15 08:19[url=http://usedrestaurantequipmentaz.com]order generic cialis online canada[/url] order cialis online canadian pharmacy http://usedrestaurantequipmentaz.com

staletiywqstaletiywq2018/09/15 09:46[url=http://valladium.com]cheap cialis in canada[/url] order generic cialis http://valladium.com

qtaletdtujqtaletdtuj2018/09/15 18:48[url=http://top-monterey-salinas-dentists.com]what does levitra do[/url] levitra 20mg tablets http://top-monterey-salinas-dentists.com

xtaletloqrxtaletloqr2018/09/16 00:32[url=http://buyviagraonl1ne.us]viagra for sale online cheap[/url] cheap viagra online pharmacy http://buyviagraonl1ne.us

htaletwonnhtaletwonn2018/09/16 15:35[url=http://top-monterey-salinas-dentists.com]how long does it take for levitra to work[/url] viagra cialis levitra http://top-monterey-salinas-dentists.com

btaletytfbbtaletytfb2018/09/16 22:44[url=http://baymontelreno.com]order cialis no prescription[/url] buy cialis http://baymontelreno.com

utaletorujutaletoruj2018/09/17 02:50[url=http://bullsac.com]levitra online canada[/url] levitra pill http://bullsac.com

ttaletqfwzttaletqfwz2018/09/17 07:17[url=http://unishade.com]order cialis usa[/url] cheap cialis prices http://unishade.com

qtaletjzvhqtaletjzvh2018/09/17 11:57[url=http://buyviagraonl1ne.us]buy viagra in canada[/url] viagra online canada http://buyviagraonl1ne.us

ptaletsjjtptaletsjjt2018/09/17 15:47[url=http://top-monterey-salinas-dentists.com]levitra coupon 3 free pills[/url] levitra super force http://top-monterey-salinas-dentists.com

jtaletbfkcjtaletbfkc2018/09/17 20:18[url=http://waltzweekend.com]cheap viagra canada pharmacy[/url] generic viagra online canadian pharmacy http://waltzweekend.com

wtaletmnniwtaletmnni2018/09/18 05:29[url=http://canadian-pharmabuy.com]generic viagra online usa[/url] generic viagra usa http://canadian-pharmabuy.com

ftaletwmmoftaletwmmo2018/09/18 15:12[url=http://canadian-pharmaonline.com]cheap viagra 100mg[/url] generic viagra online http://canadian-pharmaonline.com

jtaletviejjtaletviej2018/09/19 00:57[url=http://valladium.com]buy cialis online with prescription[/url] cialis price http://valladium.com

ktaletbemuktaletbemu2018/09/19 09:47[url=http://top-monterey-salinas-dentists.com]cost of levitra per pill[/url] levitra brand online http://top-monterey-salinas-dentists.com

gtaletftzegtaletftze2018/09/19 10:48[url=http://motechautomotive.com]cialis online bestellen[/url] cialis coupons online http://motechautomotive.com

mtaletsiwymtaletsiwy2018/09/19 11:24[url=http://gigawatt6.com]cheap cialis uk[/url] generic cialis for sale http://gigawatt6.com

btaletskrjbtaletskrj2018/09/19 21:00[url=http://buycialisonlineglka.com]cheap brand cialis online[/url] generic cialis 60 mg http://buycialisonlineglka.com

qtaletaajcqtaletaajc2018/09/19 21:57[url=http://valladium.com]cialis pill[/url] generic cialis for order http://valladium.com

otaletcmudotaletcmud2018/09/19 22:27[url=http://viciolatino.com]buy viagra canada[/url] cheapest generic viagra online http://viciolatino.com

wtaletyzmdwtaletyzmd2018/09/20 04:28[url=http://buycialisonlineglka.com]cialis online india[/url] discount cialis pills http://buycialisonlineglka.com

qtaletcrkvqtaletcrkv2018/09/20 12:44[url=http://canadian-pharmabuy.com]viagra online[/url] generic viagra online canadian pharmacy http://canadian-pharmabuy.com

ltaletckfultaletckfu2018/09/20 16:42[url=http://timsbmw.com]levitra side effects[/url] levitra dose http://timsbmw.com

otaletfyixotaletfyix2018/09/20 17:29[url=http://gigawatt6.com]cheap cialis black[/url] cialis canada mail order http://gigawatt6.com

ntaletrlmrntaletrlmr2018/09/21 01:04[url=http://top-monterey-salinas-dentists.com]online levitra[/url] viagra cialis levitra http://top-monterey-salinas-dentists.com

ttaletmztfttaletmztf2018/09/21 07:29[url=http://baymontelreno.com]buy cialis non prescription[/url] cialis 5mg online http://baymontelreno.com

utaletreteutaletrete2018/09/24 06:08[url=http://canadian-pharmacyisale.com]viagra canada[/url] viagra price per pill http://canadian-pharmacyisale.com

qtaletiuldqtaletiuld2018/09/24 08:54[url=http://canadian-pharmapills.com]buy viagra pill[/url] viagra online canadian pharmacy http://canadian-pharmapills.com

qtalettdieqtalettdie2018/09/24 17:06[url=http://bullsac.com]levitra used for[/url] how long does 10mg levitra last http://bullsac.com

qtaletuvitqtaletuvit2018/09/24 20:16[url=http://viciolatino.com]buy viagra order[/url] generic viagra 50mg http://viciolatino.com

mtaletibnqmtaletibnq2018/09/25 03:06[url=http://buycialisonlineglka.com]order cialis canadian pharmacy[/url] buy cialis daily online http://buycialisonlineglka.com

qtaletdqobqtaletdqob2018/09/25 06:45[url=http://buycialisonl1ne.us]buy cialis with prescription[/url] buy cialis non prescription http://buycialisonl1ne.us

ftaletfumoftaletfumo2018/09/25 13:27[url=http://canadian-pharmaonline.com]viagra online prescription[/url] cheap viagra sales http://canadian-pharmaonline.com

xtaletsfwaxtaletsfwa2018/09/25 18:37[url=http://timsbmw.com]where can i get levitra[/url] is levitra generic http://timsbmw.com

ptaletjxonptaletjxon2018/09/25 19:45[url=http://bullsac.com]how to take levitra[/url] best price for levitra 20mg http://bullsac.com

utaletfqfbutaletfqfb2018/09/26 00:55[url=http://viciolatino.com]order viagra online without a prescription[/url] order viagra online http://viciolatino.com

otaletijfwotaletijfw2018/09/26 08:26[url=http://canadian-pharmakoani.com]generic viagra pills[/url] buy viagra brand http://canadian-pharmakoani.com

gtaletjvnggtaletjvng2018/09/26 11:21[url=http://canadian-pharmacyibuy.com]order cialis uk[/url] cialis cheap online pharmacy http://canadian-pharmacyibuy.com

qtaletaivgqtaletaivg2018/09/26 21:01[url=http://canadian-pharmamrdi.com]generic cialis from india[/url] cheap cialis pills http://canadian-pharmamrdi.com

ftalethbluftalethblu2018/09/27 03:01[url=http://canadian-pharmamrdi.com]order cialis online[/url] generic cialis lowest price http://canadian-pharmamrdi.com

ytaletyhyaytaletyhya2018/09/27 04:22[url=http://canadian-pharmaorder.com]brand cialis name online order[/url] generic cialis 100mg http://canadian-pharmaorder.com

mtaletomvfmtaletomvf2018/09/27 10:02[url=http://canadian-pharmakgae.com]buy viagra pill[/url] generic viagra soft http://canadian-pharmakgae.com

mtaletephnmtaletephn2018/09/27 14:47[url=http://buycialisonlineglka.com]cialis india cheap order[/url] cheap cialis pills http://buycialisonlineglka.com

ptaletavysptaletavys2018/09/27 16:17[url=http://canadian-pharmapills.com]buy real viagra[/url] cheap price viagra http://canadian-pharmapills.com

xtaletdnkixtaletdnki2018/09/27 19:58[url=http://canadian-pharmacheap.com]generic cialis[/url] order cialis pills online http://canadian-pharmacheap.com

dtaletssjgdtaletssjg2018/09/28 00:48[url=http://viciolatino.com]cheap generic viagra 100mg[/url] viagra pills http://viciolatino.com

rtaletwjamrtaletwjam2018/09/28 14:48[url=http://unishade.com]order cialis online without prescription[/url] cialis online usa http://unishade.com

mtaletfmipmtaletfmip2018/09/28 20:29[url=http://canadian-pharmacyisale.com]cheap female viagra[/url] pfizer viagra online http://canadian-pharmacyisale.com

dtalethtzedtalethtze2018/09/28 20:52[url=http://canadian-pharmaonline.com]viagra coupons[/url] brand viagra online http://canadian-pharmaonline.com

jtalettsiejtalettsie2018/09/29 15:15[url=http://canadian-pharmacyionline.com]cheap female viagra[/url] generic viagra from canada http://canadian-pharmacyionline.com

etaletkimjetaletkimj2018/09/30 09:21[url=http://canadian-pharmamrdi.com]buy generic cialis online with mastercard[/url] cialis 5mg best price http://canadian-pharmamrdi.com

ptalethonkptalethonk2018/09/30 12:50[url=http://canadian-pharmasale.com]order cialis now[/url] cheap brand cialis http://canadian-pharmasale.com

mtaletzeczmtaletzecz2018/10/01 06:42[url=http://canadian-pharmakfxy.com]buy cialis with prescription[/url] can i buy cialis over the counter http://canadian-pharmakfxy.com

ctaletgqudctaletgqud2018/10/01 07:13[url=http://canadian-pharmaorder.com]generic cialis for order[/url] canadian cialis online http://canadian-pharmaorder.com

dtaletjcntdtaletjcnt2018/10/01 10:27[url=http://canadian-pharmacheap.com]order cialis europe[/url] order cialis from canadian pharmacy http://canadian-pharmacheap.com

utaletnwayutaletnway2018/10/01 21:11[url=http://buycialisonlineglka.com]order cialis now[/url] cheap cialis online http://buycialisonlineglka.com

ztaletrzghztaletrzgh2018/10/02 00:16[url=http://canadian-pharmakfxy.com]cialis by mail order[/url] order brand cialis online http://canadian-pharmakfxy.com

italetedenitaleteden2018/10/02 10:59[url=http://valladium.com]generic cialis soft tabs 20mg[/url] best cialis prices http://valladium.com

mtaletnmcqmtaletnmcq2018/10/02 14:32[url=http://canadian-pharmacyisale.com]generic viagra 100mg best price[/url] order viagra using paypal http://canadian-pharmacyisale.com

dtaletoqngdtaletoqng2018/10/03 03:41[url=http://unishade.com]cialis 20mg[/url] order cialis online without prescription http://unishade.com

xtaletpnnsxtaletpnns2018/10/03 06:17[url=http://canadian-pharmacheap.com]order cialis australia online[/url] cialis generic best price http://canadian-pharmacheap.com

otaleteugsotaleteugs2018/10/03 14:40[url=http://missreplicawatches.com]cialis online pay with paypal[/url] buy cialis cheap online http://missreplicawatches.com

ctaletsbonctaletsbon2018/10/03 15:04[url=http://buycialisonl1ne.us]buy brand cialis online in usa[/url] cialis 5 mg canada pharmacy online http://buycialisonl1ne.us

ataletdeklataletdekl2018/10/03 16:53[url=http://canadian-pharmakgae.com]order viagra 50mg pills[/url] ordering viagra online legal http://canadian-pharmakgae.com

italetyylsitaletyyls2018/10/04 08:17[url=http://canadian-pharmasale.com]discount cialis in canada[/url] cheap cialis 20mg http://canadian-pharmasale.com

ktaletzhofktaletzhof2018/10/04 10:52[url=http://canadian-pharmakgae.com]generic viagra without prescription[/url] buy real viagra on line http://canadian-pharmakgae.com

wtaletwjrgwtaletwjrg2018/10/04 15:18[url=http://canadian-pharmakgae.com]buy generic viagra online usa[/url] cheap 25 mg viagra http://canadian-pharmakgae.com

etaletcviietaletcvii2018/10/04 19:04[url=http://bullsac.com]does levitra work better than viagra[/url] levitra half life http://bullsac.com

ftaletvznsftaletvzns2018/10/05 00:00[url=http://unishade.com]legal to buy cialis from canada[/url] purchase cialis online canada http://unishade.com

dtaletsryrdtaletsryr2018/10/05 05:27[url=http://buycialisonlineglka.com]order cialis online pharmacy[/url] buy cialis 20mg http://buycialisonlineglka.com

italetklqeitaletklqe2018/10/06 09:03[url=http://missreplicawatches.com]cheap cialis online overnight shipping[/url] order 5mg cialis http://missreplicawatches.com

qtaletxsxmqtaletxsxm2018/10/06 12:42[url=http://canadian-pharmacyisale.com]discount viagra[/url] viagra pills for mens http://canadian-pharmacyisale.com

ftaletabebftaletabeb2018/10/06 23:40[url=http://canadian-pharmapills.com]best place to buy generic viagra[/url] order viagra pills http://canadian-pharmapills.com

otalettpsyotalettpsy2018/10/07 03:59[url=http://canadian-pharmabuy.com]viagra pills for mens[/url] buy viagra new york http://canadian-pharmabuy.com

ztaletlnecztaletlnec2018/10/07 23:05[url=http://canadian-pharmaorder.com]cialis 5 mg side effects[/url] cheap generic cialis lowest prices http://canadian-pharmaorder.com

ntaletanirntaletanir2018/10/09 10:12[url=http://canadian-pharmapills.com]order 50mg viagra[/url] order prescription viagra http://canadian-pharmapills.com

gtaletuwptgtaletuwpt2018/10/09 13:31[url=http://canadian-pharmasale.com]buy generic cialis[/url] order cialis http://canadian-pharmasale.com

otaletgmhgotaletgmhg2018/10/09 23:56[url=http://canadian-pharmamrdi.com]cialis 20mg online[/url] buy cialis online in usa http://canadian-pharmamrdi.com

ptalethrrnptalethrrn2018/10/10 04:52[url=http://canadian-pharmamrdi.com]cialis patent expiration[/url] cialis medication http://canadian-pharmamrdi.com

utaletaemiutaletaemi2018/10/10 07:49[url=http://baymontelreno.com]non prescription cialis online pharmacy[/url] buy cialis canada pharmacy http://baymontelreno.com

xtaletnaydxtaletnayd2018/10/10 11:26[url=http://canadian-pharmacheap.com]cheap viagra cialis uk[/url] cialis reviews http://canadian-pharmacheap.com

vtaletigqgvtaletigqg2018/10/10 16:11[url=http://gigawatt6.com]cialis over the counter[/url] buy cialis 50mg http://gigawatt6.com

utaletvmjfutaletvmjf2018/10/10 22:47[url=http://canadian-pharmacyibuy.com]order cialis now[/url] order cialis online no prescription canada http://canadian-pharmacyibuy.com

staletyahkstaletyahk2018/10/11 15:43[url=http://vico4me.com]mail order viagra online[/url] viagra generic 25mg http://vico4me.com

otaletlgapotaletlgap2018/10/12 00:23[url=http://canadian-pharmasale.com]is cialis available over the counter in usa[/url] buy cialis online for cheap http://canadian-pharmasale.com

mtaletpnvgmtaletpnvg2018/10/12 11:09[url=http://rabbitinahat.com]cialis professional 20 mg pills[/url] buy cialis cheap canada http://rabbitinahat.com

vtaletjxhbvtaletjxhb2018/10/12 15:10[url=http://baymontelreno.com]buy generic cialis online canada[/url] remedio cialis generico usa http://baymontelreno.com

qtaletyabeqtaletyabe2018/10/12 20:49[url=http://viciolatino.com]female viagra[/url] discount viagra pills http://viciolatino.com

vtaletceyevtaletceye2018/10/13 04:07[url=http://rabbitinahat.com]cialis 60 pills[/url] cialis online canadian pharmacy http://rabbitinahat.com

xtaletzhesxtaletzhes2018/10/13 08:20[url=http://unishade.com]buy cialis canada pharmacy[/url] generic cialis pills http://unishade.com

otaletfyhhotaletfyhh2018/10/13 16:06[url=http://vico4me.com]cheap price viagra[/url] over the counter viagra http://vico4me.com

ctaletpjzkctaletpjzk2018/10/13 18:27[url=http://canadian-pharmamrdi.com]buy cheap cialis uk[/url] order cialis 20mg http://canadian-pharmamrdi.com

otaletkcfdotaletkcfd2018/10/14 05:30[url=http://unishade.com]cialis usa price[/url] cheapest cialis professional http://unishade.com

ttaletoonlttaletoonl2018/10/14 07:34[url=http://zbloggers.com]propecia pills[/url] propecia for sale http://zbloggers.com

vtaletavxrvtaletavxr2018/10/14 18:14[url=http://canadian-pharmamrdi.com]acquistare cialis online[/url] buy cialis online without a prescription http://canadian-pharmamrdi.com

htaletunmthtaletunmt2018/10/14 20:45[url=http://rabbitinahat.com]buy cheap cialis uk[/url] cheap cialis http://rabbitinahat.com

ktaletlntaktaletlnta2018/10/15 14:29[url=http://canadian-pharmamrdi.com]buy brand cialis[/url] how to order cialis online safely http://canadian-pharmamrdi.com

ntaletrrcpntaletrrcp2018/10/16 05:31[url=http://buycialisonlineglka.com]cialis mail order india[/url] cialis canada order http://buycialisonlineglka.com

RolandsuelaRolandsuela2018/10/23 05:35Meet the girls for sex around the world: http://motz.tk/adultdatingonline59719
Free Dating Site for USA Singles: https://atho.me/3Dsa
Online Dating Service: Serious Matchmaking for Singles at Parship: http://motz.tk/adultdatingonline49773
Free Dating Site for CA Singles: https://tinyurl.com/adultdatingonline66678




best dating catch phrasesgreat online dating jokesdating sites for affluentdating detective jersey ukvirginia state laws on dating minorsbest cities to hook up in europedating sites fredericksburg vagay dating in middlesbroughiphone dating applicationspreguntas que se hacen en speed datinginterracial dating centraldating for recovering addictsdating love quotesadvantages of dating a man 15 years olderbeskrivelse af sig selv datingcory monteith and lea michele dating 2010dating sites for singles in their 40sinterracial dating what to expectdating sites dancerrussian dating site funny picsdating on demand loserfirst line internet datingpastor dating siteweird dating sites funnytaking good pictures for dating sitesis justin dating selena 2013cincinnati dating numbersgetting to know someone through online datingdonna macdonald dating a silver fox epubdating tips for the shy womanneed room for dating in karachiserial shaggers guide to internet datingbig bang dating rumorsmatchmaking wot 8.11dating sites for 40 plus

RolandsuelaRolandsuela2018/10/23 18:29Dating women for sex in your town: http://rih.co/adultdatingonline76637
Free Dating Site for CA Singles: http://corta.co/adultdatingonline92691
Free Dating Site for AU Singles: http://perkele.ovh/adultdatingonline71404
Free Dating Site for AU Singles: https://atho.me/3Ds9




free polish dating chicagoabstinence online datingprobleme connexion matchmaking cs goquotes about single moms datingdating a younger girl redditdating sites with no credit card requiredfree dating sites north carolinasafari speed datingvalentine's day speed dating edinburghanimal loving dating sitedating my 5th cousinkannada matchmaking onlinedating scandinaviacarbon dating graphnew dating site in germany for freetaking break datingsarmassophobia fear of datingdating ballarat vicskout dating sitedating places in tampai'm dating two guys helphow to overcome fear of dating after divorcegay dating bristol ukonline dating sites hrvatskaherpes dating site australiahiv hookup kenyadating felonslesbian dating denverspeed dating in west yorkshireonline dating idjodhpur dating clubfree dating site in abu dhabigeek speed dating melbourneamerican dating show 3best online dating canada

トラックバック - http://javascript.g.hatena.ne.jp/Yuichirou/20071002

2007年5月26日

質問 22:21 質問 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); を含むブックマーク はてなブックマーク - 質問 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); 質問 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); のブックマークコメント

"iterate over ***"って日本語だとなんて言うの?

「***の各要素について繰り返し同じ処理をする」ってことなのはわかるけど、これじゃ長すぎる……なるべく一言で。

BoztBozt2013/03/31 20:01Thanks for shiarng. Always good to find a real expert.

kmrlszylbkmrlszylb2013/04/01 18:46vpnDql <a href="http://clfhegslccoq.com/">clfhegslccoq</a>

トラックバック - http://javascript.g.hatena.ne.jp/Yuichirou/20070526

2006年9月29日

専門用語メモ 23:05 専門用語メモ - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); を含むブックマーク はてなブックマーク - 専門用語メモ - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); 専門用語メモ - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); のブックマークコメント

よく使われたり訳に気をつけるべき英単語・熟語や、難しい用語の意味メモ

object
オブジェクトJavaScriptにおいてオブジェクトとは、プロパティ(property)の順不同な集合である。
property
プロパティJIS用語では「特性」と訳されているが、カタカナ語が普及したためこれは使わない。またDOMで定義されるインターフェースでは"attribute"の語が使われるが、HTML/XMLの「属性」と区別するため「プロパティ」と訳す。
method
メソッド。JavaScriptにおいてメソッドは関数を保持するプロパティのことであり、プロパティの一部である。
normalize
正規化。データ中の冗長な部分を最適化すること。
canonicalize
正準化。データ中の揺れが起こる表記を統一すること。
element
HTML/XMLの「要素」。
attribute
HTML/XMLの「属性」。
specify
指定する。
implement
実装する。ex.)"DOM implementation"=「DOM実装システム
represent
~を表す。たいてい「~に対応する」と言い換えられる。
-ate
~化する。ex.)"instantiate"=「インスタンス化する」
in use
利用する(何か)。
processing instruction
処理命令。
ID
識別子。

ReeganReegan2011/07/23 07:40You put the lime in the cocnout and drink the article up.

rfukjerfukje2011/07/23 17:57D5J0nE <a href="http://oseglndtbddg.com/">oseglndtbddg</a>

feyewmjjfeyewmjj2011/07/24 21:068AnUIQ , [url=http://papmevqqjsaj.com/]papmevqqjsaj[/url], [link=http://banemlhhxzes.com/]banemlhhxzes[/link], http://xyfxgdrowxzm.com/

ykkrarkbsykkrarkbs2011/07/25 20:55BRJCEE <a href="http://dsklmyshfake.com/">dsklmyshfake</a>

vssjfrhlfquvssjfrhlfqu2011/07/26 23:45qZHYPM , [url=http://qdswkpgofvkn.com/]qdswkpgofvkn[/url], [link=http://etlrbmqbolcm.com/]etlrbmqbolcm[/link], http://ggwjhspyngim.com/

CherryCherry2013/04/02 17:41Your's is a point of view where real intelligence shines trhough.

MandyMandy2013/07/05 19:36If my problem was a Death Star, this article is a photon <a href="http://ewxjhvybpc.com">todrpeo.</a>

MandyMandy2013/07/05 19:36If my problem was a Death Star, this article is a photon <a href="http://ewxjhvybpc.com">todrpeo.</a>

MandyMandy2013/07/05 19:36If my problem was a Death Star, this article is a photon <a href="http://ewxjhvybpc.com">todrpeo.</a>

EzzeddienEzzeddien2013/07/06 17:53I'm so glad that the inrentet allows free info like this! http://bpthhgoozfg.com [url=http://qwyorabjmd.com]qwyorabjmd[/url] [link=http://idgowxlayzc.com]idgowxlayzc[/link]

EzzeddienEzzeddien2013/07/06 17:53I'm so glad that the inrentet allows free info like this! http://bpthhgoozfg.com [url=http://qwyorabjmd.com]qwyorabjmd[/url] [link=http://idgowxlayzc.com]idgowxlayzc[/link]

EzzeddienEzzeddien2013/07/06 17:53I'm so glad that the inrentet allows free info like this! http://bpthhgoozfg.com [url=http://qwyorabjmd.com]qwyorabjmd[/url] [link=http://idgowxlayzc.com]idgowxlayzc[/link]

RaghavRaghav2013/07/08 12:18One or two to remrebme, that is. http://angppyf.com [url=http://rlmeqgkh.com]rlmeqgkh[/url] [link=http://uyxarnp.com]uyxarnp[/link]

RaghavRaghav2013/07/08 12:18One or two to remrebme, that is. http://angppyf.com [url=http://rlmeqgkh.com]rlmeqgkh[/url] [link=http://uyxarnp.com]uyxarnp[/link]

RaghavRaghav2013/07/08 12:18One or two to remrebme, that is. http://angppyf.com [url=http://rlmeqgkh.com]rlmeqgkh[/url] [link=http://uyxarnp.com]uyxarnp[/link]

JoeieJoeie2016/04/29 08:40Ho fatto un messaggio di ritrgaziamenno a : e mi ha risposto il magistrato con una mail di ringraziamento e di incitamento a sua volta. Ci sono ancora di questi italiani, ecco perche’ ha ragione Andrea!

WimpyWimpy2016/04/29 14:08can see to it that the <a href="http://ezizcxtqlo.com">coclnacepmy</a> ends today by taking your own action to get the word out. There are several ways that have been outlined in these threads that cost very little. Which one are you doing this week? Your individual action will inspire others. Rely on it.

BunnyBunny2016/05/02 19:44I just tried it and I'm happy to report that it works <a href="http://yjnwbxl.com">bellfituuay.</a> My ancient laptop has never been able to display YouTube videos smoothly... until today. (running Chrome on Fedora 11)What a rare treat that my computer actually got a little bit faster with age!I too hope for a widely supported open video format someday, but this is a giant leap in the right direction. Thanks Google!

FinchFinch2016/05/03 19:55Gina I can no longer share posts from my business pa#87ge21&;s news feed onto the timeline. I go through the process and get a message saying that the post was successfully shared, but it isn’t there. Anyone know what’s going on? And yes, I am making sure to designate the proper location from the top left drop down menu. Thanks! http://yzegwvsuikh.com [url=http://fxorjhyule.com]fxorjhyule[/url] [link=http://tsgcrsuf.com]tsgcrsuf[/link]

トラックバック - http://javascript.g.hatena.ne.jp/Yuichirou/20060929

2006年9月28日

すごくがんばった翻訳 22:06 すごくがんばった翻訳 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); を含むブックマーク はてなブックマーク - すごくがんばった翻訳 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); すごくがんばった翻訳 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); のブックマークコメント

Document Object Model (DOM) Level 3 Core SpecificationのcreateElementの項目を読みながらkeyword:createElementを書いていたら、"canonical form"という言葉にぶち当たりました。

"canonical"をググると一番にCanonicalの訳し方というページがあって、それによると

  • "canonical"の原義は「キリスト教教会法(教会の戒律)に基づく」
  • 正規(な)」と訳すと無難だが、これは"normal"の訳として広く知られており、実は全く違う言葉を同じ訳にするのはまずい。
    • ex) "normal form"=「正規形」、"normalize"=「正規化」

で、最終的にその人は「キャノニカル」としたそうです。


しかし私は諦めず、検索結果の下のほうを見てみました。

すると、"canonical"は物理学などの世界では「正準(な)」という一種の造語で訳されていることが判明。漢字意味合いもピッタリだったので早速コレを採用し、「正準(canonical)な形」としました。

物理学などでは割とポピュラーな訳し方のようなので、ぜひウェブの世界でも"canonical"=「正準(な)」という訳を使ってみるといいと思いました。

トラックバック - http://javascript.g.hatena.ne.jp/Yuichirou/20060928

2006年9月27日

「子孫をIDで検索」にすごい違和感 21:58 「子孫をIDで検索」にすごい違和感 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); を含むブックマーク はてなブックマーク - 「子孫をIDで検索」にすごい違和感 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); 「子孫をIDで検索」にすごい違和感 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); のブックマークコメント

いきなりこんなこと言うのは失礼だと思うけど、g:javascript:id:tetsu23:20060803:1154481469にすごい違和感を感じます。


関数gchildは『element以下のidが一致するノード』のうち最初にヒットしたもの、関数gchildsは全部取ってくる関数。それはコード上間違いないです。

でもそれは、HTMLにおいてidとは何か、ってのを勘違いしているんです。


HTMLにおいて、idとはその文書中の一部分を指し示すユニークな識別子なんです。

"unique"――カタカナ語では「独特の」って意味でよく使うけど、元々の意味は「唯一の」。

つまり、あるidの値は1つのHTML文書中にただ1つしか存在しないはずなんです。


ちなみに、そのHTML文書にただ1つしかないというidを使ってノードを取り出す、getElementByIdという関数があります。

var hatena = document.getElementById("hatena");

idは唯一無二であり、何か特定のノードの下にある、というような限定は必要ありませんので、getElementByIddocumentのみが持つメソッドです。


ちなみに、おそらくid:tetsu23さんはHTML初心者から中級者によくある、idclassの混同を起こしていると思います。

idは1つのHTML文書中にただ1つ、ですが、classはいくらでも使えます。

よって、gchildやgchildsは、『element以下のclassが一致するノード』を検索するようにすればいいと思います。

tetsu23tetsu232006/09/28 14:27あーなるほど。IDは一意なんですね。失礼しました。

CadenCaden2011/12/17 14:47No quseiton this is the place to get this info, thanks y'all.

akzicehtitcakzicehtitc2011/12/18 23:295acmXt , [url=http://ubtwzmlnvghj.com/]ubtwzmlnvghj[/url], [link=http://wxrxpqczikll.com/]wxrxpqczikll[/link], http://dkmsvukylfrs.com/

djwpfwqjdjwpfwqj2011/12/19 19:19FzmryQ <a href="http://azttshbqfddf.com/">azttshbqfddf</a>

トラックバック - http://javascript.g.hatena.ne.jp/Yuichirou/20060927

2006年9月25日

はじめまして! 22:14 はじめまして! - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); を含むブックマーク はてなブックマーク - はじめまして! - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); はじめまして! - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); のブックマークコメント

Yuichirouと申します。


JavaScript大好きです。

HTMLCSSも好きです。

もちろんDOMはお手のものです。

Greasemonkey大好きです。

今までに「はてなRSSのRSSリーダーページに「手動更新」ボタンを付けるGMスクリプト」「はてなわんわんワールドに吹き出し表示切替機能を付けるGMスクリプト」などを作りました。


これからもよろしく!

DOMに関するグループキーワードに説明を入れる準備 23:02 DOMに関するグループキーワードに説明を入れる準備 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); を含むブックマーク はてなブックマーク - DOMに関するグループキーワードに説明を入れる準備 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); DOMに関するグループキーワードに説明を入れる準備 - javascript:(function() { document.title = "YuichirouのJavaScriptメモ"; })(); のブックマークコメント

interface Document : Node {
  readonly attribute DocumentType     doctype;
  readonly attribute DOMImplementation  implementation;
  readonly attribute Element          documentElement;
  Element            createElement(in DOMString tagName)
                                        raises(DOMException);
  DocumentFragment   createDocumentFragment();
  Text               createTextNode(in DOMString data);
  Comment            createComment(in DOMString data);
  CDATASection       createCDATASection(in DOMString data)
                                        raises(DOMException);
  ProcessingInstruction createProcessingInstruction(in DOMString target, 
                                                    in DOMString data)
                                        raises(DOMException);
  Attr               createAttribute(in DOMString name)
                                        raises(DOMException);
  EntityReference    createEntityReference(in DOMString name)
                                        raises(DOMException);
  NodeList           getElementsByTagName(in DOMString tagname);
  // Introduced in DOM Level 2:

  Node               importNode(in Node importedNode, 
                                in boolean deep)
                                        raises(DOMException);
  // Introduced in DOM Level 2:

  Element            createElementNS(in DOMString namespaceURI, 
                                     in DOMString qualifiedName)
                                        raises(DOMException);
  // Introduced in DOM Level 2:

  Attr               createAttributeNS(in DOMString namespaceURI, 
                                       in DOMString qualifiedName)
                                        raises(DOMException);
  // Introduced in DOM Level 2:

  NodeList           getElementsByTagNameNS(in DOMString namespaceURI, 
                                            in DOMString localName);
  // Introduced in DOM Level 2:
  Element            getElementById(in DOMString elementId);
};
Document Object Model Core - Interface Document
interface Node {

  // NodeType
  const unsigned short      ELEMENT_NODE                   = 1;
  const unsigned short      ATTRIBUTE_NODE                 = 2;
  const unsigned short      TEXT_NODE                      = 3;
  const unsigned short      CDATA_SECTION_NODE             = 4;
  const unsigned short      ENTITY_REFERENCE_NODE          = 5;
  const unsigned short      ENTITY_NODE                    = 6;
  const unsigned short      PROCESSING_INSTRUCTION_NODE    = 7;
  const unsigned short      COMMENT_NODE                   = 8;
  const unsigned short      DOCUMENT_NODE                  = 9;
  const unsigned short      DOCUMENT_TYPE_NODE             = 10;
  const unsigned short      DOCUMENT_FRAGMENT_NODE         = 11;
  const unsigned short      NOTATION_NODE                  = 12;

  readonly attribute DOMString        nodeName;
           attribute DOMString        nodeValue;
                                        // raises(DOMException) on setting

                                        // raises(DOMException) on retrieval

  readonly attribute unsigned short   nodeType;
  readonly attribute Node             parentNode;
  readonly attribute NodeList         childNodes;
  readonly attribute Node             firstChild;
  readonly attribute Node             lastChild;
  readonly attribute Node             previousSibling;
  readonly attribute Node             nextSibling;
  readonly attribute NamedNodeMap     attributes;
  // Modified in DOM Level 2:

  readonly attribute Document         ownerDocument;
  Node               insertBefore(in Node newChild, 
                                  in Node refChild)
                                        raises(DOMException);
  Node               replaceChild(in Node newChild, 
                                  in Node oldChild)
                                        raises(DOMException);
  Node               removeChild(in Node oldChild)
                                        raises(DOMException);
  Node               appendChild(in Node newChild)
                                        raises(DOMException);
  boolean            hasChildNodes();
  Node               cloneNode(in boolean deep);
  // Modified in DOM Level 2:

  void               normalize();
  // Introduced in DOM Level 2:
  boolean            isSupported(in DOMString feature, 
                                 in DOMString version);
  // Introduced in DOM Level 2:

  readonly attribute DOMString        namespaceURI;
  // Introduced in DOM Level 2:
           attribute DOMString        prefix;
                                        // raises(DOMException) on setting

  // Introduced in DOM Level 2:
  readonly attribute DOMString        localName;
  // Introduced in DOM Level 2:
  boolean            hasAttributes();
};
Document Object Model Core - Interface Node
トラックバック - http://javascript.g.hatena.ne.jp/Yuichirou/20060925