ThemeDefault-1.0.2/000077500000000000000000000000001260647414200140675ustar00rootroot00000000000000ThemeDefault-1.0.2/.gitattributes000066400000000000000000000000351260647414200167600ustar00rootroot00000000000000screenshot.png export-ignore ThemeDefault-1.0.2/LICENSE000066400000000000000000000024501260647414200150750ustar00rootroot00000000000000The MIT License --------------- - Copyright (c) 2010 [David Grudl](http://davidgrudl.com) - Copyright (c) 2011 [Jaroslav Hanslík](https://github.com/kukulich) - Copyright (c) 2011 [Ondřej Nešpor](https://github.com/Andrewsville) - Copyright (c) 2014 [Tomáš Votruba](http://tomasvotruba.cz) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ThemeDefault-1.0.2/README.md000066400000000000000000000005551260647414200153530ustar00rootroot00000000000000# Default Theme [![Downloads this Month](https://img.shields.io/packagist/dm/apigen/theme-default.svg?style=flat-square)](https://packagist.org/packages/apigen/theme-default) [![Latest stable](https://img.shields.io/packagist/v/apigen/theme-default.svg?style=flat-square)](https://packagist.org/packages/apigen/theme-default) ![Default Theme](screenshot.png?v=3) ThemeDefault-1.0.2/composer.json000066400000000000000000000010551260647414200166120ustar00rootroot00000000000000{ "name": "apigen/theme-default", "description": "Default theme for ApiGen", "homepage": "http://apigen.org/", "license": "MIT", "authors": [ { "name": "Tomáš Votruba", "email": "tomas.vot@gmail.com" }, { "name": "Olivier Laviale", "homepage": "https://github.com/olvlvl" }, { "name": "Jaroslav Hanslík", "homepage": "https://github.com/kukulich" }, { "name": "Ondřej Nešpor", "homepage": "https://github.com/andrewsville" }, { "name": "David Grudl", "homepage": "http://davidgrudl.com" } ], "require": { "latte/latte": "~2.2" } } ThemeDefault-1.0.2/src/000077500000000000000000000000001260647414200146565ustar00rootroot00000000000000ThemeDefault-1.0.2/src/404.latte000066400000000000000000000010651260647414200162220ustar00rootroot00000000000000{layout '@layout.latte'} {var $robots = false} {block title}Page not found{/block} {block content}

{include title}

The requested page could not be found.

You have probably clicked on a link that is outdated and points to a page that does not exist any more or you have made an typing error in the address.

To continue please try to find requested page in the menu,{if $config->tree} take a look at the tree view of the whole project{/if} or use search field on the top.

{/block} ThemeDefault-1.0.2/src/@elementlist.latte000066400000000000000000000022411260647414200203350ustar00rootroot00000000000000{define elements} {if $namespace}{$element->shortName}{else}{$element->name}{/if} {$element|shortDescription|noescape} {/define} {include elements, elements => $classes}
Classes summary
{include elements, elements => $interfaces}
Interfaces summary
{include elements, elements => $traits}
Traits summary
{include elements, elements => $exceptions}
Exceptions summary
{include elements, elements => $constants}
Constants summary
{include elements, elements => $functions}
Functions summary
ThemeDefault-1.0.2/src/@layout.latte000066400000000000000000000137711260647414200173370ustar00rootroot00000000000000{default $robots = true} {default $active = ''} {include title}{if 'overview' !== $active && $config->title} | {$config->title}{/if}
ThemeDefault-1.0.2/src/annotation-group.latte000066400000000000000000000101401260647414200212110ustar00rootroot00000000000000{layout '@layout.latte'} {var $active = 'annotation-group-' . $annotation} {block title}{$annotation|firstUpper}{/block} {block content}

{include title}

{if $hasElements} {include classes, items => $annotationClasses}
Classes summary
{include classes, items => $annotationInterfaces}
Interfaces summary
{include classes, items => $annotationTraits}
Traits summary
{include classes, items => $annotationExceptions}
Exceptions summary
Methods summary
{$method->declaringClassName} {$method->name}() {if $method->hasAnnotation($annotation)} {foreach $method->annotations[$annotation] as $description} {if $description} {$description|annotation:$annotation:$method|noescape}
{/if} {/foreach} {/if}
{if $constant->declaringClassName} {else} {/if}
Constants summary
{$constant->declaringClassName} {$constant->name}{$constant->namespaceName} {$constant->shortName} {foreach $constant->annotations[$annotation] as $description} {if $description} {$description|annotation:$annotation:$constant|noescape}
{/if} {/foreach}
Properties summary
{$property->declaringClassName} ${$property->name} {foreach $property->annotations[$annotation] as $description} {if $description} {$description|annotation:$annotation:$property|noescape}
{/if} {/foreach}
Functions summary
{$function->namespaceName} {$function->shortName} {foreach $function->annotations[$annotation] as $description} {if $description} {$description|annotation:$annotation:$function|noescape}
{/if} {/foreach}
{else}

No elements with @{$annotation} annotation found.

{/if}
{/block} {define classes} {$class->name} {foreach $class->annotations[$annotation] as $description} {if $description} {$description|annotation:$annotation:$class|noescape}
{/if} {/foreach} {/define} ThemeDefault-1.0.2/src/class.latte000066400000000000000000000427271260647414200170320ustar00rootroot00000000000000{layout '@layout.latte'} {var $active = 'class'} {block title}{if $class->deprecated}Deprecated {/if}{if $class->interface}Interface{elseif $class->trait}Trait{else}Class{/if} {$class->name}{/block} {block content}

{if $class->interface}Interface{elseif $class->trait}Trait{else}Class{/if} {$class->shortName}

{if $class->valid}
{$class|longDescription|noescape}
Extended by {if $item->documented} {last}{/last}{$item->name}{last}{/last} {else}{$item->name}{/if} {var $itemOwnInterfaces = $item->ownInterfaces} {if $itemOwnInterfaces} implements {foreach $itemOwnInterfaces as $interface} {$interface->name}{sep}, {/sep} {/foreach}{/if} {var $itemOwnTraits = $item->ownTraits} {if $itemOwnTraits} uses {foreach $itemOwnTraits as $trait} {if is_string($trait)} {$trait} (not available) {else} {$trait->name}{sep}, {/sep} {/} {/foreach}{/if}
{define children} {foreach $children as $child} {$child->name}{sep}, {/sep} {/foreach} {/define}

Direct known subclasses

{include children, children => $directSubClasses}

Indirect known subclasses

{include children, children => $indirectSubClasses}

Direct known implementers

{include children, children => $directImplementers}

Indirect known implementers

{include children, children => $indirectImplementers}

Direct Known Users

{include children, children => $directUsers}

Indirect Known Users

{include children, children => $indirectUsers}
{if !$class->interface && !$class->trait && ($class->abstract || $class->final)}{if $class->abstract}Abstract{else}Final{/if}
{/if} {if $class->internal}PHP Extension: {$class->extension->name|firstUpper}
{/if} {if $class->inNamespace()}Namespace: {$class->namespaceName|namespaceLinks|noescape}
{/if} {if $class->inPackage()}Package: {$class->packageName|packageLinks|noescape}
{/if} {foreach $template->annotationSort($template->annotationFilter($class->annotations)) as $annotation => $values} {foreach $values as $value} {$annotation|annotationBeautify}{if $value}:{/if} {$value|annotation:$annotation:$class|noescape}
{/foreach} {/foreach} {if $class->internal} Documented at php.net {else} Located at {$class->fileName|relativePath} {/if}
{var $ownMethods = $class->ownMethods} {var $ownMagicMethods = $class->ownMagicMethods} {define method} {var $annotations = $method->annotations} {if !$class->interface && $method->abstract}abstract{elseif $method->final}final{/if} {if $method->protected}protected{elseif $method->private}private{else}public{/if} {if $method->static}static{/if} {ifset $annotations['return']}{$annotations['return'][0]|typeLinks:$method|noescape}{/ifset} {if $method->returnsReference()}&{/if}
# {block|strip} {if $class->internal} {$method->name}( {else} {$method->name}( {/if} {foreach $method->parameters as $parameter} {$parameter->typeHint|typeLinks:$method|noescape} {if $parameter->passedByReference}& {/if}${$parameter->name}{if $parameter->defaultValueAvailable} = {$parameter->defaultValueDefinition|highlightPHP:$class|noescape}{elseif $parameter->unlimited},…{/if}{sep}, {/sep} {/foreach} ){/block} {if $config->template['options']['elementDetailsCollapsed']}
{$method|shortDescription:true|noescape}
{/if}
{$method|longDescription|noescape} {if !$class->deprecated && $method->deprecated}

Deprecated

{ifset $annotations['deprecated']}
{foreach $annotations['deprecated'] as $description} {if $description} {$description|annotation:'deprecated':$method|noescape}
{/if} {/foreach}
{/ifset} {/if} {if $method->parameters && isset($annotations['param'])}

Parameters

{foreach $method->parameters as $parameter}
${$parameter->name}{if $parameter->unlimited},…{/if}
{$parameter->description|description:$method|noescape}
{/foreach}
{/if} {if isset($annotations['return']) && 'void' !== $annotations['return'][0]}

Returns

{foreach $annotations['return'] as $description} {$description|annotation:'return':$method|noescape}{sep}
{/} {/foreach}
{/if} {ifset $annotations['throws']}

Throws

{foreach $annotations['throws'] as $description} {$description|annotation:'throws':$method|noescape}{sep}
{/} {/foreach}
{/ifset} {foreach $template->annotationSort($template->annotationFilter($annotations, array('deprecated', 'param', 'return', 'throws'))) as $annotation => $descriptions}

{$annotation|annotationBeautify}

{foreach $descriptions as $description} {if $description} {$description|annotation:$annotation:$method|noescape}
{/if} {/foreach}
{/foreach} {var $overriddenMethod = $method->overriddenMethod} {if $overriddenMethod}

Overrides

{/if} {var $implementedMethod = $method->implementedMethod} {if $implementedMethod}

Implementation of

{/if}
{/define} {foreach $ownMethods as $method} {include method, method => $method} {/foreach}
Methods summary
Methods inherited from {$parentName}
{foreach $methods as $method} {$method->name}(){sep}, {/sep} {/foreach}
Methods used from {$traitName}
{foreach $methods as $data} {$data['method']->name}(){if $data['aliases']}(as {foreach $data['aliases'] as $alias}{$alias->name}(){sep}, {/sep}{/foreach}){/if}{sep}, {/sep} {/foreach}
{foreach $ownMagicMethods as $method} {include method, method => $method} {/foreach}
Magic methods summary
Magic methods inherited from {$parentName}
{foreach $methods as $method} {$method->name}(){sep}, {/sep} {/foreach}
Magic methods used from {$traitName}
{foreach $methods as $data} {$data['method']->originalName}(){if $data['aliases']}(as {foreach $data['aliases'] as $alias}{$alias->name}(){sep}, {/sep}{/foreach}){/if}{sep}, {/sep} {/foreach}
{var $ownConstants = $class->ownConstants} {var $annotations = $constant->annotations}
Constants summary
{$constant->typeHint|typeLinks:$constant|noescape} {if $class->internal} {$constant->name} {else} {$constant->name} {/if}
{$constant|shortDescription:true|noescape}
{$constant|longDescription|noescape} {foreach $template->annotationSort($template->annotationFilter($annotations, array('var'))) as $annotation => $descriptions}

{$annotation|annotationBeautify}

{foreach $descriptions as $description} {if $description} {$description|annotation:$annotation:$constant|noescape}
{/if} {/foreach}
{/foreach}
# {$constant->valueDefinition|highlightValue:$class|noescape}
Constants inherited from {$parentName}
{foreach $constants as $constant} {$constant->name}{sep}, {/sep} {/foreach}
{define property} {if $property->protected}protected{elseif $property->private}private{else}public{/if} {if $property->static}static{/if} {if $property->readOnly}read-only{elseif $property->writeOnly}write-only{/if} {$property->typeHint|typeLinks:$property|noescape} {if $class->internal} ${$property->name} {else} ${$property->name} {/if}
{$property|shortDescription:true|noescape}
{$property|longDescription|noescape} {foreach $template->annotationSort($template->annotationFilter($property->annotations, array('var'))) as $annotation => $descriptions}

{$annotation|annotationBeautify}

{foreach $descriptions as $description} {if $description} {$description|annotation:$annotation:$property|noescape}
{/if} {/foreach}
{/foreach}
# {$property->defaultValueDefinition|highlightValue:$class|noescape}
{/define} {var $ownProperties = $class->ownProperties} {var $ownMagicProperties = $class->ownMagicProperties} {foreach $ownProperties as $property} {include property, property => $property} {/foreach}
Properties summary
Properties inherited from {$parentName}
{foreach $properties as $property} ${$property->name}{sep}, {/sep} {/foreach}
Properties used from {$traitName}
{foreach $properties as $property} ${$property->name}{sep}, {/sep} {/foreach}
{foreach $ownMagicProperties as $property} {include property, property => $property} {/foreach}
Magic properties summary
Magic properties inherited from {$parentName}
{foreach $properties as $property} ${$property->name}{sep}, {/sep} {/foreach}
Magic properties used from {$traitName}
{foreach $properties as $property} ${$property->name}{sep}, {/sep} {/foreach}
{else}

Documentation of this class could not be generated.

Class was originally declared in {$class->fileName|relativePath} and is invalid because of:

{/if}
{/block} ThemeDefault-1.0.2/src/combined.js.latte000066400000000000000000000005061260647414200201050ustar00rootroot00000000000000{contentType javascript} var ApiGen = ApiGen || {}; ApiGen.config = {$config->template}; {var $scripts = ['jquery.min.js', 'jquery.cookie.js', 'jquery.sprintf.js', 'jquery.autocomplete.js', 'jquery.sortElements.js', 'main.js']} {foreach $scripts as $script} {file_get_contents("$basePath/js/$script")|noescape} {/foreach} ThemeDefault-1.0.2/src/config.neon000066400000000000000000000000251260647414200170010ustar00rootroot00000000000000name: "ApiGen theme" ThemeDefault-1.0.2/src/constant.latte000066400000000000000000000040301260647414200175370ustar00rootroot00000000000000{layout '@layout.latte'} {var $active = 'constant'} {block title}{if $constant->deprecated}Deprecated {/if}Constant {$constant->name}{/block} {block content}

Constant {$constant->shortName}

{if $constant->valid}
{$constant|longDescription|noescape}
{if $constant->inNamespace()}Namespace: {$constant->namespaceName|namespaceLinks|noescape}
{/if} {if $constant->inPackage()}Package: {$constant->packageName|packageLinks|noescape}
{/if} {foreach $template->annotationSort($template->annotationFilter($constant->annotations, array('var'))) as $annotation => $values} {foreach $values as $value} {$annotation|annotationBeautify}{if $value}:{/if} {$value|annotation:$annotation:$constant|noescape}
{/foreach} {/foreach} Located at {$constant->fileName|relativePath}
{var $annotations = $constant->annotations}
Value summary
{$constant->typeHint|typeLinks:$constant|noescape} {block|strip} {var $element = $template->resolveElement($constant->valueDefinition, $constant)} {if $element}{$constant->valueDefinition}{else}{$constant->valueDefinition|highlightValue:$constant|noescape}{/if} {/block}
{else}

Documentation of this constant could not be generated.

Constant was originally declared in {$constant->fileName|relativePath} and is invalid because of:

{/if}
{/block} ThemeDefault-1.0.2/src/elementlist.js.latte000066400000000000000000000001241260647414200206460ustar00rootroot00000000000000{contentType javascript} var ApiGen = ApiGen || {}; ApiGen.elements = {$elements}; ThemeDefault-1.0.2/src/function.latte000066400000000000000000000056031260647414200175420ustar00rootroot00000000000000{layout '@layout.latte'} {var $active = 'function'} {block title}{if $function->deprecated}Deprecated {/if}Function {$function->name}{/block} {block content}

Function {$function->shortName}

{if $function->valid}
{$function|longDescription|noescape}
{if $function->inNamespace()}Namespace: {$function->namespaceName|namespaceLinks|noescape}
{/if} {if $function->inPackage()}Package: {$function->packageName|packageLinks|noescape}
{/if} {foreach $template->annotationSort($template->annotationFilter($function->annotations, array('param', 'return', 'throws'))) as $annotation => $values} {foreach $values as $value} {$annotation|annotationBeautify}{if $value}:{/if} {$value|annotation:$annotation:$function|noescape}
{/foreach} {/foreach} Located at {$function->fileName|relativePath}
{var $annotations = $function->annotations}
Parameters summary
{$parameter->typeHint|typeLinks:$function|noescape} {block|strip} {if $parameter->passedByReference}& {/if}${$parameter->name}{if $parameter->defaultValueAvailable} = {$parameter->defaultValueDefinition|highlightPHP:$function|noescape}{elseif $parameter->unlimited},…{/if} {/block} {$parameter->description|description:$function}
Return value summary
{$annotations['return'][0]|typeLinks:$function|noescape} {$annotations['return'][0]|description:$function|noescape}
Thrown exceptions summary
{$throws|typeLinks:$function|noescape} {$throws|description:$function|noescape}
{else}

Documentation of this function could not be generated.

Function was originally declared in {$function->fileName|relativePath} and is invalid because of:

{/if}
{/block} ThemeDefault-1.0.2/src/js/000077500000000000000000000000001260647414200152725ustar00rootroot00000000000000ThemeDefault-1.0.2/src/js/jquery.autocomplete.js000066400000000000000000000533521260647414200216570ustar00rootroot00000000000000/* * jQuery Autocomplete plugin 1.2.3 * * Copyright (c) 2009 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * With small modifications by Alfonso Gómez-Arzola. * See changelog for details. * */ ;(function($) { $.fn.extend({ autocomplete: function(urlOrData, options) { var isUrl = typeof urlOrData == "string"; options = $.extend({}, $.Autocompleter.defaults, { url: isUrl ? urlOrData : null, data: isUrl ? null : urlOrData, delay: isUrl ? $.Autocompleter.defaults.delay : 10, max: options && !options.scroll ? 10 : 150, noRecord: "No Records." }, options); // if highlight is set to false, replace it with a do-nothing function options.highlight = options.highlight || function(value) { return value; }; // if the formatMatch option is not specified, then use formatItem for backwards compatibility options.formatMatch = options.formatMatch || options.formatItem; return this.each(function() { new $.Autocompleter(this, options); }); }, result: function(handler) { return this.bind("result", handler); }, search: function(handler) { return this.trigger("search", [handler]); }, flushCache: function() { return this.trigger("flushCache"); }, setOptions: function(options){ return this.trigger("setOptions", [options]); }, unautocomplete: function() { return this.trigger("unautocomplete"); } }); $.Autocompleter = function(input, options) { var KEY = { UP: 38, DOWN: 40, DEL: 46, TAB: 9, RETURN: 13, ESC: 27, COMMA: 188, PAGEUP: 33, PAGEDOWN: 34, BACKSPACE: 8 }; var globalFailure = null; if(options.failure != null && typeof options.failure == "function") { globalFailure = options.failure; } // Create $ object for input element var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); var timeout; var previousValue = ""; var cache = $.Autocompleter.Cache(options); var hasFocus = 0; var lastKeyPressCode; var config = { mouseDownOnSelect: false }; var select = $.Autocompleter.Select(options, input, selectCurrent, config); var blockSubmit; // prevent form submit in opera when selecting with return key navigator.userAgent.indexOf("Opera") != -1 && $(input.form).bind("submit.autocomplete", function() { if (blockSubmit) { blockSubmit = false; return false; } }); // older versions of opera don't trigger keydown multiple times while pressed, others don't work with keypress at all $input.bind((navigator.userAgent.indexOf("Opera") != -1 && !'KeyboardEvent' in window ? "keypress" : "keydown") + ".autocomplete", function(event) { // a keypress means the input has focus // avoids issue where input had focus before the autocomplete was applied hasFocus = 1; // track last key pressed lastKeyPressCode = event.keyCode; switch(event.keyCode) { case KEY.UP: if ( select.visible() ) { event.preventDefault(); select.prev(); } else { onChange(0, true); } break; case KEY.DOWN: if ( select.visible() ) { event.preventDefault(); select.next(); } else { onChange(0, true); } break; case KEY.PAGEUP: if ( select.visible() ) { event.preventDefault(); select.pageUp(); } else { onChange(0, true); } break; case KEY.PAGEDOWN: if ( select.visible() ) { event.preventDefault(); select.pageDown(); } else { onChange(0, true); } break; // matches also semicolon case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: case KEY.TAB: case KEY.RETURN: if( selectCurrent() ) { // stop default to prevent a form submit, Opera needs special handling event.preventDefault(); blockSubmit = true; return false; } break; case KEY.ESC: select.hide(); break; default: clearTimeout(timeout); timeout = setTimeout(onChange, options.delay); break; } }).focus(function(){ // track whether the field has focus, we shouldn't process any // results if the field no longer has focus hasFocus++; }).blur(function() { hasFocus = 0; if (!config.mouseDownOnSelect) { hideResults(); } }).click(function() { // show select when clicking in a focused field // but if clickFire is true, don't require field // to be focused to begin with; just show select if( options.clickFire ) { if ( !select.visible() ) { onChange(0, true); } } else { if ( hasFocus++ > 1 && !select.visible() ) { onChange(0, true); } } }).bind("search", function() { var fn = (arguments.length > 1) ? arguments[1] : null; function findValueCallback(q, data) { var result; if( data && data.length ) { for (var i=0; i < data.length; i++) { if( data[i].result.toLowerCase() == q.toLowerCase() ) { result = data[i]; break; } } } if( typeof fn == "function" ) fn(result); else $input.trigger("result", result && [result.data, result.value]); } $.each(trimWords($input.val()), function(i, value) { request(value, findValueCallback, findValueCallback); }); }).bind("flushCache", function() { cache.flush(); }).bind("setOptions", function() { $.extend(true, options, arguments[1]); // if we've updated the data, repopulate if ( "data" in arguments[1] ) cache.populate(); }).bind("unautocomplete", function() { select.unbind(); $input.unbind(); $(input.form).unbind(".autocomplete"); }); function selectCurrent() { var selected = select.selected(); if( !selected ) return false; var v = selected.result; previousValue = v; if ( options.multiple ) { var words = trimWords($input.val()); if ( words.length > 1 ) { var seperator = options.multipleSeparator.length; var cursorAt = $(input).selection().start; var wordAt, progress = 0; $.each(words, function(i, word) { progress += word.length; if (cursorAt <= progress) { wordAt = i; return false; } progress += seperator; }); words[wordAt] = v; //$.Autocompleter.Selection(input, progress + seperator, progress + seperator); v = words.join( options.multipleSeparator ); } v += options.multipleSeparator; } $input.val(v); hideResultsNow(); $input.trigger("result", [selected.data, selected.value]); return true; } function onChange(crap, skipPrevCheck) { if( lastKeyPressCode == KEY.DEL ) { select.hide(); return; } var currentValue = $input.val(); if ( !skipPrevCheck && currentValue == previousValue ) return; previousValue = currentValue; currentValue = lastWord(currentValue); if ( currentValue.length >= options.minChars) { $input.addClass(options.loadingClass); if (!options.matchCase) currentValue = currentValue.toLowerCase(); request(currentValue, receiveData, hideResultsNow); } else { stopLoading(); select.hide(); } }; function trimWords(value) { if (!value) return [""]; if (!options.multiple) return [$.trim(value)]; return $.map(value.split(options.multipleSeparator), function(word) { return $.trim(value).length ? $.trim(word) : null; }); } function lastWord(value) { if ( !options.multiple ) return value; var words = trimWords(value); if (words.length == 1) return words[0]; var cursorAt = $(input).selection().start; if (cursorAt == value.length) { words = trimWords(value) } else { words = trimWords(value.replace(value.substring(cursorAt), "")); } return words[words.length - 1]; } // fills in the input box w/the first match (assumed to be the best match) // q: the term entered // sValue: the first matching result function autoFill(q, sValue){ // autofill in the complete box w/the first match as long as the user hasn't entered in more data // if the last user key pressed was backspace, don't autofill if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) { // fill in the value (keep the case the user has typed) $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); // select the portion of the value not typed by the user (so the next character will erase) $(input).selection(previousValue.length, previousValue.length + sValue.length); } }; function hideResults() { clearTimeout(timeout); timeout = setTimeout(hideResultsNow, 200); }; function hideResultsNow() { var wasVisible = select.visible(); select.hide(); clearTimeout(timeout); stopLoading(); if (options.mustMatch) { // call search and run callback $input.search( function (result){ // if no value found, clear the input box if( !result ) { if (options.multiple) { var words = trimWords($input.val()).slice(0, -1); $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") ); } else { $input.val( "" ); $input.trigger("result", null); } } } ); } }; function receiveData(q, data) { if ( data && data.length && hasFocus ) { stopLoading(); select.display(data, q); autoFill(q, data[0].value); select.show(); } else { hideResultsNow(); } }; function request(term, success, failure) { if (!options.matchCase) term = term.toLowerCase(); var data = cache.load(term); // recieve the cached data if (data) { if(data.length) { success(term, data); } else{ var parsed = options.parse && options.parse(options.noRecord) || parse(options.noRecord); success(term,parsed); } // if an AJAX url has been supplied, try loading the data now } else if( (typeof options.url == "string") && (options.url.length > 0) ){ var extraParams = { timestamp: +new Date() }; $.each(options.extraParams, function(key, param) { extraParams[key] = typeof param == "function" ? param() : param; }); $.ajax({ // try to leverage ajaxQueue plugin to abort previous requests mode: "abort", // limit abortion to this input port: "autocomplete" + input.name, dataType: options.dataType, url: options.url, data: $.extend({ q: lastWord(term), limit: options.max }, extraParams), success: function(data) { var parsed = options.parse && options.parse(data) || parse(data); cache.add(term, parsed); success(term, parsed); } }); } else { // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match select.emptyList(); if(globalFailure != null) { globalFailure(); } else { failure(term); } } }; function parse(data) { var parsed = []; var rows = data.split("\n"); for (var i=0; i < rows.length; i++) { var row = $.trim(rows[i]); if (row) { row = row.split("|"); parsed[parsed.length] = { data: row, value: row[0], result: options.formatResult && options.formatResult(row, row[0]) || row[0] }; } } return parsed; }; function stopLoading() { $input.removeClass(options.loadingClass); }; }; $.Autocompleter.defaults = { inputClass: "ac_input", resultsClass: "ac_results", loadingClass: "ac_loading", minChars: 1, delay: 400, matchCase: false, matchSubset: true, matchContains: false, cacheLength: 100, max: 1000, mustMatch: false, extraParams: {}, selectFirst: true, formatItem: function(row) { return row[0]; }, formatMatch: null, autoFill: false, width: 0, multiple: false, multipleSeparator: " ", inputFocus: true, clickFire: false, highlight: function(value, term) { return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); }, scroll: true, scrollHeight: 180, scrollJumpPosition: true }; $.Autocompleter.Cache = function(options) { var data = {}; var length = 0; function matchSubset(s, sub) { return (new RegExp(sub.toUpperCase().replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1").replace(/[A-Z0-9]/g, function(m, offset) { return offset === 0 ? '(?:' + m + '|^' + m.toLowerCase() + ')' : '(?:.*' + m + '|' + m.toLowerCase() + ')'; }))).test(s); // find by initials }; function add(q, value) { if (length > options.cacheLength){ flush(); } if (!data[q]){ length++; } data[q] = value; } function populate(){ if( !options.data ) return false; // track the matches var stMatchSets = {}, nullData = 0; // no url was specified, we need to adjust the cache length to make sure it fits the local data store if( !options.url ) options.cacheLength = 1; // track all options for minChars = 0 stMatchSets[""] = []; // loop through the array and create a lookup structure for ( var i = 0, ol = options.data.length; i < ol; i++ ) { var rawValue = options.data[i]; // if rawValue is a string, make an array otherwise just reference the array rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; var value = options.formatMatch(rawValue, i+1, options.data.length); if ( typeof(value) === 'undefined' || value === false ) continue; var firstChar = value.charAt(0).toLowerCase(); // if no lookup array for this character exists, look it up now if( !stMatchSets[firstChar] ) stMatchSets[firstChar] = []; // if the match is a string var row = { value: value, data: rawValue, result: options.formatResult && options.formatResult(rawValue) || value }; // push the current match into the set list stMatchSets[firstChar].push(row); // keep track of minChars zero items if ( nullData++ < options.max ) { stMatchSets[""].push(row); } }; // add the data items to the cache $.each(stMatchSets, function(i, value) { // increase the cache size options.cacheLength++; // add to the cache add(i, value); }); } // populate any existing data setTimeout(populate, 25); function flush(){ data = {}; length = 0; } return { flush: flush, add: add, populate: populate, load: function(q) { if (!options.cacheLength || !length) return null; /* * if dealing w/local data and matchContains than we must make sure * to loop through all the data collections looking for matches */ if( !options.url && options.matchContains ){ // track all matches var csub = []; // loop through all the data grids for matches for( var k in data ){ // don't search through the stMatchSets[""] (minChars: 0) cache // this prevents duplicates if( k.length > 0 ){ var c = data[k]; $.each(c, function(i, x) { // if we've got a match, add it to the array if (matchSubset(x.value, q)) { csub.push(x); } }); } } return csub; } else // if the exact item exists, use it if (data[q]){ return data[q]; } else if (options.matchSubset) { for (var i = q.length - 1; i >= options.minChars; i--) { var c = data[q.substr(0, i)]; if (c) { var csub = []; $.each(c, function(i, x) { if (matchSubset(x.value, q)) { csub[csub.length] = x; } }); return csub; } } } return null; } }; }; $.Autocompleter.Select = function (options, input, select, config) { var CLASSES = { ACTIVE: "ac_over" }; var listItems, active = -1, data, term = "", needsInit = true, element, list; // Create results function init() { if (!needsInit) return; element = $("
") .hide() .addClass(options.resultsClass) .css("position", "absolute") .appendTo(document.body) .hover(function(event) { // Browsers except FF do not fire mouseup event on scrollbars, resulting in mouseDownOnSelect remaining true, and results list not always hiding. if($(this).is(":visible")) { input.focus(); } config.mouseDownOnSelect = false; }); list = $("
{/define} {block content}

{include title}

{if $classTree->valid()}

Classes

{include tree, tree => $classTree} {/if} {if $interfaceTree->valid()}

Interfaces

{include tree, tree => $interfaceTree} {/if} {if $traitTree->valid()}

Traits

{include tree, tree => $traitTree} {/if} {if $exceptionTree->valid()}

Exceptions

{include tree, tree => $exceptionTree} {/if}
{/block}