(?:(?: .*|)\n)*)', re.M)
- redocmcode = re.compile('(^ *(`{3,}|~{3,}).*?\\2)', re.M | re.S)
-
- def __init__(self, text, location):
- self.__dict__['docstrings'] = []
- self.__dict__['text'] = text
-
- self.__dict__['location'] = location
- self.__dict__['_resolved'] = False
-
- self.doc = text
- self.brief = ''
-
- def __setattr__(self, name, val):
- if not name in self.docstrings:
- self.docstrings.append(name)
-
- if isinstance(val, dict):
- for key in val:
- if not isinstance(val[key], Comment.String):
- val[key] = Comment.String(val[key])
- elif not isinstance(val, Comment.String):
- val = Comment.String(val)
-
- self.__dict__[name] = val
-
- def __nonzero__(self):
- return (bool(self.brief) and not (self.brief == u'*documentation missing...*')) or (bool(self.doc) and not (self.doc == u'*documentation missing...*'))
-
- def redoccode_split(self, doc):
- # Split on C/C++ code
- components = Comment.redoccode.split(doc)
- ret = []
-
- for i in range(0, len(components), 2):
- r = Comment.redocmcode.split(components[i])
-
- for j in range(0, len(r), 3):
- ret.append(r[j])
-
- if j < len(r) - 1:
- ret.append(Comment.MarkdownCode(r[j + 1]))
-
- if i < len(components) - 1:
- ret.append(Comment.Example(components[i + 1]))
-
- return ret
-
- def redoc_split(self, doc):
- ret = []
-
- # First split examples
- components = self.redoccode_split(doc)
-
- for c in components:
- if isinstance(c, Comment.Example) or isinstance(c, Comment.MarkdownCode):
- ret.append((c, None, None))
- else:
- lastpos = 0
-
- for m in Comment.redocref.finditer(c):
- span = m.span(0)
-
- prefix = c[lastpos:span[0]]
- lastpos = span[1]
-
- ref = m.group('ref')
- refname = m.group('refname')
-
- if not refname:
- refname = None
-
- if len(m.group('isregex')) > 0:
- ref = re.compile(ref)
-
- ret.append((prefix, ref, refname))
-
- ret.append((c[lastpos:], None, None))
-
- return ret
-
- def resolve_refs_for_doc(self, doc, resolver, root):
- comps = self.redoc_split(utf8.utf8(doc))
- components = []
-
- for pair in comps:
- prefix, name, refname = pair
- components.append(prefix)
-
- if name is None:
- continue
-
- if isinstance(name, utf8.string):
- names = name.split('::')
- else:
- names = [name]
-
- nds = [root]
-
- for j in range(len(names)):
- newnds = []
-
- for n in nds:
- newnds += resolver(n, names[j], j == 0)
-
- if len(newnds) == 0:
- break
-
- nds = newnds
-
- if len(newnds) > 0:
- components.append((newnds, refname))
- else:
- components.append(Comment.UnresolvedReference(name))
-
- doc.components = components
-
- def resolve_refs(self, resolver, root):
- if self.__dict__['_resolved']:
- return
-
- self.__dict__['_resolved'] = True
-
- for name in self.docstrings:
- doc = getattr(self, name)
-
- if not doc:
- continue
-
- if isinstance(doc, dict):
- for key in doc:
- if not isinstance(doc[key], Comment.String):
- doc[key] = Comment.String(doc[key])
-
- self.resolve_refs_for_doc(doc[key], resolver, root)
- else:
- self.resolve_refs_for_doc(doc, resolver, root)
-
-class RangeMap(Sorted):
- Item = Struct.define('Item', obj=None, start=0, end=0)
-
- def __init__(self):
- super(RangeMap, self).__init__(key=lambda x: x.start)
-
- self.stack = []
-
- def push(self, obj, start):
- self.stack.append(RangeMap.Item(obj=obj, start=start, end=start))
-
- def pop(self, end):
- item = self.stack.pop()
- item.end = end
-
- self.insert(item)
-
- def insert(self, item, start=None, end=None):
- if not isinstance(item, RangeMap.Item):
- item = RangeMap.Item(obj=item, start=start, end=end)
-
- self.insert_right(item)
-
- def find(self, i):
- # Finds object for which i falls in the range of that object
- idx = bisect.bisect_right(self.keys, i)
-
- # Go back up until falls within end
- while idx > 0:
- idx -= 1
-
- o = self[idx]
-
- if i <= o.end:
- return o.obj
-
- return None
-
-class CommentsDatabase(object):
- cldoc_instrre = re.compile('^cldoc:([a-zA-Z_-]+)(\(([^\)]*)\))?')
-
- def __init__(self, filename, tu):
- self.filename = filename
-
- self.categories = RangeMap()
- self.comments = Sorted(key=lambda x: x.location.offset)
-
- self.extract(filename, tu)
-
- def parse_cldoc_instruction(self, token, s):
- m = CommentsDatabase.cldoc_instrre.match(s)
-
- if not m:
- return False
-
- func = m.group(1)
- args = m.group(3)
-
- if args:
- args = [x.strip() for x in args.split(",")]
- else:
- args = []
-
- name = 'cldoc_instruction_{0}'.format(func.replace('-', '_'))
-
- if hasattr(self, name):
- getattr(self, name)(token, args)
- else:
- sys.stderr.write('Invalid cldoc instruction: {0}\n'.format(func))
- sys.exit(1)
-
- return True
-
- @property
- def category_names(self):
- for item in self.categories:
- yield item.obj
-
- def location_to_str(self, loc):
- return '{0}:{1}:{2}'.format(loc.file.name, loc.line, loc.column)
-
- def cldoc_instruction_begin_category(self, token, args):
- if len(args) != 1:
- sys.stderr.write('No category name specified (at {0})\n'.format(self.location_to_str(token.location)))
-
- sys.exit(1)
-
- category = args[0]
- self.categories.push(category, token.location.offset)
-
- def cldoc_instruction_end_category(self, token, args):
- if len(self.categories.stack) == 0:
- sys.stderr.write('Failed to end cldoc category: no category to end (at {0})\n'.format(self.location_to_str(token.location)))
-
- sys.exit(1)
-
- last = self.categories.stack[-1]
-
- if len(args) == 1 and last.obj != args[0]:
- sys.stderr.write('Failed to end cldoc category: current category is `{0}\', not `{1}\' (at {2})\n'.format(last.obj, args[0], self.location_to_str(token.location)))
-
- sys.exit(1)
-
- self.categories.pop(token.extent.end.offset)
-
- def lookup_category(self, location):
- if location.file.name != self.filename:
- return None
-
- return self.categories.find(location.offset)
-
- def lookup(self, location):
- if location.file.name != self.filename:
- return None
-
- return self.comments.find(location.offset)
-
- def extract(self, filename, tu):
- """
- extract extracts comments from a translation unit for a given file by
- iterating over all the tokens in the TU, locating the COMMENT tokens and
- finding out to which cursors the comments semantically belong.
- """
- it = tu.get_tokens(extent=tu.get_extent(filename, (0, int(os.stat(filename).st_size))))
-
- while True:
- try:
- self.extract_loop(it)
- except StopIteration:
- break
-
- def extract_one(self, token, s):
- # Parse special cldoc:() comments for instructions
- if self.parse_cldoc_instruction(token, s.strip()):
- return
-
- comment = Comment(s, token.location)
- self.comments.insert(comment)
-
- def extract_loop(self, iter):
- token = next(iter)
-
- # Skip until comment found
- while token.kind != cindex.TokenKind.COMMENT:
- token = next(iter)
-
- comments = []
- prev = None
-
- # Concatenate individual comments together, but only if they are strictly
- # adjacent
- while token.kind == cindex.TokenKind.COMMENT:
- cleaned = self.clean(token)
-
- # Process instructions directly, now
- if (not cleaned is None) and (not CommentsDatabase.cldoc_instrre.match(cleaned) is None):
- comments = [cleaned]
- break
-
- # Check adjacency
- if not prev is None and prev.extent.end.line + 1 < token.extent.start.line:
- # Empty previous comment
- comments = []
-
- if not cleaned is None:
- comments.append(cleaned)
-
- prev = token
- token = next(iter)
-
- if len(comments) > 0:
- self.extract_one(token, "\n".join(comments))
-
- def clean(self, token):
- prelen = token.extent.start.column - 1
- comment = token.spelling.strip()
-
- if comment.startswith('//'):
- if len(comment) > 2 and comment[2] == '-':
- return None
-
- return comment[2:].strip()
- elif comment.startswith('/*') and comment.endswith('*/'):
- if comment[2] == '-':
- return None
-
- lines = comment[2:-2].splitlines()
-
- if len(lines) == 1 and len(lines[0]) > 0 and lines[0][0] == ' ':
- return lines[0][1:].rstrip()
-
- retl = []
-
- for line in lines:
- if prelen == 0 or line[0:prelen].isspace():
- line = line[prelen:].rstrip()
-
- if line.startswith(' *') or line.startswith(' '):
- line = line[2:]
-
- if len(line) > 0 and line[0] == ' ':
- line = line[1:]
-
- retl.append(line)
-
- return "\n".join(retl)
- else:
- return comment
-
-from pyparsing import *
-
-class Parser:
- ParserElement.setDefaultWhitespaceChars(' \t\r')
-
- identifier = Word(alphas + '_', alphanums + '_')
-
- brief = restOfLine.setResultsName('brief') + lineEnd
-
- paramdesc = restOfLine + ZeroOrMore(lineEnd + ~('@' | lineEnd) + Regex('[^\n]+')) + lineEnd.suppress()
- param = '@' + identifier.setResultsName('name') + White() + Combine(paramdesc).setResultsName('description')
-
- preparams = ZeroOrMore(param.setResultsName('preparam', listAllMatches=True))
- postparams = ZeroOrMore(param.setResultsName('postparam', listAllMatches=True))
-
- bodyline = NotAny('@') + (lineEnd | (Regex('[^\n]+') + lineEnd))
- body = ZeroOrMore(lineEnd) + Combine(ZeroOrMore(bodyline)).setResultsName('body')
-
- doc = brief + preparams + body + postparams
-
- @staticmethod
- def parse(s):
- return Parser.doc.parseString(s)
-
-# vi:ts=4:et
+# This file is part of cldoc. cldoc is free software: you can
+# redistribute it and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation, version 2.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 51
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+from .clang import cindex
+from cldoc import parser
+
+from .struct import Struct
+from . import utf8
+from .parser import *
+from pyparsing import *
+
+import os, re, sys, bisect
+
+class Sorted(list):
+ def __init__(self, key=None):
+ if key is None:
+ key = lambda x: x
+
+ self.keys = []
+ self.key = key
+
+ def insert_bisect(self, item, bi):
+ k = self.key(item)
+ idx = bi(self.keys, k)
+
+ self.keys.insert(idx, k)
+ return super(Sorted, self).insert(idx, item)
+
+ def insert(self, item):
+ return self.insert_bisect(item, bisect.bisect_left)
+
+ insert_left = insert
+
+ def insert_right(self, item):
+ return self.insert_bisect(item, bisect.bisect_right)
+
+ def bisect(self, item, bi):
+ k = self.key(item)
+
+ return bi(self.keys, k)
+
+ def bisect_left(self, item):
+ return self.bisect(item, bisect.bisect_left)
+
+ def bisect_right(self, item):
+ return self.bisect(item, bisect.bisect_right)
+
+ def find(self, key):
+ i = bisect.bisect_right(self.keys, key)
+ if i<=0 or i>len(self.keys):
+ return None
+ self.keys.pop(i-1)
+ result=self.pop(i-1)
+ return result
+
+class Comment(object):
+ parser=Parser()
+ class Example(str):
+ def __new__(self, s, strip=True):
+ if strip:
+ s = '\n'.join([self._strip_prefix(x) for x in s.split('\n')])
+
+ return str.__new__(self, s)
+
+ @staticmethod
+ def _strip_prefix(s):
+ if s.startswith(' '):
+ return s[4:]
+ else:
+ return s
+
+ class String(object):
+ def __init__(self, s, pth, fn, ln):
+ self.components = [utf8.utf8(s)]
+ self.path=pth
+ self.filename=fn
+ self.start_line=ln
+
+ def _utf8(self):
+ return utf8.utf8("").join([utf8.utf8(x) for x in self.components])
+
+ def __str__(self):
+ return str(self._utf8())
+
+ def __unicode__(self):
+ return unicode(self._utf8())
+
+ def __bytes__(self):
+ return bytes(self._utf8())
+
+ def __eq__(self, other):
+ if isinstance(other, str):
+ return str(self) == other
+ elif isinstance(other, unicode):
+ return unicode(self) == other
+ elif isinstance(other, bytes):
+ return bytes(self) == other
+ else:
+ return object.__cmp__(self, other)
+
+ def __nonzero__(self):
+ l = len(self.components)
+
+ return l > 0 and (l > 1 or len(self.components[0]) > 0)
+
+ class MarkdownCode(utf8.utf8):
+ pass
+
+ class UnresolvedReference(utf8.utf8):
+ reescape = re.compile('[*_]', re.I)
+
+ def __new__(cls, s):
+ ns = Comment.UnresolvedReference.reescape.sub(lambda x: '\\' + x.group(0), s)
+ ret = utf8.utf8.__new__(cls, utf8.utf8('<{0}>').format(utf8.utf8(ns)))
+
+ ret.orig = s
+ return ret
+
+ redocref = re.compile('(?P[$]?)<(?:\\[(?P[^\\]]*)\\])?(?Poperator(?:>>|>|>=)|[^>\n]+)>')
+ redoccode = re.compile('^ \\[code\\]\n(?P(?:(?: .*|)\n)*)', re.M)
+ redocmcode = re.compile('(^ *(`{3,}|~{3,}).*?\\2)', re.M | re.S)
+
+ def __init__(self, text, location, opts):
+ ln=0
+ if isinstance(location,cindex.SourceLocation):
+ location=(location.file.name,location.line,location.column,location.offset)
+ spl=os.path.split(location[0])
+ ln=location[1]
+ cl=location[2]
+
+ object.__setattr__(self, 'path', spl[0])
+ object.__setattr__(self, 'start_line', ln)
+ object.__setattr__(self, 'filename', spl[1])
+ self.__dict__['docstrings'] = []
+ self.__dict__['text'] = text
+
+ self.__dict__['location'] = location
+ self.__dict__['_resolved'] = False
+ self.global_properties={}
+
+ self.doc = text
+ self.brief = ''
+ self.images=[]
+ self.imagepaths=[]
+ self.options=opts
+ self.parsedComment=ParsedComment()
+
+ def __setattr__(self, name, val):
+ # if not name in self.docstrings:
+ # self.docstrings.append(name)
+ if isinstance(val, dict):
+ for key in val:
+ if not isinstance(val[key], Comment.String):
+ val[key] = Comment.String(val[key],self.path,self.filename,self.start_line)
+ # Let's NOT change the class of members arbitrarily...
+ elif isinstance(val, str) or isinstance(val, ParseResults):
+ val = Comment.String(val,self.path,self.filename,self.start_line)
+ else:
+ object.__setattr__(self, name, val)
+ return # ordinary class members
+ if not name in self.docstrings:
+ self.docstrings.append(name)
+
+ self.__dict__[name] = val
+
+ def __nonzero__(self):
+ return (bool(self.brief) and not (self.brief == u'*documentation missing...*')) or (bool(self.doc) and not (self.doc == u'*documentation missing...*'))
+
+ def redoccode_split(self, doc):
+ # Split on C/C++ code
+ components = Comment.redoccode.split(doc)
+ ret = []
+
+ for i in range(0, len(components), 2):
+ r = Comment.redocmcode.split(components[i])
+
+ for j in range(0, len(r), 3):
+ ret.append(r[j])
+
+ if j < len(r) - 1:
+ ret.append(Comment.MarkdownCode(r[j + 1]))
+
+ if i < len(components) - 1:
+ ret.append(Comment.Example(components[i + 1]))
+
+ return ret
+
+ def redoc_split(self, doc):
+ ret = []
+
+ # First split examples
+ components = self.redoccode_split(doc)
+
+ for c in components:
+ if isinstance(c, Comment.Example) or isinstance(c, Comment.MarkdownCode):
+ ret.append((c, None, None))
+ else:
+ lastpos = 0
+
+ for m in Comment.redocref.finditer(c):
+ span = m.span(0)
+
+ prefix = c[lastpos:span[0]]
+ lastpos = span[1]
+
+ ref = m.group('ref')
+ refname = m.group('refname')
+
+ if not refname:
+ refname = None
+
+ if len(m.group('isregex')) > 0:
+ ref = re.compile(ref)
+
+ ret.append((prefix, ref, refname))
+
+ ret.append((c[lastpos:], None, None))
+
+ return ret
+ def merge_two_dicts(x, y):
+ z = x.copy() # start with x's keys and values
+ z.update(y) # modifies z with y's keys and values & returns None
+ return z
+ def resolve_refs_for_doc(self, doc, resolver, root):
+ Comment.parser.reset()
+ comps=[]
+ for comp in doc.components:
+ if isinstance(comp, str):
+ comps+=Comment.parser.parseFull(comp, resolver, root, doc.path,doc.filename, doc.start_line)
+ self.global_properties.update(Comment.parser.properties)
+ else:
+ comps.append(comp)
+
+ doc.components = comps
+
+ def resolve_refs(self, resolver, root):
+ if self.__dict__['_resolved']:
+ return
+
+ self.__dict__['_resolved'] = True
+
+ # Each docstring: brief, doc, etc, will become a Comment.String with a list of components, which may be strings or node links.
+ for name in self.docstrings:
+ doc = getattr(self, name)
+
+ if not doc:
+ continue
+
+ if isinstance(doc, dict):
+ for key in doc:
+ if not isinstance(doc[key], Comment.String):
+ doc[key] = Comment.String(doc[key],self.path,self.filename,self.start_line)
+
+ self.resolve_refs_for_doc(doc[key], resolver, root)
+ else:
+ self.resolve_refs_for_doc(doc, resolver, root)
+ if self.parsedComment is ParsedComment:
+ self.parsedComment.resolve_cross_refs(resolver,root)
+
+class RangeMap(Sorted):
+ Item = Struct.define('Item', obj=None, start=0, end=0)
+
+ def __init__(self):
+ super(RangeMap, self).__init__(key=lambda x: x.start)
+
+ self.stack = []
+
+ def push(self, obj, start):
+ self.stack.append(RangeMap.Item(obj=obj, start=start, end=start))
+
+ def pop(self, end):
+ item = self.stack.pop()
+ item.end = end
+
+ self.insert(item)
+
+ def insert(self, item, start=None, end=None):
+ if not isinstance(item, RangeMap.Item):
+ item = RangeMap.Item(obj=item, start=start, end=end)
+
+ self.insert_right(item)
+
+ def find(self, i):
+ # Finds object for which i falls in the range of that object
+ idx = bisect.bisect_right(self.keys, i)
+
+ # Go back up until falls within end
+ while idx > 0:
+ idx -= 1
+
+ o = self[idx]
+
+ if i <= o.end:
+ return o.obj
+
+ return None
+
+class CommentsDatabase(object):
+ cldoc_instrre = re.compile('^cldoc:([a-zA-Z_-]+)(\(([^\)]*)\))?')
+
+ def __init__(self, filename, tu, opts):
+ self.filename = filename
+
+ self.categories = RangeMap()
+ self.comments = Sorted(key=lambda x: x.location[3])
+ self.options=opts
+ self.extract(filename, tu)
+
+ def parse_cldoc_instruction(self, token, s):
+ m = CommentsDatabase.cldoc_instrre.match(s)
+
+ if not m:
+ return False
+
+ func = m.group(1)
+ args = m.group(3)
+
+ if args:
+ args = [x.strip() for x in args.split(",")]
+ else:
+ args = []
+
+ name = 'cldoc_instruction_{0}'.format(func.replace('-', '_'))
+
+ if hasattr(self, name):
+ getattr(self, name)(token, args)
+ else:
+ sys.stderr.write('Invalid cldoc instruction: {0}\n'.format(func))
+ sys.exit(1)
+
+ return True
+
+ @property
+ def category_names(self):
+ for item in self.categories:
+ yield item.obj
+
+ def location_to_str(self, loc):
+ return '{0}:{1}:{2}'.format(loc.file.name, loc.line, loc.column)
+
+ def cldoc_instruction_begin_category(self, token, args):
+ if len(args) != 1:
+ sys.stderr.write('No category name specified (at {0})\n'.format(self.location_to_str(token.location)))
+
+ sys.exit(1)
+
+ category = args[0]
+ self.categories.push(category, token.location.offset)
+
+ def cldoc_instruction_end_category(self, token, args):
+ if len(self.categories.stack) == 0:
+ sys.stderr.write('Failed to end cldoc category: no category to end (at {0})\n'.format(self.location_to_str(token.location)))
+
+ sys.exit(1)
+
+ last = self.categories.stack[-1]
+
+ if len(args) == 1 and last.obj != args[0]:
+ sys.stderr.write('Failed to end cldoc category: current category is `{0}\', not `{1}\' (at {2})\n'.format(last.obj, args[0], self.location_to_str(token.location)))
+
+ sys.exit(1)
+
+ self.categories.pop(token.extent.end.offset)
+
+ def lookup_category(self, location):
+ if location.file.name != self.filename:
+ return None
+
+ return self.categories.find(location.offset)
+
+ def lookup(self, location):
+ if location[0]!= self.filename:
+ return None
+
+ return self.comments.find(location[3]) #offset
+
+ def extract(self, filename, tu):
+ """
+ extract extracts comments from a translation unit for a given file by
+ iterating over all the tokens in the TU, locating the COMMENT tokens and
+ finding out to which cursors the comments semantically belong.
+ """
+ it = tu.get_tokens(extent=tu.get_extent(filename, (0, int(os.stat(filename).st_size))))
+
+ while True:
+ try:
+ self.extract_loop(it)
+ except StopIteration:
+ break
+
+ def extract_one(self, token, s):
+ # Parse special cldoc:() comments for instructions
+ if self.parse_cldoc_instruction(token, s.strip()):
+ return
+
+ comment = Comment(s, token.location,self.options)
+ self.comments.insert(comment)
+
+ def extract_loop(self, iter):
+ token = next(iter)
+
+ # Skip until comment found
+ while token.kind != cindex.TokenKind.COMMENT:
+ token = next(iter)
+
+ comments = []
+ prev = None
+
+ # Concatenate individual comments together, but only if they are strictly
+ # adjacent
+ while token.kind == cindex.TokenKind.COMMENT:
+ cleaned = self.clean(token)
+
+ # Process instructions directly, now
+ if (not cleaned is None) and (not CommentsDatabase.cldoc_instrre.match(cleaned) is None):
+ comments = [cleaned]
+ break
+
+ # Check adjacency
+ if not prev is None and prev.extent.end.line + 1 < token.extent.start.line:
+ # Empty previous comment
+ comments = []
+
+ if not cleaned is None:
+ comments.append(cleaned)
+
+ prev = token
+ token = next(iter)
+
+ if len(comments) > 0:
+ self.extract_one(token, "\n".join(comments))
+
+ def clean(self, token):
+ prelen = token.extent.start.column - 1
+ comment = token.spelling.strip()
+
+ if comment.startswith('///') or comment.startswith('//!'):
+ return comment[3:].strip()
+ elif comment.startswith('//'):
+ # For our purposes, ordinary comments are ignored.
+ return None
+ #if len(comment) > 2 and comment[2] == '-':
+ # return None
+
+ return comment[2:].strip()
+ elif comment.startswith('/*') and comment.endswith('*/'):
+ # For our purposes, ! is required here.
+ if comment[2] != '!':
+ return None
+
+ lines = comment[3:-2].splitlines()
+
+ if len(lines) == 1 and len(lines[0]) > 0 and lines[0][0] == ' ':
+ return lines[0][1:].rstrip()
+
+ retl = []
+
+ for line in lines:
+ if prelen == 0 or line[0:prelen].isspace():
+ line = line[prelen:].rstrip()
+
+ if line.startswith(' *') or line.startswith(' '):
+ line = line[2:]
+
+ if len(line) > 0 and line[0] == ' ':
+ line = line[1:]
+
+ retl.append(line)
+
+ return "\n".join(retl)
+ else:
+ return comment
+
+# vi:ts=4:et
diff --git a/cldoc/data/javascript/cldoc.js b/cldoc/data/javascript/cldoc.js
index 186cfcb..a3b8916 100644
--- a/cldoc/data/javascript/cldoc.js
+++ b/cldoc/data/javascript/cldoc.js
@@ -16,31 +16,31 @@ window.cldoc = $.extend($.extend({
host: href.substring(0, href.lastIndexOf('/'))
}, (ref1 = window.cldoc) != null ? ref1 : {}), {
tag: function(node) {
- return $.map(node, function(e) {
- return e.tagName.toLowerCase();
- });
+\treturn $.map(node, function(e) {
+\t return e.tagName.toLowerCase();
+\t});
},
startswith: function(s, prefix) {
- return s.indexOf(prefix) === 0;
+\treturn s.indexOf(prefix) === 0;
},
html_escape: function(s) {
- escapeElement.data = s;
- return escapeDiv.innerHTML;
+\tescapeElement.data = s;
+\treturn escapeDiv.innerHTML;
},
new_timer: function() {
- var ret;
- ret = {
- start: new Date()
- };
- ret.tick = function(s) {
- var end;
- end = new Date();
- return ret.start = end;
- };
- return ret;
+\tvar ret;
+\tret = {
+\t start: new Date()
+\t};
+\tret.tick = function(s) {
+\t var end;
+\t end = new Date();
+\t return ret.start = end;
+\t};
+\treturn ret;
},
xml_attr: function(e, a) {
- return e.getAttribute(a);
+\treturn e.getAttribute(a);
}
});
@@ -54,143 +54,143 @@ cldoc.SearchWorker = function() {
var bsearch, db, load_db, log, search_term;
db = null;
log = function(msg) {
- return self.postMessage({
- type: 'log',
- message: msg
- });
+\treturn self.postMessage({
+\t type: 'log',
+\t message: msg
+\t});
};
load_db = function(host) {
- var xhr;
- xhr = new XMLHttpRequest();
- xhr.open('GET', host + '/search.json?' + new Date().getTime(), false);
- xhr.send();
- return JSON.parse(xhr.responseText);
+\tvar xhr;
+\txhr = new XMLHttpRequest();
+\txhr.open('GET', host + '/search.json?' + new Date().getTime(), false);
+\txhr.send();
+\treturn JSON.parse(xhr.responseText);
};
bsearch = (function(_this) {
- return function(term, l, r, sel) {
- var mid, rec, ref2, suf, suffix_record;
- suffix_record = function(i) {
- return db.suffixes[i][0];
- };
- while (l < r) {
- mid = Math.floor((l + r) / 2);
- rec = suffix_record(mid);
- suf = db.records[rec[0]][0].substring(rec[1]);
- ref2 = sel(suf) ? [mid + 1, r] : [l, mid], l = ref2[0], r = ref2[1];
- }
- return [l, r];
- };
+\treturn function(term, l, r, sel) {
+\t var mid, rec, ref2, suf, suffix_record;
+\t suffix_record = function(i) {
+\t\treturn db.suffixes[i][0];
+\t };
+\t while (l < r) {
+\t\tmid = Math.floor((l + r) / 2);
+\t\trec = suffix_record(mid);
+\t\tsuf = db.records[rec[0]][0].substring(rec[1]);
+\t\tref2 = sel(suf) ? [mid + 1, r] : [l, mid], l = ref2[0], r = ref2[1];
+\t }
+\t return [l, r];
+\t};
})(this);
search_term = (function(_this) {
- return function(term) {
- var _, end, l, r, ref2, ref3, start, t;
- if (term.length < 3) {
- return [0, 0];
- }
- l = 0;
- r = db.suffixes.length;
- t = term.toLowerCase();
- ref2 = bsearch(t, 0, db.suffixes.length, function(suf) {
- return t > suf;
- }), start = ref2[0], _ = ref2[1];
- ref3 = bsearch(t, start, db.suffixes.length, function(suf) {
- return suf.indexOf(t) === 0;
- }), _ = ref3[0], end = ref3[1];
- return [start, end];
- };
+\treturn function(term) {
+\t var _, end, l, r, ref2, ref3, start, t;
+\t if (term.length < 3) {
+\t\treturn [0, 0];
+\t }
+\t l = 0;
+\t r = db.suffixes.length;
+\t t = term.toLowerCase();
+\t ref2 = bsearch(t, 0, db.suffixes.length, function(suf) {
+\t\treturn t > suf;
+\t }), start = ref2[0], _ = ref2[1];
+\t ref3 = bsearch(t, start, db.suffixes.length, function(suf) {
+\t\treturn suf.indexOf(t) === 0;
+\t }), _ = ref3[0], end = ref3[1];
+\t return [start, end];
+\t};
})(this);
return self.onmessage = (function(_this) {
- return function(ev) {
- var end, i, items, j, len, len1, m, o, p, rec, recid, records, ref2, ref3, ref4, ret, rr, start, word, words;
- m = ev.data;
- if (db === null) {
- db = load_db(m.host);
- }
- words = m.q.split(/\s+/);
- records = {};
- ret = {
- type: 'result',
- id: m.id,
- q: m.q,
- words: words,
- records: []
- };
- for (j = 0, len = words.length; j < len; j++) {
- word = words[j];
- ref2 = search_term(word), start = ref2[0], end = ref2[1];
- for (i = o = ref3 = start, ref4 = end - 1; o <= ref4; i = o += 1) {
- items = db.suffixes[i];
- for (p = 0, len1 = items.length; p < len1; p++) {
- rec = items[p];
- recid = rec[0];
- if (!(recid in records)) {
- rr = {
- name: db.records[recid][0],
- id: db.records[recid][1],
- score: 0,
- results: [],
- suffixhash: {}
- };
- ret.records.push(rr);
- records[recid] = rr;
- } else {
- rr = records[recid];
- }
- if (!(rec[1] in rr.suffixhash)) {
- rr.score += 1;
- rr.results.push([rec[1], rec[1] + word.length]);
- rr.suffixhash[rec[1]] = true;
- }
- }
- }
- }
- ret.records.sort(function(a, b) {
- var ref5, ref6;
- return (ref5 = a.score > b.score) != null ? ref5 : (ref6 = a.score < b.score) != null ? ref6 : -{
- 1: 0
- };
- });
- return self.postMessage(ret);
- };
+\treturn function(ev) {
+\t var end, i, items, j, len, len1, m, o, p, rec, recid, records, ref2, ref3, ref4, ret, rr, start, word, words;
+\t m = ev.data;
+\t if (db === null) {
+\t\tdb = load_db(m.host);
+\t }
+\t words = m.q.split(/\s+/);
+\t records = {};
+\t ret = {
+\t\ttype: 'result',
+\t\tid: m.id,
+\t\tq: m.q,
+\t\twords: words,
+\t\trecords: []
+\t };
+\t for (j = 0, len = words.length; j < len; j++) {
+\t\tword = words[j];
+\t\tref2 = search_term(word), start = ref2[0], end = ref2[1];
+\t\tfor (i = o = ref3 = start, ref4 = end - 1; o <= ref4; i = o += 1) {
+\t\t items = db.suffixes[i];
+\t\t for (p = 0, len1 = items.length; p < len1; p++) {
+\t\t\trec = items[p];
+\t\t\trecid = rec[0];
+\t\t\tif (!(recid in records)) {
+\t\t\t rr = {
+\t\t\t\tname: db.records[recid][0],
+\t\t\t\tid: db.records[recid][1],
+\t\t\t\tscore: 0,
+\t\t\t\tresults: [],
+\t\t\t\tsuffixhash: {}
+\t\t\t };
+\t\t\t ret.records.push(rr);
+\t\t\t records[recid] = rr;
+\t\t\t} else {
+\t\t\t rr = records[recid];
+\t\t\t}
+\t\t\tif (!(rec[1] in rr.suffixhash)) {
+\t\t\t rr.score += 1;
+\t\t\t rr.results.push([rec[1], rec[1] + word.length]);
+\t\t\t rr.suffixhash[rec[1]] = true;
+\t\t\t}
+\t\t }
+\t\t}
+\t }
+\t ret.records.sort(function(a, b) {
+\t\tvar ref5, ref6;
+\t\treturn (ref5 = a.score > b.score) != null ? ref5 : (ref6 = a.score < b.score) != null ? ref6 : -{
+\t\t 1: 0
+\t\t};
+\t });
+\t return self.postMessage(ret);
+\t};
})(this);
};
cldoc.SearchDb = (function() {
function SearchDb() {
- var blob, ref2, wurl;
- this.searchid = 0;
- this.searchcb = null;
- wurl = (ref2 = window.webkitURL) != null ? ref2 : window.URL;
- blob = new Blob(['worker = ' + cldoc.SearchWorker.toString() + '; worker();'], {
- type: 'text/javascript'
- });
- this.worker = new Worker(wurl.createObjectURL(blob));
- this.worker.onmessage = (function(_this) {
- return function(msg) {
- var m;
- m = msg.data;
- if (m.type === 'log') {
- return console.log(m.message);
- } else if (m.type === 'result') {
- if (m.id !== _this.searchid) {
- return;
- }
- _this.searchid = 0;
- return _this.searchcb(m);
- }
- };
- })(this);
+\tvar blob, ref2, wurl;
+\tthis.searchid = 0;
+\tthis.searchcb = null;
+\twurl = (ref2 = window.webkitURL) != null ? ref2 : window.URL;
+\tblob = new Blob(['worker = ' + cldoc.SearchWorker.toString() + '; worker();'], {
+\t type: 'text/javascript'
+\t});
+\tthis.worker = new Worker(wurl.createObjectURL(blob));
+\tthis.worker.onmessage = (function(_this) {
+\t return function(msg) {
+\t\tvar m;
+\t\tm = msg.data;
+\t\tif (m.type === 'log') {
+\t\t return console.log(m.message);
+\t\t} else if (m.type === 'result') {
+\t\t if (m.id !== _this.searchid) {
+\t\t\treturn;
+\t\t }
+\t\t _this.searchid = 0;
+\t\t return _this.searchcb(m);
+\t\t}
+\t };
+\t})(this);
}
SearchDb.prototype.search = function(q, cb) {
- this.searchid += 1;
- this.searchcb = cb;
- return this.worker.postMessage({
- type: 'search',
- q: q,
- id: this.searchid,
- host: cldoc.host
- });
+\tthis.searchid += 1;
+\tthis.searchcb = cb;
+\treturn this.worker.postMessage({
+\t type: 'search',
+\t q: q,
+\t id: this.searchid,
+\t host: cldoc.host
+\t});
};
return SearchDb;
@@ -207,588 +207,588 @@ cldoc.Page = (function() {
Page.first = true;
Page.search = {
- db: null
+\tdb: null
};
Page.request_page = function(page, cb) {
- var url;
- if (page in this.pages) {
- cb(this.pages[page]);
- return;
- }
- url = cldoc.host + '/xml/' + page.replace(/::/g, '.') + '.xml';
- return $.ajax({
- url: url,
- cache: false,
- success: (function(_this) {
- return function(data) {
- _this.pages[page] = {
- xml: $(data),
- html: null
- };
- return cb(_this.pages[page]);
- };
- })(this)
- });
+\tvar url;
+\tif (page in this.pages) {
+\t cb(this.pages[page]);
+\t return;
+\t}
+\turl = cldoc.host + '/xml/' + page.replace(/::/g, '.') + '.xml';
+\treturn $.ajax({
+\t url: url,
+\t cache: false,
+\t success: (function(_this) {
+\t\treturn function(data) {
+\t\t _this.pages[page] = {
+\t\t\txml: $(data),
+\t\t\thtml: null
+\t\t };
+\t\t return cb(_this.pages[page]);
+\t\t};
+\t })(this)
+\t});
};
Page.load = function(page, scrollto, updatenav) {
- cldoc.Sidebar.exit_search();
- if (page === null || page === 'undefined') {
- page = this.current_page;
- }
- if (!page) {
- page = 'index';
- }
- if (updatenav) {
- this.push_nav(page, scrollto);
- }
- if (this.current_page !== page) {
- return this.request_page(page, (function(_this) {
- return function() {
- return _this.load_page(page, scrollto);
- };
- })(this));
- } else {
- return this.scroll(page, scrollto);
- }
+\tcldoc.Sidebar.exit_search();
+\tif (page === null || page === 'undefined') {
+\t page = this.current_page;
+\t}
+\tif (!page) {
+\t page = 'index';
+\t}
+\tif (updatenav) {
+\t this.push_nav(page, scrollto);
+\t}
+\tif (this.current_page !== page) {
+\t return this.request_page(page, (function(_this) {
+\t\treturn function() {
+\t\t return _this.load_page(page, scrollto);
+\t\t};
+\t })(this));
+\t} else {
+\t return this.scroll(page, scrollto);
+\t}
};
Page.make_link = function(ref, name, attrs) {
- var e, k, r, ret, v;
- if (attrs == null) {
- attrs = {};
- }
- e = cldoc.html_escape;
- r = this.make_internal_ref(ref);
- ret = '' + e(name) + '';
+\tvar e, k, r, ret, v;
+\tif (attrs == null) {
+\t attrs = {};
+\t}
+\te = cldoc.html_escape;
+\tr = this.make_internal_ref(ref);
+\tret = '' + e(name) + '';
};
Page.load_page = function(page, scrollto) {
- var brief, content, cpage, data, html, root, sidebar, start, title;
- this.first = this.current_page === null;
- start = new Date();
- this.current_page = page;
- cpage = this.pages[page];
- data = cpage.xml;
- html = cpage.html;
- $('#cldoc #cldoc_content').children().detach();
- root = data.children(':first');
- if (html) {
- $('#cldoc #cldoc_content').append(html.content);
- cldoc.Sidebar.load_html(html.sidebar);
- } else {
- sidebar = cldoc.Sidebar.load(root);
- content = this.load_contents(root);
- cpage.html = {
- sidebar: sidebar,
- content: content
- };
- }
- title = root.attr('name');
- if (!title) {
- brief = root.children('brief');
- if (brief.length > 0) {
- title = brief.text();
- if (title[title.length - 1] === '.') {
- title = title.substring(0, title.length - 1);
- }
- }
- }
- if (!title) {
- title = 'Documentation';
- }
- document.title = title;
- this.scroll(page, scrollto, true);
- return $('#cldoc').triggerHandler('page-loaded', [root]);
+\tvar brief, content, cpage, data, html, root, sidebar, start, title;
+\tthis.first = this.current_page === null;
+\tstart = new Date();
+\tthis.current_page = page;
+\tcpage = this.pages[page];
+\tdata = cpage.xml;
+\thtml = cpage.html;
+\t$('#cldoc #cldoc_content').children().detach();
+\troot = data.children(':first');
+\tif (html) {
+\t $('#cldoc #cldoc_content').append(html.content);
+\t cldoc.Sidebar.load_html(html.sidebar);
+\t} else {
+\t sidebar = cldoc.Sidebar.load(root);
+\t content = this.load_contents(root);
+\t cpage.html = {
+\t\tsidebar: sidebar,
+\t\tcontent: content
+\t };
+\t}
+\ttitle = root.attr('name');
+\tif (!title) {
+\t brief = root.children('brief');
+\t if (brief.length > 0) {
+\t\ttitle = brief.text();
+\t\tif (title[title.length - 1] === '.') {
+\t\t title = title.substring(0, title.length - 1);
+\t\t}
+\t }
+\t}
+\tif (!title) {
+\t title = 'Documentation';
+\t}
+\tdocument.title = title;
+\tthis.scroll(page, scrollto, true);
+\treturn $('#cldoc').triggerHandler('page-loaded', [root]);
};
Page.make_external_ref = function(page, id) {
- if (page[0] === '#') {
- page = page.substring(1);
- }
- if (!id) {
- return page.replace('/', '#');
- } else {
- return page + '#' + id;
- }
+\tif (page[0] === '#') {
+\t page = page.substring(1);
+\t}
+\tif (!id) {
+\t return page.replace('/', '#');
+\t} else {
+\t return page + '#' + id;
+\t}
};
Page.make_internal_ref = function(page, id) {
- if (!page) {
- return '#index';
- }
- if (!id) {
- return '#' + page.replace('#', '/');
- } else {
- return '#' + page + '/' + id;
- }
+\tif (!page) {
+\t return '#index';
+\t}
+\tif (!id) {
+\t return '#' + page.replace('#', '/');
+\t} else {
+\t return '#' + page + '/' + id;
+\t}
};
Page.split_ref = function(ref) {
- var id, page, ref2;
- ref2 = ref.split('#', 2), page = ref2[0], id = ref2[1];
- if (!page) {
- page = 'index';
- }
- return [page, id];
+\tvar id, page, ref2;
+\tref2 = ref.split('#', 2), page = ref2[0], id = ref2[1];
+\tif (!page) {
+\t page = 'index';
+\t}
+\treturn [page, id];
};
Page.load_ref = function(ref) {
- var r;
- r = this.split_ref(ref);
- return this.load(r[0], r[1], true);
+\tvar r;
+\tr = this.split_ref(ref);
+\treturn this.load(r[0], r[1], true);
};
Page.make_header = function(item) {
- var e, id, name, obj, ret, title, type;
- id = item.attr('id');
- e = cldoc.html_escape;
- if (id) {
- ret = '';
- type = this.node_type(item);
- title = item.attr('title');
- if (type) {
- ret += '' + e(type.title[0]) + '';
- obj = new type(item);
- name = obj.full_name_for_display();
- } else {
- name = item.attr('name');
- }
- if (title) {
- ret += '' + e(title) + '';
- } else {
- if (name) {
- ret += '' + e(name) + '';
- } else {
- ret += '' + e(id) + '';
- }
- }
- return ret;
- } else {
- return '';
- }
+\tvar e, id, name, obj, ret, title, type;
+\tid = item.attr('id');
+\te = cldoc.html_escape;
+\tif (id) {
+\t ret = '';
+\t type = this.node_type(item);
+\t title = item.attr('title');
+\t if (type) {
+\t\tret += '' + e(type.title[0]) + '';
+\t\tobj = new type(item);
+\t\tname = obj.full_name_for_display();
+\t } else {
+\t\tname = item.attr('name');
+\t }
+\t if (title) {
+\t\tret += '' + e(title) + '';
+\t } else {
+\t\tif (name) {
+\t\t ret += '' + e(name) + '';
+\t\t} else {
+\t\t ret += '' + e(id) + '';
+\t\t}
+\t }
+\t return ret;
+\t} else {
+\t return '';
+\t}
};
Page.load_description = function(page, content) {
- var desc, doc, h1, id;
- doc = cldoc.Doc.either(page);
- id = page.attr('id');
- if (id) {
- h1 = $('').appendTo(content);
- h1.attr('id', id);
- h1.append(this.make_header(page));
- }
- if (doc) {
- desc = $('');
- desc.append(doc);
- return content.append(desc);
- }
+\tvar desc, doc, h1, id;
+\tdoc = cldoc.Doc.either(page);
+\tid = page.attr('id');
+\tif (id) {
+\t h1 = $('').appendTo(content);
+\t h1.attr('id', id);
+\t h1.append(this.make_header(page));
+\t}
+\tif (doc) {
+\t desc = $('');
+\t desc.append(doc);
+\t return content.append(desc);
+\t}
};
Page.node_type = function(item) {
- var typename;
- typename = cldoc.tag(item)[0];
- if (!(typename in cldoc.Node.types)) {
- return null;
- }
- return cldoc.Node.types[typename];
+\tvar typename;
+\ttypename = cldoc.tag(item)[0];
+\tif (!(typename in cldoc.Node.types)) {
+\t return null;
+\t}
+\treturn cldoc.Node.types[typename];
};
Page.load_items = function(page) {
- var all, container, content, e, group, item, itemcontents, items, j, len, len1, o, ref2, ret, tp, type;
- all = page.children();
- content = '';
- e = cldoc.html_escape;
- ref2 = cldoc.Node.groups;
- for (j = 0, len = ref2.length; j < len; j++) {
- group = ref2[j];
- items = all.filter(group);
- if (items.length === 0) {
- continue;
- }
- type = this.node_type(items);
- if (!type || type === cldoc.Node.types.report) {
- continue;
- }
- content += '' + e(type.title[1]) + '
';
- container = type.render_container();
- itemcontents = '';
- for (o = 0, len1 = items.length; o < len1; o++) {
- item = items[o];
- item = $(item);
- if (cldoc.tag(item)[0] !== cldoc.tag(items)[0]) {
- tp = this.node_type(item);
- } else {
- tp = type;
- }
- if (tp) {
- ret = new tp($(item)).render();
- if (ret) {
- itemcontents += ret;
- }
- }
- }
- if (container) {
- content += container[0] + itemcontents + container[1];
- } else {
- content += itemcontents;
- }
- }
- return content;
+\tvar all, container, content, e, group, item, itemcontents, items, j, len, len1, o, ref2, ret, tp, type;
+\tall = page.children();
+\tcontent = '';
+\te = cldoc.html_escape;
+\tref2 = cldoc.Node.groups;
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t group = ref2[j];
+\t items = all.filter(group);
+\t if (items.length === 0) {
+\t\tcontinue;
+\t }
+\t type = this.node_type(items);
+\t if (!type || type === cldoc.Node.types.report) {
+\t\tcontinue;
+\t }
+\t content += '' + e(type.title[1]) + '
';
+\t container = type.render_container();
+\t itemcontents = '';
+\t for (o = 0, len1 = items.length; o < len1; o++) {
+\t\titem = items[o];
+\t\titem = $(item);
+\t\tif (cldoc.tag(item)[0] !== cldoc.tag(items)[0]) {
+\t\t tp = this.node_type(item);
+\t\t} else {
+\t\t tp = type;
+\t\t}
+\t\tif (tp) {
+\t\t ret = new tp($(item)).render();
+\t\t if (ret) {
+\t\t\titemcontents += ret;
+\t\t }
+\t\t}
+\t }
+\t if (container) {
+\t\tcontent += container[0] + itemcontents + container[1];
+\t } else {
+\t\tcontent += itemcontents;
+\t }
+\t}
+\treturn content;
};
Page.bind_links = function(container) {
- return container.find('a').on('click', (function(_this) {
- return function(e) {
- var ref;
- ref = $(e.delegateTarget).attr('href');
- if (ref[0] === '#') {
- _this.load_ref(_this.make_external_ref(ref));
- return false;
- } else {
- return true;
- }
- };
- })(this));
+\treturn container.find('a').on('click', (function(_this) {
+\t return function(e) {
+\t\tvar ref;
+\t\tref = $(e.delegateTarget).attr('href');
+\t\tif (ref[0] === '#') {
+\t\t _this.load_ref(_this.make_external_ref(ref));
+\t\t return false;
+\t\t} else {
+\t\t return true;
+\t\t}
+\t };
+\t})(this));
};
Page.load_pagenav = function(page, content) {
- var h2cnt, h2li, h2ol, h3cnt, pagenav, ul;
- if (this.node_type(page) !== cldoc.Category) {
- return;
- }
- pagenav = $('#cldoc_sidebar_pagenav');
- ul = $('
');
- h2cnt = 0;
- h2li = null;
- h2ol = null;
- h3cnt = 0;
- content.find('h2,h3').each((function(_this) {
- return function(i, e) {
- var a, h, id, ish2, li, t;
- h = $(e);
- if (h.attr('data-cldoc-dynamic')) {
- return;
- }
- id = h.text();
- ish2 = e.tagName === 'H2';
- if (ish2) {
- h2cnt += 1;
- t = h2cnt + '. ' + id;
- } else {
- h3cnt += 1;
- t = h2cnt + '.' + h3cnt + '. ' + id;
- }
- h.text(t);
- h.attr('id', id);
- a = $('', {
- href: _this.make_internal_ref(_this.current_page, id)
- }).text(t);
- li = $('').append(a);
- if (!ish2 && h2li !== null) {
- if (h2ol === null) {
- h2ol = $('
').appendTo(h2li);
- }
- return h2ol.append(li);
- } else {
- if (ish2 && h2li === null) {
- h2li = li;
- h2ol = null;
- }
- return li.appendTo(ul);
- }
- };
- })(this));
- this.bind_links(ul);
- return pagenav.append(ul);
+\tvar h2cnt, h2li, h2ol, h3cnt, pagenav, ul;
+\tif (this.node_type(page) !== cldoc.Category) {
+\t return;
+\t}
+\tpagenav = $('#cldoc_sidebar_pagenav');
+\tul = $('
');
+\th2cnt = 0;
+\th2li = null;
+\th2ol = null;
+\th3cnt = 0;
+\tcontent.find('h2,h3').each((function(_this) {
+\t return function(i, e) {
+\t\tvar a, h, id, ish2, li, t;
+\t\th = $(e);
+\t\tif (h.attr('data-cldoc-dynamic')) {
+\t\t return;
+\t\t}
+\t\tid = h.text();
+\t\tish2 = e.tagName === 'H2';
+\t\tif (ish2) {
+\t\t h2cnt += 1;
+\t\t t = h2cnt + '. ' + id;
+\t\t} else {
+\t\t h3cnt += 1;
+\t\t t = h2cnt + '.' + h3cnt + '. ' + id;
+\t\t}
+\t\th.text(t);
+\t\th.attr('id', id);
+\t\ta = $('', {
+\t\t href: _this.make_internal_ref(_this.current_page, id)
+\t\t}).text(t);
+\t\tli = $('').append(a);
+\t\tif (!ish2 && h2li !== null) {
+\t\t if (h2ol === null) {
+\t\t\th2ol = $('
').appendTo(h2li);
+\t\t }
+\t\t return h2ol.append(li);
+\t\t} else {
+\t\t if (ish2 && h2li === null) {
+\t\t\th2li = li;
+\t\t\th2ol = null;
+\t\t }
+\t\t return li.appendTo(ul);
+\t\t}
+\t };
+\t})(this));
+\tthis.bind_links(ul);
+\treturn pagenav.append(ul);
};
Page.load_contents = function(page) {
- var content, items;
- content = $('#cldoc #cldoc_content');
- content.children().detach();
- this.load_description(page, content);
- items = $(this.load_items(page));
- content.append(items);
- this.bind_links(content);
- this.load_pagenav(page, content);
- return content.children();
+\tvar content, items;
+\tcontent = $('#cldoc #cldoc_content');
+\tcontent.children().detach();
+\tthis.load_description(page, content);
+\titems = $(this.load_items(page));
+\tcontent.append(items);
+\tthis.bind_links(content);
+\tthis.load_pagenav(page, content);
+\treturn content.children();
};
Page.push_nav = function(page, scrollto) {
- var hash, prevpage, prevscrollto, ref2;
- hash = document.location.hash;
- ref2 = this.split_ref(this.make_external_ref(hash)), prevpage = ref2[0], prevscrollto = ref2[1];
- return history.pushState({
- page: prevpage,
- scrollto: prevscrollto
- }, page, this.make_internal_ref(page, scrollto));
+\tvar hash, prevpage, prevscrollto, ref2;
+\thash = document.location.hash;
+\tref2 = this.split_ref(this.make_external_ref(hash)), prevpage = ref2[0], prevscrollto = ref2[1];
+\treturn history.pushState({
+\t page: prevpage,
+\t scrollto: prevscrollto
+\t}, page, this.make_internal_ref(page, scrollto));
};
Page.route = function() {
- var hash, m, page, route, scrollto;
- hash = document.location.hash.substr(1);
- route = new RegExp('^([^/]+)(/(.*))?$');
- m = route.exec(hash);
- page = '';
- scrollto = '';
- if (!m) {
- page = 'index';
- } else {
- page = m[1];
- scrollto = m[3];
- }
- $(window).on('popstate', (function(_this) {
- return function(e) {
- var state;
- if (e.originalEvent.state) {
- state = e.originalEvent.state;
- if (state.page !== _this.current_page) {
- return _this.load(state.page, state.scrollto, false);
- } else {
- return _this.select(state.scrollto, false);
- }
- }
- };
- })(this));
- return this.load(page, scrollto);
+\tvar hash, m, page, route, scrollto;
+\thash = document.location.hash.substr(1);
+\troute = new RegExp('^([^/]+)(/(.*))?$');
+\tm = route.exec(hash);
+\tpage = '';
+\tscrollto = '';
+\tif (!m) {
+\t page = 'index';
+\t} else {
+\t page = m[1];
+\t scrollto = m[3];
+\t}
+\t$(window).on('popstate', (function(_this) {
+\t return function(e) {
+\t\tvar state;
+\t\tif (e.originalEvent.state) {
+\t\t state = e.originalEvent.state;
+\t\t if (state.page !== _this.current_page) {
+\t\t\treturn _this.load(state.page, state.scrollto, false);
+\t\t } else {
+\t\t\treturn _this.select(state.scrollto, false);
+\t\t }
+\t\t}
+\t };
+\t})(this));
+\treturn this.load(page, scrollto);
};
Page.select = function(scrollto, doanimate) {
- var inopts, outopts;
- scrollto = $(scrollto);
- if (!scrollto && !this.selected_element) {
- return;
- }
- if (scrollto && this.selected_element && scrollto.attr('id') === this.selected_element.attr('id')) {
- return;
- }
- if (doanimate) {
- inopts = {
- 'duration': 2000,
- 'easing': 'easeInOutExpo'
- };
- outopts = {
- 'duration': 100,
- 'easing': 'easeInOutExpo'
- };
- } else {
- inopts = {
- 'duration': 0
- };
- outopts = {
- 'duration': 0
- };
- }
- if (this.selected_element) {
- this.selected_element.removeClass('selected', outopts);
- this.selected_element = null;
- }
- if (scrollto) {
- this.selected_element = $(scrollto);
- return this.selected_element.addClass('selected', inopts);
- }
+\tvar inopts, outopts;
+\tscrollto = $(scrollto);
+\tif (!scrollto && !this.selected_element) {
+\t return;
+\t}
+\tif (scrollto && this.selected_element && scrollto.attr('id') === this.selected_element.attr('id')) {
+\t return;
+\t}
+\tif (doanimate) {
+\t inopts = {
+\t\t'duration': 2000,
+\t\t'easing': 'easeInOutExpo'
+\t };
+\t outopts = {
+\t\t'duration': 100,
+\t\t'easing': 'easeInOutExpo'
+\t };
+\t} else {
+\t inopts = {
+\t\t'duration': 0
+\t };
+\t outopts = {
+\t\t'duration': 0
+\t };
+\t}
+\tif (this.selected_element) {
+\t this.selected_element.removeClass('selected', outopts);
+\t this.selected_element = null;
+\t}
+\tif (scrollto) {
+\t this.selected_element = $(scrollto);
+\t return this.selected_element.addClass('selected', inopts);
+\t}
};
Page.scroll = function(page, scrollto, newpage) {
- var e, istopandnew, top;
- if (!scrollto) {
- return;
- }
- if (page === null) {
- page = this.current_page;
- }
- e = $(document).find('#' + scrollto.replace(/([:() +])/g, '\\$1')).first();
- if (e && e.length > 0) {
- e = $(e);
- top = e.offset().top - 10;
- istopandnew = newpage && e.is('h1');
- if (this.first || istopandnew) {
- if (!istopandnew) {
- this.select(e);
- } else {
- this.select();
- }
- $('html, body').scrollTop(top);
- } else {
- this.select(e, true);
- $('html, body').animate({
- scrollTop: top
- }, 1000, 'easeInOutExpo');
- }
- } else {
- this.select(null, true);
- }
- return this.first = false;
+\tvar e, istopandnew, top;
+\tif (!scrollto) {
+\t return;
+\t}
+\tif (page === null) {
+\t page = this.current_page;
+\t}
+\te = $(document).find('#' + scrollto.replace(/([:() +])/g, '\\$1')).first();
+\tif (e && e.length > 0) {
+\t e = $(e);
+\t top = e.offset().top - 10;
+\t istopandnew = newpage && e.is('h1');
+\t if (this.first || istopandnew) {
+\t\tif (!istopandnew) {
+\t\t this.select(e);
+\t\t} else {
+\t\t this.select();
+\t\t}
+\t\t$('html, body').scrollTop(top);
+\t } else {
+\t\tthis.select(e, true);
+\t\t$('html, body').animate({
+\t\t scrollTop: top
+\t\t}, 1000, 'easeInOutExpo');
+\t }
+\t} else {
+\t this.select(null, true);
+\t}
+\treturn this.first = false;
};
Page.render_search = function(result) {
- var a, content, cpage, data, end, item, j, len, len1, len2, o, p, page, pageid, pageidesc, parts, prev, records, ref2, ref3, ref4, ref5, res, sortfunc, start, t, tag;
- content = $('#cldoc_content');
- content.children().detach();
- $('Search
').append(result.q).appendTo(content);
- if (result.records.length === 0) {
- $('There were no results for this search query.').appendTo(content);
- cldoc.Sidebar.render_search([]);
- $('html, body').scrollTop(0);
- return;
- }
- records = [];
- ref2 = result.records;
- for (j = 0, len = ref2.length; j < len; j++) {
- res = ref2[j];
- ref3 = this.split_ref(res.id), page = ref3[0], pageid = ref3[1];
- if (!page in this.pages) {
- continue;
- }
- cpage = this.pages[page];
- data = cpage.xml;
- pageidesc = pageid.replace(/([:() ])/g, '\\$1');
- item = data.find('#' + pageidesc);
- if (item.length !== 1) {
- continue;
- }
- tag = cldoc.tag(item)[0];
- res.type = tag;
- res.brief = new cldoc.Doc(item.children('brief'));
- res.page = page;
- res.qid = pageid;
- records.push(res);
- }
- sortfunc = function(a, b) {
- var ai, bi;
- if (a.score !== b.score) {
- if (a.score > b.score) {
- return -1;
- } else {
- return 1;
- }
- }
- if (a.type !== b.type) {
- ai = cldoc.Node.order[a.type];
- bi = cldoc.Node.order[b.type];
- if (ai !== bi) {
- if (ai < bi) {
- return -1;
- } else {
- return 1;
- }
- }
- }
- if (a.name < b.name) {
- return -1;
- } else {
- return 1;
- }
- };
- records.sort(sortfunc);
- t = $('
').appendTo(content);
- for (o = 0, len1 = records.length; o < len1; o++) {
- res = records[o];
- res.results.sort(function(a, b) {
- if (a[0] !== b[0]) {
- if (a[0] < b[0]) {
- return -1;
- } else {
- return 1;
- }
- }
- if (a[1] > b[1]) {
- return -1;
- }
- if (a[1] < b[1]) {
- return 1;
- }
- return 0;
- });
- prev = 0;
- parts = [];
- ref4 = res.results;
- for (p = 0, len2 = ref4.length; p < len2; p++) {
- ref5 = ref4[p], start = ref5[0], end = ref5[1];
- if (start < prev) {
- continue;
- }
- parts.push(res.qid.substring(prev, start));
- parts.push($('').text(res.qid.substring(start, end)));
- prev = end;
- }
- parts.push(res.qid.substring(prev, res.qid.length));
- a = $('', {
- href: this.make_internal_ref(res.id)
- }).html(parts);
- a.on('click', (function(_this) {
- return function(res) {
- return function() {
- return _this.load_ref(res.id);
- };
- };
- })(this)(res));
- $(' ').append($(' ').text(res.type)).append($(' ').html(a)).appendTo(t);
- $(' ').append($(' ')).append($(' ').html(res.brief.render())).appendTo(t);
- }
- cldoc.Sidebar.render_search(records);
- return $('html, body').scrollTop(0);
+\tvar a, content, cpage, data, end, item, j, len, len1, len2, o, p, page, pageid, pageidesc, parts, prev, records, ref2, ref3, ref4, ref5, res, sortfunc, start, t, tag;
+\tcontent = $('#cldoc_content');
+\tcontent.children().detach();
+\t$('Search
').append(result.q).appendTo(content);
+\tif (result.records.length === 0) {
+\t $('There were no results for this search query.').appendTo(content);
+\t cldoc.Sidebar.render_search([]);
+\t $('html, body').scrollTop(0);
+\t return;
+\t}
+\trecords = [];
+\tref2 = result.records;
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t res = ref2[j];
+\t ref3 = this.split_ref(res.id), page = ref3[0], pageid = ref3[1];
+\t if (!page in this.pages) {
+\t\tcontinue;
+\t }
+\t cpage = this.pages[page];
+\t data = cpage.xml;
+\t pageidesc = pageid.replace(/([:() ])/g, '\\$1');
+\t item = data.find('#' + pageidesc);
+\t if (item.length !== 1) {
+\t\tcontinue;
+\t }
+\t tag = cldoc.tag(item)[0];
+\t res.type = tag;
+\t res.brief = new cldoc.Doc(item.children('brief'));
+\t res.page = page;
+\t res.qid = pageid;
+\t records.push(res);
+\t}
+\tsortfunc = function(a, b) {
+\t var ai, bi;
+\t if (a.score !== b.score) {
+\t\tif (a.score > b.score) {
+\t\t return -1;
+\t\t} else {
+\t\t return 1;
+\t\t}
+\t }
+\t if (a.type !== b.type) {
+\t\tai = cldoc.Node.order[a.type];
+\t\tbi = cldoc.Node.order[b.type];
+\t\tif (ai !== bi) {
+\t\t if (ai < bi) {
+\t\t\treturn -1;
+\t\t } else {
+\t\t\treturn 1;
+\t\t }
+\t\t}
+\t }
+\t if (a.name < b.name) {
+\t\treturn -1;
+\t } else {
+\t\treturn 1;
+\t }
+\t};
+\trecords.sort(sortfunc);
+\tt = $('
').appendTo(content);
+\tfor (o = 0, len1 = records.length; o < len1; o++) {
+\t res = records[o];
+\t res.results.sort(function(a, b) {
+\t\tif (a[0] !== b[0]) {
+\t\t if (a[0] < b[0]) {
+\t\t\treturn -1;
+\t\t } else {
+\t\t\treturn 1;
+\t\t }
+\t\t}
+\t\tif (a[1] > b[1]) {
+\t\t return -1;
+\t\t}
+\t\tif (a[1] < b[1]) {
+\t\t return 1;
+\t\t}
+\t\treturn 0;
+\t });
+\t prev = 0;
+\t parts = [];
+\t ref4 = res.results;
+\t for (p = 0, len2 = ref4.length; p < len2; p++) {
+\t\tref5 = ref4[p], start = ref5[0], end = ref5[1];
+\t\tif (start < prev) {
+\t\t continue;
+\t\t}
+\t\tparts.push(res.qid.substring(prev, start));
+\t\tparts.push($('').text(res.qid.substring(start, end)));
+\t\tprev = end;
+\t }
+\t parts.push(res.qid.substring(prev, res.qid.length));
+\t a = $('', {
+\t\thref: this.make_internal_ref(res.id)
+\t }).html(parts);
+\t a.on('click', (function(_this) {
+\t\treturn function(res) {
+\t\t return function() {
+\t\t\treturn _this.load_ref(res.id);
+\t\t };
+\t\t};
+\t })(this)(res));
+\t $(' ').append($(' ').text(res.type)).append($(' ').html(a)).appendTo(t);
+\t $(' ').append($(' ')).append($(' ').html(res.brief.render())).appendTo(t);
+\t}
+\tcldoc.Sidebar.render_search(records);
+\treturn $('html, body').scrollTop(0);
};
Page.search_result = function(result) {
- var j, len, page, pageid, pagereqcount, pages, record, ref2, ref3, results1;
- pagereqcount = 0;
- pages = {};
- ref2 = result.records;
- for (j = 0, len = ref2.length; j < len; j++) {
- record = ref2[j];
- ref3 = this.split_ref(record.id), page = ref3[0], pageid = ref3[1];
- if (page in pages) {
- continue;
- }
- pagereqcount += 1;
- pages[page] = true;
- }
- if (pagereqcount === 0) {
- this.render_search(result);
- }
- results1 = [];
- for (page in pages) {
- results1.push(this.request_page(page, (function(_this) {
- return function() {
- pagereqcount -= 1;
- if (pagereqcount === 0) {
- return _this.render_search(result);
- }
- };
- })(this)));
- }
- return results1;
+\tvar j, len, page, pageid, pagereqcount, pages, record, ref2, ref3, results1;
+\tpagereqcount = 0;
+\tpages = {};
+\tref2 = result.records;
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t record = ref2[j];
+\t ref3 = this.split_ref(record.id), page = ref3[0], pageid = ref3[1];
+\t if (page in pages) {
+\t\tcontinue;
+\t }
+\t pagereqcount += 1;
+\t pages[page] = true;
+\t}
+\tif (pagereqcount === 0) {
+\t this.render_search(result);
+\t}
+\tresults1 = [];
+\tfor (page in pages) {
+\t results1.push(this.request_page(page, (function(_this) {
+\t\treturn function() {
+\t\t pagereqcount -= 1;
+\t\t if (pagereqcount === 0) {
+\t\t\treturn _this.render_search(result);
+\t\t }
+\t\t};
+\t })(this)));
+\t}
+\treturn results1;
};
Page.search = function(q) {
- if (q.length < 3) {
- return false;
- }
- if (!this.search.db) {
- this.search.db = new cldoc.SearchDb();
- }
- this.search.db.search(q, (function(_this) {
- return function(res) {
- return _this.search_result(res);
- };
- })(this));
- return true;
+\tif (q.length < 3) {
+\t return false;
+\t}
+\tif (!this.search.db) {
+\t this.search.db = new cldoc.SearchDb();
+\t}
+\tthis.search.db.search(q, (function(_this) {
+\t return function(res) {
+\t\treturn _this.search_result(res);
+\t };
+\t})(this));
+\treturn true;
};
Page.exit_search = function() {
- var ref;
- ref = Page.make_external_ref(document.location.hash.substring(1));
- cldoc.Sidebar.exit_search();
- this.current_page = null;
- return this.load_ref(ref);
+\tvar ref;
+\tref = Page.make_external_ref(document.location.hash.substring(1));
+\tcldoc.Sidebar.exit_search();
+\tthis.current_page = null;
+\treturn this.load_ref(ref);
};
return Page;
@@ -799,178 +799,178 @@ cldoc.Sidebar = (function() {
function Sidebar() {}
Sidebar.init = function() {
- var close, div, exitsearch, icon, input, it, items, sidebar;
- sidebar = $('#cldoc #cldoc_sidebar');
- if (!sidebar) {
- return;
- }
- items = $('').attr('id', 'cldoc_sidebar_items');
- it = items[0];
- items.on('DOMSubtreeModified', (function(_this) {
- return function(e) {
- if (it.scrollHeight > it.clientHeight) {
- return $(it).removeClass('hide_scrollbar');
- } else {
- return $(it).addClass('hide_scrollbar');
- }
- };
- })(this));
- sidebar.append(items);
- div = $('').attr('id', 'cldoc_search');
- icon = $('');
- close = $('');
- input = $('');
- items = $().add(div).add(icon).add(close);
- input.on('focus', function(e) {
- return items.addClass('focus');
- });
- $('body').on('keydown', function(e) {
- if (e.altKey && e.keyCode === 83) {
- input.focus();
- input.select();
- return true;
- }
- });
- input.on('blur', function() {
- return items.removeClass('focus');
- });
- icon.on('click', function() {
- return input.focus();
- });
- exitsearch = function() {
- input.val('');
- input.blur();
- return cldoc.Page.exit_search();
- };
- close.on('click', exitsearch);
- input.on('keypress', function(e) {
- if (e.which === 13) {
- cldoc.Page.search(input.val());
- return true;
- }
- });
- input.on('keydown', function(e) {
- if (e.keyCode === 27) {
- return exitsearch();
- }
- });
- div.append(icon);
- div.append(input);
- div.append(close);
- return sidebar.append(div);
+\tvar close, div, exitsearch, icon, input, it, items, sidebar;
+\tsidebar = $('#cldoc #cldoc_sidebar');
+\tif (!sidebar) {
+\t return;
+\t}
+\titems = $('').attr('id', 'cldoc_sidebar_items');
+\tit = items[0];
+\titems.on('DOMSubtreeModified', (function(_this) {
+\t return function(e) {
+\t\tif (it.scrollHeight > it.clientHeight) {
+\t\t return $(it).removeClass('hide_scrollbar');
+\t\t} else {
+\t\t return $(it).addClass('hide_scrollbar');
+\t\t}
+\t };
+\t})(this));
+\tsidebar.append(items);
+\tdiv = $('').attr('id', 'cldoc_search');
+\ticon = $('');
+\tclose = $('');
+\tinput = $('');
+\titems = $().add(div).add(icon).add(close);
+\tinput.on('focus', function(e) {
+\t return items.addClass('focus');
+\t});
+\t$('body').on('keydown', function(e) {
+\t if (e.altKey && e.keyCode === 83) {
+\t\tinput.focus();
+\t\tinput.select();
+\t\treturn true;
+\t }
+\t});
+\tinput.on('blur', function() {
+\t return items.removeClass('focus');
+\t});
+\ticon.on('click', function() {
+\t return input.focus();
+\t});
+\texitsearch = function() {
+\t input.val('');
+\t input.blur();
+\t return cldoc.Page.exit_search();
+\t};
+\tclose.on('click', exitsearch);
+\tinput.on('keypress', function(e) {
+\t if (e.which === 13) {
+\t\tcldoc.Page.search(input.val());
+\t\treturn true;
+\t }
+\t});
+\tinput.on('keydown', function(e) {
+\t if (e.keyCode === 27) {
+\t\treturn exitsearch();
+\t }
+\t});
+\tdiv.append(icon);
+\tdiv.append(input);
+\tdiv.append(close);
+\treturn sidebar.append(div);
};
Sidebar.render_search = function(results) {
- return $('#cldoc_sidebar').addClass('search');
+\treturn $('#cldoc_sidebar').addClass('search');
};
Sidebar.exit_search = function() {
- return $('#cldoc_sidebar').removeClass('search');
+\treturn $('#cldoc_sidebar').removeClass('search');
};
Sidebar.load_html = function(html) {
- var items;
- items = $('#cldoc #cldoc_sidebar #cldoc_sidebar_items');
- items.children().detach();
- return items.append(html);
+\tvar items;
+\titems = $('#cldoc #cldoc_sidebar #cldoc_sidebar_items');
+\titems.children().detach();
+\treturn items.append(html);
};
Sidebar.load = function(page) {
- var c, div, e, group, head, id, items, j, l, len, ln, name, onpage, parts, ref2;
- items = $('#cldoc #cldoc_sidebar #cldoc_sidebar_items');
- e = cldoc.html_escape;
- if (items.length === 0) {
- return null;
- }
- items.children().detach();
- head = cldoc.Page.make_header(page);
- if (head) {
- div = '';
- div += head;
- id = page.attr('id');
- parts = id.split('::');
- l = parts.slice(0, parts.length - 1).join('::');
- name = '↵ ';
- if (parts.length === 1) {
- name += 'Index';
- } else {
- name += '' + e(parts[parts.length - 2]) + '';
- }
- ln = cldoc.Page.make_internal_ref(l);
- div += '' + name + '';
- items.append($(div));
- }
- items.append($(''));
- onpage = page.children();
- c = '';
- ref2 = cldoc.Node.groups;
- for (j = 0, len = ref2.length; j < len; j++) {
- group = ref2[j];
- c += this.load_group(page, onpage.filter(group));
- }
- items.append($(c));
- cldoc.Page.bind_links(items);
- return $('#cldoc_sidebar_items').children();
+\tvar c, div, e, group, head, id, items, j, l, len, ln, name, onpage, parts, ref2;
+\titems = $('#cldoc #cldoc_sidebar #cldoc_sidebar_items');
+\te = cldoc.html_escape;
+\tif (items.length === 0) {
+\t return null;
+\t}
+\titems.children().detach();
+\thead = cldoc.Page.make_header(page);
+\tif (head) {
+\t div = '';
+\t div += head;
+\t id = page.attr('id');
+\t parts = id.split('::');
+\t l = parts.slice(0, parts.length - 1).join('::');
+\t name = '↵ ';
+\t if (parts.length === 1) {
+\t\tname += 'Index';
+\t } else {
+\t\tname += '' + e(parts[parts.length - 2]) + '';
+\t }
+\t ln = cldoc.Page.make_internal_ref(l);
+\t div += '' + name + '';
+\t items.append($(div));
+\t}
+\titems.append($(''));
+\tonpage = page.children();
+\tc = '';
+\tref2 = cldoc.Node.groups;
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t group = ref2[j];
+\t c += this.load_group(page, onpage.filter(group));
+\t}
+\titems.append($(c));
+\tcldoc.Page.bind_links(items);
+\treturn $('#cldoc_sidebar_items').children();
};
Sidebar.load_group = function(page, items) {
- var brief, e, ftag, isprot, isstat, isvirt, item, j, len, nm, ret, tp, type;
- if (items.length === 0) {
- return '';
- }
- ftag = cldoc.tag($(items[0]))[0];
- type = cldoc.Page.node_type(items);
- if (!type) {
- return '';
- }
- e = cldoc.html_escape;
- ret = '' + e(type.title[1]) + '';
- ret += '';
- for (j = 0, len = items.length; j < len; j++) {
- item = items[j];
- item = $(item);
- if (cldoc.tag(item)[0] !== ftag) {
- tp = cldoc.Page.node_type(item);
- } else {
- tp = type;
- }
- if (!tp) {
- continue;
- }
- item = new tp(item);
- if ('render_sidebar' in item) {
- ret += item.render_sidebar();
- continue;
- }
- ret += '- ';
- nm = item.sidebar_name();
- if (item.ref) {
- href = cldoc.Page.make_internal_ref(item.ref);
- } else {
- href = cldoc.Page.make_internal_ref(cldoc.Page.current_page, item.id);
- }
- ret += '' + e(nm) + '';
- isvirt = item.node.attr('virtual');
- isprot = item.node.attr('access') === 'protected';
- isstat = item.node.attr('static');
- if (isprot && isvirt) {
- ret += 'p v';
- } else if (isprot && isstat) {
- ret += 's p';
- } else if (isprot) {
- ret += 'p';
- } else if (isstat) {
- ret += 's';
- } else if (isvirt) {
- ret += 'v';
- }
- brief = new cldoc.Doc(item.brief).render();
- if (brief) {
- ret += brief;
- }
- ret += '
';
- }
- return ret + '
';
+\tvar brief, e, ftag, isprot, isstat, isvirt, item, j, len, nm, ret, tp, type;
+\tif (items.length === 0) {
+\t return '';
+\t}
+\tftag = cldoc.tag($(items[0]))[0];
+\ttype = cldoc.Page.node_type(items);
+\tif (!type) {
+\t return '';
+\t}
+\te = cldoc.html_escape;
+\tret = '' + e(type.title[1]) + '';
+\tret += '';
+\tfor (j = 0, len = items.length; j < len; j++) {
+\t item = items[j];
+\t item = $(item);
+\t if (cldoc.tag(item)[0] !== ftag) {
+\t\ttp = cldoc.Page.node_type(item);
+\t } else {
+\t\ttp = type;
+\t }
+\t if (!tp) {
+\t\tcontinue;
+\t }
+\t item = new tp(item);
+\t if ('render_sidebar' in item) {
+\t\tret += item.render_sidebar();
+\t\tcontinue;
+\t }
+\t ret += '- ';
+\t nm = item.sidebar_name();
+\t if (item.ref) {
+\t\thref = cldoc.Page.make_internal_ref(item.ref);
+\t } else {
+\t\thref = cldoc.Page.make_internal_ref(cldoc.Page.current_page, item.id);
+\t }
+\t ret += '' + e(nm) + '';
+\t isvirt = item.node.attr('virtual');
+\t isprot = item.node.attr('access') === 'protected';
+\t isstat = item.node.attr('static');
+\t if (isprot && isvirt) {
+\t\tret += 'p v';
+\t } else if (isprot && isstat) {
+\t\tret += 's p';
+\t } else if (isprot) {
+\t\tret += 'p';
+\t } else if (isstat) {
+\t\tret += 's';
+\t } else if (isvirt) {
+\t\tret += 'v';
+\t }
+\t brief = new cldoc.Doc(item.brief).render();
+\t if (brief) {
+\t\tret += brief;
+\t }
+\t ret += '
';
+\t}
+\treturn ret + '
';
};
return Sidebar;
@@ -981,8 +981,8 @@ cldoc.Mixin = function() {
var base, j, mixin, mixins;
base = arguments[0], mixins = 2 <= arguments.length ? slice.call(arguments, 1) : [];
for (j = mixins.length - 1; j >= 0; j += -1) {
- mixin = mixins[j];
- base = mixin(base);
+\tmixin = mixins[j];
+\tbase = mixin(base);
}
return base;
};
@@ -993,71 +993,71 @@ cldoc.Node = (function() {
Node.groups = ['coverage', 'arguments', 'references', 'category', 'namespace', 'templatetypeparameter, templatenontypeparameter', 'base', 'implements', 'subclass', 'implementedby', 'typedef', 'class, classtemplate', 'gobject\\:class', 'gobject\\:interface', 'gobject\\:boxed', 'struct, structtemplate', 'enum', 'field, union', 'variable', 'gobject\\:property', 'constructor', 'destructor', 'method, methodtemplate', 'function, functiontemplate', 'report'];
Node.order = {
- 'category': 0,
- 'namespace': 1,
- 'templatetypeparameter': 2,
- 'templatenontypeparameter': 2,
- 'base': 3,
- 'implements': 3,
- 'subclass': 4,
- 'implementedby': 4,
- 'typedef': 5,
- 'class': 6,
- 'classtemplate': 6,
- 'gobjectclass': 6,
- 'gobjectinterface': 7,
- 'struct': 8,
- 'structtemplate': 8,
- 'gobjectboxed': 8,
- 'enum': 9,
- 'enumvalue': 10,
- 'field': 11,
- 'union': 12,
- 'variable': 13,
- 'gobjectproperty': 13,
- 'constructor': 14,
- 'destructor': 15,
- 'method': 16,
- 'methodtemplate': 16,
- 'function': 17,
- 'functiontemplate': 17
+\t'category': 0,
+\t'namespace': 1,
+\t'templatetypeparameter': 2,
+\t'templatenontypeparameter': 2,
+\t'base': 3,
+\t'implements': 3,
+\t'subclass': 4,
+\t'implementedby': 4,
+\t'typedef': 5,
+\t'class': 6,
+\t'classtemplate': 6,
+\t'gobjectclass': 6,
+\t'gobjectinterface': 7,
+\t'struct': 8,
+\t'structtemplate': 8,
+\t'gobjectboxed': 8,
+\t'enum': 9,
+\t'enumvalue': 10,
+\t'field': 11,
+\t'union': 12,
+\t'variable': 13,
+\t'gobjectproperty': 13,
+\t'constructor': 14,
+\t'destructor': 15,
+\t'method': 16,
+\t'methodtemplate': 16,
+\t'function': 17,
+\t'functiontemplate': 17
};
Node.render_container_tag = 'div';
function Node(node1) {
- this.node = node1;
- if (!this.node) {
- return;
- }
- if (this.node.length === 0) {
- this.node = null;
- return;
- }
- this.name = this.node.attr('name');
- this.id = this.node.attr('id');
- this.ref = this.node.attr('ref');
- if (this.ref && !this.id) {
- this.id = this.ref.replace('#', '+');
- }
- this.brief = this.node.children('brief').first();
- this.doc = this.node.children('doc').first();
+\tthis.node = node1;
+\tif (!this.node) {
+\t return;
+\t}
+\tif (this.node.length === 0) {
+\t this.node = null;
+\t return;
+\t}
+\tthis.name = this.node.attr('name');
+\tthis.id = this.node.attr('id');
+\tthis.ref = this.node.attr('ref');
+\tif (this.ref && !this.id) {
+\t this.id = this.ref.replace('#', '+');
+\t}
+\tthis.brief = this.node.children('brief').first();
+\tthis.doc = this.node.children('doc').first();
}
Node.prototype.full_name_for_display = function() {
- return null;
+\treturn null;
};
Node.prototype.sidebar_name = function() {
- return this.name;
+\treturn this.name;
};
Node.render_container = function() {
- return ['<' + this.render_container_tag + ' class="' + cldoc.html_escape(this.title[1].toLowerCase().replace(/[ ]/g, '_')) + '">', '' + this.render_container_tag + '>'];
+\treturn ['<' + this.render_container_tag + ' class="' + cldoc.html_escape(this.title[1].toLowerCase().replace(/[ ]/g, '_')) + '">', '' + this.render_container_tag + '>'];
};
Node.prototype.render = function() {
- return null;
+\treturn null;
};
return Node;
@@ -1068,134 +1068,134 @@ cldoc.Type = (function(superClass) {
extend(Type, superClass);
function Type(node1) {
- var a, arg, args, builtincls, e, i, j, len, len1, name, o, result, subtype;
- this.node = node1;
- Type.__super__.constructor.call(this, this.node);
- this.qualifier = this.node.attr('qualifier');
- this.size = this.node.attr('size');
- this.transfer_ownership = this.node.attr('transfer-ownership') || 'none';
- this.allow_none = this.node.attr('allow-none') === 'yes';
- this.typeparts = [];
- this.typeparts_text = [];
- subtype = this.node.children('type');
- e = cldoc.html_escape;
- if (subtype.length > 0) {
- this.subtype = this.append_type(subtype);
- }
- if (this.node.attr('class') === 'function') {
- this.typeparts.push('');
- this.typeparts_text.push('');
- result = this.node.children('result').first();
- args = this.node.children('arguments').first().children('type');
- this.result = this.append_type($(result));
- this.args = [];
- this.typeparts.push('');
- this.typeparts_text.push('');
- this.append_plain_part('(');
- this.append_qualifier();
- this.append_plain_part(')');
- this.typeparts.push('');
- this.typeparts_text.push('');
- this.append_plain_part('(');
- for (i = j = 0, len = args.length; j < len; i = ++j) {
- arg = args[i];
- if (i !== 0) {
- this.append_plain_part(', ');
- }
- this.args.push(this.append_type($(arg)));
- }
- this.append_plain_part(')');
- this.typeparts.push('');
- this.typeparts_text.push('');
- } else if (this.node.attr('class') === 'template') {
- this.typeparts.push('');
- this.typeparts_text.push('');
- if (this.ref) {
- a = cldoc.Page.make_link(this.ref, this.name);
- name = '' + a + '';
- } else {
- name = '' + e(this.name) + '';
- }
- this.typeparts.push(name);
- this.typeparts_text.push(this.name);
- this.typeparts.push('');
- this.typeparts_text.push('');
- this.append_plain_part('<');
- args = this.node.children('template-arguments').first().children('type');
- this.args = [];
- for (i = o = 0, len1 = args.length; o < len1; i = ++o) {
- arg = args[i];
- if (i !== 0) {
- this.append_plain_part(', ');
- }
- this.args.push(this.append_type($(arg)));
- }
- this.append_plain_part('>');
- this.typeparts.push('');
- this.typeparts_text.push('');
- } else {
- if (this.name) {
- if (this.node.attr('builtin')) {
- builtincls = 'builtin';
- } else {
- builtincls = '';
- }
- if (this.ref) {
- a = cldoc.Page.make_link(this.ref, this.name);
- name = '' + a + '';
- } else {
- name = '' + e(this.name) + '';
- }
- this.typeparts.push(name);
- this.typeparts_text.push(this.name);
- }
- this.append_qualifier();
- }
- if (this.size) {
- this.typeparts.push('' + '[' + this.size + ']' + '');
- this.typeparts_text.push('[' + this.size + ']');
- }
+\tvar a, arg, args, builtincls, e, i, j, len, len1, name, o, result, subtype;
+\tthis.node = node1;
+\tType.__super__.constructor.call(this, this.node);
+\tthis.qualifier = this.node.attr('qualifier');
+\tthis.size = this.node.attr('size');
+\tthis.transfer_ownership = this.node.attr('transfer-ownership') || 'none';
+\tthis.allow_none = this.node.attr('allow-none') === 'yes';
+\tthis.typeparts = [];
+\tthis.typeparts_text = [];
+\tsubtype = this.node.children('type');
+\te = cldoc.html_escape;
+\tif (subtype.length > 0) {
+\t this.subtype = this.append_type(subtype);
+\t}
+\tif (this.node.attr('class') === 'function') {
+\t this.typeparts.push('');
+\t this.typeparts_text.push('');
+\t result = this.node.children('result').first();
+\t args = this.node.children('arguments').first().children('type');
+\t this.result = this.append_type($(result));
+\t this.args = [];
+\t this.typeparts.push('');
+\t this.typeparts_text.push('');
+\t this.append_plain_part('(');
+\t this.append_qualifier();
+\t this.append_plain_part(')');
+\t this.typeparts.push('');
+\t this.typeparts_text.push('');
+\t this.append_plain_part('(');
+\t for (i = j = 0, len = args.length; j < len; i = ++j) {
+\t\targ = args[i];
+\t\tif (i !== 0) {
+\t\t this.append_plain_part(', ');
+\t\t}
+\t\tthis.args.push(this.append_type($(arg)));
+\t }
+\t this.append_plain_part(')');
+\t this.typeparts.push('');
+\t this.typeparts_text.push('');
+\t} else if (this.node.attr('class') === 'template') {
+\t this.typeparts.push('');
+\t this.typeparts_text.push('');
+\t if (this.ref) {
+\t\ta = cldoc.Page.make_link(this.ref, this.name);
+\t\tname = '' + a + '';
+\t } else {
+\t\tname = '' + e(this.name) + '';
+\t }
+\t this.typeparts.push(name);
+\t this.typeparts_text.push(this.name);
+\t this.typeparts.push('');
+\t this.typeparts_text.push('');
+\t this.append_plain_part('<');
+\t args = this.node.children('template-arguments').first().children('type');
+\t this.args = [];
+\t for (i = o = 0, len1 = args.length; o < len1; i = ++o) {
+\t\targ = args[i];
+\t\tif (i !== 0) {
+\t\t this.append_plain_part(', ');
+\t\t}
+\t\tthis.args.push(this.append_type($(arg)));
+\t }
+\t this.append_plain_part('>');
+\t this.typeparts.push('');
+\t this.typeparts_text.push('');
+\t} else {
+\t if (this.name) {
+\t\tif (this.node.attr('builtin')) {
+\t\t builtincls = 'builtin';
+\t\t} else {
+\t\t builtincls = '';
+\t\t}
+\t\tif (this.ref) {
+\t\t a = cldoc.Page.make_link(this.ref, this.name);
+\t\t name = '' + a + '';
+\t\t} else {
+\t\t name = '' + e(this.name) + '';
+\t\t}
+\t\tthis.typeparts.push(name);
+\t\tthis.typeparts_text.push(this.name);
+\t }
+\t this.append_qualifier();
+\t}
+\tif (this.size) {
+\t this.typeparts.push('' + '[' + this.size + ']' + '');
+\t this.typeparts_text.push('[' + this.size + ']');
+\t}
}
Type.prototype.as_text = function() {
- return this.typeparts_text.join('');
+\treturn this.typeparts_text.join('');
};
Type.prototype.render = function() {
- var item, j, len, ref2, ret;
- ret = '';
- ref2 = this.typeparts;
- for (j = 0, len = ref2.length; j < len; j++) {
- item = ref2[j];
- ret += item;
- }
- return ret;
+\tvar item, j, len, ref2, ret;
+\tret = '';
+\tref2 = this.typeparts;
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t item = ref2[j];
+\t ret += item;
+\t}
+\treturn ret;
};
Type.prototype.append_type = function(type) {
- type = new Type(type);
- this.typeparts.push('');
- this.typeparts_text.push('');
- this.typeparts = this.typeparts.concat(type.typeparts);
- this.typeparts_text = this.typeparts_text.concat(type.typeparts_text);
- this.typeparts.push('');
- this.typeparts_text.push('');
- return type;
+\ttype = new Type(type);
+\tthis.typeparts.push('');
+\tthis.typeparts_text.push('');
+\tthis.typeparts = this.typeparts.concat(type.typeparts);
+\tthis.typeparts_text = this.typeparts_text.concat(type.typeparts_text);
+\tthis.typeparts.push('');
+\tthis.typeparts_text.push('');
+\treturn type;
};
Type.prototype.append_plain_part = function(text) {
- this.typeparts.push('' + cldoc.html_escape(text) + '');
- return this.typeparts_text.push(text);
+\tthis.typeparts.push('' + cldoc.html_escape(text) + '');
+\treturn this.typeparts_text.push(text);
};
Type.prototype.append_qualifier = function() {
- var q, qc;
- if (this.qualifier) {
- qc = cldoc.html_escape(this.qualifier).replace(/const/g, 'const');
- q = ' ' + qc + '';
- this.typeparts.push(q);
- return this.typeparts_text.push(this.qualifier);
- }
+\tvar q, qc;
+\tif (this.qualifier) {
+\t qc = cldoc.html_escape(this.qualifier).replace(/const/g, 'const');
+\t q = ' ' + qc + '';
+\t this.typeparts.push(q);
+\t return this.typeparts_text.push(this.qualifier);
+\t}
};
return Type;
@@ -1210,126 +1210,126 @@ cldoc.Doc = (function(superClass) {
Doc.magic_separator = '%~@@~%';
Doc.init = function() {
- var origproto;
- origproto = marked.InlineLexer.prototype.outputLink;
- return marked.InlineLexer.prototype.outputLink = function(cap, link) {
- var orighref, ret;
- orighref = link.href;
- if (link.href.match(/^[a-z]+:/) === null && link.href[0] !== '/') {
- link.href = cldoc.host + '/' + link.href;
- }
- ret = origproto.call(this, cap, link);
- link.href = orighref;
- return ret;
- };
+\tvar origproto;
+\torigproto = marked.InlineLexer.prototype.outputLink;
+\treturn marked.InlineLexer.prototype.outputLink = function(cap, link) {
+\t var orighref, ret;
+\t orighref = link.href;
+\t if (link.href.match(/^[a-z]+:/) === null && link.href[0] !== '/') {
+\t\tlink.href = cldoc.host + '/' + link.href;
+\t }
+\t ret = origproto.call(this, cap, link);
+\t link.href = orighref;
+\t return ret;
+\t};
};
function Doc(node1) {
- this.node = node1;
- Doc.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tDoc.__super__.constructor.call(this, this.node);
}
Doc.either = function(node) {
- var brief, doc;
- doc = this.doc(node);
- if (doc) {
- return doc;
- }
- brief = this.brief(node);
- if (brief) {
- return brief;
- }
- return '';
+\tvar brief, doc;
+\tdoc = this.doc(node);
+\tif (doc) {
+\t return doc;
+\t}
+\tbrief = this.brief(node);
+\tif (brief) {
+\t return brief;
+\t}
+\treturn '';
};
Doc.brief = function(node) {
- return new Doc(node.children('brief')).render();
+\treturn new Doc(node.children('brief')).render();
};
Doc.doc = function(node) {
- return new Doc(node.children('doc')).render();
+\treturn new Doc(node.children('doc')).render();
};
Doc.prototype.escape = function(text) {
- var r;
- r = /([*_\\`{}#+-.!\[\]])/g;
- return text.replace(r, function(m) {
- return "\\" + m;
- });
+\tvar r;
+\tr = /([*_\\`{}#+-.!\[\]])/g;
+\treturn text.replace(r, function(m) {
+\t return "\\" + m;
+\t});
};
Doc.prototype.process_markdown = function(text) {
- var a, html, i, j, marked_options, parts, ref2, rethtml;
- marked_options = {
- highlight: function(code) {
- return hljs.highlightAuto(code).value;
- }
- };
- marked.setOptions(marked_options);
- html = marked(text);
- parts = html.split(Doc.magic_separator);
- rethtml = '';
- for (i = j = 0, ref2 = parts.length - 2; j <= ref2; i = j += 3) {
- a = cldoc.Page.make_link(parts[i + 1], parts[i + 2]);
- rethtml += parts[i] + a;
- }
- return rethtml + parts[parts.length - 1];
+\tvar a, html, i, j, marked_options, parts, ref2, rethtml;
+\tmarked_options = {
+\t highlight: function(code) {
+\t\treturn hljs.highlightAuto(code).value;
+\t }
+\t};
+\tmarked.setOptions(marked_options);
+\thtml = marked(text);
+\tparts = html.split(Doc.magic_separator);
+\trethtml = '';
+\tfor (i = j = 0, ref2 = parts.length - 2; j <= ref2; i = j += 3) {
+\t a = cldoc.Page.make_link(parts[i + 1], parts[i + 2]);
+\t rethtml += parts[i] + a;
+\t}
+\treturn rethtml + parts[parts.length - 1];
};
Doc.prototype.process_code = function(code) {
- var c, e, j, len, ref2, ret, tag;
- ret = '';
- e = cldoc.html_escape;
- ref2 = $(code).contents();
- for (j = 0, len = ref2.length; j < len; j++) {
- c = ref2[j];
- if (c.nodeType === document.ELEMENT_NODE) {
- tag = c.tagName.toLowerCase();
- c = $(c);
- if (tag === 'ref') {
- ret += cldoc.Page.make_link(c.attr('ref'), c.attr('name'));
- } else {
- ret += '' + e(c.text()) + '';
- }
- } else {
- ret += e($(c).text());
- }
- }
- return ret + '
';
+\tvar c, e, j, len, ref2, ret, tag;
+\tret = '';
+\te = cldoc.html_escape;
+\tref2 = $(code).contents();
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t c = ref2[j];
+\t if (c.nodeType === document.ELEMENT_NODE) {
+\t\ttag = c.tagName.toLowerCase();
+\t\tc = $(c);
+\t\tif (tag === 'ref') {
+\t\t ret += cldoc.Page.make_link(c.attr('ref'), c.attr('name'));
+\t\t} else {
+\t\t ret += '' + e(c.text()) + '';
+\t\t}
+\t } else {
+\t\tret += e($(c).text());
+\t }
+\t}
+\treturn ret + '
';
};
Doc.prototype.render = function() {
- var astext, c, contents, e, j, len, msep, ret, tag;
- if (!this.node) {
- return '';
- }
- e = cldoc.html_escape;
- ret = '';
- contents = this.node.contents();
- astext = '';
- msep = Doc.magic_separator;
- for (j = 0, len = contents.length; j < len; j++) {
- c = contents[j];
- if (c.nodeType === document.ELEMENT_NODE) {
- tag = c.tagName.toLowerCase();
- if (tag === 'ref') {
- c = $(c);
- astext += this.escape(msep + c.attr('ref') + msep + c.text() + msep);
- } else if (tag === 'code') {
- if (astext) {
- ret += this.process_markdown(astext);
- astext = '';
- }
- ret += this.process_code(c);
- }
- } else {
- astext += $(c).text();
- }
- }
- if (astext) {
- ret += this.process_markdown(astext);
- }
- return ret + '';
+\tvar astext, c, contents, e, j, len, msep, ret, tag;
+\tif (!this.node) {
+\t return '';
+\t}
+\te = cldoc.html_escape;
+\tret = '';
+\tcontents = this.node.contents();
+\tastext = '';
+\tmsep = Doc.magic_separator;
+\tfor (j = 0, len = contents.length; j < len; j++) {
+\t c = contents[j];
+\t if (c.nodeType === document.ELEMENT_NODE) {
+\t\ttag = c.tagName.toLowerCase();
+\t\tif (tag === 'ref') {
+\t\t c = $(c);
+\t\t astext += this.escape(msep + c.attr('ref') + msep + c.text() + msep);
+\t\t} else if (tag === 'code') {
+\t\t if (astext) {
+\t\t\tret += this.process_markdown(astext);
+\t\t\tastext = '';
+\t\t }
+\t\t ret += this.process_code(c);
+\t\t}
+\t } else {
+\t\tastext += $(c).text();
+\t }
+\t}
+\tif (astext) {
+\t ret += this.process_markdown(astext);
+\t}
+\treturn ret + '';
};
return Doc;
@@ -1344,34 +1344,34 @@ cldoc.Category = (function(superClass) {
Category.title = ['', 'Categories'];
function Category(node1) {
- this.node = node1;
- Category.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tCategory.__super__.constructor.call(this, this.node);
}
Category.prototype.full_name_for_display = function() {
- return this.name;
+\treturn this.name;
};
Category.prototype.render = function() {
- var a, cat, categories, doc, j, len, ret;
- ret = '';
- ret += cldoc.Page.make_link(this.ref, this.name, {
- 'id': this.id
- });
- ret += new cldoc.Doc(this.brief).render();
- categories = this.node.children('category');
- if (categories.length > 0) {
- ret += '';
- for (j = 0, len = categories.length; j < len; j++) {
- cat = categories[j];
- cat = $(cat);
- a = cldoc.Page.make_link(cat.attr('ref'), cat.attr('name'));
- doc = cldoc.Doc.either(cat);
- ret += '' + a + ' ' + doc + ' ';
- }
- ret += '
';
- }
- return ret;
+\tvar a, cat, categories, doc, j, len, ret;
+\tret = '';
+\tret += cldoc.Page.make_link(this.ref, this.name, {
+\t 'id': this.id
+\t});
+\tret += new cldoc.Doc(this.brief).render();
+\tcategories = this.node.children('category');
+\tif (categories.length > 0) {
+\t ret += '';
+\t for (j = 0, len = categories.length; j < len; j++) {
+\t\tcat = categories[j];
+\t\tcat = $(cat);
+\t\ta = cldoc.Page.make_link(cat.attr('ref'), cat.attr('name'));
+\t\tdoc = cldoc.Doc.either(cat);
+\t\tret += '' + a + ' ' + doc + ' ';
+\t }
+\t ret += '
';
+\t}
+\treturn ret;
};
return Category;
@@ -1386,44 +1386,44 @@ cldoc.Enum = (function(superClass) {
Enum.title = ['Enum', 'Enumerations'];
function Enum(node1) {
- this.node = node1;
- Enum.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tEnum.__super__.constructor.call(this, this.node);
}
Enum.prototype.render = function() {
- var e, isprot, j, len, n, ref2, ret, value;
- e = cldoc.html_escape;
- isprot = this.node.attr('access') === 'protected';
- if (isprot) {
- n = 'protected enum';
- } else {
- n = 'enum';
- }
- if (this.node.attr('class')) {
- n += ' class';
- }
- if (this.node.attr('typedef')) {
- n = 'typedef ' + n;
- }
- ret = '' + e(n) + ' ';
- ret += '';
- if (!cldoc.startswith(this.name, '(anonymous')) {
- ret += e(this.name);
- }
- ret += '';
- ret += cldoc.Doc.either(this.node);
- ret += '';
- ref2 = this.node.children('enumvalue');
- for (j = 0, len = ref2.length; j < len; j++) {
- value = ref2[j];
- value = $(value);
- ret += '';
- ret += '' + e(value.attr('name')) + ' ';
- ret += '' + e(value.attr('value')) + ' ';
- ret += '' + cldoc.Doc.either(value) + ' ';
- ret += ' ';
- }
- return ret + '
';
+\tvar e, isprot, j, len, n, ref2, ret, value;
+\te = cldoc.html_escape;
+\tisprot = this.node.attr('access') === 'protected';
+\tif (isprot) {
+\t n = 'protected enum';
+\t} else {
+\t n = 'enum';
+\t}
+\tif (this.node.attr('class')) {
+\t n += ' class';
+\t}
+\tif (this.node.attr('typedef')) {
+\t n = 'typedef ' + n;
+\t}
+\tret = '' + e(n) + ' ';
+\tret += '';
+\tif (!cldoc.startswith(this.name, '(anonymous')) {
+\t ret += e(this.name);
+\t}
+\tret += '';
+\tret += cldoc.Doc.either(this.node);
+\tret += '';
+\tref2 = this.node.children('enumvalue');
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t value = ref2[j];
+\t value = $(value);
+\t ret += '';
+\t ret += '' + e(value.attr('name')) + ' ';
+\t ret += '' + e(value.attr('value')) + ' ';
+\t ret += '' + cldoc.Doc.either(value) + ' ';
+\t ret += ' ';
+\t}
+\treturn ret + '
';
};
return Enum;
@@ -1435,77 +1435,77 @@ cldoc.Node.types["enum"] = cldoc.Enum;
cldoc.Templated = function(base) {
var MixedIn;
MixedIn = (function(superClass) {
- extend(MixedIn, superClass);
-
- function MixedIn() {
- return MixedIn.__super__.constructor.apply(this, arguments);
- }
-
- MixedIn.prototype.template_parameter_name = function(param) {
- var def, name, ret, tp;
- param = $(param);
- name = param.attr('name');
- def = param.attr('default');
- tp = param.children('type');
- ret = '';
- if (tp.length > 0) {
- ret += (new cldoc.Type(tp)).as_text() + ' ';
- }
- ret += name;
- if (def) {
- ret += ' = ' + def;
- }
- return ret;
- };
-
- MixedIn.prototype.templated_name = function() {
- var name, x;
- name = this.name;
- name += '<';
- name += ((function() {
- var j, len, ref2, results1;
- ref2 = this.node.children('templatetypeparameter, templatenontypeparameter');
- results1 = [];
- for (j = 0, len = ref2.length; j < len; j++) {
- x = ref2[j];
- results1.push(this.template_parameter_name(x));
- }
- return results1;
- }).call(this)).join(', ');
- name += '>';
- return name;
- };
-
- MixedIn.prototype.identifier_for_display = function() {
- return this.templated_name();
- };
-
- MixedIn.prototype.full_name_for_display = function() {
- return this.templated_name();
- };
-
- MixedIn.prototype.sidebar_name = function() {
- return this.identifier_for_display();
- };
-
- MixedIn.prototype.render_arguments = function() {
- var j, len, ret, tt, x;
- ret = '';
- tt = this.node.children('templatetypeparameter, templatenontypeparameter');
- for (j = 0, len = tt.length; j < len; j++) {
- x = tt[j];
- x = $(x);
- ret += '';
- ret += '' + x.attr('name') + ' ';
- ret += '' + cldoc.Doc.either(x) + ' ';
- ret += ' ';
- }
- ret += '
';
- ret += MixedIn.__super__.render_arguments.apply(this, arguments);
- return ret;
- };
-
- return MixedIn;
+\textend(MixedIn, superClass);
+
+\tfunction MixedIn() {
+\t return MixedIn.__super__.constructor.apply(this, arguments);
+\t}
+
+\tMixedIn.prototype.template_parameter_name = function(param) {
+\t var def, name, ret, tp;
+\t param = $(param);
+\t name = param.attr('name');
+\t def = param.attr('default');
+\t tp = param.children('type');
+\t ret = '';
+\t if (tp.length > 0) {
+\t\tret += (new cldoc.Type(tp)).as_text() + ' ';
+\t }
+\t ret += name;
+\t if (def) {
+\t\tret += ' = ' + def;
+\t }
+\t return ret;
+\t};
+
+\tMixedIn.prototype.templated_name = function() {
+\t var name, x;
+\t name = this.name;
+\t name += '<';
+\t name += ((function() {
+\t\tvar j, len, ref2, results1;
+\t\tref2 = this.node.children('templatetypeparameter, templatenontypeparameter');
+\t\tresults1 = [];
+\t\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t\t x = ref2[j];
+\t\t results1.push(this.template_parameter_name(x));
+\t\t}
+\t\treturn results1;
+\t }).call(this)).join(', ');
+\t name += '>';
+\t return name;
+\t};
+
+\tMixedIn.prototype.identifier_for_display = function() {
+\t return this.templated_name();
+\t};
+
+\tMixedIn.prototype.full_name_for_display = function() {
+\t return this.templated_name();
+\t};
+
+\tMixedIn.prototype.sidebar_name = function() {
+\t return this.identifier_for_display();
+\t};
+
+\tMixedIn.prototype.render_arguments = function() {
+\t var j, len, ret, tt, x;
+\t ret = '';
+\t tt = this.node.children('templatetypeparameter, templatenontypeparameter');
+\t for (j = 0, len = tt.length; j < len; j++) {
+\t\tx = tt[j];
+\t\tx = $(x);
+\t\tret += '';
+\t\tret += '' + x.attr('name') + ' ';
+\t\tret += '' + cldoc.Doc.either(x) + ' ';
+\t\tret += ' ';
+\t }
+\t ret += '
';
+\t ret += MixedIn.__super__.render_arguments.apply(this, arguments);
+\t return ret;
+\t};
+
+\treturn MixedIn;
})(base);
return MixedIn;
@@ -1519,95 +1519,95 @@ cldoc.Struct = (function(superClass) {
Struct.render_container_tag = 'table';
function Struct(node1) {
- this.node = node1;
- Struct.__super__.constructor.call(this, this.node);
- if (this.node.attr('typedef')) {
- this.keyword = 'typedef struct';
- } else {
- this.keyword = 'struct';
- }
+\tthis.node = node1;
+\tStruct.__super__.constructor.call(this, this.node);
+\tif (this.node.attr('typedef')) {
+\t this.keyword = 'typedef struct';
+\t} else {
+\t this.keyword = 'struct';
+\t}
}
Struct.prototype.render = function() {
- if (this.ref || this.node.children('field, method, function, methodtemplate, functiontemplate').length === 0) {
- return this.render_short();
- } else {
- return this.render_whole();
- }
+\tif (this.ref || this.node.children('field, method, function, methodtemplate, functiontemplate').length === 0) {
+\t return this.render_short();
+\t} else {
+\t return this.render_whole();
+\t}
};
Struct.prototype.identifier_for_display = function() {
- return this.name;
+\treturn this.name;
};
Struct.prototype.render_short = function() {
- var e, id, ret;
- e = cldoc.html_escape;
- ret = '';
- if (this.ref) {
- id = cldoc.Page.make_link(this.ref, this.identifier_for_display());
- } else {
- id = '' + e(this.identifier_for_display()) + '';
- }
- ret += '' + id + ' ';
- ret += '' + cldoc.Doc.brief(this.node) + ' ';
- return ret + ' ';
+\tvar e, id, ret;
+\te = cldoc.html_escape;
+\tret = '';
+\tif (this.ref) {
+\t id = cldoc.Page.make_link(this.ref, this.identifier_for_display());
+\t} else {
+\t id = '' + e(this.identifier_for_display()) + '';
+\t}
+\tret += '' + id + ' ';
+\tret += '' + cldoc.Doc.brief(this.node) + ' ';
+\treturn ret + ' ';
};
Struct.prototype.render_whole = function() {
- var e, id, identifier, isprot, k, ret;
- e = cldoc.html_escape;
- ret = '';
- identifier = this.identifier_for_display();
- id = '' + e(identifier) + '';
- k = '';
- isprot = this.node.attr('access') === 'protected';
- if (isprot) {
- k += 'protected ';
- }
- k += e(this.keyword) + '';
- if (this.node.attr('anonymous') !== 'yes') {
- k += ' ' + id;
- }
- ret += '' + k + '';
- ret += cldoc.Doc.either(this.node);
- ret += this.render_fields();
- ret += this.render_variables();
- return ret + ' ';
+\tvar e, id, identifier, isprot, k, ret;
+\te = cldoc.html_escape;
+\tret = '';
+\tidentifier = this.identifier_for_display();
+\tid = '' + e(identifier) + '';
+\tk = '';
+\tisprot = this.node.attr('access') === 'protected';
+\tif (isprot) {
+\t k += 'protected ';
+\t}
+\tk += e(this.keyword) + '';
+\tif (this.node.attr('anonymous') !== 'yes') {
+\t k += ' ' + id;
+\t}
+\tret += '' + k + '';
+\tret += cldoc.Doc.either(this.node);
+\tret += this.render_fields();
+\tret += this.render_variables();
+\treturn ret + ' ';
};
Struct.prototype.render_variables = function() {
- var container, itemsc, j, len, variable, variables;
- variables = this.node.children('variable');
- if (variables.length === 0) {
- return '';
- }
- container = cldoc.Variable.render_container();
- itemsc = '';
- for (j = 0, len = variables.length; j < len; j++) {
- variable = variables[j];
- itemsc += new cldoc.Variable($(variable)).render();
- }
- return container[0] + itemsc + container[1];
+\tvar container, itemsc, j, len, variable, variables;
+\tvariables = this.node.children('variable');
+\tif (variables.length === 0) {
+\t return '';
+\t}
+\tcontainer = cldoc.Variable.render_container();
+\titemsc = '';
+\tfor (j = 0, len = variables.length; j < len; j++) {
+\t variable = variables[j];
+\t itemsc += new cldoc.Variable($(variable)).render();
+\t}
+\treturn container[0] + itemsc + container[1];
};
Struct.prototype.render_fields = function() {
- var container, field, fields, itemsc, j, len, tp;
- fields = this.node.children('field,union');
- if (fields.length === 0) {
- return '';
- }
- container = cldoc.Field.render_container();
- itemsc = '';
- for (j = 0, len = fields.length; j < len; j++) {
- field = fields[j];
- field = $(field);
- tp = cldoc.Page.node_type(field);
- if (tp) {
- itemsc += new tp(field).render();
- }
- }
- return container[0] + itemsc + container[1];
+\tvar container, field, fields, itemsc, j, len, tp;
+\tfields = this.node.children('field,union');
+\tif (fields.length === 0) {
+\t return '';
+\t}
+\tcontainer = cldoc.Field.render_container();
+\titemsc = '';
+\tfor (j = 0, len = fields.length; j < len; j++) {
+\t field = fields[j];
+\t field = $(field);
+\t tp = cldoc.Page.node_type(field);
+\t if (tp) {
+\t\titemsc += new tp(field).render();
+\t }
+\t}
+\treturn container[0] + itemsc + container[1];
};
return Struct;
@@ -1620,7 +1620,7 @@ cldoc.StructTemplate = (function(superClass) {
extend(StructTemplate, superClass);
function StructTemplate() {
- return StructTemplate.__super__.constructor.apply(this, arguments);
+\treturn StructTemplate.__super__.constructor.apply(this, arguments);
}
return StructTemplate;
@@ -1635,9 +1635,9 @@ cldoc.Class = (function(superClass) {
Class.title = ['Class', 'Classes'];
function Class(node1) {
- this.node = node1;
- Class.__super__.constructor.call(this, this.node);
- this.keyword = 'class';
+\tthis.node = node1;
+\tClass.__super__.constructor.call(this, this.node);
+\tthis.keyword = 'class';
}
return Class;
@@ -1650,7 +1650,7 @@ cldoc.ClassTemplate = (function(superClass) {
extend(ClassTemplate, superClass);
function ClassTemplate() {
- return ClassTemplate.__super__.constructor.apply(this, arguments);
+\treturn ClassTemplate.__super__.constructor.apply(this, arguments);
}
return ClassTemplate;
@@ -1665,32 +1665,32 @@ cldoc.Namespace = (function(superClass) {
Namespace.title = ['Namespace', 'Namespaces'];
function Namespace(node1) {
- this.node = node1;
- Namespace.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tNamespace.__super__.constructor.call(this, this.node);
}
Namespace.prototype.render = function() {
- var a, classes, cls, j, len, ret;
- ret = '';
- ret += cldoc.Page.make_link(this.ref, this.name, {
- 'id': this.id
- });
- ret += new cldoc.Doc(this.brief).render();
- classes = this.node.children('class,struct');
- if (classes.length > 0) {
- ret += '';
- for (j = 0, len = classes.length; j < len; j++) {
- cls = classes[j];
- cls = $(cls);
- ret += '';
- a = cldoc.Page.make_link(cls.attr('ref'), cls.attr('name'));
- ret += '' + a + ' ';
- ret += '' + cldoc.Doc.either(cls) + ' ';
- ret += ' ';
- }
- ret += '
';
- }
- return ret;
+\tvar a, classes, cls, j, len, ret;
+\tret = '';
+\tret += cldoc.Page.make_link(this.ref, this.name, {
+\t 'id': this.id
+\t});
+\tret += new cldoc.Doc(this.brief).render();
+\tclasses = this.node.children('class,struct');
+\tif (classes.length > 0) {
+\t ret += '';
+\t for (j = 0, len = classes.length; j < len; j++) {
+\t\tcls = classes[j];
+\t\tcls = $(cls);
+\t\tret += '';
+\t\ta = cldoc.Page.make_link(cls.attr('ref'), cls.attr('name'));
+\t\tret += '' + a + ' ';
+\t\tret += '' + cldoc.Doc.either(cls) + ' ';
+\t\tret += ' ';
+\t }
+\t ret += '
';
+\t}
+\treturn ret;
};
return Namespace;
@@ -1707,21 +1707,21 @@ cldoc.Typedef = (function(superClass) {
Typedef.render_container_tag = 'table';
function Typedef(node1) {
- this.node = node1;
- Typedef.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tTypedef.__super__.constructor.call(this, this.node);
}
Typedef.prototype.render = function() {
- var e, ret;
- e = cldoc.html_escape;
- ret = '';
- ret += '' + e(this.node.attr('name')) + ' ';
- ret += 'type ';
- ret += '' + new cldoc.Type(this.node.children('type')).render() + ' ';
- ret += ' ';
- ret += '';
- ret += '' + cldoc.Doc.either(this.node) + ' ';
- return ret + ' ';
+\tvar e, ret;
+\te = cldoc.html_escape;
+\tret = '';
+\tret += '' + e(this.node.attr('name')) + ' ';
+\tret += 'type ';
+\tret += '' + new cldoc.Type(this.node.children('type')).render() + ' ';
+\tret += ' ';
+\tret += '';
+\tret += '' + cldoc.Doc.either(this.node) + ' ';
+\treturn ret + ' ';
};
return Typedef;
@@ -1738,18 +1738,18 @@ cldoc.Variable = (function(superClass) {
Variable.render_container_tag = 'table';
function Variable(node1) {
- this.node = node1;
- Variable.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tVariable.__super__.constructor.call(this, this.node);
}
Variable.prototype.render = function() {
- var e, ret;
- e = cldoc.html_escape;
- ret = '';
- ret += '' + e(this.node.attr('name')) + ' ';
- ret += '' + new cldoc.Type(this.node.children('type')).render() + ' ';
- ret += '' + cldoc.Doc.either(this.node) + ' ';
- return ret + ' ';
+\tvar e, ret;
+\te = cldoc.html_escape;
+\tret = '';
+\tret += '' + e(this.node.attr('name')) + ' ';
+\tret += '' + new cldoc.Type(this.node.children('type')).render() + ' ';
+\tret += '' + cldoc.Doc.either(this.node) + ' ';
+\treturn ret + ' ';
};
return Variable;
@@ -1764,125 +1764,125 @@ cldoc.Function = (function(superClass) {
Function.title = ['Function', 'Functions'];
function Function(node1) {
- this.node = node1;
- Function.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tFunction.__super__.constructor.call(this, this.node);
}
Function.prototype.identifier_for_display = function() {
- return this.name;
+\treturn this.name;
};
Function.prototype.render_arguments = function() {
- var arg, args, argtype, e, i, j, ref2, ret, retu, returntype;
- args = this.node.children('argument');
- ret = '';
- retu = this.node.children('return');
- returntype = null;
- if (retu.length > 0) {
- returntype = new cldoc.Type(retu.children('type'));
- }
- e = cldoc.html_escape;
- for (i = j = 0, ref2 = args.length - 1; j <= ref2; i = j += 1) {
- arg = $(args[i]);
- argtype = new cldoc.Type(arg.children('type'));
- ret += '';
- ret += '' + e(arg.attr('name')) + ' ';
- ret += '' + cldoc.Doc.either(arg);
- if (argtype.allow_none) {
- ret += '(may be NULL)';
- }
- ret += ' ';
- }
- if (returntype && returntype.node.attr('name') !== 'void') {
- ret += '';
- ret += 'return ';
- ret += '' + cldoc.Doc.either(retu);
- if (returntype.transfer_ownership === 'full') {
- ret += '(owned by caller)';
- } else if (returntype.transfer_ownership === 'container') {
- ret += '(container owned by caller)';
- }
- ret += ' ';
- }
- ret += '
';
- return ret;
+\tvar arg, args, argtype, e, i, j, ref2, ret, retu, returntype;
+\targs = this.node.children('argument');
+\tret = '';
+\tretu = this.node.children('return');
+\treturntype = null;
+\tif (retu.length > 0) {
+\t returntype = new cldoc.Type(retu.children('type'));
+\t}
+\te = cldoc.html_escape;
+\tfor (i = j = 0, ref2 = args.length - 1; j <= ref2; i = j += 1) {
+\t arg = $(args[i]);
+\t argtype = new cldoc.Type(arg.children('type'));
+\t ret += '';
+\t ret += '' + e(arg.attr('name')) + ' ';
+\t ret += '' + cldoc.Doc.either(arg);
+\t if (argtype.allow_none) {
+\t\tret += '(may be NULL)';
+\t }
+\t ret += ' ';
+\t}
+\tif (returntype && returntype.node.attr('name') !== 'void') {
+\t ret += '';
+\t ret += 'return ';
+\t ret += '' + cldoc.Doc.either(retu);
+\t if (returntype.transfer_ownership === 'full') {
+\t\tret += '(owned by caller)';
+\t } else if (returntype.transfer_ownership === 'container') {
+\t\tret += '(container owned by caller)';
+\t }
+\t ret += ' ';
+\t}
+\tret += '
';
+\treturn ret;
};
Function.prototype.render = function() {
- var arg, args, argtype, e, i, isover, isprot, isstat, isvirt, j, name, o, ov, override, ref2, ref3, ret, retu, returntype;
- e = cldoc.html_escape;
- ret = '';
- ret += '';
- isvirt = this.node.attr('virtual');
- isprot = this.node.attr('access') === 'protected';
- isstat = this.node.attr('static');
- if (isvirt || isprot || isstat) {
- ret += '';
- if (isstat) {
- ret += '- static
';
- }
- if (isprot) {
- ret += '- protected
';
- }
- if (isvirt) {
- isover = this.node.attr('override');
- if (isover) {
- ret += '- override
';
- } else {
- ret += '- virtual
';
- }
- if (this.node.attr('abstract')) {
- ret += '- abstract
';
- }
- }
- ret += '
';
- }
- retu = this.node.children('return');
- returntype = null;
- if (retu.length > 0) {
- returntype = new cldoc.Type(retu.children('type'));
- ret += '' + returntype.render() + '';
- }
- ret += '';
- ret += '' + e(this.identifier_for_display()) + ' ';
- ret += '( ';
- args = this.node.children('argument');
- for (i = j = 0, ref2 = args.length - 1; j <= ref2; i = j += 1) {
- if (i !== 0) {
- ret += ' ';
- }
- arg = $(args[i]);
- argtype = new cldoc.Type(arg.children('type'));
- ret += '' + argtype.render() + ' ';
- name = arg.attr('name');
- if (i !== args.length - 1) {
- name += ',';
- }
- ret += '' + e(name) + ' ';
- }
- if (args.length === 0) {
- ret += ' ';
- }
- ret += ')
';
- ret += cldoc.Doc.either(this.node);
- ret += this.render_arguments();
- override = this.node.children('override');
- if (override.length > 0) {
- ret += 'Overrides: ';
- for (i = o = 0, ref3 = override.length - 1; 0 <= ref3 ? o <= ref3 : o >= ref3; i = 0 <= ref3 ? ++o : --o) {
- ov = $(override[i]);
- if (i !== 0) {
- if (i === override.length - 1) {
- ret += ' and ';
- } else {
- ret += ', ';
- }
- }
- ret += cldoc.Page.make_link(ov.attr('ref'), ov.attr('name'));
- }
- ret += '';
- }
- return ret + '';
+\tvar arg, args, argtype, e, i, isover, isprot, isstat, isvirt, j, name, o, ov, override, ref2, ref3, ret, retu, returntype;
+\te = cldoc.html_escape;
+\tret = '';
+\tret += '';
+\tisvirt = this.node.attr('virtual');
+\tisprot = this.node.attr('access') === 'protected';
+\tisstat = this.node.attr('static');
+\tif (isvirt || isprot || isstat) {
+\t ret += '';
+\t if (isstat) {
+\t\tret += '- static
';
+\t }
+\t if (isprot) {
+\t\tret += '- protected
';
+\t }
+\t if (isvirt) {
+\t\tisover = this.node.attr('override');
+\t\tif (isover) {
+\t\t ret += '- override
';
+\t\t} else {
+\t\t ret += '- virtual
';
+\t\t}
+\t\tif (this.node.attr('abstract')) {
+\t\t ret += '- abstract
';
+\t\t}
+\t }
+\t ret += '
';
+\t}
+\tretu = this.node.children('return');
+\treturntype = null;
+\tif (retu.length > 0) {
+\t returntype = new cldoc.Type(retu.children('type'));
+\t ret += '' + returntype.render() + '';
+\t}
+\tret += '';
+\tret += '' + e(this.identifier_for_display()) + ' ';
+\tret += '( ';
+\targs = this.node.children('argument');
+\tfor (i = j = 0, ref2 = args.length - 1; j <= ref2; i = j += 1) {
+\t if (i !== 0) {
+\t\tret += ' ';
+\t }
+\t arg = $(args[i]);
+\t argtype = new cldoc.Type(arg.children('type'));
+\t ret += '' + argtype.render() + ' ';
+\t name = arg.attr('name');
+\t if (i !== args.length - 1) {
+\t\tname += ',';
+\t }
+\t ret += '' + e(name) + ' ';
+\t}
+\tif (args.length === 0) {
+\t ret += ' ';
+\t}
+\tret += ')
';
+\tret += cldoc.Doc.either(this.node);
+\tret += this.render_arguments();
+\toverride = this.node.children('override');
+\tif (override.length > 0) {
+\t ret += 'Overrides: ';
+\t for (i = o = 0, ref3 = override.length - 1; 0 <= ref3 ? o <= ref3 : o >= ref3; i = 0 <= ref3 ? ++o : --o) {
+\t\tov = $(override[i]);
+\t\tif (i !== 0) {
+\t\t if (i === override.length - 1) {
+\t\t\tret += ' and ';
+\t\t } else {
+\t\t\tret += ', ';
+\t\t }
+\t\t}
+\t\tret += cldoc.Page.make_link(ov.attr('ref'), ov.attr('name'));
+\t }
+\t ret += '';
+\t}
+\treturn ret + '';
};
return Function;
@@ -1895,7 +1895,7 @@ cldoc.FunctionTemplate = (function(superClass) {
extend(FunctionTemplate, superClass);
function FunctionTemplate() {
- return FunctionTemplate.__super__.constructor.apply(this, arguments);
+\treturn FunctionTemplate.__super__.constructor.apply(this, arguments);
}
return FunctionTemplate;
@@ -1912,18 +1912,18 @@ cldoc.Field = (function(superClass) {
Field.render_container_tag = 'table';
function Field(node1) {
- this.node = node1;
- Field.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tField.__super__.constructor.call(this, this.node);
}
Field.prototype.render = function() {
- var e, ret;
- e = cldoc.html_escape;
- ret = '';
- ret += '' + e(this.node.attr('name')) + ' ';
- ret += '' + new cldoc.Type(this.node.children('type')).render() + ' ';
- ret += '' + cldoc.Doc.either(this.node) + ' ';
- return ret + ' ';
+\tvar e, ret;
+\te = cldoc.html_escape;
+\tret = '';
+\tret += '' + e(this.node.attr('name')) + ' ';
+\tret += '' + new cldoc.Type(this.node.children('type')).render() + ' ';
+\tret += '' + cldoc.Doc.either(this.node) + ' ';
+\treturn ret + ' ';
};
return Field;
@@ -1938,8 +1938,8 @@ cldoc.Method = (function(superClass) {
Method.title = ['Member Function', 'Member Functions'];
function Method(node1) {
- this.node = node1;
- Method.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tMethod.__super__.constructor.call(this, this.node);
}
return Method;
@@ -1952,7 +1952,7 @@ cldoc.MethodTemplate = (function(superClass) {
extend(MethodTemplate, superClass);
function MethodTemplate() {
- return MethodTemplate.__super__.constructor.apply(this, arguments);
+\treturn MethodTemplate.__super__.constructor.apply(this, arguments);
}
return MethodTemplate;
@@ -1967,8 +1967,8 @@ cldoc.Constructor = (function(superClass) {
Constructor.title = ['Constructor', 'Constructors'];
function Constructor(node1) {
- this.node = node1;
- Constructor.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tConstructor.__super__.constructor.call(this, this.node);
}
return Constructor;
@@ -1983,8 +1983,8 @@ cldoc.Destructor = (function(superClass) {
Destructor.title = ['Destructor', 'Destructors'];
function Destructor(node1) {
- this.node = node1;
- Destructor.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tDestructor.__super__.constructor.call(this, this.node);
}
return Destructor;
@@ -2001,31 +2001,31 @@ cldoc.Base = (function(superClass) {
Base.render_container_tag = 'table';
function Base(node1) {
- var ref;
- this.node = node1;
- Base.__super__.constructor.call(this, this.node);
- this.type = this.node.children('type');
- this.access = this.node.attr('access');
- this.name = this.type.attr('name');
- ref = this.type.attr('ref');
- if (ref) {
- this.id = ref.replace('#', '+');
- }
+\tvar ref;
+\tthis.node = node1;
+\tBase.__super__.constructor.call(this, this.node);
+\tthis.type = this.node.children('type');
+\tthis.access = this.node.attr('access');
+\tthis.name = this.type.attr('name');
+\tref = this.type.attr('ref');
+\tif (ref) {
+\t this.id = ref.replace('#', '+');
+\t}
}
Base.prototype.render = function() {
- var access, e, ret, type;
- e = cldoc.html_escape;
- ret = '';
- access = this.access;
- if (access === 'public') {
- access = '';
- }
- type = new cldoc.Type(this.type);
- ret += '' + e(access) + ' ';
- ret += '' + type.render() + ' ';
- ret += '' + cldoc.Doc.brief(this.node) + ' ';
- return ret + ' ';
+\tvar access, e, ret, type;
+\te = cldoc.html_escape;
+\tret = '';
+\taccess = this.access;
+\tif (access === 'public') {
+\t access = '';
+\t}
+\ttype = new cldoc.Type(this.type);
+\tret += '' + e(access) + ' ';
+\tret += '' + type.render() + ' ';
+\tret += '' + cldoc.Doc.brief(this.node) + ' ';
+\treturn ret + ' ';
};
return Base;
@@ -2042,31 +2042,31 @@ cldoc.Implements = (function(superClass) {
Implements.render_container_tag = 'table';
function Implements(node1) {
- var ref;
- this.node = node1;
- Implements.__super__.constructor.call(this, this.node);
- this.type = this.node.children('type');
- this.access = this.node.attr('access');
- this.name = this.type.attr('name');
- ref = this.type.attr('ref');
- if (ref) {
- this.id = ref.replace('#', '+');
- }
+\tvar ref;
+\tthis.node = node1;
+\tImplements.__super__.constructor.call(this, this.node);
+\tthis.type = this.node.children('type');
+\tthis.access = this.node.attr('access');
+\tthis.name = this.type.attr('name');
+\tref = this.type.attr('ref');
+\tif (ref) {
+\t this.id = ref.replace('#', '+');
+\t}
}
Implements.prototype.render = function() {
- var access, e, ret, type;
- e = cldoc.html_escape;
- ret = '';
- access = this.access;
- if (access === 'public') {
- access = '';
- }
- type = new cldoc.Type(this.type);
- ret += '' + e(access) + ' ';
- ret += '' + type.render() + ' ';
- ret += '' + cldoc.Doc.brief(this.node) + ' ';
- return ret + ' ';
+\tvar access, e, ret, type;
+\te = cldoc.html_escape;
+\tret = '';
+\taccess = this.access;
+\tif (access === 'public') {
+\t access = '';
+\t}
+\ttype = new cldoc.Type(this.type);
+\tret += '' + e(access) + ' ';
+\tret += '' + type.render() + ' ';
+\tret += '' + cldoc.Doc.brief(this.node) + ' ';
+\treturn ret + ' ';
};
return Implements;
@@ -2083,24 +2083,24 @@ cldoc.Subclass = (function(superClass) {
Subclass.render_container_tag = 'table';
function Subclass(node1) {
- this.node = node1;
- Subclass.__super__.constructor.call(this, this.node);
- this.access = this.node.attr('access');
+\tthis.node = node1;
+\tSubclass.__super__.constructor.call(this, this.node);
+\tthis.access = this.node.attr('access');
}
Subclass.prototype.render = function() {
- var access, e, ret;
- e = cldoc.html_escape;
- ret = '';
- access = this.access;
- if (access === 'public') {
- access = '';
- }
- ret += '' + e(access) + ' ';
- ret += '' + cldoc.Page.make_link(this.ref, this.name) + ' ';
- ret += '' + cldoc.Doc.brief(this.node) + ' ';
- ret += ' ';
- return ret;
+\tvar access, e, ret;
+\te = cldoc.html_escape;
+\tret = '';
+\taccess = this.access;
+\tif (access === 'public') {
+\t access = '';
+\t}
+\tret += '' + e(access) + ' ';
+\tret += '' + cldoc.Page.make_link(this.ref, this.name) + ' ';
+\tret += '' + cldoc.Doc.brief(this.node) + ' ';
+\tret += ' ';
+\treturn ret;
};
return Subclass;
@@ -2117,23 +2117,23 @@ cldoc.ImplementedBy = (function(superClass) {
ImplementedBy.render_container_tag = 'table';
function ImplementedBy(node1) {
- this.node = node1;
- ImplementedBy.__super__.constructor.call(this, this.node);
- this.access = this.node.attr('access');
+\tthis.node = node1;
+\tImplementedBy.__super__.constructor.call(this, this.node);
+\tthis.access = this.node.attr('access');
}
ImplementedBy.prototype.render = function() {
- var access, e, ret;
- e = cldoc.html_escape;
- ret = '';
- access = this.access;
- if (access === 'public') {
- access = '';
- }
- ret += '' + e(access) + ' ';
- ret += '' + cldoc.Page.make_link(this.ref, this.name) + ' ';
- ret += '' + cldoc.Doc.brief(this.node) + ' ';
- return ret + ' ';
+\tvar access, e, ret;
+\te = cldoc.html_escape;
+\tret = '';
+\taccess = this.access;
+\tif (access === 'public') {
+\t access = '';
+\t}
+\tret += '' + e(access) + ' ';
+\tret += '' + cldoc.Page.make_link(this.ref, this.name) + ' ';
+\tret += '' + cldoc.Doc.brief(this.node) + ' ';
+\treturn ret + ' ';
};
return ImplementedBy;
@@ -2146,7 +2146,7 @@ cldoc.TemplateTypeParameter = (function(superClass) {
extend(TemplateTypeParameter, superClass);
function TemplateTypeParameter() {
- return TemplateTypeParameter.__super__.constructor.apply(this, arguments);
+\treturn TemplateTypeParameter.__super__.constructor.apply(this, arguments);
}
TemplateTypeParameter.title = ['Template Parameter', 'Template Parameters'];
@@ -2154,24 +2154,24 @@ cldoc.TemplateTypeParameter = (function(superClass) {
TemplateTypeParameter.render_container_tag = 'table';
TemplateTypeParameter.prototype.render = function() {
- var def, e, name, ret, tp;
- e = cldoc.html_escape;
- name = this.name;
- def = this.node.attr('default');
- tp = this.node.children('type');
- ret = '';
- name = '';
- if (tp.length > 0) {
- name += (new cldoc.Type(tp)).render() + ' ';
- }
- name += e(this.name);
- if (def) {
- name += ' = ' + def + '';
- }
- ret += '' + name + ' ';
- ret += '' + cldoc.Doc.brief(this.node) + ' ';
- ret += ' ';
- return ret;
+\tvar def, e, name, ret, tp;
+\te = cldoc.html_escape;
+\tname = this.name;
+\tdef = this.node.attr('default');
+\ttp = this.node.children('type');
+\tret = '';
+\tname = '';
+\tif (tp.length > 0) {
+\t name += (new cldoc.Type(tp)).render() + ' ';
+\t}
+\tname += e(this.name);
+\tif (def) {
+\t name += ' = ' + def + '';
+\t}
+\tret += '' + name + ' ';
+\tret += '' + cldoc.Doc.brief(this.node) + ' ';
+\tret += ' ';
+\treturn ret;
};
return TemplateTypeParameter;
@@ -2188,93 +2188,93 @@ cldoc.Coverage = (function(superClass) {
Coverage.title = ['Coverage', 'Coverage'];
function Coverage(node1) {
- this.node = node1;
- Coverage.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tCoverage.__super__.constructor.call(this, this.node);
}
Coverage.prototype.get_coverage = function(type) {
- var ret;
- ret = {
- documented: parseInt(type.attr('documented')),
- undocumented: parseInt(type.attr('undocumented'))
- };
- ret.total = ret.documented + ret.undocumented;
- ret.percentage = Math.round(100 * ret.documented / ret.total);
- return ret;
+\tvar ret;
+\tret = {
+\t documented: parseInt(type.attr('documented')),
+\t undocumented: parseInt(type.attr('undocumented'))
+\t};
+\tret.total = ret.documented + ret.undocumented;
+\tret.percentage = Math.round(100 * ret.documented / ret.total);
+\treturn ret;
};
Coverage.prototype.render_sidebar_type = function(type) {
- var a, cov, e, ret, tt, typename;
- typename = type.attr('name');
- cov = this.get_coverage(type);
- e = cldoc.html_escape;
- if (cov.documented === 0 && cov.undocumented === 0) {
- return;
- }
- tt = cov.documented + ' out of ' + cov.total + ' (' + cov.percentage + '%)';
- a = cldoc.Page.make_link(cldoc.Page.current_page + '#' + typename, typename);
- ret = '';
- if (cov.undocumented === 0) {
- ret += '✓';
- } else {
- ret += '✗';
- }
- ret += a + '' + e(tt) + '';
- return ret + ' ';
+\tvar a, cov, e, ret, tt, typename;
+\ttypename = type.attr('name');
+\tcov = this.get_coverage(type);
+\te = cldoc.html_escape;
+\tif (cov.documented === 0 && cov.undocumented === 0) {
+\t return;
+\t}
+\ttt = cov.documented + ' out of ' + cov.total + ' (' + cov.percentage + '%)';
+\ta = cldoc.Page.make_link(cldoc.Page.current_page + '#' + typename, typename);
+\tret = '';
+\tif (cov.undocumented === 0) {
+\t ret += '✓';
+\t} else {
+\t ret += '✗';
+\t}
+\tret += a + '' + e(tt) + '';
+\treturn ret + ' ';
};
Coverage.prototype.render_sidebar = function() {
- var j, len, ret, type, types;
- types = this.node.children('type');
- ret = '';
- for (j = 0, len = types.length; j < len; j++) {
- type = types[j];
- ret += this.render_sidebar_type($(type));
- }
- return ret;
+\tvar j, len, ret, type, types;
+\ttypes = this.node.children('type');
+\tret = '';
+\tfor (j = 0, len = types.length; j < len; j++) {
+\t type = types[j];
+\t ret += this.render_sidebar_type($(type));
+\t}
+\treturn ret;
};
Coverage.prototype.render_type = function(type) {
- var cov, e, file, j, len, len1, line, loc, o, ref2, ref3, ret, typename, undoc;
- ret = '';
- typename = type.attr('name');
- cov = this.get_coverage(type);
- if (cov.documented === 0 && cov.undocumented === 0) {
- return ret;
- }
- e = cldoc.html_escape;
- ret += '' + e(typename + ' (' + cov.percentage + '%)') + '
';
- ret += '';
- ret += 'Documented: ' + e(cov.documented) + ' ';
- ret += 'Undocumented: ' + e(cov.undocumented) + ' ';
- ret += '
';
- ref2 = type.children('undocumented');
- for (j = 0, len = ref2.length; j < len; j++) {
- undoc = ref2[j];
- undoc = $(undoc);
- ret += '' + e(undoc.attr('id')) + ' ';
- ref3 = undoc.children('location');
- for (o = 0, len1 = ref3.length; o < len1; o++) {
- loc = ref3[o];
- loc = $(loc);
- file = e(loc.attr('file'));
- line = e(loc.attr('line') + ':' + loc.attr('column'));
- ret += '' + file + ' ' + line + ' ';
- ret += ' ';
- }
- }
- return ret + '
';
+\tvar cov, e, file, j, len, len1, line, loc, o, ref2, ref3, ret, typename, undoc;
+\tret = '';
+\ttypename = type.attr('name');
+\tcov = this.get_coverage(type);
+\tif (cov.documented === 0 && cov.undocumented === 0) {
+\t return ret;
+\t}
+\te = cldoc.html_escape;
+\tret += '' + e(typename + ' (' + cov.percentage + '%)') + '
';
+\tret += '';
+\tret += 'Documented: ' + e(cov.documented) + ' ';
+\tret += 'Undocumented: ' + e(cov.undocumented) + ' ';
+\tret += '
';
+\tref2 = type.children('undocumented');
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t undoc = ref2[j];
+\t undoc = $(undoc);
+\t ret += '' + e(undoc.attr('id')) + ' ';
+\t ref3 = undoc.children('location');
+\t for (o = 0, len1 = ref3.length; o < len1; o++) {
+\t\tloc = ref3[o];
+\t\tloc = $(loc);
+\t\tfile = e(loc.attr('file'));
+\t\tline = e(loc.attr('line') + ':' + loc.attr('column'));
+\t\tret += '' + file + ' ' + line + ' ';
+\t\tret += ' ';
+\t }
+\t}
+\treturn ret + '
';
};
Coverage.prototype.render = function() {
- var j, len, ret, type, types;
- types = this.node.children('type');
- ret = '';
- for (j = 0, len = types.length; j < len; j++) {
- type = types[j];
- ret += this.render_type($(type));
- }
- return ret;
+\tvar j, len, ret, type, types;
+\ttypes = this.node.children('type');
+\tret = '';
+\tfor (j = 0, len = types.length; j < len; j++) {
+\t type = types[j];
+\t ret += this.render_type($(type));
+\t}
+\treturn ret;
};
return Coverage;
@@ -2289,82 +2289,82 @@ cldoc.Arguments = (function(superClass) {
Arguments.title = ['Arguments', 'Arguments'];
function Arguments(node1) {
- this.node = node1;
- Arguments.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tArguments.__super__.constructor.call(this, this.node);
}
Arguments.prototype.render_sidebar_function = function(func) {
- var a;
- a = cldoc.Page.make_link(cldoc.Page.current_page + '#' + func.attr('id'), func.attr('name'));
- return '' + a + ' ';
+\tvar a;
+\ta = cldoc.Page.make_link(cldoc.Page.current_page + '#' + func.attr('id'), func.attr('name'));
+\treturn '' + a + ' ';
};
Arguments.prototype.render_sidebar = function() {
- var f, funcs, j, len, ret;
- funcs = this.node.children('function');
- ret = '';
- for (j = 0, len = funcs.length; j < len; j++) {
- f = funcs[j];
- ret += this.render_sidebar_function($(f));
- }
- return ret;
+\tvar f, funcs, j, len, ret;
+\tfuncs = this.node.children('function');
+\tret = '';
+\tfor (j = 0, len = funcs.length; j < len; j++) {
+\t f = funcs[j];
+\t ret += this.render_sidebar_function($(f));
+\t}
+\treturn ret;
};
Arguments.prototype.render_function = function(func) {
- var e, file, j, len, line, loc, misspelled, names, ref2, ret, undocumented, x;
- e = cldoc.html_escape;
- ret = ' ' + e(func.attr('name')) + ' ';
- ref2 = func.children('location');
- for (j = 0, len = ref2.length; j < len; j++) {
- loc = ref2[j];
- loc = $(loc);
- file = e(loc.attr('file'));
- line = e(loc.attr('line') + ':' + loc.attr('column'));
- ret += '' + file + ' ' + line + ' ';
- ret += ' ';
- }
- ret += ' ';
- undocumented = func.children('undocumented');
- if (undocumented.length > 0) {
- names = ((function() {
- var len1, o, results1;
- results1 = [];
- for (o = 0, len1 = undocumented.length; o < len1; o++) {
- x = undocumented[o];
- results1.push($(x).attr('name'));
- }
- return results1;
- })()).join(', ');
- ret += 'Undocumented arguments: ' + '' + e(names) + ' ';
- }
- misspelled = func.children('misspelled');
- if (misspelled.length > 0) {
- names = ((function() {
- var len1, o, results1;
- results1 = [];
- for (o = 0, len1 = undocumented.length; o < len1; o++) {
- x = undocumented[o];
- results1.push($(x).attr('name'));
- }
- return results1;
- })()).join(', ');
- ret += 'Misspelled arguments: ' + '' + e(names) + ' ';
- }
- if (func.children('undocumented-return')) {
- ret += 'Undocumented return value ';
- }
- return ret;
+\tvar e, file, j, len, line, loc, misspelled, names, ref2, ret, undocumented, x;
+\te = cldoc.html_escape;
+\tret = ' ' + e(func.attr('name')) + ' ';
+\tref2 = func.children('location');
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t loc = ref2[j];
+\t loc = $(loc);
+\t file = e(loc.attr('file'));
+\t line = e(loc.attr('line') + ':' + loc.attr('column'));
+\t ret += '' + file + ' ' + line + ' ';
+\t ret += ' ';
+\t}
+\tret += ' ';
+\tundocumented = func.children('undocumented');
+\tif (undocumented.length > 0) {
+\t names = ((function() {
+\t\tvar len1, o, results1;
+\t\tresults1 = [];
+\t\tfor (o = 0, len1 = undocumented.length; o < len1; o++) {
+\t\t x = undocumented[o];
+\t\t results1.push($(x).attr('name'));
+\t\t}
+\t\treturn results1;
+\t })()).join(', ');
+\t ret += 'Undocumented arguments: ' + '' + e(names) + ' ';
+\t}
+\tmisspelled = func.children('misspelled');
+\tif (misspelled.length > 0) {
+\t names = ((function() {
+\t\tvar len1, o, results1;
+\t\tresults1 = [];
+\t\tfor (o = 0, len1 = undocumented.length; o < len1; o++) {
+\t\t x = undocumented[o];
+\t\t results1.push($(x).attr('name'));
+\t\t}
+\t\treturn results1;
+\t })()).join(', ');
+\t ret += 'Misspelled arguments: ' + '' + e(names) + ' ';
+\t}
+\tif (func.children('undocumented-return')) {
+\t ret += 'Undocumented return value ';
+\t}
+\treturn ret;
};
Arguments.prototype.render = function() {
- var c, f, funcs, j, len;
- funcs = this.node.children('function');
- c = '';
- for (j = 0, len = funcs.length; j < len; j++) {
- f = funcs[j];
- c += this.render_function($(f));
- }
- return c + '
';
+\tvar c, f, funcs, j, len;
+\tfuncs = this.node.children('function');
+\tc = '';
+\tfor (j = 0, len = funcs.length; j < len; j++) {
+\t f = funcs[j];
+\t c += this.render_function($(f));
+\t}
+\treturn c + '
';
};
return Arguments;
@@ -2379,12 +2379,12 @@ cldoc.Report = (function(superClass) {
Report.title = ['Report', 'Report'];
function Report(node1) {
- this.node = node1;
- Report.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tReport.__super__.constructor.call(this, this.node);
}
Report.prototype.render_sidebar = function() {
- return '' + cldoc.Page.make_link(this.ref, this.name) + ' ';
+\treturn '' + cldoc.Page.make_link(this.ref, this.name) + ' ';
};
Report.prototype.render = function(container) {};
@@ -2403,73 +2403,73 @@ cldoc.References = (function(superClass) {
References.render_container_tag = 'table';
function References(node1) {
- this.node = node1;
- References.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tReferences.__super__.constructor.call(this, this.node);
}
References.prototype.render_sidebar = function() {
- var a, child, e, j, len, ref2, ret;
- ret = '';
- e = cldoc.html_escape;
- ref2 = this.node.children();
- for (j = 0, len = ref2.length; j < len; j++) {
- child = ref2[j];
- child = $(child);
- a = cldoc.Page.make_link(cldoc.Page.current_page + '#ref-' + child.attr('id'), child.attr('name'));
- ret += '' + e(cldoc.tag(child)[0]) + ' ' + a + ' ';
- }
- return ret;
+\tvar a, child, e, j, len, ref2, ret;
+\tret = '';
+\te = cldoc.html_escape;
+\tref2 = this.node.children();
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t child = ref2[j];
+\t child = $(child);
+\t a = cldoc.Page.make_link(cldoc.Page.current_page + '#ref-' + child.attr('id'), child.attr('name'));
+\t ret += '' + e(cldoc.tag(child)[0]) + ' ' + a + ' ';
+\t}
+\treturn ret;
};
References.prototype.render = function() {
- var child, component, e, file, id, j, kw, len, len1, len2, line, loc, name, o, p, ref2, ref3, ref4, refs, ret, tp, x;
- ret = '';
- e = cldoc.html_escape;
- ref2 = this.node.children();
- for (j = 0, len = ref2.length; j < len; j++) {
- child = ref2[j];
- child = $(child);
- kw = '' + e(cldoc.tag(child)[0]) + ' ' + '';
- id = '' + e(child.attr('id')) + '';
- ret += '' + kw + id + ' ';
- ref3 = child.children('location');
- for (o = 0, len1 = ref3.length; o < len1; o++) {
- loc = ref3[o];
- loc = $(loc);
- file = e(loc.attr('file'));
- line = e(loc.attr('line') + ':' + loc.attr('column'));
- ret += '' + file + ' ';
- ret += '' + line + ' ';
- ret += ' ';
- }
- ret += ' ';
- ref4 = child.children('doctype');
- for (p = 0, len2 = ref4.length; p < len2; p++) {
- tp = ref4[p];
- tp = $(tp);
- name = tp.attr('name');
- component = tp.attr('component');
- if (component) {
- name += '.' + component;
- }
- refs = ((function() {
- var len3, ref5, results1, u;
- ref5 = tp.children('ref');
- results1 = [];
- for (u = 0, len3 = ref5.length; u < len3; u++) {
- x = ref5[u];
- results1.push($(x).attr('name'));
- }
- return results1;
- })()).join(', ');
- ret += '';
- ret += '' + e(name) + ' ';
- ret += '' + e(refs) + ' ';
- ret += ' ';
- ret += ' ';
- }
- }
- return ret;
+\tvar child, component, e, file, id, j, kw, len, len1, len2, line, loc, name, o, p, ref2, ref3, ref4, refs, ret, tp, x;
+\tret = '';
+\te = cldoc.html_escape;
+\tref2 = this.node.children();
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t child = ref2[j];
+\t child = $(child);
+\t kw = '' + e(cldoc.tag(child)[0]) + ' ' + '';
+\t id = '' + e(child.attr('id')) + '';
+\t ret += '' + kw + id + ' ';
+\t ref3 = child.children('location');
+\t for (o = 0, len1 = ref3.length; o < len1; o++) {
+\t\tloc = ref3[o];
+\t\tloc = $(loc);
+\t\tfile = e(loc.attr('file'));
+\t\tline = e(loc.attr('line') + ':' + loc.attr('column'));
+\t\tret += '' + file + ' ';
+\t\tret += '' + line + ' ';
+\t\tret += ' ';
+\t }
+\t ret += ' ';
+\t ref4 = child.children('doctype');
+\t for (p = 0, len2 = ref4.length; p < len2; p++) {
+\t\ttp = ref4[p];
+\t\ttp = $(tp);
+\t\tname = tp.attr('name');
+\t\tcomponent = tp.attr('component');
+\t\tif (component) {
+\t\t name += '.' + component;
+\t\t}
+\t\trefs = ((function() {
+\t\t var len3, ref5, results1, u;
+\t\t ref5 = tp.children('ref');
+\t\t results1 = [];
+\t\t for (u = 0, len3 = ref5.length; u < len3; u++) {
+\t\t\tx = ref5[u];
+\t\t\tresults1.push($(x).attr('name'));
+\t\t }
+\t\t return results1;
+\t\t})()).join(', ');
+\t\tret += '';
+\t\tret += '' + e(name) + ' ';
+\t\tret += '' + e(refs) + ' ';
+\t\tret += ' ';
+\t\tret += ' ';
+\t }
+\t}
+\treturn ret;
};
return References;
@@ -2486,27 +2486,27 @@ cldoc.Union = (function(superClass) {
Union.render_container_tag = 'table';
function Union(node1) {
- this.node = node1;
- Union.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tUnion.__super__.constructor.call(this, this.node);
}
Union.prototype.render = function() {
- var child, j, len, ref2, ret, tp;
- ret = '';
- ret += 'union ';
- ret += ' ';
- ret += '' + cldoc.Doc.either(this.node) + ' ';
- ret += ' ';
- ref2 = this.node.children();
- for (j = 0, len = ref2.length; j < len; j++) {
- child = ref2[j];
- child = $(child);
- tp = cldoc.Page.node_type(child);
- if (tp) {
- ret += new tp(child).render();
- }
- }
- return ret + '
';
+\tvar child, j, len, ref2, ret, tp;
+\tret = '';
+\tret += 'union ';
+\tret += ' ';
+\tret += '' + cldoc.Doc.either(this.node) + ' ';
+\tret += ' ';
+\tref2 = this.node.children();
+\tfor (j = 0, len = ref2.length; j < len; j++) {
+\t child = ref2[j];
+\t child = $(child);
+\t tp = cldoc.Page.node_type(child);
+\t if (tp) {
+\t\tret += new tp(child).render();
+\t }
+\t}
+\treturn ret + '
';
};
return Union;
@@ -2521,9 +2521,9 @@ cldoc.GObjectClass = (function(superClass) {
GObjectClass.title = ['GObject Class', 'GObject Classes'];
function GObjectClass(node1) {
- this.node = node1;
- GObjectClass.__super__.constructor.call(this, this.node);
- this.keyword = 'struct';
+\tthis.node = node1;
+\tGObjectClass.__super__.constructor.call(this, this.node);
+\tthis.keyword = 'struct';
}
return GObjectClass;
@@ -2538,9 +2538,9 @@ cldoc.GObjectInterface = (function(superClass) {
GObjectInterface.title = ['GObject Interface', 'GObject Interfaces'];
function GObjectInterface(node1) {
- this.node = node1;
- GObjectInterface.__super__.constructor.call(this, this.node);
- this.keyword = 'interface';
+\tthis.node = node1;
+\tGObjectInterface.__super__.constructor.call(this, this.node);
+\tthis.keyword = 'interface';
}
return GObjectInterface;
@@ -2555,9 +2555,9 @@ cldoc.GObjectBoxed = (function(superClass) {
GObjectBoxed.title = ['GObject Boxed Structure', 'GObject Boxed Structures'];
function GObjectBoxed(node1) {
- this.node = node1;
- GObjectBoxed.__super__.constructor.call(this, this.node);
- this.keyword = 'struct';
+\tthis.node = node1;
+\tGObjectBoxed.__super__.constructor.call(this, this.node);
+\tthis.keyword = 'struct';
}
return GObjectBoxed;
@@ -2574,29 +2574,29 @@ cldoc.GObjectProperty = (function(superClass) {
GObjectProperty.render_container_tag = 'table';
function GObjectProperty(node1) {
- this.node = node1;
- GObjectProperty.__super__.constructor.call(this, this.node);
+\tthis.node = node1;
+\tGObjectProperty.__super__.constructor.call(this, this.node);
}
GObjectProperty.prototype.render = function() {
- var e, j, len, mode, ref2, ret, x;
- e = cldoc.html_escape;
- ret = '';
- ret += '' + e(this.node.attr('name')) + ' ';
- mode = this.node.attr('mode');
- ret += '';
- if (mode) {
- ret += '';
- ref2 = mode.split(',');
- for (j = 0, len = ref2.length; j < len; j++) {
- x = ref2[j];
- ret += '- ' + e(x) + '
';
- }
- ret += '
';
- }
- ret += ' ' + new cldoc.Type(this.node.children('type')).render() + ' ';
- ret += '' + cldoc.Doc.either(this.node) + ' ';
- return ret + ' ';
+\tvar e, j, len, mode, ref2, ret, x;
+\te = cldoc.html_escape;
+\tret = '';
+\tret += '' + e(this.node.attr('name')) + ' ';
+\tmode = this.node.attr('mode');
+\tret += '';
+\tif (mode) {
+\t ret += '';
+\t ref2 = mode.split(',');
+\t for (j = 0, len = ref2.length; j < len; j++) {
+\t\tx = ref2[j];
+\t\tret += '- ' + e(x) + '
';
+\t }
+\t ret += '
';
+\t}
+\tret += ' ' + new cldoc.Type(this.node.children('type')).render() + ' ';
+\tret += '' + cldoc.Doc.either(this.node) + ' ';
+\treturn ret + ' ';
};
return GObjectProperty;
diff --git a/cldoc/data/javascript/jquery-1.9.1.js b/cldoc/data/javascript/jquery-1.9.1.js
index e2c203f..d25ada7 100644
--- a/cldoc/data/javascript/jquery-1.9.1.js
+++ b/cldoc/data/javascript/jquery-1.9.1.js
@@ -19,950 +19,950 @@
// Support: Firefox 18+
//"use strict";
var
- // The deferred used on DOM ready
- readyList,
-
- // A central reference to the root jQuery(document)
- rootjQuery,
-
- // Support: IE<9
- // For `typeof node.method` instead of `node.method !== undefined`
- core_strundefined = typeof undefined,
-
- // Use the correct document accordingly with window argument (sandbox)
- document = window.document,
- location = window.location,
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- // [[Class]] -> type pairs
- class2type = {},
-
- // List of deleted data cache ids, so we can reuse them
- core_deletedIds = [],
-
- core_version = "1.9.1",
-
- // Save a reference to some core methods
- core_concat = core_deletedIds.concat,
- core_push = core_deletedIds.push,
- core_slice = core_deletedIds.slice,
- core_indexOf = core_deletedIds.indexOf,
- core_toString = class2type.toString,
- core_hasOwn = class2type.hasOwnProperty,
- core_trim = core_version.trim,
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context, rootjQuery );
- },
-
- // Used for matching numbers
- core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
-
- // Used for splitting on whitespace
- core_rnotwhite = /\S+/g,
-
- // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // A simple way to check for HTML strings
- // Prioritize #id over to avoid XSS via location.hash (#9521)
- // Strict HTML recognition (#11290: must start with <)
- rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
-
- // Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
-
- // JSON RegExp
- rvalidchars = /^[\],:{}\s]*$/,
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
- rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
- rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
-
- // Matches dashed string for camelizing
- rmsPrefix = /^-ms-/,
- rdashAlpha = /-([\da-z])/gi,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- },
-
- // The ready event handler
- completed = function( event ) {
-
- // readyState === "complete" is good enough for us to call the dom ready in oldIE
- if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
- detach();
- jQuery.ready();
- }
- },
- // Clean-up method for dom ready events
- detach = function() {
- if ( document.addEventListener ) {
- document.removeEventListener( "DOMContentLoaded", completed, false );
- window.removeEventListener( "load", completed, false );
-
- } else {
- document.detachEvent( "onreadystatechange", completed );
- window.detachEvent( "onload", completed );
- }
- };
+\t// The deferred used on DOM ready
+\treadyList,
+
+\t// A central reference to the root jQuery(document)
+\trootjQuery,
+
+\t// Support: IE<9
+\t// For `typeof node.method` instead of `node.method !== undefined`
+\tcore_strundefined = typeof undefined,
+
+\t// Use the correct document accordingly with window argument (sandbox)
+\tdocument = window.document,
+\tlocation = window.location,
+
+\t// Map over jQuery in case of overwrite
+\t_jQuery = window.jQuery,
+
+\t// Map over the $ in case of overwrite
+\t_$ = window.$,
+
+\t// [[Class]] -> type pairs
+\tclass2type = {},
+
+\t// List of deleted data cache ids, so we can reuse them
+\tcore_deletedIds = [],
+
+\tcore_version = "1.9.1",
+
+\t// Save a reference to some core methods
+\tcore_concat = core_deletedIds.concat,
+\tcore_push = core_deletedIds.push,
+\tcore_slice = core_deletedIds.slice,
+\tcore_indexOf = core_deletedIds.indexOf,
+\tcore_toString = class2type.toString,
+\tcore_hasOwn = class2type.hasOwnProperty,
+\tcore_trim = core_version.trim,
+
+\t// Define a local copy of jQuery
+\tjQuery = function( selector, context ) {
+\t\t// The jQuery object is actually just the init constructor 'enhanced'
+\t\treturn new jQuery.fn.init( selector, context, rootjQuery );
+\t},
+
+\t// Used for matching numbers
+\tcore_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
+
+\t// Used for splitting on whitespace
+\tcore_rnotwhite = /\S+/g,
+
+\t// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+\trtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+\t// A simple way to check for HTML strings
+\t// Prioritize #id over to avoid XSS via location.hash (#9521)
+\t// Strict HTML recognition (#11290: must start with <)
+\trquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+\t// Match a standalone tag
+\trsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
+
+\t// JSON RegExp
+\trvalidchars = /^[\],:{}\s]*$/,
+\trvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+\trvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
+\trvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
+
+\t// Matches dashed string for camelizing
+\trmsPrefix = /^-ms-/,
+\trdashAlpha = /-([\da-z])/gi,
+
+\t// Used by jQuery.camelCase as callback to replace()
+\tfcamelCase = function( all, letter ) {
+\t\treturn letter.toUpperCase();
+\t},
+
+\t// The ready event handler
+\tcompleted = function( event ) {
+
+\t\t// readyState === "complete" is good enough for us to call the dom ready in oldIE
+\t\tif ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
+\t\t\tdetach();
+\t\t\tjQuery.ready();
+\t\t}
+\t},
+\t// Clean-up method for dom ready events
+\tdetach = function() {
+\t\tif ( document.addEventListener ) {
+\t\t\tdocument.removeEventListener( "DOMContentLoaded", completed, false );
+\t\t\twindow.removeEventListener( "load", completed, false );
+
+\t\t} else {
+\t\t\tdocument.detachEvent( "onreadystatechange", completed );
+\t\t\twindow.detachEvent( "onload", completed );
+\t\t}
+\t};
jQuery.fn = jQuery.prototype = {
- // The current version of jQuery being used
- jquery: core_version,
-
- constructor: jQuery,
- init: function( selector, context, rootjQuery ) {
- var match, elem;
-
- // HANDLE: $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = rquickExpr.exec( selector );
- }
-
- // Match html or make sure no context is specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- context = context instanceof jQuery ? context[0] : context;
-
- // scripts is true for back-compat
- jQuery.merge( this, jQuery.parseHTML(
- match[1],
- context && context.nodeType ? context.ownerDocument || context : document,
- true
- ) );
-
- // HANDLE: $(html, props)
- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
- for ( match in context ) {
- // Properties of context are called as methods if possible
- if ( jQuery.isFunction( this[ match ] ) ) {
- this[ match ]( context[ match ] );
-
- // ...and otherwise set as attributes
- } else {
- this.attr( match, context[ match ] );
- }
- }
- }
-
- return this;
-
- // HANDLE: $(#id)
- } else {
- elem = document.getElementById( match[2] );
-
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if ( elem && elem.parentNode ) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id !== match[2] ) {
- return rootjQuery.find( selector );
- }
-
- // Otherwise, we inject the element directly into the jQuery object
- this.length = 1;
- this[0] = elem;
- }
-
- this.context = document;
- this.selector = selector;
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || rootjQuery ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(DOMElement)
- } else if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return rootjQuery.ready( selector );
- }
-
- if ( selector.selector !== undefined ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- },
-
- // Start with an empty selector
- selector: "",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- toArray: function() {
- return core_slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num == null ?
-
- // Return a 'clean' array
- this.toArray() :
-
- // Return just the object
- ( num < 0 ? this[ this.length + num ] : this[ num ] );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
- ret.context = this.context;
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- ready: function( fn ) {
- // Add the callback
- jQuery.ready.promise().done( fn );
-
- return this;
- },
-
- slice: function() {
- return this.pushStack( core_slice.apply( this, arguments ) );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- eq: function( i ) {
- var len = this.length,
- j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- end: function() {
- return this.prevObject || this.constructor(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: core_push,
- sort: [].sort,
- splice: [].splice
+\t// The current version of jQuery being used
+\tjquery: core_version,
+
+\tconstructor: jQuery,
+\tinit: function( selector, context, rootjQuery ) {
+\t\tvar match, elem;
+
+\t\t// HANDLE: $(""), $(null), $(undefined), $(false)
+\t\tif ( !selector ) {
+\t\t\treturn this;
+\t\t}
+
+\t\t// Handle HTML strings
+\t\tif ( typeof selector === "string" ) {
+\t\t\tif ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check
+\t\t\t\tmatch = [ null, selector, null ];
+
+\t\t\t} else {
+\t\t\t\tmatch = rquickExpr.exec( selector );
+\t\t\t}
+
+\t\t\t// Match html or make sure no context is specified for #id
+\t\t\tif ( match && (match[1] || !context) ) {
+
+\t\t\t\t// HANDLE: $(html) -> $(array)
+\t\t\t\tif ( match[1] ) {
+\t\t\t\t\tcontext = context instanceof jQuery ? context[0] : context;
+
+\t\t\t\t\t// scripts is true for back-compat
+\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(
+\t\t\t\t\t\tmatch[1],
+\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,
+\t\t\t\t\t\ttrue
+\t\t\t\t\t) );
+
+\t\t\t\t\t// HANDLE: $(html, props)
+\t\t\t\t\tif ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+\t\t\t\t\t\tfor ( match in context ) {
+\t\t\t\t\t\t\t// Properties of context are called as methods if possible
+\t\t\t\t\t\t\tif ( jQuery.isFunction( this[ match ] ) ) {
+\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );
+
+\t\t\t\t\t\t\t// ...and otherwise set as attributes
+\t\t\t\t\t\t\t} else {
+\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );
+\t\t\t\t\t\t\t}
+\t\t\t\t\t\t}
+\t\t\t\t\t}
+
+\t\t\t\t\treturn this;
+
+\t\t\t\t// HANDLE: $(#id)
+\t\t\t\t} else {
+\t\t\t\t\telem = document.getElementById( match[2] );
+
+\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns
+\t\t\t\t\t// nodes that are no longer in the document #6963
+\t\t\t\t\tif ( elem && elem.parentNode ) {
+\t\t\t\t\t\t// Handle the case where IE and Opera return items
+\t\t\t\t\t\t// by name instead of ID
+\t\t\t\t\t\tif ( elem.id !== match[2] ) {
+\t\t\t\t\t\t\treturn rootjQuery.find( selector );
+\t\t\t\t\t\t}
+
+\t\t\t\t\t\t// Otherwise, we inject the element directly into the jQuery object
+\t\t\t\t\t\tthis.length = 1;
+\t\t\t\t\t\tthis[0] = elem;
+\t\t\t\t\t}
+
+\t\t\t\t\tthis.context = document;
+\t\t\t\t\tthis.selector = selector;
+\t\t\t\t\treturn this;
+\t\t\t\t}
+
+\t\t\t// HANDLE: $(expr, $(...))
+\t\t\t} else if ( !context || context.jquery ) {
+\t\t\t\treturn ( context || rootjQuery ).find( selector );
+
+\t\t\t// HANDLE: $(expr, context)
+\t\t\t// (which is just equivalent to: $(context).find(expr)
+\t\t\t} else {
+\t\t\t\treturn this.constructor( context ).find( selector );
+\t\t\t}
+
+\t\t// HANDLE: $(DOMElement)
+\t\t} else if ( selector.nodeType ) {
+\t\t\tthis.context = this[0] = selector;
+\t\t\tthis.length = 1;
+\t\t\treturn this;
+
+\t\t// HANDLE: $(function)
+\t\t// Shortcut for document ready
+\t\t} else if ( jQuery.isFunction( selector ) ) {
+\t\t\treturn rootjQuery.ready( selector );
+\t\t}
+
+\t\tif ( selector.selector !== undefined ) {
+\t\t\tthis.selector = selector.selector;
+\t\t\tthis.context = selector.context;
+\t\t}
+
+\t\treturn jQuery.makeArray( selector, this );
+\t},
+
+\t// Start with an empty selector
+\tselector: "",
+
+\t// The default length of a jQuery object is 0
+\tlength: 0,
+
+\t// The number of elements contained in the matched element set
+\tsize: function() {
+\t\treturn this.length;
+\t},
+
+\ttoArray: function() {
+\t\treturn core_slice.call( this );
+\t},
+
+\t// Get the Nth element in the matched element set OR
+\t// Get the whole matched element set as a clean array
+\tget: function( num ) {
+\t\treturn num == null ?
+
+\t\t\t// Return a 'clean' array
+\t\t\tthis.toArray() :
+
+\t\t\t// Return just the object
+\t\t\t( num < 0 ? this[ this.length + num ] : this[ num ] );
+\t},
+
+\t// Take an array of elements and push it onto the stack
+\t// (returning the new matched element set)
+\tpushStack: function( elems ) {
+
+\t\t// Build a new jQuery matched element set
+\t\tvar ret = jQuery.merge( this.constructor(), elems );
+
+\t\t// Add the old object onto the stack (as a reference)
+\t\tret.prevObject = this;
+\t\tret.context = this.context;
+
+\t\t// Return the newly-formed element set
+\t\treturn ret;
+\t},
+
+\t// Execute a callback for every element in the matched set.
+\t// (You can seed the arguments with an array of args, but this is
+\t// only used internally.)
+\teach: function( callback, args ) {
+\t\treturn jQuery.each( this, callback, args );
+\t},
+
+\tready: function( fn ) {
+\t\t// Add the callback
+\t\tjQuery.ready.promise().done( fn );
+
+\t\treturn this;
+\t},
+
+\tslice: function() {
+\t\treturn this.pushStack( core_slice.apply( this, arguments ) );
+\t},
+
+\tfirst: function() {
+\t\treturn this.eq( 0 );
+\t},
+
+\tlast: function() {
+\t\treturn this.eq( -1 );
+\t},
+
+\teq: function( i ) {
+\t\tvar len = this.length,
+\t\t\tj = +i + ( i < 0 ? len : 0 );
+\t\treturn this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+\t},
+
+\tmap: function( callback ) {
+\t\treturn this.pushStack( jQuery.map(this, function( elem, i ) {
+\t\t\treturn callback.call( elem, i, elem );
+\t\t}));
+\t},
+
+\tend: function() {
+\t\treturn this.prevObject || this.constructor(null);
+\t},
+
+\t// For internal use only.
+\t// Behaves like an Array's method, not like a jQuery method.
+\tpush: core_push,
+\tsort: [].sort,
+\tsplice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
- var src, copyIsArray, copy, name, options, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
- target = {};
- }
-
- // extend jQuery itself if only one argument is passed
- if ( length === i ) {
- target = this;
- --i;
- }
-
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray(src) ? src : [];
-
- } else {
- clone = src && jQuery.isPlainObject(src) ? src : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
+\tvar src, copyIsArray, copy, name, options, clone,
+\t\ttarget = arguments[0] || {},
+\t\ti = 1,
+\t\tlength = arguments.length,
+\t\tdeep = false;
+
+\t// Handle a deep copy situation
+\tif ( typeof target === "boolean" ) {
+\t\tdeep = target;
+\t\ttarget = arguments[1] || {};
+\t\t// skip the boolean and the target
+\t\ti = 2;
+\t}
+
+\t// Handle case when target is a string or something (possible in deep copy)
+\tif ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+\t\ttarget = {};
+\t}
+
+\t// extend jQuery itself if only one argument is passed
+\tif ( length === i ) {
+\t\ttarget = this;
+\t\t--i;
+\t}
+
+\tfor ( ; i < length; i++ ) {
+\t\t// Only deal with non-null/undefined values
+\t\tif ( (options = arguments[ i ]) != null ) {
+\t\t\t// Extend the base object
+\t\t\tfor ( name in options ) {
+\t\t\t\tsrc = target[ name ];
+\t\t\t\tcopy = options[ name ];
+
+\t\t\t\t// Prevent never-ending loop
+\t\t\t\tif ( target === copy ) {
+\t\t\t\t\tcontinue;
+\t\t\t\t}
+
+\t\t\t\t// Recurse if we're merging plain objects or arrays
+\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+\t\t\t\t\tif ( copyIsArray ) {
+\t\t\t\t\t\tcopyIsArray = false;
+\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];
+
+\t\t\t\t\t} else {
+\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};
+\t\t\t\t\t}
+
+\t\t\t\t\t// Never move original objects, clone them
+\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );
+
+\t\t\t\t// Don't bring in undefined values
+\t\t\t\t} else if ( copy !== undefined ) {
+\t\t\t\t\ttarget[ name ] = copy;
+\t\t\t\t}
+\t\t\t}
+\t\t}
+\t}
+
+\t// Return the modified object
+\treturn target;
};
jQuery.extend({
- noConflict: function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- },
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Hold (or release) the ready event
- holdReady: function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- },
-
- // Handle when the DOM is ready
- ready: function( wait ) {
-
- // Abort if there are pending holds or we're already ready
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
- return;
- }
-
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready );
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.resolveWith( document, [ jQuery ] );
-
- // Trigger any bound ready events
- if ( jQuery.fn.trigger ) {
- jQuery( document ).trigger("ready").off("ready");
- }
- },
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- return jQuery.type(obj) === "function";
- },
-
- isArray: Array.isArray || function( obj ) {
- return jQuery.type(obj) === "array";
- },
-
- isWindow: function( obj ) {
- return obj != null && obj == obj.window;
- },
-
- isNumeric: function( obj ) {
- return !isNaN( parseFloat(obj) ) && isFinite( obj );
- },
-
- type: function( obj ) {
- if ( obj == null ) {
- return String( obj );
- }
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ core_toString.call(obj) ] || "object" :
- typeof obj;
- },
-
- isPlainObject: function( obj ) {
- // Must be an Object.
- // Because of IE, we also have to check the presence of the constructor property.
- // Make sure that DOM nodes and window objects don't pass through, as well
- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- try {
- // Not own constructor property must be Object
- if ( obj.constructor &&
- !core_hasOwn.call(obj, "constructor") &&
- !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
- return false;
- }
- } catch ( e ) {
- // IE8,9 Will throw exceptions on certain host objects #9897
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
-
- var key;
- for ( key in obj ) {}
-
- return key === undefined || core_hasOwn.call( obj, key );
- },
-
- isEmptyObject: function( obj ) {
- var name;
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- // data: string of html
- // context (optional): If specified, the fragment will be created in this context, defaults to document
- // keepScripts (optional): If true, will include scripts passed in the html string
- parseHTML: function( data, context, keepScripts ) {
- if ( !data || typeof data !== "string" ) {
- return null;
- }
- if ( typeof context === "boolean" ) {
- keepScripts = context;
- context = false;
- }
- context = context || document;
-
- var parsed = rsingleTag.exec( data ),
- scripts = !keepScripts && [];
-
- // Single tag
- if ( parsed ) {
- return [ context.createElement( parsed[1] ) ];
- }
-
- parsed = jQuery.buildFragment( [ data ], context, scripts );
- if ( scripts ) {
- jQuery( scripts ).remove();
- }
- return jQuery.merge( [], parsed.childNodes );
- },
-
- parseJSON: function( data ) {
- // Attempt to parse using the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- return window.JSON.parse( data );
- }
-
- if ( data === null ) {
- return data;
- }
-
- if ( typeof data === "string" ) {
-
- // Make sure leading/trailing whitespace is removed (IE can't handle it)
- data = jQuery.trim( data );
-
- if ( data ) {
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if ( rvalidchars.test( data.replace( rvalidescape, "@" )
- .replace( rvalidtokens, "]" )
- .replace( rvalidbraces, "")) ) {
-
- return ( new Function( "return " + data ) )();
- }
- }
- }
-
- jQuery.error( "Invalid JSON: " + data );
- },
-
- // Cross-browser xml parsing
- parseXML: function( data ) {
- var xml, tmp;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
- try {
- if ( window.DOMParser ) { // Standard
- tmp = new DOMParser();
- xml = tmp.parseFromString( data , "text/xml" );
- } else { // IE
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
- xml.async = "false";
- xml.loadXML( data );
- }
- } catch( e ) {
- xml = undefined;
- }
- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
- },
-
- noop: function() {},
-
- // Evaluates a script in a global context
- // Workarounds based on findings by Jim Driscoll
- // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
- globalEval: function( data ) {
- if ( data && jQuery.trim( data ) ) {
- // We use execScript on Internet Explorer
- // We use an anonymous function so that context is window
- // rather than jQuery in Firefox
- ( window.execScript || function( data ) {
- window[ "eval" ].call( window, data );
- } )( data );
- }
- },
-
- // Convert dashed to camelCase; used by the css and data modules
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
- // args is for internal usage only
- each: function( obj, callback, args ) {
- var value,
- i = 0,
- length = obj.length,
- isArray = isArraylike( obj );
-
- if ( args ) {
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback.apply( obj[ i ], args );
-
- if ( value === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- value = callback.apply( obj[ i ], args );
-
- if ( value === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback.call( obj[ i ], i, obj[ i ] );
-
- if ( value === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- value = callback.call( obj[ i ], i, obj[ i ] );
-
- if ( value === false ) {
- break;
- }
- }
- }
- }
-
- return obj;
- },
-
- // Use native String.trim function wherever possible
- trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
- function( text ) {
- return text == null ?
- "" :
- core_trim.call( text );
- } :
-
- // Otherwise use our own trimming functionality
- function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var ret = results || [];
-
- if ( arr != null ) {
- if ( isArraylike( Object(arr) ) ) {
- jQuery.merge( ret,
- typeof arr === "string" ?
- [ arr ] : arr
- );
- } else {
- core_push.call( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- var len;
-
- if ( arr ) {
- if ( core_indexOf ) {
- return core_indexOf.call( arr, elem, i );
- }
-
- len = arr.length;
- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
- for ( ; i < len; i++ ) {
- // Skip accessing in sparse arrays
- if ( i in arr && arr[ i ] === elem ) {
- return i;
- }
- }
- }
-
- return -1;
- },
-
- merge: function( first, second ) {
- var l = second.length,
- i = first.length,
- j = 0;
-
- if ( typeof l === "number" ) {
- for ( ; j < l; j++ ) {
- first[ i++ ] = second[ j ];
- }
- } else {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, inv ) {
- var retVal,
- ret = [],
- i = 0,
- length = elems.length;
- inv = !!inv;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- retVal = !!callback( elems[ i ], i );
- if ( inv !== retVal ) {
- ret.push( elems[ i ] );
- }
- }
-
- return ret;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var value,
- i = 0,
- length = elems.length,
- isArray = isArraylike( elems ),
- ret = [];
-
- // Go through the array, translating each of the items to their
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( i in elems ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
- }
-
- // Flatten any nested arrays
- return core_concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- var args, proxy, tmp;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = core_slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- },
-
- // Multifunctional method to get and set values of a collection
- // The value/s can optionally be executed if it's a function
- access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
- var i = 0,
- length = elems.length,
- bulk = key == null;
-
- // Sets many values
- if ( jQuery.type( key ) === "object" ) {
- chainable = true;
- for ( i in key ) {
- jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
- }
-
- // Sets one value
- } else if ( value !== undefined ) {
- chainable = true;
-
- if ( !jQuery.isFunction( value ) ) {
- raw = true;
- }
-
- if ( bulk ) {
- // Bulk operations run against the entire set
- if ( raw ) {
- fn.call( elems, value );
- fn = null;
-
- // ...except when executing function values
- } else {
- bulk = fn;
- fn = function( elem, key, value ) {
- return bulk.call( jQuery( elem ), value );
- };
- }
- }
-
- if ( fn ) {
- for ( ; i < length; i++ ) {
- fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
- }
- }
- }
-
- return chainable ?
- elems :
-
- // Gets
- bulk ?
- fn.call( elems ) :
- length ? fn( elems[0], key ) : emptyGet;
- },
-
- now: function() {
- return ( new Date() ).getTime();
- }
+\tnoConflict: function( deep ) {
+\t\tif ( window.$ === jQuery ) {
+\t\t\twindow.$ = _$;
+\t\t}
+
+\t\tif ( deep && window.jQuery === jQuery ) {
+\t\t\twindow.jQuery = _jQuery;
+\t\t}
+
+\t\treturn jQuery;
+\t},
+
+\t// Is the DOM ready to be used? Set to true once it occurs.
+\tisReady: false,
+
+\t// A counter to track how many items to wait for before
+\t// the ready event fires. See #6781
+\treadyWait: 1,
+
+\t// Hold (or release) the ready event
+\tholdReady: function( hold ) {
+\t\tif ( hold ) {
+\t\t\tjQuery.readyWait++;
+\t\t} else {
+\t\t\tjQuery.ready( true );
+\t\t}
+\t},
+
+\t// Handle when the DOM is ready
+\tready: function( wait ) {
+
+\t\t// Abort if there are pending holds or we're already ready
+\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+\t\t\treturn;
+\t\t}
+
+\t\t// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+\t\tif ( !document.body ) {
+\t\t\treturn setTimeout( jQuery.ready );
+\t\t}
+
+\t\t// Remember that the DOM is ready
+\t\tjQuery.isReady = true;
+
+\t\t// If a normal DOM Ready event fired, decrement, and wait if need be
+\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {
+\t\t\treturn;
+\t\t}
+
+\t\t// If there are functions bound, to execute
+\t\treadyList.resolveWith( document, [ jQuery ] );
+
+\t\t// Trigger any bound ready events
+\t\tif ( jQuery.fn.trigger ) {
+\t\t\tjQuery( document ).trigger("ready").off("ready");
+\t\t}
+\t},
+
+\t// See test/unit/core.js for details concerning isFunction.
+\t// Since version 1.3, DOM methods and functions like alert
+\t// aren't supported. They return false on IE (#2968).
+\tisFunction: function( obj ) {
+\t\treturn jQuery.type(obj) === "function";
+\t},
+
+\tisArray: Array.isArray || function( obj ) {
+\t\treturn jQuery.type(obj) === "array";
+\t},
+
+\tisWindow: function( obj ) {
+\t\treturn obj != null && obj == obj.window;
+\t},
+
+\tisNumeric: function( obj ) {
+\t\treturn !isNaN( parseFloat(obj) ) && isFinite( obj );
+\t},
+
+\ttype: function( obj ) {
+\t\tif ( obj == null ) {
+\t\t\treturn String( obj );
+\t\t}
+\t\treturn typeof obj === "object" || typeof obj === "function" ?
+\t\t\tclass2type[ core_toString.call(obj) ] || "object" :
+\t\t\ttypeof obj;
+\t},
+
+\tisPlainObject: function( obj ) {
+\t\t// Must be an Object.
+\t\t// Because of IE, we also have to check the presence of the constructor property.
+\t\t// Make sure that DOM nodes and window objects don't pass through, as well
+\t\tif ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+\t\t\treturn false;
+\t\t}
+
+\t\ttry {
+\t\t\t// Not own constructor property must be Object
+\t\t\tif ( obj.constructor &&
+\t\t\t\t!core_hasOwn.call(obj, "constructor") &&
+\t\t\t\t!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+\t\t\t\treturn false;
+\t\t\t}
+\t\t} catch ( e ) {
+\t\t\t// IE8,9 Will throw exceptions on certain host objects #9897
+\t\t\treturn false;
+\t\t}
+
+\t\t// Own properties are enumerated firstly, so to speed up,
+\t\t// if last one is own, then all properties are own.
+
+\t\tvar key;
+\t\tfor ( key in obj ) {}
+
+\t\treturn key === undefined || core_hasOwn.call( obj, key );
+\t},
+
+\tisEmptyObject: function( obj ) {
+\t\tvar name;
+\t\tfor ( name in obj ) {
+\t\t\treturn false;
+\t\t}
+\t\treturn true;
+\t},
+
+\terror: function( msg ) {
+\t\tthrow new Error( msg );
+\t},
+
+\t// data: string of html
+\t// context (optional): If specified, the fragment will be created in this context, defaults to document
+\t// keepScripts (optional): If true, will include scripts passed in the html string
+\tparseHTML: function( data, context, keepScripts ) {
+\t\tif ( !data || typeof data !== "string" ) {
+\t\t\treturn null;
+\t\t}
+\t\tif ( typeof context === "boolean" ) {
+\t\t\tkeepScripts = context;
+\t\t\tcontext = false;
+\t\t}
+\t\tcontext = context || document;
+
+\t\tvar parsed = rsingleTag.exec( data ),
+\t\t\tscripts = !keepScripts && [];
+
+\t\t// Single tag
+\t\tif ( parsed ) {
+\t\t\treturn [ context.createElement( parsed[1] ) ];
+\t\t}
+
+\t\tparsed = jQuery.buildFragment( [ data ], context, scripts );
+\t\tif ( scripts ) {
+\t\t\tjQuery( scripts ).remove();
+\t\t}
+\t\treturn jQuery.merge( [], parsed.childNodes );
+\t},
+
+\tparseJSON: function( data ) {
+\t\t// Attempt to parse using the native JSON parser first
+\t\tif ( window.JSON && window.JSON.parse ) {
+\t\t\treturn window.JSON.parse( data );
+\t\t}
+
+\t\tif ( data === null ) {
+\t\t\treturn data;
+\t\t}
+
+\t\tif ( typeof data === "string" ) {
+
+\t\t\t// Make sure leading/trailing whitespace is removed (IE can't handle it)
+\t\t\tdata = jQuery.trim( data );
+
+\t\t\tif ( data ) {
+\t\t\t\t// Make sure the incoming data is actual JSON
+\t\t\t\t// Logic borrowed from http://json.org/json2.js
+\t\t\t\tif ( rvalidchars.test( data.replace( rvalidescape, "@" )
+\t\t\t\t\t.replace( rvalidtokens, "]" )
+\t\t\t\t\t.replace( rvalidbraces, "")) ) {
+
+\t\t\t\t\treturn ( new Function( "return " + data ) )();
+\t\t\t\t}
+\t\t\t}
+\t\t}
+
+\t\tjQuery.error( "Invalid JSON: " + data );
+\t},
+
+\t// Cross-browser xml parsing
+\tparseXML: function( data ) {
+\t\tvar xml, tmp;
+\t\tif ( !data || typeof data !== "string" ) {
+\t\t\treturn null;
+\t\t}
+\t\ttry {
+\t\t\tif ( window.DOMParser ) { // Standard
+\t\t\t\ttmp = new DOMParser();
+\t\t\t\txml = tmp.parseFromString( data , "text/xml" );
+\t\t\t} else { // IE
+\t\t\t\txml = new ActiveXObject( "Microsoft.XMLDOM" );
+\t\t\t\txml.async = "false";
+\t\t\t\txml.loadXML( data );
+\t\t\t}
+\t\t} catch( e ) {
+\t\t\txml = undefined;
+\t\t}
+\t\tif ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+\t\t\tjQuery.error( "Invalid XML: " + data );
+\t\t}
+\t\treturn xml;
+\t},
+
+\tnoop: function() {},
+
+\t// Evaluates a script in a global context
+\t// Workarounds based on findings by Jim Driscoll
+\t// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+\tglobalEval: function( data ) {
+\t\tif ( data && jQuery.trim( data ) ) {
+\t\t\t// We use execScript on Internet Explorer
+\t\t\t// We use an anonymous function so that context is window
+\t\t\t// rather than jQuery in Firefox
+\t\t\t( window.execScript || function( data ) {
+\t\t\t\twindow[ "eval" ].call( window, data );
+\t\t\t} )( data );
+\t\t}
+\t},
+
+\t// Convert dashed to camelCase; used by the css and data modules
+\t// Microsoft forgot to hump their vendor prefix (#9572)
+\tcamelCase: function( string ) {
+\t\treturn string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+\t},
+
+\tnodeName: function( elem, name ) {
+\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+\t},
+
+\t// args is for internal usage only
+\teach: function( obj, callback, args ) {
+\t\tvar value,
+\t\t\ti = 0,
+\t\t\tlength = obj.length,
+\t\t\tisArray = isArraylike( obj );
+
+\t\tif ( args ) {
+\t\t\tif ( isArray ) {
+\t\t\t\tfor ( ; i < length; i++ ) {
+\t\t\t\t\tvalue = callback.apply( obj[ i ], args );
+
+\t\t\t\t\tif ( value === false ) {
+\t\t\t\t\t\tbreak;
+\t\t\t\t\t}
+\t\t\t\t}
+\t\t\t} else {
+\t\t\t\tfor ( i in obj ) {
+\t\t\t\t\tvalue = callback.apply( obj[ i ], args );
+
+\t\t\t\t\tif ( value === false ) {
+\t\t\t\t\t\tbreak;
+\t\t\t\t\t}
+\t\t\t\t}
+\t\t\t}
+
+\t\t// A special, fast, case for the most common use of each
+\t\t} else {
+\t\t\tif ( isArray ) {
+\t\t\t\tfor ( ; i < length; i++ ) {
+\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );
+
+\t\t\t\t\tif ( value === false ) {
+\t\t\t\t\t\tbreak;
+\t\t\t\t\t}
+\t\t\t\t}
+\t\t\t} else {
+\t\t\t\tfor ( i in obj ) {
+\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );
+
+\t\t\t\t\tif ( value === false ) {
+\t\t\t\t\t\tbreak;
+\t\t\t\t\t}
+\t\t\t\t}
+\t\t\t}
+\t\t}
+
+\t\treturn obj;
+\t},
+
+\t// Use native String.trim function wherever possible
+\ttrim: core_trim && !core_trim.call("\uFEFF\xA0") ?
+\t\tfunction( text ) {
+\t\t\treturn text == null ?
+\t\t\t\t"" :
+\t\t\t\tcore_trim.call( text );
+\t\t} :
+
+\t\t// Otherwise use our own trimming functionality
+\t\tfunction( text ) {
+\t\t\treturn text == null ?
+\t\t\t\t"" :
+\t\t\t\t( text + "" ).replace( rtrim, "" );
+\t\t},
+
+\t// results is for internal usage only
+\tmakeArray: function( arr, results ) {
+\t\tvar ret = results || [];
+
+\t\tif ( arr != null ) {
+\t\t\tif ( isArraylike( Object(arr) ) ) {
+\t\t\t\tjQuery.merge( ret,
+\t\t\t\t\ttypeof arr === "string" ?
+\t\t\t\t\t[ arr ] : arr
+\t\t\t\t);
+\t\t\t} else {
+\t\t\t\tcore_push.call( ret, arr );
+\t\t\t}
+\t\t}
+
+\t\treturn ret;
+\t},
+
+\tinArray: function( elem, arr, i ) {
+\t\tvar len;
+
+\t\tif ( arr ) {
+\t\t\tif ( core_indexOf ) {
+\t\t\t\treturn core_indexOf.call( arr, elem, i );
+\t\t\t}
+
+\t\t\tlen = arr.length;
+\t\t\ti = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+\t\t\tfor ( ; i < len; i++ ) {
+\t\t\t\t// Skip accessing in sparse arrays
+\t\t\t\tif ( i in arr && arr[ i ] === elem ) {
+\t\t\t\t\treturn i;
+\t\t\t\t}
+\t\t\t}
+\t\t}
+
+\t\treturn -1;
+\t},
+
+\tmerge: function( first, second ) {
+\t\tvar l = second.length,
+\t\t\ti = first.length,
+\t\t\tj = 0;
+
+\t\tif ( typeof l === "number" ) {
+\t\t\tfor ( ; j < l; j++ ) {
+\t\t\t\tfirst[ i++ ] = second[ j ];
+\t\t\t}
+\t\t} else {
+\t\t\twhile ( second[j] !== undefined ) {
+\t\t\t\tfirst[ i++ ] = second[ j++ ];
+\t\t\t}
+\t\t}
+
+\t\tfirst.length = i;
+
+\t\treturn first;
+\t},
+
+\tgrep: function( elems, callback, inv ) {
+\t\tvar retVal,
+\t\t\tret = [],
+\t\t\ti = 0,
+\t\t\tlength = elems.length;
+\t\tinv = !!inv;
+
+\t\t// Go through the array, only saving the items
+\t\t// that pass the validator function
+\t\tfor ( ; i < length; i++ ) {
+\t\t\tretVal = !!callback( elems[ i ], i );
+\t\t\tif ( inv !== retVal ) {
+\t\t\t\tret.push( elems[ i ] );
+\t\t\t}
+\t\t}
+
+\t\treturn ret;
+\t},
+
+\t// arg is for internal usage only
+\tmap: function( elems, callback, arg ) {
+\t\tvar value,
+\t\t\ti = 0,
+\t\t\tlength = elems.length,
+\t\t\tisArray = isArraylike( elems ),
+\t\t\tret = [];
+
+\t\t// Go through the array, translating each of the items to their
+\t\tif ( isArray ) {
+\t\t\tfor ( ; i < length; i++ ) {
+\t\t\t\tvalue = callback( elems[ i ], i, arg );
+
+\t\t\t\tif ( value != null ) {
+\t\t\t\t\tret[ ret.length ] = value;
+\t\t\t\t}
+\t\t\t}
+
+\t\t// Go through every key on the object,
+\t\t} else {
+\t\t\tfor ( i in elems ) {
+\t\t\t\tvalue = callback( elems[ i ], i, arg );
+
+\t\t\t\tif ( value != null ) {
+\t\t\t\t\tret[ ret.length ] = value;
+\t\t\t\t}
+\t\t\t}
+\t\t}
+
+\t\t// Flatten any nested arrays
+\t\treturn core_concat.apply( [], ret );
+\t},
+
+\t// A global GUID counter for objects
+\tguid: 1,
+
+\t// Bind a function to a context, optionally partially applying any
+\t// arguments.
+\tproxy: function( fn, context ) {
+\t\tvar args, proxy, tmp;
+
+\t\tif ( typeof context === "string" ) {
+\t\t\ttmp = fn[ context ];
+\t\t\tcontext = fn;
+\t\t\tfn = tmp;
+\t\t}
+
+\t\t// Quick check to determine if target is callable, in the spec
+\t\t// this throws a TypeError, but we will just return undefined.
+\t\tif ( !jQuery.isFunction( fn ) ) {
+\t\t\treturn undefined;
+\t\t}
+
+\t\t// Simulated bind
+\t\targs = core_slice.call( arguments, 2 );
+\t\tproxy = function() {
+\t\t\treturn fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
+\t\t};
+
+\t\t// Set the guid of unique handler to the same of original handler, so it can be removed
+\t\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+\t\treturn proxy;
+\t},
+
+\t// Multifunctional method to get and set values of a collection
+\t// The value/s can optionally be executed if it's a function
+\taccess: function( elems, fn, key, value, chainable, emptyGet, raw ) {
+\t\tvar i = 0,
+\t\t\tlength = elems.length,
+\t\t\tbulk = key == null;
+
+\t\t// Sets many values
+\t\tif ( jQuery.type( key ) === "object" ) {
+\t\t\tchainable = true;
+\t\t\tfor ( i in key ) {
+\t\t\t\tjQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+\t\t\t}
+
+\t\t// Sets one value
+\t\t} else if ( value !== undefined ) {
+\t\t\tchainable = true;
+
+\t\t\tif ( !jQuery.isFunction( value ) ) {
+\t\t\t\traw = true;
+\t\t\t}
+
+\t\t\tif ( bulk ) {
+\t\t\t\t// Bulk operations run against the entire set
+\t\t\t\tif ( raw ) {
+\t\t\t\t\tfn.call( elems, value );
+\t\t\t\t\tfn = null;
+
+\t\t\t\t// ...except when executing function values
+\t\t\t\t} else {
+\t\t\t\t\tbulk = fn;
+\t\t\t\t\tfn = function( elem, key, value ) {
+\t\t\t\t\t\treturn bulk.call( jQuery( elem ), value );
+\t\t\t\t\t};
+\t\t\t\t}
+\t\t\t}
+
+\t\t\tif ( fn ) {
+\t\t\t\tfor ( ; i < length; i++ ) {
+\t\t\t\t\tfn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+\t\t\t\t}
+\t\t\t}
+\t\t}
+
+\t\treturn chainable ?
+\t\t\telems :
+
+\t\t\t// Gets
+\t\t\tbulk ?
+\t\t\t\tfn.call( elems ) :
+\t\t\t\tlength ? fn( elems[0], key ) : emptyGet;
+\t},
+
+\tnow: function() {
+\t\treturn ( new Date() ).getTime();
+\t}
});
jQuery.ready.promise = function( obj ) {
- if ( !readyList ) {
-
- readyList = jQuery.Deferred();
-
- // Catch cases where $(document).ready() is called after the browser event has already occurred.
- // we once tried to use readyState "interactive" here, but it caused issues like the one
- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- setTimeout( jQuery.ready );
-
- // Standards-based browsers support DOMContentLoaded
- } else if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", completed, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", completed, false );
-
- // If IE event model is used
- } else {
- // Ensure firing before onload, maybe late but safe also for iframes
- document.attachEvent( "onreadystatechange", completed );
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", completed );
-
- // If IE and not a frame
- // continually check to see if the document is ready
- var top = false;
-
- try {
- top = window.frameElement == null && document.documentElement;
- } catch(e) {}
-
- if ( top && top.doScroll ) {
- (function doScrollCheck() {
- if ( !jQuery.isReady ) {
-
- try {
- // Use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- top.doScroll("left");
- } catch(e) {
- return setTimeout( doScrollCheck, 50 );
- }
-
- // detach all dom ready events
- detach();
-
- // and execute any waiting functions
- jQuery.ready();
- }
- })();
- }
- }
- }
- return readyList.promise( obj );
+\tif ( !readyList ) {
+
+\t\treadyList = jQuery.Deferred();
+
+\t\t// Catch cases where $(document).ready() is called after the browser event has already occurred.
+\t\t// we once tried to use readyState "interactive" here, but it caused issues like the one
+\t\t// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+\t\tif ( document.readyState === "complete" ) {
+\t\t\t// Handle it asynchronously to allow scripts the opportunity to delay ready
+\t\t\tsetTimeout( jQuery.ready );
+
+\t\t// Standards-based browsers support DOMContentLoaded
+\t\t} else if ( document.addEventListener ) {
+\t\t\t// Use the handy event callback
+\t\t\tdocument.addEventListener( "DOMContentLoaded", completed, false );
+
+\t\t\t// A fallback to window.onload, that will always work
+\t\t\twindow.addEventListener( "load", completed, false );
+
+\t\t// If IE event model is used
+\t\t} else {
+\t\t\t// Ensure firing before onload, maybe late but safe also for iframes
+\t\t\tdocument.attachEvent( "onreadystatechange", completed );
+
+\t\t\t// A fallback to window.onload, that will always work
+\t\t\twindow.attachEvent( "onload", completed );
+
+\t\t\t// If IE and not a frame
+\t\t\t// continually check to see if the document is ready
+\t\t\tvar top = false;
+
+\t\t\ttry {
+\t\t\t\ttop = window.frameElement == null && document.documentElement;
+\t\t\t} catch(e) {}
+
+\t\t\tif ( top && top.doScroll ) {
+\t\t\t\t(function doScrollCheck() {
+\t\t\t\t\tif ( !jQuery.isReady ) {
+
+\t\t\t\t\t\ttry {
+\t\t\t\t\t\t\t// Use the trick by Diego Perini
+\t\t\t\t\t\t\t// http://javascript.nwbox.com/IEContentLoaded/
+\t\t\t\t\t\t\ttop.doScroll("left");
+\t\t\t\t\t\t} catch(e) {
+\t\t\t\t\t\t\treturn setTimeout( doScrollCheck, 50 );
+\t\t\t\t\t\t}
+
+\t\t\t\t\t\t// detach all dom ready events
+\t\t\t\t\t\tdetach();
+
+\t\t\t\t\t\t// and execute any waiting functions
+\t\t\t\t\t\tjQuery.ready();
+\t\t\t\t\t}
+\t\t\t\t})();
+\t\t\t}
+\t\t}
+\t}
+\treturn readyList.promise( obj );
};
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
+\tclass2type[ "[object " + name + "]" ] = name.toLowerCase();
});
function isArraylike( obj ) {
- var length = obj.length,
- type = jQuery.type( obj );
+\tvar length = obj.length,
+\t\ttype = jQuery.type( obj );
- if ( jQuery.isWindow( obj ) ) {
- return false;
- }
+\tif ( jQuery.isWindow( obj ) ) {
+\t\treturn false;
+\t}
- if ( obj.nodeType === 1 && length ) {
- return true;
- }
+\tif ( obj.nodeType === 1 && length ) {
+\t\treturn true;
+\t}
- return type === "array" || type !== "function" &&
- ( length === 0 ||
- typeof length === "number" && length > 0 && ( length - 1 ) in obj );
+\treturn type === "array" || type !== "function" &&
+\t\t( length === 0 ||
+\t\ttypeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
// All jQuery objects should point back to these
@@ -972,1739 +972,1739 @@ var optionsCache = {};
// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
- var object = optionsCache[ options ] = {};
- jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
- object[ flag ] = true;
- });
- return object;
+\tvar object = optionsCache[ options ] = {};
+\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
+\t\tobject[ flag ] = true;
+\t});
+\treturn object;
}
/*
* Create a callback list using the following parameters:
*
- * options: an optional list of space-separated options that will change how
- * the callback list behaves or a more traditional option object
+ *\toptions: an optional list of space-separated options that will change how
+ *\t\t\tthe callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
- * once: will ensure the callback list can only be fired once (like a Deferred)
+ *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)
*
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
+ *\tmemory:\t\t\twill keep track of previous values and will call any callback added
+ *\t\t\t\t\tafter the list has been fired right away with the latest "memorized"
+ *\t\t\t\t\tvalues (like a Deferred)
*
- * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)
*
- * stopOnFalse: interrupt callings when a callback returns false
+ *\tstopOnFalse:\tinterrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
- // Convert options from String-formatted to Object-formatted if needed
- // (we check in cache first)
- options = typeof options === "string" ?
- ( optionsCache[ options ] || createOptions( options ) ) :
- jQuery.extend( {}, options );
-
- var // Flag to know if list is currently firing
- firing,
- // Last fire value (for non-forgettable lists)
- memory,
- // Flag to know if list was already fired
- fired,
- // End of the loop when firing
- firingLength,
- // Index of currently firing callback (modified by remove if needed)
- firingIndex,
- // First callback to fire (used internally by add and fireWith)
- firingStart,
- // Actual callback list
- list = [],
- // Stack of fire calls for repeatable lists
- stack = !options.once && [],
- // Fire callbacks
- fire = function( data ) {
- memory = options.memory && data;
- fired = true;
- firingIndex = firingStart || 0;
- firingStart = 0;
- firingLength = list.length;
- firing = true;
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
- memory = false; // To prevent further calls using add
- break;
- }
- }
- firing = false;
- if ( list ) {
- if ( stack ) {
- if ( stack.length ) {
- fire( stack.shift() );
- }
- } else if ( memory ) {
- list = [];
- } else {
- self.disable();
- }
- }
- },
- // Actual Callbacks object
- self = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
- // First, we save the current length
- var start = list.length;
- (function add( args ) {
- jQuery.each( args, function( _, arg ) {
- var type = jQuery.type( arg );
- if ( type === "function" ) {
- if ( !options.unique || !self.has( arg ) ) {
- list.push( arg );
- }
- } else if ( arg && arg.length && type !== "string" ) {
- // Inspect recursively
- add( arg );
- }
- });
- })( arguments );
- // Do we need to add the callbacks to the
- // current firing batch?
- if ( firing ) {
- firingLength = list.length;
- // With memory, if we're not firing then
- // we should call right away
- } else if ( memory ) {
- firingStart = start;
- fire( memory );
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- if ( list ) {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
- // Handle firing indexes
- if ( firing ) {
- if ( index <= firingLength ) {
- firingLength--;
- }
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- }
- });
- }
- return this;
- },
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function( fn ) {
- return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
- },
- // Remove all callbacks from the list
- empty: function() {
- list = [];
- return this;
- },
- // Have the list do nothing anymore
- disable: function() {
- list = stack = memory = undefined;
- return this;
- },
- // Is it disabled?
- disabled: function() {
- return !list;
- },
- // Lock the list in its current state
- lock: function() {
- stack = undefined;
- if ( !memory ) {
- self.disable();
- }
- return this;
- },
- // Is it locked?
- locked: function() {
- return !stack;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- if ( list && ( !fired || stack ) ) {
- if ( firing ) {
- stack.push( args );
- } else {
- fire( args );
- }
- }
- return this;
- },
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
+\t// Convert options from String-formatted to Object-formatted if needed
+\t// (we check in cache first)
+\toptions = typeof options === "string" ?
+\t\t( optionsCache[ options ] || createOptions( options ) ) :
+\t\tjQuery.extend( {}, options );
+
+\tvar // Flag to know if list is currently firing
+\t\tfiring,
+\t\t// Last fire value (for non-forgettable lists)
+\t\tmemory,
+\t\t// Flag to know if list was already fired
+\t\tfired,
+\t\t// End of the loop when firing
+\t\tfiringLength,
+\t\t// Index of currently firing callback (modified by remove if needed)
+\t\tfiringIndex,
+\t\t// First callback to fire (used internally by add and fireWith)
+\t\tfiringStart,
+\t\t// Actual callback list
+\t\tlist = [],
+\t\t// Stack of fire calls for repeatable lists
+\t\tstack = !options.once && [],
+\t\t// Fire callbacks
+\t\tfire = function( data ) {
+\t\t\tmemory = options.memory && data;
+\t\t\tfired = true;
+\t\t\tfiringIndex = firingStart || 0;
+\t\t\tfiringStart = 0;
+\t\t\tfiringLength = list.length;
+\t\t\tfiring = true;
+\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {
+\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+\t\t\t\t\tmemory = false; // To prevent further calls using add
+\t\t\t\t\tbreak;
+\t\t\t\t}
+\t\t\t}
+\t\t\tfiring = false;
+\t\t\tif ( list ) {
+\t\t\t\tif ( stack ) {
+\t\t\t\t\tif ( stack.length ) {
+\t\t\t\t\t\tfire( stack.shift() );
+\t\t\t\t\t}
+\t\t\t\t} else if ( memory ) {
+\t\t\t\t\tlist = [];
+\t\t\t\t} else {
+\t\t\t\t\tself.disable();
+\t\t\t\t}
+\t\t\t}
+\t\t},
+\t\t// Actual Callbacks object
+\t\tself = {
+\t\t\t// Add a callback or a collection of callbacks to the list
+\t\t\tadd: function() {
+\t\t\t\tif ( list ) {
+\t\t\t\t\t// First, we save the current length
+\t\t\t\t\tvar start = list.length;
+\t\t\t\t\t(function add( args ) {
+\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {
+\t\t\t\t\t\t\tvar type = jQuery.type( arg );
+\t\t\t\t\t\t\tif ( type === "function" ) {
+\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {
+\t\t\t\t\t\t\t\t\tlist.push( arg );
+\t\t\t\t\t\t\t\t}
+\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== "string" ) {
+\t\t\t\t\t\t\t\t// Inspect recursively
+\t\t\t\t\t\t\t\tadd( arg );
+\t\t\t\t\t\t\t}
+\t\t\t\t\t\t});
+\t\t\t\t\t})( arguments );
+\t\t\t\t\t// Do we need to add the callbacks to the
+\t\t\t\t\t// current firing batch?
+\t\t\t\t\tif ( firing ) {
+\t\t\t\t\t\tfiringLength = list.length;
+\t\t\t\t\t// With memory, if we're not firing then
+\t\t\t\t\t// we should call right away
+\t\t\t\t\t} else if ( memory ) {
+\t\t\t\t\t\tfiringStart = start;
+\t\t\t\t\t\tfire( memory );
+\t\t\t\t\t}
+\t\t\t\t}
+\t\t\t\treturn this;
+\t\t\t},
+\t\t\t// Remove a callback from the list
+\t\t\tremove: function() {
+\t\t\t\tif ( list ) {
+\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {
+\t\t\t\t\t\tvar index;
+\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+\t\t\t\t\t\t\tlist.splice( index, 1 );
+\t\t\t\t\t\t\t// Handle firing indexes
+\t\t\t\t\t\t\tif ( firing ) {
+\t\t\t\t\t\t\t\tif ( index <= firingLength ) {
+\t\t\t\t\t\t\t\t\tfiringLength--;
+\t\t\t\t\t\t\t\t}
+\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {
+\t\t\t\t\t\t\t\t\tfiringIndex--;
+\t\t\t\t\t\t\t\t}
+\t\t\t\t\t\t\t}
+\t\t\t\t\t\t}
+\t\t\t\t\t});
+\t\t\t\t}
+\t\t\t\treturn this;
+\t\t\t},
+\t\t\t// Check if a given callback is in the list.
+\t\t\t// If no argument is given, return whether or not list has callbacks attached.
+\t\t\thas: function( fn ) {
+\t\t\t\treturn fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+\t\t\t},
+\t\t\t// Remove all callbacks from the list
+\t\t\tempty: function() {
+\t\t\t\tlist = [];
+\t\t\t\treturn this;
+\t\t\t},
+\t\t\t// Have the list do nothing anymore
+\t\t\tdisable: function() {
+\t\t\t\tlist = stack = memory = undefined;
+\t\t\t\treturn this;
+\t\t\t},
+\t\t\t// Is it disabled?
+\t\t\tdisabled: function() {
+\t\t\t\treturn !list;
+\t\t\t},
+\t\t\t// Lock the list in its current state
+\t\t\tlock: function() {
+\t\t\t\tstack = undefined;
+\t\t\t\tif ( !memory ) {
+\t\t\t\t\tself.disable();
+\t\t\t\t}
+\t\t\t\treturn this;
+\t\t\t},
+\t\t\t// Is it locked?
+\t\t\tlocked: function() {
+\t\t\t\treturn !stack;
+\t\t\t},
+\t\t\t// Call all callbacks with the given context and arguments
+\t\t\tfireWith: function( context, args ) {
+\t\t\t\targs = args || [];
+\t\t\t\targs = [ context, args.slice ? args.slice() : args ];
+\t\t\t\tif ( list && ( !fired || stack ) ) {
+\t\t\t\t\tif ( firing ) {
+\t\t\t\t\t\tstack.push( args );
+\t\t\t\t\t} else {
+\t\t\t\t\t\tfire( args );
+\t\t\t\t\t}
+\t\t\t\t}
+\t\t\t\treturn this;
+\t\t\t},
+\t\t\t// Call all the callbacks with the given arguments
+\t\t\tfire: function() {
+\t\t\t\tself.fireWith( this, arguments );
+\t\t\t\treturn this;
+\t\t\t},
+\t\t\t// To know if the callbacks have already been called at least once
+\t\t\tfired: function() {
+\t\t\t\treturn !!fired;
+\t\t\t}
+\t\t};
+
+\treturn self;
};
jQuery.extend({
- Deferred: function( func ) {
- var tuples = [
- // action, add listener, listener list, final state
- [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
- [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
- [ "notify", "progress", jQuery.Callbacks("memory") ]
- ],
- state = "pending",
- promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done( arguments ).fail( arguments );
- return this;
- },
- then: function( /* fnDone, fnFail, fnProgress */ ) {
- var fns = arguments;
- return jQuery.Deferred(function( newDefer ) {
- jQuery.each( tuples, function( i, tuple ) {
- var action = tuple[ 0 ],
- fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
- // deferred[ done | fail | progress ] for forwarding actions to newDefer
- deferred[ tuple[1] ](function() {
- var returned = fn && fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise()
- .done( newDefer.resolve )
- .fail( newDefer.reject )
- .progress( newDefer.notify );
- } else {
- newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
- }
- });
- });
- fns = null;
- }).promise();
- },
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- return obj != null ? jQuery.extend( obj, promise ) : promise;
- }
- },
- deferred = {};
-
- // Keep pipe for back-compat
- promise.pipe = promise.then;
-
- // Add list-specific methods
- jQuery.each( tuples, function( i, tuple ) {
- var list = tuple[ 2 ],
- stateString = tuple[ 3 ];
-
- // promise[ done | fail | progress ] = list.add
- promise[ tuple[1] ] = list.add;
-
- // Handle state
- if ( stateString ) {
- list.add(function() {
- // state = [ resolved | rejected ]
- state = stateString;
-
- // [ reject_list | resolve_list ].disable; progress_list.lock
- }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
- }
-
- // deferred[ resolve | reject | notify ]
- deferred[ tuple[0] ] = function() {
- deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
- return this;
- };
- deferred[ tuple[0] + "With" ] = list.fireWith;
- });
-
- // Make the deferred a promise
- promise.promise( deferred );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( subordinate /* , ..., subordinateN */ ) {
- var i = 0,
- resolveValues = core_slice.call( arguments ),
- length = resolveValues.length,
-
- // the count of uncompleted subordinates
- remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
- // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
- deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
- // Update function for both resolve and progress values
- updateFunc = function( i, contexts, values ) {
- return function( value ) {
- contexts[ i ] = this;
- values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
- if( values === progressValues ) {
- deferred.notifyWith( contexts, values );
- } else if ( !( --remaining ) ) {
- deferred.resolveWith( contexts, values );
- }
- };
- },
-
- progressValues, progressContexts, resolveContexts;
-
- // add listeners to Deferred subordinates; treat others as resolved
- if ( length > 1 ) {
- progressValues = new Array( length );
- progressContexts = new Array( length );
- resolveContexts = new Array( length );
- for ( ; i < length; i++ ) {
- if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
- resolveValues[ i ].promise()
- .done( updateFunc( i, resolveContexts, resolveValues ) )
- .fail( deferred.reject )
- .progress( updateFunc( i, progressContexts, progressValues ) );
- } else {
- --remaining;
- }
- }
- }
-
- // if we're not waiting on anything, resolve the master
- if ( !remaining ) {
- deferred.resolveWith( resolveContexts, resolveValues );
- }
-
- return deferred.promise();
- }
+\tDeferred: function( func ) {
+\t\tvar tuples = [
+\t\t\t\t// action, add listener, listener list, final state
+\t\t\t\t[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+\t\t\t\t[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+\t\t\t\t[ "notify", "progress", jQuery.Callbacks("memory") ]
+\t\t\t],
+\t\t\tstate = "pending",
+\t\t\tpromise = {
+\t\t\t\tstate: function() {
+\t\t\t\t\treturn state;
+\t\t\t\t},
+\t\t\t\talways: function() {
+\t\t\t\t\tdeferred.done( arguments ).fail( arguments );
+\t\t\t\t\treturn this;
+\t\t\t\t},
+\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {
+\t\t\t\t\tvar fns = arguments;
+\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {
+\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {
+\t\t\t\t\t\t\tvar action = tuple[ 0 ],
+\t\t\t\t\t\t\t\tfn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer
+\t\t\t\t\t\t\tdeferred[ tuple[1] ](function() {
+\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );
+\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {
+\t\t\t\t\t\t\t\t\treturned.promise()
+\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )
+\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )
+\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );
+\t\t\t\t\t\t\t\t} else {
+\t\t\t\t\t\t\t\t\tnewDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+\t\t\t\t\t\t\t\t}
+\t\t\t\t\t\t\t});
+\t\t\t\t\t\t});
+\t\t\t\t\t\tfns = null;
+\t\t\t\t\t}).promise();
+\t\t\t\t},
+\t\t\t\t// Get a promise for this deferred
+\t\t\t\t// If obj is provided, the promise aspect is added to the object
+\t\t\t\tpromise: function( obj ) {
+\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;
+\t\t\t\t}
+\t\t\t},
+\t\t\tdeferred = {};
+
+\t\t// Keep pipe for back-compat
+\t\tpromise.pipe = promise.then;
+
+\t\t// Add list-specific methods
+\t\tjQuery.each( tuples, function( i, tuple ) {
+\t\t\tvar list = tuple[ 2 ],
+\t\t\t\tstateString = tuple[ 3 ];
+
+\t\t\t// promise[ done | fail | progress ] = list.add
+\t\t\tpromise[ tuple[1] ] = list.add;
+
+\t\t\t// Handle state
+\t\t\tif ( stateString ) {
+\t\t\t\tlist.add(function() {
+\t\t\t\t\t// state = [ resolved | rejected ]
+\t\t\t\t\tstate = stateString;
+
+\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock
+\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+\t\t\t}
+
+\t\t\t// deferred[ resolve | reject | notify ]
+\t\t\tdeferred[ tuple[0] ] = function() {
+\t\t\t\tdeferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+\t\t\t\treturn this;
+\t\t\t};
+\t\t\tdeferred[ tuple[0] + "With" ] = list.fireWith;
+\t\t});
+
+\t\t// Make the deferred a promise
+\t\tpromise.promise( deferred );
+
+\t\t// Call given func if any
+\t\tif ( func ) {
+\t\t\tfunc.call( deferred, deferred );
+\t\t}
+
+\t\t// All done!
+\t\treturn deferred;
+\t},
+
+\t// Deferred helper
+\twhen: function( subordinate /* , ..., subordinateN */ ) {
+\t\tvar i = 0,
+\t\t\tresolveValues = core_slice.call( arguments ),
+\t\t\tlength = resolveValues.length,
+
+\t\t\t// the count of uncompleted subordinates
+\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+\t\t\t// Update function for both resolve and progress values
+\t\t\tupdateFunc = function( i, contexts, values ) {
+\t\t\t\treturn function( value ) {
+\t\t\t\t\tcontexts[ i ] = this;
+\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
+\t\t\t\t\tif( values === progressValues ) {
+\t\t\t\t\t\tdeferred.notifyWith( contexts, values );
+\t\t\t\t\t} else if ( !( --remaining ) ) {
+\t\t\t\t\t\tdeferred.resolveWith( contexts, values );
+\t\t\t\t\t}
+\t\t\t\t};
+\t\t\t},
+
+\t\t\tprogressValues, progressContexts, resolveContexts;
+
+\t\t// add listeners to Deferred subordinates; treat others as resolved
+\t\tif ( length > 1 ) {
+\t\t\tprogressValues = new Array( length );
+\t\t\tprogressContexts = new Array( length );
+\t\t\tresolveContexts = new Array( length );
+\t\t\tfor ( ; i < length; i++ ) {
+\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+\t\t\t\t\tresolveValues[ i ].promise()
+\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )
+\t\t\t\t\t\t.fail( deferred.reject )
+\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );
+\t\t\t\t} else {
+\t\t\t\t\t--remaining;
+\t\t\t\t}
+\t\t\t}
+\t\t}
+
+\t\t// if we're not waiting on anything, resolve the master
+\t\tif ( !remaining ) {
+\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );
+\t\t}
+
+\t\treturn deferred.promise();
+\t}
});
jQuery.support = (function() {
- var support, all, a,
- input, select, fragment,
- opt, eventName, isSupported, i,
- div = document.createElement("div");
-
- // Setup
- div.setAttribute( "className", "t" );
- div.innerHTML = "
a";
-
- // Support tests won't run in some limited or non-browser environments
- all = div.getElementsByTagName("*");
- a = div.getElementsByTagName("a")[ 0 ];
- if ( !all || !a || !all.length ) {
- return {};
- }
-
- // First batch of tests
- select = document.createElement("select");
- opt = select.appendChild( document.createElement("option") );
- input = div.getElementsByTagName("input")[ 0 ];
-
- a.style.cssText = "top:1px;float:left;opacity:.5";
- support = {
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
- getSetAttribute: div.className !== "t",
-
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: div.firstChild.nodeType === 3,
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText instead)
- style: /top/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: a.getAttribute("href") === "/a",
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.5/.test( a.style.opacity ),
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
- checkOn: !!input.value,
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: opt.selected,
-
- // Tests for enctype support on a form (#6743)
- enctype: !!document.createElement("form").enctype,
-
- // Makes sure cloning an html5 element does not cause problems
- // Where outerHTML is undefined, this still works
- html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>",
-
- // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
- boxModel: document.compatMode === "CSS1Compat",
-
- // Will be defined later
- deleteExpando: true,
- noCloneEvent: true,
- inlineBlockNeedsLayout: false,
- shrinkWrapBlocks: false,
- reliableMarginRight: true,
- boxSizingReliable: true,
- pixelPosition: false
- };
-
- // Make sure checked status is properly cloned
- input.checked = true;
- support.noCloneChecked = input.cloneNode( true ).checked;
-
- // Make sure that the options inside disabled selects aren't marked as disabled
- // (WebKit marks them as disabled)
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Support: IE<9
- try {
- delete div.test;
- } catch( e ) {
- support.deleteExpando = false;
- }
-
- // Check if we can trust getAttribute("value")
- input = document.createElement("input");
- input.setAttribute( "value", "" );
- support.input = input.getAttribute( "value" ) === "";
-
- // Check if an input maintains its value after becoming a radio
- input.value = "t";
- input.setAttribute( "type", "radio" );
- support.radioValue = input.value === "t";
-
- // #11217 - WebKit loses check when the name is after the checked attribute
- input.setAttribute( "checked", "t" );
- input.setAttribute( "name", "t" );
-
- fragment = document.createDocumentFragment();
- fragment.appendChild( input );
-
- // Check if a disconnected checkbox will retain its checked
- // value of true after appended to the DOM (IE6/7)
- support.appendChecked = input.checked;
-
- // WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Support: IE<9
- // Opera does not clone events (and typeof div.attachEvent === undefined).
- // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
- if ( div.attachEvent ) {
- div.attachEvent( "onclick", function() {
- support.noCloneEvent = false;
- });
-
- div.cloneNode( true ).click();
- }
-
- // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
- // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
- for ( i in { submit: true, change: true, focusin: true }) {
- div.setAttribute( eventName = "on" + i, "t" );
-
- support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
- }
-
- div.style.backgroundClip = "content-box";
- div.cloneNode( true ).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
- // Run tests that need a body at doc ready
- jQuery(function() {
- var container, marginDiv, tds,
- divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
- body = document.getElementsByTagName("body")[0];
-
- if ( !body ) {
- // Return for frameset docs that don't have a body
- return;
- }
-
- container = document.createElement("div");
- container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
-
- body.appendChild( container ).appendChild( div );
-
- // Support: IE8
- // Check if table cells still have offsetWidth/Height when they are set
- // to display:none and there are still other visible table cells in a
- // table row; if so, offsetWidth/Height are not reliable for use when
- // determining if an element has been hidden directly using
- // display:none (it is still safe to use offsets if a parent element is
- // hidden; don safety goggles and see bug #4512 for more information).
- div.innerHTML = "t
";
- tds = div.getElementsByTagName("td");
- tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
- isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
- tds[ 0 ].style.display = "";
- tds[ 1 ].style.display = "none";
-
- // Support: IE8
- // Check if empty table cells still have offsetWidth/Height
- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
- // Check box-sizing and margin behavior
- div.innerHTML = "";
- div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
- support.boxSizing = ( div.offsetWidth === 4 );
- support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
-
- // Use window.getComputedStyle because jsdom on node.js will break without it.
- if ( window.getComputedStyle ) {
- support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
- support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
-
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. (#3333)
- // Fails in WebKit before Feb 2011 nightlies
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- marginDiv = div.appendChild( document.createElement("div") );
- marginDiv.style.cssText = div.style.cssText = divReset;
- marginDiv.style.marginRight = marginDiv.style.width = "0";
- div.style.width = "1px";
-
- support.reliableMarginRight =
- !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
- }
-
- if ( typeof div.style.zoom !== core_strundefined ) {
- // Support: IE<8
- // Check if natively block-level elements act like inline-block
- // elements when setting their display to 'inline' and giving
- // them layout
- div.innerHTML = "";
- div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
- // Support: IE6
- // Check if elements with layout shrink-wrap their children
- div.style.display = "block";
- div.innerHTML = "";
- div.firstChild.style.width = "5px";
- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-
- if ( support.inlineBlockNeedsLayout ) {
- // Prevent IE 6 from affecting layout for positioned elements #11048
- // Prevent IE from shrinking the body in IE 7 mode #12869
- // Support: IE<8
- body.style.zoom = 1;
- }
- }
-
- body.removeChild( container );
-
- // Null elements to avoid leaks in IE
- container = div = tds = marginDiv = null;
- });
-
- // Null elements to avoid leaks in IE
- all = select = fragment = opt = a = input = null;
-
- return support;
+\tvar support, all, a,
+\t\tinput, select, fragment,
+\t\topt, eventName, isSupported, i,
+\t\tdiv = document.createElement("div");
+
+\t// Setup
+\tdiv.setAttribute( "className", "t" );
+\tdiv.innerHTML = "
a";
+
+\t// Support tests won't run in some limited or non-browser environments
+\tall = div.getElementsByTagName("*");
+\ta = div.getElementsByTagName("a")[ 0 ];
+\tif ( !all || !a || !all.length ) {
+\t\treturn {};
+\t}
+
+\t// First batch of tests
+\tselect = document.createElement("select");
+\topt = select.appendChild( document.createElement("option") );
+\tinput = div.getElementsByTagName("input")[ 0 ];
+
+\ta.style.cssText = "top:1px;float:left;opacity:.5";
+\tsupport = {
+\t\t// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+\t\tgetSetAttribute: div.className !== "t",
+
+\t\t// IE strips leading whitespace when .innerHTML is used
+\t\tleadingWhitespace: div.firstChild.nodeType === 3,
+
+\t\t// Make sure that tbody elements aren't automatically inserted
+\t\t// IE will insert them into empty tables
+\t\ttbody: !div.getElementsByTagName("tbody").length,
+
+\t\t// Make sure that link elements get serialized correctly by innerHTML
+\t\t// This requires a wrapper element in IE
+\t\thtmlSerialize: !!div.getElementsByTagName("link").length,
+
+\t\t// Get the style information from getAttribute
+\t\t// (IE uses .cssText instead)
+\t\tstyle: /top/.test( a.getAttribute("style") ),
+
+\t\t// Make sure that URLs aren't manipulated
+\t\t// (IE normalizes it by default)
+\t\threfNormalized: a.getAttribute("href") === "/a",
+
+\t\t// Make sure that element opacity exists
+\t\t// (IE uses filter instead)
+\t\t// Use a regex to work around a WebKit issue. See #5145
+\t\topacity: /^0.5/.test( a.style.opacity ),
+
+\t\t// Verify style float existence
+\t\t// (IE uses styleFloat instead of cssFloat)
+\t\tcssFloat: !!a.style.cssFloat,
+
+\t\t// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+\t\tcheckOn: !!input.value,
+
+\t\t// Make sure that a selected-by-default option has a working selected property.
+\t\t// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+\t\toptSelected: opt.selected,
+
+\t\t// Tests for enctype support on a form (#6743)
+\t\tenctype: !!document.createElement("form").enctype,
+
+\t\t// Makes sure cloning an html5 element does not cause problems
+\t\t// Where outerHTML is undefined, this still works
+\t\thtml5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>",
+
+\t\t// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
+\t\tboxModel: document.compatMode === "CSS1Compat",
+
+\t\t// Will be defined later
+\t\tdeleteExpando: true,
+\t\tnoCloneEvent: true,
+\t\tinlineBlockNeedsLayout: false,
+\t\tshrinkWrapBlocks: false,
+\t\treliableMarginRight: true,
+\t\tboxSizingReliable: true,
+\t\tpixelPosition: false
+\t};
+
+\t// Make sure checked status is properly cloned
+\tinput.checked = true;
+\tsupport.noCloneChecked = input.cloneNode( true ).checked;
+
+\t// Make sure that the options inside disabled selects aren't marked as disabled
+\t// (WebKit marks them as disabled)
+\tselect.disabled = true;
+\tsupport.optDisabled = !opt.disabled;
+
+\t// Support: IE<9
+\ttry {
+\t\tdelete div.test;
+\t} catch( e ) {
+\t\tsupport.deleteExpando = false;
+\t}
+
+\t// Check if we can trust getAttribute("value")
+\tinput = document.createElement("input");
+\tinput.setAttribute( "value", "" );
+\tsupport.input = input.getAttribute( "value" ) === "";
+
+\t// Check if an input maintains its value after becoming a radio
+\tinput.value = "t";
+\tinput.setAttribute( "type", "radio" );
+\tsupport.radioValue = input.value === "t";
+
+\t// #11217 - WebKit loses check when the name is after the checked attribute
+\tinput.setAttribute( "checked", "t" );
+\tinput.setAttribute( "name", "t" );
+
+\tfragment = document.createDocumentFragment();
+\tfragment.appendChild( input );
+
+\t// Check if a disconnected checkbox will retain its checked
+\t// value of true after appended to the DOM (IE6/7)
+\tsupport.appendChecked = input.checked;
+
+\t// WebKit doesn't clone checked state correctly in fragments
+\tsupport.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+\t// Support: IE<9
+\t// Opera does not clone events (and typeof div.attachEvent === undefined).
+\t// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+\tif ( div.attachEvent ) {
+\t\tdiv.attachEvent( "onclick", function() {
+\t\t\tsupport.noCloneEvent = false;
+\t\t});
+
+\t\tdiv.cloneNode( true ).click();
+\t}
+
+\t// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
+\t// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
+\tfor ( i in { submit: true, change: true, focusin: true }) {
+\t\tdiv.setAttribute( eventName = "on" + i, "t" );
+
+\t\tsupport[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
+\t}
+
+\tdiv.style.backgroundClip = "content-box";
+\tdiv.cloneNode( true ).style.backgroundClip = "";
+\tsupport.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+\t// Run tests that need a body at doc ready
+\tjQuery(function() {
+\t\tvar container, marginDiv, tds,
+\t\t\tdivReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
+\t\t\tbody = document.getElementsByTagName("body")[0];
+
+\t\tif ( !body ) {
+\t\t\t// Return for frameset docs that don't have a body
+\t\t\treturn;
+\t\t}
+
+\t\tcontainer = document.createElement("div");
+\t\tcontainer.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+
+\t\tbody.appendChild( container ).appendChild( div );
+
+\t\t// Support: IE8
+\t\t// Check if table cells still have offsetWidth/Height when they are set
+\t\t// to display:none and there are still other visible table cells in a
+\t\t// table row; if so, offsetWidth/Height are not reliable for use when
+\t\t// determining if an element has been hidden directly using
+\t\t// display:none (it is still safe to use offsets if a parent element is
+\t\t// hidden; don safety goggles and see bug #4512 for more information).
+\t\tdiv.innerHTML = "t
";
+\t\ttds = div.getElementsByTagName("td");
+\t\ttds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
+\t\tisSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+\t\ttds[ 0 ].style.display = "";
+\t\ttds[ 1 ].style.display = "none";
+
+\t\t// Support: IE8
+\t\t// Check if empty table cells still have offsetWidth/Height
+\t\tsupport.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+\t\t// Check box-sizing and margin behavior
+\t\tdiv.innerHTML = "";
+\t\tdiv.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
+\t\tsupport.boxSizing = ( div.offsetWidth === 4 );
+\t\tsupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
+
+\t\t// Use window.getComputedStyle because jsdom on node.js will break without it.
+\t\tif ( window.getComputedStyle ) {
+\t\t\tsupport.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+\t\t\tsupport.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+\t\t\t// Check if div with explicit width and no margin-right incorrectly
+\t\t\t// gets computed margin-right based on width of container. (#3333)
+\t\t\t// Fails in WebKit before Feb 2011 nightlies
+\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+\t\t\tmarginDiv = div.appendChild( document.createElement("div") );
+\t\t\tmarginDiv.style.cssText = div.style.cssText = divReset;
+\t\t\tmarginDiv.style.marginRight = marginDiv.style.width = "0";
+\t\t\tdiv.style.width = "1px";
+
+\t\t\tsupport.reliableMarginRight =
+\t\t\t\t!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+\t\t}
+
+\t\tif ( typeof div.style.zoom !== core_strundefined ) {
+\t\t\t// Support: IE<8
+\t\t\t// Check if natively block-level elements act like inline-block
+\t\t\t// elements when setting their display to 'inline' and giving
+\t\t\t// them layout
+\t\t\tdiv.innerHTML = "";
+\t\t\tdiv.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
+\t\t\tsupport.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+\t\t\t// Support: IE6
+\t\t\t// Check if elements with layout shrink-wrap their children
+\t\t\tdiv.style.display = "block";
+\t\t\tdiv.innerHTML = "";
+\t\t\tdiv.firstChild.style.width = "5px";
+\t\t\tsupport.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+
+\t\t\tif ( support.inlineBlockNeedsLayout ) {
+\t\t\t\t// Prevent IE 6 from affecting layout for positioned elements #11048
+\t\t\t\t// Prevent IE from shrinking the body in IE 7 mode #12869
+\t\t\t\t// Support: IE<8
+\t\t\t\tbody.style.zoom = 1;
+\t\t\t}
+\t\t}
+
+\t\tbody.removeChild( container );
+
+\t\t// Null elements to avoid leaks in IE
+\t\tcontainer = div = tds = marginDiv = null;
+\t});
+
+\t// Null elements to avoid leaks in IE
+\tall = select = fragment = opt = a = input = null;
+
+\treturn support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
- rmultiDash = /([A-Z])/g;
+\trmultiDash = /([A-Z])/g;
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var thisCache, ret,
- internalKey = jQuery.expando,
- getByName = typeof name === "string",
-
- // We have to handle DOM nodes and JS objects differently because IE6-7
- // can't GC object references properly across the DOM-JS boundary
- isNode = elem.nodeType,
-
- // Only DOM nodes need the global jQuery cache; JS object data is
- // attached directly to the object so GC can occur automatically
- cache = isNode ? jQuery.cache : elem,
-
- // Only defining an ID for JS objects if its cache already exists allows
- // the code to shortcut on the same path as a DOM node with no cache
- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
-
- // Avoid doing any more work than we need to when trying to get data on an
- // object that has no data at all
- if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
- return;
- }
-
- if ( !id ) {
- // Only DOM nodes need a new unique ID for each element since their data
- // ends up in the global cache
- if ( isNode ) {
- elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
- } else {
- id = internalKey;
- }
- }
-
- if ( !cache[ id ] ) {
- cache[ id ] = {};
-
- // Avoids exposing jQuery metadata on plain JS objects when the object
- // is serialized using JSON.stringify
- if ( !isNode ) {
- cache[ id ].toJSON = jQuery.noop;
- }
- }
-
- // An object can be passed to jQuery.data instead of a key/value pair; this gets
- // shallow copied over onto the existing cache
- if ( typeof name === "object" || typeof name === "function" ) {
- if ( pvt ) {
- cache[ id ] = jQuery.extend( cache[ id ], name );
- } else {
- cache[ id ].data = jQuery.extend( cache[ id ].data, name );
- }
- }
-
- thisCache = cache[ id ];
-
- // jQuery data() is stored in a separate object inside the object's internal data
- // cache in order to avoid key collisions between internal data and user-defined
- // data.
- if ( !pvt ) {
- if ( !thisCache.data ) {
- thisCache.data = {};
- }
-
- thisCache = thisCache.data;
- }
-
- if ( data !== undefined ) {
- thisCache[ jQuery.camelCase( name ) ] = data;
- }
-
- // Check for both converted-to-camel and non-converted data property names
- // If a data property was specified
- if ( getByName ) {
-
- // First Try to find as-is property data
- ret = thisCache[ name ];
-
- // Test for null|undefined property data
- if ( ret == null ) {
-
- // Try to find the camelCased property
- ret = thisCache[ jQuery.camelCase( name ) ];
- }
- } else {
- ret = thisCache;
- }
-
- return ret;
+\tif ( !jQuery.acceptData( elem ) ) {
+\t\treturn;
+\t}
+
+\tvar thisCache, ret,
+\t\tinternalKey = jQuery.expando,
+\t\tgetByName = typeof name === "string",
+
+\t\t// We have to handle DOM nodes and JS objects differently because IE6-7
+\t\t// can't GC object references properly across the DOM-JS boundary
+\t\tisNode = elem.nodeType,
+
+\t\t// Only DOM nodes need the global jQuery cache; JS object data is
+\t\t// attached directly to the object so GC can occur automatically
+\t\tcache = isNode ? jQuery.cache : elem,
+
+\t\t// Only defining an ID for JS objects if its cache already exists allows
+\t\t// the code to shortcut on the same path as a DOM node with no cache
+\t\tid = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+\t// Avoid doing any more work than we need to when trying to get data on an
+\t// object that has no data at all
+\tif ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
+\t\treturn;
+\t}
+
+\tif ( !id ) {
+\t\t// Only DOM nodes need a new unique ID for each element since their data
+\t\t// ends up in the global cache
+\t\tif ( isNode ) {
+\t\t\telem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
+\t\t} else {
+\t\t\tid = internalKey;
+\t\t}
+\t}
+
+\tif ( !cache[ id ] ) {
+\t\tcache[ id ] = {};
+
+\t\t// Avoids exposing jQuery metadata on plain JS objects when the object
+\t\t// is serialized using JSON.stringify
+\t\tif ( !isNode ) {
+\t\t\tcache[ id ].toJSON = jQuery.noop;
+\t\t}
+\t}
+
+\t// An object can be passed to jQuery.data instead of a key/value pair; this gets
+\t// shallow copied over onto the existing cache
+\tif ( typeof name === "object" || typeof name === "function" ) {
+\t\tif ( pvt ) {
+\t\t\tcache[ id ] = jQuery.extend( cache[ id ], name );
+\t\t} else {
+\t\t\tcache[ id ].data = jQuery.extend( cache[ id ].data, name );
+\t\t}
+\t}
+
+\tthisCache = cache[ id ];
+
+\t// jQuery data() is stored in a separate object inside the object's internal data
+\t// cache in order to avoid key collisions between internal data and user-defined
+\t// data.
+\tif ( !pvt ) {
+\t\tif ( !thisCache.data ) {
+\t\t\tthisCache.data = {};
+\t\t}
+
+\t\tthisCache = thisCache.data;
+\t}
+
+\tif ( data !== undefined ) {
+\t\tthisCache[ jQuery.camelCase( name ) ] = data;
+\t}
+
+\t// Check for both converted-to-camel and non-converted data property names
+\t// If a data property was specified
+\tif ( getByName ) {
+
+\t\t// First Try to find as-is property data
+\t\tret = thisCache[ name ];
+
+\t\t// Test for null|undefined property data
+\t\tif ( ret == null ) {
+
+\t\t\t// Try to find the camelCased property
+\t\t\tret = thisCache[ jQuery.camelCase( name ) ];
+\t\t}
+\t} else {
+\t\tret = thisCache;
+\t}
+
+\treturn ret;
}
function internalRemoveData( elem, name, pvt ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var i, l, thisCache,
- isNode = elem.nodeType,
-
- // See jQuery.data for more information
- cache = isNode ? jQuery.cache : elem,
- id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
- // If there is already no cache entry for this object, there is no
- // purpose in continuing
- if ( !cache[ id ] ) {
- return;
- }
-
- if ( name ) {
-
- thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
- if ( thisCache ) {
-
- // Support array or space separated string names for data keys
- if ( !jQuery.isArray( name ) ) {
-
- // try the string as a key before any manipulation
- if ( name in thisCache ) {
- name = [ name ];
- } else {
-
- // split the camel cased version by spaces unless a key with the spaces exists
- name = jQuery.camelCase( name );
- if ( name in thisCache ) {
- name = [ name ];
- } else {
- name = name.split(" ");
- }
- }
- } else {
- // If "name" is an array of keys...
- // When data is initially created, via ("key", "val") signature,
- // keys will be converted to camelCase.
- // Since there is no way to tell _how_ a key was added, remove
- // both plain key and camelCase key. #12786
- // This will only penalize the array argument path.
- name = name.concat( jQuery.map( name, jQuery.camelCase ) );
- }
-
- for ( i = 0, l = name.length; i < l; i++ ) {
- delete thisCache[ name[i] ];
- }
-
- // If there is no data left in the cache, we want to continue
- // and let the cache object itself get destroyed
- if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
- return;
- }
- }
- }
-
- // See jQuery.data for more information
- if ( !pvt ) {
- delete cache[ id ].data;
-
- // Don't destroy the parent cache unless the internal data object
- // had been the only thing left in it
- if ( !isEmptyDataObject( cache[ id ] ) ) {
- return;
- }
- }
-
- // Destroy the cache
- if ( isNode ) {
- jQuery.cleanData( [ elem ], true );
-
- // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
- } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
- delete cache[ id ];
-
- // When all else fails, null
- } else {
- cache[ id ] = null;
- }
+\tif ( !jQuery.acceptData( elem ) ) {
+\t\treturn;
+\t}
+
+\tvar i, l, thisCache,
+\t\tisNode = elem.nodeType,
+
+\t\t// See jQuery.data for more information
+\t\tcache = isNode ? jQuery.cache : elem,
+\t\tid = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+\t// If there is already no cache entry for this object, there is no
+\t// purpose in continuing
+\tif ( !cache[ id ] ) {
+\t\treturn;
+\t}
+
+\tif ( name ) {
+
+\t\tthisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+\t\tif ( thisCache ) {
+
+\t\t\t// Support array or space separated string names for data keys
+\t\t\tif ( !jQuery.isArray( name ) ) {
+
+\t\t\t\t// try the string as a key before any manipulation
+\t\t\t\tif ( name in thisCache ) {
+\t\t\t\t\tname = [ name ];
+\t\t\t\t} else {
+
+\t\t\t\t\t// split the camel cased version by spaces unless a key with the spaces exists
+\t\t\t\t\tname = jQuery.camelCase( name );
+\t\t\t\t\tif ( name in thisCache ) {
+\t\t\t\t\t\tname = [ name ];
+\t\t\t\t\t} else {
+\t\t\t\t\t\tname = name.split(" ");
+\t\t\t\t\t}
+\t\t\t\t}
+\t\t\t} else {
+\t\t\t\t// If "name" is an array of keys...
+\t\t\t\t// When data is initially created, via ("key", "val") signature,
+\t\t\t\t// keys will be converted to camelCase.
+\t\t\t\t// Since there is no way to tell _how_ a key was added, remove
+\t\t\t\t// both plain key and camelCase key. #12786
+\t\t\t\t// This will only penalize the array argument path.
+\t\t\t\tname = name.concat( jQuery.map( name, jQuery.camelCase ) );
+\t\t\t}
+
+\t\t\tfor ( i = 0, l = name.length; i < l; i++ ) {
+\t\t\t\tdelete thisCache[ name[i] ];
+\t\t\t}
+
+\t\t\t// If there is no data left in the cache, we want to continue
+\t\t\t// and let the cache object itself get destroyed
+\t\t\tif ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
+\t\t\t\treturn;
+\t\t\t}
+\t\t}
+\t}
+
+\t// See jQuery.data for more information
+\tif ( !pvt ) {
+\t\tdelete cache[ id ].data;
+
+\t\t// Don't destroy the parent cache unless the internal data object
+\t\t// had been the only thing left in it
+\t\tif ( !isEmptyDataObject( cache[ id ] ) ) {
+\t\t\treturn;
+\t\t}
+\t}
+
+\t// Destroy the cache
+\tif ( isNode ) {
+\t\tjQuery.cleanData( [ elem ], true );
+
+\t// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+\t} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
+\t\tdelete cache[ id ];
+
+\t// When all else fails, null
+\t} else {
+\t\tcache[ id ] = null;
+\t}
}
jQuery.extend({
- cache: {},
-
- // Unique for each copy of jQuery on the page
- // Non-digits removed to match rinlinejQuery
- expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
-
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- // Ban all objects except for Flash (which handle expandos)
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- "applet": true
- },
-
- hasData: function( elem ) {
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
- return !!elem && !isEmptyDataObject( elem );
- },
-
- data: function( elem, name, data ) {
- return internalData( elem, name, data );
- },
-
- removeData: function( elem, name ) {
- return internalRemoveData( elem, name );
- },
-
- // For internal use only.
- _data: function( elem, name, data ) {
- return internalData( elem, name, data, true );
- },
-
- _removeData: function( elem, name ) {
- return internalRemoveData( elem, name, true );
- },
-
- // A method for determining if a DOM node can handle the data expando
- acceptData: function( elem ) {
- // Do not set data on non-element because it will not be cleared (#8335).
- if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
- return false;
- }
-
- var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
-
- // nodes accept data unless otherwise specified; rejection can be conditional
- return !noData || noData !== true && elem.getAttribute("classid") === noData;
- }
+\tcache: {},
+
+\t// Unique for each copy of jQuery on the page
+\t// Non-digits removed to match rinlinejQuery
+\texpando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
+
+\t// The following elements throw uncatchable exceptions if you
+\t// attempt to add expando properties to them.
+\tnoData: {
+\t\t"embed": true,
+\t\t// Ban all objects except for Flash (which handle expandos)
+\t\t"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+\t\t"applet": true
+\t},
+
+\thasData: function( elem ) {
+\t\telem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+\t\treturn !!elem && !isEmptyDataObject( elem );
+\t},
+
+\tdata: function( elem, name, data ) {
+\t\treturn internalData( elem, name, data );
+\t},
+
+\tremoveData: function( elem, name ) {
+\t\treturn internalRemoveData( elem, name );
+\t},
+
+\t// For internal use only.
+\t_data: function( elem, name, data ) {
+\t\treturn internalData( elem, name, data, true );
+\t},
+
+\t_removeData: function( elem, name ) {
+\t\treturn internalRemoveData( elem, name, true );
+\t},
+
+\t// A method for determining if a DOM node can handle the data expando
+\tacceptData: function( elem ) {
+\t\t// Do not set data on non-element because it will not be cleared (#8335).
+\t\tif ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
+\t\t\treturn false;
+\t\t}
+
+\t\tvar noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+\t\t// nodes accept data unless otherwise specified; rejection can be conditional
+\t\treturn !noData || noData !== true && elem.getAttribute("classid") === noData;
+\t}
});
jQuery.fn.extend({
- data: function( key, value ) {
- var attrs, name,
- elem = this[0],
- i = 0,
- data = null;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = jQuery.data( elem );
-
- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
- attrs = elem.attributes;
- for ( ; i < attrs.length; i++ ) {
- name = attrs[i].name;
-
- if ( !name.indexOf( "data-" ) ) {
- name = jQuery.camelCase( name.slice(5) );
-
- dataAttr( elem, name, data[ name ] );
- }
- }
- jQuery._data( elem, "parsedAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each(function() {
- jQuery.data( this, key );
- });
- }
-
- return jQuery.access( this, function( value ) {
-
- if ( value === undefined ) {
- // Try to fetch any internally stored data first
- return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
- }
-
- this.each(function() {
- jQuery.data( this, key, value );
- });
- }, null, value, arguments.length > 1, null, true );
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
+\tdata: function( key, value ) {
+\t\tvar attrs, name,
+\t\t\telem = this[0],
+\t\t\ti = 0,
+\t\t\tdata = null;
+
+\t\t// Gets all values
+\t\tif ( key === undefined ) {
+\t\t\tif ( this.length ) {
+\t\t\t\tdata = jQuery.data( elem );
+
+\t\t\t\tif ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+\t\t\t\t\tattrs = elem.attributes;
+\t\t\t\t\tfor ( ; i < attrs.length; i++ ) {
+\t\t\t\t\t\tname = attrs[i].name;
+
+\t\t\t\t\t\tif ( !name.indexOf( "data-" ) ) {
+\t\t\t\t\t\t\tname = jQuery.camelCase( name.slice(5) );
+
+\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );
+\t\t\t\t\t\t}
+\t\t\t\t\t}
+\t\t\t\t\tjQuery._data( elem, "parsedAttrs", true );
+\t\t\t\t}
+\t\t\t}
+
+\t\t\treturn data;
+\t\t}
+
+\t\t// Sets multiple values
+\t\tif ( typeof key === "object" ) {
+\t\t\treturn this.each(function() {
+\t\t\t\tjQuery.data( this, key );
+\t\t\t});
+\t\t}
+
+\t\treturn jQuery.access( this, function( value ) {
+
+\t\t\tif ( value === undefined ) {
+\t\t\t\t// Try to fetch any internally stored data first
+\t\t\t\treturn elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
+\t\t\t}
+
+\t\t\tthis.each(function() {
+\t\t\t\tjQuery.data( this, key, value );
+\t\t\t});
+\t\t}, null, value, arguments.length > 1, null, true );
+\t},
+
+\tremoveData: function( key ) {
+\t\treturn this.each(function() {
+\t\t\tjQuery.removeData( this, key );
+\t\t});
+\t}
});
function dataAttr( elem, key, data ) {
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
-
- var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null :
- // Only convert to a number if it doesn't change the string
- +data + "" === data ? +data :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
- data;
- } catch( e ) {}
-
- // Make sure we set the data so it isn't changed later
- jQuery.data( elem, key, data );
-
- } else {
- data = undefined;
- }
- }
-
- return data;
+\t// If nothing was found internally, try to fetch any
+\t// data from the HTML5 data-* attribute
+\tif ( data === undefined && elem.nodeType === 1 ) {
+
+\t\tvar name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+\t\tdata = elem.getAttribute( name );
+
+\t\tif ( typeof data === "string" ) {
+\t\t\ttry {
+\t\t\t\tdata = data === "true" ? true :
+\t\t\t\t\tdata === "false" ? false :
+\t\t\t\t\tdata === "null" ? null :
+\t\t\t\t\t// Only convert to a number if it doesn't change the string
+\t\t\t\t\t+data + "" === data ? +data :
+\t\t\t\t\trbrace.test( data ) ? jQuery.parseJSON( data ) :
+\t\t\t\t\t\tdata;
+\t\t\t} catch( e ) {}
+
+\t\t\t// Make sure we set the data so it isn't changed later
+\t\t\tjQuery.data( elem, key, data );
+
+\t\t} else {
+\t\t\tdata = undefined;
+\t\t}
+\t}
+
+\treturn data;
}
// checks a cache object for emptiness
function isEmptyDataObject( obj ) {
- var name;
- for ( name in obj ) {
-
- // if the public data object is empty, the private is still empty
- if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
- continue;
- }
- if ( name !== "toJSON" ) {
- return false;
- }
- }
-
- return true;
+\tvar name;
+\tfor ( name in obj ) {
+
+\t\t// if the public data object is empty, the private is still empty
+\t\tif ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+\t\t\tcontinue;
+\t\t}
+\t\tif ( name !== "toJSON" ) {
+\t\t\treturn false;
+\t\t}
+\t}
+
+\treturn true;
}
jQuery.extend({
- queue: function( elem, type, data ) {
- var queue;
-
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- queue = jQuery._data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !queue || jQuery.isArray(data) ) {
- queue = jQuery._data( elem, type, jQuery.makeArray(data) );
- } else {
- queue.push( data );
- }
- }
- return queue || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- startLength = queue.length,
- fn = queue.shift(),
- hooks = jQuery._queueHooks( elem, type ),
- next = function() {
- jQuery.dequeue( elem, type );
- };
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- startLength--;
- }
-
- hooks.cur = fn;
- if ( fn ) {
-
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- // clear up the last queue stop function
- delete hooks.stop;
- fn.call( elem, next, hooks );
- }
-
- if ( !startLength && hooks ) {
- hooks.empty.fire();
- }
- },
-
- // not intended for public consumption - generates a queueHooks object, or returns the current one
- _queueHooks: function( elem, type ) {
- var key = type + "queueHooks";
- return jQuery._data( elem, key ) || jQuery._data( elem, key, {
- empty: jQuery.Callbacks("once memory").add(function() {
- jQuery._removeData( elem, type + "queue" );
- jQuery._removeData( elem, key );
- })
- });
- }
+\tqueue: function( elem, type, data ) {
+\t\tvar queue;
+
+\t\tif ( elem ) {
+\t\t\ttype = ( type || "fx" ) + "queue";
+\t\t\tqueue = jQuery._data( elem, type );
+
+\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup
+\t\t\tif ( data ) {
+\t\t\t\tif ( !queue || jQuery.isArray(data) ) {
+\t\t\t\t\tqueue = jQuery._data( elem, type, jQuery.makeArray(data) );
+\t\t\t\t} else {
+\t\t\t\t\tqueue.push( data );
+\t\t\t\t}
+\t\t\t}
+\t\t\treturn queue || [];
+\t\t}
+\t},
+
+\tdequeue: function( elem, type ) {
+\t\ttype = type || "fx";
+
+\t\tvar queue = jQuery.queue( elem, type ),
+\t\t\tstartLength = queue.length,
+\t\t\tfn = queue.shift(),
+\t\t\thooks = jQuery._queueHooks( elem, type ),
+\t\t\tnext = function() {
+\t\t\t\tjQuery.dequeue( elem, type );
+\t\t\t};
+
+\t\t// If the fx queue is dequeued, always remove the progress sentinel
+\t\tif ( fn === "inprogress" ) {
+\t\t\tfn = queue.shift();
+\t\t\tstartLength--;
+\t\t}
+
+\t\thooks.cur = fn;
+\t\tif ( fn ) {
+
+\t\t\t// Add a progress sentinel to prevent the fx queue from being
+\t\t\t// automatically dequeued
+\t\t\tif ( type === "fx" ) {
+\t\t\t\tqueue.unshift( "inprogress" );
+\t\t\t}
+
+\t\t\t// clear up the last queue stop function
+\t\t\tdelete hooks.stop;
+\t\t\tfn.call( elem, next, hooks );
+\t\t}
+
+\t\tif ( !startLength && hooks ) {
+\t\t\thooks.empty.fire();
+\t\t}
+\t},
+
+\t// not intended for public consumption - generates a queueHooks object, or returns the current one
+\t_queueHooks: function( elem, type ) {
+\t\tvar key = type + "queueHooks";
+\t\treturn jQuery._data( elem, key ) || jQuery._data( elem, key, {
+\t\t\tempty: jQuery.Callbacks("once memory").add(function() {
+\t\t\t\tjQuery._removeData( elem, type + "queue" );
+\t\t\t\tjQuery._removeData( elem, key );
+\t\t\t})
+\t\t});
+\t}
});
jQuery.fn.extend({
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[0], type );
- }
-
- return data === undefined ?
- this :
- this.each(function() {
- var queue = jQuery.queue( this, type, data );
-
- // ensure a hooks for this queue
- jQuery._queueHooks( this, type );
-
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- dequeue: function( type ) {
- return this.each(function() {
- jQuery.dequeue( this, type );
- });
- },
- // Based off of the plugin by Clint Helfers, with permission.
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
- delay: function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = setTimeout( next, time );
- hooks.stop = function() {
- clearTimeout( timeout );
- };
- });
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, obj ) {
- var tmp,
- count = 1,
- defer = jQuery.Deferred(),
- elements = this,
- i = this.length,
- resolve = function() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- };
-
- if ( typeof type !== "string" ) {
- obj = type;
- type = undefined;
- }
- type = type || "fx";
-
- while( i-- ) {
- tmp = jQuery._data( elements[ i ], type + "queueHooks" );
- if ( tmp && tmp.empty ) {
- count++;
- tmp.empty.add( resolve );
- }
- }
- resolve();
- return defer.promise( obj );
- }
+\tqueue: function( type, data ) {
+\t\tvar setter = 2;
+
+\t\tif ( typeof type !== "string" ) {
+\t\t\tdata = type;
+\t\t\ttype = "fx";
+\t\t\tsetter--;
+\t\t}
+
+\t\tif ( arguments.length < setter ) {
+\t\t\treturn jQuery.queue( this[0], type );
+\t\t}
+
+\t\treturn data === undefined ?
+\t\t\tthis :
+\t\t\tthis.each(function() {
+\t\t\t\tvar queue = jQuery.queue( this, type, data );
+
+\t\t\t\t// ensure a hooks for this queue
+\t\t\t\tjQuery._queueHooks( this, type );
+
+\t\t\t\tif ( type === "fx" && queue[0] !== "inprogress" ) {
+\t\t\t\t\tjQuery.dequeue( this, type );
+\t\t\t\t}
+\t\t\t});
+\t},
+\tdequeue: function( type ) {
+\t\treturn this.each(function() {
+\t\t\tjQuery.dequeue( this, type );
+\t\t});
+\t},
+\t// Based off of the plugin by Clint Helfers, with permission.
+\t// http://blindsignals.com/index.php/2009/07/jquery-delay/
+\tdelay: function( time, type ) {
+\t\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+\t\ttype = type || "fx";
+
+\t\treturn this.queue( type, function( next, hooks ) {
+\t\t\tvar timeout = setTimeout( next, time );
+\t\t\thooks.stop = function() {
+\t\t\t\tclearTimeout( timeout );
+\t\t\t};
+\t\t});
+\t},
+\tclearQueue: function( type ) {
+\t\treturn this.queue( type || "fx", [] );
+\t},
+\t// Get a promise resolved when queues of a certain type
+\t// are emptied (fx is the type by default)
+\tpromise: function( type, obj ) {
+\t\tvar tmp,
+\t\t\tcount = 1,
+\t\t\tdefer = jQuery.Deferred(),
+\t\t\telements = this,
+\t\t\ti = this.length,
+\t\t\tresolve = function() {
+\t\t\t\tif ( !( --count ) ) {
+\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );
+\t\t\t\t}
+\t\t\t};
+
+\t\tif ( typeof type !== "string" ) {
+\t\t\tobj = type;
+\t\t\ttype = undefined;
+\t\t}
+\t\ttype = type || "fx";
+
+\t\twhile( i-- ) {
+\t\t\ttmp = jQuery._data( elements[ i ], type + "queueHooks" );
+\t\t\tif ( tmp && tmp.empty ) {
+\t\t\t\tcount++;
+\t\t\t\ttmp.empty.add( resolve );
+\t\t\t}
+\t\t}
+\t\tresolve();
+\t\treturn defer.promise( obj );
+\t}
});
var nodeHook, boolHook,
- rclass = /[\t\r\n]/g,
- rreturn = /\r/g,
- rfocusable = /^(?:input|select|textarea|button|object)$/i,
- rclickable = /^(?:a|area)$/i,
- rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
- ruseDefault = /^(?:checked|selected)$/i,
- getSetAttribute = jQuery.support.getSetAttribute,
- getSetInput = jQuery.support.input;
+\trclass = /[\t\r\n]/g,
+\trreturn = /\r/g,
+\trfocusable = /^(?:input|select|textarea|button|object)$/i,
+\trclickable = /^(?:a|area)$/i,
+\trboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
+\truseDefault = /^(?:checked|selected)$/i,
+\tgetSetAttribute = jQuery.support.getSetAttribute,
+\tgetSetInput = jQuery.support.input;
jQuery.fn.extend({
- attr: function( name, value ) {
- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each(function() {
- jQuery.removeAttr( this, name );
- });
- },
-
- prop: function( name, value ) {
- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- name = jQuery.propFix[ name ] || name;
- return this.each(function() {
- // try/catch handles cases where IE balks (such as removing a property on window)
- try {
- this[ name ] = undefined;
- delete this[ name ];
- } catch( e ) {}
- });
- },
-
- addClass: function( value ) {
- var classes, elem, cur, clazz, j,
- i = 0,
- len = this.length,
- proceed = typeof value === "string" && value;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).addClass( value.call( this, j, this.className ) );
- });
- }
-
- if ( proceed ) {
- // The disjunction here is for better compressibility (see removeClass)
- classes = ( value || "" ).match( core_rnotwhite ) || [];
-
- for ( ; i < len; i++ ) {
- elem = this[ i ];
- cur = elem.nodeType === 1 && ( elem.className ?
- ( " " + elem.className + " " ).replace( rclass, " " ) :
- " "
- );
-
- if ( cur ) {
- j = 0;
- while ( (clazz = classes[j++]) ) {
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
- cur += clazz + " ";
- }
- }
- elem.className = jQuery.trim( cur );
-
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var classes, elem, cur, clazz, j,
- i = 0,
- len = this.length,
- proceed = arguments.length === 0 || typeof value === "string" && value;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).removeClass( value.call( this, j, this.className ) );
- });
- }
- if ( proceed ) {
- classes = ( value || "" ).match( core_rnotwhite ) || [];
-
- for ( ; i < len; i++ ) {
- elem = this[ i ];
- // This expression is here for better compressibility (see addClass)
- cur = elem.nodeType === 1 && ( elem.className ?
- ( " " + elem.className + " " ).replace( rclass, " " ) :
- ""
- );
-
- if ( cur ) {
- j = 0;
- while ( (clazz = classes[j++]) ) {
- // Remove *all* instances
- while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
- cur = cur.replace( " " + clazz + " ", " " );
- }
- }
- elem.className = value ? jQuery.trim( cur ) : "";
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value,
- isBool = typeof stateVal === "boolean";
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( i ) {
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className,
- i = 0,
- self = jQuery( this ),
- state = stateVal,
- classNames = value.match( core_rnotwhite ) || [];
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space separated list
- state = isBool ? state : !self.hasClass( className );
- self[ state ? "addClass" : "removeClass" ]( className );
- }
-
- // Toggle whole class name
- } else if ( type === core_strundefined || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- jQuery._data( this, "__className__", this.className );
- }
-
- // If the element has a class name or if we're passed "false",
- // then remove the whole classname (if there was one, the above saved it).
- // Otherwise bring back whatever was previously saved (if anything),
- // falling back to the empty string if nothing was stored.
- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
- return true;
- }
- }
-
- return false;
- },
-
- val: function( value ) {
- var ret, hooks, isFunction,
- elem = this[0];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
- return ret;
- }
-
- ret = elem.value;
-
- return typeof ret === "string" ?
- // handle most common string cases
- ret.replace(rreturn, "") :
- // handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
-
- return;
- }
-
- isFunction = jQuery.isFunction( value );
-
- return this.each(function( i ) {
- var val,
- self = jQuery(this);
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call( this, i, self.val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
- } else if ( typeof val === "number" ) {
- val += "";
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map(val, function ( value ) {
- return value == null ? "" : value + "";
- });
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- });
- }
+\tattr: function( name, value ) {
+\t\treturn jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+\t},
+
+\tremoveAttr: function( name ) {
+\t\treturn this.each(function() {
+\t\t\tjQuery.removeAttr( this, name );
+\t\t});
+\t},
+
+\tprop: function( name, value ) {
+\t\treturn jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+\t},
+
+\tremoveProp: function( name ) {
+\t\tname = jQuery.propFix[ name ] || name;
+\t\treturn this.each(function() {
+\t\t\t// try/catch handles cases where IE balks (such as removing a property on window)
+\t\t\ttry {
+\t\t\t\tthis[ name ] = undefined;
+\t\t\t\tdelete this[ name ];
+\t\t\t} catch( e ) {}
+\t\t});
+\t},
+
+\taddClass: function( value ) {
+\t\tvar classes, elem, cur, clazz, j,
+\t\t\ti = 0,
+\t\t\tlen = this.length,
+\t\t\tproceed = typeof value === "string" && value;
+
+\t\tif ( jQuery.isFunction( value ) ) {
+\t\t\treturn this.each(function( j ) {
+\t\t\t\tjQuery( this ).addClass( value.call( this, j, this.className ) );
+\t\t\t});
+\t\t}
+
+\t\tif ( proceed ) {
+\t\t\t// The disjunction here is for better compressibility (see removeClass)
+\t\t\tclasses = ( value || "" ).match( core_rnotwhite ) || [];
+
+\t\t\tfor ( ; i < len; i++ ) {
+\t\t\t\telem = this[ i ];
+\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?
+\t\t\t\t\t( " " + elem.className + " " ).replace( rclass, " " ) :
+\t\t\t\t\t" "
+\t\t\t\t);
+
+\t\t\t\tif ( cur ) {
+\t\t\t\t\tj = 0;
+\t\t\t\t\twhile ( (clazz = classes[j++]) ) {
+\t\t\t\t\t\tif ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+\t\t\t\t\t\t\tcur += clazz + " ";
+\t\t\t\t\t\t}
+\t\t\t\t\t}
+\t\t\t\t\telem.className = jQuery.trim( cur );
+
+\t\t\t\t}
+\t\t\t}
+\t\t}
+
+\t\treturn this;
+\t},
+
+\tremoveClass: function( value ) {
+\t\tvar classes, elem, cur, clazz, j,
+\t\t\ti = 0,
+\t\t\tlen = this.length,
+\t\t\tproceed = arguments.length === 0 || typeof value === "string" && value;
+
+\t\tif ( jQuery.isFunction( value ) ) {
+\t\t\treturn this.each(function( j ) {
+\t\t\t\tjQuery( this ).removeClass( value.call( this, j, this.className ) );
+\t\t\t});
+\t\t}
+\t\tif ( proceed ) {
+\t\t\tclasses = ( value || "" ).match( core_rnotwhite ) || [];
+
+\t\t\tfor ( ; i < len; i++ ) {
+\t\t\t\telem = this[ i ];
+\t\t\t\t// This expression is here for better compressibility (see addClass)
+\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?
+\t\t\t\t\t( " " + elem.className + " " ).replace( rclass, " " ) :
+\t\t\t\t\t""
+\t\t\t\t);
+
+\t\t\t\tif ( cur ) {
+\t\t\t\t\tj = 0;
+\t\t\t\t\twhile ( (clazz = classes[j++]) ) {
+\t\t\t\t\t\t// Remove *all* instances
+\t\t\t\t\t\twhile ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+\t\t\t\t\t\t\tcur = cur.replace( " " + clazz + " ", " " );
+\t\t\t\t\t\t}
+\t\t\t\t\t}
+\t\t\t\t\telem.className = value ? jQuery.trim( cur ) : "";
+\t\t\t\t}
+\t\t\t}
+\t\t}
+
+\t\treturn this;
+\t},
+
+\ttoggleClass: function( value, stateVal ) {
+\t\tvar type = typeof value,
+\t\t\tisBool = typeof stateVal === "boolean";
+
+\t\tif ( jQuery.isFunction( value ) ) {
+\t\t\treturn this.each(function( i ) {
+\t\t\t\tjQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+\t\t\t});
+\t\t}
+
+\t\treturn this.each(function() {
+\t\t\tif ( type === "string" ) {
+\t\t\t\t// toggle individual class names
+\t\t\t\tvar className,
+\t\t\t\t\ti = 0,
+\t\t\t\t\tself = jQuery( this ),
+\t\t\t\t\tstate = stateVal,
+\t\t\t\t\tclassNames = value.match( core_rnotwhite ) || [];
+
+\t\t\t\twhile ( (className = classNames[ i++ ]) ) {
+\t\t\t\t\t// check each className given, space separated list
+\t\t\t\t\tstate = isBool ? state : !self.hasClass( className );
+\t\t\t\t\tself[ state ? "addClass" : "removeClass" ]( className );
+\t\t\t\t}
+
+\t\t\t// Toggle whole class name
+\t\t\t} else if ( type === core_strundefined || type === "boolean" ) {
+\t\t\t\tif ( this.className ) {
+\t\t\t\t\t// store className if set
+\t\t\t\t\tjQuery._data( this, "__className__", this.className );
+\t\t\t\t}
+
+\t\t\t\t// If the element has a class name or if we're passed "false",
+\t\t\t\t// then remove the whole classname (if there was one, the above saved it).
+\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),
+\t\t\t\t// falling back to the empty string if nothing was stored.
+\t\t\t\tthis.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+\t\t\t}
+\t\t});
+\t},
+
+\thasClass: function( selector ) {
+\t\tvar className = " " + selector + " ",
+\t\t\ti = 0,
+\t\t\tl = this.length;
+\t\tfor ( ; i < l; i++ ) {
+\t\t\tif ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+\t\t\t\treturn true;
+\t\t\t}
+\t\t}
+
+\t\treturn false;
+\t},
+
+\tval: function( value ) {
+\t\tvar ret, hooks, isFunction,
+\t\t\telem = this[0];
+
+\t\tif ( !arguments.length ) {
+\t\t\tif ( elem ) {
+\t\t\t\thooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+\t\t\t\tif ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+\t\t\t\t\treturn ret;
+\t\t\t\t}
+
+\t\t\t\tret = elem.value;
+
+\t\t\t\treturn typeof ret === "string" ?
+\t\t\t\t\t// handle most common string cases
+\t\t\t\t\tret.replace(rreturn, "") :
+\t\t\t\t\t// handle cases where value is null/undef or number
+\t\t\t\t\tret == null ? "" : ret;
+\t\t\t}
+
+\t\t\treturn;
+\t\t}
+
+\t\tisFunction = jQuery.isFunction( value );
+
+\t\treturn this.each(function( i ) {
+\t\t\tvar val,
+\t\t\t\tself = jQuery(this);
+
+\t\t\tif ( this.nodeType !== 1 ) {
+\t\t\t\treturn;
+\t\t\t}
+
+\t\t\tif ( isFunction ) {
+\t\t\t\tval = value.call( this, i, self.val() );
+\t\t\t} else {
+\t\t\t\tval = value;
+\t\t\t}
+
+\t\t\t// Treat null/undefined as ""; convert numbers to string
+\t\t\tif ( val == null ) {
+\t\t\t\tval = "";
+\t\t\t} else if ( typeof val === "number" ) {
+\t\t\t\tval += "";
+\t\t\t} else if ( jQuery.isArray( val ) ) {
+\t\t\t\tval = jQuery.map(val, function ( value ) {
+\t\t\t\t\treturn value == null ? "" : value + "";
+\t\t\t\t});
+\t\t\t}
+
+\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+\t\t\t// If set returns undefined, fall back to normal setting
+\t\t\tif ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+\t\t\t\tthis.value = val;
+\t\t\t}
+\t\t});
+\t}
});
jQuery.extend({
- valHooks: {
- option: {
- get: function( elem ) {
- // attributes.value is undefined in Blackberry 4.7 but
- // uses .value. See #6932
- var val = elem.attributes.value;
- return !val || val.specified ? elem.value : elem.text;
- }
- },
- select: {
- get: function( elem ) {
- var value, option,
- options = elem.options,
- index = elem.selectedIndex,
- one = elem.type === "select-one" || index < 0,
- values = one ? null : [],
- max = one ? index + 1 : options.length,
- i = index < 0 ?
- max :
- one ? index : 0;
-
- // Loop through all the selected options
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // oldIE doesn't update selected after form reset (#2551)
- if ( ( option.selected || i === index ) &&
- // Don't return options that are disabled or in a disabled optgroup
- ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
- ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var values = jQuery.makeArray( value );
-
- jQuery(elem).find("option").each(function() {
- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
- });
-
- if ( !values.length ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- },
-
- attr: function( elem, name, value ) {
- var hooks, notxml, ret,
- nType = elem.nodeType;
-
- // don't get/set attributes on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === core_strundefined ) {
- return jQuery.prop( elem, name, value );
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- // All attributes are lowercase
- // Grab necessary hook if one is defined
- if ( notxml ) {
- name = name.toLowerCase();
- hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
- }
-
- if ( value !== undefined ) {
-
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
-
- } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- elem.setAttribute( name, value + "" );
- return value;
- }
-
- } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
-
- // In IE9+, Flash objects don't have .getAttribute (#12945)
- // Support: IE9+
- if ( typeof elem.getAttribute !== core_strundefined ) {
- ret = elem.getAttribute( name );
- }
-
- // Non-existent attributes return null, we normalize to undefined
- return ret == null ?
- undefined :
- ret;
- }
- },
-
- removeAttr: function( elem, value ) {
- var name, propName,
- i = 0,
- attrNames = value && value.match( core_rnotwhite );
-
- if ( attrNames && elem.nodeType === 1 ) {
- while ( (name = attrNames[i++]) ) {
- propName = jQuery.propFix[ name ] || name;
-
- // Boolean attributes get special treatment (#10870)
- if ( rboolean.test( name ) ) {
- // Set corresponding property to false for boolean attributes
- // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
- if ( !getSetAttribute && ruseDefault.test( name ) ) {
- elem[ jQuery.camelCase( "default-" + name ) ] =
- elem[ propName ] = false;
- } else {
- elem[ propName ] = false;
- }
-
- // See #9699 for explanation of this approach (setting first, then removal)
- } else {
- jQuery.attr( elem, name, "" );
- }
-
- elem.removeAttribute( getSetAttribute ? name : propName );
- }
- }
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
- // Setting the type on a radio button after the value resets the value in IE6-9
- // Reset value to default in case type is set after value during creation
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- },
-
- propFix: {
- tabindex: "tabIndex",
- readonly: "readOnly",
- "for": "htmlFor",
- "class": "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- },
-
- prop: function( elem, name, value ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set properties on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- if ( notxml ) {
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- return ( elem[ name ] = value );
- }
-
- } else {
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
- return elem[ name ];
- }
- }
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- var attributeNode = elem.getAttributeNode("tabindex");
-
- return attributeNode && attributeNode.specified ?
- parseInt( attributeNode.value, 10 ) :
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
- 0 :
- undefined;
- }
- }
- }
+\tvalHooks: {
+\t\toption: {
+\t\t\tget: function( elem ) {
+\t\t\t\t// attributes.value is undefined in Blackberry 4.7 but
+\t\t\t\t// uses .value. See #6932
+\t\t\t\tvar val = elem.attributes.value;
+\t\t\t\treturn !val || val.specified ? elem.value : elem.text;
+\t\t\t}
+\t\t},
+\t\tselect: {
+\t\t\tget: function( elem ) {
+\t\t\t\tvar value, option,
+\t\t\t\t\toptions = elem.options,
+\t\t\t\t\tindex = elem.selectedIndex,
+\t\t\t\t\tone = elem.type === "select-one" || index < 0,
+\t\t\t\t\tvalues = one ? null : [],
+\t\t\t\t\tmax = one ? index + 1 : options.length,
+\t\t\t\t\ti = index < 0 ?
+\t\t\t\t\t\tmax :
+\t\t\t\t\t\tone ? index : 0;
+
+\t\t\t\t// Loop through all the selected options
+\t\t\t\tfor ( ; i < max; i++ ) {
+\t\t\t\t\toption = options[ i ];
+
+\t\t\t\t\t// oldIE doesn't update selected after form reset (#2551)
+\t\t\t\t\tif ( ( option.selected || i === index ) &&
+\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup
+\t\t\t\t\t\t\t( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+\t\t\t\t\t\t\t( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+\t\t\t\t\t\t// Get the specific value for the option
+\t\t\t\t\t\tvalue = jQuery( option ).val();
+
+\t\t\t\t\t\t// We don't need an array for one selects
+\t\t\t\t\t\tif ( one ) {
+\t\t\t\t\t\t\treturn value;
+\t\t\t\t\t\t}
+
+\t\t\t\t\t\t// Multi-Selects return an array
+\t\t\t\t\t\tvalues.push( value );
+\t\t\t\t\t}
+\t\t\t\t}
+
+\t\t\t\treturn values;
+\t\t\t},
+
+\t\t\tset: function( elem, value ) {
+\t\t\t\tvar values = jQuery.makeArray( value );
+
+\t\t\t\tjQuery(elem).find("option").each(function() {
+\t\t\t\t\tthis.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+\t\t\t\t});
+
+\t\t\t\tif ( !values.length ) {
+\t\t\t\t\telem.selectedIndex = -1;
+\t\t\t\t}
+\t\t\t\treturn values;
+\t\t\t}
+\t\t}
+\t},
+
+\tattr: function( elem, name, value ) {
+\t\tvar hooks, notxml, ret,
+\t\t\tnType = elem.nodeType;
+
+\t\t// don't get/set attributes on text, comment and attribute nodes
+\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+\t\t\treturn;
+\t\t}
+
+\t\t// Fallback to prop when attributes are not supported
+\t\tif ( typeof elem.getAttribute === core_strundefined ) {
+\t\t\treturn jQuery.prop( elem, name, value );
+\t\t}
+
+\t\tnotxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+\t\t// All attributes are lowercase
+\t\t// Grab necessary hook if one is defined
+\t\tif ( notxml ) {
+\t\t\tname = name.toLowerCase();
+\t\t\thooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
+\t\t}
+
+\t\tif ( value !== undefined ) {
+
+\t\t\tif ( value === null ) {
+\t\t\t\tjQuery.removeAttr( elem, name );
+
+\t\t\t} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+\t\t\t\treturn ret;
+
+\t\t\t} else {
+\t\t\t\telem.setAttribute( name, value + "" );
+\t\t\t\treturn value;
+\t\t\t}
+
+\t\t} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+\t\t\treturn ret;
+
+\t\t} else {
+
+\t\t\t// In IE9+, Flash objects don't have .getAttribute (#12945)
+\t\t\t// Support: IE9+
+\t\t\tif ( typeof elem.getAttribute !== core_strundefined ) {
+\t\t\t\tret = elem.getAttribute( name );
+\t\t\t}
+
+\t\t\t// Non-existent attributes return null, we normalize to undefined
+\t\t\treturn ret == null ?
+\t\t\t\tundefined :
+\t\t\t\tret;
+\t\t}
+\t},
+
+\tremoveAttr: function( elem, value ) {
+\t\tvar name, propName,
+\t\t\ti = 0,
+\t\t\tattrNames = value && value.match( core_rnotwhite );
+
+\t\tif ( attrNames && elem.nodeType === 1 ) {
+\t\t\twhile ( (name = attrNames[i++]) ) {
+\t\t\t\tpropName = jQuery.propFix[ name ] || name;
+
+\t\t\t\t// Boolean attributes get special treatment (#10870)
+\t\t\t\tif ( rboolean.test( name ) ) {
+\t\t\t\t\t// Set corresponding property to false for boolean attributes
+\t\t\t\t\t// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
+\t\t\t\t\tif ( !getSetAttribute && ruseDefault.test( name ) ) {
+\t\t\t\t\t\telem[ jQuery.camelCase( "default-" + name ) ] =
+\t\t\t\t\t\t\telem[ propName ] = false;
+\t\t\t\t\t} else {
+\t\t\t\t\t\telem[ propName ] = false;
+\t\t\t\t\t}
+
+\t\t\t\t// See #9699 for explanation of this approach (setting first, then removal)
+\t\t\t\t} else {
+\t\t\t\t\tjQuery.attr( elem, name, "" );
+\t\t\t\t}
+
+\t\t\t\telem.removeAttribute( getSetAttribute ? name : propName );
+\t\t\t}
+\t\t}
+\t},
+
+\tattrHooks: {
+\t\ttype: {
+\t\t\tset: function( elem, value ) {
+\t\t\t\tif ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+\t\t\t\t\t// Setting the type on a radio button after the value resets the value in IE6-9
+\t\t\t\t\t// Reset value to default in case type is set after value during creation
+\t\t\t\t\tvar val = elem.value;
+\t\t\t\t\telem.setAttribute( "type", value );
+\t\t\t\t\tif ( val ) {
+\t\t\t\t\t\telem.value = val;
+\t\t\t\t\t}
+\t\t\t\t\treturn value;
+\t\t\t\t}
+\t\t\t}
+\t\t}
+\t},
+
+\tpropFix: {
+\t\ttabindex: "tabIndex",
+\t\treadonly: "readOnly",
+\t\t"for": "htmlFor",
+\t\t"class": "className",
+\t\tmaxlength: "maxLength",
+\t\tcellspacing: "cellSpacing",
+\t\tcellpadding: "cellPadding",
+\t\trowspan: "rowSpan",
+\t\tcolspan: "colSpan",
+\t\tusemap: "useMap",
+\t\tframeborder: "frameBorder",
+\t\tcontenteditable: "contentEditable"
+\t},
+
+\tprop: function( elem, name, value ) {
+\t\tvar ret, hooks, notxml,
+\t\t\tnType = elem.nodeType;
+
+\t\t// don't get/set properties on text, comment and attribute nodes
+\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+\t\t\treturn;
+\t\t}
+
+\t\tnotxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+\t\tif ( notxml ) {
+\t\t\t// Fix name and attach hooks
+\t\t\tname = jQuery.propFix[ name ] || name;
+\t\t\thooks = jQuery.propHooks[ name ];
+\t\t}
+
+\t\tif ( value !== undefined ) {
+\t\t\tif ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+\t\t\t\treturn ret;
+
+\t\t\t} else {
+\t\t\t\treturn ( elem[ name ] = value );
+\t\t\t}
+
+\t\t} else {
+\t\t\tif ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+\t\t\t\treturn ret;
+
+\t\t\t} else {
+\t\t\t\treturn elem[ name ];
+\t\t\t}
+\t\t}
+\t},
+
+\tpropHooks: {
+\t\ttabIndex: {
+\t\t\tget: function( elem ) {
+\t\t\t\t// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+\t\t\t\t// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+\t\t\t\tvar attributeNode = elem.getAttributeNode("tabindex");
+
+\t\t\t\treturn attributeNode && attributeNode.specified ?
+\t\t\t\t\tparseInt( attributeNode.value, 10 ) :
+\t\t\t\t\trfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+\t\t\t\t\t\t0 :
+\t\t\t\t\t\tundefined;
+\t\t\t}
+\t\t}
+\t}
});
// Hook for boolean attributes
boolHook = {
- get: function( elem, name ) {
- var
- // Use .prop to determine if this attribute is understood as boolean
- prop = jQuery.prop( elem, name ),
-
- // Fetch it accordingly
- attr = typeof prop === "boolean" && elem.getAttribute( name ),
- detail = typeof prop === "boolean" ?
-
- getSetInput && getSetAttribute ?
- attr != null :
- // oldIE fabricates an empty string for missing boolean attributes
- // and conflates checked/selected into attroperties
- ruseDefault.test( name ) ?
- elem[ jQuery.camelCase( "default-" + name ) ] :
- !!attr :
-
- // fetch an attribute node for properties not recognized as boolean
- elem.getAttributeNode( name );
-
- return detail && detail.value !== false ?
- name.toLowerCase() :
- undefined;
- },
- set: function( elem, value, name ) {
- if ( value === false ) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
- // IE<8 needs the *property* name
- elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
-
- // Use defaultChecked and defaultSelected for oldIE
- } else {
- elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
- }
-
- return name;
- }
+\tget: function( elem, name ) {
+\t\tvar
+\t\t\t// Use .prop to determine if this attribute is understood as boolean
+\t\t\tprop = jQuery.prop( elem, name ),
+
+\t\t\t// Fetch it accordingly
+\t\t\tattr = typeof prop === "boolean" && elem.getAttribute( name ),
+\t\t\tdetail = typeof prop === "boolean" ?
+
+\t\t\t\tgetSetInput && getSetAttribute ?
+\t\t\t\t\tattr != null :
+\t\t\t\t\t// oldIE fabricates an empty string for missing boolean attributes
+\t\t\t\t\t// and conflates checked/selected into attroperties
+\t\t\t\t\truseDefault.test( name ) ?
+\t\t\t\t\t\telem[ jQuery.camelCase( "default-" + name ) ] :
+\t\t\t\t\t\t!!attr :
+
+\t\t\t\t// fetch an attribute node for properties not recognized as boolean
+\t\t\t\telem.getAttributeNode( name );
+
+\t\treturn detail && detail.value !== false ?
+\t\t\tname.toLowerCase() :
+\t\t\tundefined;
+\t},
+\tset: function( elem, value, name ) {
+\t\tif ( value === false ) {
+\t\t\t// Remove boolean attributes when set to false
+\t\t\tjQuery.removeAttr( elem, name );
+\t\t} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+\t\t\t// IE<8 needs the *property* name
+\t\t\telem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+\t\t// Use defaultChecked and defaultSelected for oldIE
+\t\t} else {
+\t\t\telem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+\t\t}
+
+\t\treturn name;
+\t}
};
// fix oldIE value attroperty
if ( !getSetInput || !getSetAttribute ) {
- jQuery.attrHooks.value = {
- get: function( elem, name ) {
- var ret = elem.getAttributeNode( name );
- return jQuery.nodeName( elem, "input" ) ?
-
- // Ignore the value *property* by using defaultValue
- elem.defaultValue :
-
- ret && ret.specified ? ret.value : undefined;
- },
- set: function( elem, value, name ) {
- if ( jQuery.nodeName( elem, "input" ) ) {
- // Does not return so that setAttribute is also used
- elem.defaultValue = value;
- } else {
- // Use nodeHook if defined (#1954); otherwise setAttribute is fine
- return nodeHook && nodeHook.set( elem, value, name );
- }
- }
- };
+\tjQuery.attrHooks.value = {
+\t\tget: function( elem, name ) {
+\t\t\tvar ret = elem.getAttributeNode( name );
+\t\t\treturn jQuery.nodeName( elem, "input" ) ?
+
+\t\t\t\t// Ignore the value *property* by using defaultValue
+\t\t\t\telem.defaultValue :
+
+\t\t\t\tret && ret.specified ? ret.value : undefined;
+\t\t},
+\t\tset: function( elem, value, name ) {
+\t\t\tif ( jQuery.nodeName( elem, "input" ) ) {
+\t\t\t\t// Does not return so that setAttribute is also used
+\t\t\t\telem.defaultValue = value;
+\t\t\t} else {
+\t\t\t\t// Use nodeHook if defined (#1954); otherwise setAttribute is fine
+\t\t\t\treturn nodeHook && nodeHook.set( elem, value, name );
+\t\t\t}
+\t\t}
+\t};
}
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
- // Use this for any attribute in IE6/7
- // This fixes almost every IE6/7 issue
- nodeHook = jQuery.valHooks.button = {
- get: function( elem, name ) {
- var ret = elem.getAttributeNode( name );
- return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
- ret.value :
- undefined;
- },
- set: function( elem, value, name ) {
- // Set the existing or create a new attribute node
- var ret = elem.getAttributeNode( name );
- if ( !ret ) {
- elem.setAttributeNode(
- (ret = elem.ownerDocument.createAttribute( name ))
- );
- }
-
- ret.value = value += "";
-
- // Break association with cloned elements by also using setAttribute (#9646)
- return name === "value" || value === elem.getAttribute( name ) ?
- value :
- undefined;
- }
- };
-
- // Set contenteditable to false on removals(#10429)
- // Setting to empty string throws an error as an invalid value
- jQuery.attrHooks.contenteditable = {
- get: nodeHook.get,
- set: function( elem, value, name ) {
- nodeHook.set( elem, value === "" ? false : value, name );
- }
- };
-
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
- // This is for removals
- jQuery.each([ "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- set: function( elem, value ) {
- if ( value === "" ) {
- elem.setAttribute( name, "auto" );
- return value;
- }
- }
- });
- });
+\t// Use this for any attribute in IE6/7
+\t// This fixes almost every IE6/7 issue
+\tnodeHook = jQuery.valHooks.button = {
+\t\tget: function( elem, name ) {
+\t\t\tvar ret = elem.getAttributeNode( name );
+\t\t\treturn ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
+\t\t\t\tret.value :
+\t\t\t\tundefined;
+\t\t},
+\t\tset: function( elem, value, name ) {
+\t\t\t// Set the existing or create a new attribute node
+\t\t\tvar ret = elem.getAttributeNode( name );
+\t\t\tif ( !ret ) {
+\t\t\t\telem.setAttributeNode(
+\t\t\t\t\t(ret = elem.ownerDocument.createAttribute( name ))
+\t\t\t\t);
+\t\t\t}
+
+\t\t\tret.value = value += "";
+
+\t\t\t// Break association with cloned elements by also using setAttribute (#9646)
+\t\t\treturn name === "value" || value === elem.getAttribute( name ) ?
+\t\t\t\tvalue :
+\t\t\t\tundefined;
+\t\t}
+\t};
+
+\t// Set contenteditable to false on removals(#10429)
+\t// Setting to empty string throws an error as an invalid value
+\tjQuery.attrHooks.contenteditable = {
+\t\tget: nodeHook.get,
+\t\tset: function( elem, value, name ) {
+\t\t\tnodeHook.set( elem, value === "" ? false : value, name );
+\t\t}
+\t};
+
+\t// Set width and height to auto instead of 0 on empty string( Bug #8150 )
+\t// This is for removals
+\tjQuery.each([ "width", "height" ], function( i, name ) {
+\t\tjQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+\t\t\tset: function( elem, value ) {
+\t\t\t\tif ( value === "" ) {
+\t\t\t\t\telem.setAttribute( name, "auto" );
+\t\t\t\t\treturn value;
+\t\t\t\t}
+\t\t\t}
+\t\t});
+\t});
}
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
- jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- get: function( elem ) {
- var ret = elem.getAttribute( name, 2 );
- return ret == null ? undefined : ret;
- }
- });
- });
-
- // href/src property should get the full normalized URL (#10299/#12915)
- jQuery.each([ "href", "src" ], function( i, name ) {
- jQuery.propHooks[ name ] = {
- get: function( elem ) {
- return elem.getAttribute( name, 4 );
- }
- };
- });
+\tjQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+\t\tjQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+\t\t\tget: function( elem ) {
+\t\t\t\tvar ret = elem.getAttribute( name, 2 );
+\t\t\t\treturn ret == null ? undefined : ret;
+\t\t\t}
+\t\t});
+\t});
+
+\t// href/src property should get the full normalized URL (#10299/#12915)
+\tjQuery.each([ "href", "src" ], function( i, name ) {
+\t\tjQuery.propHooks[ name ] = {
+\t\t\tget: function( elem ) {
+\t\t\t\treturn elem.getAttribute( name, 4 );
+\t\t\t}
+\t\t};
+\t});
}
if ( !jQuery.support.style ) {
- jQuery.attrHooks.style = {
- get: function( elem ) {
- // Return undefined in the case of empty string
- // Note: IE uppercases css property names, but if we were to .toLowerCase()
- // .cssText, that would destroy case senstitivity in URL's, like in "background"
- return elem.style.cssText || undefined;
- },
- set: function( elem, value ) {
- return ( elem.style.cssText = value + "" );
- }
- };
+\tjQuery.attrHooks.style = {
+\t\tget: function( elem ) {
+\t\t\t// Return undefined in the case of empty string
+\t\t\t// Note: IE uppercases css property names, but if we were to .toLowerCase()
+\t\t\t// .cssText, that would destroy case senstitivity in URL's, like in "background"
+\t\t\treturn elem.style.cssText || undefined;
+\t\t},
+\t\tset: function( elem, value ) {
+\t\t\treturn ( elem.style.cssText = value + "" );
+\t\t}
+\t};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
- jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
- get: function( elem ) {
- var parent = elem.parentNode;
-
- if ( parent ) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- return null;
- }
- });
+\tjQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+\t\tget: function( elem ) {
+\t\t\tvar parent = elem.parentNode;
+
+\t\t\tif ( parent ) {
+\t\t\t\tparent.selectedIndex;
+
+\t\t\t\t// Make sure that it also works with optgroups, see #5701
+\t\t\t\tif ( parent.parentNode ) {
+\t\t\t\t\tparent.parentNode.selectedIndex;
+\t\t\t\t}
+\t\t\t}
+\t\t\treturn null;
+\t\t}
+\t});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
- jQuery.propFix.enctype = "encoding";
+\tjQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
- jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- get: function( elem ) {
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
- return elem.getAttribute("value") === null ? "on" : elem.value;
- }
- };
- });
+\tjQuery.each([ "radio", "checkbox" ], function() {
+\t\tjQuery.valHooks[ this ] = {
+\t\t\tget: function( elem ) {
+\t\t\t\t// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+\t\t\t\treturn elem.getAttribute("value") === null ? "on" : elem.value;
+\t\t\t}
+\t\t};
+\t});
}
jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
- }
- }
- });
+\tjQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+\t\tset: function( elem, value ) {
+\t\t\tif ( jQuery.isArray( value ) ) {
+\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+\t\t\t}
+\t\t}
+\t});
});
var rformElems = /^(?:input|select|textarea)$/i,
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|contextmenu)|click/,
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+\trkeyEvent = /^key/,
+\trmouseEvent = /^(?:mouse|contextmenu)|click/,
+\trfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+\trtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
function returnTrue() {
- return true;
+\treturn true;
}
function returnFalse() {
- return false;
+\treturn false;
}
/*
@@ -2713,976 +2713,976 @@ function returnFalse() {
*/
jQuery.event = {
- global: {},
-
- add: function( elem, types, handler, data, selector ) {
- var tmp, events, t, handleObjIn,
- special, eventHandle, handleObj,
- handlers, type, namespaces, origType,
- elemData = jQuery._data( elem );
-
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
- if ( !elemData ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- if ( !(events = elemData.events) ) {
- events = elemData.events = {};
- }
- if ( !(eventHandle = elemData.handle) ) {
- eventHandle = elemData.handle = function( e ) {
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
- jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
- undefined;
- };
- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
- eventHandle.elem = elem;
- }
-
- // Handle multiple events separated by a space
- // jQuery(...).bind("mouseover mouseout", fn);
- types = ( types || "" ).match( core_rnotwhite ) || [""];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[t] ) || [];
- type = origType = tmp[1];
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend({
- type: type,
- origType: origType,
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
- namespace: namespaces.join(".")
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- if ( !(handlers = events[ type ]) ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener/attachEvent if the special events handler returns false
- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
- // Bind the global event handler to the element
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle, false );
-
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, eventHandle );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
- var j, handleObj, tmp,
- origCount, t, events,
- special, handlers, type,
- namespaces, origType,
- elemData = jQuery.hasData( elem ) && jQuery._data( elem );
-
- if ( !elemData || !(events = elemData.events) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = ( types || "" ).match( core_rnotwhite ) || [""];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[t] ) || [];
- type = origType = tmp[1];
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector ? special.delegateType : special.bindType ) || type;
- handlers = events[ type ] || [];
- tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
-
- // Remove matching events
- origCount = j = handlers.length;
- while ( j-- ) {
- handleObj = handlers[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
- handlers.splice( j, 1 );
-
- if ( handleObj.selector ) {
- handlers.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( origCount && !handlers.length ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- delete elemData.handle;
-
- // removeData also checks for emptiness and clears the expando if empty
- // so use it instead of delete
- jQuery._removeData( elem, "events" );
- }
- },
-
- trigger: function( event, data, elem, onlyHandlers ) {
- var handle, ontype, cur,
- bubbleType, special, tmp, i,
- eventPath = [ elem || document ],
- type = core_hasOwn.call( event, "type" ) ? event.type : event,
- namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
-
- cur = tmp = elem = elem || document;
-
- // Don't do events on text and comment nodes
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
- return;
- }
-
- if ( type.indexOf(".") >= 0 ) {
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
- ontype = type.indexOf(":") < 0 && "on" + type;
-
- // Caller can pass in a jQuery.Event object, Object, or just an event type string
- event = event[ jQuery.expando ] ?
- event :
- new jQuery.Event( type, typeof event === "object" && event );
-
- event.isTrigger = true;
- event.namespace = namespaces.join(".");
- event.namespace_re = event.namespace ?
- new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
- null;
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if ( !event.target ) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data == null ?
- [ event ] :
- jQuery.makeArray( data, [ event ] );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- if ( !rfocusMorph.test( bubbleType + type ) ) {
- cur = cur.parentNode;
- }
- for ( ; cur; cur = cur.parentNode ) {
- eventPath.push( cur );
- tmp = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( tmp === (elem.ownerDocument || document) ) {
- eventPath.push( tmp.defaultView || tmp.parentWindow || window );
- }
- }
-
- // Fire handlers on the event path
- i = 0;
- while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
-
- event.type = i > 1 ?
- bubbleType :
- special.bindType || type;
-
- // jQuery handler
- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
-
- // Native handler
- handle = ontype && cur[ ontype ];
- if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
- event.preventDefault();
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
- if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
- !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
-
- // Call a native DOM method on the target with the same name name as the event.
- // Can't use an .isFunction() check here because IE6/7 fails that test.
- // Don't do default actions on window, that's where global variables be (#6170)
- if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- tmp = elem[ ontype ];
-
- if ( tmp ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- try {
- elem[ type ]();
- } catch ( e ) {
- // IE<9 dies on focus/blur to hidden element (#1486,#12518)
- // only reproducible on winXP IE8 native, not IE9 in IE8 mode
- }
- jQuery.event.triggered = undefined;
-
- if ( tmp ) {
- elem[ ontype ] = tmp;
- }
- }
- }
- }
-
- return event.result;
- },
-
- dispatch: function( event ) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( event );
-
- var i, ret, handleObj, matched, j,
- handlerQueue = [],
- args = core_slice.call( arguments ),
- handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
- special = jQuery.event.special[ event.type ] || {};
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[0] = event;
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
- // Run delegates first; they may want to stop propagation beneath us
- i = 0;
- while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
- event.currentTarget = matched.elem;
-
- j = 0;
- while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
-
- // Triggered event must either 1) have no namespace, or
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
- if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
-
- event.handleObj = handleObj;
- event.data = handleObj.data;
-
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
- .apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- if ( (event.result = ret) === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- handlers: function( event, handlers ) {
- var sel, handleObj, matches, i,
- handlerQueue = [],
- delegateCount = handlers.delegateCount,
- cur = event.target;
-
- // Find delegate handlers
- // Black-hole SVG