mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-28 07:05:45 +01:00
Death to E4X and stuff.
This commit is contained in:
1
common/bootstrap.js
vendored
1
common/bootstrap.js
vendored
@@ -135,6 +135,7 @@ let JSMLoader = {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
debug("Loading " + name + ": " + e);
|
debug("Loading " + name + ": " + e);
|
||||||
|
delete this.globals[uri];
|
||||||
|
|
||||||
if (typeof e != "string")
|
if (typeof e != "string")
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2010 by anekos <anekos@snca.net>
|
// Copyright (c) 2010 by anekos <anekos@snca.net>
|
||||||
// Copyright (c) 2010-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2010-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -1898,7 +1898,8 @@ var ItemList = Class("ItemList", {
|
|||||||
["div", { highlight: "CompItem NonText" },
|
["div", { highlight: "CompItem NonText" },
|
||||||
"~"])]],
|
"~"])]],
|
||||||
|
|
||||||
get itemCount() this.context.contextList.reduce(function (acc, ctxt) acc + ctxt.items.length, 0),
|
get itemCount() this.context.contextList
|
||||||
|
.reduce(function (acc, ctxt) acc + ctxt.items.length, 0),
|
||||||
|
|
||||||
get visible() !this.container.collapsed,
|
get visible() !this.container.collapsed,
|
||||||
set visible(val) this.container.collapsed = !val,
|
set visible(val) this.container.collapsed = !val,
|
||||||
@@ -2168,9 +2169,11 @@ var ItemList = Class("ItemList", {
|
|||||||
let off = group.getOffset(idx);
|
let off = group.getOffset(idx);
|
||||||
|
|
||||||
start = Math.constrain(start,
|
start = Math.constrain(start,
|
||||||
off + Math.min(this.CONTEXT_LINES, group.itemCount - idx + group.offsets.end)
|
off + Math.min(this.CONTEXT_LINES,
|
||||||
|
group.itemCount - idx + group.offsets.end)
|
||||||
- this.maxItems + 1,
|
- this.maxItems + 1,
|
||||||
off - Math.min(this.CONTEXT_LINES, idx + group.offsets.start));
|
off - Math.min(this.CONTEXT_LINES,
|
||||||
|
idx + group.offsets.start));
|
||||||
}
|
}
|
||||||
|
|
||||||
let count = this.maxItems;
|
let count = this.maxItems;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -1231,7 +1231,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
body.push(info);
|
body.push(info);
|
||||||
}
|
}
|
||||||
else if (DOM.isJSONXML(info)) {
|
else if (DOM.isJSONXML(info)) {
|
||||||
let langs = info.slice(2).filter(function (e) isArray(e) && isObject(e[1]) && e[1].leng);
|
let langs = info.slice(2).filter(function (e) isArray(e) && isObject(e[1]) && e[1].lang);
|
||||||
if (langs) {
|
if (langs) {
|
||||||
let lang = config.bestLocale(l[1].lang for each (l in langs));
|
let lang = config.bestLocale(l[1].lang for each (l in langs));
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ catch (e) { __dactyl_eval_error = e; }
|
|||||||
// IMPORTANT: The eval statement *must* remain on the first line
|
// IMPORTANT: The eval statement *must* remain on the first line
|
||||||
// in order for line numbering in any errors to remain correct.
|
// in order for line numbering in any errors to remain correct.
|
||||||
|
|
||||||
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2009-2011 by Kris Maglione <kris@vimperator.org>
|
// Copyright (c) 2009-2012 Kris Maglione <kris@vimperator.org>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2009-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2009-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
// Copyright (c) 2009-2010 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2009-2010 by Doug Kearns <dougkearns@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2009-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2009-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2011-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2011-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2010-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2010-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -11,7 +11,7 @@ defineModule("dom", {
|
|||||||
|
|
||||||
lazyRequire("highlight", ["highlight"]);
|
lazyRequire("highlight", ["highlight"]);
|
||||||
lazyRequire("messages", ["_"]);
|
lazyRequire("messages", ["_"]);
|
||||||
lazyRequire("template", ["template"]);
|
lazyRequire("template", ["template", "template_"]);
|
||||||
|
|
||||||
var XBL = Namespace("xbl", "http://www.mozilla.org/xbl");
|
var XBL = Namespace("xbl", "http://www.mozilla.org/xbl");
|
||||||
var XHTML = Namespace("html", "http://www.w3.org/1999/xhtml");
|
var XHTML = Namespace("html", "http://www.w3.org/1999/xhtml");
|
||||||
@@ -561,14 +561,13 @@ var DOM = Class("DOM", {
|
|||||||
* representation of this node.
|
* representation of this node.
|
||||||
*/
|
*/
|
||||||
repr: function repr(color) {
|
repr: function repr(color) {
|
||||||
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
|
||||||
|
|
||||||
function namespaced(node) {
|
function namespaced(node) {
|
||||||
var ns = DOM.namespaceNames[node.namespaceURI] || /^(?:(.*?):)?/.exec(node.name)[0];
|
var ns = DOM.namespaceNames[node.namespaceURI] || /^(?:(.*?):)?/.exec(node.name)[1];
|
||||||
if (!ns)
|
if (!ns)
|
||||||
return node.localName;
|
return node.localName;
|
||||||
if (color)
|
if (color)
|
||||||
return <><span highlight="HelpXMLNamespace">{ns}</span>{node.localName}</>
|
return [["span", { highlight: "HelpXMLNamespace" }, ns],
|
||||||
|
node.localName];
|
||||||
return ns + ":" + node.localName;
|
return ns + ":" + node.localName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -577,20 +576,24 @@ var DOM = Class("DOM", {
|
|||||||
try {
|
try {
|
||||||
let hasChildren = elem.firstChild && (!/^\s*$/.test(elem.firstChild) || elem.firstChild.nextSibling)
|
let hasChildren = elem.firstChild && (!/^\s*$/.test(elem.firstChild) || elem.firstChild.nextSibling)
|
||||||
if (color)
|
if (color)
|
||||||
res.push(<span highlight="HelpXML"><span highlight="HelpXMLTagStart"><{
|
res.push(["span", { highlight: "HelpXML" },
|
||||||
namespaced(elem)} {
|
["span", { highlight: "HelpXMLTagStart" },
|
||||||
template.map(array.iterValues(elem.attributes),
|
"<", namespaced(elem), " ",
|
||||||
function (attr)
|
template_.map(array.iterValues(elem.attributes),
|
||||||
<span highlight="HelpXMLAttribute">{namespaced(attr)}</span> +
|
function (attr) [
|
||||||
<span highlight="HelpXMLString">{attr.value}</span>,
|
["span", { highlight: "HelpXMLAttribute" }, namespaced(attr)],
|
||||||
<> </>)
|
["span", { highlight: "HelpXMLString" }, attr.value]
|
||||||
}{ !hasChildren ? "/>" : ">"
|
],
|
||||||
}</span>{ !hasChildren ? "" : <>...</> +
|
" "),
|
||||||
<span highlight="HtmlTagEnd"><{namespaced(elem)}></span>
|
!hasChildren ? "/>" : ">",
|
||||||
}</span>);
|
],
|
||||||
|
!hasChildren ? "" :
|
||||||
|
["", "...",
|
||||||
|
["span", { highlight: "HtmlTagEnd" },"<", namespaced(elem), ">"]]
|
||||||
|
]);
|
||||||
else {
|
else {
|
||||||
let tag = "<" + [namespaced(elem)].concat(
|
let tag = "<" + [namespaced(elem)].concat(
|
||||||
[namespaced(a) + "=" + template.highlight(a.value, true)
|
[namespaced(a) + '="' + String.replace(a.value, /["<]/, DOM.escapeHTML) + '"'
|
||||||
for ([i, a] in array.iterItems(elem.attributes))]).join(" ");
|
for ([i, a] in array.iterItems(elem.attributes))]).join(" ");
|
||||||
|
|
||||||
res.push(tag + (!hasChildren ? "/>" : ">...</" + namespaced(elem) + ">"));
|
res.push(tag + (!hasChildren ? "/>" : ">...</" + namespaced(elem) + ">"));
|
||||||
@@ -600,7 +603,8 @@ var DOM = Class("DOM", {
|
|||||||
res.push({}.toString.call(elem));
|
res.push({}.toString.call(elem));
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
return template.map(res, util.identity, <>,</>);
|
res = template_.map(res, util.identity, ",");
|
||||||
|
return color ? res : res.join("");
|
||||||
},
|
},
|
||||||
|
|
||||||
attr: function attr(key, val) {
|
attr: function attr(key, val) {
|
||||||
@@ -1589,13 +1593,7 @@ var DOM = Class("DOM", {
|
|||||||
|
|
||||||
attr = attr || {};
|
attr = attr || {};
|
||||||
|
|
||||||
function parseNamespace(name) {
|
function parseNamespace(name) DOM.parseNamespace(name, namespaces);
|
||||||
if (name == "xmlns")
|
|
||||||
return ["xmlns", ""];
|
|
||||||
|
|
||||||
var m = /^(?:(.*):)?(.*)$/.exec(name);
|
|
||||||
return [namespaces[m[1]], m[2]];
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: Surely we can do better.
|
// FIXME: Surely we can do better.
|
||||||
for (var key in attr) {
|
for (var key in attr) {
|
||||||
@@ -1608,13 +1606,8 @@ var DOM = Class("DOM", {
|
|||||||
|
|
||||||
var args = Array.slice(args, 2);
|
var args = Array.slice(args, 2);
|
||||||
var vals = parseNamespace(name);
|
var vals = parseNamespace(name);
|
||||||
try {
|
var elem = doc.createElementNS(vals[0] || namespaces[""],
|
||||||
var elem = doc.createElementNS(vals[0] || namespaces[""],
|
name);
|
||||||
name);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
util.dump("FOO", vals[0] || namespaces[""], name);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var key in attr)
|
for (var key in attr)
|
||||||
if (!/^xmlns(?:$|:)/.test(key)) {
|
if (!/^xmlns(?:$|:)/.test(key)) {
|
||||||
@@ -1623,7 +1616,7 @@ var DOM = Class("DOM", {
|
|||||||
nodes[val] = elem;
|
nodes[val] = elem;
|
||||||
|
|
||||||
vals = parseNamespace(key);
|
vals = parseNamespace(key);
|
||||||
if (vals[0] == "xmlns" || key == "highlight")
|
if (key == "highlight")
|
||||||
;
|
;
|
||||||
else if (typeof val == "function")
|
else if (typeof val == "function")
|
||||||
elem.addEventListener(key.replace(/^on/, ""), val, false);
|
elem.addEventListener(key.replace(/^on/, ""), val, false);
|
||||||
@@ -1650,7 +1643,7 @@ var DOM = Class("DOM", {
|
|||||||
"": "http://www.w3.org/1999/xhtml",
|
"": "http://www.w3.org/1999/xhtml",
|
||||||
dactyl: String(NS),
|
dactyl: String(NS),
|
||||||
html: "http://www.w3.org/1999/xhtml",
|
html: "http://www.w3.org/1999/xhtml",
|
||||||
xmlns: "xmlns",
|
xmlns: "http://www.w3.org/2000/xmlns/",
|
||||||
xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@@ -1823,12 +1816,13 @@ var DOM = Class("DOM", {
|
|||||||
return tag(xml, namespaces, "")
|
return tag(xml, namespaces, "")
|
||||||
},
|
},
|
||||||
|
|
||||||
parseNamespace: function parseNamespace(name) {
|
parseNamespace: function parseNamespace(name, namespaces) {
|
||||||
if (name == "xmlns")
|
if (name == "xmlns")
|
||||||
return ["xmlns", ""];
|
return [DOM.fromJSON.namespaces.xmlns, "xmlns"];
|
||||||
|
|
||||||
var m = /^(?:(.*):)?(.*)$/.exec(name);
|
var m = /^(?:(.*):)?(.*)$/.exec(name);
|
||||||
return [DOM.fromJSON.namespaces[m[1]], m[2]];
|
return [(namespaces || DOM.fromJSON.namespaces)[m[1]],
|
||||||
|
m[2]];
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2011-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2012 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2012 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2012 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
// Some code based on Venkman
|
// Some code based on Venkman
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2009-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2009-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2011-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2009-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2009-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -279,9 +279,7 @@ var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReferen
|
|||||||
name = attr, val = attrs[attr];
|
name = attr, val = attrs[attr];
|
||||||
|
|
||||||
savedAttrs.push([elem, ns, name, getAttr(elem, ns, name), val]);
|
savedAttrs.push([elem, ns, name, getAttr(elem, ns, name), val]);
|
||||||
if (ns == "xmlns")
|
if (name === "highlight")
|
||||||
;
|
|
||||||
else if (name === "highlight")
|
|
||||||
highlight.highlightNode(elem, val);
|
highlight.highlightNode(elem, val);
|
||||||
else
|
else
|
||||||
elem.setAttributeNS(ns || "", name, val);
|
elem.setAttributeNS(ns || "", name, val);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Copyright (c) 2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2009-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2009-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
defineModule("styles", {
|
defineModule("styles", {
|
||||||
exports: ["Style", "Styles", "styles"],
|
exports: ["Style", "Styles", "styles"],
|
||||||
@@ -741,28 +741,29 @@ var Styles = Module("Styles", {
|
|||||||
let patterns = Styles.patterns;
|
let patterns = Styles.patterns;
|
||||||
|
|
||||||
template.highlightCSS = function highlightCSS(css) {
|
template.highlightCSS = function highlightCSS(css) {
|
||||||
XML.prettyPrinting = XML.ignoreWhitespace = false;
|
|
||||||
|
|
||||||
return this.highlightRegexp(css, patterns.property, function (match) {
|
return this.highlightRegexp(css, patterns.property, function (match) {
|
||||||
if (!match.length)
|
if (!match.length)
|
||||||
return <></>;
|
return [];
|
||||||
return <>{match.preSpace}{template.filter(match.name)}: {
|
return ["", match.preSpace, template_.filter(match.name), ": ",
|
||||||
|
|
||||||
template.highlightRegexp(match.value, patterns.token, function (match) {
|
template_.highlightRegexp(match.value, patterns.token, function (match) {
|
||||||
if (match.function)
|
if (match.function)
|
||||||
return <>{template.filter(match.word)}{
|
return ["", template_.filter(match.word),
|
||||||
template.highlightRegexp(match.function, patterns.string,
|
template_.highlightRegexp(match.function, patterns.string,
|
||||||
function (match) <span highlight="String">{match.string}</span>)
|
function (match) ["span", { highlight: "String" }, match.string])
|
||||||
}</>;
|
];
|
||||||
if (match.important == "!important")
|
if (match.important == "!important")
|
||||||
return <span highlight="String">{match.important}</span>;
|
return ["span", { highlight: "String" }, match.important];
|
||||||
if (match.string)
|
if (match.string)
|
||||||
return <span highlight="String">{match.string}</span>;
|
return ["span", { highlight: "String" }, match.string];
|
||||||
return template.highlightRegexp(match.wholeMatch, /^(\d+)(em|ex|px|in|cm|mm|pt|pc)?/g,
|
return template.highlightRegexp(match.wholeMatch, /^(\d+)(em|ex|px|in|cm|mm|pt|pc)?/g,
|
||||||
function (m, n, u) <><span highlight="Number">{n}</span><span highlight="Object">{u || ""}</span></>);
|
function (m, n, u) [
|
||||||
})
|
["span", { highlight: "Number" }, n],
|
||||||
|
["span", { highlight: "Object" }, u || ""]
|
||||||
}{ match.postSpace }</>
|
]);
|
||||||
|
}),
|
||||||
|
match.postSpace
|
||||||
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -1078,7 +1078,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
if (~["boolean", "number"].indexOf(typeof data) || data === null)
|
if (~["boolean", "number"].indexOf(typeof data) || data === null)
|
||||||
res.push(String(data));
|
res.push(String(data));
|
||||||
else if (isinstance(data, ["String", _]))
|
else if (isinstance(data, ["String", _]))
|
||||||
res.push(String.quote(data));
|
res.push(JSON.stringify(String(data)));
|
||||||
else if (isArray(data)) {
|
else if (isArray(data)) {
|
||||||
if (data.length == 0)
|
if (data.length == 0)
|
||||||
res.push("[]");
|
res.push("[]");
|
||||||
@@ -1100,7 +1100,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
for (let [key, val] in Iterator(data)) {
|
for (let [key, val] in Iterator(data)) {
|
||||||
if (i++)
|
if (i++)
|
||||||
res.push(",\n");
|
res.push(",\n");
|
||||||
res.push(prefix, String.quote(key), ": ")
|
res.push(prefix, JSON.stringify(key), ": ")
|
||||||
rec(val, prefix, seen);
|
rec(val, prefix, seen);
|
||||||
}
|
}
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user