code_text
stringlengths 604
999k
| repo_name
stringlengths 4
100
| file_path
stringlengths 4
873
| language
stringclasses 23
values | license
stringclasses 15
values | size
int32 1.02k
999k
|
---|---|---|---|---|---|
<a href='https://github.com/angular/angular.js/edit/v1.5.x/src/ng/directive/attrs.js?message=docs(ngChecked)%3A%20describe%20your%20change...#L189' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit"> </i>Improve this Doc</a>
<a href='https://github.com/angular/angular.js/tree/v1.5.0/src/ng/directive/attrs.js#L189' class='view-source pull-right btn btn-primary'>
<i class="glyphicon glyphicon-zoom-in"> </i>View Source
</a>
<header class="api-profile-header">
<h1 class="api-profile-header-heading">ngChecked</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- directive in module <a href="api/ng">ng</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>Sets the <code>checked</code> attribute on the element, if the expression inside <code>ngChecked</code> is truthy.</p>
<p>Note that this directive should not be used together with <a href="api/ng/directive/ngModel"><code>ngModel</code></a>,
as this can lead to unexpected behavior.</p>
<p>A special directive is necessary because we cannot use interpolation inside the <code>checked</code>
attribute. See the <a href="guide/interpolation">interpolation guide</a> for more info.</p>
</div>
<div>
<h2>Directive Info</h2>
<ul>
<li>This directive executes at priority level 100.</li>
</ul>
<h2 id="usage">Usage</h2>
<div class="usage">
<ul>
<li>as attribute:
<pre><code><INPUT ng-checked="expression"> ... </INPUT></code></pre>
</li>
</div>
<section class="api-section">
<h3>Arguments</h3>
<table class="variables-matrix input-arguments">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr>
<td>
ngChecked
</td>
<td>
<a href="" class="label type-hint type-hint-expression">expression</a>
</td>
<td>
<p>If the <a href="guide/expression">expression</a> is truthy,
then the <code>checked</code> attribute will be set on the element</p>
</td>
</tr>
</tbody>
</table>
</section>
<h2 id="example">Example</h2><p>
<div>
<a ng-click="openPlunkr('examples/example-example56', $event)" class="btn pull-right">
<i class="glyphicon glyphicon-edit"> </i>
Edit in Plunker</a>
<div class="runnable-example"
path="examples/example-example56">
<div class="runnable-example-file"
name="index.html"
language="html"
type="html">
<pre><code><label>Check me to check both: <input type="checkbox" ng-model="master"></label><br/> <input id="checkSlave" type="checkbox" ng-checked="master" aria-label="Slave input"></code></pre>
</div>
<div class="runnable-example-file"
name="protractor.js"
type="protractor"
language="js">
<pre><code>it('should check both checkBoxes', function() { expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy(); element(by.model('master')).click(); expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy(); });</code></pre>
</div>
<iframe class="runnable-example-frame" src="examples/example-example56/index.html" name="example-example56"></iframe>
</div>
</div>
</p>
</div>
| UNIZAR-30226-2016-05/gbh | ProyectoSoftware/WebContent/angular-1.5.0/docs/partials/api/ng/directive/ngChecked.html | HTML | mit | 3,551 |
import unittest
from sys import platform as _platform
from datetime import datetime, timedelta
from mock import call, patch, MagicMock
from pokemongo_bot.cell_workers.update_live_stats import UpdateLiveStats
from tests import FakeBot
class UpdateLiveStatsTestCase(unittest.TestCase):
config = {
'min_interval': 20,
'stats': ['login', 'username', 'pokemon_evolved', 'pokemon_encountered', 'uptime',
'pokemon_caught', 'stops_visited', 'km_walked', 'level', 'stardust_earned',
'level_completion', 'xp_per_hour', 'pokeballs_thrown', 'highest_cp_pokemon',
'level_stats', 'xp_earned', 'pokemon_unseen', 'most_perfect_pokemon',
'pokemon_stats', 'pokemon_released', 'captures_per_hour'],
'terminal_log': True,
'terminal_title': False
}
player_stats = {
'level': 25,
'prev_level_xp': 1250000,
'next_level_xp': 1400000,
'experience': 1337500
}
def setUp(self):
self.bot = FakeBot()
self.bot._player = {'username': 'Username'}
self.bot.config.username = 'Login'
self.worker = UpdateLiveStats(self.bot, self.config)
def mock_metrics(self):
self.bot.metrics = MagicMock()
self.bot.metrics.runtime.return_value = timedelta(hours=15, minutes=42, seconds=13)
self.bot.metrics.distance_travelled.return_value = 42.05
self.bot.metrics.xp_per_hour.return_value = 1337.42
self.bot.metrics.xp_earned.return_value = 424242
self.bot.metrics.visits = {'latest': 250, 'start': 30}
self.bot.metrics.num_encounters.return_value = 130
self.bot.metrics.num_captures.return_value = 120
self.bot.metrics.captures_per_hour.return_value = 75
self.bot.metrics.releases = 30
self.bot.metrics.num_evolutions.return_value = 12
self.bot.metrics.num_new_mons.return_value = 3
self.bot.metrics.num_throws.return_value = 145
self.bot.metrics.earned_dust.return_value = 24069
self.bot.metrics.highest_cp = {'desc': 'highest_cp'}
self.bot.metrics.most_perfect = {'desc': 'most_perfect'}
def test_config(self):
self.assertEqual(self.worker.min_interval, self.config['min_interval'])
self.assertEqual(self.worker.displayed_stats, self.config['stats'])
self.assertEqual(self.worker.terminal_title, self.config['terminal_title'])
self.assertEqual(self.worker.terminal_log, self.config['terminal_log'])
def test_should_display_no_next_update(self):
self.worker.next_update = None
self.assertTrue(self.worker._should_display())
@patch('pokemongo_bot.cell_workers.update_live_stats.datetime')
def test_should_display_no_terminal_log_title(self, mock_datetime):
# _should_display should return False if both terminal_title and terminal_log are false
# in configuration, even if we're past next_update.
now = datetime.now()
mock_datetime.now.return_value = now + timedelta(seconds=20)
self.worker.next_update = now
self.worker.terminal_log = False
self.worker.terminal_title = False
self.assertFalse(self.worker._should_display())
@patch('pokemongo_bot.cell_workers.update_live_stats.datetime')
def test_should_display_before_next_update(self, mock_datetime):
now = datetime.now()
mock_datetime.now.return_value = now - timedelta(seconds=20)
self.worker.next_update = now
self.assertFalse(self.worker._should_display())
@patch('pokemongo_bot.cell_workers.update_live_stats.datetime')
def test_should_display_after_next_update(self, mock_datetime):
now = datetime.now()
mock_datetime.now.return_value = now + timedelta(seconds=20)
self.worker.next_update = now
self.assertTrue(self.worker._should_display())
@patch('pokemongo_bot.cell_workers.update_live_stats.datetime')
def test_should_display_exactly_next_update(self, mock_datetime):
now = datetime.now()
mock_datetime.now.return_value = now
self.worker.next_update = now
self.assertTrue(self.worker._should_display())
@patch('pokemongo_bot.cell_workers.update_live_stats.datetime')
def test_compute_next_update(self, mock_datetime):
now = datetime.now()
mock_datetime.now.return_value = now
old_next_display_value = self.worker.next_update
self.worker._compute_next_update()
self.assertNotEqual(self.worker.next_update, old_next_display_value)
self.assertEqual(self.worker.next_update,
now + timedelta(seconds=self.config['min_interval']))
@patch('pokemongo_bot.cell_workers.update_live_stats.stdout')
@patch('pokemongo_bot.cell_workers.UpdateLiveStats._compute_next_update')
def test_update_title_linux_cygwin(self, mock_compute_next_update, mock_stdout):
self.worker._update_title('new title linux', 'linux')
self.assertEqual(mock_stdout.write.call_count, 1)
self.assertEqual(mock_stdout.write.call_args, call('\x1b]2;new title linux\x07'))
self.assertEqual(mock_compute_next_update.call_count, 1)
self.worker._update_title('new title linux2', 'linux2')
self.assertEqual(mock_stdout.write.call_count, 2)
self.assertEqual(mock_stdout.write.call_args, call('\x1b]2;new title linux2\x07'))
self.assertEqual(mock_compute_next_update.call_count, 2)
self.worker._update_title('new title cygwin', 'cygwin')
self.assertEqual(mock_stdout.write.call_count, 3)
self.assertEqual(mock_stdout.write.call_args, call('\x1b]2;new title cygwin\x07'))
self.assertEqual(mock_compute_next_update.call_count, 3)
@patch('pokemongo_bot.cell_workers.update_live_stats.stdout')
@patch('pokemongo_bot.cell_workers.UpdateLiveStats._compute_next_update')
def test_update_title_darwin(self, mock_compute_next_update, mock_stdout):
self.worker._update_title('new title darwin', 'darwin')
self.assertEqual(mock_stdout.write.call_count, 1)
self.assertEqual(mock_stdout.write.call_args, call('\033]0;new title darwin\007'))
self.assertEqual(mock_compute_next_update.call_count, 1)
@unittest.skipUnless(_platform.startswith("win"), "requires Windows")
@patch('pokemongo_bot.cell_workers.update_live_stats.ctypes')
@patch('pokemongo_bot.cell_workers.UpdateLiveStats._compute_next_update')
def test_update_title_win32(self, mock_compute_next_update, mock_ctypes):
self.worker._update_title('new title win32', 'win32')
self.assertEqual(mock_ctypes.windll.kernel32.SetConsoleTitleA.call_count, 1)
self.assertEqual(mock_ctypes.windll.kernel32.SetConsoleTitleA.call_args,
call('new title win32'))
self.assertEqual(mock_compute_next_update.call_count, 1)
@patch('pokemongo_bot.cell_workers.update_live_stats.BaseTask.emit_event')
@patch('pokemongo_bot.cell_workers.UpdateLiveStats._compute_next_update')
def test_log_on_terminal(self, mock_compute_next_update, mock_emit_event):
self.worker._log_on_terminal('stats')
self.assertEqual(mock_emit_event.call_count, 1)
self.assertEqual(mock_emit_event.call_args,
call('log_stats', data={'stats': 'stats'}, formatted='{stats}'))
self.assertEqual(mock_compute_next_update.call_count, 1)
def test_get_stats_line_player_stats_none(self):
line = self.worker._get_stats_line(None)
self.assertEqual(line, '')
def test_get_stats_line_no_displayed_stats(self):
self.worker.displayed_stats = []
line = self.worker._get_stats_line(self.player_stats)
self.assertEqual(line, '')
def test_get_stats_line(self):
self.mock_metrics()
line = self.worker._get_stats_line(self.player_stats)
expected = 'Login | Username | Evolved 12 pokemon | Encountered 130 pokemon | ' \
'Uptime : 15:42:13 | Caught 120 pokemon | Visited 220 stops | ' \
'42.05km walked | Level 25 | Earned 24,069 Stardust | ' \
'87,500 / 150,000 XP (58%) | 1,337 XP/h | Threw 145 pokeballs | ' \
'Highest CP pokemon : highest_cp | Level 25 (87,500 / 150,000, 58%) | ' \
'+424,242 XP | Encountered 3 new pokemon | ' \
'Most perfect pokemon : most_perfect | ' \
'Encountered 130 pokemon, 120 caught, 30 released, 12 evolved, ' \
'3 never seen before | Released 30 pokemon | 75 pokemon/h'
self.assertEqual(line, expected)
| AMiketta/PokemonGo-Bot | tests/update_live_stats_test.py | Python | mit | 8,691 |
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.builtin {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #a67f59;
background: hsla(0,0%,100%,.5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.regex,
.token.important {
color: #e90;
}
.token.important {
font-weight: bold;
}
.token.entity {
cursor: help;
}
pre.line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre.line-numbers > code {
position: relative;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
| FTG-003/Draobhsad | assets/prism/prism.css | CSS | mit | 2,751 |
/*
* Copyright (c) 2010-2014 Jakub Białek
*
* 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.
*/
package com.google.code.ssm.mapper;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.code.ssm.json.ClassAliasTypeResolverBuilder;
/**
*
* Default jackson {@link ObjectMapper} initialized with enabled auto detecting of fields, getters and setters.
*
* @author Jakub Białek
* @since 2.0.0
*
*/
public class JsonObjectMapper extends ObjectMapper { // NO_UCD
private static final long serialVersionUID = 1L;
private final SimpleModule module = new SimpleModule("ssm", new Version(1, 0, 0, null, "com.google.code.ssm", "core"));
private final ClassAliasTypeResolverBuilder typer;
public JsonObjectMapper() {
registerModule(module);
configure(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS, true);
configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
enableDefaultTyping(DefaultTyping.NON_FINAL, As.WRAPPER_OBJECT);
typer = new ClassAliasTypeResolverBuilder(DefaultTyping.NON_FINAL);
setDefaultTyping(typer.inclusion(As.WRAPPER_OBJECT));
}
public void setSerializers(final List<JsonSerializer<?>> serializers) {
for (JsonSerializer<?> serializer : serializers) {
module.addSerializer(serializer);
}
// required otherwise new serializers are not registered to context
registerModule(module);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public void setSerializers(final Map<Class<?>, JsonSerializer<?>> serializers) {
for (Map.Entry<Class<?>, JsonSerializer<?>> entry : serializers.entrySet()) {
module.addSerializer((Class) entry.getKey(), entry.getValue());
}
// required otherwise new serializers are not registered to context
registerModule(module);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public void setDeserializers(final Map<Class<?>, JsonDeserializer<?>> deserializers) {
for (Map.Entry<Class<?>, JsonDeserializer<?>> entry : deserializers.entrySet()) {
module.addDeserializer((Class) entry.getKey(), entry.getValue());
}
// required otherwise new deserializers are not registered to context
registerModule(module);
}
/**
* Registers mappings between classes and aliases (ids).
*
* @param classToId
* @since 3.0.0
*/
public void setClassToId(final Map<Class<?>, String> classToId) {
typer.setClassToId(classToId);
}
}
| dinesh94/simple-spring-memcached | simple-spring-memcached/src/main/java/com/google/code/ssm/mapper/JsonObjectMapper.java | Java | mit | 4,001 |
.cm-s-duotone-light.CodeMirror{background:#faf8f5;color:#b29762}.cm-s-duotone-light div.CodeMirror-selected{background:#e3dcce!important}.cm-s-duotone-light .CodeMirror-gutters{background:#faf8f5;border-right:0}.cm-s-duotone-light .CodeMirror-linenumber{color:#cdc4b1}.cm-s-duotone-light .CodeMirror-cursor{border-left:1px solid #93abdc;border-right:.5em solid #93abdc;opacity:.5}.cm-s-duotone-light .CodeMirror-activeline-background{background:#e3dcce;opacity:.5}.cm-s-duotone-light .cm-fat-cursor .CodeMirror-cursor{background:#93abdc;opacity:.5}.cm-s-duotone-light span.cm-atom,.cm-s-duotone-light span.cm-attribute,.cm-s-duotone-light span.cm-keyword,.cm-s-duotone-light span.cm-number,.cm-s-duotone-light span.cm-quote,.cm-s-duotone-light span.cm-variable,.cm-s-duotone-light-light span.cm-hr,.cm-s-duotone-light-light span.cm-link{color:#063289}.cm-s-duotone-light span.cm-property{color:#b29762}.cm-s-duotone-light span.cm-negative,.cm-s-duotone-light span.cm-punctuation,.cm-s-duotone-light span.cm-unit{color:#063289}.cm-s-duotone-light span.cm-operator,.cm-s-duotone-light span.cm-string{color:#1659df}.cm-s-duotone-light span.cm-positive{color:#896724}.cm-s-duotone-light span.cm-string-2,.cm-s-duotone-light span.cm-type,.cm-s-duotone-light span.cm-url,.cm-s-duotone-light span.cm-variable-2,.cm-s-duotone-light span.cm-variable-3{color:#896724}.cm-s-duotone-light span.cm-builtin,.cm-s-duotone-light span.cm-def,.cm-s-duotone-light span.cm-em,.cm-s-duotone-light span.cm-header,.cm-s-duotone-light span.cm-qualifier,.cm-s-duotone-light span.cm-tag{color:#2d2006}.cm-s-duotone-light span.cm-bracket,.cm-s-duotone-light span.cm-comment{color:#b6ad9a}.cm-s-duotone-light span.cm-error,.cm-s-duotone-light span.cm-invalidchar{color:red}.cm-s-duotone-light span.cm-header{font-weight:400}.cm-s-duotone-light .CodeMirror-matchingbracket{text-decoration:underline;color:#faf8f5!important}
/*# sourceMappingURL=duotone-light.min.css.map */ | seogi1004/cdnjs | ajax/libs/codemirror/5.27.4/theme/duotone-light.min.css | CSS | mit | 1,944 |
/**
* angular-motion
* @version v0.3.4 - 2014-10-14
* @link https://github.com/mgcrea/angular-motion
* @author Olivier Louvignes <olivier@mg-crea.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
.am-collapse{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:ease;animation-timing-function:ease;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;opacity:1}.am-collapse.am-collapse-add,.am-collapse.ng-hide-remove,.am-collapse.ng-move{-webkit-animation-name:expand;animation-name:expand}.am-collapse.am-collapse-remove,.am-collapse.ng-hide{-webkit-animation-name:collapse;animation-name:collapse}.am-collapse.ng-enter{visibility:hidden;-webkit-animation-name:expand;animation-name:expand;-webkit-animation-play-state:paused;animation-play-state:paused}.am-collapse.ng-enter.ng-enter-active{visibility:visible;-webkit-animation-play-state:running;animation-play-state:running}.am-collapse.ng-leave{-webkit-animation-name:collapse;animation-name:collapse;-webkit-animation-play-state:paused;animation-play-state:paused}.am-collapse.ng-leave.ng-leave-active{-webkit-animation-play-state:running;animation-play-state:running}@-webkit-keyframes expand{from{max-height:0}to{max-height:500px}}@keyframes expand{from{max-height:0}to{max-height:500px}}@-webkit-keyframes collapse{from{max-height:500px}to{max-height:0}}@keyframes collapse{from{max-height:500px}to{max-height:0}}.panel-collapse.am-collapse.in-remove{-webkit-animation-name:collapse;animation-name:collapse;display:block}.panel-collapse.am-collapse.in-add{-webkit-animation-name:expand;animation-name:expand} | kristoferjoseph/cdnjs | ajax/libs/angular-motion/0.3.4/modules/collapse.min.css | CSS | mit | 1,645 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("anim-base",function(e,t){var n="running",r="startTime",i="elapsedTime",s="start",o="tween",u="end",a="node",f="paused",l="reverse",c="iterationCount",h=Number,p={},d;e.Anim=function(){e.Anim.superclass.constructor.apply(this,arguments),e.Anim._instances[e.stamp(this)]=this},e.Anim.NAME="anim",e.Anim._instances={},e.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,e.Anim.DEFAULT_UNIT="px",e.Anim.DEFAULT_EASING=function(e,t,n,r){return n*e/r+t},e.Anim._intervalTime=20,e.Anim.behaviors={left:{get:function(e,t){return e._getOffset(t)}}},e.Anim.behaviors.top=e.Anim.behaviors.left,e.Anim.DEFAULT_SETTER=function(t,n,r,i,s,o,u,a){var f=t._node,l=f._node,c=u(s,h(r),h(i)-h(r),o);l?"style"in l&&(n in l.style||n in e.DOM.CUSTOM_STYLES)?(a=a||"",f.setStyle(n,c+a)):"attributes"in l&&n in l.attributes?f.setAttribute(n,c):n in l&&(l[n]=c):f.set?f.set(n,c):n in f&&(f[n]=c)},e.Anim.DEFAULT_GETTER=function(t,n){var r=t._node,i=r._node,s="";return i?"style"in i&&(n in i.style||n in e.DOM.CUSTOM_STYLES)?s=r.getComputedStyle(n):"attributes"in i&&n in i.attributes?s=r.getAttribute(n):n in i&&(s=i[n]):r.get?s=r.get(n):n in r&&(s=r[n]),s},e.Anim.ATTRS={node:{setter:function(t){return t&&(typeof t=="string"||t.nodeType)&&(t=e.one(t)),this._node=t,!t,t}},duration:{value:1},easing:{value:e.Anim.DEFAULT_EASING,setter:function(t){if(typeof t=="string"&&e.Easing)return e.Easing[t]}},from:{},to:{},startTime:{value:0,readOnly:!0},elapsedTime:{value:0,readOnly:!0},running:{getter:function(){return!!p[e.stamp(this)]},value:!1,readOnly:!0},iterations:{value:1},iterationCount:{value:0,readOnly:!0},direction:{value:"normal"},paused:{readOnly:!0,value:!1},reverse:{value:!1}},e.Anim.run=function(){var t=e.Anim._instances,n;for(n in t)t[n].run&&t[n].run()},e.Anim.pause=function(){for(var t in p)p[t].pause&&p[t].pause();e.Anim._stopTimer()},e.Anim.stop=function(){for(var t in p)p[t].stop&&p[t].stop();e.Anim._stopTimer()},e.Anim._startTimer=function(){d||(d=setInterval(e.Anim._runFrame,e.Anim._intervalTime))},e.Anim._stopTimer=function(){clearInterval(d),d=0},e.Anim._runFrame=function(){var t=!0,n;for(n in p)p[n]._runFrame&&(t=!1,p[n]._runFrame());t&&e.Anim._stopTimer()},e.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var v={run:function(){return this.get(f)?this._resume():this.get(n)||this._start(),this},pause:function(){return this.get(n)&&this._pause(),this},stop:function(e){return(this.get(n)||this.get(f))&&this._end(e),this},_added:!1,_start:function(){this._set(r,new Date-this.get(i)),this._actualFrames=0,this.get(f)||this._initAnimAttr(),p[e.stamp(this)]=this,e.Anim._startTimer(),this.fire(s)},_pause:function(){this._set(r,null),this._set(f,!0),delete p[e.stamp(this)],this.fire("pause")},_resume:function(){this._set(f,!1),p[e.stamp(this)]=this,this._set(r,new Date-this.get(i)),e.Anim._startTimer(),this.fire("resume")},_end:function(t){var n=this.get("duration")*1e3;t&&this._runAttrs(n,n,this.get(l)),this._set(r,null),this._set(i,0),this._set(f,!1),delete p[e.stamp(this)],this.fire(u,{elapsed:this.get(i)})},_runFrame:function(){var e=this._runtimeAttr.duration,t=new Date-this.get(r),n=this.get(l),s=t>=e;this._runAttrs(t,e,n),this._actualFrames+=1,this._set(i,t),this.fire(o),s&&this._lastFrame()},_runAttrs:function(t,n,r){var i=this._runtimeAttr,s=e.Anim.behaviors,o=i.easing,u=n,a=!1,f,l,c;t>=n&&(a=!0),r&&(t=n-t,u=0);for(c in i)i[c].to&&(f=i[c],l=c in s&&"set"in s[c]?s[c].set:e.Anim.DEFAULT_SETTER,a?l(this,c,f.from,f.to,u,n,o,f.unit):l(this,c,f.from,f.to,t,n,o,f.unit))},_lastFrame:function(){var e=this.get("iterations"),t=this.get(c);t+=1,e==="infinite"||t<e?(this.get("direction")==="alternate"&&this.set(l,!this.get(l)),this.fire("iteration")):(t=0,this._end()),this._set(r,new Date),this._set(c,t)},_initAnimAttr:function(){var t=this.get("from")||{},n=this.get("to")||{},r={duration:this.get("duration")*1e3,easing:this.get("easing")},i=e.Anim.behaviors,s=this.get(a),o,u,f;e.each(n,function(n,a){typeof n=="function"&&(n=n.call(this,s)),u=t[a],u===undefined?u=a in i&&"get"in i[a]?i[a].get(this,a):e.Anim.DEFAULT_GETTER(this,a):typeof u=="function"&&(u=u.call(this,s));var l=e.Anim.RE_UNITS.exec(u),c=e.Anim.RE_UNITS.exec(n);u=l?l[1]:u,f=c?c[1]:n,o=c?c[2]:l?l[2]:"",!o&&e.Anim.RE_DEFAULT_UNIT.test(a)&&(o=e.Anim.DEFAULT_UNIT);if(!u||!f){e.error('invalid "from" or "to" for "'+a+'"',"Anim");return}r[a]={from:e.Lang.isObject(u)?e.clone(u):u,to:f,unit:o}},this),this._runtimeAttr=r},_getOffset:function(e){var t=this._node,n=t.getComputedStyle(e),r=e==="left"?"getX":"getY",i=e==="left"?"setX":"setY",s;return n==="auto"&&(s=t.getStyle("position"),s==="absolute"||s==="fixed"?(n=t[r](),t[i](n)):n=0),n},destructor:function(){delete e.Anim._instances[e.stamp(this)]}};e.extend(e.Anim,e.Base,v)},"3.17.0",{requires:["base-base","node-style","color-base"]});
| wackyapples/cdnjs | ajax/libs/yui/3.17.0/anim-base/anim-base-min.js | JavaScript | mit | 4,998 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("datatable-scroll",function(e,t){function u(e,t){return parseInt(e.getComputedStyle(t),10)||0}var n=e.Lang,r=n.isString,i=n.isNumber,s=n.isArray,o;e.DataTable.Scrollable=o=function(){},o.ATTRS={scrollable:{value:!1,setter:"_setScrollable"}},e.mix(o.prototype,{scrollTo:function(e){var t;return e&&this._tbodyNode&&(this._yScrollNode||this._xScrollNode)&&(s(e)?t=this.getCell(e):i(e)?t=this.getRow(e):r(e)?t=this._tbodyNode.one("#"+e):e._node&&e.ancestor(".yui3-datatable")===this.get("boundingBox")&&(t=e),t&&t.scrollIntoView()),this},_CAPTION_TABLE_TEMPLATE:'<table class="{className}" role="presentation"></table>',_SCROLL_LINER_TEMPLATE:'<div class="{className}"></div>',_SCROLLBAR_TEMPLATE:'<div class="{className}"><div></div></div>',_X_SCROLLER_TEMPLATE:'<div class="{className}"></div>',_Y_SCROLL_HEADER_TEMPLATE:'<table cellspacing="0" aria-hidden="true" class="{className}"></table>',_Y_SCROLLER_TEMPLATE:'<div class="{className}"><div class="{scrollerClassName}"></div></div>',_addScrollbarPadding:function(){var t=this._yScrollHeader,n="."+this.getClassName("header"),r,i,s,o,u;if(t){r=e.DOM.getScrollbarWidth()+"px",i=t.all("tr");for(o=0,u=i.size();o<u;o+=+s.get("rowSpan"))s=i.item(o).all(n).pop(),s.setStyle("paddingRight",r)}},_afterScrollableChange:function(){var t=this._xScrollNode;this._xScroll&&t&&(this._yScroll&&!this._yScrollNode?t.setStyle("paddingRight",e.DOM.getScrollbarWidth()+"px"):!this._yScroll&&this._yScrollNode&&t.setStyle("paddingRight","")),this._syncScrollUI()},_afterScrollCaptionChange:function(){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_afterScrollColumnsChange:function(){if(this._xScroll||this._yScroll)this._yScroll&&this._yScrollHeader&&this._syncScrollHeaders(),this._syncScrollUI()},_afterScrollDataChange:function(){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_afterScrollHeightChange:function(){this._yScroll&&this._syncScrollUI()},_afterScrollSort:function(){var e,t;this._yScroll&&this._yScrollHeader&&(t="."+this.getClassName("header"),e=this._theadNode.all(t),this._yScrollHeader.all(t).each(function(t,n){t.set("className",e.item(n).get("className"))}))},_afterScrollWidthChange:function(){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_bindScrollbar:function(){var t=this._scrollbarNode,n=this._yScrollNode;t&&n&&!this._scrollbarEventHandle&&(this._scrollbarEventHandle=new e.Event.Handle([t.on("scroll",this._syncScrollPosition,this),n.on("scroll",this._syncScrollPosition,this)]))},_bindScrollResize:function(){this._scrollResizeHandle||(this._scrollResizeHandle=e.on("resize",this._syncScrollUI,null,this))},_bindScrollUI:function(){this.after({columnsChange:e.bind("_afterScrollColumnsChange",this),heightChange:e.bind("_afterScrollHeightChange",this),widthChange:e.bind("_afterScrollWidthChange",this),captionChange:e.bind("_afterScrollCaptionChange",this),scrollableChange:e.bind("_afterScrollableChange",this),sort:e.bind("_afterScrollSort",this)}),this.after(["dataChange","*:add","*:remove","*:reset","*:change"],e.bind("_afterScrollDataChange",this))},_clearScrollLock:function(){this._scrollLock&&(this._scrollLock.cancel(),delete this._scrollLock)},_createScrollbar:function(){var t=this._scrollbarNode;return t||(t=this._scrollbarNode=e.Node.create(e.Lang.sub(this._SCROLLBAR_TEMPLATE,{className:this.getClassName("scrollbar")})),t.setStyle("width",e.DOM.getScrollbarWidth()+1+"px")),t},_createScrollCaptionTable:function(){return this._captionTable||(this._captionTable=e.Node.create(e.Lang.sub(this._CAPTION_TABLE_TEMPLATE,{className:this.getClassName("caption","table")})),this._captionTable.empty()),this._captionTable},_createXScrollNode:function(){return this._xScrollNode||(this._xScrollNode=e.Node.create(e.Lang.sub(this._X_SCROLLER_TEMPLATE,{className:this.getClassName("x","scroller")}))),this._xScrollNode},_createYScrollHeader:function(){var t=this._yScrollHeader;return t||(t=this._yScrollHeader=e.Node.create(e.Lang.sub(this._Y_SCROLL_HEADER_TEMPLATE,{className:this.getClassName("scroll","columns")}))),t},_createYScrollNode:function(){var t;return this._yScrollNode||(t=this.getClassName("y","scroller"),this._yScrollContainer=e.Node.create(e.Lang.sub(this._Y_SCROLLER_TEMPLATE,{className:this.getClassName("y","scroller","container"),scrollerClassName:t})),this._yScrollNode=this._yScrollContainer.one("."+t)),this._yScrollContainer},_disableScrolling:function(){this._removeScrollCaptionTable(),this._disableXScrolling(),this._disableYScrolling(),this._unbindScrollResize(),this._uiSetWidth(this.get("width"))},_disableXScrolling:function(){this._removeXScrollNode()},_disableYScrolling:function(){this._removeYScrollHeader(),this._removeYScrollNode(),this._removeYScrollContainer(),this._removeScrollbar()},destructor:function(){this._unbindScrollbar(),this._unbindScrollResize(),this._clearScrollLock()},initializer:function(){this._setScrollProperties(),this.after(["scrollableChange","heightChange","widthChange"],this._setScrollProperties),this.after("renderView",e.bind("_syncScrollUI",this)),e.Do.after(this._bindScrollUI,this,"bindUI")},_removeScrollCaptionTable:function(){this._captionTable&&(this._captionNode&&this._tableNode.prepend(this._captionNode),this._captionTable.remove().destroy(!0),delete this._captionTable)},_removeXScrollNode:function(){var e=this._xScrollNode;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._xScrollNode)},_removeYScrollContainer:function(){var e=this._yScrollContainer;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._yScrollContainer)},_removeYScrollHeader:function(){this._yScrollHeader&&(this._yScrollHeader.remove().destroy(!0),delete this._yScrollHeader)},_removeYScrollNode:function(){var e=this._yScrollNode;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._yScrollNode)},_removeScrollbar:function(){this._scrollbarNode&&(this._scrollbarNode.remove().destroy(!0),delete this._scrollbarNode),this._scrollbarEventHandle&&(this._scrollbarEventHandle
.detach(),delete this._scrollbarEventHandle)},_setScrollable:function(t){return t===!0&&(t="xy"),r(t)&&(t=t.toLowerCase()),t===!1||t==="y"||t==="x"||t==="xy"?t:e.Attribute.INVALID_VALUE},_setScrollProperties:function(){var e=this.get("scrollable")||"",t=this.get("width"),n=this.get("height");this._xScroll=t&&e.indexOf("x")>-1,this._yScroll=n&&e.indexOf("y")>-1},_syncScrollPosition:function(t){var n=this._scrollbarNode,r=this._yScrollNode,i=t.currentTarget,s;if(n&&r){if(this._scrollLock&&this._scrollLock.source!==i)return;this._clearScrollLock(),this._scrollLock=e.later(300,this,this._clearScrollLock),this._scrollLock.source=i,s=i===n?r:n,s.set("scrollTop",i.get("scrollTop"))}},_syncScrollCaptionUI:function(){var t=this._captionNode,n=this._tableNode,r=this._captionTable,i;t?(i=t.getAttribute("id"),r||(r=this._createScrollCaptionTable(),this.get("contentBox").prepend(r)),t.get("parentNode").compareTo(r)||(r.empty().insert(t),i||(i=e.stamp(t),t.setAttribute("id",i)),n.setAttribute("aria-describedby",i))):r&&this._removeScrollCaptionTable()},_syncScrollColumnWidths:function(){var t=[];this._theadNode&&this._yScrollHeader&&(this._theadNode.all("."+this.getClassName("header")).each(function(n){t.push(e.UA.ie&&e.UA.ie<8?n.get("clientWidth")-u(n,"paddingLeft")-u(n,"paddingRight")+"px":n.getComputedStyle("width"))}),this._yScrollHeader.all("."+this.getClassName("scroll","liner")).each(function(e,n){e.setStyle("width",t[n])}))},_syncScrollHeaders:function(){var t=this._yScrollHeader,n=this._SCROLL_LINER_TEMPLATE,r=this.getClassName("scroll","liner"),i=this.getClassName("header"),s=this._theadNode.all("."+i);this._theadNode&&t&&(t.empty().appendChild(this._theadNode.cloneNode(!0)),t.all("[id]").removeAttribute("id"),t.all("."+i).each(function(t,i){var o=e.Node.create(e.Lang.sub(n,{className:r})),u=s.item(i);o.setStyle("padding",u.getComputedStyle("paddingTop")+" "+u.getComputedStyle("paddingRight")+" "+u.getComputedStyle("paddingBottom")+" "+u.getComputedStyle("paddingLeft")),o.appendChild(t.get("childNodes").toFrag()),t.appendChild(o)},this),this._syncScrollColumnWidths(),this._addScrollbarPadding())},_syncScrollUI:function(){var e=this._xScroll,t=this._yScroll,n=this._xScrollNode,r=this._yScrollNode,i=n&&n.get("scrollLeft"),s=r&&r.get("scrollTop");this._uiSetScrollable(),e||t?((this.get("width")||"").slice(-1)==="%"?this._bindScrollResize():this._unbindScrollResize(),this._syncScrollCaptionUI()):this._disableScrolling(),this._yScrollHeader&&this._yScrollHeader.setStyle("display","none"),e&&(t||this._disableYScrolling(),this._syncXScrollUI(t)),t&&(e||this._disableXScrolling(),this._syncYScrollUI(e)),i&&this._xScrollNode&&this._xScrollNode.set("scrollLeft",i),s&&this._yScrollNode&&this._yScrollNode.set("scrollTop",s)},_syncXScrollUI:function(t){var n=this._xScrollNode,r=this._yScrollContainer,i=this._tableNode,s=this.get("width"),o=this.get("boundingBox").get("offsetWidth"),a=e.DOM.getScrollbarWidth(),f,l;n||(n=this._createXScrollNode(),(r||i).replace(n).appendTo(n)),f=u(n,"borderLeftWidth")+u(n,"borderRightWidth"),n.setStyle("width",""),this._uiSetDim("width",""),t&&this._yScrollContainer&&this._yScrollContainer.setStyle("width",""),e.UA.ie&&e.UA.ie<8&&(i.setStyle("width",s),i.get("offsetWidth")),i.setStyle("width",""),l=i.get("offsetWidth"),i.setStyle("width",l+"px"),this._uiSetDim("width",s),n.setStyle("width",o-f+"px"),n.get("offsetWidth")-f>l&&(t?i.setStyle("width",n.get("offsetWidth")-f-a+"px"):i.setStyle("width","100%"))},_syncYScrollUI:function(t){var n=this._yScrollContainer,r=this._yScrollNode,i=this._xScrollNode,s=this._yScrollHeader,o=this._scrollbarNode,a=this._tableNode,f=this._theadNode,l=this._captionTable,c=this.get("boundingBox"),h=this.get("contentBox"),p=this.get("width"),d=c.get("offsetHeight"),v=e.DOM.getScrollbarWidth(),m;l&&!t&&l.setStyle("width",p||"100%"),n||(n=this._createYScrollNode(),r=this._yScrollNode,a.replace(n).appendTo(r)),m=t?i:n,t||a.setStyle("width",""),t&&(d-=v),r.setStyle("height",d-m.get("offsetTop")-u(m,"borderTopWidth")-u(m,"borderBottomWidth")+"px"),t?n.setStyle("width",a.get("offsetWidth")+v+"px"):this._uiSetYScrollWidth(p),l&&!t&&l.setStyle("width",n.get("offsetWidth")+"px"),f&&!s&&(s=this._createYScrollHeader(),n.prepend(s),this._syncScrollHeaders()),s&&(this._syncScrollColumnWidths(),s.setStyle("display",""),o||(o=this._createScrollbar(),this._bindScrollbar(),h.prepend(o)),this._uiSetScrollbarHeight(),this._uiSetScrollbarPosition(m))},_uiSetScrollable:function(){this.get("boundingBox").toggleClass(this.getClassName("scrollable","x"),this._xScroll).toggleClass(this.getClassName("scrollable","y"),this._yScroll)},_uiSetScrollbarHeight:function(){var e=this._scrollbarNode,t=this._yScrollNode,n=this._yScrollHeader;e&&t&&n&&(e.get("firstChild").setStyle("height",this._tbodyNode.get("scrollHeight")+"px"),e.setStyle("height",parseFloat(t.getComputedStyle("height"))-parseFloat(n.getComputedStyle("height"))+"px"))},_uiSetScrollbarPosition:function(t){var n=this._scrollbarNode,r=this._yScrollHeader;n&&t&&r&&n.setStyles({top:parseFloat(r.getComputedStyle("height"))+u(t,"borderTopWidth")+t.get("offsetTop")+"px",left:t.get("offsetWidth")-e.DOM.getScrollbarWidth()-1-u(t,"borderRightWidth")+"px"})},_uiSetYScrollWidth:function(t){var n=this._yScrollContainer,r=this._tableNode,i,s,o,u;n&&r&&(u=e.DOM.getScrollbarWidth(),t?(s=n.get("offsetWidth")-n.get("clientWidth")+u,n.setStyle("width",t),o=n.get("clientWidth")-s,r.setStyle("width",o+"px"),i=r.get("offsetWidth"),n.setStyle("width",i+u+"px")):(r.setStyle("width",""),n.setStyle("width",""),n.setStyle("width",r.get("offsetWidth")+u+"px")))},_unbindScrollbar:function(){this._scrollbarEventHandle&&this._scrollbarEventHandle.detach()},_unbindScrollResize:function(){this._scrollResizeHandle&&(this._scrollResizeHandle.detach(),delete this._scrollResizeHandle)}},!0),e.Base.mix(e.DataTable,[o])},"3.17.0",{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0});
| CarlosOhh/cdnjs | ajax/libs/yui/3.17.0/datatable-scroll/datatable-scroll-min.js | JavaScript | mit | 12,120 |
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v1.8.2
//
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
//
// http://marionettejs.com
/*!
* Includes BabySitter
* https://github.com/marionettejs/backbone.babysitter/
*
* Includes Wreqr
* https://github.com/marionettejs/backbone.wreqr/
*/
Backbone.ChildViewContainer=function(a,b){var c=function(a){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),b.each(a,this.add,this)};b.extend(c.prototype,{add:function(a,b){var c=a.cid;return this._views[c]=a,a.model&&(this._indexByModel[a.model.cid]=c),b&&(this._indexByCustom[b]=c),this._updateLength(),this},findByModel:function(a){return this.findByModelCid(a.cid)},findByModelCid:function(a){var b=this._indexByModel[a];return this.findByCid(b)},findByCustom:function(a){var b=this._indexByCustom[a];return this.findByCid(b)},findByIndex:function(a){return b.values(this._views)[a]},findByCid:function(a){return this._views[a]},remove:function(a){var c=a.cid;return a.model&&delete this._indexByModel[a.model.cid],b.any(this._indexByCustom,function(a,b){return a===c?(delete this._indexByCustom[b],!0):void 0},this),delete this._views[c],this._updateLength(),this},call:function(a){this.apply(a,b.tail(arguments))},apply:function(a,c){b.each(this._views,function(d){b.isFunction(d[a])&&d[a].apply(d,c||[])})},_updateLength:function(){this.length=b.size(this._views)}});var d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return b.each(d,function(a){c.prototype[a]=function(){var c=b.values(this._views),d=[c].concat(b.toArray(arguments));return b[a].apply(b,d)}}),c}(Backbone,_),Backbone.Wreqr=function(a,b,c){"use strict";var d={};return d.Handlers=function(a,b){var c=function(a){this.options=a,this._wreqrHandlers={},b.isFunction(this.initialize)&&this.initialize(a)};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events,{setHandlers:function(a){b.each(a,function(a,c){var d=null;b.isObject(a)&&!b.isFunction(a)&&(d=a.context,a=a.callback),this.setHandler(c,a,d)},this)},setHandler:function(a,b,c){var d={callback:b,context:c};this._wreqrHandlers[a]=d,this.trigger("handler:add",a,b,c)},hasHandler:function(a){return!!this._wreqrHandlers[a]},getHandler:function(a){var b=this._wreqrHandlers[a];if(b)return function(){var a=Array.prototype.slice.apply(arguments);return b.callback.apply(b.context,a)}},removeHandler:function(a){delete this._wreqrHandlers[a]},removeAllHandlers:function(){this._wreqrHandlers={}}}),c}(a,c),d.CommandStorage=function(){var b=function(a){this.options=a,this._commands={},c.isFunction(this.initialize)&&this.initialize(a)};return c.extend(b.prototype,a.Events,{getCommands:function(a){var b=this._commands[a];return b||(b={command:a,instances:[]},this._commands[a]=b),b},addCommand:function(a,b){var c=this.getCommands(a);c.instances.push(b)},clearCommands:function(a){var b=this.getCommands(a);b.instances=[]}}),b}(),d.Commands=function(a){return a.Handlers.extend({storageType:a.CommandStorage,constructor:function(b){this.options=b||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var c=Array.prototype.slice.call(arguments);a.Handlers.prototype.constructor.apply(this,c)},execute:function(a,b){a=arguments[0],b=Array.prototype.slice.call(arguments,1),this.hasHandler(a)?this.getHandler(a).apply(this,b):this.storage.addCommand(a,b)},_executeCommands:function(a,b,d){var e=this.storage.getCommands(a);c.each(e.instances,function(a){b.apply(d,a)}),this.storage.clearCommands(a)},_initializeStorage:function(a){var b,d=a.storageType||this.storageType;b=c.isFunction(d)?new d:d,this.storage=b}})}(d),d.RequestResponse=function(a){return a.Handlers.extend({request:function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);return this.hasHandler(a)?this.getHandler(a).apply(this,b):void 0}})}(d),d.EventAggregator=function(a,b){var c=function(){};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events),c}(a,c),d.Channel=function(){var b=function(b){this.vent=new a.Wreqr.EventAggregator,this.reqres=new a.Wreqr.RequestResponse,this.commands=new a.Wreqr.Commands,this.channelName=b};return c.extend(b.prototype,{reset:function(){return this.vent.off(),this.vent.stopListening(),this.reqres.removeAllHandlers(),this.commands.removeAllHandlers(),this},connectEvents:function(a,b){return this._connect("vent",a,b),this},connectCommands:function(a,b){return this._connect("commands",a,b),this},connectRequests:function(a,b){return this._connect("reqres",a,b),this},_connect:function(a,b,d){if(b){d=d||this;var e="vent"===a?"on":"setHandler";c.each(b,function(b,f){this[a][e](f,c.bind(b,d))},this)}}}),b}(d),d.radio=function(a){var b=function(){this._channels={},this.vent={},this.commands={},this.reqres={},this._proxyMethods()};c.extend(b.prototype,{channel:function(a){if(!a)throw new Error("Channel must receive a name");return this._getChannel(a)},_getChannel:function(b){var c=this._channels[b];return c||(c=new a.Channel(b),this._channels[b]=c),c},_proxyMethods:function(){c.each(["vent","commands","reqres"],function(a){c.each(d[a],function(b){this[a][b]=e(this,a,b)},this)},this)}});var d={vent:["on","off","trigger","once","stopListening","listenTo","listenToOnce"],commands:["execute","setHandler","setHandlers","removeHandler","removeAllHandlers"],reqres:["request","setHandler","setHandlers","removeHandler","removeAllHandlers"]},e=function(a,b,c){return function(d){var e=a._getChannel(d)[b],f=Array.prototype.slice.call(arguments,1);e[c].apply(e,f)}};return new b}(d),d}(Backbone,Backbone.Marionette,_);var Marionette=function(a,b,c){"use strict";function d(a,b){var c=new Error(a);throw c.name=b||"Error",c}var e={};b.Marionette=e,e.$=b.$;var f=Array.prototype.slice;return e.extend=b.Model.extend,e.getOption=function(a,b){if(a&&b){var c;return c=a.options&&b in a.options&&void 0!==a.options[b]?a.options[b]:a[b]}},e.normalizeMethods=function(a){var b,d={};return c.each(a,function(a,e){b=a,c.isFunction(b)||(b=this[b]),b&&(d[e]=b)},this),d},e.normalizeUIKeys=function(a,b){return"undefined"!=typeof a?(c.each(c.keys(a),function(c){var d=/@ui.[a-zA-Z_$0-9]*/g;c.match(d)&&(a[c.replace(d,function(a){return b[a.slice(4)]})]=a[c],delete a[c])}),a):void 0},e.actAsCollection=function(a,b){var d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];c.each(d,function(d){a[d]=function(){var a=c.values(c.result(this,b)),e=[a].concat(c.toArray(arguments));return c[d].apply(c,e)}})},e.triggerMethod=function(){function a(a,b,c){return c.toUpperCase()}var b=/(^|:)(\w)/gi,d=function(d){var e="on"+d.replace(b,a),f=this[e];return c.isFunction(this.trigger)&&this.trigger.apply(this,arguments),c.isFunction(f)?f.apply(this,c.tail(arguments)):void 0};return d}(),e.MonitorDOMRefresh=function(a){function b(a){a._isShown=!0,e(a)}function d(a){a._isRendered=!0,e(a)}function e(a){a._isShown&&a._isRendered&&f(a)&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}function f(b){return a.contains(b.el)}return function(a){a.listenTo(a,"show",function(){b(a)}),a.listenTo(a,"render",function(){d(a)})}}(document.documentElement),function(a){function b(a,b,e,f){var g=f.split(/\s+/);c.each(g,function(c){var f=a[c];f||d("Method '"+c+"' was configured as an event handler, but does not exist."),a.listenTo(b,e,f)})}function e(a,b,c,d){a.listenTo(b,c,d)}function f(a,b,d,e){var f=e.split(/\s+/);c.each(f,function(c){var e=a[c];a.stopListening(b,d,e)})}function g(a,b,c,d){a.stopListening(b,c,d)}function h(a,b,d,e,f){b&&d&&(c.isFunction(d)&&(d=d.call(a)),c.each(d,function(d,g){c.isFunction(d)?e(a,b,g,d):f(a,b,g,d)}))}a.bindEntityEvents=function(a,c,d){h(a,c,d,e,b)},a.unbindEntityEvents=function(a,b,c){h(a,b,c,g,f)}}(e),e.Callbacks=function(){this._deferred=e.$.Deferred(),this._callbacks=[]},c.extend(e.Callbacks.prototype,{add:function(a,b){this._callbacks.push({cb:a,ctx:b}),this._deferred.done(function(c,d){b&&(c=b),a.call(c,d)})},run:function(a,b){this._deferred.resolve(b,a)},reset:function(){var a=this._callbacks;this._deferred=e.$.Deferred(),this._callbacks=[],c.each(a,function(a){this.add(a.cb,a.ctx)},this)}}),e.Controller=function(a){this.triggerMethod=e.triggerMethod,this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},e.Controller.extend=e.extend,c.extend(e.Controller.prototype,b.Events,{close:function(){this.stopListening();var a=Array.prototype.slice.call(arguments);this.triggerMethod.apply(this,["close"].concat(a)),this.off()}}),e.Region=function(a){if(this.options=a||{},this.el=e.getOption(this,"el"),this.el||d("An 'el' must be specified for a region.","NoElError"),this.initialize){var b=Array.prototype.slice.apply(arguments);this.initialize.apply(this,b)}},c.extend(e.Region,{buildRegion:function(a,b){var e=c.isString(a),f=c.isString(a.selector),g=c.isUndefined(a.regionType),h=c.isFunction(a);h||e||f||d("Region must be specified as a Region type, a selector string or an object with selector property");var i,j;e&&(i=a),a.selector&&(i=a.selector,delete a.selector),h&&(j=a),!h&&g&&(j=b),a.regionType&&(j=a.regionType,delete a.regionType),(e||h)&&(a={}),a.el=i;var k=new j(a);return a.parentEl&&(k.getEl=function(b){var d=a.parentEl;return c.isFunction(d)&&(d=d()),d.find(b)}),k}}),c.extend(e.Region.prototype,b.Events,{show:function(a,b){this.ensureEl();var d=b||{},f=a.isClosed||c.isUndefined(a.$el),g=a!==this.currentView,h=!!d.preventClose,i=!h&&g;i&&this.close(),a.render(),e.triggerMethod.call(this,"before:show",a),e.triggerMethod.call(a,"before:show"),(g||f)&&this.open(a),this.currentView=a,e.triggerMethod.call(this,"show",a),e.triggerMethod.call(a,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(a){return e.$(a)},open:function(a){this.$el.empty().append(a.el)},close:function(){var a=this.currentView;a&&!a.isClosed&&(a.close?a.close():a.remove&&a.remove(),e.triggerMethod.call(this,"close",a),delete this.currentView)},attachView:function(a){this.currentView=a},reset:function(){this.close(),delete this.$el}}),e.Region.extend=e.extend,e.RegionManager=function(a){var b=a.Controller.extend({constructor:function(b){this._regions={},a.Controller.prototype.constructor.call(this,b)},addRegions:function(a,b){var d={};return c.each(a,function(a,e){c.isString(a)&&(a={selector:a}),a.selector&&(a=c.defaults({},a,b));var f=this.addRegion(e,a);d[e]=f},this),d},addRegion:function(b,d){var e,f=c.isObject(d),g=c.isString(d),h=!!d.selector;return e=g||f&&h?a.Region.buildRegion(d,a.Region):c.isFunction(d)?a.Region.buildRegion(d,a.Region):d,this._store(b,e),this.triggerMethod("region:add",b,e),e},get:function(a){return this._regions[a]},removeRegion:function(a){var b=this._regions[a];this._remove(a,b)},removeRegions:function(){c.each(this._regions,function(a,b){this._remove(b,a)},this)},closeRegions:function(){c.each(this._regions,function(a){a.close()},this)},close:function(){this.removeRegions(),a.Controller.prototype.close.apply(this,arguments)},_store:function(a,b){this._regions[a]=b,this._setLength()},_remove:function(a,b){b.close(),b.stopListening(),delete this._regions[a],this._setLength(),this.triggerMethod("region:remove",a,b)},_setLength:function(){this.length=c.size(this._regions)}});return a.actAsCollection(b.prototype,"_regions"),b}(e),e.TemplateCache=function(a){this.templateId=a},c.extend(e.TemplateCache,{templateCaches:{},get:function(a){var b=this.templateCaches[a];return b||(b=new e.TemplateCache(a),this.templateCaches[a]=b),b.load()},clear:function(){var a,b=f.call(arguments),c=b.length;if(c>0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(e.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var a=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(a),this.compiledTemplate},loadTemplate:function(a){var b=e.$(a).html();return b&&0!==b.length||d("Could not find template: '"+a+"'","NoTemplateError"),b},compileTemplate:function(a){return c.template(a)}}),e.Renderer={render:function(a,b){a||d("Cannot render the template since it's false, null or undefined.","TemplateNotFoundError");var c;return(c="function"==typeof a?a:e.TemplateCache.get(a))(b)}},e.View=b.View.extend({constructor:function(a){c.bindAll(this,"render"),c.isObject(this.behaviors)&&new e.Behaviors(this),this.options=c.extend({},c.result(this,"options"),c.isFunction(a)?a.call(this):a),this.events=this.normalizeUIKeys(c.result(this,"events")),b.View.prototype.constructor.apply(this,arguments),e.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled)},triggerMethod:e.triggerMethod,normalizeMethods:e.normalizeMethods,getTemplate:function(){return e.getOption(this,"template")},mixinTemplateHelpers:function(a){a=a||{};var b=e.getOption(this,"templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},normalizeUIKeys:function(a){var b=c.result(this,"ui");return e.normalizeUIKeys(a,b)},configureTriggers:function(){if(this.triggers){var a={},b=this.normalizeUIKeys(c.result(this,"triggers"));return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){this._delegateDOMEvents(a),e.bindEntityEvents(this,this.model,e.getOption(this,"modelEvents")),e.bindEntityEvents(this,this.collection,e.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this));var d={},e=c.result(this,"behaviorEvents")||{},f=this.configureTriggers();c.extend(d,e,a,f),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=Array.prototype.slice.call(arguments);b.View.prototype.undelegateEvents.apply(this,a),e.unbindEntityEvents(this,this.model,e.getOption(this,"modelEvents")),e.unbindEntityEvents(this,this.collection,e.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var a=Array.prototype.slice.call(arguments),b=this.triggerMethod.apply(this,["before:close"].concat(a));b!==!1&&(this.isClosed=!0,this.triggerMethod.apply(this,["close"].concat(a)),this.unbindUIElements(),this.remove())}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var a=c.result(this,"_uiBindings");this.ui={},c.each(c.keys(a),function(b){var c=a[b];this.ui[b]=this.$(c)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(c.each(this.ui,function(a,b){delete this.ui[b]},this),this.ui=this._uiBindings,delete this._uiBindings)}}),e.ItemView=e.View.extend({constructor:function(){e.View.prototype.constructor.apply(this,arguments)},serializeData:function(){var a={};return this.model?a=this.model.toJSON():this.collection&&(a={items:this.collection.toJSON()}),a},render:function(){this.isClosed=!1,this.triggerMethod("before:render",this),this.triggerMethod("item:before:render",this);var a=this.serializeData();a=this.mixinTemplateHelpers(a);var b=this.getTemplate(),c=e.Renderer.render(b,a);return this.$el.html(c),this.bindUIElements(),this.triggerMethod("render",this),this.triggerMethod("item:rendered",this),this},close:function(){this.isClosed||(this.triggerMethod("item:before:close"),e.View.prototype.close.apply(this,arguments),this.triggerMethod("item:closed"))}}),e.CollectionView=e.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),e.View.prototype.constructor.apply(this,arguments),this._initialEvents(),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this.appendBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()},_triggerShowBufferedChildren:function(){this._isShown&&(c.each(this._bufferedChildren,function(a){e.triggerMethod.call(a,"show")}),this._bufferedChildren=[])},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView),this.listenTo(this.collection,"remove",this.removeItemView),this.listenTo(this.collection,"reset",this.render))},addChildView:function(a){this.closeEmptyView();var b=this.getItemView(a),c=this.collection.indexOf(a);this.addItemView(a,b,c)},onShowCalled:function(){this.children.each(function(a){e.triggerMethod.call(a,"show")})},triggerBeforeRender:function(){this.triggerMethod("before:render",this),this.triggerMethod("collection:before:render",this)},triggerRendered:function(){this.triggerMethod("render",this),this.triggerMethod("collection:rendered",this)},render:function(){return this.isClosed=!1,this.triggerBeforeRender(),this._renderChildren(),this.triggerRendered(),this},_renderChildren:function(){this.startBuffering(),this.closeEmptyView(),this.closeChildren(),this.isEmpty(this.collection)?this.showEmptyView():this.showCollection(),this.endBuffering()},showCollection:function(){var a;this.collection.each(function(b,c){a=this.getItemView(b),this.addItemView(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this._showingEmptyView=!0;var c=new b.Model;this.addItemView(c,a,0)}},closeEmptyView:function(){this._showingEmptyView&&(this.closeChildren(),delete this._showingEmptyView)},getEmptyView:function(){return e.getOption(this,"emptyView")},getItemView:function(){var a=e.getOption(this,"itemView");return a||d("An `itemView` must be specified","NoItemViewError"),a},addItemView:function(a,b,d){var f=e.getOption(this,"itemViewOptions");c.isFunction(f)&&(f=f.call(this,a,d));var g=this.buildItemView(a,b,f);return this.addChildViewEventForwarding(g),this.triggerMethod("before:item:added",g),this.children.add(g),this.renderItemView(g,d),this._isShown&&!this.isBuffering&&e.triggerMethod.call(g,"show"),this.triggerMethod("after:item:added",g),g},addChildViewEventForwarding:function(a){var b=e.getOption(this,"itemViewEventPrefix");this.listenTo(a,"all",function(){var d=f.call(arguments),g=d[0],h=this.normalizeMethods(this.getItemEvents());d[0]=b+":"+g,d.splice(1,0,a),"undefined"!=typeof h&&c.isFunction(h[g])&&h[g].apply(this,d),e.triggerMethod.apply(this,d)},this)},getItemEvents:function(){return c.isFunction(this.itemEvents)?this.itemEvents.call(this):this.itemEvents},renderItemView:function(a,b){a.render(),this.appendHtml(this,a,b)},buildItemView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeItemView:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},removeChildView:function(a){a&&(a.close?a.close():a.remove&&a.remove(),this.stopListening(a),this.children.remove(a)),this.triggerMethod("item:removed",a)},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},appendBuffer:function(a,b){a.$el.append(b)},appendHtml:function(a,b){a.isBuffering?(a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b)):a.$el.append(b.el)},_initChildViewStorage:function(){this.children=new b.ChildViewContainer},close:function(){this.isClosed||(this.triggerMethod("collection:before:close"),this.closeChildren(),this.triggerMethod("collection:closed"),e.View.prototype.close.apply(this,arguments))},closeChildren:function(){this.children.each(function(a){this.removeChildView(a)},this),this.checkEmpty()}}),e.CompositeView=e.CollectionView.extend({constructor:function(){e.CollectionView.prototype.constructor.apply(this,arguments)},_initialEvents:function(){this.once("render",function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView),this.listenTo(this.collection,"remove",this.removeItemView),this.listenTo(this.collection,"reset",this._renderChildren))})},getItemView:function(){var a=e.getOption(this,"itemView")||this.constructor;return a||d("An `itemView` must be specified","NoItemViewError"),a},serializeData:function(){var a={};return this.model&&(a=this.model.toJSON()),a},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var a=this.renderModel();return this.$el.html(a),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(this.triggerMethod("composite:collection:before:render"),e.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var a={};a=this.serializeData(),a=this.mixinTemplateHelpers(a);var b=this.getTemplate();return e.Renderer.render(b,a)},appendBuffer:function(a,b){var c=this.getItemViewContainer(a);c.append(b)},appendHtml:function(a,b){if(a.isBuffering)a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b);else{var c=this.getItemViewContainer(a);c.append(b.el)}},getItemViewContainer:function(a){if("$itemViewContainer"in a)return a.$itemViewContainer;var b,f=e.getOption(a,"itemViewContainer");if(f){var g=c.isFunction(f)?f.call(a):f;b="@"===g.charAt(0)&&a.ui?a.ui[g.substr(4)]:a.$(g),b.length<=0&&d("The specified `itemViewContainer` was not found: "+a.itemViewContainer,"ItemViewContainerMissingError")}else b=a.$el;return a.$itemViewContainer=b,b},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),e.Layout=e.ItemView.extend({regionType:e.Region,constructor:function(a){a=a||{},this._firstRender=!0,this._initializeRegions(a),e.ItemView.prototype.constructor.call(this,a)},render:function(){return this.isClosed&&this._initializeRegions(),this._firstRender?this._firstRender=!1:this.isClosed||this._reInitializeRegions(),e.ItemView.prototype.render.apply(this,arguments)},close:function(){this.isClosed||(this.regionManager.close(),e.ItemView.prototype.close.apply(this,arguments))},addRegion:function(a,b){var c={};return c[a]=b,this._buildRegions(c)[a]},addRegions:function(a){return this.regions=c.extend({},this.regions,a),this._buildRegions(a)},removeRegion:function(a){return delete this.regions[a],this.regionManager.removeRegion(a)},getRegion:function(a){return this.regionManager.get(a)},_buildRegions:function(a){var b=this,c={regionType:e.getOption(this,"regionType"),parentEl:function(){return b.$el}};return this.regionManager.addRegions(a,c)},_initializeRegions:function(a){var b;this._initRegionManager(),b=c.isFunction(this.regions)?this.regions(a):this.regions||{},this.addRegions(b)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(a){a.reset()})},_initRegionManager:function(){this.regionManager=new e.RegionManager,this.listenTo(this.regionManager,"region:add",function(a,b){this[a]=b,this.trigger("region:add",a,b)}),this.listenTo(this.regionManager,"region:remove",function(a,b){delete this[a],this.trigger("region:remove",a,b)})}}),e.Behavior=function(a,b){function c(b,c){this.view=c,this.defaults=a.result(this,"defaults")||{},this.options=a.extend({},this.defaults,b),this.$=function(){return this.view.$.apply(this.view,arguments)},this.initialize.apply(this,arguments)}return a.extend(c.prototype,b.Events,{initialize:function(){},close:function(){this.stopListening()},triggerMethod:e.triggerMethod}),c.extend=e.extend,c}(c,b),e.Behaviors=function(a,b){function c(a){this.behaviors=c.parseBehaviors(a,b.result(a,"behaviors")),c.wrap(a,this.behaviors,["bindUIElements","unbindUIElements","delegateEvents","undelegateEvents","onShow","onClose","behaviorEvents","triggerMethod","setElement","close"])}var d={setElement:function(a,c){a.apply(this,b.tail(arguments,2)),b.each(c,function(a){a.$el=this.$el},this)},close:function(a,c){var d=b.tail(arguments,2);a.apply(this,d),b.invoke(c,"close",d)},onShow:function(c,d){var e=b.tail(arguments,2);b.each(d,function(b){a.triggerMethod.apply(b,["show"].concat(e))}),b.isFunction(c)&&c.apply(this,e)},onClose:function(c,d){var e=b.tail(arguments,2);b.each(d,function(b){a.triggerMethod.apply(b,["close"].concat(e))}),b.isFunction(c)&&c.apply(this,e)},bindUIElements:function(a,c){a.apply(this),b.invoke(c,a)},unbindUIElements:function(a,c){a.apply(this),b.invoke(c,a)},triggerMethod:function(a,c){var d=b.tail(arguments,2);a.apply(this,d),b.each(c,function(b){a.apply(b,d)})},delegateEvents:function(c,d){var e=b.tail(arguments,2);c.apply(this,e),b.each(d,function(b){a.bindEntityEvents(b,this.model,a.getOption(b,"modelEvents")),a.bindEntityEvents(b,this.collection,a.getOption(b,"collectionEvents"))},this)},undelegateEvents:function(c,d){var e=b.tail(arguments,2);c.apply(this,e),b.each(d,function(b){a.unbindEntityEvents(b,this.model,a.getOption(b,"modelEvents")),a.unbindEntityEvents(b,this.collection,a.getOption(b,"collectionEvents"))},this)},behaviorEvents:function(c,d){var e={},f=b.result(this,"ui");return b.each(d,function(c,d){var g={},h=b.result(c,"events")||{},i=b.result(c,"ui"),j=b.extend({},f,i);h=a.normalizeUIKeys(h,j),b.each(b.keys(h),function(a){var e=new Array(d+2).join(" "),f=a+e,i=b.isFunction(h[a])?h[a]:c[h[a]];g[f]=b.bind(i,c)}),e=b.extend(e,g)}),e}};return b.extend(c,{behaviorsLookup:function(){throw new Error("You must define where your behaviors are stored. See https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.behaviors.md#behaviorslookup")},getBehaviorClass:function(a,d){return a.behaviorClass?a.behaviorClass:b.isFunction(c.behaviorsLookup)?c.behaviorsLookup.apply(this,arguments)[d]:c.behaviorsLookup[d]},parseBehaviors:function(a,d){return b.map(d,function(b,d){var e=c.getBehaviorClass(b,d);return new e(b,a)})},wrap:function(a,c,e){b.each(e,function(e){a[e]=b.partial(d[e],a[e],c)})}}),c}(e,c),e.AppRouter=b.Router.extend({constructor:function(a){b.Router.prototype.constructor.apply(this,arguments),this.options=a||{};var c=e.getOption(this,"appRoutes"),d=this._getController();this.processAppRoutes(d,c),this.on("route",this._processOnRoute,this)},appRoute:function(a,b){var c=this._getController();this._addAppRoute(c,a,b)},_processOnRoute:function(a,b){var d=c.invert(this.appRoutes)[a];c.isFunction(this.onRoute)&&this.onRoute(a,d,b)},processAppRoutes:function(a,b){if(b){var d=c.keys(b).reverse();c.each(d,function(c){this._addAppRoute(a,c,b[c])},this)}},_getController:function(){return e.getOption(this,"controller")},_addAppRoute:function(a,b,e){var f=a[e];f||d("Method '"+e+"' was not found on the controller"),this.route(b,e,c.bind(f,a))}}),e.Application=function(a){this._initRegionManager(),this._initCallbacks=new e.Callbacks,this.vent=new b.Wreqr.EventAggregator,this.commands=new b.Wreqr.Commands,this.reqres=new b.Wreqr.RequestResponse,this.submodules={},c.extend(this,a),this.triggerMethod=e.triggerMethod},c.extend(e.Application.prototype,b.Events,{execute:function(){this.commands.execute.apply(this.commands,arguments)},request:function(){return this.reqres.request.apply(this.reqres,arguments)},addInitializer:function(a){this._initCallbacks.add(a)},start:function(a){this.triggerMethod("initialize:before",a),this._initCallbacks.run(a,this),this.triggerMethod("initialize:after",a),this.triggerMethod("start",a)},addRegions:function(a){return this._regionManager.addRegions(a)},closeRegions:function(){this._regionManager.closeRegions()},removeRegion:function(a){this._regionManager.removeRegion(a)},getRegion:function(a){return this._regionManager.get(a)},module:function(a,b){var c=e.Module.getClass(b),d=f.call(arguments);return d.unshift(this),c.create.apply(c,d)},_initRegionManager:function(){this._regionManager=new e.RegionManager,this.listenTo(this._regionManager,"region:add",function(a,b){this[a]=b}),this.listenTo(this._regionManager,"region:remove",function(a){delete this[a]})}}),e.Application.extend=e.extend,e.Module=function(a,b,d){this.moduleName=a,this.options=c.extend({},this.options,d),this.initialize=d.initialize||this.initialize,this.submodules={},this._setupInitializersAndFinalizers(),this.app=b,this.startWithParent=!0,this.triggerMethod=e.triggerMethod,c.isFunction(this.initialize)&&this.initialize(this.options,a,b)},e.Module.extend=e.extend,c.extend(e.Module.prototype,b.Events,{initialize:function(){},addInitializer:function(a){this._initializerCallbacks.add(a)},addFinalizer:function(a){this._finalizerCallbacks.add(a)},start:function(a){this._isInitialized||(c.each(this.submodules,function(b){b.startWithParent&&b.start(a)}),this.triggerMethod("before:start",a),this._initializerCallbacks.run(a,this),this._isInitialized=!0,this.triggerMethod("start",a))},stop:function(){this._isInitialized&&(this._isInitialized=!1,e.triggerMethod.call(this,"before:stop"),c.each(this.submodules,function(a){a.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),e.triggerMethod.call(this,"stop"))},addDefinition:function(a,b){this._runModuleDefinition(a,b)},_runModuleDefinition:function(a,d){if(a){var f=c.flatten([this,this.app,b,e,e.$,c,d]);a.apply(this,f)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new e.Callbacks,this._finalizerCallbacks=new e.Callbacks}}),c.extend(e.Module,{create:function(a,b,d){var e=a,g=f.call(arguments);g.splice(0,3),b=b.split(".");var h=b.length,i=[];return i[h-1]=d,c.each(b,function(b,c){var f=e;e=this._getModule(f,b,a,d),this._addModuleDefinition(f,e,i[c],g)},this),e},_getModule:function(a,b,d,e){var f=c.extend({},e),g=this.getClass(e),h=a[b];return h||(h=new g(b,d,f),a[b]=h,a.submodules[b]=h),h},getClass:function(a){var b=e.Module;return a?a.prototype instanceof b?a:a.moduleClass||b:b},_addModuleDefinition:function(a,b,c,d){var e=this._getDefine(c),f=this._getStartWithParent(c,b);e&&b.addDefinition(e,d),this._addStartWithParent(a,b,f)},_getStartWithParent:function(a,b){var d;return c.isFunction(a)&&a.prototype instanceof e.Module?(d=b.constructor.prototype.startWithParent,c.isUndefined(d)?!0:d):c.isObject(a)?(d=a.startWithParent,c.isUndefined(d)?!0:d):!0},_getDefine:function(a){return!c.isFunction(a)||a.prototype instanceof e.Module?c.isObject(a)?a.define:null:a},_addStartWithParent:function(a,b,c){b.startWithParent=b.startWithParent&&c,b.startWithParent&&!b.startWithParentIsConfigured&&(b.startWithParentIsConfigured=!0,a.addInitializer(function(a){b.startWithParent&&b.start(a)}))}}),e}(this,Backbone,_);
//# sourceMappingURL=backbone.marionette.map | simudream/cdnjs | ajax/libs/backbone.marionette/1.8.2/backbone.marionette.min.js | JavaScript | mit | 30,825 |
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.lang['sq']={"editor":"Redaktues i Pasur Teksti","editorPanel":"Rich Text Editor panel","common":{"editorHelp":"Shtyp ALT 0 për ndihmë","browseServer":"Shfleto në Server","url":"URL","protocol":"Protokolli","upload":"Ngarko","uploadSubmit":"Dërgo në server","image":"Imazh","flash":"Objekt flash","form":"Formular","checkbox":"Checkbox","radio":"Buton radio","textField":"Fushë tekst","textarea":"Hapësirë tekst","hiddenField":"Fushë e fshehur","button":"Buton","select":"Menu zgjedhjeje","imageButton":"Buton imazhi","notSet":"<e pazgjedhur>","id":"Id","name":"Emër","langDir":"Kod gjuhe","langDirLtr":"Nga e majta në të djathtë (LTR)","langDirRtl":"Nga e djathta në të majtë (RTL)","langCode":"Kod gjuhe","longDescr":"Përshkrim i hollësishëm","cssClass":"Klasa stili CSS","advisoryTitle":"Titull","cssStyle":"Stil","ok":"OK","cancel":"Anulo","close":"Mbyll","preview":"Parashiko","resize":"Ripërmaso","generalTab":"Të përgjithshme","advancedTab":"Të përparuara","validateNumberFailed":"Vlera e futur nuk është një numër","confirmNewPage":"Çdo ndryshim që nuk është ruajtur do humbasë. Je i sigurtë që dëshiron të krijosh një faqe të re?","confirmCancel":"Disa opsione kanë ndryshuar. Je i sigurtë që dëshiron ta mbyllësh dritaren?","options":"Opsione","target":"Objektivi","targetNew":"Dritare e re (_blank)","targetTop":"Dritare në plan të parë (_top)","targetSelf":"E njëjta dritare (_self)","targetParent":"Dritarja prind (_parent)","langDirLTR":"Nga e majta në të djathë (LTR)","langDirRTL":"Nga e djathta në të majtë (RTL)","styles":"Stil","cssClasses":"Klasa Stili CSS","width":"Gjerësi","height":"Lartësi","align":"Rreshtim","alignLeft":"Majtas","alignRight":"Djathtas","alignCenter":"Qendër","alignTop":"Lart","alignMiddle":"Në mes","alignBottom":"Poshtë","alignNone":"None","invalidValue":"Vlerë e pavlefshme","invalidHeight":"Lartësia duhet të jetë një numër","invalidWidth":"Gjerësia duhet të jetë një numër","invalidCssLength":"Vlera e fushës \"%1\" duhet të jetë një numër pozitiv me apo pa njësi matëse të vlefshme CSS (px, %, in, cm, mm, em, ex, pt ose pc).","invalidHtmlLength":"Vlera e fushës \"%1\" duhet të jetë një numër pozitiv me apo pa njësi matëse të vlefshme HTML (px ose %)","invalidInlineStyle":"Stili inline duhet të jetë një apo disa vlera të formatit \"emër: vlerë\", ndarë nga pikëpresje.","cssLengthTooltip":"Fut një numër për vlerën në pixel apo një numër me një njësi të vlefshme CSS (px, %, in, cm, mm, ex, pt, ose pc).","unavailable":"%1<span class=\"cke_accessibility\">, i padisponueshëm</span>"},"about":{"copy":"Të drejtat e kopjimit © $1. Të gjitha të drejtat e rezervuara.","dlgTitle":"Rreth CKEditor","help":"Kontrollo $1 për ndihmë.","moreInfo":"Për informacione rreth licencave shih faqen tonë:","title":"Rreth CKEditor","userGuide":"Udhëzuesi i Shfrytëzuesit të CKEditor"},"basicstyles":{"bold":"Trash","italic":"Pjerrët","strike":"Nëpërmes","subscript":"Nën-skriptë","superscript":"Super-skriptë","underline":"Nënvijëzuar"},"bidi":{"ltr":"Drejtimi i tekstit nga e majta në të djathtë","rtl":"Drejtimi i tekstit nga e djathta në të majtë"},"blockquote":{"toolbar":"Citatet"},"clipboard":{"copy":"Kopjo","copyError":"Të dhënat e sigurisë së shfletuesit tuaj nuk lejojnë që redaktuesi automatikisht të kryej veprimin e kopjimit. Ju lutemi shfrytëzoni tastierën për këtë veprim (Ctrl/Cmd+C).","cut":"Preje","cutError":"Të dhënat e sigurisë së shfletuesit tuaj nuk lejojnë që redaktuesi automatikisht të kryej veprimin e prerjes. Ju lutemi shfrytëzoni tastierën për këtë veprim (Ctrl/Cmd+X).","paste":"Hidhe","pasteArea":"Hapësira Hedhëse","pasteMsg":"Ju lutemi hidhni brenda kutizës në vijim duke shfrytëzuar tastierën (<strong>Ctrl/Cmd+V</strong>) dhe shtypni Mirë.","securityMsg":"Për shkak të dhënave të sigurisë së shfletuesit tuaj, redaktuesi nuk është në gjendje të i qaset drejtpërdrejtë të dhanve të tabelës suaj të punës. Ju duhet të hidhni atë përsëri në këtë dritare.","title":"Hidhe"},"button":{"selectedLabel":"%1 (Selected)"},"colorbutton":{"auto":"Automatik","bgColorTitle":"Ngjyra e Prapavijës","colors":{"000":"E zezë","800000":"Ngjyrë gështenjë","8B4513":"Ngjyrë Shale Kafe","2F4F4F":"Ngjyrë Gri të errët ardëz","008080":"Ngjyrë bajukë","000080":"Ngjyrë Marine","4B0082":"Indigo","696969":"Gri e Errët","B22222":"Tullë në Flakë","A52A2A":"Ngjytë Kafe","DAA520":"Shkop i Artë","006400":"E Gjelbër e Errët","40E0D0":"Ngjyrë e Bruztë","0000CD":"E Kaltër e Mesme","800080":"Vjollcë","808080":"Gri","F00":"E Kuqe","FF8C00":"E Portokalltë e Errët","FFD700":"Ngjyrë Ari","008000":"E Gjelbërt","0FF":"Cyan","00F":"E Kaltër","EE82EE":"Vjollcë","A9A9A9":"Gri e Zbehtë","FFA07A":"Salmon i Ndritur","FFA500":"E Portokalltë","FFFF00":"E Verdhë","00FF00":"Ngjyrë Gëlqere","AFEEEE":"Ngjyrë e Bruztë e Zbehtë","ADD8E6":"E Kaltër e Ndritur","DDA0DD":"Ngjyrë Llokumi","D3D3D3":"Gri e Ndritur","FFF0F5":"Ngjyrë Purpur e Skuqur","FAEBD7":"E Bardhë Antike","FFFFE0":"E verdhë e Ndritur","F0FFF0":"Ngjyrë Nektari","F0FFFF":"Ngjyrë Qielli","F0F8FF":"E Kaltër Alice","E6E6FA":"Ngjyrë Purpur e Zbetë","FFF":"E bardhë"},"more":"Më Shumë Ngjyra...","panelTitle":"Ngjyrat","textColorTitle":"Ngjyra e Tekstit"},"colordialog":{"clear":"Pastro","highlight":"Thekso","options":"Përzgjedhjet e Ngjyrave","selected":"Ngjyra e Përzgjedhur","title":"Përzgjidh një ngjyrë"},"templates":{"button":"Shabllonet","emptyListMsg":"(Asnjë shabllon nuk është paradefinuar)","insertOption":"Zëvendëso përmbajtjen aktuale","options":"Opsionet e Shabllonit","selectPromptMsg":"Përzgjidhni shabllonin për të hapur tek redaktuesi","title":"Përmbajtja e Shabllonit"},"contextmenu":{"options":"Mundësitë e Menysë së Kontekstit"},"div":{"IdInputLabel":"Id","advisoryTitleInputLabel":"Titull","cssClassInputLabel":"Klasa stili CSS","edit":"Redakto Div","inlineStyleInputLabel":"Stili i brendshëm","langDirLTRLabel":"Nga e majta në të djathë (LTR)","langDirLabel":"Drejtim teksti","langDirRTLLabel":"Nga e djathta në të majtë (RTL)","languageCodeInputLabel":"Kodi i Gjuhës","remove":"Largo Div","styleSelectLabel":"Stil","title":"Krijo Div Përmbajtës","toolbar":"Krijo Div Përmbajtës"},"toolbar":{"toolbarCollapse":"Zvogëlo Shiritin","toolbarExpand":"Zgjero Shiritin","toolbarGroups":{"document":"Dokument","clipboard":"Tabela Punës/Ribëje","editing":"Duke Redaktuar","forms":"Formular","basicstyles":"Stili Bazë","paragraph":"Paragraf","links":"Nyjet","insert":"Shto","styles":"Stil","colors":"Ngjyrat","tools":"Mjetet"},"toolbars":"Shiritet e Redaktuesit"},"elementspath":{"eleLabel":"Rruga e elementeve","eleTitle":"%1 element"},"find":{"find":"Gjej","findOptions":"Gjejë Alternativat","findWhat":"Gjej çka:","matchCase":"Rasti i përputhjes","matchCyclic":"Përputh ciklikun","matchWord":"Përputh fjalën e tërë","notFoundMsg":"Teksti i caktuar nuk mundej të gjendet.","replace":"Zëvendëso","replaceAll":"Zëvendëso të gjitha","replaceSuccessMsg":"%1 rast(e) u zëvendësua(n).","replaceWith":"Zëvendëso me:","title":"Gjej dhe Zëvendëso"},"fakeobjects":{"anchor":"Spirancë","flash":"Objekt flash","hiddenfield":"Fushë e fshehur","iframe":"IFrame","unknown":"Objekt i Panjohur"},"flash":{"access":"Qasja në Skriptë","accessAlways":"Gjithnjë","accessNever":"Asnjëherë","accessSameDomain":"Fusha e Njëjtë","alignAbsBottom":"Abs në Fund","alignAbsMiddle":"Abs në Mes","alignBaseline":"Baza","alignTextTop":"Koka e Tekstit","bgcolor":"Ngjyra e Prapavijës","chkFull":"Lejo Ekran të Plotë","chkLoop":"Përsëritje","chkMenu":"Lejo Menynë për Flash","chkPlay":"Auto Play","flashvars":"Variablat për Flash","hSpace":"Hapësira Horizontale","properties":"Karakteristikat për Flash","propertiesTab":"Karakteristikat","quality":"Kualiteti","qualityAutoHigh":"Automatikisht i Lartë","qualityAutoLow":"Automatikisht i Ulët","qualityBest":"Më i Miri","qualityHigh":"I Lartë","qualityLow":"Më i Ulti","qualityMedium":"I Mesëm","scale":"Shkalla","scaleAll":"Shfaq të Gjitha","scaleFit":"Përputhje të Plotë","scaleNoBorder":"Pa Kornizë","title":"Rekuizitat për Flash","vSpace":"Hapësira Vertikale","validateHSpace":"Hapësira Horizontale duhet të është numër.","validateSrc":"URL nuk duhet mbetur zbrazur.","validateVSpace":"Hapësira Vertikale duhet të është numër.","windowMode":"Window mode","windowModeOpaque":"Errët","windowModeTransparent":"Tejdukshëm","windowModeWindow":"Window"},"font":{"fontSize":{"label":"Madhësia","voiceLabel":"Madhësia e Shkronjës","panelTitle":"Madhësia e Shkronjës"},"label":"Shkronja","panelTitle":"Emri i Shkronjës","voiceLabel":"Shkronja"},"forms":{"button":{"title":"Rekuizitat e Pullës","text":"Teskti (Vlera)","type":"LLoji","typeBtn":"Buton","typeSbm":"Dërgo","typeRst":"Rikthe"},"checkboxAndRadio":{"checkboxTitle":"Rekuizitat e Kutizë Përzgjedhëse","radioTitle":"Rekuizitat e Pullës","value":"Vlera","selected":"Përzgjedhur"},"form":{"title":"Rekuizitat e Formës","menu":"Rekuizitat e Formës","action":"Veprim","method":"Metoda","encoding":"Kodimi"},"hidden":{"title":"Rekuizitat e Fushës së Fshehur","name":"Emër","value":"Vlera"},"select":{"title":"Rekuizitat e Fushës së Përzgjedhur","selectInfo":"Përzgjidh Informacionin","opAvail":"Opsionet e Mundshme","value":"Vlera","size":"Madhësia","lines":"rreshtat","chkMulti":"Lejo përzgjidhje të shumëfishta","opText":"Teksti","opValue":"Vlera","btnAdd":"Vendos","btnModify":"Ndrysho","btnUp":"Sipër","btnDown":"Poshtë","btnSetValue":"Bëje si vlerë të përzgjedhur","btnDelete":"Grise"},"textarea":{"title":"Rekuzitat e Fushës së Tekstit","cols":"Kolonat","rows":"Rreshtat"},"textfield":{"title":"Rekuizitat e Fushës së Tekstit","name":"Emër","value":"Vlera","charWidth":"Gjerësia e Karakterit","maxChars":"Numri maksimal i karaktereve","type":"LLoji","typeText":"Teksti","typePass":"Fjalëkalimi","typeEmail":"Posta Elektronike","typeSearch":"Kërko","typeTel":"Numri i Telefonit","typeUrl":"URL"}},"format":{"label":"Formati","panelTitle":"Formati i Paragrafit","tag_address":"Adresa","tag_div":"Normal (DIV)","tag_h1":"Titulli 1","tag_h2":"Titulli 2","tag_h3":"Titulli 3","tag_h4":"Titulli 4","tag_h5":"Titulli 5","tag_h6":"Titulli 6","tag_p":"Normal","tag_pre":"Formatuar"},"horizontalrule":{"toolbar":"Vendos Vijë Horizontale"},"iframe":{"border":"Shfaq kufirin e kornizës","noUrl":"Ju lutemi shkruani URL-në e iframe-it","scrolling":"Lejo shiritët zvarritës","title":"Karakteristikat e IFrame","toolbar":"IFrame"},"image":{"alertUrl":"Ju lutemi shkruani URL-në e fotos","alt":"Tekst Alternativ","border":"Korniza","btnUpload":"Dërgo në server","button2Img":"Dëshironi të e ndërroni pullën e fotos së selektuar në një foto të thjeshtë?","hSpace":"HSpace","img2Button":"Dëshironi të ndryshoni foton e përzgjedhur në pullë?","infoTab":"Informacione mbi Fotografinë","linkTab":"Nyja","lockRatio":"Mbyll Racionin","menu":"Karakteristikat e Fotografisë","resetSize":"Rikthe Madhësinë","title":"Karakteristikat e Fotografisë","titleButton":"Karakteristikat e Pullës së Fotografisë","upload":"Ngarko","urlMissing":"Mungon URL e burimit të fotografisë.","vSpace":"Hapësira Vertikale","validateBorder":"Korniza duhet të jetë numër i plotë.","validateHSpace":"Hapësira horizontale duhet të jetë numër i plotë.","validateVSpace":"Hapësira vertikale duhet të jetë numër i plotë."},"indent":{"indent":"Rrite Identin","outdent":"Zvogëlo Identin"},"smiley":{"options":"Opsionet e Ikonave","title":"Vendos Ikonë","toolbar":"Ikona"},"justify":{"block":"Zgjero","center":"Qendër","left":"Rreshto majtas","right":"Rreshto Djathtas"},"language":{"button":"Set language","remove":"Remove language"},"link":{"acccessKey":"Sipas ID-së së Elementit","advanced":"Të përparuara","advisoryContentType":"Lloji i Përmbajtjes Këshillimore","advisoryTitle":"Titull","anchor":{"toolbar":"Spirancë","menu":"Redakto Spirancën","title":"Anchor Properties","name":"Emri i Spirancës","errorName":"Ju lutemi shkruani emrin e spirancës","remove":"Largo Spirancën"},"anchorId":"Sipas ID-së së Elementit","anchorName":"Sipas Emrit të Spirancës","charset":"Seti i Karaktereve të Burimeve të Nëdlidhura","cssClasses":"Klasa stili CSS","emailAddress":"Posta Elektronike","emailBody":"Trupi i Porosisë","emailSubject":"Titulli i Porosisë","id":"Id","info":"Informacione të Nyjes","langCode":"Kod gjuhe","langDir":"Drejtim teksti","langDirLTR":"Nga e majta në të djathë (LTR)","langDirRTL":"Nga e djathta në të majtë (RTL)","menu":"Redakto Nyjen","name":"Emër","noAnchors":"(Nuk ka asnjë spirancë në dokument)","noEmail":"Ju lutemi shkruani postën elektronike","noUrl":"Ju lutemi shkruani URL-në e nyjes","other":"<tjetër>","popupDependent":"E Varur (Netscape)","popupFeatures":"Karakteristikat e Dritares së Dialogut","popupFullScreen":"Ekran i Plotë (IE)","popupLeft":"Pozita Majtas","popupLocationBar":"Shiriti i Lokacionit","popupMenuBar":"Shiriti i Menysë","popupResizable":"I ndryshueshëm","popupScrollBars":"Scroll Bars","popupStatusBar":"Shiriti i Statutit","popupToolbar":"Shiriti i Mejteve","popupTop":"Top Pozita","rel":"Marrëdhëniet","selectAnchor":"Përzgjidh një Spirancë","styles":"Stil","tabIndex":"Tab Index","target":"Objektivi","targetFrame":"<frame>","targetFrameName":"Emri i Kornizës së Synuar","targetPopup":"<popup window>","targetPopupName":"Emri i Dritares së Dialogut","title":"Nyja","toAnchor":"Lidhu me spirancën në tekst","toEmail":"Posta Elektronike","toUrl":"URL","toolbar":"Nyja","type":"Lloji i Nyjes","unlink":"Largo Nyjen","upload":"Ngarko"},"list":{"bulletedlist":"Vendos/Largo Listën me Pika","numberedlist":"Vendos/Largo Listën me Numra"},"liststyle":{"armenian":"Numërim armenian","bulletedTitle":"Karakteristikat e Listës me Pulla","circle":"Rreth","decimal":"Decimal (1, 2, 3, etj.)","decimalLeadingZero":"Decimal me zerro udhëheqëse (01, 02, 03, etj.)","disc":"Disk","georgian":"Numërim gjeorgjian (an, ban, gan, etj.)","lowerAlpha":"Të vogla alfa (a, b, c, d, e, etj.)","lowerGreek":"Të vogla greke (alpha, beta, gamma, etj.)","lowerRoman":"Të vogla romake (i, ii, iii, iv, v, etj.)","none":"Asnjë","notset":"<e pazgjedhur>","numberedTitle":"Karakteristikat e Listës me Numra","square":"Katror","start":"Fillimi","type":"LLoji","upperAlpha":"Të mëdha alfa (A, B, C, D, E, etj.)","upperRoman":"Të mëdha romake (I, II, III, IV, V, etj.)","validateStartNumber":"Numri i fillimit të listës duhet të është numër i plotë."},"magicline":{"title":"Vendos paragraf këtu"},"maximize":{"maximize":"Zmadho","minimize":"Zvogëlo"},"newpage":{"toolbar":"Faqe e Re"},"pagebreak":{"alt":"Thyerja e Faqes","toolbar":"Vendos Thyerje Faqeje për Shtyp"},"pastetext":{"button":"Hidhe si tekst të thjeshtë","title":"Hidhe si Tekst të Thjeshtë"},"pastefromword":{"confirmCleanup":"Teksti që dëshironi të e hidhni siç duket është kopjuar nga Word-i. Dëshironi të e pastroni para se të e hidhni?","error":"Nuk ishte e mundur të fshiheshin të dhënat e hedhura për shkak të një gabimi të brendshëm","title":"Hidhe nga Word-i","toolbar":"Hidhe nga Word-i"},"preview":{"preview":"Parashiko"},"print":{"toolbar":"Shtype"},"removeformat":{"toolbar":"Largo Formatin"},"save":{"toolbar":"Ruaje"},"selectall":{"toolbar":"Përzgjidh të Gjitha"},"showblocks":{"toolbar":"Shfaq Blloqet"},"sourcearea":{"toolbar":"Burimi"},"specialchar":{"options":"Mundësitë për Karaktere Speciale","title":"Përzgjidh Karakter Special","toolbar":"Vendos Karakter Special"},"scayt":{"btn_about":"About SCAYT","btn_dictionaries":"Dictionaries","btn_disable":"Disable SCAYT","btn_enable":"Enable SCAYT","btn_langs":"Languages","btn_options":"Options","text_title":""},"stylescombo":{"label":"Stil","panelTitle":"Stilet e Formatimit","panelTitle1":"Stilet e Bllokut","panelTitle2":"Stili i Brendshëm","panelTitle3":"Stilet e Objektit"},"table":{"border":"Madhësia e kornizave","caption":"Titull","cell":{"menu":"Qeli","insertBefore":"Shto Qeli Para","insertAfter":"Shto Qeli Prapa","deleteCell":"Gris Qelitë","merge":"Bashko Qelitë","mergeRight":"Bashko Djathtas","mergeDown":"Bashko Poshtë","splitHorizontal":"Ndaj Qelinë Horizontalisht","splitVertical":"Ndaj Qelinë Vertikalisht","title":"Rekuizitat e Qelisë","cellType":"Lloji i Qelisë","rowSpan":"Bashko Rreshtat","colSpan":"Bashko Kolonat","wordWrap":"Fund i Fjalës","hAlign":"Bashkimi Horizontal","vAlign":"Bashkimi Vertikal","alignBaseline":"Baza","bgColor":"Ngjyra e Prapavijës","borderColor":"Ngjyra e Kornizave","data":"Të dhënat","header":"Koka","yes":"Po","no":"Jo","invalidWidth":"Gjerësia e qelisë duhet të jetë numër.","invalidHeight":"Lartësia e qelisë duhet të jetë numër.","invalidRowSpan":"Hapësira e rreshtave duhet të jetë numër i plotë.","invalidColSpan":"Hapësira e kolonave duhet të jetë numër i plotë.","chooseColor":"Përzgjidh"},"cellPad":"Mbushja e qelisë","cellSpace":"Hapësira e qelisë","column":{"menu":"Kolona","insertBefore":"Vendos Kolonë Para","insertAfter":"Vendos Kolonë Pas","deleteColumn":"Gris Kolonat"},"columns":"Kolonat","deleteTable":"Gris Tabelën","headers":"Kokat","headersBoth":"Së bashku","headersColumn":"Kolona e parë","headersNone":"Asnjë","headersRow":"Rreshti i Parë","invalidBorder":"Madhësia e kufinjve duhet të jetë numër.","invalidCellPadding":"Mbushja e qelisë duhet të jetë numër pozitiv.","invalidCellSpacing":"Hapësira e qelisë duhet të jetë numër pozitiv.","invalidCols":"Numri i kolonave duhet të jetë numër më i madh se 0.","invalidHeight":"Lartësia e tabelës duhet të jetë numër.","invalidRows":"Numri i rreshtave duhet të jetë numër më i madh se 0.","invalidWidth":"Gjerësia e tabelës duhet të jetë numër.","menu":"Karakteristikat e Tabelës","row":{"menu":"Rreshti","insertBefore":"Shto Rresht Para","insertAfter":"Shto Rresht Prapa","deleteRow":"Gris Rreshtat"},"rows":"Rreshtat","summary":"Përmbledhje","title":"Karakteristikat e Tabelës","toolbar":"Tabela","widthPc":"përqind","widthPx":"piksell","widthUnit":"njësia e gjerësisë"},"undo":{"redo":"Ribëje","undo":"Rizhbëje"},"wsc":{"btnIgnore":"Ignore","btnIgnoreAll":"Ignore All","btnReplace":"Replace","btnReplaceAll":"Replace All","btnUndo":"Undo","changeTo":"Change to","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"Spell checker not installed. Do you want to download it now?","manyChanges":"Spell check complete: %1 words changed","noChanges":"Spell check complete: No words changed","noMispell":"Spell check complete: No misspellings found","noSuggestions":"- No suggestions -","notAvailable":"Sorry, but service is unavailable now.","notInDic":"Not in dictionary","oneChange":"Spell check complete: One word changed","progress":"Spell check in progress...","title":"Spell Check","toolbar":"Check Spelling"}}; | wenliang-developer/cdnjs | ajax/libs/ckeditor/4.4.2/lang/sq.js | JavaScript | mit | 19,206 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('dom-base', function (Y, NAME) {
/**
* @for DOM
* @module dom
*/
var documentElement = Y.config.doc.documentElement,
Y_DOM = Y.DOM,
TAG_NAME = 'tagName',
OWNER_DOCUMENT = 'ownerDocument',
EMPTY_STRING = '',
addFeature = Y.Features.add,
testFeature = Y.Features.test;
Y.mix(Y_DOM, {
/**
* Returns the text content of the HTMLElement.
* @method getText
* @param {HTMLElement} element The html element.
* @return {String} The text content of the element (includes text of any descending elements).
*/
getText: (documentElement.textContent !== undefined) ?
function(element) {
var ret = '';
if (element) {
ret = element.textContent;
}
return ret || '';
} : function(element) {
var ret = '';
if (element) {
ret = element.innerText || element.nodeValue; // might be a textNode
}
return ret || '';
},
/**
* Sets the text content of the HTMLElement.
* @method setText
* @param {HTMLElement} element The html element.
* @param {String} content The content to add.
*/
setText: (documentElement.textContent !== undefined) ?
function(element, content) {
if (element) {
element.textContent = content;
}
} : function(element, content) {
if ('innerText' in element) {
element.innerText = content;
} else if ('nodeValue' in element) {
element.nodeValue = content;
}
},
CUSTOM_ATTRIBUTES: (!documentElement.hasAttribute) ? { // IE < 8
'for': 'htmlFor',
'class': 'className'
} : { // w3c
'htmlFor': 'for',
'className': 'class'
},
/**
* Provides a normalized attribute interface.
* @method setAttribute
* @param {HTMLElement} el The target element for the attribute.
* @param {String} attr The attribute to set.
* @param {String} val The value of the attribute.
*/
setAttribute: function(el, attr, val, ieAttr) {
if (el && attr && el.setAttribute) {
attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr;
el.setAttribute(attr, val, ieAttr);
}
},
/**
* Provides a normalized attribute interface.
* @method getAttribute
* @param {HTMLElement} el The target element for the attribute.
* @param {String} attr The attribute to get.
* @return {String} The current value of the attribute.
*/
getAttribute: function(el, attr, ieAttr) {
ieAttr = (ieAttr !== undefined) ? ieAttr : 2;
var ret = '';
if (el && attr && el.getAttribute) {
attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr;
// BUTTON value issue for IE < 8
ret = (el.tagName === "BUTTON" && attr === 'value') ? Y_DOM.getValue(el) : el.getAttribute(attr, ieAttr);
if (ret === null) {
ret = ''; // per DOM spec
}
}
return ret;
},
VALUE_SETTERS: {},
VALUE_GETTERS: {},
getValue: function(node) {
var ret = '', // TODO: return null?
getter;
if (node && node[TAG_NAME]) {
getter = Y_DOM.VALUE_GETTERS[node[TAG_NAME].toLowerCase()];
if (getter) {
ret = getter(node);
} else {
ret = node.value;
}
}
// workaround for IE8 JSON stringify bug
// which converts empty string values to null
if (ret === EMPTY_STRING) {
ret = EMPTY_STRING; // for real
}
return (typeof ret === 'string') ? ret : '';
},
setValue: function(node, val) {
var setter;
if (node && node[TAG_NAME]) {
setter = Y_DOM.VALUE_SETTERS[node[TAG_NAME].toLowerCase()];
val = (val === null) ? '' : val;
if (setter) {
setter(node, val);
} else {
node.value = val;
}
}
},
creators: {}
});
addFeature('value-set', 'select', {
test: function() {
var node = Y.config.doc.createElement('select');
node.innerHTML = '<option>1</option><option>2</option>';
node.value = '2';
return (node.value && node.value === '2');
}
});
if (!testFeature('value-set', 'select')) {
Y_DOM.VALUE_SETTERS.select = function(node, val) {
for (var i = 0, options = node.getElementsByTagName('option'), option;
option = options[i++];) {
if (Y_DOM.getValue(option) === val) {
option.selected = true;
//Y_DOM.setAttribute(option, 'selected', 'selected');
break;
}
}
};
}
Y.mix(Y_DOM.VALUE_GETTERS, {
button: function(node) {
return (node.attributes && node.attributes.value) ? node.attributes.value.value : '';
}
});
Y.mix(Y_DOM.VALUE_SETTERS, {
// IE: node.value changes the button text, which should be handled via innerHTML
button: function(node, val) {
var attr = node.attributes.value;
if (!attr) {
attr = node[OWNER_DOCUMENT].createAttribute('value');
node.setAttributeNode(attr);
}
attr.value = val;
}
});
Y.mix(Y_DOM.VALUE_GETTERS, {
option: function(node) {
var attrs = node.attributes;
return (attrs.value && attrs.value.specified) ? node.value : node.text;
},
select: function(node) {
var val = node.value,
options = node.options;
if (options && options.length) {
// TODO: implement multipe select
if (node.multiple) {
} else if (node.selectedIndex > -1) {
val = Y_DOM.getValue(options[node.selectedIndex]);
}
}
return val;
}
});
var addClass, hasClass, removeClass;
Y.mix(Y.DOM, {
/**
* Determines whether a DOM element has the given className.
* @method hasClass
* @for DOM
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to search for
* @return {Boolean} Whether or not the element has the given class.
*/
hasClass: function(node, className) {
var re = Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
return re.test(node.className);
},
/**
* Adds a class name to a given DOM element.
* @method addClass
* @for DOM
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to add to the class attribute
*/
addClass: function(node, className) {
if (!Y.DOM.hasClass(node, className)) { // skip if already present
node.className = Y.Lang.trim([node.className, className].join(' '));
}
},
/**
* Removes a class name from a given element.
* @method removeClass
* @for DOM
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to remove from the class attribute
*/
removeClass: function(node, className) {
if (className && hasClass(node, className)) {
node.className = Y.Lang.trim(node.className.replace(Y.DOM._getRegExp('(?:^|\\s+)' +
className + '(?:\\s+|$)'), ' '));
if ( hasClass(node, className) ) { // in case of multiple adjacent
removeClass(node, className);
}
}
},
/**
* Replace a class with another class for a given element.
* If no oldClassName is present, the newClassName is simply added.
* @method replaceClass
* @for DOM
* @param {HTMLElement} element The DOM element
* @param {String} oldClassName the class name to be replaced
* @param {String} newClassName the class name that will be replacing the old class name
*/
replaceClass: function(node, oldC, newC) {
removeClass(node, oldC); // remove first in case oldC === newC
addClass(node, newC);
},
/**
* If the className exists on the node it is removed, if it doesn't exist it is added.
* @method toggleClass
* @for DOM
* @param {HTMLElement} element The DOM element
* @param {String} className the class name to be toggled
* @param {Boolean} addClass optional boolean to indicate whether class
* should be added or removed regardless of current state
*/
toggleClass: function(node, className, force) {
var add = (force !== undefined) ? force :
!(hasClass(node, className));
if (add) {
addClass(node, className);
} else {
removeClass(node, className);
}
}
});
hasClass = Y.DOM.hasClass;
removeClass = Y.DOM.removeClass;
addClass = Y.DOM.addClass;
var re_tag = /<([a-z]+)/i,
Y_DOM = Y.DOM,
addFeature = Y.Features.add,
testFeature = Y.Features.test,
creators = {},
createFromDIV = function(html, tag) {
var div = Y.config.doc.createElement('div'),
ret = true;
div.innerHTML = html;
if (!div.firstChild || div.firstChild.tagName !== tag.toUpperCase()) {
ret = false;
}
return ret;
},
re_tbody = /(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,
TABLE_OPEN = '<table>',
TABLE_CLOSE = '</table>',
selectedIndex;
Y.mix(Y.DOM, {
_fragClones: {},
_create: function(html, doc, tag) {
tag = tag || 'div';
var frag = Y_DOM._fragClones[tag];
if (frag) {
frag = frag.cloneNode(false);
} else {
frag = Y_DOM._fragClones[tag] = doc.createElement(tag);
}
frag.innerHTML = html;
return frag;
},
_children: function(node, tag) {
var i = 0,
children = node.children,
childNodes,
hasComments,
child;
if (children && children.tags) { // use tags filter when possible
if (tag) {
children = node.children.tags(tag);
} else { // IE leaks comments into children
hasComments = children.tags('!').length;
}
}
if (!children || (!children.tags && tag) || hasComments) {
childNodes = children || node.childNodes;
children = [];
while ((child = childNodes[i++])) {
if (child.nodeType === 1) {
if (!tag || tag === child.tagName) {
children.push(child);
}
}
}
}
return children || [];
},
/**
* Creates a new dom node using the provided markup string.
* @method create
* @param {String} html The markup used to create the element
* @param {HTMLDocument} doc An optional document context
* @return {HTMLElement|DocumentFragment} returns a single HTMLElement
* when creating one node, and a documentFragment when creating
* multiple nodes.
*/
create: function(html, doc) {
if (typeof html === 'string') {
html = Y.Lang.trim(html); // match IE which trims whitespace from innerHTML
}
doc = doc || Y.config.doc;
var m = re_tag.exec(html),
create = Y_DOM._create,
custom = creators,
ret = null,
creator, tag, node, nodes;
if (html != undefined) { // not undefined or null
if (m && m[1]) {
creator = custom[m[1].toLowerCase()];
if (typeof creator === 'function') {
create = creator;
} else {
tag = creator;
}
}
node = create(html, doc, tag);
nodes = node.childNodes;
if (nodes.length === 1) { // return single node, breaking parentNode ref from "fragment"
ret = node.removeChild(nodes[0]);
} else if (nodes[0] && nodes[0].className === 'yui3-big-dummy') { // using dummy node to preserve some attributes (e.g. OPTION not selected)
selectedIndex = node.selectedIndex;
if (nodes.length === 2) {
ret = nodes[0].nextSibling;
} else {
node.removeChild(nodes[0]);
ret = Y_DOM._nl2frag(nodes, doc);
}
} else { // return multiple nodes as a fragment
ret = Y_DOM._nl2frag(nodes, doc);
}
}
return ret;
},
_nl2frag: function(nodes, doc) {
var ret = null,
i, len;
if (nodes && (nodes.push || nodes.item) && nodes[0]) {
doc = doc || nodes[0].ownerDocument;
ret = doc.createDocumentFragment();
if (nodes.item) { // convert live list to static array
nodes = Y.Array(nodes, 0, true);
}
for (i = 0, len = nodes.length; i < len; i++) {
ret.appendChild(nodes[i]);
}
} // else inline with log for minification
return ret;
},
/**
* Inserts content in a node at the given location
* @method addHTML
* @param {HTMLElement} node The node to insert into
* @param {HTMLElement | Array | HTMLCollection} content The content to be inserted
* @param {HTMLElement} where Where to insert the content
* If no "where" is given, content is appended to the node
* Possible values for "where"
* <dl>
* <dt>HTMLElement</dt>
* <dd>The element to insert before</dd>
* <dt>"replace"</dt>
* <dd>Replaces the existing HTML</dd>
* <dt>"before"</dt>
* <dd>Inserts before the existing HTML</dd>
* <dt>"before"</dt>
* <dd>Inserts content before the node</dd>
* <dt>"after"</dt>
* <dd>Inserts content after the node</dd>
* </dl>
*/
addHTML: function(node, content, where) {
var nodeParent = node.parentNode,
i = 0,
item,
ret = content,
newNode;
if (content != undefined) { // not null or undefined (maybe 0)
if (content.nodeType) { // DOM node, just add it
newNode = content;
} else if (typeof content == 'string' || typeof content == 'number') {
ret = newNode = Y_DOM.create(content);
} else if (content[0] && content[0].nodeType) { // array or collection
newNode = Y.config.doc.createDocumentFragment();
while ((item = content[i++])) {
newNode.appendChild(item); // append to fragment for insertion
}
}
}
if (where) {
if (newNode && where.parentNode) { // insert regardless of relationship to node
where.parentNode.insertBefore(newNode, where);
} else {
switch (where) {
case 'replace':
while (node.firstChild) {
node.removeChild(node.firstChild);
}
if (newNode) { // allow empty content to clear node
node.appendChild(newNode);
}
break;
case 'before':
if (newNode) {
nodeParent.insertBefore(newNode, node);
}
break;
case 'after':
if (newNode) {
if (node.nextSibling) { // IE errors if refNode is null
nodeParent.insertBefore(newNode, node.nextSibling);
} else {
nodeParent.appendChild(newNode);
}
}
break;
default:
if (newNode) {
node.appendChild(newNode);
}
}
}
} else if (newNode) {
node.appendChild(newNode);
}
// `select` elements are the only elements with `selectedIndex`.
// Don't grab the dummy `option` element's `selectedIndex`.
if (node.nodeName == "SELECT" && selectedIndex > 0) {
node.selectedIndex = selectedIndex - 1;
}
return ret;
},
wrap: function(node, html) {
var parent = (html && html.nodeType) ? html : Y.DOM.create(html),
nodes = parent.getElementsByTagName('*');
if (nodes.length) {
parent = nodes[nodes.length - 1];
}
if (node.parentNode) {
node.parentNode.replaceChild(parent, node);
}
parent.appendChild(node);
},
unwrap: function(node) {
var parent = node.parentNode,
lastChild = parent.lastChild,
next = node,
grandparent;
if (parent) {
grandparent = parent.parentNode;
if (grandparent) {
node = parent.firstChild;
while (node !== lastChild) {
next = node.nextSibling;
grandparent.insertBefore(node, parent);
node = next;
}
grandparent.replaceChild(lastChild, parent);
} else {
parent.removeChild(node);
}
}
}
});
addFeature('innerhtml', 'table', {
test: function() {
var node = Y.config.doc.createElement('table');
try {
node.innerHTML = '<tbody></tbody>';
} catch(e) {
return false;
}
return (node.firstChild && node.firstChild.nodeName === 'TBODY');
}
});
addFeature('innerhtml-div', 'tr', {
test: function() {
return createFromDIV('<tr></tr>', 'tr');
}
});
addFeature('innerhtml-div', 'script', {
test: function() {
return createFromDIV('<script></script>', 'script');
}
});
if (!testFeature('innerhtml', 'table')) {
// TODO: thead/tfoot with nested tbody
// IE adds TBODY when creating TABLE elements (which may share this impl)
creators.tbody = function(html, doc) {
var frag = Y_DOM.create(TABLE_OPEN + html + TABLE_CLOSE, doc),
tb = Y.DOM._children(frag, 'tbody')[0];
if (frag.children.length > 1 && tb && !re_tbody.test(html)) {
tb.parentNode.removeChild(tb); // strip extraneous tbody
}
return frag;
};
}
if (!testFeature('innerhtml-div', 'script')) {
creators.script = function(html, doc) {
var frag = doc.createElement('div');
frag.innerHTML = '-' + html;
frag.removeChild(frag.firstChild);
return frag;
};
creators.link = creators.style = creators.script;
}
if (!testFeature('innerhtml-div', 'tr')) {
Y.mix(creators, {
option: function(html, doc) {
return Y_DOM.create('<select><option class="yui3-big-dummy" selected></option>' + html + '</select>', doc);
},
tr: function(html, doc) {
return Y_DOM.create('<tbody>' + html + '</tbody>', doc);
},
td: function(html, doc) {
return Y_DOM.create('<tr>' + html + '</tr>', doc);
},
col: function(html, doc) {
return Y_DOM.create('<colgroup>' + html + '</colgroup>', doc);
},
tbody: 'table'
});
Y.mix(creators, {
legend: 'fieldset',
th: creators.td,
thead: creators.tbody,
tfoot: creators.tbody,
caption: creators.tbody,
colgroup: creators.tbody,
optgroup: creators.option
});
}
Y_DOM.creators = creators;
Y.mix(Y.DOM, {
/**
* Sets the width of the element to the given size, regardless
* of box model, border, padding, etc.
* @method setWidth
* @param {HTMLElement} element The DOM element.
* @param {String|Number} size The pixel height to size to
*/
setWidth: function(node, size) {
Y.DOM._setSize(node, 'width', size);
},
/**
* Sets the height of the element to the given size, regardless
* of box model, border, padding, etc.
* @method setHeight
* @param {HTMLElement} element The DOM element.
* @param {String|Number} size The pixel height to size to
*/
setHeight: function(node, size) {
Y.DOM._setSize(node, 'height', size);
},
_setSize: function(node, prop, val) {
val = (val > 0) ? val : 0;
var size = 0;
node.style[prop] = val + 'px';
size = (prop === 'height') ? node.offsetHeight : node.offsetWidth;
if (size > val) {
val = val - (size - val);
if (val < 0) {
val = 0;
}
node.style[prop] = val + 'px';
}
}
});
}, '3.17.0', {"requires": ["dom-core"]});
| leecrossley/cdnjs | ajax/libs/yui/3.17.0/dom-base/dom-base.js | JavaScript | mit | 21,315 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('node-focusmanager', function (Y, NAME) {
/**
* <p>The Focus Manager Node Plugin makes it easy to manage focus among
* a Node's descendants. Primarily intended to help with widget development,
* the Focus Manager Node Plugin can be used to improve the keyboard
* accessibility of widgets.</p>
*
* <p>
* When designing widgets that manage a set of descendant controls (i.e. buttons
* in a toolbar, tabs in a tablist, menuitems in a menu, etc.) it is important to
* limit the number of descendants in the browser's default tab flow. The fewer
* number of descendants in the default tab flow, the easier it is for keyboard
* users to navigate between widgets by pressing the tab key. When a widget has
* focus it should provide a set of shortcut keys (typically the arrow keys)
* to move focus among its descendants.
* </p>
*
* <p>
* To this end, the Focus Manager Node Plugin makes it easy to define a Node's
* focusable descendants, define which descendant should be in the default tab
* flow, and define the keys that move focus among each descendant.
* Additionally, as the CSS
* <a href="http://www.w3.org/TR/CSS21/selector.html#x38"><code>:focus</code></a>
* pseudo class is not supported on all elements in all
* <a href="http://developer.yahoo.com/yui/articles/gbs/">A-Grade browsers</a>,
* the Focus Manager Node Plugin provides an easy, cross-browser means of
* styling focus.
* </p>
*
DEPRECATED: The FocusManager Node Plugin has been deprecated as of YUI 3.9.0. This module will be removed from the library in a future version. If you require functionality similar to the one provided by this module, consider taking a look at the various modules in the YUI Gallery <http://yuilibrary.com/gallery/>.
* @module node-focusmanager
* @deprecated 3.9.0
*/
// Frequently used strings
var ACTIVE_DESCENDANT = "activeDescendant",
ID = "id",
DISABLED = "disabled",
TAB_INDEX = "tabIndex",
FOCUSED = "focused",
FOCUS_CLASS = "focusClass",
CIRCULAR = "circular",
UI = "UI",
KEY = "key",
ACTIVE_DESCENDANT_CHANGE = ACTIVE_DESCENDANT + "Change",
HOST = "host",
// Collection of keys that, when pressed, cause the browser viewport
// to scroll.
scrollKeys = {
37: true,
38: true,
39: true,
40: true
},
clickableElements = {
"a": true,
"button": true,
"input": true,
"object": true
},
// Library shortcuts
Lang = Y.Lang,
UA = Y.UA,
/**
* The NodeFocusManager class is a plugin for a Node instance. The class is used
* via the <a href="Node.html#method_plug"><code>plug</code></a> method of Node
* and should not be instantiated directly.
* @namespace plugin
* @class NodeFocusManager
*/
NodeFocusManager = function () {
NodeFocusManager.superclass.constructor.apply(this, arguments);
};
NodeFocusManager.ATTRS = {
/**
* Boolean indicating that one of the descendants is focused.
*
* @attribute focused
* @readOnly
* @default false
* @type boolean
*/
focused: {
value: false,
readOnly: true
},
/**
* String representing the CSS selector used to define the descendant Nodes
* whose focus should be managed.
*
* @attribute descendants
* @type Y.NodeList
*/
descendants: {
getter: function (value) {
return this.get(HOST).all(value);
}
},
/**
* <p>Node, or index of the Node, representing the descendant that is either
* focused or is focusable (<code>tabIndex</code> attribute is set to 0).
* The value cannot represent a disabled descendant Node. Use a value of -1
* to remove all descendant Nodes from the default tab flow.
* If no value is specified, the active descendant will be inferred using
* the following criteria:</p>
* <ol>
* <li>Examining the <code>tabIndex</code> attribute of each descendant and
* using the first descendant whose <code>tabIndex</code> attribute is set
* to 0</li>
* <li>If no default can be inferred then the value is set to either 0 or
* the index of the first enabled descendant.</li>
* </ol>
*
* @attribute activeDescendant
* @type Number
*/
activeDescendant: {
setter: function (value) {
var isNumber = Lang.isNumber,
INVALID_VALUE = Y.Attribute.INVALID_VALUE,
descendantsMap = this._descendantsMap,
descendants = this._descendants,
nodeIndex,
returnValue,
oNode;
if (isNumber(value)) {
nodeIndex = value;
returnValue = nodeIndex;
}
else if ((value instanceof Y.Node) && descendantsMap) {
nodeIndex = descendantsMap[value.get(ID)];
if (isNumber(nodeIndex)) {
returnValue = nodeIndex;
}
else {
// The user passed a reference to a Node that wasn't one
// of the descendants.
returnValue = INVALID_VALUE;
}
}
else {
returnValue = INVALID_VALUE;
}
if (descendants) {
oNode = descendants.item(nodeIndex);
if (oNode && oNode.get("disabled")) {
// Setting the "activeDescendant" attribute to the index
// of a disabled descendant is invalid.
returnValue = INVALID_VALUE;
}
}
return returnValue;
}
},
/**
* Object literal representing the keys to be used to navigate between the
* next/previous descendant. The format for the attribute's value is
* <code>{ next: "down:40", previous: "down:38" }</code>. The value for the
* "next" and "previous" properties are used to attach
* <a href="event/#keylistener"><code>key</code></a> event listeners. See
* the <a href="event/#keylistener">Using the key Event</a> section of
* the Event documentation for more information on "key" event listeners.
*
* @attribute keys
* @type Object
*/
keys: {
value: {
next: null,
previous: null
}
},
/**
* String representing the name of class applied to the focused active
* descendant Node. Can also be an object literal used to define both the
* class name, and the Node to which the class should be applied. If using
* an object literal, the format is:
* <code>{ className: "focus", fn: myFunction }</code>. The function
* referenced by the <code>fn</code> property in the object literal will be
* passed a reference to the currently focused active descendant Node.
*
* @attribute focusClass
* @type String|Object
*/
focusClass: { },
/**
* Boolean indicating if focus should be set to the first/last descendant
* when the end or beginning of the descendants has been reached.
*
* @attribute circular
* @type Boolean
* @default true
*/
circular: {
value: true
}
};
Y.extend(NodeFocusManager, Y.Plugin.Base, {
// Protected properties
// Boolean indicating if the NodeFocusManager is active.
_stopped: true,
// NodeList representing the descendants selected via the
// "descendants" attribute.
_descendants: null,
// Object literal mapping the IDs of each descendant to its index in the
// "_descendants" NodeList.
_descendantsMap: null,
// Reference to the Node instance to which the focused class (defined
// by the "focusClass" attribute) is currently applied.
_focusedNode: null,
// Number representing the index of the last descendant Node.
_lastNodeIndex: 0,
// Array of handles for event handlers used for a NodeFocusManager instance.
_eventHandlers: null,
// Protected methods
/**
* @method _initDescendants
* @description Sets the <code>tabIndex</code> attribute of all of the
* descendants to -1, except the active descendant, whose
* <code>tabIndex</code> attribute is set to 0.
* @protected
*/
_initDescendants: function () {
var descendants = this.get("descendants"),
descendantsMap = {},
nFirstEnabled = -1,
nDescendants,
nActiveDescendant = this.get(ACTIVE_DESCENDANT),
oNode,
sID,
i = 0;
if (Lang.isUndefined(nActiveDescendant)) {
nActiveDescendant = -1;
}
if (descendants) {
nDescendants = descendants.size();
for (i = 0; i < nDescendants; i++) {
oNode = descendants.item(i);
if (nFirstEnabled === -1 && !oNode.get(DISABLED)) {
nFirstEnabled = i;
}
// If the user didn't specify a value for the
// "activeDescendant" attribute try to infer it from
// the markup.
// Need to pass "2" when using "getAttribute" for IE to get
// the attribute value as it is set in the markup.
// Need to use "parseInt" because IE always returns the
// value as a number, whereas all other browsers return
// the attribute as a string when accessed
// via "getAttribute".
if (nActiveDescendant < 0 &&
parseInt(oNode.getAttribute(TAB_INDEX, 2), 10) === 0) {
nActiveDescendant = i;
}
if (oNode) {
oNode.set(TAB_INDEX, -1);
}
sID = oNode.get(ID);
if (!sID) {
sID = Y.guid();
oNode.set(ID, sID);
}
descendantsMap[sID] = i;
}
// If the user didn't specify a value for the
// "activeDescendant" attribute and no default value could be
// determined from the markup, then default to 0.
if (nActiveDescendant < 0) {
nActiveDescendant = 0;
}
oNode = descendants.item(nActiveDescendant);
// Check to make sure the active descendant isn't disabled,
// and fall back to the first enabled descendant if it is.
if (!oNode || oNode.get(DISABLED)) {
oNode = descendants.item(nFirstEnabled);
nActiveDescendant = nFirstEnabled;
}
this._lastNodeIndex = nDescendants - 1;
this._descendants = descendants;
this._descendantsMap = descendantsMap;
this.set(ACTIVE_DESCENDANT, nActiveDescendant);
// Need to set the "tabIndex" attribute here, since the
// "activeDescendantChange" event handler used to manage
// the setting of the "tabIndex" attribute isn't wired up yet.
if (oNode) {
oNode.set(TAB_INDEX, 0);
}
}
},
/**
* @method _isDescendant
* @description Determines if the specified Node instance is a descendant
* managed by the Focus Manager.
* @param node {Node} Node instance to be checked.
* @return {Boolean} Boolean indicating if the specified Node instance is a
* descendant managed by the Focus Manager.
* @protected
*/
_isDescendant: function (node) {
return (node.get(ID) in this._descendantsMap);
},
/**
* @method _removeFocusClass
* @description Removes the class name representing focus (as specified by
* the "focusClass" attribute) from the Node instance to which it is
* currently applied.
* @protected
*/
_removeFocusClass: function () {
var oFocusedNode = this._focusedNode,
focusClass = this.get(FOCUS_CLASS),
sClassName;
if (focusClass) {
sClassName = Lang.isString(focusClass) ?
focusClass : focusClass.className;
}
if (oFocusedNode && sClassName) {
oFocusedNode.removeClass(sClassName);
}
},
/**
* @method _detachKeyHandler
* @description Detaches the "key" event handlers used to support the "keys"
* attribute.
* @protected
*/
_detachKeyHandler: function () {
var prevKeyHandler = this._prevKeyHandler,
nextKeyHandler = this._nextKeyHandler;
if (prevKeyHandler) {
prevKeyHandler.detach();
}
if (nextKeyHandler) {
nextKeyHandler.detach();
}
},
/**
* @method _preventScroll
* @description Prevents the viewport from scolling when the user presses
* the up, down, left, or right key.
* @protected
*/
_preventScroll: function (event) {
if (scrollKeys[event.keyCode] && this._isDescendant(event.target)) {
event.preventDefault();
}
},
/**
* @method _fireClick
* @description Fires the click event if the enter key is pressed while
* focused on an HTML element that is not natively clickable.
* @protected
*/
_fireClick: function (event) {
var oTarget = event.target,
sNodeName = oTarget.get("nodeName").toLowerCase();
if (event.keyCode === 13 && (!clickableElements[sNodeName] ||
(sNodeName === "a" && !oTarget.getAttribute("href")))) {
Y.log(("Firing click event for node:" + oTarget.get("id")), "info", "nodeFocusManager");
oTarget.simulate("click");
}
},
/**
* @method _attachKeyHandler
* @description Attaches the "key" event handlers used to support the "keys"
* attribute.
* @protected
*/
_attachKeyHandler: function () {
this._detachKeyHandler();
var sNextKey = this.get("keys.next"),
sPrevKey = this.get("keys.previous"),
oNode = this.get(HOST),
aHandlers = this._eventHandlers;
if (sPrevKey) {
this._prevKeyHandler =
Y.on(KEY, Y.bind(this._focusPrevious, this), oNode, sPrevKey);
}
if (sNextKey) {
this._nextKeyHandler =
Y.on(KEY, Y.bind(this._focusNext, this), oNode, sNextKey);
}
// In Opera it is necessary to call the "preventDefault" method in
// response to the user pressing the arrow keys in order to prevent
// the viewport from scrolling when the user is moving focus among
// the focusable descendants.
if (UA.opera) {
aHandlers.push(oNode.on("keypress", this._preventScroll, this));
}
// For all browsers except Opera: HTML elements that are not natively
// focusable but made focusable via the tabIndex attribute don't
// fire a click event when the user presses the enter key. It is
// possible to work around this problem by simplying dispatching a
// click event in response to the user pressing the enter key.
if (!UA.opera) {
aHandlers.push(oNode.on("keypress", this._fireClick, this));
}
},
/**
* @method _detachEventHandlers
* @description Detaches all event handlers used by the Focus Manager.
* @protected
*/
_detachEventHandlers: function () {
this._detachKeyHandler();
var aHandlers = this._eventHandlers;
if (aHandlers) {
Y.Array.each(aHandlers, function (handle) {
handle.detach();
});
this._eventHandlers = null;
}
},
/**
* @method _detachEventHandlers
* @description Attaches all event handlers used by the Focus Manager.
* @protected
*/
_attachEventHandlers: function () {
var descendants = this._descendants,
aHandlers,
oDocument,
handle;
if (descendants && descendants.size()) {
aHandlers = this._eventHandlers || [];
oDocument = this.get(HOST).get("ownerDocument");
if (aHandlers.length === 0) {
Y.log("Attaching base set of event handlers.", "info", "nodeFocusManager");
aHandlers.push(oDocument.on("focus", this._onDocFocus, this));
aHandlers.push(oDocument.on("mousedown",
this._onDocMouseDown, this));
aHandlers.push(
this.after("keysChange", this._attachKeyHandler));
aHandlers.push(
this.after("descendantsChange", this._initDescendants));
aHandlers.push(
this.after(ACTIVE_DESCENDANT_CHANGE,
this._afterActiveDescendantChange));
// For performance: defer attaching all key-related event
// handlers until the first time one of the specified
// descendants receives focus.
handle = this.after("focusedChange", Y.bind(function (event) {
if (event.newVal) {
Y.log("Attaching key event handlers.", "info", "nodeFocusManager");
this._attachKeyHandler();
// Detach this "focusedChange" handler so that the
// key-related handlers only get attached once.
handle.detach();
}
}, this));
aHandlers.push(handle);
}
this._eventHandlers = aHandlers;
}
},
// Protected event handlers
/**
* @method _onDocMouseDown
* @description "mousedown" event handler for the owner document of the
* Focus Manager's Node.
* @protected
* @param event {Object} Object representing the DOM event.
*/
_onDocMouseDown: function (event) {
var oHost = this.get(HOST),
oTarget = event.target,
bChildNode = oHost.contains(oTarget),
node,
getFocusable = function (node) {
var returnVal = false;
if (!node.compareTo(oHost)) {
returnVal = this._isDescendant(node) ? node :
getFocusable.call(this, node.get("parentNode"));
}
return returnVal;
};
if (bChildNode) {
// Check to make sure that the target isn't a child node of one
// of the focusable descendants.
node = getFocusable.call(this, oTarget);
if (node) {
oTarget = node;
}
else if (!node && this.get(FOCUSED)) {
// The target was a non-focusable descendant of the root
// node, so the "focused" attribute should be set to false.
this._set(FOCUSED, false);
this._onDocFocus(event);
}
}
if (bChildNode && this._isDescendant(oTarget)) {
// Fix general problem in Webkit: mousing down on a button or an
// anchor element doesn't focus it.
// For all browsers: makes sure that the descendant that
// was the target of the mousedown event is now considered the
// active descendant.
this.focus(oTarget);
}
else if (UA.webkit && this.get(FOCUSED) &&
(!bChildNode || (bChildNode && !this._isDescendant(oTarget)))) {
// Fix for Webkit:
// Document doesn't receive focus in Webkit when the user mouses
// down on it, so the "focused" attribute won't get set to the
// correct value.
// The goal is to force a blur if the user moused down on
// either: 1) A descendant node, but not one that managed by
// the FocusManager, or 2) an element outside of the
// FocusManager
this._set(FOCUSED, false);
this._onDocFocus(event);
}
},
/**
* @method _onDocFocus
* @description "focus" event handler for the owner document of the
* Focus Manager's Node.
* @protected
* @param event {Object} Object representing the DOM event.
*/
_onDocFocus: function (event) {
var oTarget = this._focusTarget || event.target,
bFocused = this.get(FOCUSED),
focusClass = this.get(FOCUS_CLASS),
oFocusedNode = this._focusedNode,
bInCollection;
if (this._focusTarget) {
this._focusTarget = null;
}
if (this.get(HOST).contains(oTarget)) {
// The target is a descendant of the root Node.
bInCollection = this._isDescendant(oTarget);
if (!bFocused && bInCollection) {
// The user has focused a focusable descendant.
bFocused = true;
}
else if (bFocused && !bInCollection) {
// The user has focused a child of the root Node that is
// not one of the descendants managed by this Focus Manager
// so clear the currently focused descendant.
bFocused = false;
}
}
else {
// The target is some other node in the document.
bFocused = false;
}
if (focusClass) {
if (oFocusedNode && (!oFocusedNode.compareTo(oTarget) || !bFocused)) {
this._removeFocusClass();
}
if (bInCollection && bFocused) {
if (focusClass.fn) {
oTarget = focusClass.fn(oTarget);
oTarget.addClass(focusClass.className);
}
else {
oTarget.addClass(focusClass);
}
this._focusedNode = oTarget;
}
}
this._set(FOCUSED, bFocused);
},
/**
* @method _focusNext
* @description Keydown event handler that moves focus to the next
* enabled descendant.
* @protected
* @param event {Object} Object representing the DOM event.
* @param activeDescendant {Number} Number representing the index of the
* next descendant to be focused
*/
_focusNext: function (event, activeDescendant) {
var nActiveDescendant = activeDescendant || this.get(ACTIVE_DESCENDANT),
oNode;
if (this._isDescendant(event.target) &&
(nActiveDescendant <= this._lastNodeIndex)) {
nActiveDescendant = nActiveDescendant + 1;
if (nActiveDescendant === (this._lastNodeIndex + 1) &&
this.get(CIRCULAR)) {
nActiveDescendant = 0;
}
oNode = this._descendants.item(nActiveDescendant);
if (oNode) {
if (oNode.get("disabled")) {
this._focusNext(event, nActiveDescendant);
}
else {
this.focus(nActiveDescendant);
}
}
}
this._preventScroll(event);
},
/**
* @method _focusPrevious
* @description Keydown event handler that moves focus to the previous
* enabled descendant.
* @protected
* @param event {Object} Object representing the DOM event.
* @param activeDescendant {Number} Number representing the index of the
* next descendant to be focused.
*/
_focusPrevious: function (event, activeDescendant) {
var nActiveDescendant = activeDescendant || this.get(ACTIVE_DESCENDANT),
oNode;
if (this._isDescendant(event.target) && nActiveDescendant >= 0) {
nActiveDescendant = nActiveDescendant - 1;
if (nActiveDescendant === -1 && this.get(CIRCULAR)) {
nActiveDescendant = this._lastNodeIndex;
}
oNode = this._descendants.item(nActiveDescendant);
if (oNode) {
if (oNode.get("disabled")) {
this._focusPrevious(event, nActiveDescendant);
}
else {
this.focus(nActiveDescendant);
}
}
}
this._preventScroll(event);
},
/**
* @method _afterActiveDescendantChange
* @description afterChange event handler for the
* "activeDescendant" attribute.
* @protected
* @param event {Object} Object representing the change event.
*/
_afterActiveDescendantChange: function (event) {
var oNode = this._descendants.item(event.prevVal);
if (oNode) {
oNode.set(TAB_INDEX, -1);
}
oNode = this._descendants.item(event.newVal);
if (oNode) {
oNode.set(TAB_INDEX, 0);
}
},
// Public methods
initializer: function (config) {
Y.log("WARNING: node-focusmanager is a deprecated module as of YUI 3.9.0. This module will be removed from a later version of the library.", "warn");
this.start();
},
destructor: function () {
this.stop();
this.get(HOST).focusManager = null;
},
/**
* @method focus
* @description Focuses the active descendant and sets the
* <code>focused</code> attribute to true.
* @param index {Number|Node} Optional. Number representing the index of the
* descendant to be set as the active descendant or Node instance
* representing the descendant to be set as the active descendant.
*/
focus: function (index) {
if (Lang.isUndefined(index)) {
index = this.get(ACTIVE_DESCENDANT);
}
this.set(ACTIVE_DESCENDANT, index, { src: UI });
var oNode = this._descendants.item(this.get(ACTIVE_DESCENDANT));
if (oNode) {
oNode.focus();
// In Opera focusing a <BUTTON> element programmatically
// will result in the document-level focus event handler
// "_onDocFocus" being called, resulting in the handler
// incorrectly setting the "focused" Attribute to false. To fix
// this, set a flag ("_focusTarget") that the "_onDocFocus" method
// can look for to properly handle this edge case.
if (UA.opera && oNode.get("nodeName").toLowerCase() === "button") {
this._focusTarget = oNode;
}
}
},
/**
* @method blur
* @description Blurs the current active descendant and sets the
* <code>focused</code> attribute to false.
*/
blur: function () {
var oNode;
if (this.get(FOCUSED)) {
oNode = this._descendants.item(this.get(ACTIVE_DESCENDANT));
if (oNode) {
oNode.blur();
// For Opera and Webkit: Blurring an element in either browser
// doesn't result in another element (such as the document)
// being focused. Therefore, the "_onDocFocus" method
// responsible for managing the application and removal of the
// focus indicator class name is never called.
this._removeFocusClass();
}
this._set(FOCUSED, false, { src: UI });
}
},
/**
* @method start
* @description Enables the Focus Manager.
*/
start: function () {
if (this._stopped) {
this._initDescendants();
this._attachEventHandlers();
this._stopped = false;
}
},
/**
* @method stop
* @description Disables the Focus Manager by detaching all event handlers.
*/
stop: function () {
if (!this._stopped) {
this._detachEventHandlers();
this._descendants = null;
this._focusedNode = null;
this._lastNodeIndex = 0;
this._stopped = true;
}
},
/**
* @method refresh
* @description Refreshes the Focus Manager's descendants by re-executing the
* CSS selector query specified by the <code>descendants</code> attribute.
*/
refresh: function () {
this._initDescendants();
if (!this._eventHandlers) {
this._attachEventHandlers();
}
}
});
NodeFocusManager.NAME = "nodeFocusManager";
NodeFocusManager.NS = "focusManager";
Y.namespace("Plugin");
Y.Plugin.NodeFocusManager = NodeFocusManager;
}, '3.17.0', {"requires": ["attribute", "node", "plugin", "node-event-simulate", "event-key", "event-focus"]});
| aeharding/cdnjs | ajax/libs/yui/3.17.0/node-focusmanager/node-focusmanager-debug.js | JavaScript | mit | 25,107 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/file-flash/file-flash.js']) {
__coverage__['build/file-flash/file-flash.js'] = {"path":"build/file-flash/file-flash.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0,0,0,0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":41}}},"2":{"name":"(anonymous_2)","line":16,"loc":{"start":{"line":16,"column":20},"end":{"line":16,"column":32}}},"3":{"name":"(anonymous_3)","line":28,"loc":{"start":{"line":28,"column":22},"end":{"line":28,"column":37}}},"4":{"name":"(anonymous_4)","line":41,"loc":{"start":{"line":41,"column":26},"end":{"line":41,"column":43}}},"5":{"name":"(anonymous_5)","line":166,"loc":{"start":{"line":166,"column":21},"end":{"line":166,"column":62}}},"6":{"name":"(anonymous_6)","line":193,"loc":{"start":{"line":193,"column":22},"end":{"line":193,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":341,"column":37}},"2":{"start":{"line":16,"column":4},"end":{"line":18,"column":6}},"3":{"start":{"line":17,"column":8},"end":{"line":17,"column":64}},"4":{"start":{"line":20,"column":4},"end":{"line":336,"column":7}},"5":{"start":{"line":29,"column":12},"end":{"line":31,"column":13}},"6":{"start":{"line":30,"column":16},"end":{"line":30,"column":48}},"7":{"start":{"line":42,"column":10},"end":{"line":155,"column":9}},"8":{"start":{"line":43,"column":10},"end":{"line":154,"column":11}},"9":{"start":{"line":56,"column":17},"end":{"line":56,"column":76}},"10":{"start":{"line":57,"column":17},"end":{"line":57,"column":23}},"11":{"start":{"line":77,"column":17},"end":{"line":81,"column":48}},"12":{"start":{"line":82,"column":17},"end":{"line":82,"column":63}},"13":{"start":{"line":83,"column":17},"end":{"line":83,"column":23}},"14":{"start":{"line":97,"column":17},"end":{"line":97,"column":67}},"15":{"start":{"line":98,"column":17},"end":{"line":98,"column":23}},"16":{"start":{"line":113,"column":17},"end":{"line":114,"column":65}},"17":{"start":{"line":115,"column":17},"end":{"line":115,"column":23}},"18":{"start":{"line":129,"column":17},"end":{"line":129,"column":65}},"19":{"start":{"line":130,"column":17},"end":{"line":130,"column":23}},"20":{"start":{"line":152,"column":17},"end":{"line":152,"column":135}},"21":{"start":{"line":168,"column":8},"end":{"line":184,"column":10}},"22":{"start":{"line":170,"column":12},"end":{"line":173,"column":44}},"23":{"start":{"line":175,"column":12},"end":{"line":175,"column":42}},"24":{"start":{"line":177,"column":12},"end":{"line":177,"column":70}},"25":{"start":{"line":178,"column":12},"end":{"line":178,"column":73}},"26":{"start":{"line":179,"column":12},"end":{"line":179,"column":73}},"27":{"start":{"line":180,"column":12},"end":{"line":180,"column":77}},"28":{"start":{"line":181,"column":12},"end":{"line":181,"column":70}},"29":{"start":{"line":183,"column":12},"end":{"line":183,"column":71}},"30":{"start":{"line":194,"column":9},"end":{"line":197,"column":10}},"31":{"start":{"line":195,"column":11},"end":{"line":195,"column":68}},"32":{"start":{"line":196,"column":11},"end":{"line":196,"column":37}},"33":{"start":{"line":338,"column":4},"end":{"line":338,"column":28}}},"branchMap":{"1":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":12},"end":{"line":29,"column":12}},{"start":{"line":29,"column":12},"end":{"line":29,"column":12}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":10},"end":{"line":42,"column":10}},{"start":{"line":42,"column":10},"end":{"line":42,"column":10}}]},"3":{"line":43,"type":"switch","locations":[{"start":{"line":55,"column":12},"end":{"line":57,"column":23}},{"start":{"line":58,"column":12},"end":{"line":83,"column":23}},{"start":{"line":84,"column":12},"end":{"line":98,"column":23}},{"start":{"line":99,"column":12},"end":{"line":115,"column":23}},{"start":{"line":116,"column":12},"end":{"line":130,"column":23}},{"start":{"line":131,"column":12},"end":{"line":152,"column":135}}]},"4":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":8},"end":{"line":168,"column":8}},{"start":{"line":168,"column":8},"end":{"line":168,"column":8}}]},"5":{"line":171,"type":"binary-expr","locations":[{"start":{"line":171,"column":28},"end":{"line":171,"column":41}},{"start":{"line":171,"column":45},"end":{"line":171,"column":55}}]},"6":{"line":173,"type":"binary-expr","locations":[{"start":{"line":173,"column":25},"end":{"line":173,"column":35}},{"start":{"line":173,"column":39},"end":{"line":173,"column":43}}]},"7":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":9},"end":{"line":194,"column":9}},{"start":{"line":194,"column":9},"end":{"line":194,"column":9}}]}},"code":["(function () { YUI.add('file-flash', function (Y, NAME) {",""," /**"," * The FileFlash class provides a wrapper for a file pointer stored in Flash. The File wrapper"," * also implements the mechanics for uploading a file and tracking its progress."," * @module file-flash"," */"," /**"," * The class provides a wrapper for a file pointer in Flash."," * @class FileFlash"," * @extends Base"," * @constructor"," * @param {Object} config Configuration object."," */",""," var FileFlash = function(o) {"," FileFlash.superclass.constructor.apply(this, arguments);"," };",""," Y.extend(FileFlash, Y.Base, {",""," /**"," * Construction logic executed during FileFlash instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function (cfg) {"," if (!this.get(\"id\")) {"," this._set(\"id\", Y.guid(\"file\"));"," }"," },",""," /**"," * Handler of events dispatched by the Flash player."," *"," * @method _swfEventHandler"," * @param {Event} event The event object received from the Flash player."," * @protected"," */"," _swfEventHandler: function (event) {"," if (event.id === this.get(\"id\")) {"," switch (event.type) {"," /**"," * Signals that this file's upload has started."," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart` with the"," * following payload:"," * <dl>"," * <dt>uploader</dt>"," * <dd>The Y.SWF instance of Flash uploader that's handling the upload.</dd>"," * </dl>"," */"," case \"uploadstart\":"," this.fire(\"uploadstart\", {uploader: this.get(\"uploader\")});"," break;"," case \"uploadprogress\":",""," /**"," * Signals that progress has been made on the upload of this file."," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash uploader instance.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded.</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file (the file size)</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100.</dd>"," * </dl>"," */"," this.fire(\"uploadprogress\", {originEvent: event,"," bytesLoaded: event.bytesLoaded,"," bytesTotal: event.bytesTotal,"," percentLoaded: Math.min(100, Math.round(10000*event.bytesLoaded/event.bytesTotal)/100)"," });"," this._set(\"bytesUploaded\", event.bytesLoaded);"," break;"," case \"uploadcomplete\":",""," /**"," * Signals that this file's upload has completed, but data has not yet been received from the server."," *"," * @event uploadfinished"," * @param event {Event} The event object for the `uploadfinished` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * </dl>"," */"," this.fire(\"uploadfinished\", {originEvent: event});"," break;"," case \"uploadcompletedata\":"," /**"," * Signals that this file's upload has completed and data has been received from the server."," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * <dt>data</dt>"," * <dd>The data returned by the server.</dd>"," * </dl>"," */"," this.fire(\"uploadcomplete\", {originEvent: event,"," data: event.data});"," break;"," case \"uploadcancel\":",""," /**"," * Signals that this file's upload has been cancelled."," *"," * @event uploadcancel"," * @param event {Event} The event object for the `uploadcancel` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * </dl>"," */"," this.fire(\"uploadcancel\", {originEvent: event});"," break;"," case \"uploaderror\":",""," /**"," * Signals that this file's upload has encountered an error."," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * <dt>status</dt>"," * <dd>The status code reported by the Flash Player. If it's an HTTP error,"," * then this corresponds to the HTTP status code received by the uploader.</dd>"," * <dt>statusText</dt>"," * <dd>The text of the error event reported by the Flash Player.</dd>"," * <dt>source</dt>"," * <dd>Either \"http\" (if it's an HTTP error), or \"io\" (if it's a network transmission"," * error.)</dd>"," * </dl>"," */"," this.fire(\"uploaderror\", {originEvent: event, status: event.status, statusText: event.message, source: event.source});",""," }"," }"," },",""," /**"," * Starts the upload of a specific file."," *"," * @method startUpload"," * @param url {String} The URL to upload the file to."," * @param parameters {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param fileFieldName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," */"," startUpload: function(url, parameters, fileFieldName) {",""," if (this.get(\"uploader\")) {",""," var myUploader = this.get(\"uploader\"),"," fileField = fileFieldName || \"Filedata\","," id = this.get(\"id\"),"," params = parameters || null;",""," this._set(\"bytesUploaded\", 0);",""," myUploader.on(\"uploadstart\", this._swfEventHandler, this);"," myUploader.on(\"uploadprogress\", this._swfEventHandler, this);"," myUploader.on(\"uploadcomplete\", this._swfEventHandler, this);"," myUploader.on(\"uploadcompletedata\", this._swfEventHandler, this);"," myUploader.on(\"uploaderror\", this._swfEventHandler, this);",""," myUploader.callSWF(\"upload\", [id, url, params, fileField]);"," }",""," },",""," /**"," * Cancels the upload of a specific file, if currently in progress."," *"," * @method cancelUpload"," */"," cancelUpload: function () {"," if (this.get(\"uploader\")) {"," this.get(\"uploader\").callSWF(\"cancel\", [this.get(\"id\")]);"," this.fire(\"uploadcancel\");"," }"," }",""," }, {",""," /**"," * The identity of the class."," *"," * @property NAME"," * @type String"," * @default 'file'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'file',",""," /**"," * The type of transport."," *"," * @property TYPE"," * @type String"," * @default 'flash'"," * @readOnly"," * @protected"," * @static"," */"," TYPE: \"flash\",",""," /**"," * Static property used to define the default attribute configuration of"," * the File."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A String containing the unique id of the file wrapped by the FileFlash instance."," * The id is supplied by the Flash player uploader."," *"," * @attribute id"," * @type {String}"," * @initOnly"," */"," id: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The size of the file wrapped by FileFlash. This value is supplied by the Flash player uploader."," *"," * @attribute size"," * @type {Number}"," * @initOnly"," */"," size: {"," writeOnce: \"initOnly\","," value: 0"," },",""," /**"," * The name of the file wrapped by FileFlash. This value is supplied by the Flash player uploader."," *"," * @attribute name"," * @type {String}"," * @initOnly"," */"," name: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileFlash was created on. This value is supplied by the Flash player uploader."," *"," * @attribute dateCreated"," * @type {Date}"," * @initOnly"," */"," dateCreated: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileFlash was last modified on. This value is supplied by the Flash player uploader."," *"," * @attribute dateModified"," * @type {Date}"," * @initOnly"," */"," dateModified: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The number of bytes of the file that has been uploaded to the server. This value is"," * non-zero only while a file is being uploaded."," *"," * @attribute bytesUploaded"," * @type {Date}"," * @readOnly"," */"," bytesUploaded: {"," readOnly: true,"," value: 0"," },",""," /**"," * The type of the file wrapped by FileFlash. This value is provided by the Flash player"," * uploader."," *"," * @attribute type"," * @type {String}"," * @initOnly"," */"," type: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The instance of Y.SWF wrapping the Flash player uploader associated with this file."," *"," * @attribute uploder"," * @type {SWF}"," * @initOnly"," */"," uploader: {"," writeOnce: \"initOnly\","," value: null"," }"," }"," });",""," Y.FileFlash = FileFlash;","","","}, '3.17.0', {\"requires\": [\"base\"]});","","}());"]};
}
var __cov_xw2Hm6m2cM4kRyhZpOm3Vw = __coverage__['build/file-flash/file-flash.js'];
__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['1']++;YUI.add('file-flash',function(Y,NAME){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.f['1']++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['2']++;var FileFlash=function(o){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.f['2']++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['3']++;FileFlash.superclass.constructor.apply(this,arguments);};__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['4']++;Y.extend(FileFlash,Y.Base,{initializer:function(cfg){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.f['3']++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['5']++;if(!this.get('id')){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['1'][0]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['6']++;this._set('id',Y.guid('file'));}else{__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['1'][1]++;}},_swfEventHandler:function(event){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.f['4']++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['7']++;if(event.id===this.get('id')){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['2'][0]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['8']++;switch(event.type){case'uploadstart':__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['3'][0]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['9']++;this.fire('uploadstart',{uploader:this.get('uploader')});__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['10']++;break;case'uploadprogress':__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['3'][1]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['11']++;this.fire('uploadprogress',{originEvent:event,bytesLoaded:event.bytesLoaded,bytesTotal:event.bytesTotal,percentLoaded:Math.min(100,Math.round(10000*event.bytesLoaded/event.bytesTotal)/100)});__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['12']++;this._set('bytesUploaded',event.bytesLoaded);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['13']++;break;case'uploadcomplete':__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['3'][2]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['14']++;this.fire('uploadfinished',{originEvent:event});__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['15']++;break;case'uploadcompletedata':__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['3'][3]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['16']++;this.fire('uploadcomplete',{originEvent:event,data:event.data});__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['17']++;break;case'uploadcancel':__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['3'][4]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['18']++;this.fire('uploadcancel',{originEvent:event});__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['19']++;break;case'uploaderror':__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['3'][5]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['20']++;this.fire('uploaderror',{originEvent:event,status:event.status,statusText:event.message,source:event.source});}}else{__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['2'][1]++;}},startUpload:function(url,parameters,fileFieldName){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.f['5']++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['21']++;if(this.get('uploader')){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['4'][0]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['22']++;var myUploader=this.get('uploader'),fileField=(__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['5'][0]++,fileFieldName)||(__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['5'][1]++,'Filedata'),id=this.get('id'),params=(__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['6'][0]++,parameters)||(__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['6'][1]++,null);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['23']++;this._set('bytesUploaded',0);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['24']++;myUploader.on('uploadstart',this._swfEventHandler,this);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['25']++;myUploader.on('uploadprogress',this._swfEventHandler,this);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['26']++;myUploader.on('uploadcomplete',this._swfEventHandler,this);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['27']++;myUploader.on('uploadcompletedata',this._swfEventHandler,this);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['28']++;myUploader.on('uploaderror',this._swfEventHandler,this);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['29']++;myUploader.callSWF('upload',[id,url,params,fileField]);}else{__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['4'][1]++;}},cancelUpload:function(){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.f['6']++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['30']++;if(this.get('uploader')){__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['7'][0]++;__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['31']++;this.get('uploader').callSWF('cancel',[this.get('id')]);__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['32']++;this.fire('uploadcancel');}else{__cov_xw2Hm6m2cM4kRyhZpOm3Vw.b['7'][1]++;}}},{NAME:'file',TYPE:'flash',ATTRS:{id:{writeOnce:'initOnly',value:null},size:{writeOnce:'initOnly',value:0},name:{writeOnce:'initOnly',value:null},dateCreated:{writeOnce:'initOnly',value:null},dateModified:{writeOnce:'initOnly',value:null},bytesUploaded:{readOnly:true,value:0},type:{writeOnce:'initOnly',value:null},uploader:{writeOnce:'initOnly',value:null}}});__cov_xw2Hm6m2cM4kRyhZpOm3Vw.s['33']++;Y.FileFlash=FileFlash;},'3.17.0',{'requires':['base']});
| x112358/cdnjs | ajax/libs/yui/3.17.0/file-flash/file-flash-coverage.js | JavaScript | mit | 22,254 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("series-candlestick",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}n.NAME="candlestickSeries",n.ATTRS={type:{value:"candlestick"},graphic:{lazyAdd:!1,setter:function(e){return this.get("rendered")||this.set("rendered",!0),this.set("upcandle",e.addShape({type:"path"})),this.set("downcandle",e.addShape({type:"path"})),this.set("wick",e.addShape({type:"path"})),e}},upcandle:{},downcandle:{},wick:{}},e.extend(n,e.RangeSeries,{_drawMarkers:function(t,n,r,i,s,o,u,a,f){var l=this.get("upcandle"),c=this.get("downcandle"),h,p=this.get("wick"),d=f.wick,v=d.width,m,g,y,b,w,E,S,x,T,N,C=f.padding.left,k,L,A=e.Lang.isNumber;l.set(f.upcandle),c.set(f.downcandle),p.set({fill:d.fill,stroke:d.stroke,shapeRendering:d.shapeRendering}),l.clear(),c.clear(),p.clear();for(L=0;L<o;L+=1)m=Math.round(t[L]+C),E=m-a,S=m+a,g=Math.round(n[L]),y=Math.round(r[L]),b=Math.round(i[L]),w=Math.round(s[L]),k=g>w,x=k?w:g,T=k?g:w,N=T-x,h=k?l:c,h&&A(E)&&A(x)&&A(u)&&A(N)&&h.drawRect(E,x,u,N),A(m)&&A(y)&&A(b)&&p.drawRect(m-v/2,y,v,b-y);l.end(),c.end(),p.end(),p.toBack()},_toggleVisible:function(e){this.get("upcandle").set("visible",e),this.get("downcandle").set("visible",e),this.get("wick").set("visible",e)},destructor:function(){var e=this.get("upcandle"),t=this.get("downcandle"),n=this.get("wick");e&&e.destroy(),t&&t.destroy(),n&&n.destroy()},_getDefaultStyles:function(){var e={upcandle:{shapeRendering:"crispEdges",fill:{color:"#00aa00",alpha:1},stroke:{color:"#000000",alpha:1,weight:0}},downcandle:{shapeRendering:"crispEdges",fill:{color:"#aa0000",alpha:1},stroke:{color:"#000000",alpha:1,weight:0}},wick:{shapeRendering:"crispEdges",width:1,fill:{color:"#000000",alpha:1},stroke:{color:"#000000",alpha:1,weight:0}}};return this._mergeStyles(e,n.superclass._getDefaultStyles())}}),e.CandlestickSeries=n},"3.17.0",{requires:["series-range"]});
| iwdmb/cdnjs | ajax/libs/yui/3.17.0/series-candlestick/series-candlestick-min.js | JavaScript | mit | 2,009 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/dataschema-json/dataschema-json.js']) {
__coverage__['build/dataschema-json/dataschema-json.js'] = {"path":"build/dataschema-json/dataschema-json.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":46}}},"2":{"name":"(anonymous_2)","line":44,"loc":{"start":{"line":44,"column":13},"end":{"line":44,"column":31}}},"3":{"name":"(anonymous_3)","line":56,"loc":{"start":{"line":56,"column":16},"end":{"line":56,"column":35}}},"4":{"name":"(anonymous_4)","line":58,"loc":{"start":{"line":58,"column":16},"end":{"line":58,"column":32}}},"5":{"name":"(anonymous_5)","line":88,"loc":{"start":{"line":88,"column":22},"end":{"line":88,"column":44}}},"6":{"name":"(anonymous_6)","line":221,"loc":{"start":{"line":221,"column":11},"end":{"line":221,"column":34}}},"7":{"name":"(anonymous_7)","line":263,"loc":{"start":{"line":263,"column":19},"end":{"line":263,"column":55}}},"8":{"name":"(anonymous_8)","line":303,"loc":{"start":{"line":303,"column":21},"end":{"line":303,"column":58}}},"9":{"name":"(anonymous_9)","line":416,"loc":{"start":{"line":416,"column":16},"end":{"line":416,"column":56}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":439,"column":56}},"2":{"start":{"line":19,"column":0},"end":{"line":27,"column":15}},"3":{"start":{"line":29,"column":0},"end":{"line":433,"column":2}},"4":{"start":{"line":45,"column":8},"end":{"line":47,"column":18}},"5":{"start":{"line":49,"column":8},"end":{"line":75,"column":9}},"6":{"start":{"line":54,"column":12},"end":{"line":59,"column":34}},"7":{"start":{"line":56,"column":36},"end":{"line":56,"column":47}},"8":{"start":{"line":56,"column":47},"end":{"line":56,"column":65}},"9":{"start":{"line":58,"column":33},"end":{"line":58,"column":59}},"10":{"start":{"line":58,"column":59},"end":{"line":58,"column":77}},"11":{"start":{"line":65,"column":12},"end":{"line":65,"column":38}},"12":{"start":{"line":66,"column":12},"end":{"line":70,"column":13}},"13":{"start":{"line":67,"column":16},"end":{"line":69,"column":17}},"14":{"start":{"line":68,"column":20},"end":{"line":68,"column":67}},"15":{"start":{"line":76,"column":8},"end":{"line":76,"column":20}},"16":{"start":{"line":89,"column":8},"end":{"line":90,"column":30}},"17":{"start":{"line":91,"column":8},"end":{"line":98,"column":9}},"18":{"start":{"line":92,"column":12},"end":{"line":97,"column":13}},"19":{"start":{"line":93,"column":16},"end":{"line":93,"column":37}},"20":{"start":{"line":95,"column":16},"end":{"line":95,"column":33}},"21":{"start":{"line":96,"column":16},"end":{"line":96,"column":22}},"22":{"start":{"line":99,"column":8},"end":{"line":99,"column":20}},"23":{"start":{"line":222,"column":8},"end":{"line":223,"column":49}},"24":{"start":{"line":226,"column":8},"end":{"line":234,"column":9}},"25":{"start":{"line":227,"column":12},"end":{"line":233,"column":13}},"26":{"start":{"line":228,"column":16},"end":{"line":228,"column":45}},"27":{"start":{"line":231,"column":16},"end":{"line":231,"column":35}},"28":{"start":{"line":232,"column":16},"end":{"line":232,"column":32}},"29":{"start":{"line":236,"column":8},"end":{"line":247,"column":9}},"30":{"start":{"line":238,"column":12},"end":{"line":238,"column":86}},"31":{"start":{"line":241,"column":12},"end":{"line":243,"column":13}},"32":{"start":{"line":242,"column":16},"end":{"line":242,"column":87}},"33":{"start":{"line":246,"column":12},"end":{"line":246,"column":68}},"34":{"start":{"line":249,"column":8},"end":{"line":249,"column":24}},"35":{"start":{"line":264,"column":8},"end":{"line":272,"column":32}},"36":{"start":{"line":274,"column":8},"end":{"line":287,"column":9}},"37":{"start":{"line":279,"column":12},"end":{"line":283,"column":13}},"38":{"start":{"line":280,"column":16},"end":{"line":280,"column":105}},"39":{"start":{"line":282,"column":16},"end":{"line":282,"column":43}},"40":{"start":{"line":284,"column":15},"end":{"line":287,"column":9}},"41":{"start":{"line":285,"column":12},"end":{"line":285,"column":34}},"42":{"start":{"line":286,"column":12},"end":{"line":286,"column":73}},"43":{"start":{"line":289,"column":8},"end":{"line":289,"column":24}},"44":{"start":{"line":304,"column":8},"end":{"line":309,"column":27}},"45":{"start":{"line":312,"column":8},"end":{"line":347,"column":9}},"46":{"start":{"line":313,"column":12},"end":{"line":313,"column":30}},"47":{"start":{"line":314,"column":12},"end":{"line":314,"column":37}},"48":{"start":{"line":315,"column":12},"end":{"line":315,"column":43}},"49":{"start":{"line":318,"column":12},"end":{"line":318,"column":47}},"50":{"start":{"line":319,"column":12},"end":{"line":333,"column":13}},"51":{"start":{"line":320,"column":16},"end":{"line":331,"column":17}},"52":{"start":{"line":321,"column":20},"end":{"line":324,"column":23}},"53":{"start":{"line":326,"column":20},"end":{"line":330,"column":23}},"54":{"start":{"line":337,"column":12},"end":{"line":339,"column":53}},"55":{"start":{"line":341,"column":12},"end":{"line":346,"column":13}},"56":{"start":{"line":342,"column":16},"end":{"line":345,"column":19}},"57":{"start":{"line":351,"column":8},"end":{"line":400,"column":9}},"58":{"start":{"line":352,"column":12},"end":{"line":352,"column":24}},"59":{"start":{"line":353,"column":12},"end":{"line":353,"column":33}},"60":{"start":{"line":354,"column":12},"end":{"line":399,"column":13}},"61":{"start":{"line":356,"column":16},"end":{"line":378,"column":17}},"62":{"start":{"line":357,"column":20},"end":{"line":357,"column":43}},"63":{"start":{"line":358,"column":20},"end":{"line":358,"column":73}},"64":{"start":{"line":359,"column":20},"end":{"line":374,"column":21}},"65":{"start":{"line":360,"column":24},"end":{"line":360,"column":82}},"66":{"start":{"line":364,"column":24},"end":{"line":373,"column":25}},"67":{"start":{"line":365,"column":28},"end":{"line":368,"column":31}},"68":{"start":{"line":371,"column":28},"end":{"line":371,"column":53}},"69":{"start":{"line":372,"column":28},"end":{"line":372,"column":37}},"70":{"start":{"line":376,"column":20},"end":{"line":377,"column":80}},"71":{"start":{"line":381,"column":16},"end":{"line":387,"column":17}},"72":{"start":{"line":382,"column":20},"end":{"line":382,"column":42}},"73":{"start":{"line":384,"column":20},"end":{"line":386,"column":66}},"74":{"start":{"line":390,"column":16},"end":{"line":397,"column":17}},"75":{"start":{"line":391,"column":20},"end":{"line":391,"column":46}},"76":{"start":{"line":392,"column":20},"end":{"line":392,"column":81}},"77":{"start":{"line":394,"column":20},"end":{"line":396,"column":21}},"78":{"start":{"line":395,"column":24},"end":{"line":395,"column":43}},"79":{"start":{"line":398,"column":16},"end":{"line":398,"column":36}},"80":{"start":{"line":401,"column":8},"end":{"line":401,"column":35}},"81":{"start":{"line":402,"column":8},"end":{"line":402,"column":24}},"82":{"start":{"line":417,"column":8},"end":{"line":430,"column":9}},"83":{"start":{"line":418,"column":12},"end":{"line":418,"column":26}},"84":{"start":{"line":419,"column":12},"end":{"line":426,"column":13}},"85":{"start":{"line":420,"column":16},"end":{"line":425,"column":17}},"86":{"start":{"line":421,"column":20},"end":{"line":421,"column":63}},"87":{"start":{"line":422,"column":20},"end":{"line":424,"column":21}},"88":{"start":{"line":423,"column":24},"end":{"line":423,"column":88}},"89":{"start":{"line":429,"column":12},"end":{"line":429,"column":75}},"90":{"start":{"line":431,"column":8},"end":{"line":431,"column":24}},"91":{"start":{"line":436,"column":0},"end":{"line":436,"column":44}}},"branchMap":{"1":{"line":49,"type":"if","locations":[{"start":{"line":49,"column":8},"end":{"line":49,"column":8}},{"start":{"line":49,"column":8},"end":{"line":49,"column":8}}]},"2":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":16},"end":{"line":67,"column":16}},{"start":{"line":67,"column":16},"end":{"line":67,"column":16}}]},"3":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":12},"end":{"line":92,"column":12}},{"start":{"line":92,"column":12},"end":{"line":92,"column":12}}]},"4":{"line":92,"type":"binary-expr","locations":[{"start":{"line":92,"column":16},"end":{"line":92,"column":30}},{"start":{"line":92,"column":35},"end":{"line":92,"column":50}}]},"5":{"line":226,"type":"if","locations":[{"start":{"line":226,"column":8},"end":{"line":226,"column":8}},{"start":{"line":226,"column":8},"end":{"line":226,"column":8}}]},"6":{"line":236,"type":"if","locations":[{"start":{"line":236,"column":8},"end":{"line":236,"column":8}},{"start":{"line":236,"column":8},"end":{"line":236,"column":8}}]},"7":{"line":236,"type":"binary-expr","locations":[{"start":{"line":236,"column":12},"end":{"line":236,"column":29}},{"start":{"line":236,"column":33},"end":{"line":236,"column":39}}]},"8":{"line":241,"type":"if","locations":[{"start":{"line":241,"column":12},"end":{"line":241,"column":12}},{"start":{"line":241,"column":12},"end":{"line":241,"column":12}}]},"9":{"line":267,"type":"cond-expr","locations":[{"start":{"line":268,"column":25},"end":{"line":270,"column":61}},{"start":{"line":272,"column":24},"end":{"line":272,"column":31}}]},"10":{"line":268,"type":"binary-expr","locations":[{"start":{"line":268,"column":25},"end":{"line":268,"column":48}},{"start":{"line":270,"column":28},"end":{"line":270,"column":61}}]},"11":{"line":274,"type":"if","locations":[{"start":{"line":274,"column":8},"end":{"line":274,"column":8}},{"start":{"line":274,"column":8},"end":{"line":274,"column":8}}]},"12":{"line":279,"type":"if","locations":[{"start":{"line":279,"column":12},"end":{"line":279,"column":12}},{"start":{"line":279,"column":12},"end":{"line":279,"column":12}}]},"13":{"line":284,"type":"if","locations":[{"start":{"line":284,"column":15},"end":{"line":284,"column":15}},{"start":{"line":284,"column":15},"end":{"line":284,"column":15}}]},"14":{"line":314,"type":"binary-expr","locations":[{"start":{"line":314,"column":18},"end":{"line":314,"column":27}},{"start":{"line":314,"column":31},"end":{"line":314,"column":36}}]},"15":{"line":315,"type":"binary-expr","locations":[{"start":{"line":315,"column":22},"end":{"line":315,"column":35}},{"start":{"line":315,"column":39},"end":{"line":315,"column":42}}]},"16":{"line":319,"type":"if","locations":[{"start":{"line":319,"column":12},"end":{"line":319,"column":12}},{"start":{"line":319,"column":12},"end":{"line":319,"column":12}}]},"17":{"line":320,"type":"if","locations":[{"start":{"line":320,"column":16},"end":{"line":320,"column":16}},{"start":{"line":320,"column":16},"end":{"line":320,"column":16}}]},"18":{"line":337,"type":"cond-expr","locations":[{"start":{"line":338,"column":24},"end":{"line":338,"column":36}},{"start":{"line":339,"column":24},"end":{"line":339,"column":52}}]},"19":{"line":341,"type":"if","locations":[{"start":{"line":341,"column":12},"end":{"line":341,"column":12}},{"start":{"line":341,"column":12},"end":{"line":341,"column":12}}]},"20":{"line":354,"type":"if","locations":[{"start":{"line":354,"column":12},"end":{"line":354,"column":12}},{"start":{"line":354,"column":12},"end":{"line":354,"column":12}}]},"21":{"line":359,"type":"if","locations":[{"start":{"line":359,"column":20},"end":{"line":359,"column":20}},{"start":{"line":359,"column":20},"end":{"line":359,"column":20}}]},"22":{"line":364,"type":"if","locations":[{"start":{"line":364,"column":24},"end":{"line":364,"column":24}},{"start":{"line":364,"column":24},"end":{"line":364,"column":24}}]},"23":{"line":385,"type":"cond-expr","locations":[{"start":{"line":386,"column":28},"end":{"line":386,"column":37}},{"start":{"line":386,"column":40},"end":{"line":386,"column":57}}]},"24":{"line":394,"type":"if","locations":[{"start":{"line":394,"column":20},"end":{"line":394,"column":20}},{"start":{"line":394,"column":20},"end":{"line":394,"column":20}}]},"25":{"line":417,"type":"if","locations":[{"start":{"line":417,"column":8},"end":{"line":417,"column":8}},{"start":{"line":417,"column":8},"end":{"line":417,"column":8}}]},"26":{"line":420,"type":"if","locations":[{"start":{"line":420,"column":16},"end":{"line":420,"column":16}},{"start":{"line":420,"column":16},"end":{"line":420,"column":16}}]},"27":{"line":422,"type":"if","locations":[{"start":{"line":422,"column":20},"end":{"line":422,"column":20}},{"start":{"line":422,"column":20},"end":{"line":422,"column":20}}]},"28":{"line":422,"type":"binary-expr","locations":[{"start":{"line":422,"column":24},"end":{"line":422,"column":28}},{"start":{"line":422,"column":32},"end":{"line":422,"column":39}}]}},"code":["(function () { YUI.add('dataschema-json', function (Y, NAME) {","","/**","Provides a DataSchema implementation which can be used to work with JSON data.","","@module dataschema","@submodule dataschema-json","**/","","/**","Provides a DataSchema implementation which can be used to work with JSON data.","","See the `apply` method for usage.","","@class DataSchema.JSON","@extends DataSchema.Base","@static","**/","var LANG = Y.Lang,"," isFunction = LANG.isFunction,"," isObject = LANG.isObject,"," isArray = LANG.isArray,"," // TODO: I don't think the calls to Base.* need to be done via Base since"," // Base is mixed into SchemaJSON. Investigate for later."," Base = Y.DataSchema.Base,",""," SchemaJSON;","","SchemaJSON = {","","/////////////////////////////////////////////////////////////////////////////","//","// DataSchema.JSON static methods","//","/////////////////////////////////////////////////////////////////////////////"," /**"," * Utility function converts JSON locator strings into walkable paths"," *"," * @method getPath"," * @param locator {String} JSON value locator."," * @return {String[]} Walkable path to data value."," * @static"," */"," getPath: function(locator) {"," var path = null,"," keys = [],"," i = 0;",""," if (locator) {"," // Strip the [\"string keys\"] and [1] array indexes"," // TODO: the first two steps can probably be reduced to one with"," // /\\[\\s*(['\"])?(.*?)\\1\\s*\\]/g, but the array indices would be"," // stored as strings. This is not likely an issue."," locator = locator."," replace(/\\[\\s*(['\"])(.*?)\\1\\s*\\]/g,"," function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);})."," replace(/\\[(\\d+)\\]/g,"," function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);})."," replace(/^\\./,''); // remove leading dot",""," // Validate against problematic characters."," // commented out because the path isn't sent to eval, so it"," // should be safe. I'm not sure what makes a locator invalid."," //if (!/[^\\w\\.\\$@]/.test(locator)) {"," path = locator.split('.');"," for (i=path.length-1; i >= 0; --i) {"," if (path[i].charAt(0) === '@') {"," path[i] = keys[parseInt(path[i].substr(1),10)];"," }"," }"," /*}"," else {"," }"," */"," }"," return path;"," },",""," /**"," * Utility function to walk a path and return the value located there."," *"," * @method getLocationValue"," * @param path {String[]} Locator path."," * @param data {String} Data to traverse."," * @return {Object} Data value at location."," * @static"," */"," getLocationValue: function (path, data) {"," var i = 0,"," len = path.length;"," for (;i<len;i++) {"," if (isObject(data) && (path[i] in data)) {"," data = data[path[i]];"," } else {"," data = undefined;"," break;"," }"," }"," return data;"," },",""," /**"," Applies a schema to an array of data located in a JSON structure, returning"," a normalized object with results in the `results` property. Additional"," information can be parsed out of the JSON for inclusion in the `meta`"," property of the response object. If an error is encountered during"," processing, an `error` property will be added.",""," The input _data_ is expected to be an object or array. If it is a string,"," it will be passed through `Y.JSON.parse()`.",""," If _data_ contains an array of data records to normalize, specify the"," _schema.resultListLocator_ as a dot separated path string just as you would"," reference it in JavaScript. So if your _data_ object has a record array at"," _data.response.results_, use _schema.resultListLocator_ ="," \"response.results\". Bracket notation can also be used for array indices or"," object properties (e.g. \"response['results']\"); This is called a \"path"," locator\"",""," Field data in the result list is extracted with field identifiers in"," _schema.resultFields_. Field identifiers are objects with the following"," properties:",""," * `key` : <strong>(required)</strong> The path locator (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use path locators (strings)"," instead of field identifiers (objects) -- see example below.",""," If no processing of the result list array is needed, _schema.resultFields_"," can be omitted; the `response.results` will point directly to the array.",""," If the result list contains arrays, `response.results` will contain an"," array of objects with key:value pairs assuming the fields in"," _schema.resultFields_ are ordered in accordance with the data array"," values.",""," If the result list contains objects, the identified _schema.resultFields_"," will be used to extract a value from those objects for the output result.",""," To extract additional information from the JSON, include an array of"," path locators in _schema.metaFields_. The collected values will be"," stored in `response.meta`.","",""," @example"," // Process array of arrays"," var schema = {"," resultListLocator: 'produce.fruit',"," resultFields: [ 'name', 'color' ]"," },"," data = {"," produce: {"," fruit: ["," [ 'Banana', 'yellow' ],"," [ 'Orange', 'orange' ],"," [ 'Eggplant', 'purple' ]"," ]"," }"," };",""," var response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"yellow\" }","",""," // Process array of objects + some metadata"," schema.metaFields = [ 'lastInventory' ];",""," data = {"," produce: {"," fruit: ["," { name: 'Banana', color: 'yellow', price: '1.96' },"," { name: 'Orange', color: 'orange', price: '2.04' },"," { name: 'Eggplant', color: 'purple', price: '4.31' }"," ]"," },"," lastInventory: '2011-07-19'"," };",""," response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"yellow\" }"," // response.meta.lastInventory is '2001-07-19'","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'name',"," parser: function (val) { return val.toUpperCase(); }"," },"," {"," key: 'price',"," parser: 'number' // Uses Y.Parsers.number"," }"," ];",""," response = Y.DataSchema.JSON.apply(schema, data);",""," // Note price was converted from a numeric string to a number"," // response.results[0] looks like { fruit: \"BANANA\", price: 1.96 }",""," @method apply"," @param {Object} [schema] Schema to apply. Supported configuration"," properties are:"," @param {String} [schema.resultListLocator] Path locator for the"," location of the array of records to flatten into `response.results`"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} [schema.metaFields] Path locators to extract extra"," non-record related information from the data object."," @param {Object|Array|String} data JSON data or its string serialization."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = { results: [], meta: {} };",""," // Convert incoming JSON strings"," if (!isObject(data)) {"," try {"," data_in = Y.JSON.parse(data);"," }"," catch(e) {"," data_out.error = e;"," return data_out;"," }"," }",""," if (isObject(data_in) && schema) {"," // Parse results data"," data_out = SchemaJSON._parseResults.call(this, schema, data_in, data_out);",""," // Parse meta data"," if (schema.metaFields !== undefined) {"," data_out = SchemaJSON._parseMeta(schema.metaFields, data_in, data_out);"," }"," }"," else {"," data_out.error = new Error(\"JSON schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Object} Schema to parse against."," * @param json_in {Object} JSON to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(schema, json_in, data_out) {"," var getPath = SchemaJSON.getPath,"," getValue = SchemaJSON.getLocationValue,"," path = getPath(schema.resultListLocator),"," results = path ?"," (getValue(path, json_in) ||"," // Fall back to treat resultListLocator as a simple key"," json_in[schema.resultListLocator]) :"," // Or if no resultListLocator is supplied, use the input"," json_in;",""," if (isArray(results)) {"," // if no result fields are passed in, then just take"," // the results array whole-hog Sometimes you're getting"," // an array of strings, or want the whole object, so"," // resultFields don't make sense."," if (isArray(schema.resultFields)) {"," data_out = SchemaJSON._getFieldValues.call(this, schema.resultFields, results, data_out);"," } else {"," data_out.results = results;"," }"," } else if (schema.resultListLocator) {"," data_out.results = [];"," data_out.error = new Error(\"JSON results retrieval failure\");"," }",""," return data_out;"," },",""," /**"," * Get field data values out of list of full results"," *"," * @method _getFieldValues"," * @param fields {Array} Fields to find."," * @param array_in {Array} Results to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _getFieldValues: function(fields, array_in, data_out) {"," var results = [],"," len = fields.length,"," i, j,"," field, key, locator, path, parser, val,"," simplePaths = [], complexPaths = [], fieldParsers = [],"," result, record;",""," // First collect hashes of simple paths, complex paths, and parsers"," for (i=0; i<len; i++) {"," field = fields[i]; // A field can be a simple string or a hash"," key = field.key || field; // Find the key"," locator = field.locator || key; // Find the locator",""," // Validate and store locators for later"," path = SchemaJSON.getPath(locator);"," if (path) {"," if (path.length === 1) {"," simplePaths.push({"," key : key,"," path: path[0]"," });"," } else {"," complexPaths.push({"," key : key,"," path : path,"," locator: locator"," });"," }"," } else {"," }",""," // Validate and store parsers for later"," //TODO: use Y.DataSchema.parse?"," parser = (isFunction(field.parser)) ?"," field.parser :"," Y.Parsers[field.parser + ''];",""," if (parser) {"," fieldParsers.push({"," key : key,"," parser: parser"," });"," }"," }",""," // Traverse list of array_in, creating records of simple fields,"," // complex fields, and applying parsers as necessary"," for (i=array_in.length-1; i>=0; --i) {"," record = {};"," result = array_in[i];"," if(result) {"," // Cycle through complexLocators"," for (j=complexPaths.length - 1; j>=0; --j) {"," path = complexPaths[j];"," val = SchemaJSON.getLocationValue(path.path, result);"," if (val === undefined) {"," val = SchemaJSON.getLocationValue([path.locator], result);"," // Fail over keys like \"foo.bar\" from nested parsing"," // to single token parsing if a value is found in"," // results[\"foo.bar\"]"," if (val !== undefined) {"," simplePaths.push({"," key: path.key,"," path: path.locator"," });"," // Don't try to process the path as complex"," // for further results"," complexPaths.splice(i,1);"," continue;"," }"," }",""," record[path.key] = Base.parse.call(this,"," (SchemaJSON.getLocationValue(path.path, result)), path);"," }",""," // Cycle through simpleLocators"," for (j = simplePaths.length - 1; j >= 0; --j) {"," path = simplePaths[j];"," // Bug 1777850: The result might be an array instead of object"," record[path.key] = Base.parse.call(this,"," ((result[path.path] === undefined) ?"," result[j] : result[path.path]), path);"," }",""," // Cycle through fieldParsers"," for (j=fieldParsers.length-1; j>=0; --j) {"," key = fieldParsers[j].key;"," record[key] = fieldParsers[j].parser.call(this, record[key]);"," // Safety net"," if (record[key] === undefined) {"," record[key] = null;"," }"," }"," results[i] = record;"," }"," }"," data_out.results = results;"," return data_out;"," },",""," /**"," * Parses results data according to schema"," *"," * @method _parseMeta"," * @param metaFields {Object} Metafields definitions."," * @param json_in {Object} JSON to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Schema-parsed meta data."," * @static"," * @protected"," */"," _parseMeta: function(metaFields, json_in, data_out) {"," if (isObject(metaFields)) {"," var key, path;"," for(key in metaFields) {"," if (metaFields.hasOwnProperty(key)) {"," path = SchemaJSON.getPath(metaFields[key]);"," if (path && json_in) {"," data_out.meta[key] = SchemaJSON.getLocationValue(path, json_in);"," }"," }"," }"," }"," else {"," data_out.error = new Error(\"JSON meta data retrieval failure\");"," }"," return data_out;"," }","};","","// TODO: Y.Object + mix() might be better here","Y.DataSchema.JSON = Y.mix(SchemaJSON, Base);","","","}, '3.17.0', {\"requires\": [\"dataschema-base\", \"json\"]});","","}());"]};
}
var __cov_GxUuHPQ8FEO1Q4S85u1HAw = __coverage__['build/dataschema-json/dataschema-json.js'];
__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['1']++;YUI.add('dataschema-json',function(Y,NAME){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['1']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['2']++;var LANG=Y.Lang,isFunction=LANG.isFunction,isObject=LANG.isObject,isArray=LANG.isArray,Base=Y.DataSchema.Base,SchemaJSON;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['3']++;SchemaJSON={getPath:function(locator){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['2']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['4']++;var path=null,keys=[],i=0;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['5']++;if(locator){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['1'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['6']++;locator=locator.replace(/\[\s*(['"])(.*?)\1\s*\]/g,function(x,$1,$2){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['3']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['7']++;keys[i]=$2;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['8']++;return'.@'+i++;}).replace(/\[(\d+)\]/g,function(x,$1){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['4']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['9']++;keys[i]=parseInt($1,10)|0;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['10']++;return'.@'+i++;}).replace(/^\./,'');__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['11']++;path=locator.split('.');__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['12']++;for(i=path.length-1;i>=0;--i){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['13']++;if(path[i].charAt(0)==='@'){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['2'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['14']++;path[i]=keys[parseInt(path[i].substr(1),10)];}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['2'][1]++;}}}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['1'][1]++;}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['15']++;return path;},getLocationValue:function(path,data){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['5']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['16']++;var i=0,len=path.length;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['17']++;for(;i<len;i++){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['18']++;if((__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['4'][0]++,isObject(data))&&(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['4'][1]++,path[i]in data)){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['3'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['19']++;data=data[path[i]];}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['3'][1]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['20']++;data=undefined;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['21']++;break;}}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['22']++;return data;},apply:function(schema,data){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['6']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['23']++;var data_in=data,data_out={results:[],meta:{}};__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['24']++;if(!isObject(data)){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['5'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['25']++;try{__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['26']++;data_in=Y.JSON.parse(data);}catch(e){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['27']++;data_out.error=e;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['28']++;return data_out;}}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['5'][1]++;}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['29']++;if((__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['7'][0]++,isObject(data_in))&&(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['7'][1]++,schema)){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['6'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['30']++;data_out=SchemaJSON._parseResults.call(this,schema,data_in,data_out);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['31']++;if(schema.metaFields!==undefined){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['8'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['32']++;data_out=SchemaJSON._parseMeta(schema.metaFields,data_in,data_out);}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['8'][1]++;}}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['6'][1]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['33']++;data_out.error=new Error('JSON schema parse failure');}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['34']++;return data_out;},_parseResults:function(schema,json_in,data_out){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['7']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['35']++;var getPath=SchemaJSON.getPath,getValue=SchemaJSON.getLocationValue,path=getPath(schema.resultListLocator),results=path?(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['9'][0]++,(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['10'][0]++,getValue(path,json_in))||(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['10'][1]++,json_in[schema.resultListLocator])):(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['9'][1]++,json_in);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['36']++;if(isArray(results)){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['11'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['37']++;if(isArray(schema.resultFields)){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['12'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['38']++;data_out=SchemaJSON._getFieldValues.call(this,schema.resultFields,results,data_out);}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['12'][1]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['39']++;data_out.results=results;}}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['11'][1]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['40']++;if(schema.resultListLocator){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['13'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['41']++;data_out.results=[];__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['42']++;data_out.error=new Error('JSON results retrieval failure');}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['13'][1]++;}}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['43']++;return data_out;},_getFieldValues:function(fields,array_in,data_out){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['8']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['44']++;var results=[],len=fields.length,i,j,field,key,locator,path,parser,val,simplePaths=[],complexPaths=[],fieldParsers=[],result,record;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['45']++;for(i=0;i<len;i++){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['46']++;field=fields[i];__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['47']++;key=(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['14'][0]++,field.key)||(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['14'][1]++,field);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['48']++;locator=(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['15'][0]++,field.locator)||(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['15'][1]++,key);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['49']++;path=SchemaJSON.getPath(locator);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['50']++;if(path){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['16'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['51']++;if(path.length===1){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['17'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['52']++;simplePaths.push({key:key,path:path[0]});}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['17'][1]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['53']++;complexPaths.push({key:key,path:path,locator:locator});}}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['16'][1]++;}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['54']++;parser=isFunction(field.parser)?(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['18'][0]++,field.parser):(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['18'][1]++,Y.Parsers[field.parser+'']);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['55']++;if(parser){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['19'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['56']++;fieldParsers.push({key:key,parser:parser});}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['19'][1]++;}}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['57']++;for(i=array_in.length-1;i>=0;--i){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['58']++;record={};__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['59']++;result=array_in[i];__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['60']++;if(result){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['20'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['61']++;for(j=complexPaths.length-1;j>=0;--j){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['62']++;path=complexPaths[j];__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['63']++;val=SchemaJSON.getLocationValue(path.path,result);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['64']++;if(val===undefined){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['21'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['65']++;val=SchemaJSON.getLocationValue([path.locator],result);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['66']++;if(val!==undefined){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['22'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['67']++;simplePaths.push({key:path.key,path:path.locator});__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['68']++;complexPaths.splice(i,1);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['69']++;continue;}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['22'][1]++;}}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['21'][1]++;}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['70']++;record[path.key]=Base.parse.call(this,SchemaJSON.getLocationValue(path.path,result),path);}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['71']++;for(j=simplePaths.length-1;j>=0;--j){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['72']++;path=simplePaths[j];__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['73']++;record[path.key]=Base.parse.call(this,result[path.path]===undefined?(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['23'][0]++,result[j]):(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['23'][1]++,result[path.path]),path);}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['74']++;for(j=fieldParsers.length-1;j>=0;--j){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['75']++;key=fieldParsers[j].key;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['76']++;record[key]=fieldParsers[j].parser.call(this,record[key]);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['77']++;if(record[key]===undefined){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['24'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['78']++;record[key]=null;}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['24'][1]++;}}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['79']++;results[i]=record;}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['20'][1]++;}}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['80']++;data_out.results=results;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['81']++;return data_out;},_parseMeta:function(metaFields,json_in,data_out){__cov_GxUuHPQ8FEO1Q4S85u1HAw.f['9']++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['82']++;if(isObject(metaFields)){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['25'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['83']++;var key,path;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['84']++;for(key in metaFields){__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['85']++;if(metaFields.hasOwnProperty(key)){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['26'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['86']++;path=SchemaJSON.getPath(metaFields[key]);__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['87']++;if((__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['28'][0]++,path)&&(__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['28'][1]++,json_in)){__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['27'][0]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['88']++;data_out.meta[key]=SchemaJSON.getLocationValue(path,json_in);}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['27'][1]++;}}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['26'][1]++;}}}else{__cov_GxUuHPQ8FEO1Q4S85u1HAw.b['25'][1]++;__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['89']++;data_out.error=new Error('JSON meta data retrieval failure');}__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['90']++;return data_out;}};__cov_GxUuHPQ8FEO1Q4S85u1HAw.s['91']++;Y.DataSchema.JSON=Y.mix(SchemaJSON,Base);},'3.17.0',{'requires':['dataschema-base','json']});
| vetruvet/cdnjs | ajax/libs/yui/3.17.0/dataschema-json/dataschema-json-coverage.js | JavaScript | mit | 40,554 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("calendar-base",function(e,t){function M(){M.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="calendar",i=n(r,"grid"),s=n(r,"left-grid"),o=n(r,"right-grid"),u=n(r,"body"),a=n(r,"header"),f=n(r,"header-label"),l=n(r,"weekdayrow"),c=n(r,"weekday"),h=n(r,"column-hidden"),p=n(r,"day-selected"),d=n(r,"selection-disabled"),v=n(r,"row"),m=n(r,"day"),g=n(r,"prevmonth-day"),y=n(r,"nextmonth-day"),b=n(r,"anchor"),w=n(r,"pane"),E=n(r,"status"),S=e.Lang,x=S.sub,T=e.Array.each,N=e.Object.each,C=e.Array.indexOf,k=e.Object.hasKey,L=e.Object.setValue,A=e.Object.isEmpty,O=e.DataType.Date;e.CalendarBase=e.extend(M,e.Widget,{_paneProperties:{},_paneNumber:1,_calendarId:null,_selectedDates:{},_rules:{},_filterFunction:null,_storedDateCells:{},initializer:function(){this._paneProperties={},this._calendarId=e.guid("calendar"),this._selectedDates={},A(this._rules)&&(this._rules={}),this._storedDateCells={}},renderUI:function(){var e=this.get("contentBox");e.appendChild(this._initCalendarHTML(this.get("date"))),this.get("showPrevMonth")&&this._afterShowPrevMonthChange(),this.get("showNextMonth")&&this._afterShowNextMonthChange(),this._renderCustomRules(),this._renderSelectedDates(),this.get("boundingBox").setAttribute("aria-labelledby",this._calendarId+"_header")},bindUI:function(){this.after("dateChange",this._afterDateChange),this.after("showPrevMonthChange",this._afterShowPrevMonthChange),this.after("showNextMonthChange",this._afterShowNextMonthChange),this.after("headerRendererChange",this._afterHeaderRendererChange),this.after("customRendererChange",this._afterCustomRendererChange),this.after("enabledDatesRuleChange",this._afterCustomRendererChange),this.after("disabledDatesRuleChange",this._afterCustomRendererChange),this.after("focusedChange",this._afterFocusedChange),this.after("selectionChange",this._renderSelectedDates),this._bindCalendarEvents()},_getSelectedDatesList:function(){var e=[];return N(this._selectedDates,function(t){N(t,function(t){N(t,function(t){e.push(t)},this)},this)},this),e},_getSelectedDatesInMonth:function(t){var n=t.getFullYear(),r=t.getMonth();return k(this._selectedDates,n)&&k(this._selectedDates[n],r)?e.Object.values(this._selectedDates[n][r]):[]},_isNumInList:function(e,t){if(t==="all")return!0;var n=t.split(","),r=n.length,i;while(r--){i=n[r].split("-");if(i.length===2&&e>=parseInt(i[0],10)&&e<=parseInt(i[1],10))return!0;if(i.length===1&&parseInt(n[r],10)===e)return!0}return!1},_getRulesForDate:function(e){var t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=e.getDay(),s=this._rules,o=[],u,a,f,l;for(u in s)if(this._isNumInList(t,u))if(S.isString(s[u]))o.push(s[u]);else for(a in s[u])if(this._isNumInList(n,a))if(S.isString(s[u][a]))o.push(s[u][a]);else for(f in s[u][a])if(this._isNumInList(r,f))if(S.isString(s[u][a][f]))o.push(s[u][a][f]);else for(l in s[u][a][f])this._isNumInList(i,l)&&S.isString(s[u][a][f][l])&&o.push(s[u][a][f][l]);return o},_matchesRule:function(e,t){return C(this._getRulesForDate(e),t)>=0},_canBeSelected:function(e){var t=this.get("enabledDatesRule"),n=this.get("disabledDatesRule");return t?this._matchesRule(e,t):n?!this._matchesRule(e,n):!0},selectDates:function(e){return O.isValidDate(e)?this._addDateToSelection(e):S.isArray(e)&&this._addDatesToSelection(e),this},deselectDates:function(e){return e?O.isValidDate(e)?this._removeDateFromSelection(e):S.isArray(e)&&this._removeDatesFromSelection(e):this._clearSelection(),this},_addDateToSelection:function(e,t){e=this._normalizeTime(e);if(this._canBeSelected(e)){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate();k(this._selectedDates,n)?k(this._selectedDates[n],r)?this._selectedDates[n][r][i]=e:(this._selectedDates[n][r]={},this._selectedDates[n][r][i]=e):(this._selectedDates[n]={},this._selectedDates[n][r]={},this._selectedDates[n][r][i]=e),this._selectedDates=L(this._selectedDates,[n,r,i],e),t||this._fireSelectionChange()}},_addDatesToSelection:function(e){T(e,this._addDateToSelection,this),this._fireSelectionChange()},_addDateRangeToSelection:function(e,t){var n=(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4,r=e.getTime(),i=t.getTime(),s,o,u;r>i?(s=r,r=i,i=s+n):i-=n;for(o=r;o<=i;o+=864e5)u=new Date(o),u.setHours(12),this._addDateToSelection(u,o);this._fireSelectionChange()},_removeDateFromSelection:function(e,t){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate();k(this._selectedDates,n)&&k(this._selectedDates[n],r)&&k(this._selectedDates[n][r],i)&&(delete this._selectedDates[n][r][i],t||this._fireSelectionChange())},_removeDatesFromSelection:function(e){T(e,this._removeDateFromSelection,this),this._fireSelectionChange()},_removeDateRangeFromSelection:function(e,t){var n=e.getTime(),r=t.getTime(),i;for(i=n;i<=r;i+=864e5)this._removeDateFromSelection(new Date(i),i);this._fireSelectionChange()},_clearSelection:function(e){this._selectedDates={},this.get("contentBox").all("."+p).removeClass(p).setAttribute("aria-selected",!1),e||this._fireSelectionChange()},_fireSelectionChange:function(){this.fire("selectionChange",{newSelection:this._getSelectedDatesList()})},_restoreModifiedCells:function(){var e=this.get("contentBox"),t;for(t in this._storedDateCells)e.one("#"+t).replace(this._storedDateCells[t]),delete this._storedDateCells[t]},_renderCustomRules:function(){this.get("contentBox").all("."+m+",."+y).removeClass(d).setAttribute("aria-disabled",!1);if(!A(this._rules)){var t,n,r;for(t=0;t<this._paneNumber;t++)n=O.addMonths(this.get("date"),t),r=O.listOfDatesInMonth(n),T(r,e.bind(this._renderCustomRulesHelper,this))}},_renderCustomRulesHelper:function(e){var t=this.get("enabledDatesRule"),n=this.get("disabledDatesRule"),r,i;r=this._getRulesForDate(e),r.length>0?((t&&C(r,t)<0||!t&&n&&C(r,n)>=0)&&this._disableDate(e),S.isFunction(this._filterFunction)&&(i=this._dateToNode(e),this._storedDateCells[i.get("id")]=i.cloneNode(!0),this._filterFunction(e,i,r))):t&&this._disableDate(e)},_renderSelectedDates:function(){this.get("contentBox").all("."+p).removeClass(p).setAttribute
("aria-selected",!1);var t,n,r;for(t=0;t<this._paneNumber;t++)n=O.addMonths(this.get("date"),t),r=this._getSelectedDatesInMonth(n),T(r,e.bind(this._renderSelectedDatesHelper,this))},_renderSelectedDatesHelper:function(e){this._dateToNode(e).addClass(p).setAttribute("aria-selected",!0)},_disableDate:function(e){this._dateToNode(e).addClass(d).setAttribute("aria-disabled",!0)},_dateToNode:function(e){var t=e.getDate(),n=0,r=t%7,i=(12+e.getMonth()-this.get("date").getMonth())%12,s=this._calendarId+"_pane_"+i,o=this._paneProperties[s].cutoffCol;switch(r){case 0:o>=6?n=12:n=5;break;case 1:n=6;break;case 2:o>0?n=7:n=0;break;case 3:o>1?n=8:n=1;break;case 4:o>2?n=9:n=2;break;case 5:o>3?n=10:n=3;break;case 6:o>4?n=11:n=4}return this.get("contentBox").one("#"+this._calendarId+"_pane_"+i+"_"+n+"_"+t)},_nodeToDate:function(e){var t=e.get("id").split("_").reverse(),n=parseInt(t[2],10),r=parseInt(t[0],10),i=O.addMonths(this.get("date"),n),s=i.getFullYear(),o=i.getMonth();return new Date(s,o,r,12,0,0,0)},_bindCalendarEvents:function(){},_normalizeDate:function(e){return e?new Date(e.getFullYear(),e.getMonth(),1,12,0,0,0):null},_normalizeTime:function(e){return e?new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0,0):null},_getCutoffColumn:function(e,t){var n=this._normalizeDate(e).getDay()-t,r=6-(n+7)%7;return r},_turnPrevMonthOn:function(e){var t=e.get("id"),n=this._paneProperties[t].paneDate,r=O.daysInMonth(O.addMonths(n,-1)),i;this._paneProperties[t].hasOwnProperty("daysInPrevMonth")||(this._paneProperties[t].daysInPrevMonth=0);if(r!==this._paneProperties[t].daysInPrevMonth){this._paneProperties[t].daysInPrevMonth=r;for(i=5;i>=0;i--)e.one("#"+t+"_"+i+"_"+(i-5)).set("text",r--)}},_turnPrevMonthOff:function(e){var t=e.get("id"),n;this._paneProperties[t].daysInPrevMonth=0;for(n=5;n>=0;n--)e.one("#"+t+"_"+n+"_"+(n-5)).setContent(" ")},_cleanUpNextMonthCells:function(e){var t=e.get("id");e.one("#"+t+"_6_29").removeClass(y),e.one("#"+t+"_7_30").removeClass(y),e.one("#"+t+"_8_31").removeClass(y),e.one("#"+t+"_0_30").removeClass(y),e.one("#"+t+"_1_31").removeClass(y)},_turnNextMonthOn:function(e){var t=1,n=e.get("id"),r=this._paneProperties[n].daysInMonth,i=this._paneProperties[n].cutoffCol,s,o;for(s=r-22;s<i+7;s++)e.one("#"+n+"_"+s+"_"+(s+23)).set("text",t++).addClass(y);o=i,r===31&&i<=1?o=2:r===30&&i===0&&(o=1);for(s=o;s<i+7;s++)e.one("#"+n+"_"+s+"_"+(s+30)).set("text",t++).addClass(y)},_turnNextMonthOff:function(e){var t=e.get("id"),n=this._paneProperties[t].daysInMonth,r=this._paneProperties[t].cutoffCol,i,s;for(i=n-22;i<=12;i++)e.one("#"+t+"_"+i+"_"+(i+23)).setContent(" ").addClass(y);s=0,n===31&&r<=1?s=2:n===30&&r===0&&(s=1);for(i=s;i<=12;i++)e.one("#"+t+"_"+i+"_"+(i+30)).setContent(" ").addClass(y)},_afterShowNextMonthChange:function(){var e=this.get("contentBox"),t=e.one("#"+this._calendarId+"_pane_"+(this._paneNumber-1));this._cleanUpNextMonthCells(t),this.get("showNextMonth")?this._turnNextMonthOn(t):this._turnNextMonthOff(t)},_afterShowPrevMonthChange:function(){var e=this.get("contentBox"),t=e.one("#"+this._calendarId+"_pane_"+0);this.get("showPrevMonth")?this._turnPrevMonthOn(t):this._turnPrevMonthOff(t)},_afterHeaderRendererChange:function(){var e=this.get("contentBox").one("."+f);e.setContent(this._updateCalendarHeader(this.get("date")))},_afterCustomRendererChange:function(){this._restoreModifiedCells(),this._renderCustomRules()},_afterDateChange:function(){var e=this.get("contentBox"),t=e.one("."+a).one("."+f),n=e.all("."+i),r=this.get("date"),s=0;e.setStyle("visibility","hidden"),t.setContent(this._updateCalendarHeader(r)),this._restoreModifiedCells(),n.each(function(e){this._rerenderCalendarPane(O.addMonths(r,s++),e)},this),this._afterShowPrevMonthChange(),this._afterShowNextMonthChange(),this._renderCustomRules(),this._renderSelectedDates(),e.setStyle("visibility","inherit")},_initCalendarPane:function(t,n){var r=this.get("strings.very_short_weekdays")||["Su","Mo","Tu","We","Th","Fr","Sa"],i=e.Intl.get("datatype-date-format").A,s=this.get("strings.first_weekday")||0,o=this._getCutoffColumn(t,s),u=O.daysInMonth(t),a=["","","","","",""],f={},l,c,p,d,v,b,w,E;f.weekday_row="";for(l=s;l<=s+6;l++)f.weekday_row+=x(M.WEEKDAY_TEMPLATE,{short_weekdayname:r[l%7],weekdayname:i[l%7]});f.weekday_row_template=x(M.WEEKDAY_ROW_TEMPLATE,f);for(c=0;c<=5;c++)for(p=0;p<=12;p++){d=7*c-5+p,v=n+"_"+p+"_"+d,b=m,d<1?b=g:d>u&&(b=y);if(d<1||d>u)d=" ";w=p>=o&&p<o+7?"":h,a[c]+=x(M.CALDAY_TEMPLATE,{day_content:d,calendar_col_class:"calendar_col"+p,calendar_col_visibility_class:w,calendar_day_class:b,calendar_day_id:v})}return f.body_template="",T(a,function(e){f.body_template+=x(M.CALDAY_ROW_TEMPLATE,{calday_row:e})}),f.calendar_pane_id=n,f.calendar_pane_tabindex=this.get("tabIndex"),f.pane_arialabel=O.format(t,{format:"%B %Y"}),E=x(x(M.CALENDAR_GRID_TEMPLATE,f),M.CALENDAR_STRINGS),this._paneProperties[n]={cutoffCol:o,daysInMonth:u,paneDate:t},E},_rerenderCalendarPane:function(e,t){var n=this.get("strings.first_weekday")||0,r=this._getCutoffColumn(e,n),i=O.daysInMonth(e),s=t.get("id"),o,u,a;t.setStyle("visibility","hidden"),t.setAttribute("aria-label",O.format(e,{format:"%B %Y"}));for(o=0;o<=12;o++){u=t.all(".calendar_col"+o),u.removeClass(h);if(o<r||o>=r+7)u.addClass(h);else switch(o){case 0:a=t.one("#"+s+"_0_30"),i>=30?(a.set("text","30"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 1:a=t.one("#"+s+"_1_31"),i>=31?(a.set("text","31"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 6:a=t.one("#"+s+"_6_29"),i>=29?(a.set("text","29"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 7:a=t.one("#"+s+"_7_30"),i>=30?(a.set("text","30"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 8:a=t.one("#"+s+"_8_31"),i>=31?(a.set("text","31"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y)
)}}this._paneProperties[s].cutoffCol=r,this._paneProperties[s].daysInMonth=i,this._paneProperties[s].paneDate=e,t.setStyle("visibility","inherit")},_updateCalendarHeader:function(t){var n="",r=this.get("headerRenderer");return e.Lang.isString(r)?n=O.format(t,{format:r}):r instanceof Function&&(n=r.call(this,t)),n},_initCalendarHeader:function(e){return x(x(M.HEADER_TEMPLATE,{calheader:this._updateCalendarHeader(e),calendar_id:this._calendarId}),M.CALENDAR_STRINGS)},_initCalendarHTML:function(t){function o(){return i=this._initCalendarPane(O.addMonths(t,r),n.calendar_id+"_pane_"+r),r++,i}var n={},r=0,i,s;return n.header_template=this._initCalendarHeader(t),n.calendar_id=this._calendarId,n.body_template=x(x(M.CONTENT_TEMPLATE,n),M.CALENDAR_STRINGS),s=n.body_template.replace(/\{calendar_grid_template\}/g,e.bind(o,this)),this._paneNumber=r,s}},{CALENDAR_STRINGS:{calendar_grid_class:i,calendar_body_class:u,calendar_hd_class:a,calendar_hd_label_class:f,calendar_weekdayrow_class:l,calendar_weekday_class:c,calendar_row_class:v,calendar_day_class:m,calendar_dayanchor_class:b,calendar_pane_class:w,calendar_right_grid_class:o,calendar_left_grid_class:s,calendar_status_class:E},CONTENT_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',ONE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',TWO_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-2"><div class = "{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-2"><div class = "{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',THREE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-3"><div class="{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-3">{calendar_grid_template}</div><div class="yui3-u-1-3"><div class="{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',CALENDAR_GRID_TEMPLATE:'<table class="{calendar_grid_class}" id="{calendar_pane_id}" role="grid" aria-readonly="true" aria-label="{pane_arialabel}" tabindex="{calendar_pane_tabindex}"><thead>{weekday_row_template}</thead><tbody>{body_template}</tbody></table>',HEADER_TEMPLATE:'<div class="yui3-g {calendar_hd_class}"><div class="yui3-u {calendar_hd_label_class}" id="{calendar_id}_header" aria-role="heading">{calheader}</div></div>',WEEKDAY_ROW_TEMPLATE:'<tr class="{calendar_weekdayrow_class}" role="row">{weekday_row}</tr>',CALDAY_ROW_TEMPLATE:'<tr class="{calendar_row_class}" role="row">{calday_row}</tr>',WEEKDAY_TEMPLATE:'<th class="{calendar_weekday_class}" role="columnheader" aria-label="{weekdayname}">{short_weekdayname}</th>',CALDAY_TEMPLATE:'<td class="{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}" id="{calendar_day_id}" role="gridcell" tabindex="-1">{day_content}</td>',NAME:"calendarBase",ATTRS:{tabIndex:{value:1},date:{value:new Date,setter:function(e){var t=this._normalizeDate(e);return O.areEqual(t,this.get("date"))?this.get("date"):t}},showPrevMonth:{value:!1},showNextMonth:{value:!1},strings:{valueFn:function(){return e.Intl.get("calendar-base")}},headerRenderer:{value:"%B %Y"},enabledDatesRule:{value:null},disabledDatesRule:{value:null},selectedDates:{readOnly:!0,getter:function(){return this._getSelectedDatesList()}},customRenderer:{lazyAdd:!1,value:{},setter:function(e){this._rules=e.rules,this._filterFunction=e.filterFunction}}}})},"3.17.0",{requires:["widget","datatype-date","datatype-date-math","cssgrids"],lang:["de","en","es","es-AR","fr","hu","it","ja","nb-NO","nl","pt-BR","ru","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-HANT-TW"],skinnable:!0});
| mikaelbr/cdnjs | ajax/libs/yui/3.17.0/calendar-base/calendar-base-min.js | JavaScript | mit | 16,052 |
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('event-base', function (Y, NAME) {
/*
* DOM event listener abstraction layer
* @module event
* @submodule event-base
*/
/**
* The domready event fires at the moment the browser's DOM is
* usable. In most cases, this is before images are fully
* downloaded, allowing you to provide a more responsive user
* interface.
*
* In YUI 3, domready subscribers will be notified immediately if
* that moment has already passed when the subscription is created.
*
* One exception is if the yui.js file is dynamically injected into
* the page. If this is done, you must tell the YUI instance that
* you did this in order for DOMReady (and window load events) to
* fire normally. That configuration option is 'injected' -- set
* it to true if the yui.js script is not included inline.
*
* This method is part of the 'event-ready' module, which is a
* submodule of 'event'.
*
* @event domready
* @for YUI
*/
Y.publish('domready', {
fireOnce: true,
async: true
});
if (YUI.Env.DOMReady) {
Y.fire('domready');
} else {
Y.Do.before(function() { Y.fire('domready'); }, YUI.Env, '_ready');
}
/**
* Custom event engine, DOM event listener abstraction layer, synthetic DOM
* events.
* @module event
* @submodule event-base
*/
/**
* Wraps a DOM event, properties requiring browser abstraction are
* fixed here. Provids a security layer when required.
* @class DOMEventFacade
* @param ev {Event} the DOM event
* @param currentTarget {HTMLElement} the element the listener was attached to
* @param wrapper {CustomEvent} the custom event wrapper for this DOM event
*/
var ua = Y.UA,
EMPTY = {},
/**
* webkit key remapping required for Safari < 3.1
* @property webkitKeymap
* @private
*/
webkitKeymap = {
63232: 38, // up
63233: 40, // down
63234: 37, // left
63235: 39, // right
63276: 33, // page up
63277: 34, // page down
25: 9, // SHIFT-TAB (Safari provides a different key code in
// this case, even though the shiftKey modifier is set)
63272: 46, // delete
63273: 36, // home
63275: 35 // end
},
/**
* Returns a wrapped node. Intended to be used on event targets,
* so it will return the node's parent if the target is a text
* node.
*
* If accessing a property of the node throws an error, this is
* probably the anonymous div wrapper Gecko adds inside text
* nodes. This likely will only occur when attempting to access
* the relatedTarget. In this case, we now return null because
* the anonymous div is completely useless and we do not know
* what the related target was because we can't even get to
* the element's parent node.
*
* @method resolve
* @private
*/
resolve = function(n) {
if (!n) {
return n;
}
try {
if (n && 3 == n.nodeType) {
n = n.parentNode;
}
} catch(e) {
return null;
}
return Y.one(n);
},
DOMEventFacade = function(ev, currentTarget, wrapper) {
this._event = ev;
this._currentTarget = currentTarget;
this._wrapper = wrapper || EMPTY;
// if not lazy init
this.init();
};
Y.extend(DOMEventFacade, Object, {
init: function() {
var e = this._event,
overrides = this._wrapper.overrides,
x = e.pageX,
y = e.pageY,
c,
currentTarget = this._currentTarget;
this.altKey = e.altKey;
this.ctrlKey = e.ctrlKey;
this.metaKey = e.metaKey;
this.shiftKey = e.shiftKey;
this.type = (overrides && overrides.type) || e.type;
this.clientX = e.clientX;
this.clientY = e.clientY;
this.pageX = x;
this.pageY = y;
// charCode is unknown in keyup, keydown. keyCode is unknown in keypress.
// FF 3.6 - 8+? pass 0 for keyCode in keypress events.
// Webkit, FF 3.6-8+?, and IE9+? pass 0 for charCode in keydown, keyup.
// Webkit and IE9+? duplicate charCode in keyCode.
// Opera never sets charCode, always keyCode (though with the charCode).
// IE6-8 don't set charCode or which.
// All browsers other than IE6-8 set which=keyCode in keydown, keyup, and
// which=charCode in keypress.
//
// Moral of the story: (e.which || e.keyCode) will always return the
// known code for that key event phase. e.keyCode is often different in
// keypress from keydown and keyup.
c = e.keyCode || e.charCode;
if (ua.webkit && (c in webkitKeymap)) {
c = webkitKeymap[c];
}
this.keyCode = c;
this.charCode = c;
// Fill in e.which for IE - implementers should always use this over
// e.keyCode or e.charCode.
this.which = e.which || e.charCode || c;
// this.button = e.button;
this.button = this.which;
this.target = resolve(e.target);
this.currentTarget = resolve(currentTarget);
this.relatedTarget = resolve(e.relatedTarget);
if (e.type == "mousewheel" || e.type == "DOMMouseScroll") {
this.wheelDelta = (e.detail) ? (e.detail * -1) : Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1);
}
if (this._touch) {
this._touch(e, currentTarget, this._wrapper);
}
},
stopPropagation: function() {
this._event.stopPropagation();
this._wrapper.stopped = 1;
this.stopped = 1;
},
stopImmediatePropagation: function() {
var e = this._event;
if (e.stopImmediatePropagation) {
e.stopImmediatePropagation();
} else {
this.stopPropagation();
}
this._wrapper.stopped = 2;
this.stopped = 2;
},
preventDefault: function(returnValue) {
var e = this._event;
e.preventDefault();
if (returnValue) {
e.returnValue = returnValue;
}
this._wrapper.prevented = 1;
this.prevented = 1;
},
halt: function(immediate) {
if (immediate) {
this.stopImmediatePropagation();
} else {
this.stopPropagation();
}
this.preventDefault();
}
});
DOMEventFacade.resolve = resolve;
Y.DOM2EventFacade = DOMEventFacade;
Y.DOMEventFacade = DOMEventFacade;
/**
* The native event
* @property _event
* @type {DOMEvent}
* @private
*/
/**
The name of the event (e.g. "click")
@property type
@type {String}
**/
/**
`true` if the "alt" or "option" key is pressed.
@property altKey
@type {Boolean}
**/
/**
`true` if the shift key is pressed.
@property shiftKey
@type {Boolean}
**/
/**
`true` if the "Windows" key on a Windows keyboard, "command" key on an
Apple keyboard, or "meta" key on other keyboards is pressed.
@property metaKey
@type {Boolean}
**/
/**
`true` if the "Ctrl" or "control" key is pressed.
@property ctrlKey
@type {Boolean}
**/
/**
* The X location of the event on the page (including scroll)
* @property pageX
* @type {Number}
*/
/**
* The Y location of the event on the page (including scroll)
* @property pageY
* @type {Number}
*/
/**
* The X location of the event in the viewport
* @property clientX
* @type {Number}
*/
/**
* The Y location of the event in the viewport
* @property clientY
* @type {Number}
*/
/**
* The keyCode for key events. Uses charCode if keyCode is not available
* @property keyCode
* @type {Number}
*/
/**
* The charCode for key events. Same as keyCode
* @property charCode
* @type {Number}
*/
/**
* The button that was pushed. 1 for left click, 2 for middle click, 3 for
* right click. This is only reliably populated on `mouseup` events.
* @property button
* @type {Number}
*/
/**
* The button that was pushed. Same as button.
* @property which
* @type {Number}
*/
/**
* Node reference for the targeted element
* @property target
* @type {Node}
*/
/**
* Node reference for the element that the listener was attached to.
* @property currentTarget
* @type {Node}
*/
/**
* Node reference to the relatedTarget
* @property relatedTarget
* @type {Node}
*/
/**
* Number representing the direction and velocity of the movement of the mousewheel.
* Negative is down, the higher the number, the faster. Applies to the mousewheel event.
* @property wheelDelta
* @type {Number}
*/
/**
* Stops the propagation to the next bubble target
* @method stopPropagation
*/
/**
* Stops the propagation to the next bubble target and
* prevents any additional listeners from being exectued
* on the current target.
* @method stopImmediatePropagation
*/
/**
* Prevents the event's default behavior
* @method preventDefault
* @param returnValue {string} sets the returnValue of the event to this value
* (rather than the default false value). This can be used to add a customized
* confirmation query to the beforeunload event).
*/
/**
* Stops the event propagation and prevents the default
* event behavior.
* @method halt
* @param immediate {boolean} if true additional listeners
* on the current target will not be executed
*/
(function() {
/**
* The event utility provides functions to add and remove event listeners,
* event cleansing. It also tries to automatically remove listeners it
* registers during the unload event.
* @module event
* @main event
* @submodule event-base
*/
/**
* The event utility provides functions to add and remove event listeners,
* event cleansing. It also tries to automatically remove listeners it
* registers during the unload event.
*
* @class Event
* @static
*/
Y.Env.evt.dom_wrappers = {};
Y.Env.evt.dom_map = {};
var _eventenv = Y.Env.evt,
config = Y.config,
win = config.win,
add = YUI.Env.add,
remove = YUI.Env.remove,
onLoad = function() {
YUI.Env.windowLoaded = true;
Y.Event._load();
remove(win, "load", onLoad);
},
onUnload = function() {
Y.Event._unload();
},
EVENT_READY = 'domready',
COMPAT_ARG = '~yui|2|compat~',
shouldIterate = function(o) {
try {
// TODO: See if there's a more performant way to return true early on this, for the common case
return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !Y.DOM.isWindow(o));
} catch(ex) {
return false;
}
},
// aliases to support DOM event subscription clean up when the last
// subscriber is detached. deleteAndClean overrides the DOM event's wrapper
// CustomEvent _delete method.
_ceProtoDelete = Y.CustomEvent.prototype._delete,
_deleteAndClean = function(s) {
var ret = _ceProtoDelete.apply(this, arguments);
if (!this.hasSubs()) {
Y.Event._clean(this);
}
return ret;
},
Event = function() {
/**
* True after the onload event has fired
* @property _loadComplete
* @type boolean
* @static
* @private
*/
var _loadComplete = false,
/**
* The number of times to poll after window.onload. This number is
* increased if additional late-bound handlers are requested after
* the page load.
* @property _retryCount
* @static
* @private
*/
_retryCount = 0,
/**
* onAvailable listeners
* @property _avail
* @static
* @private
*/
_avail = [],
/**
* Custom event wrappers for DOM events. Key is
* 'event:' + Element uid stamp + event type
* @property _wrappers
* @type CustomEvent
* @static
* @private
*/
_wrappers = _eventenv.dom_wrappers,
_windowLoadKey = null,
/**
* Custom event wrapper map DOM events. Key is
* Element uid stamp. Each item is a hash of custom event
* wrappers as provided in the _wrappers collection. This
* provides the infrastructure for getListeners.
* @property _el_events
* @static
* @private
*/
_el_events = _eventenv.dom_map;
return {
/**
* The number of times we should look for elements that are not
* in the DOM at the time the event is requested after the document
* has been loaded. The default is 1000@amp;40 ms, so it will poll
* for 40 seconds or until all outstanding handlers are bound
* (whichever comes first).
* @property POLL_RETRYS
* @type int
* @static
* @final
*/
POLL_RETRYS: 1000,
/**
* The poll interval in milliseconds
* @property POLL_INTERVAL
* @type int
* @static
* @final
*/
POLL_INTERVAL: 40,
/**
* addListener/removeListener can throw errors in unexpected scenarios.
* These errors are suppressed, the method returns false, and this property
* is set
* @property lastError
* @static
* @type Error
*/
lastError: null,
/**
* poll handle
* @property _interval
* @static
* @private
*/
_interval: null,
/**
* document readystate poll handle
* @property _dri
* @static
* @private
*/
_dri: null,
/**
* True when the document is initially usable
* @property DOMReady
* @type boolean
* @static
*/
DOMReady: false,
/**
* @method startInterval
* @static
* @private
*/
startInterval: function() {
if (!Event._interval) {
Event._interval = setInterval(Event._poll, Event.POLL_INTERVAL);
}
},
/**
* Executes the supplied callback when the item with the supplied
* id is found. This is meant to be used to execute behavior as
* soon as possible as the page loads. If you use this after the
* initial page load it will poll for a fixed time for the element.
* The number of times it will poll and the frequency are
* configurable. By default it will poll for 10 seconds.
*
* <p>The callback is executed with a single parameter:
* the custom object parameter, if provided.</p>
*
* @method onAvailable
*
* @param {string||string[]} id the id of the element, or an array
* of ids to look for.
* @param {function} fn what to execute when the element is found.
* @param {object} p_obj an optional object to be passed back as
* a parameter to fn.
* @param {boolean|object} p_override If set to true, fn will execute
* in the context of p_obj, if set to an object it
* will execute in the context of that object
* @param checkContent {boolean} check child node readiness (onContentReady)
* @static
* @deprecated Use Y.on("available")
*/
// @TODO fix arguments
onAvailable: function(id, fn, p_obj, p_override, checkContent, compat) {
var a = Y.Array(id), i, availHandle;
for (i=0; i<a.length; i=i+1) {
_avail.push({
id: a[i],
fn: fn,
obj: p_obj,
override: p_override,
checkReady: checkContent,
compat: compat
});
}
_retryCount = this.POLL_RETRYS;
// We want the first test to be immediate, but async
setTimeout(Event._poll, 0);
availHandle = new Y.EventHandle({
_delete: function() {
// set by the event system for lazy DOM listeners
if (availHandle.handle) {
availHandle.handle.detach();
return;
}
var i, j;
// otherwise try to remove the onAvailable listener(s)
for (i = 0; i < a.length; i++) {
for (j = 0; j < _avail.length; j++) {
if (a[i] === _avail[j].id) {
_avail.splice(j, 1);
}
}
}
}
});
return availHandle;
},
/**
* Works the same way as onAvailable, but additionally checks the
* state of sibling elements to determine if the content of the
* available element is safe to modify.
*
* <p>The callback is executed with a single parameter:
* the custom object parameter, if provided.</p>
*
* @method onContentReady
*
* @param {string} id the id of the element to look for.
* @param {function} fn what to execute when the element is ready.
* @param {object} obj an optional object to be passed back as
* a parameter to fn.
* @param {boolean|object} override If set to true, fn will execute
* in the context of p_obj. If an object, fn will
* exectute in the context of that object
*
* @static
* @deprecated Use Y.on("contentready")
*/
// @TODO fix arguments
onContentReady: function(id, fn, obj, override, compat) {
return Event.onAvailable(id, fn, obj, override, true, compat);
},
/**
* Adds an event listener
*
* @method attach
*
* @param {String} type The type of event to append
* @param {Function} fn The method the event invokes
* @param {String|HTMLElement|Array|NodeList} el An id, an element
* reference, or a collection of ids and/or elements to assign the
* listener to.
* @param {Object} context optional context object
* @param {Boolean|object} args 0..n arguments to pass to the callback
* @return {EventHandle} an object to that can be used to detach the listener
*
* @static
*/
attach: function(type, fn, el, context) {
return Event._attach(Y.Array(arguments, 0, true));
},
_createWrapper: function (el, type, capture, compat, facade) {
var cewrapper,
ek = Y.stamp(el),
key = 'event:' + ek + type;
if (false === facade) {
key += 'native';
}
if (capture) {
key += 'capture';
}
cewrapper = _wrappers[key];
if (!cewrapper) {
// create CE wrapper
cewrapper = Y.publish(key, {
silent: true,
bubbles: false,
emitFacade:false,
contextFn: function() {
if (compat) {
return cewrapper.el;
} else {
cewrapper.nodeRef = cewrapper.nodeRef || Y.one(cewrapper.el);
return cewrapper.nodeRef;
}
}
});
cewrapper.overrides = {};
// for later removeListener calls
cewrapper.el = el;
cewrapper.key = key;
cewrapper.domkey = ek;
cewrapper.type = type;
cewrapper.fn = function(e) {
cewrapper.fire(Event.getEvent(e, el, (compat || (false === facade))));
};
cewrapper.capture = capture;
if (el == win && type == "load") {
// window load happens once
cewrapper.fireOnce = true;
_windowLoadKey = key;
}
cewrapper._delete = _deleteAndClean;
_wrappers[key] = cewrapper;
_el_events[ek] = _el_events[ek] || {};
_el_events[ek][key] = cewrapper;
add(el, type, cewrapper.fn, capture);
}
return cewrapper;
},
_attach: function(args, conf) {
var compat,
handles, oEl, cewrapper, context,
fireNow = false, ret,
type = args[0],
fn = args[1],
el = args[2] || win,
facade = conf && conf.facade,
capture = conf && conf.capture,
overrides = conf && conf.overrides;
if (args[args.length-1] === COMPAT_ARG) {
compat = true;
}
if (!fn || !fn.call) {
return false;
}
// The el argument can be an array of elements or element ids.
if (shouldIterate(el)) {
handles=[];
Y.each(el, function(v, k) {
args[2] = v;
handles.push(Event._attach(args.slice(), conf));
});
// return (handles.length === 1) ? handles[0] : handles;
return new Y.EventHandle(handles);
// If the el argument is a string, we assume it is
// actually the id of the element. If the page is loaded
// we convert el to the actual element, otherwise we
// defer attaching the event until the element is
// ready
} else if (Y.Lang.isString(el)) {
// oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el);
if (compat) {
oEl = Y.DOM.byId(el);
} else {
oEl = Y.Selector.query(el);
switch (oEl.length) {
case 0:
oEl = null;
break;
case 1:
oEl = oEl[0];
break;
default:
args[2] = oEl;
return Event._attach(args, conf);
}
}
if (oEl) {
el = oEl;
// Not found = defer adding the event until the element is available
} else {
ret = Event.onAvailable(el, function() {
ret.handle = Event._attach(args, conf);
}, Event, true, false, compat);
return ret;
}
}
// Element should be an html element or node
if (!el) {
return false;
}
if (Y.Node && Y.instanceOf(el, Y.Node)) {
el = Y.Node.getDOMNode(el);
}
cewrapper = Event._createWrapper(el, type, capture, compat, facade);
if (overrides) {
Y.mix(cewrapper.overrides, overrides);
}
if (el == win && type == "load") {
// if the load is complete, fire immediately.
// all subscribers, including the current one
// will be notified.
if (YUI.Env.windowLoaded) {
fireNow = true;
}
}
if (compat) {
args.pop();
}
context = args[3];
// set context to the Node if not specified
// ret = cewrapper.on.apply(cewrapper, trimmedArgs);
ret = cewrapper._on(fn, context, (args.length > 4) ? args.slice(4) : null);
if (fireNow) {
cewrapper.fire();
}
return ret;
},
/**
* Removes an event listener. Supports the signature the event was bound
* with, but the preferred way to remove listeners is using the handle
* that is returned when using Y.on
*
* @method detach
*
* @param {String} type the type of event to remove.
* @param {Function} fn the method the event invokes. If fn is
* undefined, then all event handlers for the type of event are
* removed.
* @param {String|HTMLElement|Array|NodeList|EventHandle} el An
* event handle, an id, an element reference, or a collection
* of ids and/or elements to remove the listener from.
* @return {boolean} true if the unbind was successful, false otherwise.
* @static
*/
detach: function(type, fn, el, obj) {
var args=Y.Array(arguments, 0, true), compat, l, ok, i,
id, ce;
if (args[args.length-1] === COMPAT_ARG) {
compat = true;
// args.pop();
}
if (type && type.detach) {
return type.detach();
}
// The el argument can be a string
if (typeof el == "string") {
// el = (compat) ? Y.DOM.byId(el) : Y.all(el);
if (compat) {
el = Y.DOM.byId(el);
} else {
el = Y.Selector.query(el);
l = el.length;
if (l < 1) {
el = null;
} else if (l == 1) {
el = el[0];
}
}
// return Event.detach.apply(Event, args);
}
if (!el) {
return false;
}
if (el.detach) {
args.splice(2, 1);
return el.detach.apply(el, args);
// The el argument can be an array of elements or element ids.
} else if (shouldIterate(el)) {
ok = true;
for (i=0, l=el.length; i<l; ++i) {
args[2] = el[i];
ok = ( Y.Event.detach.apply(Y.Event, args) && ok );
}
return ok;
}
if (!type || !fn || !fn.call) {
return Event.purgeElement(el, false, type);
}
id = 'event:' + Y.stamp(el) + type;
ce = _wrappers[id];
if (ce) {
return ce.detach(fn);
} else {
return false;
}
},
/**
* Finds the event in the window object, the caller's arguments, or
* in the arguments of another method in the callstack. This is
* executed automatically for events registered through the event
* manager, so the implementer should not normally need to execute
* this function at all.
* @method getEvent
* @param {Event} e the event parameter from the handler
* @param {HTMLElement} el the element the listener was attached to
* @return {Event} the event
* @static
*/
getEvent: function(e, el, noFacade) {
var ev = e || win.event;
return (noFacade) ? ev :
new Y.DOMEventFacade(ev, el, _wrappers['event:' + Y.stamp(el) + e.type]);
},
/**
* Generates an unique ID for the element if it does not already
* have one.
* @method generateId
* @param el the element to create the id for
* @return {string} the resulting id of the element
* @static
*/
generateId: function(el) {
return Y.DOM.generateID(el);
},
/**
* We want to be able to use getElementsByTagName as a collection
* to attach a group of events to. Unfortunately, different
* browsers return different types of collections. This function
* tests to determine if the object is array-like. It will also
* fail if the object is an array, but is empty.
* @method _isValidCollection
* @param o the object to test
* @return {boolean} true if the object is array-like and populated
* @deprecated was not meant to be used directly
* @static
* @private
*/
_isValidCollection: shouldIterate,
/**
* hook up any deferred listeners
* @method _load
* @static
* @private
*/
_load: function(e) {
if (!_loadComplete) {
_loadComplete = true;
// Just in case DOMReady did not go off for some reason
// E._ready();
if (Y.fire) {
Y.fire(EVENT_READY);
}
// Available elements may not have been detected before the
// window load event fires. Try to find them now so that the
// the user is more likely to get the onAvailable notifications
// before the window load notification
Event._poll();
}
},
/**
* Polling function that runs before the onload event fires,
* attempting to attach to DOM Nodes as soon as they are
* available
* @method _poll
* @static
* @private
*/
_poll: function() {
if (Event.locked) {
return;
}
if (Y.UA.ie && !YUI.Env.DOMReady) {
// Hold off if DOMReady has not fired and check current
// readyState to protect against the IE operation aborted
// issue.
Event.startInterval();
return;
}
Event.locked = true;
// keep trying until after the page is loaded. We need to
// check the page load state prior to trying to bind the
// elements so that we can be certain all elements have been
// tested appropriately
var i, len, item, el, notAvail, executeItem,
tryAgain = !_loadComplete;
if (!tryAgain) {
tryAgain = (_retryCount > 0);
}
// onAvailable
notAvail = [];
executeItem = function (el, item) {
var context, ov = item.override;
try {
if (item.compat) {
if (item.override) {
if (ov === true) {
context = item.obj;
} else {
context = ov;
}
} else {
context = el;
}
item.fn.call(context, item.obj);
} else {
context = item.obj || Y.one(el);
item.fn.apply(context, (Y.Lang.isArray(ov)) ? ov : []);
}
} catch (e) {
}
};
// onAvailable
for (i=0,len=_avail.length; i<len; ++i) {
item = _avail[i];
if (item && !item.checkReady) {
// el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);
el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);
if (el) {
executeItem(el, item);
_avail[i] = null;
} else {
notAvail.push(item);
}
}
}
// onContentReady
for (i=0,len=_avail.length; i<len; ++i) {
item = _avail[i];
if (item && item.checkReady) {
// el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);
el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);
if (el) {
// The element is available, but not necessarily ready
// @todo should we test parentNode.nextSibling?
if (_loadComplete || (el.get && el.get('nextSibling')) || el.nextSibling) {
executeItem(el, item);
_avail[i] = null;
}
} else {
notAvail.push(item);
}
}
}
_retryCount = (notAvail.length === 0) ? 0 : _retryCount - 1;
if (tryAgain) {
// we may need to strip the nulled out items here
Event.startInterval();
} else {
clearInterval(Event._interval);
Event._interval = null;
}
Event.locked = false;
return;
},
/**
* Removes all listeners attached to the given element via addListener.
* Optionally, the node's children can also be purged.
* Optionally, you can specify a specific type of event to remove.
* @method purgeElement
* @param {HTMLElement} el the element to purge
* @param {boolean} recurse recursively purge this element's children
* as well. Use with caution.
* @param {string} type optional type of listener to purge. If
* left out, all listeners will be removed
* @static
*/
purgeElement: function(el, recurse, type) {
// var oEl = (Y.Lang.isString(el)) ? Y.one(el) : el,
var oEl = (Y.Lang.isString(el)) ? Y.Selector.query(el, null, true) : el,
lis = Event.getListeners(oEl, type), i, len, children, child;
if (recurse && oEl) {
lis = lis || [];
children = Y.Selector.query('*', oEl);
len = children.length;
for (i = 0; i < len; ++i) {
child = Event.getListeners(children[i], type);
if (child) {
lis = lis.concat(child);
}
}
}
if (lis) {
for (i = 0, len = lis.length; i < len; ++i) {
lis[i].detachAll();
}
}
},
/**
* Removes all object references and the DOM proxy subscription for
* a given event for a DOM node.
*
* @method _clean
* @param wrapper {CustomEvent} Custom event proxy for the DOM
* subscription
* @private
* @static
* @since 3.4.0
*/
_clean: function (wrapper) {
var key = wrapper.key,
domkey = wrapper.domkey;
remove(wrapper.el, wrapper.type, wrapper.fn, wrapper.capture);
delete _wrappers[key];
delete Y._yuievt.events[key];
if (_el_events[domkey]) {
delete _el_events[domkey][key];
if (!Y.Object.size(_el_events[domkey])) {
delete _el_events[domkey];
}
}
},
/**
* Returns all listeners attached to the given element via addListener.
* Optionally, you can specify a specific type of event to return.
* @method getListeners
* @param el {HTMLElement|string} the element or element id to inspect
* @param type {string} optional type of listener to return. If
* left out, all listeners will be returned
* @return {CustomEvent} the custom event wrapper for the DOM event(s)
* @static
*/
getListeners: function(el, type) {
var ek = Y.stamp(el, true), evts = _el_events[ek],
results=[] , key = (type) ? 'event:' + ek + type : null,
adapters = _eventenv.plugins;
if (!evts) {
return null;
}
if (key) {
// look for synthetic events
if (adapters[type] && adapters[type].eventDef) {
key += '_synth';
}
if (evts[key]) {
results.push(evts[key]);
}
// get native events as well
key += 'native';
if (evts[key]) {
results.push(evts[key]);
}
} else {
Y.each(evts, function(v, k) {
results.push(v);
});
}
return (results.length) ? results : null;
},
/**
* Removes all listeners registered by pe.event. Called
* automatically during the unload event.
* @method _unload
* @static
* @private
*/
_unload: function(e) {
Y.each(_wrappers, function(v, k) {
if (v.type == 'unload') {
v.fire(e);
}
v.detachAll();
});
remove(win, "unload", onUnload);
},
/**
* Adds a DOM event directly without the caching, cleanup, context adj, etc
*
* @method nativeAdd
* @param {HTMLElement} el the element to bind the handler to
* @param {string} type the type of event handler
* @param {function} fn the callback to invoke
* @param {Boolean} capture capture or bubble phase
* @static
* @private
*/
nativeAdd: add,
/**
* Basic remove listener
*
* @method nativeRemove
* @param {HTMLElement} el the element to bind the handler to
* @param {string} type the type of event handler
* @param {function} fn the callback to invoke
* @param {Boolean} capture capture or bubble phase
* @static
* @private
*/
nativeRemove: remove
};
}();
Y.Event = Event;
if (config.injected || YUI.Env.windowLoaded) {
onLoad();
} else {
add(win, "load", onLoad);
}
// Process onAvailable/onContentReady items when when the DOM is ready in IE
if (Y.UA.ie) {
Y.on(EVENT_READY, Event._poll);
// In IE6 and below, detach event handlers when the page is unloaded in
// order to try and prevent cross-page memory leaks. This isn't done in
// other browsers because a) it's not necessary, and b) it breaks the
// back/forward cache.
if (Y.UA.ie < 7) {
try {
add(win, "unload", onUnload);
} catch(e) {
}
}
}
Event.Custom = Y.CustomEvent;
Event.Subscriber = Y.Subscriber;
Event.Target = Y.EventTarget;
Event.Handle = Y.EventHandle;
Event.Facade = Y.EventFacade;
Event._poll();
}());
/**
* DOM event listener abstraction layer
* @module event
* @submodule event-base
*/
/**
* Executes the callback as soon as the specified element
* is detected in the DOM. This function expects a selector
* string for the element(s) to detect. If you already have
* an element reference, you don't need this event.
* @event available
* @param type {string} 'available'
* @param fn {function} the callback function to execute.
* @param el {string} an selector for the element(s) to attach
* @param context optional argument that specifies what 'this' refers to.
* @param args* 0..n additional arguments to pass on to the callback function.
* These arguments will be added after the event object.
* @return {EventHandle} the detach handle
* @for YUI
*/
Y.Env.evt.plugins.available = {
on: function(type, fn, id, o) {
var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;
return Y.Event.onAvailable.call(Y.Event, id, fn, o, a);
}
};
/**
* Executes the callback as soon as the specified element
* is detected in the DOM with a nextSibling property
* (indicating that the element's children are available).
* This function expects a selector
* string for the element(s) to detect. If you already have
* an element reference, you don't need this event.
* @event contentready
* @param type {string} 'contentready'
* @param fn {function} the callback function to execute.
* @param el {string} an selector for the element(s) to attach.
* @param context optional argument that specifies what 'this' refers to.
* @param args* 0..n additional arguments to pass on to the callback function.
* These arguments will be added after the event object.
* @return {EventHandle} the detach handle
* @for YUI
*/
Y.Env.evt.plugins.contentready = {
on: function(type, fn, id, o) {
var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;
return Y.Event.onContentReady.call(Y.Event, id, fn, o, a);
}
};
}, '3.17.0', {"requires": ["event-custom-base"]});
| cgvarela/cdnjs | ajax/libs/yui/3.17.0/event-base/event-base.js | JavaScript | mit | 41,982 |
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.WordCount', {
block : 0,
id : null,
countre : null,
cleanre : null,
init : function(ed, url) {
var t = this, last = 0, VK = tinymce.VK;
t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’
t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);
t.update_rate = ed.getParam('wordcount_update_rate', 2000);
t.update_on_delete = ed.getParam('wordcount_update_on_delete', false);
t.id = ed.id + '-word-count';
ed.onPostRender.add(function(ed, cm) {
var row, id;
// Add it to the specified id or the theme advanced path
id = ed.getParam('wordcount_target_id');
if (!id) {
row = tinymce.DOM.get(ed.id + '_path_row');
if (row)
tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id="' + t.id + '">0</span>');
} else {
tinymce.DOM.add(id, 'span', {}, '<span id="' + t.id + '">0</span>');
}
});
ed.onInit.add(function(ed) {
ed.selection.onSetContent.add(function() {
t._count(ed);
});
t._count(ed);
});
ed.onSetContent.add(function(ed) {
t._count(ed);
});
function checkKeys(key) {
return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last));
}
function checkDelOrBksp(key) {
return key === VK.DELETE || key === VK.BACKSPACE;
}
ed.onKeyUp.add(function(ed, e) {
if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) {
t._count(ed);
}
last = e.keyCode;
});
},
_getCount : function(ed) {
var tc = 0;
var tx = ed.getContent({ format: 'raw' });
if (tx) {
tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces
tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars
// deal with html entities
tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' ');
tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation
var wordArray = tx.match(this.countre);
if (wordArray) {
tc = wordArray.length;
}
}
return tc;
},
_count : function(ed) {
var t = this;
// Keep multiple calls from happening at the same time
if (t.block)
return;
t.block = 1;
setTimeout(function() {
if (!ed.destroyed) {
var tc = t._getCount(ed);
tinymce.DOM.setHTML(t.id, tc.toString());
setTimeout(function() {t.block = 0;}, t.update_rate);
}
}, 1);
},
getInfo: function() {
return {
longname : 'Word Count plugin',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount);
})();
| emmansun/cdnjs | ajax/libs/tinymce/3.5.8/plugins/wordcount/editor_plugin_src.js | JavaScript | mit | 3,331 |
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
var base64VLQ = require('./base64-vlq');
var util = require('./util');
var ArraySet = require('./array-set').ArraySet;
var MappingList = require('./mapping-list').MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
* being built incrementally. You may pass an object with the following
* properties:
*
* - file: The filename of the generated source.
* - sourceRoot: A root for all relative URLs in this source map.
*/
function SourceMapGenerator(aArgs) {
if (!aArgs) {
aArgs = {};
}
this._file = util.getArg(aArgs, 'file', null);
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
this._sources = new ArraySet();
this._names = new ArraySet();
this._mappings = new MappingList();
this._sourcesContents = null;
}
SourceMapGenerator.prototype._version = 3;
/**
* Creates a new SourceMapGenerator based on a SourceMapConsumer
*
* @param aSourceMapConsumer The SourceMap.
*/
SourceMapGenerator.fromSourceMap =
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
var generator = new SourceMapGenerator({
file: aSourceMapConsumer.file,
sourceRoot: sourceRoot
});
aSourceMapConsumer.eachMapping(function (mapping) {
var newMapping = {
generated: {
line: mapping.generatedLine,
column: mapping.generatedColumn
}
};
if (mapping.source != null) {
newMapping.source = mapping.source;
if (sourceRoot != null) {
newMapping.source = util.relative(sourceRoot, newMapping.source);
}
newMapping.original = {
line: mapping.originalLine,
column: mapping.originalColumn
};
if (mapping.name != null) {
newMapping.name = mapping.name;
}
}
generator.addMapping(newMapping);
});
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
generator.setSourceContent(sourceFile, content);
}
});
return generator;
};
/**
* Add a single mapping from original source line and column to the generated
* source's line and column for this source map being created. The mapping
* object should have the following properties:
*
* - generated: An object with the generated line and column positions.
* - original: An object with the original line and column positions.
* - source: The original source file (relative to the sourceRoot).
* - name: An optional original token name for this mapping.
*/
SourceMapGenerator.prototype.addMapping =
function SourceMapGenerator_addMapping(aArgs) {
var generated = util.getArg(aArgs, 'generated');
var original = util.getArg(aArgs, 'original', null);
var source = util.getArg(aArgs, 'source', null);
var name = util.getArg(aArgs, 'name', null);
if (!this._skipValidation) {
this._validateMapping(generated, original, source, name);
}
if (source != null && !this._sources.has(source)) {
this._sources.add(source);
}
if (name != null && !this._names.has(name)) {
this._names.add(name);
}
this._mappings.add({
generatedLine: generated.line,
generatedColumn: generated.column,
originalLine: original != null && original.line,
originalColumn: original != null && original.column,
source: source,
name: name
});
};
/**
* Set the source content for a source file.
*/
SourceMapGenerator.prototype.setSourceContent =
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot != null) {
source = util.relative(this._sourceRoot, source);
}
if (aSourceContent != null) {
// Add the source content to the _sourcesContents map.
// Create a new _sourcesContents map if the property is null.
if (!this._sourcesContents) {
this._sourcesContents = {};
}
this._sourcesContents[util.toSetString(source)] = aSourceContent;
} else if (this._sourcesContents) {
// Remove the source file from the _sourcesContents map.
// If the _sourcesContents map is empty, set the property to null.
delete this._sourcesContents[util.toSetString(source)];
if (Object.keys(this._sourcesContents).length === 0) {
this._sourcesContents = null;
}
}
};
/**
* Applies the mappings of a sub-source-map for a specific source file to the
* source map being generated. Each mapping to the supplied source file is
* rewritten using the supplied source map. Note: The resolution for the
* resulting mappings is the minimium of this map and the supplied map.
*
* @param aSourceMapConsumer The source map to be applied.
* @param aSourceFile Optional. The filename of the source file.
* If omitted, SourceMapConsumer's file property will be used.
* @param aSourceMapPath Optional. The dirname of the path to the source map
* to be applied. If relative, it is relative to the SourceMapConsumer.
* This parameter is needed when the two source maps aren't in the same
* directory, and the source map to be applied contains relative source
* paths. If so, those relative source paths need to be rewritten
* relative to the SourceMapGenerator.
*/
SourceMapGenerator.prototype.applySourceMap =
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
var sourceFile = aSourceFile;
// If aSourceFile is omitted, we will use the file property of the SourceMap
if (aSourceFile == null) {
if (aSourceMapConsumer.file == null) {
throw new Error(
'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
'or the source map\'s "file" property. Both were omitted.'
);
}
sourceFile = aSourceMapConsumer.file;
}
var sourceRoot = this._sourceRoot;
// Make "sourceFile" relative if an absolute Url is passed.
if (sourceRoot != null) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
// Applying the SourceMap can add and remove items from the sources and
// the names array.
var newSources = new ArraySet();
var newNames = new ArraySet();
// Find mappings for the "sourceFile"
this._mappings.unsortedForEach(function (mapping) {
if (mapping.source === sourceFile && mapping.originalLine != null) {
// Check if it can be mapped by the source map, then update the mapping.
var original = aSourceMapConsumer.originalPositionFor({
line: mapping.originalLine,
column: mapping.originalColumn
});
if (original.source != null) {
// Copy mapping
mapping.source = original.source;
if (aSourceMapPath != null) {
mapping.source = util.join(aSourceMapPath, mapping.source)
}
if (sourceRoot != null) {
mapping.source = util.relative(sourceRoot, mapping.source);
}
mapping.originalLine = original.line;
mapping.originalColumn = original.column;
if (original.name != null) {
mapping.name = original.name;
}
}
}
var source = mapping.source;
if (source != null && !newSources.has(source)) {
newSources.add(source);
}
var name = mapping.name;
if (name != null && !newNames.has(name)) {
newNames.add(name);
}
}, this);
this._sources = newSources;
this._names = newNames;
// Copy sourcesContents of applied map.
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
if (aSourceMapPath != null) {
sourceFile = util.join(aSourceMapPath, sourceFile);
}
if (sourceRoot != null) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
this.setSourceContent(sourceFile, content);
}
}, this);
};
/**
* A mapping can have one of the three levels of data:
*
* 1. Just the generated position.
* 2. The Generated position, original position, and original source.
* 3. Generated and original position, original source, as well as a name
* token.
*
* To maintain consistency, we validate that any new mapping being added falls
* in to one of these categories.
*/
SourceMapGenerator.prototype._validateMapping =
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
aName) {
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
&& aGenerated.line > 0 && aGenerated.column >= 0
&& !aOriginal && !aSource && !aName) {
// Case 1.
return;
}
else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
&& aOriginal && 'line' in aOriginal && 'column' in aOriginal
&& aGenerated.line > 0 && aGenerated.column >= 0
&& aOriginal.line > 0 && aOriginal.column >= 0
&& aSource) {
// Cases 2 and 3.
return;
}
else {
throw new Error('Invalid mapping: ' + JSON.stringify({
generated: aGenerated,
source: aSource,
original: aOriginal,
name: aName
}));
}
};
/**
* Serialize the accumulated mappings in to the stream of base 64 VLQs
* specified by the source map format.
*/
SourceMapGenerator.prototype._serializeMappings =
function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
var previousOriginalColumn = 0;
var previousOriginalLine = 0;
var previousName = 0;
var previousSource = 0;
var result = '';
var mapping;
var mappings = this._mappings.toArray();
for (var i = 0, len = mappings.length; i < len; i++) {
mapping = mappings[i];
if (mapping.generatedLine !== previousGeneratedLine) {
previousGeneratedColumn = 0;
while (mapping.generatedLine !== previousGeneratedLine) {
result += ';';
previousGeneratedLine++;
}
}
else {
if (i > 0) {
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
continue;
}
result += ',';
}
}
result += base64VLQ.encode(mapping.generatedColumn
- previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source != null) {
result += base64VLQ.encode(this._sources.indexOf(mapping.source)
- previousSource);
previousSource = this._sources.indexOf(mapping.source);
// lines are stored 0-based in SourceMap spec version 3
result += base64VLQ.encode(mapping.originalLine - 1
- previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
result += base64VLQ.encode(mapping.originalColumn
- previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name != null) {
result += base64VLQ.encode(this._names.indexOf(mapping.name)
- previousName);
previousName = this._names.indexOf(mapping.name);
}
}
}
return result;
};
SourceMapGenerator.prototype._generateSourcesContent =
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function (source) {
if (!this._sourcesContents) {
return null;
}
if (aSourceRoot != null) {
source = util.relative(aSourceRoot, source);
}
var key = util.toSetString(source);
return Object.prototype.hasOwnProperty.call(this._sourcesContents,
key)
? this._sourcesContents[key]
: null;
}, this);
};
/**
* Externalize the source map.
*/
SourceMapGenerator.prototype.toJSON =
function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
sources: this._sources.toArray(),
names: this._names.toArray(),
mappings: this._serializeMappings()
};
if (this._file != null) {
map.file = this._file;
}
if (this._sourceRoot != null) {
map.sourceRoot = this._sourceRoot;
}
if (this._sourcesContents) {
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
}
return map;
};
/**
* Render the source map being generated to a string.
*/
SourceMapGenerator.prototype.toString =
function SourceMapGenerator_toString() {
return JSON.stringify(this.toJSON());
};
exports.SourceMapGenerator = SourceMapGenerator;
});
| alexscg/weather | node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/source-map/lib/source-map/source-map-generator.js | JavaScript | mit | 14,157 |
// This is autogenerated with esprima tools, see:
// https://github.com/ariya/esprima/blob/master/esprima.js
//
// PS: oh God, I hate Unicode
// ECMAScript 5.1/Unicode v6.3.0 NonAsciiIdentifierStart:
var Uni = module.exports
module.exports.isWhiteSpace = function isWhiteSpace(x) {
// section 7.2, table 2
return x === '\u0020'
|| x === '\u00A0'
|| x === '\uFEFF' // <-- this is not a Unicode WS, only a JS one
|| (x >= '\u0009' && x <= '\u000D') // 9 A B C D
// + whitespace characters from unicode, category Zs
|| x === '\u1680'
|| x === '\u180E'
|| (x >= '\u2000' && x <= '\u200A') // 0 1 2 3 4 5 6 7 8 9 A
|| x === '\u2028'
|| x === '\u2029'
|| x === '\u202F'
|| x === '\u205F'
|| x === '\u3000'
}
module.exports.isWhiteSpaceJSON = function isWhiteSpaceJSON(x) {
return x === '\u0020'
|| x === '\u0009'
|| x === '\u000A'
|| x === '\u000D'
}
module.exports.isLineTerminator = function isLineTerminator(x) {
// ok, here is the part when JSON is wrong
// section 7.3, table 3
return x === '\u000A'
|| x === '\u000D'
|| x === '\u2028'
|| x === '\u2029'
}
module.exports.isLineTerminatorJSON = function isLineTerminatorJSON(x) {
return x === '\u000A'
|| x === '\u000D'
}
module.exports.isIdentifierStart = function isIdentifierStart(x) {
return x === '$'
|| x === '_'
|| (x >= 'A' && x <= 'Z')
|| (x >= 'a' && x <= 'z')
|| (x >= '\u0080' && Uni.NonAsciiIdentifierStart.test(x))
}
module.exports.isIdentifierPart = function isIdentifierPart(x) {
return x === '$'
|| x === '_'
|| (x >= 'A' && x <= 'Z')
|| (x >= 'a' && x <= 'z')
|| (x >= '0' && x <= '9') // <-- addition to Start
|| (x >= '\u0080' && Uni.NonAsciiIdentifierPart.test(x))
}
module.exports.NonAsciiIdentifierStart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
// ECMAScript 5.1/Unicode v6.3.0 NonAsciiIdentifierPart:
module.exports.NonAsciiIdentifierPart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
| TenthEstate/Newspaper16 | node_modules/typings/node_modules/typings-core/node_modules/parse-json/vendor/unicode.js | JavaScript | mit | 11,215 |
var arrayMap = require('./_arrayMap'),
baseIteratee = require('./_baseIteratee'),
baseMap = require('./_baseMap'),
baseSortBy = require('./_baseSortBy'),
baseUnary = require('./_baseUnary'),
compareMultiple = require('./_compareMultiple'),
identity = require('./identity');
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
var index = -1;
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
module.exports = baseOrderBy;
| crod93/googlePlacesEx-react-native | node_modules/native-base/node_modules/lodash/_baseOrderBy.js | JavaScript | mit | 1,196 |
/*
YUI 3.18.1 (build f7e7bcb)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/editor-br/editor-br.js']) {
__coverage__['build/editor-br/editor-br.js'] = {"path":"build/editor-br/editor-br.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0,0],"7":[0,0],"8":[0,0],"9":[0,0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0,0],"14":[0,0],"15":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":40}}},"2":{"name":"(anonymous_2)","line":15,"loc":{"start":{"line":15,"column":19},"end":{"line":15,"column":30}}},"3":{"name":"(anonymous_3)","line":26,"loc":{"start":{"line":26,"column":20},"end":{"line":26,"column":32}}},"4":{"name":"(anonymous_4)","line":56,"loc":{"start":{"line":56,"column":27},"end":{"line":56,"column":38}}},"5":{"name":"(anonymous_5)","line":81,"loc":{"start":{"line":81,"column":23},"end":{"line":81,"column":35}}},"6":{"name":"(anonymous_6)","line":100,"loc":{"start":{"line":100,"column":21},"end":{"line":100,"column":32}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":137,"column":44}},"2":{"start":{"line":15,"column":4},"end":{"line":17,"column":32}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":63}},"4":{"start":{"line":20,"column":4},"end":{"line":129,"column":7}},"5":{"start":{"line":27,"column":12},"end":{"line":30,"column":13}},"6":{"start":{"line":28,"column":16},"end":{"line":28,"column":25}},"7":{"start":{"line":29,"column":16},"end":{"line":29,"column":23}},"8":{"start":{"line":31,"column":12},"end":{"line":49,"column":13}},"9":{"start":{"line":32,"column":16},"end":{"line":33,"column":53}},"10":{"start":{"line":35,"column":16},"end":{"line":48,"column":17}},"11":{"start":{"line":36,"column":20},"end":{"line":41,"column":21}},"12":{"start":{"line":37,"column":24},"end":{"line":40,"column":25}},"13":{"start":{"line":38,"column":28},"end":{"line":38,"column":88}},"14":{"start":{"line":39,"column":28},"end":{"line":39,"column":37}},"15":{"start":{"line":42,"column":20},"end":{"line":47,"column":21}},"16":{"start":{"line":43,"column":24},"end":{"line":46,"column":25}},"17":{"start":{"line":44,"column":28},"end":{"line":44,"column":77}},"18":{"start":{"line":45,"column":28},"end":{"line":45,"column":37}},"19":{"start":{"line":57,"column":12},"end":{"line":58,"column":26}},"20":{"start":{"line":60,"column":12},"end":{"line":62,"column":28}},"21":{"start":{"line":61,"column":16},"end":{"line":61,"column":76}},"22":{"start":{"line":64,"column":12},"end":{"line":72,"column":13}},"23":{"start":{"line":65,"column":16},"end":{"line":65,"column":54}},"24":{"start":{"line":67,"column":16},"end":{"line":69,"column":17}},"25":{"start":{"line":68,"column":20},"end":{"line":68,"column":48}},"26":{"start":{"line":71,"column":16},"end":{"line":71,"column":77}},"27":{"start":{"line":82,"column":12},"end":{"line":98,"column":13}},"28":{"start":{"line":92,"column":20},"end":{"line":94,"column":64}},"29":{"start":{"line":95,"column":20},"end":{"line":95,"column":37}},"30":{"start":{"line":96,"column":20},"end":{"line":96,"column":37}},"31":{"start":{"line":97,"column":20},"end":{"line":97,"column":26}},"32":{"start":{"line":101,"column":12},"end":{"line":101,"column":38}},"33":{"start":{"line":102,"column":12},"end":{"line":105,"column":13}},"34":{"start":{"line":103,"column":16},"end":{"line":103,"column":82}},"35":{"start":{"line":104,"column":16},"end":{"line":104,"column":23}},"36":{"start":{"line":106,"column":12},"end":{"line":106,"column":70}},"37":{"start":{"line":107,"column":12},"end":{"line":109,"column":13}},"38":{"start":{"line":108,"column":16},"end":{"line":108,"column":72}},"39":{"start":{"line":131,"column":4},"end":{"line":131,"column":26}},"40":{"start":{"line":133,"column":4},"end":{"line":133,"column":33}}},"branchMap":{"1":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":12},"end":{"line":27,"column":12}},{"start":{"line":27,"column":12},"end":{"line":27,"column":12}}]},"2":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":12},"end":{"line":31,"column":12}},{"start":{"line":31,"column":12},"end":{"line":31,"column":12}}]},"3":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":16},"end":{"line":35,"column":16}},{"start":{"line":35,"column":16},"end":{"line":35,"column":16}}]},"4":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":20},"end":{"line":36,"column":20}},{"start":{"line":36,"column":20},"end":{"line":36,"column":20}}]},"5":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":24},"end":{"line":37,"column":24}},{"start":{"line":37,"column":24},"end":{"line":37,"column":24}}]},"6":{"line":37,"type":"binary-expr","locations":[{"start":{"line":37,"column":28},"end":{"line":37,"column":43}},{"start":{"line":37,"column":48},"end":{"line":37,"column":72}},{"start":{"line":37,"column":76},"end":{"line":37,"column":104}}]},"7":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":20},"end":{"line":42,"column":20}},{"start":{"line":42,"column":20},"end":{"line":42,"column":20}}]},"8":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":24},"end":{"line":43,"column":24}},{"start":{"line":43,"column":24},"end":{"line":43,"column":24}}]},"9":{"line":43,"type":"binary-expr","locations":[{"start":{"line":43,"column":28},"end":{"line":43,"column":43}},{"start":{"line":43,"column":48},"end":{"line":43,"column":72}},{"start":{"line":43,"column":76},"end":{"line":43,"column":104}}]},"10":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":12},"end":{"line":64,"column":12}},{"start":{"line":64,"column":12},"end":{"line":64,"column":12}}]},"11":{"line":64,"type":"binary-expr","locations":[{"start":{"line":64,"column":16},"end":{"line":64,"column":23}},{"start":{"line":64,"column":27},"end":{"line":64,"column":38}}]},"12":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":16},"end":{"line":67,"column":16}},{"start":{"line":67,"column":16},"end":{"line":67,"column":16}}]},"13":{"line":82,"type":"switch","locations":[{"start":{"line":83,"column":16},"end":{"line":83,"column":36}},{"start":{"line":84,"column":16},"end":{"line":84,"column":38}},{"start":{"line":85,"column":16},"end":{"line":97,"column":26}}]},"14":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":12},"end":{"line":102,"column":12}},{"start":{"line":102,"column":12},"end":{"line":102,"column":12}}]},"15":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":12},"end":{"line":107,"column":12}},{"start":{"line":107,"column":12},"end":{"line":107,"column":12}}]}},"code":["(function () { YUI.add('editor-br', function (Y, NAME) {","","",""," /**"," * Plugin for Editor to normalize BR's."," * @class Plugin.EditorBR"," * @extends Base"," * @constructor"," * @module editor"," * @submodule editor-br"," */","",""," var EditorBR = function() {"," EditorBR.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', LI = 'li';","",""," Y.extend(EditorBR, Y.Base, {"," /**"," * Frame keyDown handler that normalizes BR's when pressing ENTER."," * @private"," * @method _onKeyDown"," */"," _onKeyDown: function(e) {"," if (e.stopped) {"," e.halt();"," return;"," }"," if (e.keyCode === 13) {"," var host = this.get(HOST), inst = host.getInstance(),"," sel = new inst.EditorSelection();",""," if (sel) {"," if (Y.UA.ie) {"," if (!sel.anchorNode || (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI))) {"," host.execCommand('inserthtml', inst.EditorSelection.CURSOR);"," e.halt();"," }"," }"," if (Y.UA.webkit) {"," if (!sel.anchorNode || (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI))) {"," host.frame._execCommand('insertlinebreak', null);"," e.halt();"," }"," }"," }"," }"," },"," /**"," * Adds listeners for keydown in IE and Webkit. Also fires insertbeonreturn for supporting browsers."," * @private"," * @method _afterEditorReady"," */"," _afterEditorReady: function() {"," var inst = this.get(HOST).getInstance(),"," container;",""," try {"," inst.config.doc.execCommand('insertbronreturn', null, true);"," } catch (bre) {}",""," if (Y.UA.ie || Y.UA.webkit) {"," container = inst.EditorSelection.ROOT;",""," if (container.test('body')) {"," container = inst.config.doc;"," }",""," inst.on('keydown', Y.bind(this._onKeyDown, this), container);"," }"," },"," /**"," * Adds a nodeChange listener only for FF, in the event of a backspace or delete, it creates an empy textNode"," * inserts it into the DOM after the e.changedNode, then removes it. Causing FF to redraw the content."," * @private"," * @method _onNodeChange"," * @param {Event} e The nodeChange event."," */"," _onNodeChange: function(e) {"," switch (e.changedType) {"," case 'backspace-up':"," case 'backspace-down':"," case 'delete-up':"," /*"," * This forced FF to redraw the content on backspace."," * On some occasions FF will leave a cursor residue after content has been deleted."," * Dropping in the empty textnode and then removing it causes FF to redraw and"," * remove the \"ghost cursors\""," */"," var inst = this.get(HOST).getInstance(),"," d = e.changedNode,"," t = inst.config.doc.createTextNode(' ');"," d.appendChild(t);"," d.removeChild(t);"," break;"," }"," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorPara) {"," Y.error('Can not plug EditorBR and EditorPara at the same time.');"," return;"," }"," host.after('ready', Y.bind(this._afterEditorReady, this));"," if (Y.UA.gecko) {"," host.on('nodeChange', Y.bind(this._onNodeChange, this));"," }"," }"," }, {"," /**"," * editorBR"," * @static"," * @property NAME"," */"," NAME: 'editorBR',"," /**"," * editorBR"," * @static"," * @property NS"," */"," NS: 'editorBR',"," ATTRS: {"," host: {"," value: false"," }"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorBR = EditorBR;","","","","}, '3.18.1', {\"requires\": [\"editor-base\"]});","","}());"]};
}
var __cov_QWppDxNIhwHCmeIZxL1EVA = __coverage__['build/editor-br/editor-br.js'];
__cov_QWppDxNIhwHCmeIZxL1EVA.s['1']++;YUI.add('editor-br',function(Y,NAME){__cov_QWppDxNIhwHCmeIZxL1EVA.f['1']++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['2']++;var EditorBR=function(){__cov_QWppDxNIhwHCmeIZxL1EVA.f['2']++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['3']++;EditorBR.superclass.constructor.apply(this,arguments);},HOST='host',LI='li';__cov_QWppDxNIhwHCmeIZxL1EVA.s['4']++;Y.extend(EditorBR,Y.Base,{_onKeyDown:function(e){__cov_QWppDxNIhwHCmeIZxL1EVA.f['3']++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['5']++;if(e.stopped){__cov_QWppDxNIhwHCmeIZxL1EVA.b['1'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['6']++;e.halt();__cov_QWppDxNIhwHCmeIZxL1EVA.s['7']++;return;}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['1'][1]++;}__cov_QWppDxNIhwHCmeIZxL1EVA.s['8']++;if(e.keyCode===13){__cov_QWppDxNIhwHCmeIZxL1EVA.b['2'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['9']++;var host=this.get(HOST),inst=host.getInstance(),sel=new inst.EditorSelection();__cov_QWppDxNIhwHCmeIZxL1EVA.s['10']++;if(sel){__cov_QWppDxNIhwHCmeIZxL1EVA.b['3'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['11']++;if(Y.UA.ie){__cov_QWppDxNIhwHCmeIZxL1EVA.b['4'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['12']++;if((__cov_QWppDxNIhwHCmeIZxL1EVA.b['6'][0]++,!sel.anchorNode)||(__cov_QWppDxNIhwHCmeIZxL1EVA.b['6'][1]++,!sel.anchorNode.test(LI))&&(__cov_QWppDxNIhwHCmeIZxL1EVA.b['6'][2]++,!sel.anchorNode.ancestor(LI))){__cov_QWppDxNIhwHCmeIZxL1EVA.b['5'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['13']++;host.execCommand('inserthtml',inst.EditorSelection.CURSOR);__cov_QWppDxNIhwHCmeIZxL1EVA.s['14']++;e.halt();}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['5'][1]++;}}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['4'][1]++;}__cov_QWppDxNIhwHCmeIZxL1EVA.s['15']++;if(Y.UA.webkit){__cov_QWppDxNIhwHCmeIZxL1EVA.b['7'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['16']++;if((__cov_QWppDxNIhwHCmeIZxL1EVA.b['9'][0]++,!sel.anchorNode)||(__cov_QWppDxNIhwHCmeIZxL1EVA.b['9'][1]++,!sel.anchorNode.test(LI))&&(__cov_QWppDxNIhwHCmeIZxL1EVA.b['9'][2]++,!sel.anchorNode.ancestor(LI))){__cov_QWppDxNIhwHCmeIZxL1EVA.b['8'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['17']++;host.frame._execCommand('insertlinebreak',null);__cov_QWppDxNIhwHCmeIZxL1EVA.s['18']++;e.halt();}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['8'][1]++;}}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['7'][1]++;}}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['3'][1]++;}}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['2'][1]++;}},_afterEditorReady:function(){__cov_QWppDxNIhwHCmeIZxL1EVA.f['4']++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['19']++;var inst=this.get(HOST).getInstance(),container;__cov_QWppDxNIhwHCmeIZxL1EVA.s['20']++;try{__cov_QWppDxNIhwHCmeIZxL1EVA.s['21']++;inst.config.doc.execCommand('insertbronreturn',null,true);}catch(bre){}__cov_QWppDxNIhwHCmeIZxL1EVA.s['22']++;if((__cov_QWppDxNIhwHCmeIZxL1EVA.b['11'][0]++,Y.UA.ie)||(__cov_QWppDxNIhwHCmeIZxL1EVA.b['11'][1]++,Y.UA.webkit)){__cov_QWppDxNIhwHCmeIZxL1EVA.b['10'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['23']++;container=inst.EditorSelection.ROOT;__cov_QWppDxNIhwHCmeIZxL1EVA.s['24']++;if(container.test('body')){__cov_QWppDxNIhwHCmeIZxL1EVA.b['12'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['25']++;container=inst.config.doc;}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['12'][1]++;}__cov_QWppDxNIhwHCmeIZxL1EVA.s['26']++;inst.on('keydown',Y.bind(this._onKeyDown,this),container);}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['10'][1]++;}},_onNodeChange:function(e){__cov_QWppDxNIhwHCmeIZxL1EVA.f['5']++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['27']++;switch(e.changedType){case'backspace-up':__cov_QWppDxNIhwHCmeIZxL1EVA.b['13'][0]++;case'backspace-down':__cov_QWppDxNIhwHCmeIZxL1EVA.b['13'][1]++;case'delete-up':__cov_QWppDxNIhwHCmeIZxL1EVA.b['13'][2]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['28']++;var inst=this.get(HOST).getInstance(),d=e.changedNode,t=inst.config.doc.createTextNode(' ');__cov_QWppDxNIhwHCmeIZxL1EVA.s['29']++;d.appendChild(t);__cov_QWppDxNIhwHCmeIZxL1EVA.s['30']++;d.removeChild(t);__cov_QWppDxNIhwHCmeIZxL1EVA.s['31']++;break;}},initializer:function(){__cov_QWppDxNIhwHCmeIZxL1EVA.f['6']++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['32']++;var host=this.get(HOST);__cov_QWppDxNIhwHCmeIZxL1EVA.s['33']++;if(host.editorPara){__cov_QWppDxNIhwHCmeIZxL1EVA.b['14'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['34']++;Y.error('Can not plug EditorBR and EditorPara at the same time.');__cov_QWppDxNIhwHCmeIZxL1EVA.s['35']++;return;}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['14'][1]++;}__cov_QWppDxNIhwHCmeIZxL1EVA.s['36']++;host.after('ready',Y.bind(this._afterEditorReady,this));__cov_QWppDxNIhwHCmeIZxL1EVA.s['37']++;if(Y.UA.gecko){__cov_QWppDxNIhwHCmeIZxL1EVA.b['15'][0]++;__cov_QWppDxNIhwHCmeIZxL1EVA.s['38']++;host.on('nodeChange',Y.bind(this._onNodeChange,this));}else{__cov_QWppDxNIhwHCmeIZxL1EVA.b['15'][1]++;}}},{NAME:'editorBR',NS:'editorBR',ATTRS:{host:{value:false}}});__cov_QWppDxNIhwHCmeIZxL1EVA.s['39']++;Y.namespace('Plugin');__cov_QWppDxNIhwHCmeIZxL1EVA.s['40']++;Y.Plugin.EditorBR=EditorBR;},'3.18.1',{'requires':['editor-base']});
| Heigvd/Wegas | wegas-resources/src/main/webapp/lib/yui3/build/editor-br/editor-br-coverage.js | JavaScript | mit | 16,674 |
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\ResourceBundle\EventListener;
use Doctrine\Common\EventSubscriber;
use Doctrine\ODM\MongoDB\Event\LoadClassMetadataEventArgs;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo;
use Sylius\Component\Resource\Metadata\RegistryInterface;
/**
* Doctrine listener used to manipulate mappings.
*
* @author Ivannis Suárez Jérez <ivannis.suarez@gmail.com>
*/
class LoadODMMetadataSubscriber implements EventSubscriber
{
/**
* @var RegistryInterface
*/
private $resourceRegistry;
/**
* @param RegistryInterface $resourceRegistry
*/
public function __construct(RegistryInterface $resourceRegistry)
{
$this->resourceRegistry = $resourceRegistry;
}
/**
* @return array
*/
public function getSubscribedEvents()
{
return [
'loadClassMetadata',
];
}
/**
* @param LoadClassMetadataEventArgs $eventArgs
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
{
/** @var ClassMetadata $metadata */
$metadata = $eventArgs->getClassMetadata();
$this->convertToDocumentIfNeeded($metadata);
if (!$metadata->isMappedSuperclass) {
$this->setAssociationMappings($metadata, $eventArgs->getDocumentManager()->getConfiguration());
} else {
$this->unsetAssociationMappings($metadata);
}
}
/**
* @param ClassMetadataInfo $metadata
*/
private function convertToDocumentIfNeeded(ClassMetadataInfo $metadata)
{
foreach ($this->resourceRegistry->getAll() as $alias => $resourceMetadata) {
if ($metadata->getName() !== $resourceMetadata->getClass('model')) {
continue;
}
if ($resourceMetadata->hasClass('repository')) {
$metadata->setCustomRepositoryClass($resourceMetadata->getClass('repository'));
}
$metadata->isMappedSuperclass = false;
}
}
/**
* @param ClassMetadataInfo $metadata
* @param $configuration
*/
private function setAssociationMappings(ClassMetadataInfo $metadata, $configuration)
{
foreach (class_parents($metadata->getName()) as $parent) {
$parentMetadata = new ClassMetadata($parent);
if (in_array($parent, $configuration->getMetadataDriverImpl()->getAllClassNames())) {
$configuration->getMetadataDriverImpl()->loadMetadataForClass($parent, $parentMetadata);
if ($parentMetadata->isMappedSuperclass) {
foreach ($parentMetadata->associationMappings as $key => $value) {
if ($this->hasRelation($value['association'])) {
$metadata->associationMappings[$key] = $value;
}
}
}
}
}
}
/**
* @param ClassMetadataInfo $metadata
*/
private function unsetAssociationMappings(ClassMetadataInfo $metadata)
{
foreach ($metadata->associationMappings as $key => $value) {
if ($this->hasRelation($value['association'])) {
unset($metadata->associationMappings[$key]);
}
}
}
/**
* @param $type
*
* @return bool
*/
private function hasRelation($type)
{
return in_array(
$type,
[
ClassMetadataInfo::REFERENCE_ONE,
ClassMetadataInfo::REFERENCE_MANY,
ClassMetadataInfo::EMBED_ONE,
ClassMetadataInfo::EMBED_MANY,
],
true
);
}
}
| ravaj-group/Sylius | src/Sylius/Bundle/ResourceBundle/EventListener/LoadODMMetadataSubscriber.php | PHP | mit | 3,952 |
class CustomSet
attr_reader :data
def initialize(input_data = [])
@data = parse_data(input_data.to_a.uniq)
end
def delete(datum)
data.each do |n|
@data -= Array(n) if n.datum.eql?(datum)
end
self
end
def difference(other)
shared = nodes - other.nodes
CustomSet.new(shared)
end
def disjoint?(other)
remainder = nodes - other.nodes
remainder.length == data.length
end
def empty
CustomSet.new
end
def intersection(other)
intersection = nodes.select do |node|
other.nodes.any? { |other_node| other_node.eql?(node) }
end
CustomSet.new(intersection)
end
def member?(datum)
data.any? { |node| node.datum.eql?(datum) }
end
def put(datum)
unless data.any? { |node| node.datum.eql?(datum) }
add_datum(datum)
end
self
end
def size
nodes.uniq.count
end
def subset?(other)
return true if other.data.empty?
other.nodes.all? { |other_node| nodes.any? { |node| node.eql?(other_node) } }
end
def to_a
nodes.uniq
end
def union(other)
union = (nodes + other.nodes).uniq
CustomSet.new(union)
end
def ==(other)
nodes == other.nodes
end
def nodes
data.map(&:datum).sort
end
def add_datum(datum)
@data << Node.new(datum)
end
private
def parse_data(input_data)
input_data.map do |d|
Node.new(d)
end
end
end
class Node
attr_reader :datum
def initialize(input_datum)
@datum = input_datum
end
end
| NobbZ/xruby | custom-set/example.rb | Ruby | mit | 1,499 |
// CodeContracts
//
// Copyright (c) Microsoft Corporation
//
// All rights reserved.
//
// MIT License
//
// 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.
#if !SILVERLIGHT
// File System.Runtime.Serialization.IObjectReference.cs
// Automatically generated contract file.
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;
// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108
namespace System.Runtime.Serialization
{
public partial interface IObjectReference
{
#region Methods and constructors
Object GetRealObject (StreamingContext context);
#endregion
}
}
#endif | sharwell/CodeContracts | Microsoft.Research/Contracts/MsCorlib/System.Runtime.serialization.IObjectReference.cs | C# | mit | 2,140 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>FreeType-2.5.0 API Reference</title>
<style type="text/css">
body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
color: #000000;
background: #FFFFFF; }
p { text-align: justify; }
h1 { text-align: center; }
li { text-align: justify; }
td { padding: 0 0.5em 0 0.5em; }
td.left { padding: 0 0.5em 0 0.5em;
text-align: left; }
a:link { color: #0000EF; }
a:visited { color: #51188E; }
a:hover { color: #FF0000; }
span.keyword { font-family: monospace;
text-align: left;
white-space: pre;
color: darkblue; }
pre.colored { color: blue; }
ul.empty { list-style-type: none; }
</style>
</head>
<body>
<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<center><h1>FreeType-2.5.0 API Reference</h1></center>
<center><h1>
Header File Macros
</h1></center>
<h2>Synopsis</h2>
<table align=center cellspacing=5 cellpadding=0 border=0>
<tr><td></td><td><a href="#FT_CONFIG_CONFIG_H">FT_CONFIG_CONFIG_H</a></td><td></td><td><a href="#FT_LZW_H">FT_LZW_H</a></td></tr>
<tr><td></td><td><a href="#FT_CONFIG_STANDARD_LIBRARY_H">FT_CONFIG_STANDARD_LIBRARY_H</a></td><td></td><td><a href="#FT_BZIP2_H">FT_BZIP2_H</a></td></tr>
<tr><td></td><td><a href="#FT_CONFIG_OPTIONS_H">FT_CONFIG_OPTIONS_H</a></td><td></td><td><a href="#FT_WINFONTS_H">FT_WINFONTS_H</a></td></tr>
<tr><td></td><td><a href="#FT_CONFIG_MODULES_H">FT_CONFIG_MODULES_H</a></td><td></td><td><a href="#FT_GLYPH_H">FT_GLYPH_H</a></td></tr>
<tr><td></td><td><a href="#FT_FREETYPE_H">FT_FREETYPE_H</a></td><td></td><td><a href="#FT_BITMAP_H">FT_BITMAP_H</a></td></tr>
<tr><td></td><td><a href="#FT_ERRORS_H">FT_ERRORS_H</a></td><td></td><td><a href="#FT_BBOX_H">FT_BBOX_H</a></td></tr>
<tr><td></td><td><a href="#FT_MODULE_ERRORS_H">FT_MODULE_ERRORS_H</a></td><td></td><td><a href="#FT_CACHE_H">FT_CACHE_H</a></td></tr>
<tr><td></td><td><a href="#FT_SYSTEM_H">FT_SYSTEM_H</a></td><td></td><td><a href="#FT_CACHE_IMAGE_H">FT_CACHE_IMAGE_H</a></td></tr>
<tr><td></td><td><a href="#FT_IMAGE_H">FT_IMAGE_H</a></td><td></td><td><a href="#FT_CACHE_SMALL_BITMAPS_H">FT_CACHE_SMALL_BITMAPS_H</a></td></tr>
<tr><td></td><td><a href="#FT_TYPES_H">FT_TYPES_H</a></td><td></td><td><a href="#FT_CACHE_CHARMAP_H">FT_CACHE_CHARMAP_H</a></td></tr>
<tr><td></td><td><a href="#FT_LIST_H">FT_LIST_H</a></td><td></td><td><a href="#FT_MAC_H">FT_MAC_H</a></td></tr>
<tr><td></td><td><a href="#FT_OUTLINE_H">FT_OUTLINE_H</a></td><td></td><td><a href="#FT_MULTIPLE_MASTERS_H">FT_MULTIPLE_MASTERS_H</a></td></tr>
<tr><td></td><td><a href="#FT_SIZES_H">FT_SIZES_H</a></td><td></td><td><a href="#FT_SFNT_NAMES_H">FT_SFNT_NAMES_H</a></td></tr>
<tr><td></td><td><a href="#FT_MODULE_H">FT_MODULE_H</a></td><td></td><td><a href="#FT_OPENTYPE_VALIDATE_H">FT_OPENTYPE_VALIDATE_H</a></td></tr>
<tr><td></td><td><a href="#FT_RENDER_H">FT_RENDER_H</a></td><td></td><td><a href="#FT_GX_VALIDATE_H">FT_GX_VALIDATE_H</a></td></tr>
<tr><td></td><td><a href="#FT_AUTOHINTER_H">FT_AUTOHINTER_H</a></td><td></td><td><a href="#FT_PFR_H">FT_PFR_H</a></td></tr>
<tr><td></td><td><a href="#FT_CFF_DRIVER_H">FT_CFF_DRIVER_H</a></td><td></td><td><a href="#FT_STROKER_H">FT_STROKER_H</a></td></tr>
<tr><td></td><td><a href="#FT_TRUETYPE_DRIVER_H">FT_TRUETYPE_DRIVER_H</a></td><td></td><td><a href="#FT_SYNTHESIS_H">FT_SYNTHESIS_H</a></td></tr>
<tr><td></td><td><a href="#FT_TYPE1_TABLES_H">FT_TYPE1_TABLES_H</a></td><td></td><td><a href="#FT_XFREE86_H">FT_XFREE86_H</a></td></tr>
<tr><td></td><td><a href="#FT_TRUETYPE_IDS_H">FT_TRUETYPE_IDS_H</a></td><td></td><td><a href="#FT_TRIGONOMETRY_H">FT_TRIGONOMETRY_H</a></td></tr>
<tr><td></td><td><a href="#FT_TRUETYPE_TABLES_H">FT_TRUETYPE_TABLES_H</a></td><td></td><td><a href="#FT_LCD_FILTER_H">FT_LCD_FILTER_H</a></td></tr>
<tr><td></td><td><a href="#FT_TRUETYPE_TAGS_H">FT_TRUETYPE_TAGS_H</a></td><td></td><td><a href="#FT_UNPATENTED_HINTING_H">FT_UNPATENTED_HINTING_H</a></td></tr>
<tr><td></td><td><a href="#FT_BDF_H">FT_BDF_H</a></td><td></td><td><a href="#FT_INCREMENTAL_H">FT_INCREMENTAL_H</a></td></tr>
<tr><td></td><td><a href="#FT_CID_H">FT_CID_H</a></td><td></td><td><a href="#FT_GASP_H">FT_GASP_H</a></td></tr>
<tr><td></td><td><a href="#FT_GZIP_H">FT_GZIP_H</a></td><td></td><td><a href="#FT_ADVANCES_H">FT_ADVANCES_H</a></td></tr>
</table><br><br>
<table align=center width="87%"><tr><td>
<p>The following macros are defined to the name of specific FreeType 2 header files. They can be used directly in #include statements as in:</p>
<pre class="colored">
#include FT_FREETYPE_H
#include FT_MULTIPLE_MASTERS_H
#include FT_GLYPH_H
</pre>
<p>There are several reasons why we are now using macros to name public header files. The first one is that such macros are not limited to the infamous 8.3 naming rule required by DOS (and ‘FT_MULTIPLE_MASTERS_H’ is a lot more meaningful than ‘ftmm.h’).</p>
<p>The second reason is that it allows for more flexibility in the way FreeType 2 is installed on a given system.</p>
</td></tr></table><br>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CONFIG_CONFIG_H">FT_CONFIG_CONFIG_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#ifndef <b>FT_CONFIG_CONFIG_H</b>
#define <b>FT_CONFIG_CONFIG_H</b> <freetype/config/ftconfig.h>
#endif
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing FreeType 2 configuration data.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CONFIG_STANDARD_LIBRARY_H">FT_CONFIG_STANDARD_LIBRARY_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#ifndef <b>FT_CONFIG_STANDARD_LIBRARY_H</b>
#define <b>FT_CONFIG_STANDARD_LIBRARY_H</b> <freetype/config/ftstdlib.h>
#endif
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing FreeType 2 interface to the standard C library functions.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CONFIG_OPTIONS_H">FT_CONFIG_OPTIONS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#ifndef <b>FT_CONFIG_OPTIONS_H</b>
#define <b>FT_CONFIG_OPTIONS_H</b> <freetype/config/ftoption.h>
#endif
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing FreeType 2 project-specific configuration options.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CONFIG_MODULES_H">FT_CONFIG_MODULES_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#ifndef <b>FT_CONFIG_MODULES_H</b>
#define <b>FT_CONFIG_MODULES_H</b> <freetype/config/ftmodule.h>
#endif
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the list of FreeType 2 modules that are statically linked to new library instances in <a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a>.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_FREETYPE_H">FT_FREETYPE_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_FREETYPE_H</b> <freetype/freetype.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the base FreeType 2 API.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_ERRORS_H">FT_ERRORS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_ERRORS_H</b> <freetype/fterrors.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the list of FreeType 2 error codes (and messages).</p>
<p>It is included by <a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a>.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_MODULE_ERRORS_H">FT_MODULE_ERRORS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_MODULE_ERRORS_H</b> <freetype/ftmoderr.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the list of FreeType 2 module error offsets (and messages).</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_SYSTEM_H">FT_SYSTEM_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_SYSTEM_H</b> <freetype/ftsystem.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 interface to low-level operations (i.e., memory management and stream i/o).</p>
<p>It is included by <a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a>.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_IMAGE_H">FT_IMAGE_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_IMAGE_H</b> <freetype/ftimage.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing type definitions related to glyph images (i.e., bitmaps, outlines, scan-converter parameters).</p>
<p>It is included by <a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a>.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_TYPES_H">FT_TYPES_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_TYPES_H</b> <freetype/fttypes.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the basic data types defined by FreeType 2.</p>
<p>It is included by <a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a>.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_LIST_H">FT_LIST_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_LIST_H</b> <freetype/ftlist.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the list management API of FreeType 2.</p>
<p>(Most applications will never need to include this file.)</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_OUTLINE_H">FT_OUTLINE_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_OUTLINE_H</b> <freetype/ftoutln.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the scalable outline management API of FreeType 2.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_SIZES_H">FT_SIZES_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_SIZES_H</b> <freetype/ftsizes.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the API which manages multiple <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects per face.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_MODULE_H">FT_MODULE_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_MODULE_H</b> <freetype/ftmodapi.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the module management API of FreeType 2.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_RENDER_H">FT_RENDER_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_RENDER_H</b> <freetype/ftrender.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the renderer module management API of FreeType 2.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_AUTOHINTER_H">FT_AUTOHINTER_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_AUTOHINTER_H</b> <freetype/ftautoh.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing structures and macros related to the auto-hinting module.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CFF_DRIVER_H">FT_CFF_DRIVER_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_CFF_DRIVER_H</b> <freetype/ftcffdrv.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing structures and macros related to the CFF driver module.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_TRUETYPE_DRIVER_H">FT_TRUETYPE_DRIVER_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_TRUETYPE_DRIVER_H</b> <freetype/ftttdrv.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing structures and macros related to the TrueType driver module.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_TYPE1_TABLES_H">FT_TYPE1_TABLES_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_TYPE1_TABLES_H</b> <freetype/t1tables.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the types and API specific to the Type 1 format.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_TRUETYPE_IDS_H">FT_TRUETYPE_IDS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_TRUETYPE_IDS_H</b> <freetype/ttnameid.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the enumeration values which identify name strings, languages, encodings, etc. This file really contains a <i>large</i> set of constant macro definitions, taken from the TrueType and OpenType specifications.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_TRUETYPE_TABLES_H">FT_TRUETYPE_TABLES_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_TRUETYPE_TABLES_H</b> <freetype/tttables.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the types and API specific to the TrueType (as well as OpenType) format.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_TRUETYPE_TAGS_H">FT_TRUETYPE_TAGS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_TRUETYPE_TAGS_H</b> <freetype/tttags.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the definitions of TrueType four-byte ‘tags’ which identify blocks in SFNT-based font formats (i.e., TrueType and OpenType).</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_BDF_H">FT_BDF_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_BDF_H</b> <freetype/ftbdf.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the definitions of an API which accesses BDF-specific strings from a face.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CID_H">FT_CID_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_CID_H</b> <freetype/ftcid.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the definitions of an API which access CID font information from a face.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_GZIP_H">FT_GZIP_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_GZIP_H</b> <freetype/ftgzip.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the definitions of an API which supports gzip-compressed files.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_LZW_H">FT_LZW_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_LZW_H</b> <freetype/ftlzw.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the definitions of an API which supports LZW-compressed files.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_BZIP2_H">FT_BZIP2_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_BZIP2_H</b> <freetype/ftbzip2.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the definitions of an API which supports bzip2-compressed files.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_WINFONTS_H">FT_WINFONTS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_WINFONTS_H</b> <freetype/ftwinfnt.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the definitions of an API which supports Windows FNT files.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_GLYPH_H">FT_GLYPH_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_GLYPH_H</b> <freetype/ftglyph.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the API of the optional glyph management component.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_BITMAP_H">FT_BITMAP_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_BITMAP_H</b> <freetype/ftbitmap.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the API of the optional bitmap conversion component.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_BBOX_H">FT_BBOX_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_BBOX_H</b> <freetype/ftbbox.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the API of the optional exact bounding box computation routines.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CACHE_H">FT_CACHE_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_CACHE_H</b> <freetype/ftcache.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the API of the optional FreeType 2 cache sub-system.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CACHE_IMAGE_H">FT_CACHE_IMAGE_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_CACHE_IMAGE_H</b> <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the ‘glyph image’ API of the FreeType 2 cache sub-system.</p>
<p>It is used to define a cache for <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> elements. You can also use the API defined in <a href="ft2-header_file_macros.html#FT_CACHE_SMALL_BITMAPS_H">FT_CACHE_SMALL_BITMAPS_H</a> if you only need to store small glyph bitmaps, as it will use less memory.</p>
<p>This macro is deprecated. Simply include <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a> to have all glyph image-related cache declarations.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CACHE_SMALL_BITMAPS_H">FT_CACHE_SMALL_BITMAPS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_CACHE_SMALL_BITMAPS_H</b> <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the ‘small bitmaps’ API of the FreeType 2 cache sub-system.</p>
<p>It is used to define a cache for small glyph bitmaps in a relatively memory-efficient way. You can also use the API defined in <a href="ft2-header_file_macros.html#FT_CACHE_IMAGE_H">FT_CACHE_IMAGE_H</a> if you want to cache arbitrary glyph images, including scalable outlines.</p>
<p>This macro is deprecated. Simply include <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a> to have all small bitmaps-related cache declarations.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CACHE_CHARMAP_H">FT_CACHE_CHARMAP_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_CACHE_CHARMAP_H</b> <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the ‘charmap’ API of the FreeType 2 cache sub-system.</p>
<p>This macro is deprecated. Simply include <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a> to have all charmap-based cache declarations.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_MAC_H">FT_MAC_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_MAC_H</b> <freetype/ftmac.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the Macintosh-specific FreeType 2 API. The latter is used to access fonts embedded in resource forks.</p>
<p>This header file must be explicitly included by client applications compiled on the Mac (note that the base API still works though).</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_MULTIPLE_MASTERS_H">FT_MULTIPLE_MASTERS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_MULTIPLE_MASTERS_H</b> <freetype/ftmm.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the optional multiple-masters management API of FreeType 2.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_SFNT_NAMES_H">FT_SFNT_NAMES_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_SFNT_NAMES_H</b> <freetype/ftsnames.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the optional FreeType 2 API which accesses embedded ‘name’ strings in SFNT-based font formats (i.e., TrueType and OpenType).</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_OPENTYPE_VALIDATE_H">FT_OPENTYPE_VALIDATE_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_OPENTYPE_VALIDATE_H</b> <freetype/ftotval.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the optional FreeType 2 API which validates OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_GX_VALIDATE_H">FT_GX_VALIDATE_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_GX_VALIDATE_H</b> <freetype/ftgxval.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the optional FreeType 2 API which validates TrueTypeGX/AAT tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop).</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_PFR_H">FT_PFR_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_PFR_H</b> <freetype/ftpfr.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which accesses PFR-specific data.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_STROKER_H">FT_STROKER_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_STROKER_H</b> <freetype/ftstroke.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which provides functions to stroke outline paths.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_SYNTHESIS_H">FT_SYNTHESIS_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_SYNTHESIS_H</b> <freetype/ftsynth.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which performs artificial obliquing and emboldening.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_XFREE86_H">FT_XFREE86_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_XFREE86_H</b> <freetype/ftxf86.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which provides functions specific to the XFree86 and X.Org X11 servers.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_TRIGONOMETRY_H">FT_TRIGONOMETRY_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_TRIGONOMETRY_H</b> <freetype/fttrigon.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which performs trigonometric computations (e.g., cosines and arc tangents).</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_LCD_FILTER_H">FT_LCD_FILTER_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_LCD_FILTER_H</b> <freetype/ftlcdfil.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_UNPATENTED_HINTING_H">FT_UNPATENTED_HINTING_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_UNPATENTED_HINTING_H</b> <freetype/ttunpat.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_INCREMENTAL_H">FT_INCREMENTAL_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_INCREMENTAL_H</b> <freetype/ftincrem.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_GASP_H">FT_GASP_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_GASP_H</b> <freetype/ftgasp.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which returns entries from the TrueType GASP table.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_ADVANCES_H">FT_ADVANCES_H</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_ADVANCES_H</b> <freetype/ftadvanc.h>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A macro used in #include statements to name the file containing the FreeType 2 API which returns individual and ranged glyph advances.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
</body>
</html>
| devlato/kolibrios-llvm | contrib/sdk/sources/freetype/docs/reference/ft2-header_file_macros.html | HTML | mit | 41,934 |
require 'fog/core/model'
module Fog
module Compute
class Brightbox
class FirewallRule < Fog::Model
identity :id
attribute :url
attribute :resource_type
attribute :description
attribute :source
attribute :source_port
attribute :destination
attribute :destination_port
attribute :protocol
attribute :icmp_type_name
attribute :created_at, :type => :time
attribute :firewall_policy_id, :aliases => "firewall_policy", :squash => "id"
# Sticking with existing Fog behaviour, save does not update but creates a new resource
def save
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
requires :firewall_policy_id
options = {
:firewall_policy => firewall_policy_id,
:protocol => protocol,
:description => description,
:source => source,
:source_port => source_port,
:destination => destination,
:destination_port => destination_port,
:icmp_type_name => icmp_type_name
}.delete_if { |k, v| v.nil? || v == "" }
data = service.create_firewall_rule(options)
merge_attributes(data)
true
end
def destroy
requires :identity
service.destroy_firewall_rule(identity)
true
end
end
end
end
end
| 12spokes/fog | lib/fog/brightbox/models/compute/firewall_rule.rb | Ruby | mit | 1,486 |
/*!
* Jasny Bootstrap Extensions j2
*
* Copyright 2012 Jasny BV
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Extended with pride by @ArnoldDaniels of jasny.net
*/
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
display: table;
line-height: 0;
content: "";
}
.clearfix:after {
clear: both;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.container-semifluid {
max-width: 940px;
padding-right: 20px;
padding-left: 20px;
margin-right: auto;
margin-left: auto;
*zoom: 1;
}
.container-semifluid:before,
.container-semifluid:after {
display: table;
line-height: 0;
content: "";
}
.container-semifluid:after {
clear: both;
}
form > *:last-child {
margin-bottom: 0;
}
label input[type="image"],
label input[type="checkbox"],
label input[type="radio"] {
vertical-align: middle;
}
.small-labels .control-group > label {
width: 70px;
}
.small-labels .controls {
margin-left: 80px;
}
.small-labels .form-actions {
padding-left: 80px;
}
.form-vertical .form-horizontal .control-group > label {
text-align: left;
}
.form-horizontal .form-vertical .control-group > label {
float: none;
padding-top: 0;
text-align: left;
}
.form-horizontal .form-vertical .controls {
margin-left: 0;
}
.form-horizontal .form-vertical.form-actions,
.form-horizontal .form-vertical .form-actions {
padding-left: 20px;
}
.control-group .control-group {
margin-bottom: 0;
}
.form-horizontal .well .control-label {
width: 120px;
}
.form-horizontal .well .controls {
margin-left: 140px;
}
form .well > *:last-child {
margin-bottom: 0;
}
.editor {
width: 100%;
height: 100px;
padding: 5px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.uneditable-textarea.editor-html {
padding: 5px 3px 5px 5px;
white-space: normal;
}
textarea.editor-html {
visibility: hidden;
}
.uneditable-input,
.uneditable-textarea {
display: inline-block;
padding: 4px 3px 4px 5px;
font-size: 14px;
line-height: 20px;
color: #555555;
cursor: not-allowed;
background-color: #ffffff;
border: 1px solid #eee;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.uneditable-input {
height: 20px;
overflow: hidden;
white-space: pre;
}
.uneditable-textarea {
overflow-x: hidden;
overflow-y: auto;
white-space: pre-wrap;
}
select[disabled],
textarea[disabled],
input[type="text"][disabled],
input[type="password"][disabled],
input[type="datetime"][disabled],
input[type="datetime-local"][disabled],
input[type="date"][disabled],
input[type="month"][disabled],
input[type="time"][disabled],
input[type="week"][disabled],
input[type="number"][disabled],
input[type="email"][disabled],
input[type="url"][disabled],
input[type="search"][disabled] {
color: #999;
}
.uneditable-input.disabled,
.uneditable-textarea.disabled {
color: #999;
cursor: not-allowed;
background-color: #f5f5f5;
border-color: #ddd;
}
textarea,
.uneditable-textarea {
height: 60px;
}
textarea[rows="1"],
.uneditable-textarea[rows="1"] {
height: 40px;
}
textarea[rows="2"],
.uneditable-textarea[rows="2"] {
height: 60px;
}
textarea[rows="3"],
.uneditable-textarea[rows="3"] {
height: 80px;
}
textarea[rows="4"],
.uneditable-textarea[rows="4"] {
height: 100px;
}
textarea[rows="5"],
.uneditable-textarea[rows="5"] {
height: 120px;
}
textarea[rows="6"],
.uneditable-textarea[rows="6"] {
height: 140px;
}
textarea[rows="7"],
.uneditable-textarea[rows="7"] {
height: 160px;
}
textarea[rows="8"],
.uneditable-textarea[rows="8"] {
height: 180px;
}
textarea[rows="9"],
.uneditable-textarea[rows="9"] {
height: 200px;
}
textarea[rows="10"],
.uneditable-textarea[rows="10"] {
height: 220px;
}
textarea[rows="11"],
.uneditable-textarea[rows="11"] {
height: 240px;
}
textarea[rows="12"],
.uneditable-textarea[rows="12"] {
height: 260px;
}
textarea[rows="13"],
.uneditable-textarea[rows="13"] {
height: 280px;
}
textarea[rows="14"],
.uneditable-textarea[rows="14"] {
height: 300px;
}
textarea[rows="15"],
.uneditable-textarea[rows="15"] {
height: 320px;
}
textarea[rows="16"],
.uneditable-textarea[rows="16"] {
height: 340px;
}
textarea[rows="17"],
.uneditable-textarea[rows="17"] {
height: 360px;
}
textarea[rows="18"],
.uneditable-textarea[rows="18"] {
height: 380px;
}
textarea[rows="19"],
.uneditable-textarea[rows="19"] {
height: 400px;
}
textarea[rows="20"],
.uneditable-textarea[rows="20"] {
height: 420px;
}
textarea[rows="21"],
.uneditable-textarea[rows="21"] {
height: 440px;
}
textarea[rows="22"],
.uneditable-textarea[rows="22"] {
height: 460px;
}
textarea[rows="23"],
.uneditable-textarea[rows="23"] {
height: 480px;
}
textarea[rows="24"],
.uneditable-textarea[rows="24"] {
height: 500px;
}
textarea[rows="25"],
.uneditable-textarea[rows="25"] {
height: 520px;
}
textarea[rows="26"],
.uneditable-textarea[rows="26"] {
height: 540px;
}
textarea[rows="27"],
.uneditable-textarea[rows="27"] {
height: 560px;
}
textarea[rows="28"],
.uneditable-textarea[rows="28"] {
height: 580px;
}
textarea[rows="29"],
.uneditable-textarea[rows="29"] {
height: 600px;
}
textarea[rows="30"],
.uneditable-textarea[rows="30"] {
height: 620px;
}
textarea[rows="35"],
.uneditable-textarea[rows="35"] {
height: 720px;
}
textarea[rows="40"],
.uneditable-textarea[rows="40"] {
height: 820px;
}
textarea[rows="45"],
.uneditable-textarea[rows="45"] {
height: 920px;
}
textarea[rows="50"],
.uneditable-textarea[rows="50"] {
height: 1020px;
}
textarea[rows="55"],
.uneditable-textarea[rows="55"] {
height: 1120px;
}
textarea[rows="60"],
.uneditable-textarea[rows="60"] {
height: 1220px;
}
textarea[rows="65"],
.uneditable-textarea[rows="65"] {
height: 1320px;
}
textarea[rows="70"],
.uneditable-textarea[rows="70"] {
height: 1420px;
}
textarea[rows="75"],
.uneditable-textarea[rows="75"] {
height: 1520px;
}
textarea[rows="80"],
.uneditable-textarea[rows="80"] {
height: 1620px;
}
textarea[rows="85"],
.uneditable-textarea[rows="85"] {
height: 1720px;
}
textarea[rows="90"],
.uneditable-textarea[rows="90"] {
height: 1820px;
}
textarea[rows="95"],
.uneditable-textarea[rows="95"] {
height: 1920px;
}
textarea[rows="100"],
.uneditable-textarea[rows="100"] {
height: 2020px;
}
.uneditable-textarea {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.uneditable-input[class*="span"],
.uneditable-textarea[class*="span"],
.row-fluid .uneditable-input[class*="span"],
.row-fluid .uneditable-textarea[class*="span"] {
float: none;
margin-left: 0;
}
.input-append .uneditable-input,
.input-prepend .uneditable-input {
vertical-align: top;
}
.input-append .uneditable-input[class*="span"],
.input-prepend .uneditable-input[class*="span"] {
display: inline-block;
}
.uneditable-form input[disabled],
.uneditable-form textarea[disabled],
.uneditable-form select[disabled] {
cursor: auto;
}
.uneditable-form .uneditable-input,
.uneditable-form .uneditable-textarea {
cursor: text;
}
.uneditable-form .form-actions {
background-color: transparent;
}
.header-actions {
padding: 0 20px;
line-height: 36px;
}
.table-actions {
padding-bottom: 20px;
*zoom: 1;
}
.table-actions:before,
.table-actions:after {
display: table;
line-height: 0;
content: "";
}
.table-actions:after {
clear: both;
}
tr.rowlink td {
cursor: pointer;
}
tr.rowlink td.nolink {
cursor: auto;
}
.table tbody tr.rowlink:hover td {
background-color: #cfcfcf;
}
a.rowlink {
font: inherit;
color: inherit;
text-decoration: inherit;
}
.act {
display: inline;
padding: 0;
font-weight: bold;
color: #555555;
background: inherit;
border: none;
-webkit-transition: text-shadow 0.1s linear;
-moz-transition: text-shadow 0.1s linear;
-o-transition: text-shadow 0.1s linear;
transition: text-shadow 0.1s linear;
}
.act:hover {
color: #333333;
text-decoration: none;
text-shadow: 1px 1px 3px rgba(85, 85, 85, 0.5);
}
.act-primary {
color: #006dcc;
}
.act-primary:hover {
color: #0044cc;
text-shadow: 1px 1px 3px rgba(0, 109, 204, 0.5);
}
.act-info {
color: #49afcd;
}
.act-info:hover {
color: #2f96b4;
text-shadow: 1px 1px 3px rgba(75, 175, 206, 0.5);
}
.act-success {
color: #51a351;
}
.act-success:hover {
color: #468847;
text-shadow: 1px 1px 3px rgba(81, 164, 81, 0.5);
}
.act-warning {
color: #c09853;
}
.act-warning:hover {
color: #f89406;
text-shadow: 1px 1px 3px rgba(192, 152, 84, 0.5);
}
.act-danger {
color: #b94a48;
}
.act-danger:hover {
color: #bd362f;
text-shadow: 1px 1px 3px rgba(185, 72, 70, 0.5);
}
.act.disabled,
.act[disabled] {
color: #AAAAAA;
cursor: not-allowed;
}
.act.disabled:hover,
.act[disabled]:hover {
color: #AAAAAA;
text-shadow: none;
}
.form-actions .act {
line-height: 30px;
}
@font-face {
font-family: IconicStroke;
font-weight: normal;
src: url('../fonts/iconic_stroke.eot');
src: local('IconicStroke'), url('iconic_stroke.eot?#iefix') format('../fonts/embedded-opentype'), url('../fonts/iconic_stroke.woff') format('woff'), url('../fonts/iconic_stroke.ttf') format('truetype'), url('iconic_stroke.svg#iconic') format('svg'), url('../fonts/iconic_stroke.otf') format('opentype');
}
@font-face {
font-family: IconicFill;
font-weight: normal;
src: url('../fonts/iconic_fill.eot');
src: local('IconicFill'), url('../fonts/iconic_fill.eot?#iefix') format('embedded-opentype'), url('../fonts/iconic_fill.woff') format('woff'), url('../fonts/iconic_fill.ttf') format('truetype'), url('iconic_fill.svg#iconic') format('svg'), url('../fonts/iconic_fill.otf') format('opentype');
}
@media screen, print {
[class*="iconic-"] {
font-style: inherit;
font-weight: normal;
vertical-align: bottom;
}
[class*="iconic-"]:before {
display: inline-block;
width: 1em;
font-family: IconicFill;
font-size: 0.9em;
text-align: center;
vertical-align: middle;
content: "";
}
.iconic-stroke:before {
font-family: IconicStroke;
}
.iconic-hash:before {
content: '\23';
}
.iconic-question-mark:before {
content: '\3f';
}
.iconic-at:before {
content: '\40';
}
.iconic-pilcrow:before {
content: '\b6';
}
.iconic-info:before {
content: '\2139';
}
.iconic-arrow-left:before {
content: '\2190';
}
.iconic-arrow-up:before {
content: '\2191';
}
.iconic-arrow-right:before {
content: '\2192';
}
.iconic-arrow-down:before {
content: '\2193';
}
.iconic-home:before {
content: '\2302';
}
.iconic-sun:before {
content: '\2600';
}
.iconic-cloud:before {
content: '\2601';
}
.iconic-umbrella:before {
content: '\2602';
}
.iconic-star:before {
content: '\2605';
}
.iconic-moon:before {
content: '\263e';
}
.iconic-heart:before {
content: '\2764';
}
.iconic-cog:before {
content: '\2699';
}
.iconic-bolt:before {
content: '\26a1';
}
.iconic-key:before {
content: '\26bf';
}
.iconic-rain:before {
content: '\26c6';
}
.iconic-denied:before {
content: '\26d4';
}
.iconic-mail:before {
content: '\2709';
}
.iconic-pen:before {
content: '\270e';
}
.iconic-x:before {
content: '\2717';
}
.iconic-o-x:before {
content: '\2718';
}
.iconic-check:before {
content: '\2713';
}
.iconic-o-check:before {
content: '\2714';
}
.iconic-left-quote:before {
content: '\275d';
}
.iconic-right-quote:before {
content: '\275e';
}
.iconic-plus:before {
content: '\2795';
}
.iconic-minus:before {
content: '\2796';
}
.iconic-curved-arrow:before {
content: '\2935';
}
.iconic-document-alt:before {
content: '\e000';
}
.iconic-calendar:before {
content: '\e001';
}
.iconic-map-pin-alt:before {
content: '\e002';
}
.iconic-comment-alt1:before {
content: '\e003';
}
.iconic-comment-alt2:before {
content: '\e004';
}
.iconic-pen-alt:before {
content: '\e005';
}
.iconic-pen-alt2:before {
content: '\e006';
}
.iconic-chat-alt:before {
content: '\e007';
}
.iconic-o-plus:before {
content: '\e008';
}
.iconic-o-minus:before {
content: '\e009';
}
.iconic-bars-alt:before {
content: '\e00a';
}
.iconic-book-alt:before {
content: '\e00b';
}
.iconic-aperture-alt:before {
content: '\e00c';
}
.iconic-beaker-alt:before {
content: '\e010';
}
.iconic-left-quote-alt:before {
content: '\e011';
}
.iconic-right-quote-alt:before {
content: '\e012';
}
.iconic-o-arrow-left:before {
content: '\e013';
}
.iconic-o-arrow-up:before {
content: '\e014';
}
.iconic-o-arrow-right:before {
content: '\e015';
}
.iconic-o-arrow-down:before {
content: '\e016';
}
.iconic-o-arrow-left-alt:before {
content: '\e017';
}
.iconic-o-arrow-up-alt:before {
content: '\e018';
}
.iconic-o-arrow-right-alt:before {
content: '\e019';
}
.iconic-o-arrow-down-alt:before {
content: '\e01a';
}
.iconic-brush:before {
content: '\e01b';
}
.iconic-brush-alt:before {
content: '\e01c';
}
.iconic-eyedropper:before {
content: '\e01e';
}
.iconic-layers:before {
content: '\e01f';
}
.iconic-layers-alt:before {
content: '\e020';
}
.iconic-compass:before {
content: '\e021';
}
.iconic-award:before {
content: '\e022';
}
.iconic-beaker:before {
content: '\e023';
}
.iconic-steering-wheel:before {
content: '\e024';
}
.iconic-eye:before {
content: '\e025';
}
.iconic-aperture:before {
content: '\e026';
}
.iconic-image:before {
content: '\e027';
}
.iconic-chart:before {
content: '\e028';
}
.iconic-chart-alt:before {
content: '\e029';
}
.iconic-target:before {
content: '\e02a';
}
.iconic-tag:before {
content: '\e02b';
}
.iconic-rss:before {
content: '\e02c';
}
.iconic-rss-alt:before {
content: '\e02d';
}
.iconic-share:before {
content: '\e02e';
}
.iconic-undo:before {
content: '\e02f';
}
.iconic-reload:before {
content: '\e030';
}
.iconic-reload-alt:before {
content: '\e031';
}
.iconic-loop:before {
content: '\e032';
}
.iconic-loop-alt:before {
content: '\e033';
}
.iconic-back-forth:before {
content: '\e034';
}
.iconic-back-forth-alt:before {
content: '\e035';
}
.iconic-spin:before {
content: '\e036';
}
.iconic-spin-alt:before {
content: '\e037';
}
.iconic-move-horizontal:before {
content: '\e038';
}
.iconic-move-horizontal-alt:before {
content: '\e039';
}
.iconic-o-move-horizontal:before {
content: '\e03a';
}
.iconic-move-vertical:before {
content: '\e03b';
}
.iconic-move-vertical-alt:before {
content: '\e03c';
}
.iconic-o-move-vertical:before {
content: '\e03d';
}
.iconic-move:before {
content: '\e03e';
}
.iconic-move-alt:before {
content: '\e03f';
}
.iconic-o-move:before {
content: '\e040';
}
.iconic-transfer:before {
content: '\e041';
}
.iconic-download:before {
content: '\e042';
}
.iconic-upload:before {
content: '\e043';
}
.iconic-cloud-download:before {
content: '\e044';
}
.iconic-cloud-upload:before {
content: '\e045';
}
.iconic-fork:before {
content: '\e046';
}
.iconic-play:before {
content: '\e047';
}
.iconic-o-play:before {
content: '\e048';
}
.iconic-pause:before {
content: '\e049';
}
.iconic-stop:before {
content: '\e04a';
}
.iconic-eject:before {
content: '\e04b';
}
.iconic-first:before {
content: '\e04c';
}
.iconic-last:before {
content: '\e04d';
}
.iconic-fullscreen:before {
content: '\e04e';
}
.iconic-fullscreen-alt:before {
content: '\e04f';
}
.iconic-fullscreen-exit:before {
content: '\e050';
}
.iconic-fullscreen-exit-alt:before {
content: '\e051';
}
.iconic-equalizer:before {
content: '\e052';
}
.iconic-article:before {
content: '\e053';
}
.iconic-read-more:before {
content: '\e054';
}
.iconic-list:before {
content: '\e055';
}
.iconic-list-nested:before {
content: '\e056';
}
.iconic-cursor:before {
content: '\e057';
}
.iconic-dial:before {
content: '\e058';
}
.iconic-new-window:before {
content: '\e059';
}
.iconic-trash:before {
content: '\e05a';
}
.iconic-battery-half:before {
content: '\e05b';
}
.iconic-battery-empty:before {
content: '\e05c';
}
.iconic-battery-charging:before {
content: '\e05d';
}
.iconic-chat:before {
content: '\e05e';
}
.iconic-mic:before {
content: '\e05f';
}
.iconic-movie:before {
content: '\e060';
}
.iconic-headphones:before {
content: '\e061';
}
.iconic-user:before {
content: '\e062';
}
.iconic-lightbulb:before {
content: '\e063';
}
.iconic-cd:before {
content: '\e064';
}
.iconic-folder:before {
content: '\e065';
}
.iconic-document:before {
content: '\e066';
}
.iconic-pin:before {
content: '\e067';
}
.iconic-map-pin:before {
content: '\e068';
}
.iconic-book:before {
content: '\e069';
}
.iconic-book-alt2:before {
content: '\e06a';
}
.iconic-box:before {
content: '\e06b';
}
.iconic-calendar-alt:before {
content: '\e06c';
}
.iconic-comment:before {
content: '\e06d';
}
.iconic-iphone:before {
content: '\e06e';
}
.iconic-bars:before {
content: '\e06f';
}
.iconic-camera:before {
content: '\e070';
}
.iconic-volume-mute:before {
content: '\e071';
}
.iconic-volume:before {
content: '\e072';
}
.iconic-battery-full:before {
content: '\e073';
}
.iconic-magnifying-glass:before {
content: '\e074';
}
.iconic-lock:before {
content: '\e075';
}
.iconic-unlock:before {
content: '\e076';
}
.iconic-link:before {
content: '\e077';
}
.iconic-wrench:before {
content: '\e078';
}
.iconic-clock:before {
content: '\e079';
}
.iconic-sun-stroke:before {
font-family: IconicStroke;
content: '\2600';
}
.iconic-moon-stroke:before {
font-family: IconicStroke;
content: '\263e';
}
.iconic-star-stroke:before {
font-family: IconicStroke;
content: '\2605';
}
.iconic-heart-stroke:before {
font-family: IconicStroke;
content: '\2764';
}
.iconic-key-stroke:before {
font-family: IconicStroke;
content: '\26bf';
}
.iconic-document-alt-stroke:before {
font-family: IconicStroke;
content: '\e000';
}
.iconic-comment-alt1-stroke:before {
font-family: IconicStroke;
content: '\e003';
}
.iconic-comment-alt2-stroke:before {
font-family: IconicStroke;
content: '\e004';
}
.iconic-pen-alt-stroke:before {
font-family: IconicStroke;
content: '\e005';
}
.iconic-chat-alt-stroke:before {
font-family: IconicStroke;
content: '\e007';
}
.iconic-award-stroke:before {
font-family: IconicStroke;
content: '\e022';
}
.iconic-tag-stroke:before {
font-family: IconicStroke;
content: '\e02b';
}
.iconic-trash-stroke:before {
font-family: IconicStroke;
content: '\e05a';
}
.iconic-folder-stroke:before {
font-family: IconicStroke;
content: '\e065';
}
.iconic-document-stroke:before {
font-family: IconicStroke;
content: '\e066';
}
.iconic-map-pin-stroke:before {
font-family: IconicStroke;
content: '\e068';
}
.iconic-calendar-alt-stroke:before {
font-family: IconicStroke;
content: '\e06c';
}
.iconic-comment-stroke:before {
font-family: IconicStroke;
content: '\e06d';
}
.iconic-lock-stroke:before {
font-family: IconicStroke;
content: '\e075';
}
.iconic-unlock-stroke:before {
font-family: IconicStroke;
content: '\e076';
}
}
.page-alert {
position: absolute;
top: 0;
left: 50%;
z-index: 1020;
width: 0;
}
.page-alert .alert {
width: 550px;
margin-left: -300px;
border-top-width: 0;
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.navbar-fixed-top + .page-alert {
top: 40px;
}
body > .page-alert {
position: fixed;
}
.btn-file {
position: relative;
overflow: hidden;
vertical-align: middle;
}
.btn-file > input {
position: absolute;
top: 0;
right: 0;
margin: 0;
cursor: pointer;
border: solid transparent;
border-width: 0 0 100px 200px;
opacity: 0;
filter: alpha(opacity=0);
-moz-transform: translate(-300px, 0) scale(4);
direction: ltr;
}
.fileupload {
margin-bottom: 9px;
}
.fileupload .uneditable-input {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
cursor: text;
}
.fileupload .thumbnail {
display: inline-block;
margin-bottom: 5px;
overflow: hidden;
text-align: center;
vertical-align: middle;
}
.fileupload .thumbnail > img {
display: inline-block;
max-height: 100%;
vertical-align: middle;
}
.fileupload .btn {
vertical-align: middle;
}
.fileupload-exists .fileupload-new,
.fileupload-new .fileupload-exists {
display: none;
}
.fileupload-inline .fileupload-controls {
display: inline;
}
.fileupload-new .input-append .btn-file {
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.thumbnail-borderless .thumbnail {
padding: 0;
border: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.fileupload-new.thumbnail-borderless .thumbnail {
border: 1px solid #ddd;
}
.control-group.warning .fileupload .uneditable-input {
color: #a47e3c;
border-color: #a47e3c;
}
.control-group.warning .fileupload .fileupload-preview {
color: #a47e3c;
}
.control-group.warning .fileupload .thumbnail {
border-color: #a47e3c;
}
.control-group.error .fileupload .uneditable-input {
color: #b94a48;
border-color: #b94a48;
}
.control-group.error .fileupload .fileupload-preview {
color: #b94a48;
}
.control-group.error .fileupload .thumbnail {
border-color: #b94a48;
}
.control-group.success .fileupload .uneditable-input {
color: #468847;
border-color: #468847;
}
.control-group.success .fileupload .fileupload-preview {
color: #468847;
}
.control-group.success .fileupload .thumbnail {
border-color: #468847;
}
.nav-tabs > li > a,
.nav-pills > li > a {
outline: none;
}
.nav-tabs > li.disabled > a {
color: #CCCCCC;
cursor: not-allowed;
}
.tabbable {
border-color: #ddd;
border-style: solid;
border-width: 0;
*zoom: 1;
}
.tabbable:before,
.tabbable:after {
display: table;
line-height: 0;
content: "";
}
.tabbable:after {
clear: both;
}
.tabbable > .nav-tabs {
margin: 0;
}
.tab-content {
padding: 18px 0 0 0;
overflow: auto;
border-color: #ddd;
border-style: solid;
border-width: 0;
}
.tabbable-bordered {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.tabbable-bordered > .tab-content {
padding: 20px 20px 10px 20px;
border-width: 0 1px 1px 1px;
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
body > .container.tabbable > .nav-tabs {
padding-top: 15px;
}
.tabs-below > .tab-content {
padding: 0 0 10px 0;
}
.tabs-below.tabbable-bordered > .tab-content {
padding: 20px 20px 10px 20px;
border-width: 1px 1px 0 1px;
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
body > .container.tabs-below.tabbable-bodered > .tab-content {
border-top-width: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.tabs-left,
.tabs-right {
margin-bottom: 20px;
}
.tabs-left > .nav-tabs,
.tabs-right > .nav-tabs {
position: relative;
z-index: 1;
margin-bottom: 0;
}
.tabs-left > .tab-content,
.tabs-right > .tab-content {
overflow: hidden;
}
.tabs-left > .nav-tabs {
left: 1px;
}
.tabs-left > .nav-tabs > .active > a,
.tabs-left > .nav-tabs > .active > a:hover {
border-color: #ddd transparent #ddd #ddd;
*border-right-color: #ffffff;
}
.tabs-left > .tab-content {
padding: 0 0 0 19px;
border-left-width: 1px;
}
.tabs-left.tabbable-bordered {
border-width: 0 1px 0 0;
}
.tabs-left.tabbable-bordered > .tab-content {
padding: 20px 20px 10px 20px;
border-width: 1px 0 1px 1px;
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
body > .container.tabs-left.tabbable-bodered > .tab-content {
border-top-width: 0;
-webkit-border-radius: 0 0 4px 0;
-moz-border-radius: 0 0 4px 0;
border-radius: 0 0 4px 0;
}
.tabs-right > .nav-tabs {
right: 1px;
}
.tabs-right > .nav-tabs > .active > a,
.tabs-right > .nav-tabs > .active > a:hover {
border-color: #ddd #ddd #ddd transparent;
*border-left-color: #ffffff;
}
.tabs-right > .tab-content {
padding: 0 19px 0 0;
border-right-width: 1px;
}
.tabs-right.tabbable-bordered {
border-width: 0 0 0 1px;
}
.tabs-right.tabbable-bordered > .tab-content {
padding: 20px 20px 10px 20px;
border-width: 1px 1px 1px 0;
-webkit-border-radius: 4px 0 0 4px;
-moz-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
body > .container.tabs-right.tabbable-bodered > .tab-content {
border-top-width: 0;
-webkit-border-radius: 0 0 0 4px;
-moz-border-radius: 0 0 0 4px;
border-radius: 0 0 0 4px;
}
.modal form {
margin-bottom: 0;
}
| NextDayWeb/assetm | UX/common/bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap.css | CSS | mit | 26,437 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Class: Animation</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/default.css">
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div style="position: absolute; width: 143px; height: 31px; right: 10px; top: 10px; z-index: 1050"><a href="http://phaser.io"><img src="img/phaser.png" border="0" /></a></div>
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser API</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-0">
<a href="Phaser.html">Phaser</a>
</li>
<li class="class-depth-0">
<a href="PIXI.html">PIXI</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-1">
<a href="Phaser.Animation.html">Animation</a>
</li>
<li class="class-depth-1">
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li class="class-depth-1">
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li class="class-depth-1">
<a href="Phaser.ArraySet.html">ArraySet</a>
</li>
<li class="class-depth-1">
<a href="Phaser.ArrayUtils.html">ArrayUtils</a>
</li>
<li class="class-depth-1">
<a href="Phaser.AudioSprite.html">AudioSprite</a>
</li>
<li class="class-depth-1">
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li class="class-depth-1">
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Button.html">Button</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Cache.html">Cache</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Camera.html">Camera</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Circle.html">Circle</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Color.html">Color</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Angle.html">Angle</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Animation.html">Animation</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.AutoCull.html">AutoCull</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Bounds.html">Bounds</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.BringToTop.html">BringToTop</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Core.html">Core</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Crop.html">Crop</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Delta.html">Delta</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Destroy.html">Destroy</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.FixedToCamera.html">FixedToCamera</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Health.html">Health</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.InCamera.html">InCamera</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.InputEnabled.html">InputEnabled</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.InWorld.html">InWorld</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.LifeSpan.html">LifeSpan</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.LoadTexture.html">LoadTexture</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Overlap.html">Overlap</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.PhysicsBody.html">PhysicsBody</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Reset.html">Reset</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.ScaleMinMax.html">ScaleMinMax</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Component.Smoothed.html">Smoothed</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Create.html">Create</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Creature.html">Creature</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Device.html">Device</a>
</li>
<li class="class-depth-1">
<a href="Phaser.DeviceButton.html">DeviceButton</a>
</li>
<li class="class-depth-1">
<a href="Phaser.DOM.html">DOM</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Easing.html">Easing</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Events.html">Events</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Filter.html">Filter</a>
</li>
<li class="class-depth-1">
<a href="Phaser.FlexGrid.html">FlexGrid</a>
</li>
<li class="class-depth-1">
<a href="Phaser.FlexLayer.html">FlexLayer</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Frame.html">Frame</a>
</li>
<li class="class-depth-1">
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Game.html">Game</a>
</li>
<li class="class-depth-1">
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li class="class-depth-1">
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Group.html">Group</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Image.html">Image</a>
</li>
<li class="class-depth-1">
<a href="Phaser.ImageCollection.html">ImageCollection</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Input.html">Input</a>
</li>
<li class="class-depth-1">
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Key.html">Key</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Line.html">Line</a>
</li>
<li class="class-depth-1">
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Loader.html">Loader</a>
</li>
<li class="class-depth-1">
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Math.html">Math</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Matrix.html">Matrix</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li class="class-depth-1">
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Net.html">Net</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Particle.html">Particle</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Particles.html">Particles</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Particles.Arcade.html">Arcade</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Physics.html">Physics</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.Arcade.html#TilemapCollision">TilemapCollision</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.FixtureList.html">FixtureList</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a>
</li>
<li class="class-depth-3">
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li class="class-depth-1">
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Point.html">Point</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li class="class-depth-1">
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li class="class-depth-1">
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li class="class-depth-1">
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li class="class-depth-1">
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li class="class-depth-1">
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Rope.html">Rope</a>
</li>
<li class="class-depth-1">
<a href="Phaser.RoundedRectangle.html">RoundedRectangle</a>
</li>
<li class="class-depth-1">
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Signal.html">Signal</a>
</li>
<li class="class-depth-1">
<a href="Phaser.SignalBinding.html">SignalBinding</a>
</li>
<li class="class-depth-1">
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Sound.html">Sound</a>
</li>
<li class="class-depth-1">
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li class="class-depth-1">
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Stage.html">Stage</a>
</li>
<li class="class-depth-1">
<a href="Phaser.State.html">State</a>
</li>
<li class="class-depth-1">
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Text.html">Text</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Tile.html">Tile</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li class="class-depth-1">
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li class="class-depth-1">
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li class="class-depth-1">
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Time.html">Time</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Timer.html">Timer</a>
</li>
<li class="class-depth-1">
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Touch.html">Touch</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Tween.html">Tween</a>
</li>
<li class="class-depth-1">
<a href="Phaser.TweenData.html">TweenData</a>
</li>
<li class="class-depth-1">
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Utils.html">Utils</a>
</li>
<li class="class-depth-2">
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li class="class-depth-1">
<a href="Phaser.Video.html">Video</a>
</li>
<li class="class-depth-1">
<a href="Phaser.World.html">World</a>
</li>
<li class="class-depth-1">
<a href="PIXI.AbstractFilter.html">AbstractFilter</a>
</li>
<li class="class-depth-1">
<a href="PIXI.BaseTexture.html">BaseTexture</a>
</li>
<li class="class-depth-1">
<a href="PIXI.CanvasBuffer.html">CanvasBuffer</a>
</li>
<li class="class-depth-1">
<a href="PIXI.CanvasGraphics.html">CanvasGraphics</a>
</li>
<li class="class-depth-1">
<a href="PIXI.CanvasMaskManager.html">CanvasMaskManager</a>
</li>
<li class="class-depth-1">
<a href="PIXI.CanvasRenderer.html">CanvasRenderer</a>
</li>
<li class="class-depth-1">
<a href="PIXI.CanvasTinter.html">CanvasTinter</a>
</li>
<li class="class-depth-1">
<a href="PIXI.ComplexPrimitiveShader.html">ComplexPrimitiveShader</a>
</li>
<li class="class-depth-1">
<a href="PIXI.DisplayObject.html">DisplayObject</a>
</li>
<li class="class-depth-1">
<a href="PIXI.DisplayObjectContainer.html">DisplayObjectContainer</a>
</li>
<li class="class-depth-1">
<a href="PIXI.Event.html">Event</a>
</li>
<li class="class-depth-1">
<a href="PIXI.EventTarget.html">EventTarget</a>
</li>
<li class="class-depth-1">
<a href="PIXI.FilterTexture.html">FilterTexture</a>
</li>
<li class="class-depth-1">
<a href="PIXI.Graphics.html">Graphics</a>
</li>
<li class="class-depth-1">
<a href="PIXI.GraphicsData.html">GraphicsData</a>
</li>
<li class="class-depth-1">
<a href="PIXI.PIXI.html">PIXI</a>
</li>
<li class="class-depth-1">
<a href="PIXI.PixiFastShader.html">PixiFastShader</a>
</li>
<li class="class-depth-1">
<a href="PIXI.PixiShader.html">PixiShader</a>
</li>
<li class="class-depth-1">
<a href="PIXI.PolyK.html">PolyK</a>
</li>
<li class="class-depth-1">
<a href="PIXI.PrimitiveShader.html">PrimitiveShader</a>
</li>
<li class="class-depth-1">
<a href="PIXI.RenderTexture.html">RenderTexture</a>
</li>
<li class="class-depth-1">
<a href="PIXI.Rope.html">Rope</a>
</li>
<li class="class-depth-1">
<a href="PIXI.Sprite.html">Sprite</a>
</li>
<li class="class-depth-1">
<a href="PIXI.SpriteBatch.html">SpriteBatch</a>
</li>
<li class="class-depth-1">
<a href="PIXI.Stage.html">Stage</a>
</li>
<li class="class-depth-1">
<a href="PIXI.Strip.html">Strip</a>
</li>
<li class="class-depth-1">
<a href="PIXI.StripShader.html">StripShader</a>
</li>
<li class="class-depth-1">
<a href="PIXI.Texture.html">Texture</a>
</li>
<li class="class-depth-1">
<a href="PIXI.TilingSprite.html">TilingSprite</a>
</li>
<li class="class-depth-1">
<a href="PIXI.WebGLBlendModeManager.html">WebGLBlendModeManager</a>
</li>
<li class="class-depth-1">
<a href="PIXI.WebGLFastSpriteBatch.html">WebGLFastSpriteBatch</a>
</li>
<li class="class-depth-1">
<a href="PIXI.WebGLFilterManager.html">WebGLFilterManager</a>
</li>
<li class="class-depth-1">
<a href="PIXI.WebGLRenderer.html">WebGLRenderer</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-0">
<a href="global.html#AUTO">AUTO</a>
</li>
<li class="class-depth-0">
<a href="global.html#BITMAPDATA">BITMAPDATA</a>
</li>
<li class="class-depth-0">
<a href="global.html#BITMAPTEXT">BITMAPTEXT</a>
</li>
<li class="class-depth-0">
<a href="global.html#blendModes">blendModes</a>
</li>
<li class="class-depth-0">
<a href="global.html#BUTTON">BUTTON</a>
</li>
<li class="class-depth-0">
<a href="global.html#CANVAS">CANVAS</a>
</li>
<li class="class-depth-0">
<a href="global.html#CANVAS_FILTER">CANVAS_FILTER</a>
</li>
<li class="class-depth-0">
<a href="global.html#CIRCLE">CIRCLE</a>
</li>
<li class="class-depth-0">
<a href="global.html#CREATURE">CREATURE</a>
</li>
<li class="class-depth-0">
<a href="global.html#DOWN">DOWN</a>
</li>
<li class="class-depth-0">
<a href="global.html#ELLIPSE">ELLIPSE</a>
</li>
<li class="class-depth-0">
<a href="global.html#EMITTER">EMITTER</a>
</li>
<li class="class-depth-0">
<a href="global.html#GAMES">GAMES</a>
</li>
<li class="class-depth-0">
<a href="global.html#GRAPHICS">GRAPHICS</a>
</li>
<li class="class-depth-0">
<a href="global.html#GROUP">GROUP</a>
</li>
<li class="class-depth-0">
<a href="global.html#HEADLESS">HEADLESS</a>
</li>
<li class="class-depth-0">
<a href="global.html#IMAGE">IMAGE</a>
</li>
<li class="class-depth-0">
<a href="global.html#LEFT">LEFT</a>
</li>
<li class="class-depth-0">
<a href="global.html#LINE">LINE</a>
</li>
<li class="class-depth-0">
<a href="global.html#MATRIX">MATRIX</a>
</li>
<li class="class-depth-0">
<a href="global.html#NONE">NONE</a>
</li>
<li class="class-depth-0">
<a href="global.html#POINT">POINT</a>
</li>
<li class="class-depth-0">
<a href="global.html#POINTER">POINTER</a>
</li>
<li class="class-depth-0">
<a href="global.html#POLYGON">POLYGON</a>
</li>
<li class="class-depth-0">
<a href="global.html#RECTANGLE">RECTANGLE</a>
</li>
<li class="class-depth-0">
<a href="global.html#RENDERTEXTURE">RENDERTEXTURE</a>
</li>
<li class="class-depth-0">
<a href="global.html#RETROFONT">RETROFONT</a>
</li>
<li class="class-depth-0">
<a href="global.html#RIGHT">RIGHT</a>
</li>
<li class="class-depth-0">
<a href="global.html#ROPE">ROPE</a>
</li>
<li class="class-depth-0">
<a href="global.html#ROUNDEDRECTANGLE">ROUNDEDRECTANGLE</a>
</li>
<li class="class-depth-0">
<a href="global.html#scaleModes">scaleModes</a>
</li>
<li class="class-depth-0">
<a href="global.html#SPRITE">SPRITE</a>
</li>
<li class="class-depth-0">
<a href="global.html#SPRITEBATCH">SPRITEBATCH</a>
</li>
<li class="class-depth-0">
<a href="global.html#TEXT">TEXT</a>
</li>
<li class="class-depth-0">
<a href="global.html#TILEMAP">TILEMAP</a>
</li>
<li class="class-depth-0">
<a href="global.html#TILEMAPLAYER">TILEMAPLAYER</a>
</li>
<li class="class-depth-0">
<a href="global.html#TILESPRITE">TILESPRITE</a>
</li>
<li class="class-depth-0">
<a href="global.html#UP">UP</a>
</li>
<li class="class-depth-0">
<a href="global.html#VERSION">VERSION</a>
</li>
<li class="class-depth-0">
<a href="global.html#VIDEO">VIDEO</a>
</li>
<li class="class-depth-0">
<a href="global.html#WEBGL">WEBGL</a>
</li>
<li class="class-depth-0">
<a href="global.html#WEBGL_FILTER">WEBGL_FILTER</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Core<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-1"><a href="Phaser.Game.html">Game</a></li>
<li class="class-depth-1"><a href="Phaser.Group.html">Group</a></li>
<li class="class-depth-1"><a href="Phaser.World.html">World</a></li>
<li class="class-depth-1"><a href="Phaser.Loader.html">Loader</a></li>
<li class="class-depth-1"><a href="Phaser.Cache.html">Cache</a></li>
<li class="class-depth-1"><a href="Phaser.Time.html">Time</a></li>
<li class="class-depth-1"><a href="Phaser.Camera.html">Camera</a></li>
<li class="class-depth-1"><a href="Phaser.StateManager.html">State Manager</a></li>
<li class="class-depth-1"><a href="Phaser.TweenManager.html">Tween Manager</a></li>
<li class="class-depth-1"><a href="Phaser.SoundManager.html">Sound Manager</a></li>
<li class="class-depth-1"><a href="Phaser.Input.html">Input Manager</a></li>
<li class="class-depth-1"><a href="Phaser.ScaleManager.html">Scale Manager</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Game Objects<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-1"><a href="Phaser.GameObjectFactory.html">Factory (game.add)</a></li>
<li class="class-depth-1"><a href="Phaser.GameObjectCreator.html">Creator (game.make)</a></li>
<li class="class-depth-1"><a href="Phaser.Sprite.html">Sprite</a></li>
<li class="class-depth-1"><a href="Phaser.Image.html">Image</a></li>
<li class="class-depth-1"><a href="Phaser.Sound.html">Sound</a></li>
<li class="class-depth-1"><a href="Phaser.Video.html">Video</a></li>
<li class="class-depth-1"><a href="Phaser.Particles.Arcade.Emitter.html">Particle Emitter</a></li>
<li class="class-depth-1"><a href="Phaser.Particle.html">Particle</a></li>
<li class="class-depth-1"><a href="Phaser.Text.html">Text</a></li>
<li class="class-depth-1"><a href="Phaser.Tween.html">Tween</a></li>
<li class="class-depth-1"><a href="Phaser.BitmapText.html">BitmapText</a></li>
<li class="class-depth-1"><a href="Phaser.Tilemap.html">Tilemap</a></li>
<li class="class-depth-1"><a href="Phaser.BitmapData.html">BitmapData</a></li>
<li class="class-depth-1"><a href="Phaser.RetroFont.html">RetroFont</a></li>
<li class="class-depth-1"><a href="Phaser.Button.html">Button</a></li>
<li class="class-depth-1"><a href="Phaser.Animation.html">Animation</a></li>
<li class="class-depth-1"><a href="Phaser.Graphics.html">Graphics</a></li>
<li class="class-depth-1"><a href="Phaser.RenderTexture.html">RenderTexture</a></li>
<li class="class-depth-1"><a href="Phaser.TileSprite.html">TileSprite</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Geometry<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-1"><a href="Phaser.Circle.html">Circle</a></li>
<li class="class-depth-1"><a href="Phaser.Ellipse.html">Ellipse</a></li>
<li class="class-depth-1"><a href="Phaser.Line.html">Line</a></li>
<li class="class-depth-1"><a href="Phaser.Matrix.html">Matrix</a></li>
<li class="class-depth-1"><a href="Phaser.Point.html">Point</a></li>
<li class="class-depth-1"><a href="Phaser.Polygon.html">Polygon</a></li>
<li class="class-depth-1"><a href="Phaser.Rectangle.html">Rectangle</a></li>
<li class="class-depth-1"><a href="Phaser.RoundedRectangle.html">Rounded Rectangle</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Physics<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-1"><a href="Phaser.Physics.Arcade.html">Arcade Physics</a></li>
<li class="class-depth-2"><a href="Phaser.Physics.Arcade.Body.html">Body</a></li>
<li class="class-depth-1"><a href="Phaser.Physics.P2.html">P2 Physics</a></li>
<li class="class-depth-2"><a href="Phaser.Physics.P2.Body.html">Body</a></li>
<li class="class-depth-2"><a href="Phaser.Physics.P2.Spring.html">Spring</a></li>
<li class="class-depth-2"><a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a></li>
<li class="class-depth-2"><a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a></li>
<li class="class-depth-1"><a href="Phaser.Physics.Ninja.html">Ninja Physics</a></li>
<li class="class-depth-2"><a href="Phaser.Physics.Body.html">Body</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Input<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-1"><a href="Phaser.InputHandler.html">Input Handler</a></li>
<li class="class-depth-1"><a href="Phaser.Pointer.html">Pointer</a></li>
<li class="class-depth-1"><a href="Phaser.DeviceButton.html">Device Button</a></li>
<li class="class-depth-1"><a href="Phaser.Mouse.html">Mouse</a></li>
<li class="class-depth-1"><a href="Phaser.Keyboard.html">Keyboard</a></li>
<li class="class-depth-1"><a href="Phaser.Key.html">Key</a></li>
<li class="class-depth-1"><a href="Phaser.Gamepad.html">Gamepad</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Community<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li class="class-depth-1"><a href="http://phaser.io">Phaser Web Site</a></li>
<li class="class-depth-1"><a href="https://github.com/photonstorm/phaser">Phaser Github</a></li>
<li class="class-depth-1"><a href="http://phaser.io/examples">Phaser Examples</a></li>
<li class="class-depth-1"><a href="https://github.com/photonstorm/phaser-plugins">Phaser Plugins</a></li>
<li class="class-depth-1"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Forum</a></li>
<li class="class-depth-1"><a href="http://stackoverflow.com/questions/tagged/phaser-framework">Stack Overflow</a></li>
<li class="class-depth-1"><a href="http://phaser.io/learn">Tutorials</a></li>
<li class="class-depth-1"><a href="https://confirmsubscription.com/h/r/369DE48E3E86AF1E">Newsletter</a></li>
<li class="class-depth-1"><a href="http://phaser.io/community/twitter">Twitter</a></li>
<li class="class-depth-1"><a href="http://phaser.io/community/irc">IRC</a></li>
<li class="class-depth-1"><a href="https://www.codeandweb.com/texturepacker/phaser">Texture Packer</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span8">
<div id="main">
<!--<h1 class="page-title">Class: Animation</h1>-->
<section>
<header>
<h2>
<span class="ancestors"><a href="Phaser.html">Phaser</a><a href="Phaser.html#Component">.Component</a>.</span>
Animation
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name "
id="Animation"><span class="type-signature"></span>new Animation<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>The Animation Component provides a <code>play</code> method, which is a proxy to the <code>AnimationManager.play</code> method.</p>
</div>
<dl class="details">
<dt class="tag-source">Source -
<a href="src_gameobjects_components_Animation.js.html">gameobjects/components/Animation.js</a>, <a href="src_gameobjects_components_Animation.js.html#sunlight-1-line-12">line 12</a>
</dt>
</dl>
</dd>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name "
id="play"><span class="type-signature"></span>play<span class="signature">(name, <span class="optional">frameRate</span>, <span class="optional">loop</span>, <span class="optional">killOnComplete</span>)</span><span class="type-signature"> → {<a href="Phaser.Animation.html">Phaser.Animation</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Plays an Animation.</p>
<p>The animation should have previously been created via <code>animations.add</code>.</p>
<p>If the animation is already playing calling this again won't do anything.
If you need to reset an already running animation do so directly on the Animation object itself or via <code>AnimationManager.stop</code>.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The name of the animation to be played, e.g. "fire", "walk", "jump". Must have been previously created via 'AnimationManager.add'.</p></td>
</tr>
<tr>
<td class="name"><code>frameRate</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
null
</td>
<td class="description last"><p>The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.</p></td>
</tr>
<tr>
<td class="name"><code>loop</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.</p></td>
</tr>
<tr>
<td class="name"><code>killOnComplete</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>If set to true when the animation completes (only happens if loop=false) the parent Sprite will be killed.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="returns">
<div class="returns-type">
<span class="param-type"><a href="Phaser.Animation.html">Phaser.Animation</a></span>
-
</div>
<div class="returns-desc param-desc">
<p>A reference to playing Animation.</p>
</div>
</div>
<dl class="details">
<dt class="tag-source">Source -
<a href="src_gameobjects_components_Animation.js.html">gameobjects/components/Animation.js</a>, <a href="src_gameobjects_components_Animation.js.html#sunlight-1-line-31">line 31</a>
</dt>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2015 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha10</a>
on Fri Jul 24 2015 13:29:47 GMT+0100 (GMT Daylight Time) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<div class="span3">
<div id="toc"></div>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html> | erkan32/impact | docs/Phaser.Component.Animation.html | HTML | mit | 40,467 |
//编写自定义JS代码
/*jslint unparam: true, regexp: true */
/*global window, $ */
function initUpload(basePath){
'use strict';
// Change this to the location of your server-side upload handler:
var url = basePath+"/qywx/qywxNewsitem.do?doUpload",
uploadButton = $('<button/>')
.addClass('btn btn-primary')
.prop('disabled', true)
.text('上传中...')
.on('click', function () {
var $this = $(this), data = $this.data();
$this.off('click').text('正在上传...').on('click', function () {
$this.remove();
data.abort();
});
data.submit().always(function () {
$this.remove();
});
});
$('#fileupload').fileupload({
url: url,
dataType: 'json',
autoUpload: false,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
maxFileSize: 2000000, // 2 MB
disableImageResize: /Android(?!.*Chrome)|Opera/
.test(window.navigator.userAgent),
previewMaxWidth: 290,
previewMaxHeight: 160,
previewCrop: true
}).on('fileuploadadd', function (e, data) {
$("#files").text("");
data.context = $('<div/>').appendTo('#files');
$.each(data.files, function (index, file) {
//var node = $('<p/>').append($('<span/>').text(file.name));
//fileupload
var node = $('<p/>');
if (!index) {
node.append('<br>').append(uploadButton.clone(true).data(data));
}
node.appendTo(data.context);
});
removePic();
}).on('fileuploadprocessalways', function (e, data) {
var index = data.index,
file = data.files[index],
node = $(data.context.children()[index]);
if (file.preview) {
node.prepend('<br>').prepend(file.preview);
}
if (file.error) {
node
.append('<br>')
.append($('<span class="text-danger"/>').text(file.error));
}
if (index + 1 === data.files.length) {
data.context.find('button')
.text('上传')
.prop('disabled', !!data.files.error);
}
}).on('fileuploadprogressall', function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .progress-bar').css(
'width',
progress + '%'
);
}).on('fileuploaddone', function (e, data) {
//console.info(data);
var file = data.files[0];
//var delUrl = "<a class=\"js_removeCover\" onclick=\"return false;\" href=\"javascript:void(0);\">删除</a>";
$("#imgName").text("").append(file.name);
$("#progress").hide();
var d =data.result;
if (d.success) {
var link = $('<a>').attr('target', '_blank').prop('href', d.attributes.viewhref);
$(data.context.children()[0]).wrap(link);
//console.info(d.attributes.viewhref);
$("#imagePath").val(d.attributes.url);
showPic(d.attributes.url,d.attributes.fileKey);
}else{
var error = $('<span class="text-danger"/>').text(d.msg);
$(data.context.children()[0]).append('<br>').append(error);
}
}).on('fileuploadfail', function (e, data) {
$.each(data.files, function (index, file) {
var error = $('<span class="text-danger"/>').text('File upload failed.');
$(data.context.children()[index])
.append('<br>')
.append(error);
});
}).prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');
}
function showPic(path,id)
{
try {
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=b_version.split(";");
var trim_Version=version[1].replace(/[ ]/g,"");
if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0"||trim_Version=="MSIE7.0"||trim_Version=="MSIE8.0"||trim_Version=="MSIE9.0")
{
var img = '<div id=\"'+id+'\"><img name=\"photo\" src=\"'+basePath+'/'+path+'\" width=\"290\" height=\"160\" id=\"'+path+'\"/>';
$('#files').append(img);
}
} catch (e) {
}
//alert(trim_Version);
}
function removePic()
{
//$('#'+id).remove();
$("img[name=\"photo\"]").remove();
}
function browseImages(inputId, Img) {// 图片管理器,可多个上传共用
var finder = new CKFinder();
finder.selectActionFunction = function(fileUrl, data) {//设置文件被选中时的函数
$("#" + Img).attr("src", fileUrl);
$("#" + inputId).attr("value", fileUrl);
};
finder.resourceType = 'Images';// 指定ckfinder只为图片进行管理
finder.selectActionData = inputId; //接收地址的input ID
finder.removePlugins = 'help';// 移除帮助(只有英文)
finder.defaultLanguage = 'zh-cn';
finder.popup();
}
function browseFiles(inputId, file) {// 文件管理器,可多个上传共用
var finder = new CKFinder();
finder.selectActionFunction = function(fileUrl, data) {//设置文件被选中时的函数
$("#" + file).attr("href", fileUrl);
$("#" + inputId).attr("value", fileUrl);
decode(fileUrl, file);
};
finder.resourceType = 'Files';// 指定ckfinder只为文件进行管理
finder.selectActionData = inputId; //接收地址的input ID
finder.removePlugins = 'help';// 移除帮助(只有英文)
finder.defaultLanguage = 'zh-cn';
finder.popup();
}
function decode(value, id) {//value传入值,id接受值
var last = value.lastIndexOf("/");
var filename = value.substring(last + 1, value.length);
$("#" + id).text(decodeURIComponent(filename));
} | xiongmaoshouzha/test | jeecg-p3-biz-qywx/target/classes/content/qywx/plug-in/sucai/qywxNewsitem-add.js | JavaScript | mit | 5,799 |
module.exports = function (sails) {
/**
* Module dependencies.
*/
var _ = require( 'lodash' );
/**
* Expose hook constructor
*
* @api private
*/
return Hook;
function Hook (definition) {
// Ensure that the hook definition has valid properties
_normalize( this );
definition = _normalize( definition );
// Merge default definition with overrides in the definition passed in
_.extend( definition.config, this.config, definition.config );
_.extend( definition.middleware, this.middleware, definition.middleware );
_.extend( definition.routes.before, this.routes.before, definition.routes.before );
_.extend( definition.routes.after, this.routes.after, definition.routes.after );
_.extend( this, definition );
// Bind context of new methods from definition
_.bindAll(this);
/**
* Load the hook asynchronously
*
* @api private
*/
this.load = function (cb) {
var self = this;
// Determine if this hook should load based on Sails environment & hook config
if ( this.config.envs &&
this.config.envs.length > 0 &&
this.config.envs.indexOf(sails.config.environment) === -1) {
return cb();
}
// Convenience config to bind routes before any of the static app routes
sails.on('router:before', function () {
_.each(self.routes.before, function (middleware, route) {
sails.router.bind(route, middleware);
});
});
// Convenience config to bind routes after the static app routes
sails.on('router:after', function () {
_.each(self.routes.after, function (middleware, route) {
sails.router.bind(route, middleware);
});
});
// Call initialize() method if one provided
if (this.initialize) { this.initialize(cb); }
else cb();
};
/**
* Ensure that a hook definition has the required properties
* @api private
*/
function _normalize ( def ) {
def = def || {};
// Default hook config
def.config = def.config || {};
// list of environments to run in, if empty defaults to all
def.config.envs = def.config.envs || [];
def.middleware = def.middleware || {};
// Default hook routes
def.routes = def.routes || {};
def.routes.before = def.routes.before || {};
def.routes.after = def.routes.after || {};
// Always set ready to true-- doesn't need to do anything asynchronous
def.ready = true;
return def;
}
}
};
| tskaggs/btown-hackers | node_modules/sails/lib/hooks/index.js | JavaScript | mit | 2,415 |
/// <reference types="d3" />
nv.addGraph({
generate: function() {
var chart = nv.models.historicalBar();
d3.select("#test1")
.datum(sinData())
.datum(sinData())
.transition()
.call(chart);
return chart;
},
callback: function(graph) {
graph.dispatch.on('elementMouseover', function(e) {
var offsetElement = document.getElementById("chart"),
left = e.pos[0],
top = e.pos[1];
var content = '<p>' + e.point.y + '</p>';
nv.tooltip.show([left, top], content, e.value < 0 ? 'n' : 's');
});
graph.dispatch.on('elementMouseout', function(e) {
nv.tooltip.cleanup();
});
}
});
//Simple test data generators
function sinAndCos() {
var sin = [],
cos = [];
for (var i = 0; i < 100; i++) {
sin.push({x: i, y: Math.sin(i/10)});
cos.push({x: i, y: .5 * Math.cos(i/10)});
}
return [
{values: sin, key: "Sine Wave", color: "#ff7f0e"},
{values: cos, key: "Cosine Wave", color: "#2ca02c"}
];
}
function sinData() {
var sin = [];
for (var i = 0; i < 100; i++) {
sin.push({x: i, y: Math.sin(i/10)});
}
return [{
values: sin,
key: "Sine Wave",
color: "#ff7f0e"
}];
} | psnider/DefinitelyTyped | nvd3/test/historicalBar.ts | TypeScript | mit | 1,177 |
var _ = require('lodash');
var request = require('request');
var Promise = require('bluebird');
function main(options) {
options = options || {};
var user = options.user;
var repo = options.repo;
var oauthKey = options.oauthKey;
var releaseDate = options.releaseDate;
var releaseTag = options.releaseTag;
var count = options.count || Infinity;
if (!(user && repo)) {
throw new Error('Must specify both github user and repo.');
}
//Looks like we're good to go. Start making promises baby!
var repoApiUrl = ['https://api.github.com/repos/', user, '/', repo].join('');
var releaseDatePromise = getReleaseDatePromise(releaseDate, releaseTag, repoApiUrl, user, oauthKey);
var contributorsPromise = requestPromise({
url: repoApiUrl + '/stats/contributors',
userAgent: user,
oauthKey: oauthKey,
retry: options.retry
});
return Promise.join(releaseDatePromise, contributorsPromise, count, getTopContributors);
}
function getReleaseDatePromise(releaseDate, releaseTag, repoApiUrl, user, oauthKey) {
if (releaseDate) {
//Divide by 1k to remove milliseconds to match GH datestamps
return Promise.resolve(releaseDate / 1000);
}
// If neither releaseDate or releaseTag were specified
// sum all commits since the beginning of time.
if (!releaseTag) {
return Promise.resolve(0); // All time!
}
return requestPromise({
url: repoApiUrl + '/releases',
userAgent: user,
oauthKey: oauthKey
}).then(function (releases) {
var lastRelease = _.find(releases, function findLastRelease(release) {
return release.tag_name === releaseTag;
});
if (!lastRelease) {
return Promise.reject(new Error(releaseTag + ' not found in github releases\'s tags.'));
}
//Divide by 1k to remove milliseconds to match GH datestamps
return Date.parse(lastRelease.published_at) / 1000;
});
}
function getTopContributors(releaseDate, contributors, count) {
contributors = _.map(contributors, function (contributor) {
var numCommitsSinceReleaseDate = _.reduce(contributor.weeks,
function (commits, week) {
if (week.w >= releaseDate) {
commits += week.c;
}
return commits;
}, 0);
return {
commitCount: numCommitsSinceReleaseDate,
name: contributor.author.login,
githubUrl: contributor.author.html_url,
avatarUrl: contributor.author.avatar_url
};
});
//Get the top `count` contributors by commits
return _.chain(contributors).filter(function (c) {
return c.commitCount > 0;
}).sortBy('commitCount')
.reverse()
.slice(0, count)
.value();
}
/*
* @param {Object} options
* @param {string} url - the url to request
* @param {string} [userAgent]
* @param {string} [oauthKey] - a GitHub oauth key with access to the repository being queried
* @param {boolean} [retry] - retry on status code 202
* @param {number} [retryCount]
*/
function requestPromise(options) {
options = options || {};
var headers = {'User-Agent': options.userAgent || 'request'};
if (options.oauthKey) {
headers.Authorization = 'token ' + options.oauthKey;
}
return new Promise(function (resolve, reject) {
request({
url: options.url,
json: true,
headers: headers
}, function (error, response, body) {
if (error) {
return reject(error);
}
function decorateError(error) {
if (!error) {
throw new Error('error is required.');
}
error.url = options.url;
error.http_status = response.statusCode;
error.ratelimit_limit = response.headers['x-ratelimit-limit'];
error.ratelimit_remaining = response.headers['x-ratelimit-remaining'];
error.ratelimit_reset = parseInt(response.headers['x-ratelimit-reset'], 10);
return error;
}
if (response.statusCode >= 500) {
return reject(decorateError(new Error('Server error on url ' + options.url)));
}
if (response.statusCode >= 400) {
return reject(decorateError(new Error('Client error on url ' + options.url)));
}
if (response.statusCode === 202) {
if (!options.retry || options.retryCount > 4) {
return reject(decorateError(new Error('API returned status 202. Try again in a few moments.')));
}
var retryCount = parseInt(options.retryCount, 10) || 0;
var retryPromise = Promise.delay(retryDelay(retryCount)).then(function () {
return requestPromise({
url: options.url,
userAgent: options.userAgent || 'request',
oauthKey: options.oauthKey,
retry: true,
retryCount: retryCount + 1
});
});
return resolve(retryPromise);
}
return resolve(body);
});
});
}
function retryDelay(count) {
return Math.floor((Math.pow(2, count) + Math.random()) * 1000);
}
main.getReleaseDatePromise = getReleaseDatePromise;
main.getTopContributors = getTopContributors;
module.exports = main;
| rtrigoso/tastycakes | node_modules/top-gh-contribs/index.js | JavaScript | mit | 5,616 |
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { OpaqueToken, SchemaMetadata } from '@angular/core';
import { CompileDirectiveMetadata, CompilePipeMetadata } from '../compile_metadata';
import { BindingPipe, RecursiveAstVisitor } from '../expression_parser/ast';
import { Parser } from '../expression_parser/parser';
import { I18NHtmlParser } from '../i18n/i18n_html_parser';
import { ParseTreeResult } from '../ml_parser/html_parser';
import { InterpolationConfig } from '../ml_parser/interpolation_config';
import { ParseError, ParseErrorLevel, ParseSourceSpan } from '../parse_util';
import { Console } from '../private_import_core';
import { ElementSchemaRegistry } from '../schema/element_schema_registry';
import { TemplateAst, TemplateAstVisitor } from './template_ast';
/**
* Provides an array of {@link TemplateAstVisitor}s which will be used to transform
* parsed templates before compilation is invoked, allowing custom expression syntax
* and other advanced transformations.
*
* This is currently an internal-only feature and not meant for general use.
*/
export declare const TEMPLATE_TRANSFORMS: OpaqueToken;
export declare class TemplateParseError extends ParseError {
constructor(message: string, span: ParseSourceSpan, level: ParseErrorLevel);
}
export declare class TemplateParseResult {
templateAst: TemplateAst[];
errors: ParseError[];
constructor(templateAst?: TemplateAst[], errors?: ParseError[]);
}
export declare class TemplateParser {
private _exprParser;
private _schemaRegistry;
private _htmlParser;
private _console;
transforms: TemplateAstVisitor[];
constructor(_exprParser: Parser, _schemaRegistry: ElementSchemaRegistry, _htmlParser: I18NHtmlParser, _console: Console, transforms: TemplateAstVisitor[]);
parse(component: CompileDirectiveMetadata, template: string, directives: CompileDirectiveMetadata[], pipes: CompilePipeMetadata[], schemas: SchemaMetadata[], templateUrl: string): TemplateAst[];
tryParse(component: CompileDirectiveMetadata, template: string, directives: CompileDirectiveMetadata[], pipes: CompilePipeMetadata[], schemas: SchemaMetadata[], templateUrl: string): TemplateParseResult;
tryParseHtml(htmlAstWithErrors: ParseTreeResult, component: CompileDirectiveMetadata, template: string, directives: CompileDirectiveMetadata[], pipes: CompilePipeMetadata[], schemas: SchemaMetadata[], templateUrl: string): TemplateParseResult;
expandHtml(htmlAstWithErrors: ParseTreeResult, forced?: boolean): ParseTreeResult;
getInterpolationConfig(component: CompileDirectiveMetadata): InterpolationConfig;
}
export declare function splitClasses(classAttrValue: string): string[];
export declare class PipeCollector extends RecursiveAstVisitor {
pipes: Set<string>;
visitPipe(ast: BindingPipe, context: any): any;
}
| ShareTracs/app | node_modules/@angular/compiler/src/template_parser/template_parser.d.ts | TypeScript | mit | 2,990 |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime;
using System.Diagnostics;
namespace Internal.Reflection.Core.NonPortable
{
//
// This is essentially a workaround for the fact that neither IntPtr or RuntimeTypeHandle implements IEquatable<>.
// Note that for performance, this key implements equality as a IntPtr compare rather than calling RuntimeImports.AreTypesEquivalent().
// That is, this key is designed for use in caches, not unifiers.
//
internal struct RawRuntimeTypeHandleKey : IEquatable<RawRuntimeTypeHandleKey>
{
public RawRuntimeTypeHandleKey(RuntimeTypeHandle runtimeTypeHandle)
{
_runtimeTypeHandle = runtimeTypeHandle;
}
public RuntimeTypeHandle RuntimeTypeHandle
{
get
{
return _runtimeTypeHandle;
}
}
public override bool Equals(Object obj)
{
if (!(obj is RawRuntimeTypeHandleKey))
return false;
return Equals((RawRuntimeTypeHandleKey)obj);
}
public bool Equals(RawRuntimeTypeHandleKey other)
{
//
// Note: This compares the handle as raw IntPtr's. This is NOT equivalent to testing for semantic type identity. Redhawk can
// and does create multiple EETypes for the same type identity. This is only considered ok here because
// this key is designed for caching Object.GetType() and Type.GetTypeFromHandle() results, not for establishing
// a canonical Type instance for a given semantic type identity.
//
return this.RuntimeTypeHandle.RawValue == other.RuntimeTypeHandle.RawValue;
}
public override int GetHashCode()
{
//
// Note: This treats the handle as raw IntPtr's. This is NOT equivalent to testing for semantic type identity. Redhawk can
// and does create multiple EETypes for the same type identity. This is only considered ok here because
// this key is designed for caching Object.GetType() and Type.GetTypeFromHandle() results, not for establishing
// a canonical Type instance for a given semantic type identity.
//
return this.RuntimeTypeHandle.RawValue.GetHashCode();
}
private RuntimeTypeHandle _runtimeTypeHandle;
}
}
| yizhang82/corert | src/System.Private.CoreLib/src/Internal/Reflection/Core/NonPortable/RawRuntimeTypeHandleKey.cs | C# | mit | 2,589 |
module Gitlab
module Satellite
class Satellite
include Gitlab::Popen
PARKING_BRANCH = "__parking_branch"
attr_accessor :project
def initialize(project)
@project = project
end
def log(message)
Gitlab::Satellite::Logger.error(message)
end
def clear_and_update!
project.ensure_satellite_exists
@repo = nil
clear_working_dir!
delete_heads!
remove_remotes!
update_from_source!
end
def create
output, status = popen(%W(git clone -- #{project.repository.path_to_repo} #{path}),
Gitlab.config.satellites.path)
log("PID: #{project.id}: git clone #{project.repository.path_to_repo} #{path}")
log("PID: #{project.id}: -> #{output}")
if status.zero?
true
else
log("Failed to create satellite for #{project.name_with_namespace}")
false
end
end
def exists?
File.exists? path
end
# * Locks the satellite
# * Changes the current directory to the satellite's working dir
# * Yields
def lock
project.ensure_satellite_exists
File.open(lock_file, "w+") do |f|
begin
f.flock File::LOCK_EX
yield
ensure
f.flock File::LOCK_UN
end
end
end
def lock_file
create_locks_dir unless File.exists?(lock_files_dir)
File.join(lock_files_dir, "satellite_#{project.id}.lock")
end
def path
File.join(Gitlab.config.satellites.path, project.path_with_namespace)
end
def repo
project.ensure_satellite_exists
@repo ||= Grit::Repo.new(path)
end
def destroy
FileUtils.rm_rf(path)
end
private
# Clear the working directory
def clear_working_dir!
repo.git.reset(hard: true)
repo.git.clean(f: true, d: true, x: true)
end
# Deletes all branches except the parking branch
#
# This ensures we have no name clashes or issues updating branches when
# working with the satellite.
def delete_heads!
heads = repo.heads.map(&:name)
# update or create the parking branch
if heads.include? PARKING_BRANCH
repo.git.checkout({}, PARKING_BRANCH)
else
repo.git.checkout(default_options({b: true}), PARKING_BRANCH)
end
# remove the parking branch from the list of heads ...
heads.delete(PARKING_BRANCH)
# ... and delete all others
heads.each { |head| repo.git.branch(default_options({D: true}), head) }
end
# Deletes all remotes except origin
#
# This ensures we have no remote name clashes or issues updating branches when
# working with the satellite.
def remove_remotes!
remotes = repo.git.remote.split(' ')
remotes.delete('origin')
remotes.each { |name| repo.git.remote(default_options,'rm', name)}
end
# Updates the satellite from bare repo
#
# Note: this will only update remote branches (i.e. origin/*)
def update_from_source!
repo.git.remote(default_options, 'set-url', :origin, project.repository.path_to_repo)
repo.git.fetch(default_options, :origin)
end
def default_options(options = {})
{raise: true, timeout: true}.merge(options)
end
# Create directory for storing
# satellites lock files
def create_locks_dir
FileUtils.mkdir_p(lock_files_dir)
end
def lock_files_dir
@lock_files_dir ||= File.join(Gitlab.config.satellites.path, "tmp")
end
end
end
end
| yulchitaj/TEST3 | lib/gitlab/satellite/satellite.rb | Ruby | mit | 3,762 |
Veewee::Definition.declare({
:cpu_count => '1', :memory_size=> '384',
:disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
:os_type_id => 'Ubuntu',
:iso_file => "ubuntu-11.04-server-i386.iso",
:iso_src => "http://releases.ubuntu.com/11.04/ubuntu-11.04-server-i386.iso",
:iso_md5 => "b1a479c6593a90029414d201cb83a9cc",
:iso_download_timeout => "1000",
:boot_wait => "10", :boot_cmd_sequence => [
'<Esc><Esc><Enter>',
'/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
'hostname=%NAME% ',
'fb=false debconf/frontend=noninteractive ',
'keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
'initrd=/install/initrd.gz -- <Enter>'
],
:kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "preseed.cfg",
:ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
:ssh_host_port => "7222", :ssh_guest_port => "22",
:sudo_cmd => "echo '%p'|sudo -S sh '%f'",
:shutdown_cmd => "shutdown -P now",
:postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
})
| github/veewee | templates/ubuntu-11.04-server-i386/definition.rb | Ruby | mit | 1,238 |
/**
* JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)
*
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
* @see http://github.com/garycourt/murmurhash-js
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
* @see http://sites.google.com/site/murmurhash/
*
* @param {string} key ASCII only
* @param {number} seed Positive integer only
* @return {number} 32-bit positive integer hash
*/
function murmurhash3_32_gc(key, seed) {
var remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i;
remainder = key.length & 3; // key.length % 4
bytes = key.length - remainder;
h1 = seed;
c1 = 0xcc9e2d51;
c2 = 0x1b873593;
i = 0;
while (i < bytes) {
k1 =
((key.charCodeAt(i) & 0xff)) |
((key.charCodeAt(++i) & 0xff) << 8) |
((key.charCodeAt(++i) & 0xff) << 16) |
((key.charCodeAt(++i) & 0xff) << 24);
++i;
k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;
k1 = (k1 << 15) | (k1 >>> 17);
k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;
h1 ^= k1;
h1 = (h1 << 13) | (h1 >>> 19);
h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;
h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));
}
k1 = 0;
switch (remainder) {
case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;
case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;
case 1: k1 ^= (key.charCodeAt(i) & 0xff);
k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;
k1 = (k1 << 15) | (k1 >>> 17);
k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;
h1 ^= k1;
}
h1 ^= key.length;
h1 ^= h1 >>> 16;
h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;
h1 ^= h1 >>> 13;
h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;
h1 ^= h1 >>> 16;
return h1 >>> 0;
}
if(typeof module !== "undefined") {
module.exports = murmurhash3_32_gc
} | oudalab/fajita | node_modules/plotly.js/node_modules/gl-contour2d/node_modules/glslify/node_modules/glslify-bundle/node_modules/murmurhash-js/murmurhash3_gc.js | JavaScript | mit | 2,091 |
// Copyright 2014 Joyent, Inc. All rights reserved.
var test = require('tape').test;
var bunyan = require('bunyan');
///--- Globals
var lib;
var Parser;
var LOG = bunyan.createLogger({name: 'ldapjs-test'});
///--- Tests
test('load library', function (t) {
lib = require('../../lib/');
Parser = lib.Parser;
t.ok(Parser);
t.end();
});
test('wrong protocol error', function (t) {
var p = new Parser({log: LOG});
p.once('error', function (err) {
t.ok(err);
t.end();
});
// Send some bogus data to incur an error
p.write(new Buffer([16, 1, 4]));
});
test('bad protocol op', function (t) {
var p = new Parser({log: LOG});
var message = new lib.LDAPMessage({
protocolOp: 254 // bogus (at least today)
});
p.once('error', function (err) {
t.ok(err);
t.ok(/not supported$/.test(err.message));
t.end();
});
p.write(message.toBer());
});
test('bad message structure', function (t) {
var p = new Parser({log: LOG});
// message with bogus structure
var message = new lib.LDAPMessage({
protocolOp: lib.LDAP_REQ_EXTENSION
});
message._toBer = function (writer) {
writer.writeBuffer(new Buffer([16, 1, 4]), 80);
return writer;
};
p.once('error', function (err) {
t.ok(err);
t.end();
});
p.write(message.toBer());
});
| mcavage/node-ldapjs | test/messages/parser.test.js | JavaScript | mit | 1,307 |
module.exports = [
[ 0x0300, 0x036F ], [ 0x0483, 0x0486 ], [ 0x0488, 0x0489 ],
[ 0x0591, 0x05BD ], [ 0x05BF, 0x05BF ], [ 0x05C1, 0x05C2 ],
[ 0x05C4, 0x05C5 ], [ 0x05C7, 0x05C7 ], [ 0x0600, 0x0603 ],
[ 0x0610, 0x0615 ], [ 0x064B, 0x065E ], [ 0x0670, 0x0670 ],
[ 0x06D6, 0x06E4 ], [ 0x06E7, 0x06E8 ], [ 0x06EA, 0x06ED ],
[ 0x070F, 0x070F ], [ 0x0711, 0x0711 ], [ 0x0730, 0x074A ],
[ 0x07A6, 0x07B0 ], [ 0x07EB, 0x07F3 ], [ 0x0901, 0x0902 ],
[ 0x093C, 0x093C ], [ 0x0941, 0x0948 ], [ 0x094D, 0x094D ],
[ 0x0951, 0x0954 ], [ 0x0962, 0x0963 ], [ 0x0981, 0x0981 ],
[ 0x09BC, 0x09BC ], [ 0x09C1, 0x09C4 ], [ 0x09CD, 0x09CD ],
[ 0x09E2, 0x09E3 ], [ 0x0A01, 0x0A02 ], [ 0x0A3C, 0x0A3C ],
[ 0x0A41, 0x0A42 ], [ 0x0A47, 0x0A48 ], [ 0x0A4B, 0x0A4D ],
[ 0x0A70, 0x0A71 ], [ 0x0A81, 0x0A82 ], [ 0x0ABC, 0x0ABC ],
[ 0x0AC1, 0x0AC5 ], [ 0x0AC7, 0x0AC8 ], [ 0x0ACD, 0x0ACD ],
[ 0x0AE2, 0x0AE3 ], [ 0x0B01, 0x0B01 ], [ 0x0B3C, 0x0B3C ],
[ 0x0B3F, 0x0B3F ], [ 0x0B41, 0x0B43 ], [ 0x0B4D, 0x0B4D ],
[ 0x0B56, 0x0B56 ], [ 0x0B82, 0x0B82 ], [ 0x0BC0, 0x0BC0 ],
[ 0x0BCD, 0x0BCD ], [ 0x0C3E, 0x0C40 ], [ 0x0C46, 0x0C48 ],
[ 0x0C4A, 0x0C4D ], [ 0x0C55, 0x0C56 ], [ 0x0CBC, 0x0CBC ],
[ 0x0CBF, 0x0CBF ], [ 0x0CC6, 0x0CC6 ], [ 0x0CCC, 0x0CCD ],
[ 0x0CE2, 0x0CE3 ], [ 0x0D41, 0x0D43 ], [ 0x0D4D, 0x0D4D ],
[ 0x0DCA, 0x0DCA ], [ 0x0DD2, 0x0DD4 ], [ 0x0DD6, 0x0DD6 ],
[ 0x0E31, 0x0E31 ], [ 0x0E34, 0x0E3A ], [ 0x0E47, 0x0E4E ],
[ 0x0EB1, 0x0EB1 ], [ 0x0EB4, 0x0EB9 ], [ 0x0EBB, 0x0EBC ],
[ 0x0EC8, 0x0ECD ], [ 0x0F18, 0x0F19 ], [ 0x0F35, 0x0F35 ],
[ 0x0F37, 0x0F37 ], [ 0x0F39, 0x0F39 ], [ 0x0F71, 0x0F7E ],
[ 0x0F80, 0x0F84 ], [ 0x0F86, 0x0F87 ], [ 0x0F90, 0x0F97 ],
[ 0x0F99, 0x0FBC ], [ 0x0FC6, 0x0FC6 ], [ 0x102D, 0x1030 ],
[ 0x1032, 0x1032 ], [ 0x1036, 0x1037 ], [ 0x1039, 0x1039 ],
[ 0x1058, 0x1059 ], [ 0x1160, 0x11FF ], [ 0x135F, 0x135F ],
[ 0x1712, 0x1714 ], [ 0x1732, 0x1734 ], [ 0x1752, 0x1753 ],
[ 0x1772, 0x1773 ], [ 0x17B4, 0x17B5 ], [ 0x17B7, 0x17BD ],
[ 0x17C6, 0x17C6 ], [ 0x17C9, 0x17D3 ], [ 0x17DD, 0x17DD ],
[ 0x180B, 0x180D ], [ 0x18A9, 0x18A9 ], [ 0x1920, 0x1922 ],
[ 0x1927, 0x1928 ], [ 0x1932, 0x1932 ], [ 0x1939, 0x193B ],
[ 0x1A17, 0x1A18 ], [ 0x1B00, 0x1B03 ], [ 0x1B34, 0x1B34 ],
[ 0x1B36, 0x1B3A ], [ 0x1B3C, 0x1B3C ], [ 0x1B42, 0x1B42 ],
[ 0x1B6B, 0x1B73 ], [ 0x1DC0, 0x1DCA ], [ 0x1DFE, 0x1DFF ],
[ 0x200B, 0x200F ], [ 0x202A, 0x202E ], [ 0x2060, 0x2063 ],
[ 0x206A, 0x206F ], [ 0x20D0, 0x20EF ], [ 0x302A, 0x302F ],
[ 0x3099, 0x309A ], [ 0xA806, 0xA806 ], [ 0xA80B, 0xA80B ],
[ 0xA825, 0xA826 ], [ 0xFB1E, 0xFB1E ], [ 0xFE00, 0xFE0F ],
[ 0xFE20, 0xFE23 ], [ 0xFEFF, 0xFEFF ], [ 0xFFF9, 0xFFFB ],
[ 0x10A01, 0x10A03 ], [ 0x10A05, 0x10A06 ], [ 0x10A0C, 0x10A0F ],
[ 0x10A38, 0x10A3A ], [ 0x10A3F, 0x10A3F ], [ 0x1D167, 0x1D169 ],
[ 0x1D173, 0x1D182 ], [ 0x1D185, 0x1D18B ], [ 0x1D1AA, 0x1D1AD ],
[ 0x1D242, 0x1D244 ], [ 0xE0001, 0xE0001 ], [ 0xE0020, 0xE007F ],
[ 0xE0100, 0xE01EF ]
]
| al1221/ghost-openshift | core/client/node_modules/ember-cli/node_modules/npm/node_modules/columnify/node_modules/wcwidth/combining.js | JavaScript | mit | 3,078 |
ace.define("ace/mode/mel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/mel_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./mel_highlight_rules").MELHighlightRules,u=e("./behaviour/cstyle").CstyleBehaviour,a=e("./folding/cstyle").FoldMode,f=function(){this.HighlightRules=o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(f,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/mel"}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/mel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{caseInsensitive:!0,token:"storage.type.mel",regex:"\\b(matrix|string|vector|float|int|void)\\b"},{caseInsensitive:!0,token:"support.function.mel",regex:"\\b((s(h(ow(ManipCtx|S(hadingGroupAttrEditor|electionInTitle)|H(idden|elp)|Window)|el(f(Button|TabLayout|Layout)|lField)|ading(GeometryRelCtx|Node|Connection|LightRelCtx))|y(s(tem|File)|mbol(Button|CheckBox))|nap(shot|Mode|2to2 |TogetherCtx|Key)|c(ulpt|ene(UIReplacement|Editor)|ale(BrushBrightness |Constraint|Key(Ctx)?)?|r(ipt(Node|Ctx|Table|edPanel(Type)?|Job|EditorInfo)|oll(Field|Layout))|mh)|t(itch(Surface(Points)?|AndExplodeShell )|a(ckTrace|rt(sWith |String ))|r(cmp|i(ng(ToStringArray |Array(Remove(Duplicates | )|C(ount |atenate )|ToString |Intersector))|p )|oke))|i(n(gleProfileBirailSurface)?|ze|gn|mplify)|o(u(nd(Control)?|rce)|ft(Mod(Ctx)?)?|rt)|u(perCtx|rface(S(haderList|ampler))?|b(st(itute(Geometry|AllString )?|ring)|d(M(irror|a(tchTopology|p(SewMove|Cut)))|iv(Crease|DisplaySmoothness)?|C(ollapse|leanTopology)|T(o(Blind|Poly)|ransferUVsToCache)|DuplicateAndConnect|EditUV|ListComponentConversion|AutoProjection)))|p(h(ere|rand)|otLight(PreviewPort)?|aceLocator|r(ing|eadSheetEditor))|e(t(s|MenuMode|Sta(te |rtupMessage|mpDensity )|NodeTypeFlag|ConstraintRestPosition |ToolTo|In(putDeviceMapping|finity)|D(ynamic|efaultShadingGroup|rivenKeyframe)|UITemplate|P(ar(ticleAttr|ent)|roject )|E(scapeCtx|dit(or|Ctx))|Key(Ctx|frame|Path)|F(ocus|luidAttr)|Attr(Mapping)?)|parator|ed|l(ect(Mode|ionConnection|Context|Type|edNodes|Pr(iority|ef)|Key(Ctx)?)?|LoadSettings)|archPathArray )|kin(Cluster|Percent)|q(uareSurface|rt)|w(itchTable|atchDisplayPort)|a(ve(Menu|Shelf|ToolSettings|I(nitialState|mage)|Pref(s|Objects)|Fluid|A(ttrPreset |llShelves))|mpleImage)|rtContext|mooth(step|Curve|TangentSurface))|h(sv_to_rgb|yp(ot|er(Graph|Shade|Panel))|i(tTest|de|lite)|ot(Box|key(Check)?)|ud(Button|Slider(Button)?)|e(lp(Line)?|adsUpDisplay|rmite)|wRe(nder(Load)?|flectionMap)|ard(enPointCurve|ware(RenderPanel)?))|n(o(nLinear|ise|de(Type|IconButton|Outliner|Preset)|rmal(ize |Constraint))|urbs(Boolean|S(elect|quare)|C(opyUVSet|ube)|To(Subdiv|Poly(gonsPref)?)|Plane|ViewDirectionVector )|ew(ton|PanelItems)|ame(space(Info)?|Command|Field))|c(h(oice|dir|eck(Box(Grp)?|DefaultRenderGlobals)|a(n(nelBox|geSubdiv(Region|ComponentDisplayLevel))|racter(Map|OutlineEditor)?))|y(cleCheck|linder)|tx(Completion|Traverse|EditMode|Abort)|irc(ularFillet|le)|o(s|n(str(uctionHistory|ain(Value)?)|nect(ionInfo|Control|Dynamic|Joint|Attr)|t(extInfo|rol)|dition|e|vert(SolidTx|Tessellation|Unit|FromOldLayers |Lightmap)|firmDialog)|py(SkinWeights|Key|Flexor|Array )|l(or(Slider(Grp|ButtonGrp)|Index(SliderGrp)?|Editor|AtPoint)?|umnLayout|lision)|arsenSubdivSelectionList|m(p(onentEditor|utePolysetVolume |actHairSystem )|mand(Port|Echo|Line)))|u(tKey|r(ve(MoveEPCtx|SketchCtx|CVCtx|Intersect|OnSurface|E(ditorCtx|PCtx)|AddPtCtx)?|rent(Ctx|Time(Ctx)?|Unit)))|p(GetSolverAttr|Button|S(olver(Types)?|e(t(SolverAttr|Edit)|am))|C(o(nstraint|llision)|ache)|Tool|P(anel|roperty))|eil|l(ip(Schedule(rOutliner)?|TrimBefore |Editor(CurrentTimeCtx)?)?|ose(Surface|Curve)|uster|ear(Cache)?|amp)|a(n(CreateManip|vas)|tch(Quiet)?|pitalizeString |mera(View)?)|r(oss(Product )?|eate(RenderLayer|MotionField |SubdivRegion|N(ode|ewShelf )|D(isplayLayer|rawCtx)|Editor))|md(Shell|FileOutput))|M(R(ender(ShadowData|Callback|Data|Util|View|Line(Array)?)|ampAttribute)|G(eometryData|lobal)|M(odelMessage|essage|a(nipData|t(erial|rix)))|BoundingBox|S(yntax|ceneMessage|t(atus|ring(Array)?)|imple|pace|elect(ion(Mask|List)|Info)|watchRender(Register|Base))|H(ardwareRenderer|WShaderSwatchGenerator)|NodeMessage|C(o(nditionMessage|lor(Array)?|m(putation|mand(Result|Message)))|ursor|loth(Material|S(ystem|olverRegister)|Con(straint|trol)|Triangle|Particle|Edge|Force)|allbackIdArray)|T(ypeId|ime(r(Message)?|Array)?|oolsInfo|esselationParams|r(imBoundaryArray|ansformationMatrix))|I(ntArray|t(Geometry|Mesh(Polygon|Edge|Vertex|FaceVertex)|S(urfaceCV|electionList)|CurveCV|Instancer|eratorType|D(ependency(Graph|Nodes)|ag)|Keyframe)|k(System|HandleGroup)|mage)|3dView|Object(SetMessage|Handle|Array)?|D(G(M(odifier|essage)|Context)|ynSwept(Triangle|Line)|istance|oubleArray|evice(State|Channel)|a(ta(Block|Handle)|g(M(odifier|essage)|Path(Array)?))|raw(Request(Queue)?|Info|Data|ProcedureBase))|U(serEventMessage|i(nt(Array|64Array)|Message))|P(o(int(Array)?|lyMessage)|lug(Array)?|rogressWindow|x(G(eometry(Iterator|Data)|lBuffer)|M(idiInputDevice|odelEditorCommand|anipContainer)|S(urfaceShape(UI)?|pringNode|electionContext)|HwShaderNode|Node|Co(ntext(Command)?|m(ponentShape|mand))|T(oolCommand|ransform(ationMatrix)?)|IkSolver(Node)?|3dModelView|ObjectSet|D(eformerNode|ata|ragAndDropBehavior)|PolyT(weakUVCommand|rg)|EmitterNode|F(i(eldNode|leTranslator)|luidEmitterNode)|LocatorNode))|E(ulerRotation|vent(Message)?)|ayatomr|Vector(Array)?|Quaternion|F(n(R(otateManip|eflectShader|adialField)|G(e(nericAttribute|ometry(Data|Filter))|ravityField)|M(otionPath|es(sageAttribute|h(Data)?)|a(nip3D|trix(Data|Attribute)))|B(l(innShader|endShapeDeformer)|ase)|S(caleManip|t(ateManip|ring(Data|ArrayData))|ingleIndexedComponent|ubd(Names|Data)?|p(hereData|otLight)|et|kinCluster)|HikEffector|N(on(ExtendedLight|AmbientLight)|u(rbs(Surface(Data)?|Curve(Data)?)|meric(Data|Attribute))|ewtonField)|C(haracter|ircleSweepManip|ompo(nent(ListData)?|undAttribute)|urveSegmentManip|lip|amera)|T(ypedAttribute|oggleManip|urbulenceField|r(ipleIndexedComponent|ansform))|I(ntArrayData|k(Solver|Handle|Joint|Effector))|D(ynSweptGeometryData|i(s(cManip|tanceManip)|rection(Manip|alLight))|ouble(IndexedComponent|ArrayData)|ependencyNode|a(ta|gNode)|ragField)|U(ni(tAttribute|formField)|Int64ArrayData)|P(hong(Shader|EShader)|oint(On(SurfaceManip|CurveManip)|Light|ArrayData)|fxGeometry|lugin(Data)?|arti(cleSystem|tion))|E(numAttribute|xpression)|V(o(lume(Light|AxisField)|rtexField)|ectorArrayData)|KeyframeDelta(Move|B(lockAddRemove|reakdown)|Scale|Tangent|InfType|Weighted|AddRemove)?|F(ield|luid|reePointTriadManip)|W(ireDeformer|eightGeometryFilter)|L(ight(DataAttribute)?|a(yeredShader|ttice(D(eformer|ata))?|mbertShader))|A(ni(sotropyShader|mCurve)|ttribute|irField|r(eaLight|rayAttrsData)|mbientLight))?|ile(IO|Object)|eedbackLine|loat(Matrix|Point(Array)?|Vector(Array)?|Array))|L(i(ghtLinks|brary)|ockMessage)|A(n(im(Message|C(ontrol|urveC(hange|lipboard(Item(Array)?)?))|Util)|gle)|ttribute(Spec(Array)?|Index)|r(rayData(Builder|Handle)|g(Database|Parser|List))))|t(hreePointArcCtx|ime(Control|Port|rX)|o(ol(Button|HasOptions|Collection|Dropped|PropertyWindow)|NativePath |upper|kenize(List )?|l(ower|erance)|rus|ggle(WindowVisibility|Axis)?)|u(rbulence|mble(Ctx)?)|ex(RotateContext|M(oveContext|anipContext)|t(ScrollList|Curves|ure(HairColor |DisplacePlane |PlacementContext|Window)|ToShelf |Field(Grp|ButtonGrp)?)?|S(caleContext|electContext|mudgeUVContext)|WinToolCtx)|woPointArcCtx|a(n(gentConstraint)?|bLayout)|r(im|unc(ate(HairCache|FluidCache))?|a(ns(formLimits|lator)|c(e|k(Ctx)?))))|i(s(olateSelect|Connected|True|Dirty|ParentOf |Valid(String |ObjectName |UiName )|AnimCurve )|n(s(tance(r)?|ert(Joint(Ctx)?|K(not(Surface|Curve)|eyCtx)))|heritTransform|t(S(crollBar|lider(Grp)?)|er(sect|nalVar|ToUI )|Field(Grp)?))|conText(Radio(Button|Collection)|Button|StaticLabel|CheckBox)|temFilter(Render|Type|Attr)?|prEngine|k(S(ystem(Info)?|olver|plineHandleCtx)|Handle(Ctx|DisplayScale)?|fkDisplayMethod)|m(portComposerCurves |fPlugins|age))|o(ceanNurbsPreviewPlane |utliner(Panel|Editor)|p(tion(Menu(Grp)?|Var)|en(GLExtension|MayaPref))|verrideModifier|ffset(Surface|Curve(OnSurface)?)|r(ientConstraint|bit(Ctx)?)|b(soleteProc |j(ect(Center|Type(UI)?|Layer )|Exists)))|d(yn(RelEd(itor|Panel)|Globals|C(ontrol|ache)|P(a(intEditor|rticleCtx)|ref)|Exp(ort|ression)|amicLoad)|i(s(connect(Joint|Attr)|tanceDim(Context|ension)|pla(y(RGBColor|S(tats|urface|moothness)|C(olor|ull)|Pref|LevelOfDetail|Affected)|cementToPoly)|kCache|able)|r(name |ect(ionalLight|KeyCtx)|map)|mWhen)|o(cServer|Blur|t(Product )?|ubleProfileBirailSurface|peSheetEditor|lly(Ctx)?)|uplicate(Surface|Curve)?|e(tach(Surface|Curve|DeviceAttr)|vice(Panel|Editor)|f(ine(DataServer|VirtualDevice)|ormer|ault(Navigation|LightListCheckBox))|l(ete(Sh(elfTab |adingGroupsAndMaterials )|U(nusedBrushes |I)|Attr)?|randstr)|g_to_rad)|agPose|r(opoffLocator|ag(gerContext)?)|g(timer|dirty|Info|eval))|CBG |u(serCtx|n(t(angleUV|rim)|i(t|form)|do(Info)?|loadPlugin|assignInputDevice|group)|iTemplate|p(dateAE |Axis)|v(Snapshot|Link))|joint(C(tx|luster)|DisplayScale|Lattice)?|p(sd(ChannelOutliner|TextureFile|E(ditTextureFile|xport))|close|i(c(ture|kWalk)|xelMove)|o(se|int(MatrixMult |C(onstraint|urveConstraint)|On(Surface|Curve)|Position|Light)|p(upMenu|en)|w|l(y(Reduce|GeoSampler|M(irrorFace|ove(UV|Edge|Vertex|Facet(UV)?)|erge(UV|Edge(Ctx)?|Vertex|Facet(Ctx)?)|ap(Sew(Move)?|Cut|Del))|B(oolOp|evel|l(indData|endColor))|S(traightenUVBorder|oftEdge|u(perCtx|bdivide(Edge|Facet))|p(her(icalProjection|e)|lit(Ring|Ctx|Edge|Vertex)?)|e(tToFaceNormal|parate|wEdge|lect(Constraint(Monitor)?|EditCtx))|mooth)|Normal(izeUV|PerVertex)?|C(hipOff|ylind(er|ricalProjection)|o(ne|pyUV|l(or(BlindData|Set|PerVertex)|lapse(Edge|Facet)))|u(t(Ctx)?|be)|l(ipboard|oseBorder)|acheMonitor|rea(seEdge|teFacet(Ctx)?))|T(o(Subdiv|rus)|r(iangulate|ansfer))|In(stallAction|fo)|Options|D(uplicate(Edge|AndConnect)|el(Edge|Vertex|Facet))|U(nite|VSet)|P(yramid|oke|lan(e|arProjection)|r(ism|ojection))|E(ditUV|valuate|xtrude(Edge|Facet))|Qu(eryBlindData|ad)|F(orceUV|lip(UV|Edge))|WedgeFace|L(istComponentConversion|ayoutUV)|A(utoProjection|ppend(Vertex|FacetCtx)?|verage(Normal|Vertex)))|eVectorConstraint))|utenv|er(cent|formanceOptions)|fxstrokes|wd|l(uginInfo|a(y(b(last|ackOptions))?|n(e|arSrf)))|a(steKey|ne(l(History|Configuration)?|Layout)|thAnimation|irBlend|use|lettePort|r(ti(cle(RenderInfo|Instancer|Exists)?|tion)|ent(Constraint)?|am(Dim(Context|ension)|Locator)))|r(int|o(j(ect(ion(Manip|Context)|Curve|Tangent)|FileViewer)|pMo(dCtx|ve)|gress(Bar|Window)|mptDialog)|eloadRefEd))|e(n(codeString|d(sWith |String )|v|ableDevice)|dit(RenderLayer(Globals|Members)|or(Template)?|DisplayLayer(Globals|Members)|AttrLimits )|v(ent|al(Deferred|Echo)?)|quivalent(Tol | )|ffector|r(f|ror)|x(clusiveLightCheckBox|t(end(Surface|Curve)|rude)|ists|p(ortComposerCurves |ression(EditorListen)?)?|ec(uteForEachObject )?|actWorldBoundingBox)|mit(ter)?)|v(i(sor|ew(Set|HeadOn|2dToolCtx|C(lipPlane|amera)|Place|Fit|LookAt))|o(lumeAxis|rtex)|e(ctorize|rifyCmd )|alidateShelfName )|key(Tangent|frame(Region(MoveKeyCtx|S(caleKeyCtx|e(tKeyCtx|lectKeyCtx))|CurrentTimeCtx|TrackCtx|InsertKeyCtx|D(irectKeyCtx|ollyCtx))|Stats|Outliner)?)|qu(it|erySubdiv)|f(c(heck|lose)|i(nd(RelatedSkinCluster |MenuItem |er|Keyframe|AllIntersections )|tBspline|l(ter(StudioImport|Curve|Expand)?|e(BrowserDialog|test|Info|Dialog|Extension )?|letCurve)|rstParentOf )|o(ntDialog|pen|rmLayout)|print|eof|flush|write|l(o(or|w|at(S(crollBar|lider(Grp|ButtonGrp|2)?)|Eq |Field(Grp)?))|u(shUndo|id(CacheInfo|Emitter|VoxelInfo))|exor)|r(omNativePath |e(eFormFillet|wind|ad)|ameLayout)|get(word|line)|mod)|w(hatIs|i(ndow(Pref)?|re(Context)?)|orkspace|ebBrowser(Prefs)?|a(itCursor|rning)|ri(nkle(Context)?|teTake))|l(s(T(hroughFilter|ype )|UI)?|i(st(Relatives|MenuAnnotation |Sets|History|NodeTypes|C(onnections|ameras)|Transforms |InputDevice(s|Buttons|Axes)|erEditor|DeviceAttachments|Unselected |A(nimatable|ttr))|n(step|eIntersection )|ght(link|List(Panel|Editor)?))|o(ckNode|okThru|ft|ad(NewShelf |P(lugin|refObjects)|Fluid)|g)|a(ssoContext|y(out|er(Button|ed(ShaderPort|TexturePort)))|ttice(DeformKeyCtx)?|unch(ImageEditor)?))|a(ssign(Command|InputDevice)|n(notate|im(C(one|urveEditor)|Display|View)|gle(Between)?)|tt(ach(Surface|Curve|DeviceAttr)|r(ibute(Menu|Info|Exists|Query)|NavigationControlGrp|Co(ntrolGrp|lorSliderGrp|mpatibility)|PresetEditWin|EnumOptionMenu(Grp)?|Field(Grp|SliderGrp)))|i(r|mConstraint)|d(d(NewShelfTab|Dynamic|PP|Attr(ibuteEditorNodeHelp)?)|vanceToNextDrivenKey)|uto(Place|Keyframe)|pp(endStringArray|l(y(Take|AttrPreset)|icationName))|ffect(s|edNet)|l(i(as(Attr)?|gn(Surface|C(tx|urve))?)|lViewFit)|r(c(len|Len(DimContext|gthDimension))|t(BuildPaintMenu|Se(tPaintCtx|lectCtx)|3dPaintCtx|UserPaintCtx|PuttyCtx|FluidAttrCtx|Attr(SkinPaintCtx|Ctx|PaintVertexCtx))|rayMapper)|mbientLight|b(s|out))|r(igid(Body|Solver)|o(t(at(ionInterpolation|e))?|otOf |undConstantRadius|w(ColumnLayout|Layout)|ll(Ctx)?)|un(up|TimeCommand)|e(s(olutionNode|et(Tool|AE )|ampleFluid)|hash|n(der(GlobalsNode|Manip|ThumbnailUpdate|Info|er|Partition|QualityNode|Window(SelectContext|Editor)|LayerButton)?|ame(SelectionList |UI|Attr)?)|cord(Device|Attr)|target|order(Deformers)?|do|v(olve|erse(Surface|Curve))|quires|f(ineSubdivSelectionList|erence(Edit|Query)?|resh(AE )?)|loadImage|adTake|root|move(MultiInstance|Joint)|build(Surface|Curve))|a(n(d(state|omizeFollicles )?|geControl)|d(i(o(MenuItemCollection|Button(Grp)?|Collection)|al)|_to_deg)|mpColorPort)|gb_to_hsv)|g(o(toBindPose |al)|e(t(M(odifiers|ayaPanelTypes )|Classification|InputDeviceRange|pid|env|DefaultBrush|Pa(nel|rticleAttr)|F(ileList|luidAttr)|A(ttr|pplicationVersionAsFloat ))|ometryConstraint)|l(Render(Editor)?|obalStitch)|a(uss|mma)|r(id(Layout)?|oup(ObjectsByName )?|a(dientControl(NoAttr)?|ph(SelectContext|TrackCtx|DollyCtx)|vity|bColor))|match)|x(pmPicker|form|bmLangPathList )|m(i(n(imizeApp)?|rrorJoint)|o(del(CurrentTimeCtx|Panel|Editor)|use|v(In|e(IKtoFK |VertexAlongDirection|KeyCtx)?|Out))|u(te|ltiProfileBirailSurface)|e(ssageLine|nu(BarLayout|Item(ToShelf )?|Editor)?|mory)|a(nip(Rotate(Context|LimitsCtx)|Move(Context|LimitsCtx)|Scale(Context|LimitsCtx)|Options)|tch|ke(Roll |SingleSurface|TubeOn |Identity|Paintable|bot|Live)|rker|g|x))|b(in(Membership|d(Skin|Pose))|o(neLattice|undary|x(ZoomCtx|DollyCtx))|u(tton(Manip)?|ild(BookmarkMenu|KeyframeMenu)|fferCurve)|e(ssel|vel(Plus)?)|l(indDataType|end(Shape(Panel|Editor)?|2|TwoAttr))|a(sename(Ex | )|tchRender|ke(Results|Simulation|Clip|PartialHistory|FluidShading )))))\\b"},{caseInsensitive:!0,token:"support.constant.mel",regex:"\\b(s(h(ellTessellate|a(d(ing(Map|Engine)|erGlow)|pe))|n(ow|apshot(Shape)?)|c(ulpt|aleConstraint|ript)|t(yleCurve|itch(Srf|AsNurbsShell)|u(cco|dioClearCoat)|encil|roke(Globals)?)|i(ngleShadingSwitch|mpleVolumeShader)|o(ftMod(Manip|Handle)?|lidFractal)|u(rface(Sha(der|pe)|Info|EdManip|VarGroup|Luminance)|b(Surface|d(M(odifier(UV|World)?|ap(SewMove|Cut|pingManip))|B(lindData|ase)|iv(ReverseFaces|SurfaceVarGroup|Co(llapse|mponentId)|To(Nurbs|Poly))?|HierBlind|CleanTopology|Tweak(UV)?|P(lanarProj|rojManip)|LayoutUV|A(ddTopology|utoProj))|Curve))|p(BirailSrf|otLight|ring)|e(tRange|lectionListOperator)|k(inCluster|etchPlane)|quareSrf|ampler(Info)?|m(ooth(Curve|TangentSrf)|ear))|h(svToRgb|yper(GraphInfo|View|Layout)|ik(Solver|Handle|Effector)|oldMatrix|eightField|w(Re(nderGlobals|flectionMap)|Shader)|a(ir(System|Constraint|TubeShader)|rd(enPoint|wareRenderGlobals)))|n(o(n(ExtendedLightShapeNode|Linear|AmbientLightShapeNode)|ise|rmalConstraint)|urbs(Surface|Curve|T(oSubdiv(Proc)?|essellate)|DimShape)|e(twork|wtonField))|c(h(o(ice|oser)|ecker|aracter(Map|Offset)?)|o(n(straint|tr(olPoint|ast)|dition)|py(ColorSet|UVSet))|urve(Range|Shape|Normalizer(Linear|Angle)?|In(tersect|fo)|VarGroup|From(Mesh(CoM|Edge)?|Su(rface(Bnd|CoS|Iso)?|bdiv(Edge|Face)?)))|l(ip(Scheduler|Library)|o(se(stPointOnSurface|Surface|Curve)|th|ud)|uster(Handle)?|amp)|amera(View)?|r(eate(BPManip|ColorSet|UVSet)|ater))|t(ime(ToUnitConversion|Function)?|oo(nLineAttributes|lDrawManip)|urbulenceField|ex(BaseDeformManip|ture(BakeSet|2d|ToGeom|3d|Env)|SmudgeUVManip|LatticeDeformManip)|weak|angentConstraint|r(i(pleShadingSwitch|m(WithBoundaries)?)|ansform(Geometry)?))|i(n(s(tancer|ertKnot(Surface|Curve))|tersectSurface)|k(RPsolver|MCsolver|S(ystem|olver|Csolver|plineSolver)|Handle|PASolver|Effector)|m(plicit(Box|Sphere|Cone)|agePlane))|o(cean(Shader)?|pticalFX|ffset(Surface|C(os|urve))|ldBlindDataBase|rient(Constraint|ationMarker)|bject(RenderFilter|MultiFilter|BinFilter|S(criptFilter|et)|NameFilter|TypeFilter|Filter|AttrFilter))|d(yn(Globals|Base)|i(s(tance(Between|DimShape)|pla(yLayer(Manager)?|cementShader)|kCache)|rect(ionalLight|edDisc)|mensionShape)|o(ubleShadingSwitch|f)|pBirailSrf|e(tach(Surface|Curve)|pendNode|f(orm(Bend|S(ine|quash)|Twist|ableShape|F(unc|lare)|Wave)|ault(RenderUtilityList|ShaderList|TextureList|LightList))|lete(Co(lorSet|mponent)|UVSet))|ag(Node|Pose)|r(opoffLocator|agField))|u(seBackground|n(trim|i(t(Conversion|ToTimeConversion)|formField)|known(Transform|Dag)?)|vChooser)|j(iggle|oint(Cluster|Ffd|Lattice)?)|p(sdFileTex|hong(E)?|o(s(tProcessList|itionMarker)|int(MatrixMult|Constraint|On(SurfaceInfo|CurveInfo)|Emitter|Light)|l(y(Reduce|M(irror|o(difier(UV|World)?|ve(UV|Edge|Vertex|Face(tUV)?))|erge(UV|Edge|Vert|Face)|ap(Sew(Move)?|Cut|Del))|B(oolOp|evel|lindData|ase)|S(traightenUVBorder|oftEdge|ubd(Edge|Face)|p(h(ere|Proj)|lit(Ring|Edge|Vert)?)|e(parate|wEdge)|mooth(Proxy|Face)?)|Normal(izeUV|PerVertex)?|C(hipOff|yl(inder|Proj)|o(ne|pyUV|l(orPerVertex|lapse(Edge|F)))|u(t(Manip(Container)?)?|be)|loseBorder|rea(seEdge|t(or|eFace)))|T(o(Subdiv|rus)|weak(UV)?|r(iangulate|ansfer))|OptUvs|D(uplicateEdge|el(Edge|Vertex|Facet))|Unite|P(yramid|oke(Manip)?|lan(e|arProj)|r(i(sm|mitive)|oj))|Extrude(Edge|Vertex|Face)|VertexNormalManip|Quad|Flip(UV|Edge)|WedgeFace|LayoutUV|A(utoProj|ppend(Vertex)?|verageVertex))|eVectorConstraint))|fx(Geometry|Hair|Toon)|l(usMinusAverage|a(n(e|arTrimSurface)|ce(2dTexture|3dTexture)))|a(ssMatrix|irBlend|r(ti(cle(SamplerInfo|C(olorMapper|loud)|TranspMapper|IncandMapper|AgeMapper)?|tion)|ent(Constraint|Tessellate)|amDimension))|r(imitive|o(ject(ion|Curve|Tangent)|xyManager)))|e(n(tity|v(Ball|ironmentFog|S(phere|ky)|C(hrome|ube)|Fog))|x(t(end(Surface|Curve)|rude)|p(lodeNurbsShell|ression)))|v(iewManip|o(lume(Shader|Noise|Fog|Light|AxisField)|rtexField)|e(ctor(RenderGlobals|Product)|rtexBakeSet))|quadShadingSwitch|f(i(tBspline|eld|l(ter(Resample|Simplify|ClosestSample|Euler)?|e|letCurve))|o(urByFourMatrix|llicle)|urPointOn(MeshInfo|Subd)|f(BlendSrf(Obsolete)?|d|FilletSrf)|l(ow|uid(S(hape|liceManip)|Texture(2D|3D)|Emitter)|exorShape)|ra(ctal|meCache))|w(tAddMatrix|ire|ood|eightGeometryFilter|ater|rap)|l(ight(Info|Fog|Li(st|nker))?|o(cator|okAt|d(Group|Thresholds)|ft)|uminance|ea(stSquaresModifier|ther)|a(yered(Shader|Texture)|ttice|mbert))|a(n(notationShape|i(sotropic|m(Blend(InOut)?|C(urve(T(T|U|L|A)|U(T|U|L|A))?|lip)))|gleBetween)|tt(ach(Surface|Curve)|rHierarchyTest)|i(rField|mConstraint)|dd(Matrix|DoubleLinear)|udio|vg(SurfacePoints|NurbsSurfacePoints|Curves)|lign(Manip|Surface|Curve)|r(cLengthDimension|tAttrPaintTest|eaLight|rayMapper)|mbientLight|bstractBase(NurbsConversion|Create))|r(igid(Body|Solver|Constraint)|o(ck|undConstantRadius)|e(s(olution|ultCurve(TimeTo(Time|Unitless|Linear|Angular))?)|nder(Rect|Globals(List)?|Box|Sphere|Cone|Quality|L(ight|ayer(Manager)?))|cord|v(olve(dPrimitive)?|erse(Surface|Curve)?)|f(erence|lect)|map(Hsv|Color|Value)|build(Surface|Curve))|a(dialField|mp(Shader)?)|gbToHsv|bfSrf)|g(uide|eo(Connect(or|able)|metry(Shape|Constraint|VarGroup|Filter))|lobal(Stitch|CacheControl)|ammaCorrect|r(id|oup(Id|Parts)|a(nite|vityField)))|Fur(Globals|Description|Feedback|Attractors)|xformManip|m(o(tionPath|untain|vie)|u(te|lt(Matrix|i(plyDivide|listerLight)|DoubleLinear))|pBirailSrf|e(sh(VarGroup)?|ntalray(Texture|IblShape))|a(terialInfo|ke(Group|Nurb(sSquare|Sphere|C(ylinder|ircle|one|ube)|Torus|Plane)|CircularArc|T(hreePointCircularArc|extCurves|woPointCircularArc))|rble))|b(irailSrf|o(neLattice|olean|undary(Base)?)|u(lge|mp(2d|3d))|evel(Plus)?|l(in(n|dDataTemplate)|end(Shape|Color(s|Sets)|TwoAttr|Device|Weighted)?)|a(se(GeometryVarGroup|ShadingSwitch|Lattice)|keSet)|r(ownian|ush)))\\b"},{caseInsensitive:!0,token:"keyword.control.mel",regex:"\\b(if|in|else|for|while|break|continue|case|default|do|switch|return|switch|case|source|catch|alias)\\b"},{token:"keyword.other.mel",regex:"\\b(global)\\b"},{caseInsensitive:!0,token:"constant.language.mel",regex:"\\b(null|undefined)\\b"},{token:"constant.numeric.mel",regex:"\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b"},{token:"punctuation.definition.string.begin.mel",regex:'"',push:[{token:"constant.character.escape.mel",regex:"\\\\."},{token:"punctuation.definition.string.end.mel",regex:'"',next:"pop"},{defaultToken:"string.quoted.double.mel"}]},{token:["variable.other.mel","punctuation.definition.variable.mel"],regex:"(\\$)([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*?\\b)"},{token:"punctuation.definition.string.begin.mel",regex:"'",push:[{token:"constant.character.escape.mel",regex:"\\\\."},{token:"punctuation.definition.string.end.mel",regex:"'",next:"pop"},{defaultToken:"string.quoted.single.mel"}]},{token:"constant.language.mel",regex:"\\b(false|true|yes|no|on|off)\\b"},{token:"punctuation.definition.comment.mel",regex:"/\\*",push:[{token:"punctuation.definition.comment.mel",regex:"\\*/",next:"pop"},{defaultToken:"comment.block.mel"}]},{token:["comment.line.double-slash.mel","punctuation.definition.comment.mel"],regex:"(//)(.*$\\n?)"},{caseInsensitive:!0,token:"keyword.operator.mel",regex:"\\b(instanceof)\\b"},{token:"keyword.operator.symbolic.mel",regex:"[-\\!\\%\\&\\*\\+\\=\\/\\?\\:]"},{token:["meta.preprocessor.mel","punctuation.definition.preprocessor.mel"],regex:"(^[ \\t]*)((?:#)[a-zA-Z]+)"},{token:["meta.function.mel","keyword.other.mel","storage.type.mel","entity.name.function.mel","punctuation.section.function.mel"],regex:"((?:global\\s*)?proc)\\s*(\\w+\\s*\\[?\\]?\\s+|\\s+)([A-Za-z_][A-Za-z0-9_\\.]*)(\\s*(\\())",push:[{include:"$self"},{token:"punctuation.section.function.mel",regex:"\\)",next:"pop"},{defaultToken:"meta.function.mel"}]}]},this.normalizeRules()};r.inherits(s,i),t.MELHighlightRules=s}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.id,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var p=r.getTokens(o.start.row),d=0,v,m=-1;for(var g=0;g<p.length;g++){v=p[g],v.type=="string"?m=-1:m<0&&(m=v.value.indexOf(s));if(v.value.length+d>o.start.column)break;d+=p[g].value.length}if(!v||m<0&&v.type!=="comment"&&(v.type!=="string"||o.start.column!==v.value.length+d-1&&v.value.lastIndexOf(s)===v.value.length-1)){if(!h.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(v&&v.type==="string"){var y=f.substring(a.column,a.column+1);if(y==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n),s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)}}.call(o.prototype)}) | js-data/cdnjs | ajax/libs/ace/1.1.3/mode-mel.js | JavaScript | mit | 30,620 |
// subkit.js - 1.0.19
// https://github.com/subkit
// Copyright 2012 - 2014 http://subkit.io
// MIT License
!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.Subkit=a():"undefined"!=typeof global?global.Subkit=a():"undefined"!=typeof self&&(self.Subkit=a())}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){var c=b.exports={};c.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};if(b){var c=[];return window.addEventListener("message",function(a){var b=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){var d=c.shift();d()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}return function(a){setTimeout(a,0)}}(),c.title="browser",c.browser=!0,c.env={},c.argv=[],c.binding=function(){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(){throw new Error("process.chdir is not supported")}},{}],2:[function(b,c,d){var e=b("__browserify_process");!function(b){if("function"==typeof bootstrap)bootstrap("promise",b);else if("object"==typeof d)c.exports=b();else if("function"==typeof a&&a.amd)a(b);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=b}else Q=b()}(function(){"use strict";function a(a){return function(){return W.apply(a,arguments)}}function b(a){return a===Object(a)}function c(a){return"[object StopIteration]"===cb(a)||a instanceof S}function d(a,b){if(P&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(db)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+db+"\n");a.stack=f(e)}}function f(a){for(var b=a.split("\n"),c=[],d=0;d<b.length;++d){var e=b[d];i(e)||g(e)||!e||c.push(e)}return c.join("\n")}function g(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===R&&d>=T&&hb>=d}function j(){if(P)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return R=d[0],d[1]}}function k(a,b,c){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(b+" is deprecated, use "+c+" instead.",new Error("").stack),a.apply(a,arguments)}}function l(a){return s(a)?a:t(a)?C(a):B(a)}function m(){function a(a){b=a,f.source=a,Y(c,function(b,c){V(function(){a.promiseDispatch.apply(a,c)})},void 0),c=void 0,d=void 0}var b,c=[],d=[],e=_(m.prototype),f=_(p.prototype);if(f.promiseDispatch=function(a,e,f){var g=X(arguments);c?(c.push(g),"when"===e&&f[1]&&d.push(f[1])):V(function(){b.promiseDispatch.apply(b,g)})},f.valueOf=function(){if(c)return f;var a=r(b);return s(a)&&(b=a),a},f.inspect=function(){return b?b.inspect():{state:"pending"}},l.longStackSupport&&P)try{throw new Error}catch(g){f.stack=g.stack.substring(g.stack.indexOf("\n")+1)}return e.promise=f,e.resolve=function(c){b||a(l(c))},e.fulfill=function(c){b||a(B(c))},e.reject=function(c){b||a(A(c))},e.notify=function(a){b||Y(d,function(b,c){V(function(){c(a)})},void 0)},e}function n(a){if("function"!=typeof a)throw new TypeError("resolver must be a function.");var b=m();try{a(b.resolve,b.reject,b.notify)}catch(c){b.reject(c)}return b.promise}function o(a){return n(function(b,c){for(var d=0,e=a.length;e>d;d++)l(a[d]).then(b,c)})}function p(a,b,c){void 0===b&&(b=function(a){return A(new Error("Promise does not support operation: "+a))}),void 0===c&&(c=function(){return{state:"unknown"}});var d=_(p.prototype);if(d.promiseDispatch=function(c,e,f){var g;try{g=a[e]?a[e].apply(d,f):b.call(d,e,f)}catch(h){g=A(h)}c&&c(g)},d.inspect=c,c){var e=c();"rejected"===e.state&&(d.exception=e.reason),d.valueOf=function(){var a=c();return"pending"===a.state||"rejected"===a.state?d:a.value}}return d}function q(a,b,c,d){return l(a).then(b,c,d)}function r(a){if(s(a)){var b=a.inspect();if("fulfilled"===b.state)return b.value}return a}function s(a){return b(a)&&"function"==typeof a.promiseDispatch&&"function"==typeof a.inspect}function t(a){return b(a)&&"function"==typeof a.then}function u(a){return s(a)&&"pending"===a.inspect().state}function v(a){return!s(a)||"fulfilled"===a.inspect().state}function w(a){return s(a)&&"rejected"===a.inspect().state}function x(){eb.length=0,fb.length=0,gb||(gb=!0)}function y(a,b){gb&&(fb.push(a),eb.push(b&&"undefined"!=typeof b.stack?b.stack:"(no stack) "+b))}function z(a){if(gb){var b=Z(fb,a);-1!==b&&(fb.splice(b,1),eb.splice(b,1))}}function A(a){var b=p({when:function(b){return b&&z(this),b?b(a):this}},function(){return this},function(){return{state:"rejected",reason:a}});return y(b,a),b}function B(a){return p({when:function(){return a},get:function(b){return a[b]},set:function(b,c){a[b]=c},"delete":function(b){delete a[b]},post:function(b,c){return null===b||void 0===b?a.apply(void 0,c):a[b].apply(a,c)},apply:function(b,c){return a.apply(b,c)},keys:function(){return bb(a)}},void 0,function(){return{state:"fulfilled",value:a}})}function C(a){var b=m();return V(function(){try{a.then(b.resolve,b.reject,b.notify)}catch(c){b.reject(c)}}),b.promise}function D(a){return p({isDef:function(){}},function(b,c){return J(a,b,c)},function(){return l(a).inspect()})}function E(a,b,c){return l(a).spread(b,c)}function F(a){return function(){function b(a,b){var g;if("undefined"==typeof StopIteration){try{g=d[a](b)}catch(h){return A(h)}return g.done?g.value:q(g.value,e,f)}try{g=d[a](b)}catch(h){return c(h)?h.value:A(h)}return q(g,e,f)}var d=a.apply(this,arguments),e=b.bind(b,"next"),f=b.bind(b,"throw");return e()}}function G(a){l.done(l.async(a)())}function H(a){throw new S(a)}function I(a){return function(){return E([this,K(arguments)],function(b,c){return a.apply(b,c)})}}function J(a,b,c){return l(a).dispatch(b,c)}function K(a){return q(a,function(a){var b=0,c=m();return Y(a,function(d,e,f){var g;s(e)&&"fulfilled"===(g=e.inspect()).state?a[f]=g.value:(++b,q(e,function(d){a[f]=d,0===--b&&c.resolve(a)},c.reject,function(a){c.notify({index:f,value:a})}))},void 0),0===b&&c.resolve(a),c.promise})}function L(a){return q(a,function(a){return a=$(a,l),q(K($(a,function(a){return q(a,U,U)})),function(){return a})})}function M(a){return l(a).allSettled()}function N(a,b){return l(a).then(void 0,void 0,b)}function O(a,b){return l(a).nodeify(b)}var P=!1;try{throw new Error}catch(Q){P=!!Q.stack}var R,S,T=j(),U=function(){},V=function(){function a(){for(;b.next;){b=b.next;var c=b.task;b.task=void 0;var e=b.domain;e&&(b.domain=void 0,e.enter());try{c()}catch(f){if(g)throw e&&e.exit(),setTimeout(a,0),e&&e.enter(),f;setTimeout(function(){throw f},0)}e&&e.exit()}d=!1}var b={task:void 0,next:null},c=b,d=!1,f=void 0,g=!1;if(V=function(a){c=c.next={task:a,domain:g&&e.domain,next:null},d||(d=!0,f())},"undefined"!=typeof e&&e.nextTick)g=!0,f=function(){e.nextTick(a)};else if("function"==typeof setImmediate)f="undefined"!=typeof window?setImmediate.bind(window,a):function(){setImmediate(a)};else if("undefined"!=typeof MessageChannel){var h=new MessageChannel;h.port1.onmessage=function(){f=i,h.port1.onmessage=a,a()};var i=function(){h.port2.postMessage(0)};f=function(){setTimeout(a,0),i()}}else f=function(){setTimeout(a,0)};return V}(),W=Function.call,X=a(Array.prototype.slice),Y=a(Array.prototype.reduce||function(a,b){var c=0,d=this.length;if(1===arguments.length)for(;;){if(c in this){b=this[c++];break}if(++c>=d)throw new TypeError}for(;d>c;c++)c in this&&(b=a(b,this[c],c));return b}),Z=a(Array.prototype.indexOf||function(a){for(var b=0;b<this.length;b++)if(this[b]===a)return b;return-1}),$=a(Array.prototype.map||function(a,b){var c=this,d=[];return Y(c,function(e,f,g){d.push(a.call(b,f,g,c))},void 0),d}),_=Object.create||function(a){function b(){}return b.prototype=a,new b},ab=a(Object.prototype.hasOwnProperty),bb=Object.keys||function(a){var b=[];for(var c in a)ab(a,c)&&b.push(c);return b},cb=a(Object.prototype.toString);S="undefined"!=typeof ReturnValue?ReturnValue:function(a){this.value=a};var db="From previous event:";l.resolve=l,l.nextTick=V,l.longStackSupport=!1,l.defer=m,m.prototype.makeNodeResolver=function(){var a=this;return function(b,c){b?a.reject(b):a.resolve(arguments.length>2?X(arguments,1):c)}},l.Promise=n,l.promise=n,n.race=o,n.all=K,n.reject=A,n.resolve=l,l.passByCopy=function(a){return a},p.prototype.passByCopy=function(){return this},l.join=function(a,b){return l(a).join(b)},p.prototype.join=function(a){return l([this,a]).spread(function(a,b){if(a===b)return a;throw new Error("Can't join: not the same: "+a+" "+b)})},l.race=o,p.prototype.race=function(){return this.then(l.race)},l.makePromise=p,p.prototype.toString=function(){return"[object Promise]"},p.prototype.then=function(a,b,c){function e(b){try{return"function"==typeof a?a(b):b}catch(c){return A(c)}}function f(a){if("function"==typeof b){d(a,h);try{return b(a)}catch(c){return A(c)}}return A(a)}function g(a){return"function"==typeof c?c(a):a}var h=this,i=m(),j=!1;return V(function(){h.promiseDispatch(function(a){j||(j=!0,i.resolve(e(a)))},"when",[function(a){j||(j=!0,i.resolve(f(a)))}])}),h.promiseDispatch(void 0,"when",[void 0,function(a){var b,c=!1;try{b=g(a)}catch(d){if(c=!0,!l.onerror)throw d;l.onerror(d)}c||i.notify(b)}]),i.promise},l.when=q,p.prototype.thenResolve=function(a){return this.then(function(){return a})},l.thenResolve=function(a,b){return l(a).thenResolve(b)},p.prototype.thenReject=function(a){return this.then(function(){throw a})},l.thenReject=function(a,b){return l(a).thenReject(b)},l.nearer=r,l.isPromise=s,l.isPromiseAlike=t,l.isPending=u,p.prototype.isPending=function(){return"pending"===this.inspect().state},l.isFulfilled=v,p.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},l.isRejected=w,p.prototype.isRejected=function(){return"rejected"===this.inspect().state};var eb=[],fb=[],gb=!0;l.resetUnhandledRejections=x,l.getUnhandledReasons=function(){return eb.slice()},l.stopUnhandledRejectionTracking=function(){x(),gb=!1},x(),l.reject=A,l.fulfill=B,l.master=D,l.spread=E,p.prototype.spread=function(a,b){return this.all().then(function(b){return a.apply(void 0,b)},b)},l.async=F,l.spawn=G,l["return"]=H,l.promised=I,l.dispatch=J,p.prototype.dispatch=function(a,b){var c=this,d=m();return V(function(){c.promiseDispatch(d.resolve,a,b)}),d.promise},l.get=function(a,b){return l(a).dispatch("get",[b])},p.prototype.get=function(a){return this.dispatch("get",[a])},l.set=function(a,b,c){return l(a).dispatch("set",[b,c])},p.prototype.set=function(a,b){return this.dispatch("set",[a,b])},l.del=l["delete"]=function(a,b){return l(a).dispatch("delete",[b])},p.prototype.del=p.prototype["delete"]=function(a){return this.dispatch("delete",[a])},l.mapply=l.post=function(a,b,c){return l(a).dispatch("post",[b,c])},p.prototype.mapply=p.prototype.post=function(a,b){return this.dispatch("post",[a,b])},l.send=l.mcall=l.invoke=function(a,b){return l(a).dispatch("post",[b,X(arguments,2)])},p.prototype.send=p.prototype.mcall=p.prototype.invoke=function(a){return this.dispatch("post",[a,X(arguments,1)])},l.fapply=function(a,b){return l(a).dispatch("apply",[void 0,b])},p.prototype.fapply=function(a){return this.dispatch("apply",[void 0,a])},l["try"]=l.fcall=function(a){return l(a).dispatch("apply",[void 0,X(arguments,1)])},p.prototype.fcall=function(){return this.dispatch("apply",[void 0,X(arguments)])},l.fbind=function(a){var b=l(a),c=X(arguments,1);return function(){return b.dispatch("apply",[this,c.concat(X(arguments))])}},p.prototype.fbind=function(){var a=this,b=X(arguments);return function(){return a.dispatch("apply",[this,b.concat(X(arguments))])}},l.keys=function(a){return l(a).dispatch("keys",[])},p.prototype.keys=function(){return this.dispatch("keys",[])},l.all=K,p.prototype.all=function(){return K(this)},l.allResolved=k(L,"allResolved","allSettled"),p.prototype.allResolved=function(){return L(this)},l.allSettled=M,p.prototype.allSettled=function(){return this.then(function(a){return K($(a,function(a){function b(){return a.inspect()}return a=l(a),a.then(b,b)}))})},l.fail=l["catch"]=function(a,b){return l(a).then(void 0,b)},p.prototype.fail=p.prototype["catch"]=function(a){return this.then(void 0,a)},l.progress=N,p.prototype.progress=function(a){return this.then(void 0,void 0,a)},l.fin=l["finally"]=function(a,b){return l(a)["finally"](b)},p.prototype.fin=p.prototype["finally"]=function(a){return a=l(a),this.then(function(b){return a.fcall().then(function(){return b})},function(b){return a.fcall().then(function(){throw b})})},l.done=function(a,b,c,d){return l(a).done(b,c,d)},p.prototype.done=function(a,b,c){var f=function(a){V(function(){if(d(a,g),!l.onerror)throw a;l.onerror(a)})},g=a||b||c?this.then(a,b,c):this;"object"==typeof e&&e&&e.domain&&(f=e.domain.bind(f)),g.then(void 0,f)},l.timeout=function(a,b,c){return l(a).timeout(b,c)},p.prototype.timeout=function(a,b){var c=m(),d=setTimeout(function(){c.reject(new Error(b||"Timed out after "+a+" ms"))},a);return this.then(function(a){clearTimeout(d),c.resolve(a)},function(a){clearTimeout(d),c.reject(a)},c.notify),c.promise},l.delay=function(a,b){return void 0===b&&(b=a,a=void 0),l(a).delay(b)},p.prototype.delay=function(a){return this.then(function(b){var c=m();return setTimeout(function(){c.resolve(b)},a),c.promise})},l.nfapply=function(a,b){return l(a).nfapply(b)},p.prototype.nfapply=function(a){var b=m(),c=X(a);return c.push(b.makeNodeResolver()),this.fapply(c).fail(b.reject),b.promise},l.nfcall=function(a){var b=X(arguments,1);return l(a).nfapply(b)},p.prototype.nfcall=function(){var a=X(arguments),b=m();return a.push(b.makeNodeResolver()),this.fapply(a).fail(b.reject),b.promise},l.nfbind=l.denodeify=function(a){var b=X(arguments,1);return function(){var c=b.concat(X(arguments)),d=m();return c.push(d.makeNodeResolver()),l(a).fapply(c).fail(d.reject),d.promise}},p.prototype.nfbind=p.prototype.denodeify=function(){var a=X(arguments);return a.unshift(this),l.denodeify.apply(void 0,a)},l.nbind=function(a,b){var c=X(arguments,2);return function(){function d(){return a.apply(b,arguments)}var e=c.concat(X(arguments)),f=m();return e.push(f.makeNodeResolver()),l(d).fapply(e).fail(f.reject),f.promise}},p.prototype.nbind=function(){var a=X(arguments,0);return a.unshift(this),l.nbind.apply(void 0,a)},l.nmapply=l.npost=function(a,b,c){return l(a).npost(b,c)},p.prototype.nmapply=p.prototype.npost=function(a,b){var c=X(b||[]),d=m();return c.push(d.makeNodeResolver()),this.dispatch("post",[a,c]).fail(d.reject),d.promise},l.nsend=l.nmcall=l.ninvoke=function(a,b){var c=X(arguments,2),d=m();return c.push(d.makeNodeResolver()),l(a).dispatch("post",[b,c]).fail(d.reject),d.promise},p.prototype.nsend=p.prototype.nmcall=p.prototype.ninvoke=function(a){var b=X(arguments,1),c=m();return b.push(c.makeNodeResolver()),this.dispatch("post",[a,b]).fail(c.reject),c.promise},l.nodeify=O,p.prototype.nodeify=function(a){return a?void this.then(function(b){V(function(){a(null,b)})},function(b){V(function(){a(b)})}):this};var hb=j();return l})},{__browserify_process:1}],3:[function(a,b){b.exports=function(a){"use strict";return{list:function(b){var c=a.$q.defer(),d=a.baseUrl+"/baas";return a.httpRequest.get(d,a.options,function(a,b){0===a?c.reject(new Error("No network connection.")):200!==a?c.reject(new Error(b.json().message)):c.resolve(b.json())}),c.promise.nodeify(b)},listByAccountId:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/baas/by/accounts/"+b;return a.httpRequest.get(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},get:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/baas/"+b;return a.httpRequest.get(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},set:function(b,c,d,e){var f=a.$q.defer(),g=a.baseUrl+"/baas/"+b,h=JSON.parse(JSON.stringify(a.options));return h.data={username:c,password:d},a.httpRequest.post(g,h,function(a,b){0===a?f.reject(new Error("No network connection.")):200!==a&&201!==a&&202!==a?f.reject(new Error(b.json().message)):f.resolve(b.json())}),f.promise.nodeify(e)},remove:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/baas/"+b;return a.httpRequest.del(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&202!==a&&204!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},start:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/baas/command/"+b;return a.httpRequest.put(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&202!==a&&204!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},stop:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/baas/command/"+b;return a.httpRequest.del(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&202!==a&&204!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)}}}},{}],4:[function(a,b){b.exports=function(a){"use strict";return{Email:function(){var a=this;a.recipient="",a.templateId="",a.subject="",a.metadata},send:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/email/action/send/"+b.recipient,f=JSON.parse(JSON.stringify(a.options));return f.data=b,a.httpRequest.post(e,f,function(a,b){0===a?d.reject(new Error("No network connection.")):201!==a&&202!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},setSettings:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/email/settings",f=JSON.parse(JSON.stringify(a.options));return f.data=b,a.httpRequest.put(e,f,function(a,b){0===a?d.reject(new Error("No network connection.")):201!==a&&202!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},getSettings:function(b){var c=a.$q.defer(),d=a.baseUrl+"/email/settings";return a.httpRequest.get(d,a.options,function(a,b){0===a?c.reject(new Error("No network connection.")):200!==a?c.reject(new Error(b.json().message)):c.resolve(b.json())}),c.promise.nodeify(b)}}}},{}],5:[function(a,b){b.exports=function(a){"use strict";return{upload:function(b,c){var d=a.$q.defer(),e=JSON.parse(JSON.stringify(a.options));e.headers["Content-Type"]="application/octed-stream",e.data=b;var f=a.baseUrl+"/file/upload/"+b.name;return a.httpRequest.post(f,e,function(a,b){0===a?d.reject(new Error("No network connection.")):201!==a&&202!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},download:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/file/download/"+b;return a.httpRequest.get(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a?d.reject(new Error(b.json().message)):d.resolve(b.text())}),d.promise.nodeify(c)},"delete":function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/file/"+b;return a.httpRequest.del(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&202!==a&&204!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},list:function(b){var c=a.$q.defer(),d=a.baseUrl+"/file";return a.httpRequest.get(d,a.options,function(a,b){0===a?c.reject(new Error("No network connection.")):200!==a?c.reject(new Error(b.json().message)):c.resolve(b.json())}),c.promise.nodeify(b)},open:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/file/"+b;return a.httpRequest.get(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a?d.reject(new Error(b.json().message)):d.resolve(b.text())}),d.promise.nodeify(c)}}}},{}],6:[function(a,b){b.exports=function(a){"use strict";return{list:function(b){var c=a.$q.defer(),d=a.baseUrl+"/processes",e=JSON.parse(JSON.stringify(a.options));return e.data={filter:"{}"},a.httpRequest.get(d,e,function(a,b){0===a?c.reject(new Error("No network connection.")):200!==a?c.reject(new Error(b.json().message)):c.resolve(b.json().map(function(a){return a.value}))}),c.promise.nodeify(b)},get:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/processes/"+b;return a.httpRequest.get(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a?d.reject(new Error(b.json().message)):d.resolve(b.json().map(function(a){return a.value}))}),d.promise.nodeify(c)},run:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/processes/actions/run/"+b.rel,f=JSON.parse(JSON.stringify(a.options));return f.data=b,a.httpRequest.post(e,f,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&201!==a&&202!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)}}}},{}],7:[function(a,b){b.exports=function(){"use strict";return{}}},{}],8:[function(a,b){b.exports=function(a){"use strict";return{set:function(b,c){var d=a.$q.defer(),e=JSON.parse(JSON.stringify(a.options));e.data=b;var f=a.baseUrl+"/task/"+b.Name;return a.httpRequest.put(f,e,function(a,b){0===a?d.reject(new Error("No network connection.")):201!==a&&202!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},get:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/task/"+b;return a.httpRequest.get(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},remove:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/task/"+b;return a.httpRequest.del(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&202!==a&&204!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},list:function(b){var c=a.$q.defer(),d=a.baseUrl+"/task";return a.httpRequest.get(d,a.options,function(a,b){0===a?c.reject(new Error("No network connection.")):200!==a?c.reject(new Error(b.json().message)):c.resolve(b.json())}),c.promise.nodeify(b)},run:function(b,c,d,e){var f=a.$q.defer(),g=a.baseUrl+"/task/run/"+b,h=JSON.parse(JSON.stringify(a.options));return h.data=c,a.httpRequest.get(g,h,function(a,b){0===a?f.reject(new Error("No network connection.")):200!==a?f.reject(new Error(b.json().message)):f.resolve(b.json())},e),f.promise.nodeify(d)}}}},{}],9:[function(a,b){b.exports=function(a){"use strict";return{add:function(b,c,d){var e=a.$q.defer(),f=JSON.parse(JSON.stringify(a.options));f.headers["Content-Type"]="application/octed-stream",f.data=c;var g=a.baseUrl+"/template/"+b;return a.httpRequest.post(g,f,function(a,b){0===a?e.reject(new Error("No network connection.")):201!==a&&202!==a?e.reject(new Error(b.json().message)):e.resolve(b.json())}),e.promise.nodeify(d)},set:function(b,c,d){var e=a.$q.defer(),f=JSON.parse(JSON.stringify(a.options));f.headers["Content-Type"]="application/octed-stream",f.data=c;var g=a.baseUrl+"/template/"+b;return a.httpRequest.put(g,f,function(a,b){0===a?e.reject(new Error("No network connection.")):201!==a&&202!==a?e.reject(new Error(b.json().message)):e.resolve(b.json())}),e.promise.nodeify(d)},get:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/template/"+b;return a.httpRequest.get(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a?d.reject(new Error(b.json().message)):d.resolve(b.text())}),d.promise.nodeify(c)},remove:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/template/"+b;return a.httpRequest.del(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&202!==a&&204!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},list:function(b){var c=a.$q.defer(),d=a.baseUrl+"/template";return a.httpRequest.get(d,a.options,function(a,b){0===a?c.reject(new Error("No network connection.")):200!==a?c.reject(new Error(b.json().message)):c.resolve(b.json())}),c.promise.nodeify(b)},open:function(b,c,d){var e=a.$q.defer(),f=a.baseUrl+"/template/"+b+"/actions/render";if(c){a.options.cache=!0;var g=[];for(var h in c)c.hasOwnProperty(h)&&g.push(encodeURIComponent(h)+"="+encodeURIComponent(c[h]));f+="?"+g.join("&")}return a.httpRequest.get(f,a.options,function(a,b){0===a?e.reject(new Error("No network connection.")):200!==a?e.reject(new Error(b.json().message)):e.resolve(b.text())}),e.promise.nodeify(d)}}}},{}],10:[function(a,b){b.exports=function(a){"use strict";return{login:function(b){var c=a.$q.defer(),d=a.baseUrl+"/users/actions/login";return a.httpRequest.authBasic(a.options.username,a.options.password),a.httpRequest.post(d,a.options,function(b,d){0===b?c.reject(new Error("No network connection.")):200!==b?c.reject(new Error("Authentication failed.")):(a.options.apiKey=d.json().apiKey,c.resolve({apiKey:a.options.apiKey,username:a.options.username,password:a.options.password,baseUrl:a.baseUrl}))}),c.promise.nodeify(b)},listAll:function(b){var c=a.$q.defer(),d=a.baseUrl+"/users",e=JSON.parse(JSON.stringify(a.options));return e.data={filter:"{}"},a.httpRequest.get(d,e,function(a,b){0===a?c.reject(new Error("No network connection.")):200!==a?c.reject(b.json().message):c.resolve(b.json().map(function(a){return a.value}))}),c.promise.nodeify(b)},list:function(b){var c=a.$q.defer(),d=a.baseUrl+"/users";return a.httpRequest.get(d,a.options,function(a,b){0===a?c.reject(new Error("No network connection.")):200!==a?c.reject(b.json().message):c.resolve(b.json().map(function(a){return a.value}))}),c.promise.nodeify(b)},groups:function(b){var c=a.$q.defer(),d=a.baseUrl+"/users/groups";return a.httpRequest.get(d,a.options,function(a,b){if(0===a)c.reject(new Error("No network connection."));else if(200!==a)c.reject(b.json().message);else{b=b.json();var d=[];for(var e in b)b.hasOwnProperty(e)&&d.push(e);c.resolve(d)}}),c.promise.nodeify(b)},register:function(b,c,d){var e=a.$q.defer(),f=a.baseUrl+"/users/actions/register",g=JSON.parse(JSON.stringify(a.options));return g.data={username:b,password:c},a.httpRequest.post(f,g,function(a,b){0===a?e.reject(new Error("No network connection.")):201!==a&&202!==a?e.reject(new Error(b.json().message)):e.resolve(b.json())}),e.promise.nodeify(d)},remove:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/users/"+b;return a.httpRequest.del(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&202!==a&&204!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},get:function(b,c){var d=a.$q.defer(),e=a.baseUrl+"/users/"+b;return a.httpRequest.get(e,a.options,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(c)},set:function(b,c,d){var e=a.$q.defer(),f=a.baseUrl+"/users/"+b,g=JSON.parse(JSON.stringify(a.options));return g.data=c,a.httpRequest.put(f,g,function(a,b){0===a?e.reject(new Error("No network connection.")):200!==a&&202!==a?e.reject(new Error(b.json().message)):e.resolve(b.json())}),e.promise.nodeify(d)}}}},{}],11:[function(a,b){b.exports=function(b){"use strict";var c=this;c.$q=a("q"),c.user=a("./plugins/user")(c),c.file=a("./plugins/file")(c),c.task=a("./plugins/task")(c),c.template=a("./plugins/template")(c),c.email=a("./plugins/email")(c),c.flow=a("./plugins/flow")(c),c.geolocation=a("./plugins/geolocation")(c),c.baas=a("./plugins/baas")(c),c.UUID=function(){for(var a=[],b="0123456789abcdef",c=0;36>c;c++)a[c]=b.substr(Math.floor(16*Math.random()),1);a[14]="4",a[19]=b.substr(3&a[19]|8,1),a[8]=a[13]=a[18]=a[23]="-";var d=a.join("");return d},c.manage={login:function(a){var b=c.$q.defer(),d=c.baseUrl+"/manage/login";return j.authBasic(c.options.username,c.options.password),j.post(d,c.options,function(a,d){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(d.json().message)):(c.options.apiKey=d.json().api.apiKey,b.resolve({apiKey:c.options.apiKey,username:c.options.username,password:c.options.password,baseUrl:c.baseUrl}))}),b.promise.nodeify(a)},"import":function(a,d){var e=c.$q.defer(),f=JSON.parse(JSON.stringify(c.options));f.headers={"Content-Type":"application/octed-stream",apiKey:b.apiKey},f.data=a;var g=c.baseUrl+"/manage/import";return j.post(g,f,function(a,b){0===a?e.reject(new Error("No network connection.")):201!==a?e.reject(new Error(b.json().message)):e.resolve(b.json())}),e.promise.nodeify(d)},"export":function(a){var b=c.$q.defer(),d=c.baseUrl+"/manage/export";return j.get(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(c.json().message)):b.resolve("data:application/octet-stream,"+c.text())}),b.promise.nodeify(a)},backup:function(a){a&&a()},restore:function(a,b){b&&b()},acl:{list:function(a,b){var d=c.baseUrl+"/shares/";"function"==typeof a?(d+="identities",b=a):d+=a,j.get(d,c.options,function(a,c){return b?0===a?b({message:"No network connection."}):200!==a?b(c.json()):void b(null,c.json()):void 0})},set:function(a,b){var d=c.baseUrl+"/shares/"+encodeURIComponent(a);j.post(d,c.options,function(a,c){return b?0===a?b({message:"No network connection."}):201!==a?b(c.json()):void b(null,c.json()):void 0})},remove:function(a,b){var d=c.baseUrl+"/shares/"+encodeURIComponent(a);j.del(d,c.options,function(a,c){return b?0===a?b({message:"No network connection."}):202!==a?b(c.json()):void b(null,c.json()):void 0})},grantWrite:function(a,b,d){var e=c.baseUrl+"/shares/"+encodeURIComponent(a)+"/actions/grantwrite/"+b;j.put(e,c.options,function(a,b){return d?0===a?d({message:"No network connection."}):202!==a?d(b.json()):void d(null,b.json()):void 0})},grantDelete:function(a,b,d){var e=c.baseUrl+"/shares/"+encodeURIComponent(a)+"/actions/grantdelete/"+b;j.put(e,c.options,function(a,b){return d?0===a?d({message:"No network connection."}):202!==a?d(b.json()):void d(null,b.json()):void 0})},grantRead:function(a,b,d){var e=c.baseUrl+"/shares/"+encodeURIComponent(a)+"/actions/grantread/"+b;j.put(e,c.options,function(a,b){return d?0===a?d({message:"No network connection."}):202!==a?d(b.json()):void d(null,b.json()):void 0})},revokeWrite:function(a,b,d){var e=c.baseUrl+"/shares/"+encodeURIComponent(a)+"/actions/revokewrite/"+b;j.put(e,c.options,function(a,b){return d?0===a?d({message:"No network connection."}):202!==a?d(b.json()):void d(null,b.json()):void 0})},revokeDelete:function(a,b,d){var e=c.baseUrl+"/shares/"+encodeURIComponent(a)+"/actions/revokedelete/"+b;j.put(e,c.options,function(a,b){return d?0===a?d({message:"No network connection."}):202!==a?d(b.json()):void d(null,b.json()):void 0})},revokeRead:function(a,b,d){var e=c.baseUrl+"/shares/"+encodeURIComponent(a)+"/actions/revokeread/"+b;j.put(e,c.options,function(a,b){return d?0===a?d({message:"No network connection."}):202!==a?d(b.json()):void d(null,b.json()):void 0})}},password:{set:function(a,b,d,e){var f=c.$q.defer(),g=c.baseUrl+"/manage/password/actions/reset",h=JSON.parse(JSON.stringify(c.options));return h.data={password:a,newPassword:b,newPasswordValidation:d},j.put(g,h,function(a,b){0===a?f.reject(new Error("No network connection.")):200!==a&&202!==a?f.reject(new Error(b.json().message)):f.resolve(b.json())}),f.promise.nodeify(e)}},user:{set:function(a,b){var d=c.$q.defer(),e=c.baseUrl+"/manage/user",f=JSON.parse(JSON.stringify(c.options));return f.data={username:a},j.put(e,f,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&202!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(b)}},apikey:{reset:function(a){var b=c.$q.defer(),d=c.baseUrl+"/manage/apikey/actions/reset";
return j.put(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a&&202!==a?b.reject(new Error(c.json().message)):b.resolve(c.json())}),b.promise.nodeify(a)}},certificate:{get:function(a){var b=c.$q.defer(),d=c.baseUrl+"/manage/certificate";return j.get(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(c.json().message)):b.resolve(c.json())}),b.promise.nodeify(a)},set:function(a,b,d){var e=c.$q.defer(),f=c.baseUrl+"/manage/certificate/actions/change",g=JSON.parse(JSON.stringify(c.options));return g.data={certificate:a,key:b},j.put(f,g,function(a,b){0===a?e.reject(new Error("No network connection.")):200!==a&&201!==a&&202!==a?e.reject(new Error(b.json().message)):e.resolve(b.json())}),e.promise.nodeify(d)}},status:{get:function(a){var b=c.$q.defer(),d=c.baseUrl+"/manage/os";return j.get(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(c.json().message)):b.resolve(c.json())}),b.promise.nodeify(a)}},plugin:{list:function(a){var b=c.$q.defer(),d=c.baseUrl+"/plugin";return j.get(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(c.json().message)):b.resolve(c.json())}),b.promise.nodeify(a)}}},c.store=function(a){var d=function(b){return a&&!b?c.baseUrl+"/stores/"+a:a&&b?c.baseUrl+"/stores/"+a+"/"+b:!a&&b&&-1!==b.indexOf("!")?(b=b.replace(/^[a-zA-z0-9]\/\//,"!"),c.baseUrl+"/stores/"+b):!a&&b?c.baseUrl+"/stores/"+b:c.baseUrl+"/stores"},e=function(){var a=this;a.doneResult=function(){},a.errorResult=function(){},a.done=function(b){return a.doneResult=b,a},a.error=function(b){return a.errorResult=b,a}},f=null,g={key:function(){return c.UUID()},"import":function(d,e){var f=JSON.parse(JSON.stringify(c.options));f.headers={"Content-Type":"application/octed-stream",apiKey:b.apiKey},f.data=d;var g=c.baseUrl+"/manage/import/"+a;j.post(g,f,function(a,b){return e?0===a?e({message:"No network connection."}):201!==a?e(b.json()):void e(null,b.json()):void 0})},"export":function(b){var d=c.baseUrl+"/manage/export/"+a;j.get(d,c.options,function(a,c){return b?0===a?b({message:"No network connection."}):200!==a?b(c.json()):void b(null,"data:application/octet-stream,"+c.text()):void 0})},set:function(a,b,f){a=arguments[0],b=arguments[1],1===arguments.length&&a instanceof Object&&(b=a,a=c.UUID());var g=d(a),h=new e,i=JSON.parse(JSON.stringify(c.options));return i.data=b,j.post(g,i,function(a,b){200!==a&&201!==a?(h.errorResult(b.text()),m(b.text()),f&&f(b.text())):(h.doneResult(b.json()),f&&f(null,b.json()))}),h},get:function(a,b){var f=new e;return j.get(d(a),c.options,function(a,c){0===a&&200!==a?(f.errorResult(c.text()),m(c.text()),b&&b(c.text())):(f.doneResult(c.json()),b&&b(null,c.json()))}),f},remove:function(a,b){var f=new e;return j.del(d(a),c.options,function(a,c){200!==a&&202!==a?(f.errorResult(c.text()),m(c.text()),b&&b(c.text())):(f.doneResult(c.json()),b&&b(null,c.json()))}),f},history:function(a){var b=new e,c=[];return b.doneResult(c),a&&a(null,c),g},on:function(b){return c.subscribed[a]&&f&&f().abort(),c.subscribed[a]=!0,f=n(a,c.clientId,b),m("subscribed to "+a),g},off:function(){return delete c.subscribed[a],f&&f().abort(),m("unsubscribed from "+a),g}};return g},c.notify={upload:function(a,d,e,f){var g=c.$q.defer(),h=JSON.parse(JSON.stringify(c.options));h.headers={"Content-Type":"application/octed-stream",apiKey:b.apiKey},h.data=e;var i=c.baseUrl+"/push/upload/"+a+"/"+d;return j.post(i,h,function(a,b){0===a?g.reject(new Error("No network connection.")):200!==a&&201!==a&&202!==a?g.reject(new Error(b.json().message)):g.resolve(b.json())}),g.promise.nodeify(f)},send:function(a,b){var d=c.$q.defer(),e=c.baseUrl+"/push/send",f=JSON.parse(JSON.stringify(c.options));return f.data=a,j.post(e,f,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&201!==a&&202!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(b)},settings:{load:function(a){var b=c.$q.defer(),d=c.baseUrl+"/push/settings";return j.get(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(c.json().message)):b.resolve(c.json())}),b.promise.nodeify(a)},save:function(a,b){var d=c.$q.defer(),e=c.baseUrl+"/push/settings",f=JSON.parse(JSON.stringify(c.options));return f.data=a,j.put(e,f,function(a,b){0===a?d.reject(new Error("No network connection.")):200!==a&&201!==a&&202!==a?d.reject(new Error(b.json().message)):d.resolve(b.json())}),d.promise.nodeify(b)}}},c.pubsub={channels:function(a){var b=c.$q.defer(),d=c.baseUrl+"/pubsub/channels";return j.get(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(c.json().message)):b.resolve(c.json())}),b.promise.nodeify(a)},push:function(a,b,d){var e=c.$q.defer(),f=c.baseUrl+"/pubsub/channel/publish/"+a,g=JSON.parse(JSON.stringify(c.options));return g.data=b,j.post(f,g,function(a,b){0===a?e.reject(new Error("No network connection.")):200!==a&&201!==a&&202!==a?e.reject(new Error(b.json().message)):e.resolve(b.json())}),e.promise.nodeify(d)},on:function(a,b){a=a.replace("/","_"),c.subscribed[a]=!0,m("subscribed to "+a);var d=n(a,c.clientId,b);return{off:function(){delete c.subscribed[a],d&&d().abort(),m("unsubscribed from "+a)},push:function(b,d){c.pubsub.push(a,b,d)}}}},c.statistics={minutes:function(a){var b=c.$q.defer(),d=c.baseUrl+"/statistics/minutes";return j.get(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(c.json().message)):b.resolve(c.json())}),b.promise.nodeify(a)},summary:function(a){var b=c.$q.defer(),d=c.baseUrl+"/statistics/summary";return j.get(d,c.options,function(a,c){0===a?b.reject(new Error("No network connection.")):200!==a?b.reject(new Error(c.json().message)):b.resolve(c.json())}),b.promise.nodeify(a)}};var d=function(a){if(window.XMLHttpRequest)return a(null,new XMLHttpRequest);if(window.ActiveXObject)try{return a(null,new ActiveXObject("Msxml2.XMLHTTP"))}catch(b){return a(null,new ActiveXObject("Microsoft.XMLHTTP"))}return a(new Error)},e=function(a){if("string"==typeof a)return a;var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")},f=function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},g=function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a=f(a);var c,d,e,g,h,i,j,k="",l=0;do c=a.charCodeAt(l++),d=a.charCodeAt(l++),e=a.charCodeAt(l++),g=c>>2,h=(3&c)<<4|d>>4,i=(15&d)<<2|e>>6,j=63&e,isNaN(d)?i=j=64:isNaN(e)&&(j=64),k+=b.charAt(g)+b.charAt(h)+b.charAt(i)+b.charAt(j),c=d=e="",g=h=i=j="";while(l<a.length);return k},h=function(){for(var a=arguments[0],b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}return a},i=function(a,b,c,f,g){"function"==typeof c&&(f=c,c={}),c.cache=c.cache||!0,c.headers=c.headers||{},c.jsonp=c.jsonp||!1;var j,k=h({accept:"*/*","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","x-auth-token":c.apiKey},i.headers,c.headers);if(c.data&&(j="GET"===a&&"application/json"===k["Content-Type"]?e(c.data):"application/json"===k["Content-Type"]?JSON.stringify(c.data):-1!==k["Content-Type"].indexOf("application/octed-stream")?c.data:e(c.data)),"GET"===a){var l=[];if(j&&(l.push(j),j=null),c.cache||l.push("_="+(new Date).getTime()),c.jsonp&&(l.push("callback="+c.jsonp),l.push("jsonp="+c.jsonp)),l="?"+l.join("&"),b+="?"!==l?l:"",c.jsonp){var m=document.getElementsByTagName("head")[0],n=document.createElement("script");return n.type="text/javascript",n.src=b,void m.appendChild(n)}}var o=null;return d(function(d,e){if(o=e,d)return f(d);e.open(a,b,c.async||!0);for(var h in k)k.hasOwnProperty(h)&&e.setRequestHeader(h,k[h]);e.onerror=function(){f(e.status,{text:function(){return e.statusText}})},e.onreadystatechange=function(){if(4===e.readyState&&0!==e.status){var a=this.getResponseHeader("subkit-log");if(g&&g(a),!f)return;var b=e.responseText||"";f(e.status,{text:function(){return b},json:function(){return b?JSON.parse(b):{}},headers:function(){return e.getAllResponseHeaders()}})}},e.send(j)}),o},j={authBasic:function(a,b){j.headers({}),i.headers.Authorization="Basic "+g(a+":"+b)},connect:function(a,b,c,d){return i("CONNECT",a,b,c,d)},del:function(a,b,c,d){return i("DELETE",a,b,c,d)},get:function(a,b,c,d){return i("GET",a,b,c,d)},head:function(a,b,c,d){return i("HEAD",a,b,c,d)},headers:function(a){i.headers=a||{}},isAllowed:function(a,b,c,d){this.options(a,function(a,d){c(-1!==d.text().indexOf(b))},d)},options:function(a,b,c,d){return i("OPTIONS",a,b,c,d)},patch:function(a,b,c,d){return i("PATCH",a,b,c,d)},post:function(a,b,c,d){return i("POST",a,b,c,d)},put:function(a,b,c,d){return i("PUT",a,b,c,d)},trace:function(a,b,c,d){return i("TRACE",a,b,c,d)}},k=function(){var a=window.sessionStorage.getItem("clientId");return a||(a=c.UUID(),window.sessionStorage.setItem("clientId",a)),a};c.clientId=b.clientId||k(),c.baseUrl=b.baseUrl||(-1!==window.location.origin.indexOf("http")?window.location.origin:"https://localhost:8080"),c.options={apiKey:b.apiKey||"",username:b.username||"",password:b.password||"",headers:{"Content-Type":"application/json"}};var l=[];c.subscribed={};var m=function(a){a.json&&(a=a.json()),l.forEach(function(b){b(a)})};c.httpRequest=j;var n=function(a,b,d){var e=c.baseUrl+"/pubsub/subscribe/"+a+"/"+b,f=null,g=1;return function h(){f=j.get(e,c.options,function(e,f){200!==e?c.subscribed[a]&&(d({message:"subscription error - retry"}),setTimeout(function(){h(a,b,d)},300*g++)):(g=1,f.json().forEach(function(a){d(null,a.value)}),c.subscribed[a]&&h(a,b,d))})}(),function(){return f}}}},{"./plugins/baas":3,"./plugins/email":4,"./plugins/file":5,"./plugins/flow":6,"./plugins/geolocation":7,"./plugins/task":8,"./plugins/template":9,"./plugins/user":10,q:2}]},{},[11])(11)}); | NMastracchio/cdnjs | ajax/libs/subkit/1.0.19/subkit.min.js | JavaScript | mit | 42,314 |
var Absurd=function(){var a={api:{},helpers:{},plugins:{},processors:{css:{plugins:{}},html:{plugins:{}}}},b=function(b){switch(b){case"/../processors/html/HTML.js":return a.processors.html.HTML}return function(){}},d="",e=function(){return function(b){var d=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},e={defaultProcessor:a.processors.css.CSS()},f={},g={},h={},i={};e.getRules=function(a){return"undefined"==typeof a?f:("undefined"==typeof f[a]&&(f[a]=[]),f[a])},e.getPlugins=function(){return h},e.getStorage=function(){return g},e.flush=function(){f={},g=[]},e.import=function(){return e.callHooks("import",arguments)?e:e},e.addHook=function(a,b){i[a]||(i[a]=[]);for(var d=!1,e=0;c=i[a][e];e++)c===b&&(d=!0);d===!1?i[a].push(b):null},e.callHooks=function(a,b){if(i[a])for(var d=0;c=i[a][d];d++)if(c.apply(e,b)===!0)return!0;return!1},e.numOfAddedRules=0,e.compile=function(a,b){if(e.callHooks("compile",arguments))return e;var c={combineSelectors:!0,minify:!1,processor:e.defaultProcessor};b=d(c,b||{}),b.processor(e.getRules(),a||function(){},{combineSelectors:!0}),e.flush()};for(var j in a.api)"compile"!==j&&(e[j]=a.api[j](e),e[j]=function(b){return function(){var c=a.api[b](e);return e.callHooks(b,arguments)?e:c.apply(e,arguments)}}(j));for(var k in a.plugins)e.plugin(k,a.plugins[k]());return"function"==typeof b&&b(e),e}};a.api.add=function(a){var b=function(b,c,d,f){var g=a.getPlugins()[c];if("undefined"!=typeof g){var h=g(a,d);return h&&e(b,h,f),!0}return!1},c=function(b){var c=a.getPlugins();for(var d in b)"undefined"!=typeof c[d]&&(b[d]=!1);for(var d in b)":"===d.charAt(0)&&(b[d]=!1)},d=function(a,c,f){for(var g in c)"object"==typeof c[g]?(":"===g.charAt(0)?e(a+g,c[g],f):0===g.indexOf("@media")||0===g.indexOf("@supports")?e(a,c[g],g):b(a,g,c[g],f)===!1&&e(a+" "+g,c[g],f),c[g]=!1):"function"==typeof c[g]?(c[g]=c[g](),d(a,c,f)):b(a,g,c[g],f)&&(c[g]=!1)},e=function(f,g,h){if("undefined"==typeof g.length||"object"!=typeof g){if(!b(null,f,g,h)){if("object"==typeof a.getRules(h||"mainstream")[f]){var i=a.getRules(h||"mainstream")[f];for(var j in g)i[j]=g[j]}else a.getRules(h||"mainstream")[f]=g;d(f,g,h||"mainstream"),c(g)}}else for(var k=0;prop=g[k];k++)e(f,prop,h)},f=function(b,c){a.numOfAddedRules+=1;for(var d in b)if("undefined"!=typeof b[d].length&&"object"==typeof b[d])for(var f=0;r=b[d][f];f++)e(d,r,c||"mainstream");else e(d,b[d],c||"mainstream");return a};return f};var f=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a};a.api.compile=function(a){return function(){for(var b=null,c=null,d=null,e=0;e<arguments.length;e++)switch(typeof arguments[e]){case"function":c=arguments[e];break;case"string":b=arguments[e];break;case"object":d=arguments[e]}var g={combineSelectors:!0,minify:!1,processor:a.defaultProcessor};d=f(g,d||{}),d.processor(a.getRules(),function(d,e){if(null!=b)try{fs.writeFile(b,e,function(a){c(a,e)})}catch(d){c(d)}else c(d,e);a.flush()},d)}},a.api.compileFile=function(a){return a.compile};var g=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};a.api.darken=function(){return function(a,b){return g(a,-(b/100))}},a.api.hook=function(a){return function(b,c){return a.addHook(b,c),a}};var g=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};a.api.lighten=function(){return function(a,b){return g(a,b/100)}};var h={html:function(a){a.defaultProcessor=b(d+"/../processors/html/HTML.js")(),a.hook("add",function(b,c){return a.getRules(c||"mainstream").push(b),!0})}};a.api.morph=function(a){return function(b){return h[b]&&(a.flush(),h[b](a)),a}},a.api.plugin=function(a){var b=function(b,c){return a.getPlugins()[b]=c,a};return b},a.api.raw=function(a){return function(b){var c={},d={},e="____raw_"+a.numOfAddedRules;return d[e]=b,c[e]=d,a.add(c),a}},a.api.register=function(a){return function(b,c){return a[b]=c,a}},a.api.storage=function(a){var b=a.getStorage(),c=function(c,d){if("undefined"==typeof d){if(b[c])return b[c];throw new Error("There is no data in the storage associated with '"+c+"'")}return b[c]=d,a};return c},a.helpers.ColorLuminance=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e},a.helpers.RequireUncached=function(a){return delete b.cache[b.resolve(a)],b(a)};var i=b("clean-css"),j="\n",k={combineSelectors:!0,minify:!1},l=function(a){var b="";for(var c in a)if(0===c.indexOf("____raw"))b+=a[c][c]+j;else{var d=c+" {"+j;for(var e in a[c]){var f=a[c][e];""===f&&(f='""'),d+=" "+o(e)+": "+f+";"+j}d+="}"+j,b+=d}return b},m=function(a){var b={};for(var c in a){var d=!1,e={};for(var f in a[c]){var g=a[c][f];g!==!1&&(d=!0,e[f]=g)}d&&(b[c]=e)}return b},n=function(a){var b={},c={};for(var d in a){var e=a[d];for(var f in e){var g=e[f];b[f]||(b[f]={}),b[f][g]||(b[f][g]=[]),b[f][g].push(d)}}for(var f in b){var h=b[f];for(var g in h){var i=h[g];c[i.join(", ")]||(c[i.join(", ")]={});var d=c[i.join(", ")];d[f]=g}}return c},o=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b};a.processors.css.CSS=function(){return function(a,b,c){c=c||k;var d="";for(var e in a){var f=m(a[e]);f=c.combineSelectors?n(f):f,d+="mainstream"===e?l(f):e+" {"+j+l(f)+"}"+j}return c.minify?(d=i.process(d),b&&b(null,d)):b&&b(null,d),d}},a.processors.css.plugins.charset=function(){return function(a,b){"string"==typeof b?a.raw('@charset: "'+b+'";'):"object"==typeof b&&(b=b.charset.replace(/:/g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,""),a.raw('@charset: "'+b+'";'))}},a.processors.css.plugins.document=function(){return function(a,b){if("object"==typeof b){var c="";if(c+="@"+b.vendor+"document",c+=" "+b.document,b.rules&&b.rules.length)for(var d=0;rule=b.rules[d];d++)a.handlecssrule(rule,c);else"undefined"!=typeof b.styles&&a.add(b.styles,c)}}},a.processors.css.plugins.keyframes=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c)if("undefined"!=typeof c.frames){var f="@keyframes "+c.name+" {\n";f+=e({mainstream:c.frames}),f+="}",a.raw(f+"\n"+f.replace("@keyframes","@-webkit-keyframes"))}else if("undefined"!=typeof c.keyframes){for(var f="@keyframes "+c.name+" {\n",g={},h=0;rule=c.keyframes[h];h++)if("keyframe"===rule.type)for(var i=g[rule.values]={},j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value);f+=e({mainstream:g}),f+="}",a.raw(f+"\n"+f.replace("@keyframes","@-webkit-keyframes"))}}},a.processors.css.plugins.media=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c){for(var f="@media "+c.media+" {\n",g={},h=0;rule=c.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=e({mainstream:g}),f+="}",a.raw(f)}}},a.processors.css.plugins.namespace=function(){return function(a,b){"string"==typeof b?a.raw('@namespace: "'+b+'";'):"object"==typeof b&&(b=b.namespace.replace(/: /g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,"").replace(/:h/g,"h"),a.raw('@namespace: "'+b+'";'))}},a.processors.css.plugins.page=function(){return function(a,b){if("object"==typeof b){var c="";c+=b.selectors.length>0?"@page "+b.selectors.join(", ")+" {\n":"@page {\n";for(var d=0;declaration=b.declarations[d];d++)"declaration"==declaration.type&&(c+=" "+declaration.property+": "+declaration.value+";\n");c+="}",a.raw(c)}}},a.processors.css.plugins.supports=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c){for(var f="@supports "+c.supports+" {\n",g={},h=0;rule=c.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=e({mainstream:g}),f+="}",a.raw(f)}}};var p=null,j="\n",k={},o=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b},q=function(a){var b="";for(var c in p)if(c==a)for(var d=p[c].length,e=0;d>e;e++)b+=s("",p[c][e]);return b},s=function(a,b){var c="",d="",e="";if("string"==typeof b)return t(a,d,b);var f=function(a){""!=e&&(e+=j),e+=a};for(var g in b){var h=b[g];switch(g){case"_attrs":for(var i in h)d+="function"==typeof h[i]?" "+o(i)+'="'+h[i]()+'"':" "+o(i)+'="'+h[i]+'"';b[g]=!1;break;case"_":f(h),b[g]=!1;break;case"_tpl":if("string"==typeof h)f(q(h));else if("object"==typeof h&&h.length&&h.length>0){for(var k="",l=0;tpl=h[l];l++)k+=q(tpl),l<h.length-1&&(k+=j);f(k)}b[g]=!1}}for(var m in b){var h=b[m];if(h!==!1)switch(typeof h){case"string":f(s(m,h));break;case"object":if(h.length&&h.length>0){for(var k="",l=0;v=h[l];l++)k+=s("","function"==typeof v?v():v),l<h.length-1&&(k+=j);f(s(m,k))}else f(s(m,h));break;case"function":f(s(m,h()))}}return c+=""!=a?t(a,d,e):e},t=function(a,b,c){var d="";return d+=""!==c?"<"+o(a)+b+">"+j+c+j+"</"+o(a)+">":"<"+o(a)+b+"/>"};return a.processors.html.HTML=function(){return function(a,b,c){p=a,b=b||function(){},c=c||k;var d=q("mainstream");return b(null,d),d}},e()}(window); | kood1/cdnjs | ajax/libs/absurd/0.0.50/absurd.min.js | JavaScript | mit | 9,732 |
<?php
namespace Composer\Installers\Test;
use Composer\Installers\AsgardInstaller;
use Composer\Package\Package;
use Composer\Composer;
class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
{
/**
* @var OctoberInstaller
*/
private $installer;
public function setUp()
{
$this->installer = new AsgardInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),
array('name' => $expected, 'type' => $type)
);
}
public function packageNameInflectionProvider()
{
return array(
array(
'asgard-module',
'asgard-module',
'Asgard'
),
array(
'asgard-module',
'blog',
'Blog'
),
// tests that exactly one '-theme' is cut off
array(
'asgard-theme',
'some-theme-theme',
'Some-theme',
),
// tests that names without '-theme' suffix stay valid
array(
'asgard-theme',
'someothertheme',
'Someothertheme',
),
);
}
}
| bluematt/composer-installers | tests/Composer/Installers/Test/AsgardInstallerTest.php | PHP | mit | 1,513 |
define("dojo/hash", ["./_base/kernel", "require", "./_base/config", "./_base/connect", "./_base/lang", "./ready", "./sniff"],
function(dojo, require, config, connect, lang, ready, has){
// module:
// dojo/hash
dojo.hash = function(/* String? */ hash, /* Boolean? */ replace){
// summary:
// Gets or sets the hash string in the browser URL.
// description:
// Handles getting and setting of location.hash.
//
// - If no arguments are passed, acts as a getter.
// - If a string is passed, acts as a setter.
// hash:
// the hash is set - #string.
// replace:
// If true, updates the hash value in the current history
// state instead of creating a new history state.
// returns:
// when used as a getter, returns the current hash string.
// when used as a setter, returns the new hash string.
// example:
// | topic.subscribe("/dojo/hashchange", context, callback);
// |
// | function callback (hashValue){
// | // do something based on the hash value.
// | }
// getter
if(!arguments.length){
return _getHash();
}
// setter
if(hash.charAt(0) == "#"){
hash = hash.substring(1);
}
if(replace){
_replace(hash);
}else{
location.href = "#" + hash;
}
return hash; // String
};
// Global vars
var _recentHash, _ieUriMonitor, _connect,
_pollFrequency = config.hashPollFrequency || 100;
//Internal functions
function _getSegment(str, delimiter){
var i = str.indexOf(delimiter);
return (i >= 0) ? str.substring(i+1) : "";
}
function _getHash(){
return _getSegment(location.href, "#");
}
function _dispatchEvent(){
connect.publish("/dojo/hashchange", [_getHash()]);
}
function _pollLocation(){
if(_getHash() === _recentHash){
return;
}
_recentHash = _getHash();
_dispatchEvent();
}
function _replace(hash){
if(_ieUriMonitor){
if(_ieUriMonitor.isTransitioning()){
setTimeout(lang.hitch(null,_replace,hash), _pollFrequency);
return;
}
var href = _ieUriMonitor.iframe.location.href;
var index = href.indexOf('?');
// main frame will detect and update itself
_ieUriMonitor.iframe.location.replace(href.substring(0, index) + "?" + hash);
return;
}
location.replace("#"+hash);
!_connect && _pollLocation();
}
function IEUriMonitor(){
// summary:
// Determine if the browser's URI has changed or if the user has pressed the
// back or forward button. If so, call _dispatchEvent.
//
// description:
// IE doesn't add changes to the URI's hash into the history unless the hash
// value corresponds to an actual named anchor in the document. To get around
// this IE difference, we use a background IFrame to maintain a back-forward
// history, by updating the IFrame's query string to correspond to the
// value of the main browser location's hash value.
//
// E.g. if the value of the browser window's location changes to
//
// #action=someAction
//
// ... then we'd update the IFrame's source to:
//
// ?action=someAction
//
// This design leads to a somewhat complex state machine, which is
// described below:
//
// ####s1
//
// Stable state - neither the window's location has changed nor
// has the IFrame's location. Note that this is the 99.9% case, so
// we optimize for it.
//
// Transitions: s1, s2, s3
//
// ####s2
//
// Window's location changed - when a user clicks a hyperlink or
// code programmatically changes the window's URI.
//
// Transitions: s4
//
// ####s3
//
// Iframe's location changed as a result of user pressing back or
// forward - when the user presses back or forward, the location of
// the background's iframe changes to the previous or next value in
// its history.
//
// Transitions: s1
//
// ####s4
//
// IEUriMonitor has programmatically changed the location of the
// background iframe, but it's location hasn't yet changed. In this
// case we do nothing because we need to wait for the iframe's
// location to reflect its actual state.
//
// Transitions: s4, s5
//
// ####s5
//
// IEUriMonitor has programmatically changed the location of the
// background iframe, and the iframe's location has caught up with
// reality. In this case we need to transition to s1.
//
// Transitions: s1
//
// The hashchange event is always dispatched on the transition back to s1.
// create and append iframe
var ifr = document.createElement("iframe"),
IFRAME_ID = "dojo-hash-iframe",
ifrSrc = config.dojoBlankHtmlUrl || require.toUrl("./resources/blank.html");
if(config.useXDomain && !config.dojoBlankHtmlUrl){
console.warn("dojo.hash: When using cross-domain Dojo builds,"
+ " please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl"
+ " to the path on your domain to blank.html");
}
ifr.id = IFRAME_ID;
ifr.src = ifrSrc + "?" + _getHash();
ifr.style.display = "none";
document.body.appendChild(ifr);
this.iframe = dojo.global[IFRAME_ID];
var recentIframeQuery, transitioning, expectedIFrameQuery, docTitle, ifrOffline,
iframeLoc = this.iframe.location;
function resetState(){
_recentHash = _getHash();
recentIframeQuery = ifrOffline ? _recentHash : _getSegment(iframeLoc.href, "?");
transitioning = false;
expectedIFrameQuery = null;
}
this.isTransitioning = function(){
return transitioning;
};
this.pollLocation = function(){
if(!ifrOffline){
try{
//see if we can access the iframe's location without a permission denied error
var iframeSearch = _getSegment(iframeLoc.href, "?");
//good, the iframe is same origin (no thrown exception)
if(document.title != docTitle){ //sync title of main window with title of iframe.
docTitle = this.iframe.document.title = document.title;
}
}catch(e){
//permission denied - server cannot be reached.
ifrOffline = true;
console.error("dojo.hash: Error adding history entry. Server unreachable.");
}
}
var hash = _getHash();
if(transitioning && _recentHash === hash){
// we're in an iframe transition (s4 or s5)
if(ifrOffline || iframeSearch === expectedIFrameQuery){
// s5 (iframe caught up to main window or iframe offline), transition back to s1
resetState();
_dispatchEvent();
}else{
// s4 (waiting for iframe to catch up to main window)
setTimeout(lang.hitch(this,this.pollLocation),0);
return;
}
}else if(_recentHash === hash && (ifrOffline || recentIframeQuery === iframeSearch)){
// we're in stable state (s1, iframe query == main window hash), do nothing
}else{
// the user has initiated a URL change somehow.
// sync iframe query <-> main window hash
if(_recentHash !== hash){
// s2 (main window location changed), set iframe url and transition to s4
_recentHash = hash;
transitioning = true;
expectedIFrameQuery = hash;
ifr.src = ifrSrc + "?" + expectedIFrameQuery;
ifrOffline = false; //we're updating the iframe src - set offline to false so we can check again on next poll.
setTimeout(lang.hitch(this,this.pollLocation),0); //yielded transition to s4 while iframe reloads.
return;
}else if(!ifrOffline){
// s3 (iframe location changed via back/forward button), set main window url and transition to s1.
location.href = "#" + iframeLoc.search.substring(1);
resetState();
_dispatchEvent();
}
}
setTimeout(lang.hitch(this,this.pollLocation), _pollFrequency);
};
resetState(); // initialize state (transition to s1)
setTimeout(lang.hitch(this,this.pollLocation), _pollFrequency);
}
ready(function(){
if("onhashchange" in dojo.global && (!has("ie") || (has("ie") >= 8 && document.compatMode != "BackCompat"))){ //need this IE browser test because "onhashchange" exists in IE8 in IE7 mode
_connect = connect.connect(dojo.global,"onhashchange",_dispatchEvent);
}else{
if(document.addEventListener){ // Non-IE
_recentHash = _getHash();
setInterval(_pollLocation, _pollFrequency); //Poll the window location for changes
}else if(document.attachEvent){ // IE7-
//Use hidden iframe in versions of IE that don't have onhashchange event
_ieUriMonitor = new IEUriMonitor();
}
// else non-supported browser, do nothing.
}
});
return dojo.hash;
});
| emmy41124/cdnjs | ajax/libs/dojo/1.8.0/hash.js.uncompressed.js | JavaScript | mit | 8,394 |
define("dojo/_base/fx", ["./kernel", "./config", /*===== "./declare", =====*/ "./lang", "../Evented", "./Color", "./connect", "./sniff", "../dom", "../dom-style"],
function(dojo, config, /*===== declare, =====*/ lang, Evented, Color, connect, has, dom, style){
// module:
// dojo/_base/fx
// notes:
// Animation loosely package based on Dan Pupius' work, contributed under CLA; see
// http://pupius.co.uk/js/Toolkit.Drawing.js
var _mixin = lang.mixin;
// Module export
var basefx = {
// summary:
// This module defines the base dojo/_base/fx implementation.
};
var _Line = basefx._Line = function(/*int*/ start, /*int*/ end){
// summary:
// Object used to generate values from a start value to an end value
// start: int
// Beginning value for range
// end: int
// Ending value for range
this.start = start;
this.end = end;
};
_Line.prototype.getValue = function(/*float*/ n){
// summary:
// Returns the point on the line
// n:
// a floating point number greater than 0 and less than 1
return ((this.end - this.start) * n) + this.start; // Decimal
};
var Animation = basefx.Animation = function(args){
// summary:
// A generic animation class that fires callbacks into its handlers
// object at various states.
// description:
// A generic animation class that fires callbacks into its handlers
// object at various states. Nearly all dojo animation functions
// return an instance of this method, usually without calling the
// .play() method beforehand. Therefore, you will likely need to
// call .play() on instances of `Animation` when one is
// returned.
// args: Object
// The 'magic argument', mixing all the properties into this
// animation instance.
_mixin(this, args);
if(lang.isArray(this.curve)){
this.curve = new _Line(this.curve[0], this.curve[1]);
}
};
Animation.prototype = new Evented();
lang.extend(Animation, {
// duration: Integer
// The time in milliseconds the animation will take to run
duration: 350,
/*=====
// curve: _Line|Array
// A two element array of start and end values, or a `_Line` instance to be
// used in the Animation.
curve: null,
// easing: Function?
// A Function to adjust the acceleration (or deceleration) of the progress
// across a _Line
easing: null,
=====*/
// repeat: Integer?
// The number of times to loop the animation
repeat: 0,
// rate: Integer?
// the time in milliseconds to wait before advancing to next frame
// (used as a fps timer: 1000/rate = fps)
rate: 20 /* 50 fps */,
/*=====
// delay: Integer?
// The time in milliseconds to wait before starting animation after it
// has been .play()'ed
delay: null,
// beforeBegin: Event?
// Synthetic event fired before a Animation begins playing (synchronous)
beforeBegin: null,
// onBegin: Event?
// Synthetic event fired as a Animation begins playing (useful?)
onBegin: null,
// onAnimate: Event?
// Synthetic event fired at each interval of the Animation
onAnimate: null,
// onEnd: Event?
// Synthetic event fired after the final frame of the Animation
onEnd: null,
// onPlay: Event?
// Synthetic event fired any time the Animation is play()'ed
onPlay: null,
// onPause: Event?
// Synthetic event fired when the Animation is paused
onPause: null,
// onStop: Event
// Synthetic event fires when the Animation is stopped
onStop: null,
=====*/
_percent: 0,
_startRepeatCount: 0,
_getStep: function(){
var _p = this._percent,
_e = this.easing
;
return _e ? _e(_p) : _p;
},
_fire: function(/*Event*/ evt, /*Array?*/ args){
// summary:
// Convenience function. Fire event "evt" and pass it the
// arguments specified in "args".
// description:
// Convenience function. Fire event "evt" and pass it the
// arguments specified in "args".
// Fires the callback in the scope of this Animation
// instance.
// evt:
// The event to fire.
// args:
// The arguments to pass to the event.
var a = args||[];
if(this[evt]){
if(config.debugAtAllCosts){
this[evt].apply(this, a);
}else{
try{
this[evt].apply(this, a);
}catch(e){
// squelch and log because we shouldn't allow exceptions in
// synthetic event handlers to cause the internal timer to run
// amuck, potentially pegging the CPU. I'm not a fan of this
// squelch, but hopefully logging will make it clear what's
// going on
console.error("exception in animation handler for:", evt);
console.error(e);
}
}
}
return this; // Animation
},
play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
// summary:
// Start the animation.
// delay:
// How many milliseconds to delay before starting.
// gotoStart:
// If true, starts the animation from the beginning; otherwise,
// starts it from its current position.
// returns: Animation
// The instance to allow chaining.
var _t = this;
if(_t._delayTimer){ _t._clearTimer(); }
if(gotoStart){
_t._stopTimer();
_t._active = _t._paused = false;
_t._percent = 0;
}else if(_t._active && !_t._paused){
return _t;
}
_t._fire("beforeBegin", [_t.node]);
var de = delay || _t.delay,
_p = lang.hitch(_t, "_play", gotoStart);
if(de > 0){
_t._delayTimer = setTimeout(_p, de);
return _t;
}
_p();
return _t; // Animation
},
_play: function(gotoStart){
var _t = this;
if(_t._delayTimer){ _t._clearTimer(); }
_t._startTime = new Date().valueOf();
if(_t._paused){
_t._startTime -= _t.duration * _t._percent;
}
_t._active = true;
_t._paused = false;
var value = _t.curve.getValue(_t._getStep());
if(!_t._percent){
if(!_t._startRepeatCount){
_t._startRepeatCount = _t.repeat;
}
_t._fire("onBegin", [value]);
}
_t._fire("onPlay", [value]);
_t._cycle();
return _t; // Animation
},
pause: function(){
// summary:
// Pauses a running animation.
var _t = this;
if(_t._delayTimer){ _t._clearTimer(); }
_t._stopTimer();
if(!_t._active){ return _t; /*Animation*/ }
_t._paused = true;
_t._fire("onPause", [_t.curve.getValue(_t._getStep())]);
return _t; // Animation
},
gotoPercent: function(/*Decimal*/ percent, /*Boolean?*/ andPlay){
// summary:
// Sets the progress of the animation.
// percent:
// A percentage in decimal notation (between and including 0.0 and 1.0).
// andPlay:
// If true, play the animation after setting the progress.
var _t = this;
_t._stopTimer();
_t._active = _t._paused = true;
_t._percent = percent;
if(andPlay){ _t.play(); }
return _t; // Animation
},
stop: function(/*boolean?*/ gotoEnd){
// summary:
// Stops a running animation.
// gotoEnd:
// If true, the animation will end.
var _t = this;
if(_t._delayTimer){ _t._clearTimer(); }
if(!_t._timer){ return _t; /* Animation */ }
_t._stopTimer();
if(gotoEnd){
_t._percent = 1;
}
_t._fire("onStop", [_t.curve.getValue(_t._getStep())]);
_t._active = _t._paused = false;
return _t; // Animation
},
status: function(){
// summary:
// Returns a string token representation of the status of
// the animation, one of: "paused", "playing", "stopped"
if(this._active){
return this._paused ? "paused" : "playing"; // String
}
return "stopped"; // String
},
_cycle: function(){
var _t = this;
if(_t._active){
var curr = new Date().valueOf();
// Allow durations of 0 (instant) by setting step to 1 - see #13798
var step = _t.duration === 0 ? 1 : (curr - _t._startTime) / (_t.duration);
if(step >= 1){
step = 1;
}
_t._percent = step;
// Perform easing
if(_t.easing){
step = _t.easing(step);
}
_t._fire("onAnimate", [_t.curve.getValue(step)]);
if(_t._percent < 1){
_t._startTimer();
}else{
_t._active = false;
if(_t.repeat > 0){
_t.repeat--;
_t.play(null, true);
}else if(_t.repeat == -1){
_t.play(null, true);
}else{
if(_t._startRepeatCount){
_t.repeat = _t._startRepeatCount;
_t._startRepeatCount = 0;
}
}
_t._percent = 0;
_t._fire("onEnd", [_t.node]);
!_t.repeat && _t._stopTimer();
}
}
return _t; // Animation
},
_clearTimer: function(){
// summary:
// Clear the play delay timer
clearTimeout(this._delayTimer);
delete this._delayTimer;
}
});
// the local timer, stubbed into all Animation instances
var ctr = 0,
timer = null,
runner = {
run: function(){}
};
lang.extend(Animation, {
_startTimer: function(){
if(!this._timer){
this._timer = connect.connect(runner, "run", this, "_cycle");
ctr++;
}
if(!timer){
timer = setInterval(lang.hitch(runner, "run"), this.rate);
}
},
_stopTimer: function(){
if(this._timer){
connect.disconnect(this._timer);
this._timer = null;
ctr--;
}
if(ctr <= 0){
clearInterval(timer);
timer = null;
ctr = 0;
}
}
});
var _makeFadeable =
has("ie") ? function(node){
// only set the zoom if the "tickle" value would be the same as the
// default
var ns = node.style;
// don't set the width to auto if it didn't already cascade that way.
// We don't want to f anyones designs
if(!ns.width.length && style.get(node, "width") == "auto"){
ns.width = "auto";
}
} :
function(){};
basefx._fade = function(/*Object*/ args){
// summary:
// Returns an animation that will fade the node defined by
// args.node from the start to end values passed (args.start
// args.end) (end is mandatory, start is optional)
args.node = dom.byId(args.node);
var fArgs = _mixin({ properties: {} }, args),
props = (fArgs.properties.opacity = {});
props.start = !("start" in fArgs) ?
function(){
return +style.get(fArgs.node, "opacity")||0;
} : fArgs.start;
props.end = fArgs.end;
var anim = basefx.animateProperty(fArgs);
connect.connect(anim, "beforeBegin", lang.partial(_makeFadeable, fArgs.node));
return anim; // Animation
};
/*=====
var __FadeArgs = declare(null, {
// node: DOMNode|String
// The node referenced in the animation
// duration: Integer?
// Duration of the animation in milliseconds.
// easing: Function?
// An easing function.
});
=====*/
basefx.fadeIn = function(/*__FadeArgs*/ args){
// summary:
// Returns an animation that will fade node defined in 'args' from
// its current opacity to fully opaque.
return basefx._fade(_mixin({ end: 1 }, args)); // Animation
};
basefx.fadeOut = function(/*__FadeArgs*/ args){
// summary:
// Returns an animation that will fade node defined in 'args'
// from its current opacity to fully transparent.
return basefx._fade(_mixin({ end: 0 }, args)); // Animation
};
basefx._defaultEasing = function(/*Decimal?*/ n){
// summary:
// The default easing function for Animation(s)
return 0.5 + ((Math.sin((n + 1.5) * Math.PI)) / 2); // Decimal
};
var PropLine = function(properties){
// PropLine is an internal class which is used to model the values of
// an a group of CSS properties across an animation lifecycle. In
// particular, the "getValue" function handles getting interpolated
// values between start and end for a particular CSS value.
this._properties = properties;
for(var p in properties){
var prop = properties[p];
if(prop.start instanceof Color){
// create a reusable temp color object to keep intermediate results
prop.tempColor = new Color();
}
}
};
PropLine.prototype.getValue = function(r){
var ret = {};
for(var p in this._properties){
var prop = this._properties[p],
start = prop.start;
if(start instanceof Color){
ret[p] = Color.blendColors(start, prop.end, r, prop.tempColor).toCss();
}else if(!lang.isArray(start)){
ret[p] = ((prop.end - start) * r) + start + (p != "opacity" ? prop.units || "px" : 0);
}
}
return ret;
};
/*=====
var __AnimArgs = declare(__FadeArgs, {
// properties: Object?
// A hash map of style properties to Objects describing the transition,
// such as the properties of _Line with an additional 'units' property
properties: {}
//TODOC: add event callbacks
});
=====*/
basefx.animateProperty = function(/*__AnimArgs*/ args){
// summary:
// Returns an animation that will transition the properties of
// node defined in `args` depending how they are defined in
// `args.properties`
//
// description:
// Foundation of most `dojo/_base/fx`
// animations. It takes an object of "properties" corresponding to
// style properties, and animates them in parallel over a set
// duration.
//
// example:
// A simple animation that changes the width of the specified node.
// | basefx.animateProperty({
// | node: "nodeId",
// | properties: { width: 400 },
// | }).play();
// Dojo figures out the start value for the width and converts the
// integer specified for the width to the more expressive but
// verbose form `{ width: { end: '400', units: 'px' } }` which you
// can also specify directly. Defaults to 'px' if omitted.
//
// example:
// Animate width, height, and padding over 2 seconds... the
// pedantic way:
// | basefx.animateProperty({ node: node, duration:2000,
// | properties: {
// | width: { start: '200', end: '400', units:"px" },
// | height: { start:'200', end: '400', units:"px" },
// | paddingTop: { start:'5', end:'50', units:"px" }
// | }
// | }).play();
// Note 'paddingTop' is used over 'padding-top'. Multi-name CSS properties
// are written using "mixed case", as the hyphen is illegal as an object key.
//
// example:
// Plug in a different easing function and register a callback for
// when the animation ends. Easing functions accept values between
// zero and one and return a value on that basis. In this case, an
// exponential-in curve.
// | basefx.animateProperty({
// | node: "nodeId",
// | // dojo figures out the start value
// | properties: { width: { end: 400 } },
// | easing: function(n){
// | return (n==0) ? 0 : Math.pow(2, 10 * (n - 1));
// | },
// | onEnd: function(node){
// | // called when the animation finishes. The animation
// | // target is passed to this function
// | }
// | }).play(500); // delay playing half a second
//
// example:
// Like all `Animation`s, animateProperty returns a handle to the
// Animation instance, which fires the events common to Dojo FX. Use `aspect.after`
// to access these events outside of the Animation definition:
// | var anim = basefx.animateProperty({
// | node:"someId",
// | properties:{
// | width:400, height:500
// | }
// | });
// | aspect.after(anim, "onEnd", function(){
// | console.log("animation ended");
// | }, true);
// | // play the animation now:
// | anim.play();
//
// example:
// Each property can be a function whose return value is substituted along.
// Additionally, each measurement (eg: start, end) can be a function. The node
// reference is passed directly to callbacks.
// | basefx.animateProperty({
// | node:"mine",
// | properties:{
// | height:function(node){
// | // shrink this node by 50%
// | return domGeom.position(node).h / 2
// | },
// | width:{
// | start:function(node){ return 100; },
// | end:function(node){ return 200; }
// | }
// | }
// | }).play();
//
var n = args.node = dom.byId(args.node);
if(!args.easing){ args.easing = dojo._defaultEasing; }
var anim = new Animation(args);
connect.connect(anim, "beforeBegin", anim, function(){
var pm = {};
for(var p in this.properties){
// Make shallow copy of properties into pm because we overwrite
// some values below. In particular if start/end are functions
// we don't want to overwrite them or the functions won't be
// called if the animation is reused.
if(p == "width" || p == "height"){
this.node.display = "block";
}
var prop = this.properties[p];
if(lang.isFunction(prop)){
prop = prop(n);
}
prop = pm[p] = _mixin({}, (lang.isObject(prop) ? prop: { end: prop }));
if(lang.isFunction(prop.start)){
prop.start = prop.start(n);
}
if(lang.isFunction(prop.end)){
prop.end = prop.end(n);
}
var isColor = (p.toLowerCase().indexOf("color") >= 0);
function getStyle(node, p){
// domStyle.get(node, "height") can return "auto" or "" on IE; this is more reliable:
var v = { height: node.offsetHeight, width: node.offsetWidth }[p];
if(v !== undefined){ return v; }
v = style.get(node, p);
return (p == "opacity") ? +v : (isColor ? v : parseFloat(v));
}
if(!("end" in prop)){
prop.end = getStyle(n, p);
}else if(!("start" in prop)){
prop.start = getStyle(n, p);
}
if(isColor){
prop.start = new Color(prop.start);
prop.end = new Color(prop.end);
}else{
prop.start = (p == "opacity") ? +prop.start : parseFloat(prop.start);
}
}
this.curve = new PropLine(pm);
});
connect.connect(anim, "onAnimate", lang.hitch(style, "set", anim.node));
return anim; // Animation
};
basefx.anim = function( /*DOMNode|String*/ node,
/*Object*/ properties,
/*Integer?*/ duration,
/*Function?*/ easing,
/*Function?*/ onEnd,
/*Integer?*/ delay){
// summary:
// A simpler interface to `animateProperty()`, also returns
// an instance of `Animation` but begins the animation
// immediately, unlike nearly every other Dojo animation API.
// description:
// Simpler (but somewhat less powerful) version
// of `animateProperty`. It uses defaults for many basic properties
// and allows for positional parameters to be used in place of the
// packed "property bag" which is used for other Dojo animation
// methods.
//
// The `Animation` object returned will be already playing, so
// calling play() on it again is (usually) a no-op.
// node:
// a DOM node or the id of a node to animate CSS properties on
// duration:
// The number of milliseconds over which the animation
// should run. Defaults to the global animation default duration
// (350ms).
// easing:
// An easing function over which to calculate acceleration
// and deceleration of the animation through its duration.
// A default easing algorithm is provided, but you may
// plug in any you wish. A large selection of easing algorithms
// are available in `dojo/fx/easing`.
// onEnd:
// A function to be called when the animation finishes
// running.
// delay:
// The number of milliseconds to delay beginning the
// animation by. The default is 0.
// example:
// Fade out a node
// | basefx.anim("id", { opacity: 0 });
// example:
// Fade out a node over a full second
// | basefx.anim("id", { opacity: 0 }, 1000);
return basefx.animateProperty({ // Animation
node: node,
duration: duration || Animation.prototype.duration,
properties: properties,
easing: easing,
onEnd: onEnd
}).play(delay || 0);
};
if( 1 ){
_mixin(dojo, basefx);
// Alias to drop come 2.0:
dojo._Animation = Animation;
}
return basefx;
});
| pvnr0082t/cdnjs | ajax/libs/dojo/1.8.1/_base/fx.js.uncompressed.js | JavaScript | mit | 19,488 |
YUI.add("autocomplete-base",function(e,t){function T(){}var n=e.Escape,r=e.Lang,i=e.Array,s=e.Object,o=r.isFunction,u=r.isString,a=r.trim,f=e.Attribute.INVALID_VALUE,l="_functionValidator",c="_sourceSuccess",h="allowBrowserAutocomplete",p="inputNode",d="query",v="queryDelimiter",m="requestTemplate",g="results",y="resultListLocator",b="value",w="valueChange",E="clear",S=d,x=g;T.prototype={initializer:function(){e.before(this._bindUIACBase,this,"bindUI"),e.before(this._syncUIACBase,this,"syncUI"),this.publish(E,{defaultFn:this._defClearFn}),this.publish(S,{defaultFn:this._defQueryFn}),this.publish(x,{defaultFn:this._defResultsFn})},destructor:function(){this._acBaseEvents&&this._acBaseEvents.detach(),delete this._acBaseEvents,delete this._cache,delete this._inputNode,delete this._rawSource},clearCache:function(){return this._cache&&(this._cache={}),this},sendRequest:function(t,n){var r,i=this.get("source");return t||t===""?this._set(d,t):t=this.get(d)||"",i&&(n||(n=this.get(m)),r=n?n.call(this,t):t,i.sendRequest({query:t,request:r,callback:{success:e.bind(this._onResponse,this,t)}})),this},_bindUIACBase:function(){var t=this.get(p),n=t&&t.tokenInput;n&&(t=n.get(p),this._set("tokenInput",n));if(!t){e.error("No inputNode specified.");return}this._inputNode=t,this._acBaseEvents=new e.EventHandle([t.on(w,this._onInputValueChange,this),t.on("blur",this._onInputBlur,this),this.after(h+"Change",this._syncBrowserAutocomplete),this.after("sourceTypeChange",this._afterSourceTypeChange),this.after(w,this._afterValueChange)])},_syncUIACBase:function(){this._syncBrowserAutocomplete(),this.set(b,this.get(p).get(b))},_createArraySource:function(e){var t=this;return{type:"array",sendRequest:function(n){t[c](e.concat(),n)}}},_createFunctionSource:function(e){var t=this;return{type:"function",sendRequest:function(n){function i(e){t[c](e||[],n)}var r;(r=e(n.query,i))&&i(r)}}},_createObjectSource:function(e){var t=this;return{type:"object",sendRequest:function(n){var r=n.query;t[c](s.owns(e,r)?e[r]:[],n)}}},_functionValidator:function(e){return e===null||o(e)},_getObjectValue:function(e,t){if(!e)return;for(var n=0,r=t.length;e&&n<r;n++)e=e[t[n]];return e},_parseResponse:function(e,t,r){var i={data:r,query:e,results:[]},s=this.get(y),o=[],u=t&&t.results,a,f,l,c,h,p,d,v,m,g,b;u&&s&&(u=s.call(this,u));if(u&&u.length){a=this.get("resultFilters"),b=this.get("resultTextLocator");for(p=0,d=u.length;p<d;++p)m=u[p],g=b?b.call(this,m):m.toString(),o.push({display:n.html(g),raw:m,text:g});for(p=0,d=a.length;p<d;++p){o=a[p].call(this,e,o.concat());if(!o)return;if(!o.length)break}if(o.length){l=this.get("resultFormatter"),h=this.get("resultHighlighter"),v=this.get("maxResults"),v&&v>0&&o.length>v&&(o.length=v);if(h){c=h.call(this,e,o.concat());if(!c)return;for(p=0,d=c.length;p<d;++p)m=o[p],m.highlighted=c[p],m.display=m.highlighted}if(l){f=l.call(this,e,o.concat());if(!f)return;for(p=0,d=f.length;p<d;++p)o[p].display=f[p]}}}i.results=o,this.fire(x,i)},_parseValue:function(e){var t=this.get(v);return t&&(e=e.split(t),e=e[e.length-1]),r.trimLeft(e)},_setEnableCache:function(e){this._cache=e?{}:null},_setLocator:function(e){if(this[l](e))return e;var t=this;return e=e.toString().split("."),function(n){return n&&t._getObjectValue(n,e)}},_setRequestTemplate:function(e){return this[l](e)?e:(e=e.toString(),function(t){return r.sub(e,{query:encodeURIComponent(t)})})},_setResultFilters:function(t){var n,s;return t===null?[]:(n=e.AutoCompleteFilters,s=function(e){return o(e)?e:u(e)&&n&&o(n[e])?n[e]:!1},r.isArray(t)?(t=i.map(t,s),i.every(t,function(e){return!!e})?t:f):(t=s(t),t?[t]:f))},_setResultHighlighter:function(t){var n;return this[l](t)?t:(n=e.AutoCompleteHighlighters,u(t)&&n&&o(n[t])?n[t]:f)},_setSource:function(t){var n=this.get("sourceType")||r.type(t),i;return t&&o(t.sendRequest)||t===null||n==="datasource"?(this._rawSource=t,t):(i=T.SOURCE_TYPES[n])?(this._rawSource=t,r.isString(i)?this[i](t):i(t)):(e.error("Unsupported source type '"+n+"'. Maybe autocomplete-sources isn't loaded?"),f)},_sourceSuccess:function(e,t){t.callback.success({data:e,response:{results:e}})},_syncBrowserAutocomplete:function(){var e=this.get(p);e.get("nodeName").toLowerCase()==="input"&&e.setAttribute("autocomplete",this.get(h)?"on":"off")},_updateValue:function(e){var t=this.get(v),n,s,o;e=r.trimLeft(e),t&&(n=a(t),o=i.map(a(this.get(b)).split(t),a),s=o.length,s>1&&(o[s-1]=e,e=o.join(n+" ")),e=e+n+" "),this.set(b,e)},_afterSourceTypeChange:function(e){this._rawSource&&this.set("source",this._rawSource)},_afterValueChange:function(e){var t=e.newVal,n=this,r=e.src===T.UI_SRC,i,s,o,u;r||n._inputNode.set(b,t),o=n.get("minQueryLength"),u=n._parseValue(t)||"",o>=0&&u.length>=o?r?(i=n.get("queryDelay"),s=function(){n.fire(S,{inputValue:t,query:u,src:e.src})},i?(clearTimeout(n._delay),n._delay=setTimeout(s,i)):s()):n._set(d,u):(clearTimeout(n._delay),n.fire(E,{prevVal:e.prevVal?n._parseValue(e.prevVal):null,src:e.src}))},_onInputBlur:function(e){var t=this.get(v),n,i,s;if(t&&!this.get("allowTrailingDelimiter")){t=r.trimRight(t),s=i=this._inputNode.get(b);if(t)while((i=r.trimRight(i))&&(n=i.length-t.length)&&i.lastIndexOf(t)===n)i=i.substring(0,n);else i=r.trimRight(i);i!==s&&this.set(b,i)}},_onInputValueChange:function(e){var t=e.newVal;t!==this.get(b)&&this.set(b,t,{src:T.UI_SRC})},_onResponse:function(e,t){e===(this.get(d)||"")&&this._parseResponse(e||"",t.response,t.data)},_defClearFn:function(){this._set(d,null),this._set(g,[])},_defQueryFn:function(e){this.sendRequest(e.query)},_defResultsFn:function(e){this._set(g,e[g])}},T.ATTRS={allowBrowserAutocomplete:{value:!1},allowTrailingDelimiter:{value:!1},enableCache:{lazyAdd:!1,setter:"_setEnableCache",value:!0},inputNode:{setter:e.one,writeOnce:"initOnly"},maxResults:{value:0},minQueryLength:{value:1},query:{readOnly:!0,value:null},queryDelay:{value:100},queryDelimiter:{value:null},requestTemplate:{setter:"_setRequestTemplate",value:null},resultFilters:{setter:"_setResultFilters",value:[]},resultFormatter
:{validator:l,value:null},resultHighlighter:{setter:"_setResultHighlighter",value:null},resultListLocator:{setter:"_setLocator",value:null},results:{readOnly:!0,value:[]},resultTextLocator:{setter:"_setLocator",value:null},source:{setter:"_setSource",value:null},sourceType:{value:null},tokenInput:{readOnly:!0},value:{value:""}},T._buildCfg={aggregates:["SOURCE_TYPES"],statics:["UI_SRC"]},T.SOURCE_TYPES={array:"_createArraySource","function":"_createFunctionSource",object:"_createObjectSource"},T.UI_SRC=e.Widget&&e.Widget.UI_SRC||"ui",e.AutoCompleteBase=T},"@VERSION@",{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]});
| Timbioz/cdnjs | ajax/libs/yui/3.9.1/autocomplete-base/autocomplete-base-min.js | JavaScript | mit | 6,695 |
var arrayEvery = require('../internal/arrayEvery'),
baseCallback = require('../internal/baseCallback'),
baseEvery = require('../internal/baseEvery'),
isArray = require('../lang/isArray'),
isIterateeCall = require('../internal/isIterateeCall');
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* The predicate is bound to `thisArg` and invoked with three arguments:
* (value, index|key, collection).
*
* If a property name is provided for `predicate` the created `_.property`
* style callback returns the property value of the given element.
*
* If a value is also provided for `thisArg` the created `_.matchesProperty`
* style callback returns `true` for elements that have a matching property
* value, else `false`.
*
* If an object is provided for `predicate` the created `_.matches` style
* callback returns `true` for elements that have the properties of the given
* object, else `false`.
*
* @static
* @memberOf _
* @alias all
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false }
* ];
*
* // using the `_.matches` callback shorthand
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // using the `_.matchesProperty` callback shorthand
* _.every(users, 'active', false);
* // => true
*
* // using the `_.property` callback shorthand
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, thisArg) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
predicate = undefined;
}
if (typeof predicate != 'function' || thisArg !== undefined) {
predicate = baseCallback(predicate, thisArg, 3);
}
return func(collection, predicate);
}
module.exports = every;
| jeffreymendez1993/avon | node_modules/grunt-nodemon/node_modules/nodemon/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/every.js | JavaScript | mit | 2,263 |
YUI.add('async-queue', function (Y, NAME) {
/**
* <p>AsyncQueue allows you create a chain of function callbacks executed
* via setTimeout (or synchronously) that are guaranteed to run in order.
* Items in the queue can be promoted or removed. Start or resume the
* execution chain with run(). pause() to temporarily delay execution, or
* stop() to halt and clear the queue.</p>
*
* @module async-queue
*/
/**
* <p>A specialized queue class that supports scheduling callbacks to execute
* sequentially, iteratively, even asynchronously.</p>
*
* <p>Callbacks can be function refs or objects with the following keys. Only
* the <code>fn</code> key is required.</p>
*
* <ul>
* <li><code>fn</code> -- The callback function</li>
* <li><code>context</code> -- The execution context for the callbackFn.</li>
* <li><code>args</code> -- Arguments to pass to callbackFn.</li>
* <li><code>timeout</code> -- Millisecond delay before executing callbackFn.
* (Applies to each iterative execution of callback)</li>
* <li><code>iterations</code> -- Number of times to repeat the callback.
* <li><code>until</code> -- Repeat the callback until this function returns
* true. This setting trumps iterations.</li>
* <li><code>autoContinue</code> -- Set to false to prevent the AsyncQueue from
* executing the next callback in the Queue after
* the callback completes.</li>
* <li><code>id</code> -- Name that can be used to get, promote, get the
* indexOf, or delete this callback.</li>
* </ul>
*
* @class AsyncQueue
* @extends EventTarget
* @constructor
* @param callback* {Function|Object} 0..n callbacks to seed the queue
*/
Y.AsyncQueue = function() {
this._init();
this.add.apply(this, arguments);
};
var Queue = Y.AsyncQueue,
EXECUTE = 'execute',
SHIFT = 'shift',
PROMOTE = 'promote',
REMOVE = 'remove',
isObject = Y.Lang.isObject,
isFunction = Y.Lang.isFunction;
/**
* <p>Static default values used to populate callback configuration properties.
* Preconfigured defaults include:</p>
*
* <ul>
* <li><code>autoContinue</code>: <code>true</code></li>
* <li><code>iterations</code>: 1</li>
* <li><code>timeout</code>: 10 (10ms between callbacks)</li>
* <li><code>until</code>: (function to run until iterations <= 0)</li>
* </ul>
*
* @property defaults
* @type {Object}
* @static
*/
Queue.defaults = Y.mix({
autoContinue : true,
iterations : 1,
timeout : 10,
until : function () {
this.iterations |= 0;
return this.iterations <= 0;
}
}, Y.config.queueDefaults || {});
Y.extend(Queue, Y.EventTarget, {
/**
* Used to indicate the queue is currently executing a callback.
*
* @property _running
* @type {Boolean|Object} true for synchronous callback execution, the
* return handle from Y.later for async callbacks.
* Otherwise false.
* @protected
*/
_running : false,
/**
* Initializes the AsyncQueue instance properties and events.
*
* @method _init
* @protected
*/
_init : function () {
Y.EventTarget.call(this, { prefix: 'queue', emitFacade: true });
this._q = [];
/**
* Callback defaults for this instance. Static defaults that are not
* overridden are also included.
*
* @property defaults
* @type {Object}
*/
this.defaults = {};
this._initEvents();
},
/**
* Initializes the instance events.
*
* @method _initEvents
* @protected
*/
_initEvents : function () {
this.publish({
'execute' : { defaultFn : this._defExecFn, emitFacade: true },
'shift' : { defaultFn : this._defShiftFn, emitFacade: true },
'add' : { defaultFn : this._defAddFn, emitFacade: true },
'promote' : { defaultFn : this._defPromoteFn, emitFacade: true },
'remove' : { defaultFn : this._defRemoveFn, emitFacade: true }
});
},
/**
* Returns the next callback needing execution. If a callback is
* configured to repeat via iterations or until, it will be returned until
* the completion criteria is met.
*
* When the queue is empty, null is returned.
*
* @method next
* @return {Function} the callback to execute
*/
next : function () {
var callback;
while (this._q.length) {
callback = this._q[0] = this._prepare(this._q[0]);
if (callback && callback.until()) {
this.fire(SHIFT, { callback: callback });
callback = null;
} else {
break;
}
}
return callback || null;
},
/**
* Default functionality for the "shift" event. Shifts the
* callback stored in the event object's <em>callback</em> property from
* the queue if it is the first item.
*
* @method _defShiftFn
* @param e {Event} The event object
* @protected
*/
_defShiftFn : function (e) {
if (this.indexOf(e.callback) === 0) {
this._q.shift();
}
},
/**
* Creates a wrapper function to execute the callback using the aggregated
* configuration generated by combining the static AsyncQueue.defaults, the
* instance defaults, and the specified callback settings.
*
* The wrapper function is decorated with the callback configuration as
* properties for runtime modification.
*
* @method _prepare
* @param callback {Object|Function} the raw callback
* @return {Function} a decorated function wrapper to execute the callback
* @protected
*/
_prepare: function (callback) {
if (isFunction(callback) && callback._prepared) {
return callback;
}
var config = Y.merge(
Queue.defaults,
{ context : this, args: [], _prepared: true },
this.defaults,
(isFunction(callback) ? { fn: callback } : callback)),
wrapper = Y.bind(function () {
if (!wrapper._running) {
wrapper.iterations--;
}
if (isFunction(wrapper.fn)) {
wrapper.fn.apply(wrapper.context || Y,
Y.Array(wrapper.args));
}
}, this);
return Y.mix(wrapper, config);
},
/**
* Sets the queue in motion. All queued callbacks will be executed in
* order unless pause() or stop() is called or if one of the callbacks is
* configured with autoContinue: false.
*
* @method run
* @return {AsyncQueue} the AsyncQueue instance
* @chainable
*/
run : function () {
var callback,
cont = true;
for (callback = this.next();
cont && callback && !this.isRunning();
callback = this.next())
{
cont = (callback.timeout < 0) ?
this._execute(callback) :
this._schedule(callback);
}
if (!callback) {
/**
* Event fired after the last queued callback is executed.
* @event complete
*/
this.fire('complete');
}
return this;
},
/**
* Handles the execution of callbacks. Returns a boolean indicating
* whether it is appropriate to continue running.
*
* @method _execute
* @param callback {Object} the callback object to execute
* @return {Boolean} whether the run loop should continue
* @protected
*/
_execute : function (callback) {
this._running = callback._running = true;
callback.iterations--;
this.fire(EXECUTE, { callback: callback });
var cont = this._running && callback.autoContinue;
this._running = callback._running = false;
return cont;
},
/**
* Schedules the execution of asynchronous callbacks.
*
* @method _schedule
* @param callback {Object} the callback object to execute
* @return {Boolean} whether the run loop should continue
* @protected
*/
_schedule : function (callback) {
this._running = Y.later(callback.timeout, this, function () {
if (this._execute(callback)) {
this.run();
}
});
return false;
},
/**
* Determines if the queue is waiting for a callback to complete execution.
*
* @method isRunning
* @return {Boolean} true if queue is waiting for a
* from any initiated transactions
*/
isRunning : function () {
return !!this._running;
},
/**
* Default functionality for the "execute" event. Executes the
* callback function
*
* @method _defExecFn
* @param e {Event} the event object
* @protected
*/
_defExecFn : function (e) {
e.callback();
},
/**
* Add any number of callbacks to the end of the queue. Callbacks may be
* provided as functions or objects.
*
* @method add
* @param callback* {Function|Object} 0..n callbacks
* @return {AsyncQueue} the AsyncQueue instance
* @chainable
*/
add : function () {
this.fire('add', { callbacks: Y.Array(arguments,0,true) });
return this;
},
/**
* Default functionality for the "add" event. Adds the callbacks
* in the event facade to the queue. Callbacks successfully added to the
* queue are present in the event's <code>added</code> property in the
* after phase.
*
* @method _defAddFn
* @param e {Event} the event object
* @protected
*/
_defAddFn : function(e) {
var _q = this._q,
added = [];
Y.Array.each(e.callbacks, function (c) {
if (isObject(c)) {
_q.push(c);
added.push(c);
}
});
e.added = added;
},
/**
* Pause the execution of the queue after the execution of the current
* callback completes. If called from code outside of a queued callback,
* clears the timeout for the pending callback. Paused queue can be
* restarted with q.run()
*
* @method pause
* @return {AsyncQueue} the AsyncQueue instance
* @chainable
*/
pause: function () {
if (isObject(this._running)) {
this._running.cancel();
}
this._running = false;
return this;
},
/**
* Stop and clear the queue after the current execution of the
* current callback completes.
*
* @method stop
* @return {AsyncQueue} the AsyncQueue instance
* @chainable
*/
stop : function () {
this._q = [];
return this.pause();
},
/**
* Returns the current index of a callback. Pass in either the id or
* callback function from getCallback.
*
* @method indexOf
* @param callback {String|Function} the callback or its specified id
* @return {Number} index of the callback or -1 if not found
*/
indexOf : function (callback) {
var i = 0, len = this._q.length, c;
for (; i < len; ++i) {
c = this._q[i];
if (c === callback || c.id === callback) {
return i;
}
}
return -1;
},
/**
* Retrieve a callback by its id. Useful to modify the configuration
* while the queue is running.
*
* @method getCallback
* @param id {String} the id assigned to the callback
* @return {Object} the callback object
*/
getCallback : function (id) {
var i = this.indexOf(id);
return (i > -1) ? this._q[i] : null;
},
/**
* Promotes the named callback to the top of the queue. If a callback is
* currently executing or looping (via until or iterations), the promotion
* is scheduled to occur after the current callback has completed.
*
* @method promote
* @param callback {String|Object} the callback object or a callback's id
* @return {AsyncQueue} the AsyncQueue instance
* @chainable
*/
promote : function (callback) {
var payload = { callback : callback },e;
if (this.isRunning()) {
e = this.after(SHIFT, function () {
this.fire(PROMOTE, payload);
e.detach();
}, this);
} else {
this.fire(PROMOTE, payload);
}
return this;
},
/**
* <p>Default functionality for the "promote" event. Promotes the
* named callback to the head of the queue.</p>
*
* <p>The event object will contain a property "callback", which
* holds the id of a callback or the callback object itself.</p>
*
* @method _defPromoteFn
* @param e {Event} the custom event
* @protected
*/
_defPromoteFn : function (e) {
var i = this.indexOf(e.callback),
promoted = (i > -1) ? this._q.splice(i,1)[0] : null;
e.promoted = promoted;
if (promoted) {
this._q.unshift(promoted);
}
},
/**
* Removes the callback from the queue. If the queue is active, the
* removal is scheduled to occur after the current callback has completed.
*
* @method remove
* @param callback {String|Object} the callback object or a callback's id
* @return {AsyncQueue} the AsyncQueue instance
* @chainable
*/
remove : function (callback) {
var payload = { callback : callback },e;
// Can't return the removed callback because of the deferral until
// current callback is complete
if (this.isRunning()) {
e = this.after(SHIFT, function () {
this.fire(REMOVE, payload);
e.detach();
},this);
} else {
this.fire(REMOVE, payload);
}
return this;
},
/**
* <p>Default functionality for the "remove" event. Removes the
* callback from the queue.</p>
*
* <p>The event object will contain a property "callback", which
* holds the id of a callback or the callback object itself.</p>
*
* @method _defRemoveFn
* @param e {Event} the custom event
* @protected
*/
_defRemoveFn : function (e) {
var i = this.indexOf(e.callback);
e.removed = (i > -1) ? this._q.splice(i,1)[0] : null;
},
/**
* Returns the number of callbacks in the queue.
*
* @method size
* @return {Number}
*/
size : function () {
// next() flushes callbacks that have met their until() criteria and
// therefore shouldn't count since they wouldn't execute anyway.
if (!this.isRunning()) {
this.next();
}
return this._q.length;
}
});
}, '@VERSION@', {"requires": ["event-custom"]});
| wackyapples/cdnjs | ajax/libs/yui/3.10.0/async-queue/async-queue-debug.js | JavaScript | mit | 15,382 |
YUI.add('color-hsl', function (Y, NAME) {
/**
Color provides static methods for color conversion to hsl values.
Y.Color.toHSL('f00'); // hsl(0, 100%, 50%)
Y.Color.toHSLA('rgb(255, 255, 0'); // hsla(60, 100%, 50%, 1)
@module color
@submodule color-hsl
@class HSL
@namespace Color
@since 3.8.0
**/
Color = {
/**
@static
@property REGEX_HSL
@type RegExp
@default /hsla?\(([.\d]*), ?([.\d]*)%, ?([.\d]*)%,? ?([.\d]*)?\)/
@since 3.8.0
**/
REGEX_HSL: /hsla?\(([.\d]*), ?([.\d]*)%, ?([.\d]*)%,? ?([.\d]*)?\)/,
/**
@static
@property STR_HSL
@type String
@default hsl({*}, {*}%, {*}%)
@since 3.8.0
**/
STR_HSL: 'hsl({*}, {*}%, {*}%)',
/**
@static
@property STR_HSLA
@type String
@default hsla({*}, {*}%, {*}%, {*})
@since 3.8.0
**/
STR_HSLA: 'hsla({*}, {*}%, {*}%, {*})',
/**
Converts provided color value to an HSL string.
@public
@method toHSL
@param {String} str
@return {String}
@since 3.8.0
**/
toHSL: function (str) {
var clr = Y.Color._convertTo(str, 'hsl');
return clr.toLowerCase();
},
/**
Converts provided color value to an HSLA string.
@public
@method toHSLA
@param {String} str
@return {String}
@since 3.8.0
**/
toHSLA: function (str) {
var clr = Y.Color._convertTo(str, 'hsla');
return clr.toLowerCase();
},
/**
Parses the RGB string into h, s, l values. Will return an Array
of values or an HSL string.
@protected
@method _rgbToHsl
@param {String} str
@param {Boolean} [toArray]
@return {String|Array}
@since 3.8.0
**/
_rgbToHsl: function (str, toArray) {
var h, s, l,
rgb = Y.Color.REGEX_RGB.exec(str),
r = rgb[1] / 255,
g = rgb[2] / 255,
b = rgb[3] / 255,
max = Math.max(r, g, b),
min = Math.min(r, g, b),
isGrayScale = false,
sub = max - min,
sum = max + min;
if (r === g && g === b) {
isGrayScale = true;
}
// hue
if (sub === 0) {
h = 0;
} else if (r === max) {
h = ((60 * (g - b) / sub) + 360) % 360;
} else if (g === max) {
h = (60 * (b - r) / sub) + 120;
} else {
h = (60 * (r - g) / sub) + 240;
}
// lightness
l = sum / 2;
// saturation
if (l === 0 || l === 1) {
s = l;
} else if (l <= 0.5) {
s = sub / sum;
} else {
s = sub / (2 - sum);
}
if (isGrayScale) {
s = 0;
}
// clean up hsl
h = Math.round(h);
s = Math.round(s * 100);
l = Math.round(l * 100);
if (toArray) {
return [h, s, l];
}
return 'hsl(' + h + ', ' + s + '%, ' + l + '%)';
},
/**
Parses the HSL string into r, b, g values. Will return an Array
of values or an RGB string.
@protected
@method _hslToRgb
@param {String} str
@param {Boolean} [toArray]
@return {String|Array}
@since 3.8.0
**/
_hslToRgb: function (str, toArray) {
// assume input is [h, s, l]
// TODO: Find legals for use of formula
var hsl = Y.Color.REGEX_HSL.exec(str),
h = parseInt(hsl[1], 10) / 360,
s = parseInt(hsl[2], 10) / 100,
l = parseInt(hsl[3], 10) / 100,
r,
g,
b,
p,
q;
if (l <= 0.5) {
q = l * (s + 1);
} else {
q = (l + s) - (l * s);
}
p = 2 * l - q;
r = Math.round(Color._hueToRGB(p, q, h + 1/3) * 255);
g = Math.round(Color._hueToRGB(p, q, h) * 255);
b = Math.round(Color._hueToRGB(p, q, h - 1/3) * 255);
if (toArray) {
return [r, g, b];
}
return 'rgb(' + r + ', ' + g + ', ' + b + ')';
},
/**
Converts the HSL hue to the different channels for RGB
@protected
@method _hueToRGB
@param {Number} p
@param {Number} q
@param {Number} hue
@return {Number} value for requested channel
@since 3.8.0
**/
_hueToRGB: function(p, q, hue) {
// TODO: Find legals for use of formula
if (hue < 0) {
hue += 1;
} else if (hue > 1) {
hue -= 1;
}
if (hue * 6 < 1) {
return p + (q - p) * 6 * hue;
}
if (hue * 2 < 1) {
return q;
}
if (hue * 3 < 2) {
return p + (q - p) * (2/3 - hue) * 6;
}
return p;
}
};
Y.Color = Y.mix(Color, Y.Color);
Y.Color.TYPES = Y.mix(Y.Color.TYPES, {'HSL':'hsl', 'HSLA':'hsla'});
Y.Color.CONVERTS = Y.mix(Y.Color.CONVERTS, {'hsl': 'toHSL', 'hsla': 'toHSLA'});
}, '@VERSION@', {"requires": ["color-base"]});
| jessepollak/cdnjs | ajax/libs/yui/3.11.0/color-hsl/color-hsl-debug.js | JavaScript | mit | 4,980 |
YUI.add('color-hsv', function (Y, NAME) {
/**
Color provides static methods for color conversion hsv values.
Y.Color.toHSV('f00'); // hsv(0, 100%, 100%)
Y.Color.toHSVA('rgb(255, 255, 0'); // hsva(60, 100%, 100%, 1)
@module color
@submodule color-hsv
@class HSV
@namespace Color
@since 3.8.0
**/
Color = {
/**
@static
@property REGEX_HSV
@type RegExp
@default /hsva?\(([.\d]*), ?([.\d]*)%, ?([.\d]*)%,? ?([.\d]*)?\)/
@since 3.8.0
**/
REGEX_HSV: /hsva?\(([.\d]*), ?([.\d]*)%, ?([.\d]*)%,? ?([.\d]*)?\)/,
/**
@static
@property STR_HSV
@type String
@default hsv({*}, {*}%, {*}%)
@since 3.8.0
**/
STR_HSV: 'hsv({*}, {*}%, {*}%)',
/**
@static
@property STR_HSVA
@type String
@default hsva({*}, {*}%, {*}%, {*})
@since 3.8.0
**/
STR_HSVA: 'hsva({*}, {*}%, {*}%, {*})',
/**
Converts provided color value to an HSV string.
@public
@method toHSV
@param {String} str
@return {String}
@since 3.8.0
**/
toHSV: function (str) {
var clr = Y.Color._convertTo(str, 'hsv');
return clr.toLowerCase();
},
/**
Converts provided color value to an HSVA string.
@public
@method toHSVA
@param {String} str
@return {String}
@since 3.8.0
**/
toHSVA: function (str) {
var clr = Y.Color._convertTo(str, 'hsva');
return clr.toLowerCase();
},
/**
Parses the RGB string into h, s, v values. Will return an Array
of values or an HSV string.
@protected
@method _rgbToHsv
@param {String} str
@param {Boolean} [toArray]
@return {String|Array}
@since 3.8.0
**/
_rgbToHsv: function (str, toArray) {
var h, s, v,
rgb = Y.Color.REGEX_RGB.exec(str),
r = rgb[1] / 255,
g = rgb[2] / 255,
b = rgb[3] / 255,
max = Math.max(r, g, b),
min = Math.min(r, g, b),
delta = max - min;
if (max === min) {
h = 0;
} else if (max === r) {
h = 60 * (g - b) / delta;
} else if (max === g) {
h = (60 * (b - r) / delta) + 120;
} else { // max === b
h = (60 * (r - g) / delta) + 240;
}
s = (max === 0) ? 0 : 1 - (min / max);
// ensure h is between 0 and 360
while (h < 0) {
h += 360;
}
h %= 360;
h = Math.round(h);
// saturation is percentage
s = Math.round(s * 100);
// value is percentage
v = Math.round(max * 100);
if (toArray) {
return [h, s, v];
}
return Y.Color.fromArray([h, s, v], Y.Color.TYPES.HSV);
},
/**
Parses the HSV string into r, b, g values. Will return an Array
of values or an RGB string.
@protected
@method _hsvToRgb
@param {String} str
@param {Boolean} [toArray]
@return {String|Array}
@since 3.8.0
**/
_hsvToRgb: function (str, toArray) {
var hsv = Y.Color.REGEX_HSV.exec(str),
h = parseInt(hsv[1], 10),
s = parseInt(hsv[2], 10) / 100, // 0 - 1
v = parseInt(hsv[3], 10) / 100, // 0 - 1
r,
g,
b,
i = Math.floor(h / 60) % 6,
f = (h / 60) - i,
p = v * (1 - s),
q = v * (1 - (s * f)),
t = v * (1 - (s * (1 - f)));
if (s === 0) {
r = v;
g = v;
b = v;
} else {
switch (i) {
case 0: r = v; g = t; b = p; break;
case 1: r = q; g = v; b = p; break;
case 2: r = p; g = v; b = t; break;
case 3: r = p; g = q; b = v; break;
case 4: r = t; g = p; b = v; break;
case 5: r = v; g = p; b = q; break;
}
}
r = Math.min(255, Math.round(r * 256));
g = Math.min(255, Math.round(g * 256));
b = Math.min(255, Math.round(b * 256));
if (toArray) {
return [r, g, b];
}
return Y.Color.fromArray([r, g, b], Y.Color.TYPES.RGB);
}
};
Y.Color = Y.mix(Color, Y.Color);
Y.Color.TYPES = Y.mix(Y.Color.TYPES, {'HSV':'hsv', 'HSVA':'hsva'});
Y.Color.CONVERTS = Y.mix(Y.Color.CONVERTS, {'hsv': 'toHSV', 'hsva': 'toHSVA'});
}, '@VERSION@', {"requires": ["color-base"]});
| wallin/cdnjs | ajax/libs/yui/3.10.3/color-hsv/color-hsv-debug.js | JavaScript | mit | 4,428 |
/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* 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.
*/
package org.spongepowered.common.text;
import net.minecraft.util.EnumChatFormatting;
import javax.annotation.Nullable;
public final class ResolvedChatStyle {
@Nullable
public final EnumChatFormatting color;
public final boolean bold;
public final boolean italic;
public final boolean underlined;
public final boolean strikethrough;
public final boolean obfuscated;
public ResolvedChatStyle(@Nullable EnumChatFormatting color,
boolean bold, boolean italic, boolean underlined, boolean strikethrough, boolean obfuscated) {
this.color = color;
this.bold = bold;
this.italic = italic;
this.underlined = underlined;
this.strikethrough = strikethrough;
this.obfuscated = obfuscated;
}
}
| jamierocks/SpongeCommon | src/main/java/org/spongepowered/common/text/ResolvedChatStyle.java | Java | mit | 2,031 |
/**
* React v15.6.0-rc.1
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* Escape and wrap key so it is safe to use as a reactid
*
* @param {string} key to be escaped.
* @return {string} the escaped key.
*/
function escape(key) {
var escapeRegex = /[=:]/g;
var escaperLookup = {
'=': '=0',
':': '=2'
};
var escapedString = ('' + key).replace(escapeRegex, function (match) {
return escaperLookup[match];
});
return '$' + escapedString;
}
/**
* Unescape and unwrap key for human-readable display
*
* @param {string} key to unescape.
* @return {string} the unescaped key.
*/
function unescape(key) {
var unescapeRegex = /(=0|=2)/g;
var unescaperLookup = {
'=0': '=',
'=2': ':'
};
var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
return ('' + keySubstring).replace(unescapeRegex, function (match) {
return unescaperLookup[match];
});
}
var KeyEscapeUtils = {
escape: escape,
unescape: unescape
};
module.exports = KeyEscapeUtils;
},{}],2:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = _dereq_(25);
var invariant = _dereq_(30);
/**
* Static poolers. Several custom versions for each potential number of
* arguments. A completely generic pooler is easy to implement, but would
* require accessing the `arguments` object. In each of these, `this` refers to
* the Class itself, not an instance. If any others are needed, simply add them
* here, or in their own files.
*/
var oneArgumentPooler = function (copyFieldsFrom) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, copyFieldsFrom);
return instance;
} else {
return new Klass(copyFieldsFrom);
}
};
var twoArgumentPooler = function (a1, a2) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2);
return instance;
} else {
return new Klass(a1, a2);
}
};
var threeArgumentPooler = function (a1, a2, a3) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3);
return instance;
} else {
return new Klass(a1, a2, a3);
}
};
var fourArgumentPooler = function (a1, a2, a3, a4) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3, a4);
return instance;
} else {
return new Klass(a1, a2, a3, a4);
}
};
var standardReleaser = function (instance) {
var Klass = this;
!(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
instance.destructor();
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = oneArgumentPooler;
/**
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
* itself (statically) not adding any prototypical fields. Any CopyConstructor
* you give this may have a `poolSize` property, and will look for a
* prototypical `destructor` on instances.
*
* @param {Function} CopyConstructor Constructor that can be used to reset.
* @param {Function} pooler Customizable pooler.
*/
var addPoolingTo = function (CopyConstructor, pooler) {
// Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo: addPoolingTo,
oneArgumentPooler: oneArgumentPooler,
twoArgumentPooler: twoArgumentPooler,
threeArgumentPooler: threeArgumentPooler,
fourArgumentPooler: fourArgumentPooler
};
module.exports = PooledClass;
},{"25":25,"30":30}],3:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = _dereq_(32);
var ReactBaseClasses = _dereq_(4);
var ReactChildren = _dereq_(5);
var ReactDOMFactories = _dereq_(8);
var ReactElement = _dereq_(9);
var ReactPropTypes = _dereq_(14);
var ReactVersion = _dereq_(17);
var createReactClass = _dereq_(20);
var onlyChild = _dereq_(24);
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
var cloneElement = ReactElement.cloneElement;
if ("development" !== 'production') {
var lowPriorityWarning = _dereq_(23);
var canDefineProperty = _dereq_(18);
var ReactElementValidator = _dereq_(11);
var didWarnPropTypesDeprecated = false;
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
cloneElement = ReactElementValidator.cloneElement;
}
var __spread = _assign;
var createMixin = function (mixin) {
return mixin;
};
if ("development" !== 'production') {
var warnedForSpread = false;
var warnedForCreateMixin = false;
__spread = function () {
lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.');
warnedForSpread = true;
return _assign.apply(null, arguments);
};
createMixin = function (mixin) {
lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.');
warnedForCreateMixin = true;
return mixin;
};
}
var React = {
// Modern
Children: {
map: ReactChildren.map,
forEach: ReactChildren.forEach,
count: ReactChildren.count,
toArray: ReactChildren.toArray,
only: onlyChild
},
Component: ReactBaseClasses.Component,
PureComponent: ReactBaseClasses.PureComponent,
createElement: createElement,
cloneElement: cloneElement,
isValidElement: ReactElement.isValidElement,
// Classic
PropTypes: ReactPropTypes,
createClass: createReactClass,
createFactory: createFactory,
createMixin: createMixin,
// This looks DOM specific but these are actually isomorphic helpers
// since they are just generating DOM strings.
DOM: ReactDOMFactories,
version: ReactVersion,
// Deprecated hook for JSX spread, don't use this for anything.
__spread: __spread
};
if ("development" !== 'production') {
var warnedForCreateClass = false;
if (canDefineProperty) {
Object.defineProperty(React, 'PropTypes', {
get: function () {
lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs');
didWarnPropTypesDeprecated = true;
return ReactPropTypes;
}
});
Object.defineProperty(React, 'createClass', {
get: function () {
lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class');
warnedForCreateClass = true;
return createReactClass;
}
});
}
// React.DOM factories are deprecated. Wrap these methods so that
// invocations of the React.DOM namespace and alert users to switch
// to the `react-dom-factories` package.
React.DOM = {};
var warnedForFactories = false;
Object.keys(ReactDOMFactories).forEach(function (factory) {
React.DOM[factory] = function () {
if (!warnedForFactories) {
lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory);
warnedForFactories = true;
}
return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments);
};
});
}
module.exports = React;
},{"11":11,"14":14,"17":17,"18":18,"20":20,"23":23,"24":24,"32":32,"4":4,"5":5,"8":8,"9":9}],4:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = _dereq_(25),
_assign = _dereq_(32);
var ReactNoopUpdateQueue = _dereq_(12);
var canDefineProperty = _dereq_(18);
var emptyObject = _dereq_(29);
var invariant = _dereq_(30);
var lowPriorityWarning = _dereq_(23);
/**
* Base class helpers for the updating state of a component.
*/
function ReactComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
ReactComponent.prototype.isReactComponent = {};
/**
* Sets a subset of the state. Always use this to mutate
* state. You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* There is no guarantee that calls to `setState` will run synchronously,
* as they may eventually be batched together. You can provide an optional
* callback that will be executed when the call to setState is actually
* completed.
*
* When a function is provided to setState, it will be called at some point in
* the future (not synchronously). It will be called with the up to date
* component arguments (state, props, context). These values can be different
* from this.* because your function may be called after receiveProps but before
* shouldComponentUpdate, and this new state, props, and context will not yet be
* assigned to this.
*
* @param {object|function} partialState Next partial state or function to
* produce next partial state to be merged with current state.
* @param {?function} callback Called after state is updated.
* @final
* @protected
*/
ReactComponent.prototype.setState = function (partialState, callback) {
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
this.updater.enqueueSetState(this, partialState);
if (callback) {
this.updater.enqueueCallback(this, callback, 'setState');
}
};
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {?function} callback Called after update is complete.
* @final
* @protected
*/
ReactComponent.prototype.forceUpdate = function (callback) {
this.updater.enqueueForceUpdate(this);
if (callback) {
this.updater.enqueueCallback(this, callback, 'forceUpdate');
}
};
/**
* Deprecated APIs. These APIs used to exist on classic React classes but since
* we would like to deprecate them, we're not going to move them over to this
* modern base class. Instead, we define a getter that warns if it's accessed.
*/
if ("development" !== 'production') {
var deprecatedAPIs = {
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
};
var defineDeprecationWarning = function (methodName, info) {
if (canDefineProperty) {
Object.defineProperty(ReactComponent.prototype, methodName, {
get: function () {
lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
return undefined;
}
});
}
};
for (var fnName in deprecatedAPIs) {
if (deprecatedAPIs.hasOwnProperty(fnName)) {
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
}
}
}
/**
* Base class helpers for the updating state of a component.
*/
function ReactPureComponent(props, context, updater) {
// Duplicated from ReactComponent.
this.props = props;
this.context = context;
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
function ComponentDummy() {}
ComponentDummy.prototype = ReactComponent.prototype;
ReactPureComponent.prototype = new ComponentDummy();
ReactPureComponent.prototype.constructor = ReactPureComponent;
// Avoid an extra prototype jump for these methods.
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
ReactPureComponent.prototype.isPureReactComponent = true;
module.exports = {
Component: ReactComponent,
PureComponent: ReactPureComponent
};
},{"12":12,"18":18,"23":23,"25":25,"29":29,"30":30,"32":32}],5:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var PooledClass = _dereq_(2);
var ReactElement = _dereq_(9);
var emptyFunction = _dereq_(28);
var traverseAllChildren = _dereq_(26);
var twoArgumentPooler = PooledClass.twoArgumentPooler;
var fourArgumentPooler = PooledClass.fourArgumentPooler;
var userProvidedKeyEscapeRegex = /\/+/g;
function escapeUserProvidedKey(text) {
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
}
/**
* PooledClass representing the bookkeeping associated with performing a child
* traversal. Allows avoiding binding callbacks.
*
* @constructor ForEachBookKeeping
* @param {!function} forEachFunction Function to perform traversal with.
* @param {?*} forEachContext Context to perform context with.
*/
function ForEachBookKeeping(forEachFunction, forEachContext) {
this.func = forEachFunction;
this.context = forEachContext;
this.count = 0;
}
ForEachBookKeeping.prototype.destructor = function () {
this.func = null;
this.context = null;
this.count = 0;
};
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
function forEachSingleChild(bookKeeping, child, name) {
var func = bookKeeping.func,
context = bookKeeping.context;
func.call(context, child, bookKeeping.count++);
}
/**
* Iterates through children that are typically specified as `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
*
* The provided forEachFunc(child, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} forEachFunc
* @param {*} forEachContext Context for forEachContext.
*/
function forEachChildren(children, forEachFunc, forEachContext) {
if (children == null) {
return children;
}
var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
traverseAllChildren(children, forEachSingleChild, traverseContext);
ForEachBookKeeping.release(traverseContext);
}
/**
* PooledClass representing the bookkeeping associated with performing a child
* mapping. Allows avoiding binding callbacks.
*
* @constructor MapBookKeeping
* @param {!*} mapResult Object containing the ordered map of results.
* @param {!function} mapFunction Function to perform mapping with.
* @param {?*} mapContext Context to perform mapping with.
*/
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
this.result = mapResult;
this.keyPrefix = keyPrefix;
this.func = mapFunction;
this.context = mapContext;
this.count = 0;
}
MapBookKeeping.prototype.destructor = function () {
this.result = null;
this.keyPrefix = null;
this.func = null;
this.context = null;
this.count = 0;
};
PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
var result = bookKeeping.result,
keyPrefix = bookKeeping.keyPrefix,
func = bookKeeping.func,
context = bookKeeping.context;
var mappedChild = func.call(context, child, bookKeeping.count++);
if (Array.isArray(mappedChild)) {
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
} else if (mappedChild != null) {
if (ReactElement.isValidElement(mappedChild)) {
mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
// Keep both the (mapped) and old keys if they differ, just as
// traverseAllChildren used to do for objects as children
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
}
result.push(mappedChild);
}
}
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
var escapedPrefix = '';
if (prefix != null) {
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
}
var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
MapBookKeeping.release(traverseContext);
}
/**
* Maps children that are typically specified as `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
*
* The provided mapFunction(child, key, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} func The map function.
* @param {*} context Context for mapFunction.
* @return {object} Object containing the ordered map of results.
*/
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
return result;
}
function forEachSingleChildDummy(traverseContext, child, name) {
return null;
}
/**
* Count the number of children that are typically specified as
* `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
*
* @param {?*} children Children tree container.
* @return {number} The number of children.
*/
function countChildren(children, context) {
return traverseAllChildren(children, forEachSingleChildDummy, null);
}
/**
* Flatten a children object (typically specified as `props.children`) and
* return an array with appropriately re-keyed children.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
*/
function toArray(children) {
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
return result;
}
var ReactChildren = {
forEach: forEachChildren,
map: mapChildren,
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
count: countChildren,
toArray: toArray
};
module.exports = ReactChildren;
},{"2":2,"26":26,"28":28,"9":9}],6:[function(_dereq_,module,exports){
/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = _dereq_(25);
var ReactCurrentOwner = _dereq_(7);
var invariant = _dereq_(30);
var warning = _dereq_(31);
function isNative(fn) {
// Based on isNative() from Lodash
var funcToString = Function.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var reIsNative = RegExp('^' + funcToString
// Take an example native function source for comparison
.call(hasOwnProperty)
// Strip regex characters so we can use it for regex
.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
// Remove hasOwnProperty from the template to make it generic
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
try {
var source = funcToString.call(fn);
return reIsNative.test(source);
} catch (err) {
return false;
}
}
var canUseCollections =
// Array.from
typeof Array.from === 'function' &&
// Map
typeof Map === 'function' && isNative(Map) &&
// Map.prototype.keys
Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
// Set
typeof Set === 'function' && isNative(Set) &&
// Set.prototype.keys
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
var setItem;
var getItem;
var removeItem;
var getItemIDs;
var addRoot;
var removeRoot;
var getRootIDs;
if (canUseCollections) {
var itemMap = new Map();
var rootIDSet = new Set();
setItem = function (id, item) {
itemMap.set(id, item);
};
getItem = function (id) {
return itemMap.get(id);
};
removeItem = function (id) {
itemMap['delete'](id);
};
getItemIDs = function () {
return Array.from(itemMap.keys());
};
addRoot = function (id) {
rootIDSet.add(id);
};
removeRoot = function (id) {
rootIDSet['delete'](id);
};
getRootIDs = function () {
return Array.from(rootIDSet.keys());
};
} else {
var itemByKey = {};
var rootByKey = {};
// Use non-numeric keys to prevent V8 performance issues:
// https://github.com/facebook/react/pull/7232
var getKeyFromID = function (id) {
return '.' + id;
};
var getIDFromKey = function (key) {
return parseInt(key.substr(1), 10);
};
setItem = function (id, item) {
var key = getKeyFromID(id);
itemByKey[key] = item;
};
getItem = function (id) {
var key = getKeyFromID(id);
return itemByKey[key];
};
removeItem = function (id) {
var key = getKeyFromID(id);
delete itemByKey[key];
};
getItemIDs = function () {
return Object.keys(itemByKey).map(getIDFromKey);
};
addRoot = function (id) {
var key = getKeyFromID(id);
rootByKey[key] = true;
};
removeRoot = function (id) {
var key = getKeyFromID(id);
delete rootByKey[key];
};
getRootIDs = function () {
return Object.keys(rootByKey).map(getIDFromKey);
};
}
var unmountedIDs = [];
function purgeDeep(id) {
var item = getItem(id);
if (item) {
var childIDs = item.childIDs;
removeItem(id);
childIDs.forEach(purgeDeep);
}
}
function describeComponentFrame(name, source, ownerName) {
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
}
function getDisplayName(element) {
if (element == null) {
return '#empty';
} else if (typeof element === 'string' || typeof element === 'number') {
return '#text';
} else if (typeof element.type === 'string') {
return element.type;
} else {
return element.type.displayName || element.type.name || 'Unknown';
}
}
function describeID(id) {
var name = ReactComponentTreeHook.getDisplayName(id);
var element = ReactComponentTreeHook.getElement(id);
var ownerID = ReactComponentTreeHook.getOwnerID(id);
var ownerName;
if (ownerID) {
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
}
"development" !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
return describeComponentFrame(name, element && element._source, ownerName);
}
var ReactComponentTreeHook = {
onSetChildren: function (id, nextChildIDs) {
var item = getItem(id);
!item ? "development" !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
item.childIDs = nextChildIDs;
for (var i = 0; i < nextChildIDs.length; i++) {
var nextChildID = nextChildIDs[i];
var nextChild = getItem(nextChildID);
!nextChild ? "development" !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
!(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
!nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
if (nextChild.parentID == null) {
nextChild.parentID = id;
// TODO: This shouldn't be necessary but mounting a new root during in
// componentWillMount currently causes not-yet-mounted components to
// be purged from our tree data so their parent id is missing.
}
!(nextChild.parentID === id) ? "development" !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
}
},
onBeforeMountComponent: function (id, element, parentID) {
var item = {
element: element,
parentID: parentID,
text: null,
childIDs: [],
isMounted: false,
updateCount: 0
};
setItem(id, item);
},
onBeforeUpdateComponent: function (id, element) {
var item = getItem(id);
if (!item || !item.isMounted) {
// We may end up here as a result of setState() in componentWillUnmount().
// In this case, ignore the element.
return;
}
item.element = element;
},
onMountComponent: function (id) {
var item = getItem(id);
!item ? "development" !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
item.isMounted = true;
var isRoot = item.parentID === 0;
if (isRoot) {
addRoot(id);
}
},
onUpdateComponent: function (id) {
var item = getItem(id);
if (!item || !item.isMounted) {
// We may end up here as a result of setState() in componentWillUnmount().
// In this case, ignore the element.
return;
}
item.updateCount++;
},
onUnmountComponent: function (id) {
var item = getItem(id);
if (item) {
// We need to check if it exists.
// `item` might not exist if it is inside an error boundary, and a sibling
// error boundary child threw while mounting. Then this instance never
// got a chance to mount, but it still gets an unmounting event during
// the error boundary cleanup.
item.isMounted = false;
var isRoot = item.parentID === 0;
if (isRoot) {
removeRoot(id);
}
}
unmountedIDs.push(id);
},
purgeUnmountedComponents: function () {
if (ReactComponentTreeHook._preventPurging) {
// Should only be used for testing.
return;
}
for (var i = 0; i < unmountedIDs.length; i++) {
var id = unmountedIDs[i];
purgeDeep(id);
}
unmountedIDs.length = 0;
},
isMounted: function (id) {
var item = getItem(id);
return item ? item.isMounted : false;
},
getCurrentStackAddendum: function (topElement) {
var info = '';
if (topElement) {
var name = getDisplayName(topElement);
var owner = topElement._owner;
info += describeComponentFrame(name, topElement._source, owner && owner.getName());
}
var currentOwner = ReactCurrentOwner.current;
var id = currentOwner && currentOwner._debugID;
info += ReactComponentTreeHook.getStackAddendumByID(id);
return info;
},
getStackAddendumByID: function (id) {
var info = '';
while (id) {
info += describeID(id);
id = ReactComponentTreeHook.getParentID(id);
}
return info;
},
getChildIDs: function (id) {
var item = getItem(id);
return item ? item.childIDs : [];
},
getDisplayName: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (!element) {
return null;
}
return getDisplayName(element);
},
getElement: function (id) {
var item = getItem(id);
return item ? item.element : null;
},
getOwnerID: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (!element || !element._owner) {
return null;
}
return element._owner._debugID;
},
getParentID: function (id) {
var item = getItem(id);
return item ? item.parentID : null;
},
getSource: function (id) {
var item = getItem(id);
var element = item ? item.element : null;
var source = element != null ? element._source : null;
return source;
},
getText: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (typeof element === 'string') {
return element;
} else if (typeof element === 'number') {
return '' + element;
} else {
return null;
}
},
getUpdateCount: function (id) {
var item = getItem(id);
return item ? item.updateCount : 0;
},
getRootIDs: getRootIDs,
getRegisteredIDs: getItemIDs,
pushNonStandardWarningStack: function (isCreatingElement, currentSource) {
if (typeof console.reactStack !== 'function') {
return;
}
var stack = [];
var currentOwner = ReactCurrentOwner.current;
var id = currentOwner && currentOwner._debugID;
try {
if (isCreatingElement) {
stack.push({
name: id ? ReactComponentTreeHook.getDisplayName(id) : null,
fileName: currentSource ? currentSource.fileName : null,
lineNumber: currentSource ? currentSource.lineNumber : null
});
}
while (id) {
var element = ReactComponentTreeHook.getElement(id);
var parentID = ReactComponentTreeHook.getParentID(id);
var ownerID = ReactComponentTreeHook.getOwnerID(id);
var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null;
var source = element && element._source;
stack.push({
name: ownerName,
fileName: source ? source.fileName : null,
lineNumber: source ? source.lineNumber : null
});
id = parentID;
}
} catch (err) {
// Internal state is messed up.
// Stop building the stack (it's just a nice to have).
}
console.reactStack(stack);
},
popNonStandardWarningStack: function () {
if (typeof console.reactStackEnd !== 'function') {
return;
}
console.reactStackEnd();
}
};
module.exports = ReactComponentTreeHook;
},{"25":25,"30":30,"31":31,"7":7}],7:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* Keeps track of the current owner.
*
* The current owner is the component who should own any components that are
* currently being constructed.
*/
var ReactCurrentOwner = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
module.exports = ReactCurrentOwner;
},{}],8:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactElement = _dereq_(9);
/**
* Create a factory that creates HTML tag elements.
*
* @private
*/
var createDOMFactory = ReactElement.createFactory;
if ("development" !== 'production') {
var ReactElementValidator = _dereq_(11);
createDOMFactory = ReactElementValidator.createFactory;
}
/**
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
*
* @public
*/
var ReactDOMFactories = {
a: createDOMFactory('a'),
abbr: createDOMFactory('abbr'),
address: createDOMFactory('address'),
area: createDOMFactory('area'),
article: createDOMFactory('article'),
aside: createDOMFactory('aside'),
audio: createDOMFactory('audio'),
b: createDOMFactory('b'),
base: createDOMFactory('base'),
bdi: createDOMFactory('bdi'),
bdo: createDOMFactory('bdo'),
big: createDOMFactory('big'),
blockquote: createDOMFactory('blockquote'),
body: createDOMFactory('body'),
br: createDOMFactory('br'),
button: createDOMFactory('button'),
canvas: createDOMFactory('canvas'),
caption: createDOMFactory('caption'),
cite: createDOMFactory('cite'),
code: createDOMFactory('code'),
col: createDOMFactory('col'),
colgroup: createDOMFactory('colgroup'),
data: createDOMFactory('data'),
datalist: createDOMFactory('datalist'),
dd: createDOMFactory('dd'),
del: createDOMFactory('del'),
details: createDOMFactory('details'),
dfn: createDOMFactory('dfn'),
dialog: createDOMFactory('dialog'),
div: createDOMFactory('div'),
dl: createDOMFactory('dl'),
dt: createDOMFactory('dt'),
em: createDOMFactory('em'),
embed: createDOMFactory('embed'),
fieldset: createDOMFactory('fieldset'),
figcaption: createDOMFactory('figcaption'),
figure: createDOMFactory('figure'),
footer: createDOMFactory('footer'),
form: createDOMFactory('form'),
h1: createDOMFactory('h1'),
h2: createDOMFactory('h2'),
h3: createDOMFactory('h3'),
h4: createDOMFactory('h4'),
h5: createDOMFactory('h5'),
h6: createDOMFactory('h6'),
head: createDOMFactory('head'),
header: createDOMFactory('header'),
hgroup: createDOMFactory('hgroup'),
hr: createDOMFactory('hr'),
html: createDOMFactory('html'),
i: createDOMFactory('i'),
iframe: createDOMFactory('iframe'),
img: createDOMFactory('img'),
input: createDOMFactory('input'),
ins: createDOMFactory('ins'),
kbd: createDOMFactory('kbd'),
keygen: createDOMFactory('keygen'),
label: createDOMFactory('label'),
legend: createDOMFactory('legend'),
li: createDOMFactory('li'),
link: createDOMFactory('link'),
main: createDOMFactory('main'),
map: createDOMFactory('map'),
mark: createDOMFactory('mark'),
menu: createDOMFactory('menu'),
menuitem: createDOMFactory('menuitem'),
meta: createDOMFactory('meta'),
meter: createDOMFactory('meter'),
nav: createDOMFactory('nav'),
noscript: createDOMFactory('noscript'),
object: createDOMFactory('object'),
ol: createDOMFactory('ol'),
optgroup: createDOMFactory('optgroup'),
option: createDOMFactory('option'),
output: createDOMFactory('output'),
p: createDOMFactory('p'),
param: createDOMFactory('param'),
picture: createDOMFactory('picture'),
pre: createDOMFactory('pre'),
progress: createDOMFactory('progress'),
q: createDOMFactory('q'),
rp: createDOMFactory('rp'),
rt: createDOMFactory('rt'),
ruby: createDOMFactory('ruby'),
s: createDOMFactory('s'),
samp: createDOMFactory('samp'),
script: createDOMFactory('script'),
section: createDOMFactory('section'),
select: createDOMFactory('select'),
small: createDOMFactory('small'),
source: createDOMFactory('source'),
span: createDOMFactory('span'),
strong: createDOMFactory('strong'),
style: createDOMFactory('style'),
sub: createDOMFactory('sub'),
summary: createDOMFactory('summary'),
sup: createDOMFactory('sup'),
table: createDOMFactory('table'),
tbody: createDOMFactory('tbody'),
td: createDOMFactory('td'),
textarea: createDOMFactory('textarea'),
tfoot: createDOMFactory('tfoot'),
th: createDOMFactory('th'),
thead: createDOMFactory('thead'),
time: createDOMFactory('time'),
title: createDOMFactory('title'),
tr: createDOMFactory('tr'),
track: createDOMFactory('track'),
u: createDOMFactory('u'),
ul: createDOMFactory('ul'),
'var': createDOMFactory('var'),
video: createDOMFactory('video'),
wbr: createDOMFactory('wbr'),
// SVG
circle: createDOMFactory('circle'),
clipPath: createDOMFactory('clipPath'),
defs: createDOMFactory('defs'),
ellipse: createDOMFactory('ellipse'),
g: createDOMFactory('g'),
image: createDOMFactory('image'),
line: createDOMFactory('line'),
linearGradient: createDOMFactory('linearGradient'),
mask: createDOMFactory('mask'),
path: createDOMFactory('path'),
pattern: createDOMFactory('pattern'),
polygon: createDOMFactory('polygon'),
polyline: createDOMFactory('polyline'),
radialGradient: createDOMFactory('radialGradient'),
rect: createDOMFactory('rect'),
stop: createDOMFactory('stop'),
svg: createDOMFactory('svg'),
text: createDOMFactory('text'),
tspan: createDOMFactory('tspan')
};
module.exports = ReactDOMFactories;
},{"11":11,"9":9}],9:[function(_dereq_,module,exports){
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = _dereq_(32);
var ReactCurrentOwner = _dereq_(7);
var warning = _dereq_(31);
var canDefineProperty = _dereq_(18);
var hasOwnProperty = Object.prototype.hasOwnProperty;
var REACT_ELEMENT_TYPE = _dereq_(10);
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown;
function hasValidRef(config) {
if ("development" !== 'production') {
if (hasOwnProperty.call(config, 'ref')) {
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.ref !== undefined;
}
function hasValidKey(config) {
if ("development" !== 'production') {
if (hasOwnProperty.call(config, 'key')) {
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.key !== undefined;
}
function defineKeyPropWarningGetter(props, displayName) {
var warnAboutAccessingKey = function () {
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
"development" !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
}
};
warnAboutAccessingKey.isReactWarning = true;
Object.defineProperty(props, 'key', {
get: warnAboutAccessingKey,
configurable: true
});
}
function defineRefPropWarningGetter(props, displayName) {
var warnAboutAccessingRef = function () {
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
"development" !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
}
};
warnAboutAccessingRef.isReactWarning = true;
Object.defineProperty(props, 'ref', {
get: warnAboutAccessingRef,
configurable: true
});
}
/**
* Factory method to create a new React element. This no longer adheres to
* the class pattern, so do not use new to call it. Also, no instanceof check
* will work. Instead test $$typeof field against Symbol.for('react.element') to check
* if something is a React Element.
*
* @param {*} type
* @param {*} key
* @param {string|object} ref
* @param {*} self A *temporary* helper to detect places where `this` is
* different from the `owner` when React.createElement is called, so that we
* can warn. We want to get rid of owner and replace string `ref`s with arrow
* functions, and as long as `this` and owner are the same, there will be no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or otherwise)
* indicating filename, line number, and/or other information.
* @param {*} owner
* @param {*} props
* @internal
*/
var ReactElement = function (type, key, ref, self, source, owner, props) {
var element = {
// This tag allow us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element
type: type,
key: key,
ref: ref,
props: props,
// Record the component responsible for creating this element.
_owner: owner
};
if ("development" !== 'production') {
// The validation flag is currently mutative. We put it on
// an external backing store so that we can freeze the whole object.
// This can be replaced with a WeakMap once they are implemented in
// commonly used development environments.
element._store = {};
// To make comparing ReactElements easier for testing purposes, we make
// the validation flag non-enumerable (where possible, which should
// include every environment we run tests in), so the test framework
// ignores it.
if (canDefineProperty) {
Object.defineProperty(element._store, 'validated', {
configurable: false,
enumerable: false,
writable: true,
value: false
});
// self and source are DEV only properties.
Object.defineProperty(element, '_self', {
configurable: false,
enumerable: false,
writable: false,
value: self
});
// Two elements created in two different places should be considered
// equal for testing purposes and therefore we hide it from enumeration.
Object.defineProperty(element, '_source', {
configurable: false,
enumerable: false,
writable: false,
value: source
});
} else {
element._store.validated = false;
element._self = self;
element._source = source;
}
if (Object.freeze) {
Object.freeze(element.props);
Object.freeze(element);
}
}
return element;
};
/**
* Create and return a new ReactElement of the given type.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
*/
ReactElement.createElement = function (type, config, children) {
var propName;
// Reserved names are extracted
var props = {};
var key = null;
var ref = null;
var self = null;
var source = null;
if (config != null) {
if (hasValidRef(config)) {
ref = config.ref;
}
if (hasValidKey(config)) {
key = '' + config.key;
}
self = config.__self === undefined ? null : config.__self;
source = config.__source === undefined ? null : config.__source;
// Remaining properties are added to a new props object
for (propName in config) {
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
props[propName] = config[propName];
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
if ("development" !== 'production') {
if (Object.freeze) {
Object.freeze(childArray);
}
}
props.children = childArray;
}
// Resolve default props
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (props[propName] === undefined) {
props[propName] = defaultProps[propName];
}
}
}
if ("development" !== 'production') {
if (key || ref) {
if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
if (key) {
defineKeyPropWarningGetter(props, displayName);
}
if (ref) {
defineRefPropWarningGetter(props, displayName);
}
}
}
}
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
};
/**
* Return a function that produces ReactElements of a given type.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
*/
ReactElement.createFactory = function (type) {
var factory = ReactElement.createElement.bind(null, type);
// Expose the type on the factory and the prototype so that it can be
// easily accessed on elements. E.g. `<Foo />.type === Foo`.
// This should not be named `constructor` since this may not be the function
// that created the element, and it may not even be a constructor.
// Legacy hook TODO: Warn if this is accessed
factory.type = type;
return factory;
};
ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
return newElement;
};
/**
* Clone and return a new ReactElement using element as the starting point.
* See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
*/
ReactElement.cloneElement = function (element, config, children) {
var propName;
// Original props are copied
var props = _assign({}, element.props);
// Reserved names are extracted
var key = element.key;
var ref = element.ref;
// Self is preserved since the owner is preserved.
var self = element._self;
// Source is preserved since cloneElement is unlikely to be targeted by a
// transpiler, and the original source is probably a better indicator of the
// true owner.
var source = element._source;
// Owner will be preserved, unless ref is overridden
var owner = element._owner;
if (config != null) {
if (hasValidRef(config)) {
// Silently steal the ref from the parent.
ref = config.ref;
owner = ReactCurrentOwner.current;
}
if (hasValidKey(config)) {
key = '' + config.key;
}
// Remaining properties override existing props
var defaultProps;
if (element.type && element.type.defaultProps) {
defaultProps = element.type.defaultProps;
}
for (propName in config) {
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
if (config[propName] === undefined && defaultProps !== undefined) {
// Resolve default props
props[propName] = defaultProps[propName];
} else {
props[propName] = config[propName];
}
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
props.children = childArray;
}
return ReactElement(element.type, key, ref, self, source, owner, props);
};
/**
* Verifies the object is a ReactElement.
* See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
* @param {?object} object
* @return {boolean} True if `object` is a valid component.
* @final
*/
ReactElement.isValidElement = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
module.exports = ReactElement;
},{"10":10,"18":18,"31":31,"32":32,"7":7}],10:[function(_dereq_,module,exports){
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
// The Symbol used to tag the ReactElement type. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
module.exports = REACT_ELEMENT_TYPE;
},{}],11:[function(_dereq_,module,exports){
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/**
* ReactElementValidator provides a wrapper around a element factory
* which validates the props passed to the element. This is intended to be
* used only in DEV and could be replaced by a static type checker for languages
* that support it.
*/
'use strict';
var ReactCurrentOwner = _dereq_(7);
var ReactComponentTreeHook = _dereq_(6);
var ReactElement = _dereq_(9);
var checkReactTypeSpec = _dereq_(19);
var canDefineProperty = _dereq_(18);
var getIteratorFn = _dereq_(21);
var warning = _dereq_(31);
var lowPriorityWarning = _dereq_(23);
function getDeclarationErrorAddendum() {
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
function getSourceInfoErrorAddendum(elementProps) {
if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
var source = elementProps.__source;
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
var lineNumber = source.lineNumber;
return ' Check your code at ' + fileName + ':' + lineNumber + '.';
}
return '';
}
/**
* Warn if there's no key explicitly set on dynamic arrays of children or
* object keys are not valid. This allows us to keep track of children between
* updates.
*/
var ownerHasKeyUseWarning = {};
function getCurrentComponentErrorInfo(parentType) {
var info = getDeclarationErrorAddendum();
if (!info) {
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
if (parentName) {
info = ' Check the top-level render call using <' + parentName + '>.';
}
}
return info;
}
/**
* Warn if the element doesn't have an explicit key assigned to it.
* This element is in an array. The array could grow and shrink or be
* reordered. All children that haven't already been validated are required to
* have a "key" property assigned to it. Error statuses are cached so a warning
* will only be shown once.
*
* @internal
* @param {ReactElement} element Element that requires a key.
* @param {*} parentType element's parent's type.
*/
function validateExplicitKey(element, parentType) {
if (!element._store || element._store.validated || element.key != null) {
return;
}
element._store.validated = true;
var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
if (memoizer[currentComponentErrorInfo]) {
return;
}
memoizer[currentComponentErrorInfo] = true;
// Usually the current owner is the offender, but if it accepts children as a
// property, it may be the creator of the child that's responsible for
// assigning it a key.
var childOwner = '';
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
// Give the component that originally created this child.
childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
}
"development" !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
}
/**
* Ensure that every element either is passed in a static location, in an
* array with an explicit keys property defined, or in an object literal
* with valid key property.
*
* @internal
* @param {ReactNode} node Statically passed child of any type.
* @param {*} parentType node's parent's type.
*/
function validateChildKeys(node, parentType) {
if (typeof node !== 'object') {
return;
}
if (Array.isArray(node)) {
for (var i = 0; i < node.length; i++) {
var child = node[i];
if (ReactElement.isValidElement(child)) {
validateExplicitKey(child, parentType);
}
}
} else if (ReactElement.isValidElement(node)) {
// This element was passed in a valid location.
if (node._store) {
node._store.validated = true;
}
} else if (node) {
var iteratorFn = getIteratorFn(node);
// Entry iterators provide implicit keys.
if (iteratorFn) {
if (iteratorFn !== node.entries) {
var iterator = iteratorFn.call(node);
var step;
while (!(step = iterator.next()).done) {
if (ReactElement.isValidElement(step.value)) {
validateExplicitKey(step.value, parentType);
}
}
}
}
}
}
/**
* Given an element, validate that its props follow the propTypes definition,
* provided by the type.
*
* @param {ReactElement} element
*/
function validatePropTypes(element) {
var componentClass = element.type;
if (typeof componentClass !== 'function') {
return;
}
var name = componentClass.displayName || componentClass.name;
if (componentClass.propTypes) {
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
}
if (typeof componentClass.getDefaultProps === 'function') {
"development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
}
}
var ReactElementValidator = {
createElement: function (type, props, children) {
var validType = typeof type === 'string' || typeof type === 'function';
// We warn in this case but don't throw. We expect the element creation to
// succeed and there will likely be errors in render.
if (!validType) {
if (typeof type !== 'function' && typeof type !== 'string') {
var info = '';
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
info += ' You likely forgot to export your component from the file ' + "it's defined in.";
}
var sourceInfo = getSourceInfoErrorAddendum(props);
if (sourceInfo) {
info += sourceInfo;
} else {
info += getDeclarationErrorAddendum();
}
info += ReactComponentTreeHook.getCurrentStackAddendum();
var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null;
ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource);
"development" !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
ReactComponentTreeHook.popNonStandardWarningStack();
}
}
var element = ReactElement.createElement.apply(this, arguments);
// The result can be nullish if a mock or a custom function is used.
// TODO: Drop this when these are no longer allowed as the type argument.
if (element == null) {
return element;
}
// Skip key warning if the type isn't valid since our key validation logic
// doesn't expect a non-string/function type and can throw confusing errors.
// We don't want exception behavior to differ between dev and prod.
// (Rendering will throw with a helpful message and as soon as the type is
// fixed, the key warnings will appear.)
if (validType) {
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], type);
}
}
validatePropTypes(element);
return element;
},
createFactory: function (type) {
var validatedFactory = ReactElementValidator.createElement.bind(null, type);
// Legacy hook TODO: Warn if this is accessed
validatedFactory.type = type;
if ("development" !== 'production') {
if (canDefineProperty) {
Object.defineProperty(validatedFactory, 'type', {
enumerable: false,
get: function () {
lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
Object.defineProperty(this, 'type', {
value: type
});
return type;
}
});
}
}
return validatedFactory;
},
cloneElement: function (element, props, children) {
var newElement = ReactElement.cloneElement.apply(this, arguments);
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], newElement.type);
}
validatePropTypes(newElement);
return newElement;
}
};
module.exports = ReactElementValidator;
},{"18":18,"19":19,"21":21,"23":23,"31":31,"6":6,"7":7,"9":9}],12:[function(_dereq_,module,exports){
/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var warning = _dereq_(31);
function warnNoop(publicInstance, callerName) {
if ("development" !== 'production') {
var constructor = publicInstance.constructor;
"development" !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
}
}
/**
* This is the abstract API for an update queue.
*/
var ReactNoopUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function (publicInstance) {
return false;
},
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @internal
*/
enqueueCallback: function (publicInstance, callback) {},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
warnNoop(publicInstance, 'forceUpdate');
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState) {
warnNoop(publicInstance, 'replaceState');
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
warnNoop(publicInstance, 'setState');
}
};
module.exports = ReactNoopUpdateQueue;
},{"31":31}],13:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactPropTypeLocationNames = {};
if ("development" !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
},{}],14:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _require = _dereq_(9),
isValidElement = _require.isValidElement;
var factory = _dereq_(34);
module.exports = factory(isValidElement);
},{"34":34,"9":9}],15:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
},{}],16:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = _dereq_(32);
var React = _dereq_(3);
// `version` will be added here by the React module.
var ReactUMDEntry = _assign(React, {
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
ReactCurrentOwner: _dereq_(7)
}
});
if ("development" !== 'production') {
_assign(ReactUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
// ReactComponentTreeHook should not be included in production.
ReactComponentTreeHook: _dereq_(6),
getNextDebugID: _dereq_(22)
});
}
module.exports = ReactUMDEntry;
},{"22":22,"3":3,"32":32,"6":6,"7":7}],17:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
module.exports = '15.6.0-rc.1';
},{}],18:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var canDefineProperty = false;
if ("development" !== 'production') {
try {
// $FlowFixMe https://github.com/facebook/flow/issues/285
Object.defineProperty({}, 'x', { get: function () {} });
canDefineProperty = true;
} catch (x) {
// IE will fail on defineProperty
}
}
module.exports = canDefineProperty;
},{}],19:[function(_dereq_,module,exports){
(function (process){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = _dereq_(25);
var ReactPropTypeLocationNames = _dereq_(13);
var ReactPropTypesSecret = _dereq_(15);
var invariant = _dereq_(30);
var warning = _dereq_(31);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && "development" === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = _dereq_(6);
}
var loggedTypeFailures = {};
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?object} element The React element that is being type-checked
* @param {?number} debugID The React component instance that is being type-checked
* @private
*/
function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
!(typeof typeSpecs[typeSpecName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
"development" !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var componentStackInfo = '';
if ("development" !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = _dereq_(6);
}
if (debugID !== null) {
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
} else if (element !== null) {
componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
}
}
"development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
}
}
}
}
module.exports = checkReactTypeSpec;
}).call(this,undefined)
},{"13":13,"15":15,"25":25,"30":30,"31":31,"6":6}],20:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _require = _dereq_(4),
Component = _require.Component;
var _require2 = _dereq_(9),
isValidElement = _require2.isValidElement;
var ReactNoopUpdateQueue = _dereq_(12);
var factory = _dereq_(27);
module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue);
},{"12":12,"27":27,"4":4,"9":9}],21:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
module.exports = getIteratorFn;
},{}],22:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var nextDebugID = 1;
function getNextDebugID() {
return nextDebugID++;
}
module.exports = getNextDebugID;
},{}],23:[function(_dereq_,module,exports){
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* Forked from fbjs/warning:
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
*
* Only change is we use console.warn instead of console.error,
* and do nothing when 'console' is not supported.
* This really simplifies the code.
* ---
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var lowPriorityWarning = function () {};
if ("development" !== 'production') {
var printWarning = function (format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.warn(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
lowPriorityWarning = function (condition, format) {
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (!condition) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
}
module.exports = lowPriorityWarning;
},{}],24:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = _dereq_(25);
var ReactElement = _dereq_(9);
var invariant = _dereq_(30);
/**
* Returns the first child in a collection of children and verifies that there
* is only one child in the collection.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
*
* The current implementation of this function assumes that a single child gets
* passed without a wrapper, but the purpose of this helper function is to
* abstract away the particular structure of children.
*
* @param {?object} children Child collection structure.
* @return {ReactElement} The first and only `ReactElement` contained in the
* structure.
*/
function onlyChild(children) {
!ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
return children;
}
module.exports = onlyChild;
},{"25":25,"30":30,"9":9}],25:[function(_dereq_,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* WARNING: DO NOT manually require this module.
* This is a replacement for `invariant(...)` used by the error code system
* and will _only_ be required by the corresponding babel pass.
* It always throws.
*/
function reactProdInvariant(code) {
var argCount = arguments.length - 1;
var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
for (var argIdx = 0; argIdx < argCount; argIdx++) {
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
}
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
var error = new Error(message);
error.name = 'Invariant Violation';
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
throw error;
}
module.exports = reactProdInvariant;
},{}],26:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = _dereq_(25);
var ReactCurrentOwner = _dereq_(7);
var REACT_ELEMENT_TYPE = _dereq_(10);
var getIteratorFn = _dereq_(21);
var invariant = _dereq_(30);
var KeyEscapeUtils = _dereq_(1);
var warning = _dereq_(31);
var SEPARATOR = '.';
var SUBSEPARATOR = ':';
/**
* This is inlined from ReactElement since this file is shared between
* isomorphic and renderers. We could extract this to a
*
*/
/**
* TODO: Test that a single child and an array with one item have the same key
* pattern.
*/
var didWarnAboutMaps = false;
/**
* Generate a key string that identifies a component within a set.
*
* @param {*} component A component that could contain a manual key.
* @param {number} index Index that is used if a manual key is not provided.
* @return {string}
*/
function getComponentKey(component, index) {
// Do some typechecking here since we call this blindly. We want to ensure
// that we don't block potential future ES APIs.
if (component && typeof component === 'object' && component.key != null) {
// Explicit key
return KeyEscapeUtils.escape(component.key);
}
// Implicit key determined by the index in the set
return index.toString(36);
}
/**
* @param {?*} children Children tree container.
* @param {!string} nameSoFar Name of the key path so far.
* @param {!function} callback Callback to invoke with each child found.
* @param {?*} traverseContext Used to pass information throughout the traversal
* process.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
var type = typeof children;
if (type === 'undefined' || type === 'boolean') {
// All of the above are perceived as null.
children = null;
}
if (children === null || type === 'string' || type === 'number' ||
// The following is inlined from ReactElement. This means we can optimize
// some checks. React Fiber also inlines this logic for similar purposes.
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
callback(traverseContext, children,
// If it's the only child, treat the name as if it was wrapped in an array
// so that it's consistent if the number of children grows.
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
return 1;
}
var child;
var nextName;
var subtreeCount = 0; // Count of children found in the current subtree.
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
child = children[i];
nextName = nextNamePrefix + getComponentKey(child, i);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
var iteratorFn = getIteratorFn(children);
if (iteratorFn) {
var iterator = iteratorFn.call(children);
var step;
if (iteratorFn !== children.entries) {
var ii = 0;
while (!(step = iterator.next()).done) {
child = step.value;
nextName = nextNamePrefix + getComponentKey(child, ii++);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
if ("development" !== 'production') {
var mapsAsChildrenAddendum = '';
if (ReactCurrentOwner.current) {
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
if (mapsAsChildrenOwnerName) {
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
}
}
"development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
didWarnAboutMaps = true;
}
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
child = entry[1];
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
}
}
} else if (type === 'object') {
var addendum = '';
if ("development" !== 'production') {
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
if (children._isReactElement) {
addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.';
}
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
addendum += ' Check the render method of `' + name + '`.';
}
}
}
var childrenString = String(children);
!false ? "development" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
}
}
return subtreeCount;
}
/**
* Traverses children that are typically specified as `props.children`, but
* might also be specified through attributes:
*
* - `traverseAllChildren(this.props.children, ...)`
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
*
* The `traverseContext` is an optional argument that is passed through the
* entire traversal. It can be used to store accumulations or anything else that
* the callback might find relevant.
*
* @param {?*} children Children tree object.
* @param {!function} callback To invoke upon traversing each child.
* @param {?*} traverseContext Context for traversal.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildren(children, callback, traverseContext) {
if (children == null) {
return 0;
}
return traverseAllChildrenImpl(children, '', callback, traverseContext);
}
module.exports = traverseAllChildren;
},{"1":1,"10":10,"21":21,"25":25,"30":30,"31":31,"7":7}],27:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = _dereq_(32);
var emptyObject = _dereq_(29);
var _invariant = _dereq_(30);
if ("development" !== 'production') {
var warning = _dereq_(31);
}
var MIXINS_KEY = 'mixins';
// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
return fn;
}
var ReactPropTypeLocationNames;
if ("development" !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context',
};
} else {
ReactPropTypeLocationNames = {};
}
function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var injectedMixins = [];
/**
* Composite components are higher-level components that compose other composite
* or host components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return <div>Hello World</div>;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactClassInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will be available on the prototype.
*
* @interface ReactClassInterface
* @internal
*/
var ReactClassInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: 'DEFINE_MANY',
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: 'DEFINE_MANY',
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: 'DEFINE_MANY',
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: 'DEFINE_MANY',
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: 'DEFINE_MANY',
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: 'DEFINE_MANY_MERGED',
/**
* Invoked once before the component is mounted. The return value will be used
* as the initial value of `this.state`.
*
* getInitialState: function() {
* return {
* isOn: false,
* fooBaz: new BazFoo()
* }
* }
*
* @return {object}
* @optional
*/
getInitialState: 'DEFINE_MANY_MERGED',
/**
* @return {object}
* @optional
*/
getChildContext: 'DEFINE_MANY_MERGED',
/**
* Uses props from `this.props` and state from `this.state` to render the
* structure of the component.
*
* No guarantees are made about when or how often this method is invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return <div>Hello, {name}!</div>;
* }
*
* @return {ReactComponent}
* @nosideeffects
* @required
*/
render: 'DEFINE_ONCE',
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: 'DEFINE_MANY',
/**
* Invoked when the component has been mounted and has a DOM representation.
* However, there is no guarantee that the DOM node is in the document.
*
* Use this as an opportunity to operate on the DOM when the component has
* been mounted (initialized and rendered) for the first time.
*
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidMount: 'DEFINE_MANY',
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
* transition may cause a state change, but the opposite is not true. If you
* need it, you are probably looking for `componentWillUpdate`.
*
* @param {object} nextProps
* @optional
*/
componentWillReceiveProps: 'DEFINE_MANY',
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* update.
*
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
* return !equal(nextProps, this.props) ||
* !equal(nextState, this.state) ||
* !equal(nextContext, this.context);
* }
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @return {boolean} True if the component should update.
* @optional
*/
shouldComponentUpdate: 'DEFINE_ONCE',
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* and `nextContext`.
*
* Use this as an opportunity to perform preparation before an update occurs.
*
* NOTE: You **cannot** use `this.setState()` in this method.
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @param {ReactReconcileTransaction} transaction
* @optional
*/
componentWillUpdate: 'DEFINE_MANY',
/**
* Invoked when the component's DOM representation has been updated.
*
* Use this as an opportunity to operate on the DOM when the component has
* been updated.
*
* @param {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: 'DEFINE_MANY',
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: 'DEFINE_MANY',
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: 'OVERRIDE_BASE'
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* being static, they must be defined outside of the "statics" key under
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
displayName: function (Constructor, displayName) {
Constructor.displayName = displayName;
},
mixins: function (Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
childContextTypes: function (Constructor, childContextTypes) {
if ("development" !== 'production') {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if ("development" !== 'production') {
validateTypeDef(Constructor, contextTypes, 'context');
}
Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function (Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function (Constructor, propTypes) {
if ("development" !== 'production') {
validateTypeDef(Constructor, propTypes, 'prop');
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
},
statics: function (Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function () {} };
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
// use a warning instead of an _invariant so components
// don't show up in prod but only in __DEV__
"development" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
}
}
}
function validateMethodOverride(isAlreadyDefined, name) {
var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactClassMixin.hasOwnProperty(name)) {
_invariant(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name);
}
// Disallow defining methods more than once unless explicitly allowed.
if (isAlreadyDefined) {
_invariant(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name);
}
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building React classes.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
if ("development" !== 'production') {
var typeofSpec = typeof spec;
var isMixinValid = typeofSpec === 'object' && spec !== null;
"development" !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
}
return;
}
_invariant(typeof spec !== 'function', 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.');
_invariant(!isValidElement(spec), 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.');
var proto = Constructor.prototype;
var autoBindPairs = proto.__reactAutoBindPairs;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above.
continue;
}
var property = spec[name];
var isAlreadyDefined = proto.hasOwnProperty(name);
validateMethodOverride(isAlreadyDefined, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactClass methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
var isFunction = typeof property === 'function';
var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
if (shouldAutoBind) {
autoBindPairs.push(name, property);
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactClassInterface[name];
// These cases should already be caught by validateMethodOverride.
_invariant(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name);
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === 'DEFINE_MANY_MERGED') {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === 'DEFINE_MANY') {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if ("development" !== 'production') {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
function mixStaticSpecIntoComponent(Constructor, statics) {
if (!statics) {
return;
}
for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
continue;
}
var isReserved = name in RESERVED_SPEC_KEYS;
_invariant(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name);
var isInherited = name in Constructor;
_invariant(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name);
Constructor[name] = property;
}
}
/**
* Merge two objects, but throw if both contain the same key.
*
* @param {object} one The first object, which is mutated.
* @param {object} two The second object
* @return {object} one after it has been mutated to contain everything in two.
*/
function mergeIntoWithNoDuplicateKeys(one, two) {
_invariant(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.');
for (var key in two) {
if (two.hasOwnProperty(key)) {
_invariant(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key);
one[key] = two[key];
}
}
return one;
}
/**
* Creates a function that invokes two functions and merges their return values.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createMergedResultFunction(one, two) {
return function mergedResult() {
var a = one.apply(this, arguments);
var b = two.apply(this, arguments);
if (a == null) {
return b;
} else if (b == null) {
return a;
}
var c = {};
mergeIntoWithNoDuplicateKeys(c, a);
mergeIntoWithNoDuplicateKeys(c, b);
return c;
};
}
/**
* Creates a function that invokes two functions and ignores their return vales.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createChainedFunction(one, two) {
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
/**
* Binds a method to the component.
*
* @param {object} component Component whose method is going to be bound.
* @param {function} method Method to be bound.
* @return {function} The bound method.
*/
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
if ("development" !== 'production') {
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName;
var _bind = boundMethod.bind;
boundMethod.bind = function (newThis) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
"development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
} else if (!args.length) {
"development" !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
}
return boundMethod;
}
/**
* Binds all auto-bound methods in a component.
*
* @param {object} component Component whose method is going to be bound.
*/
function bindAutoBindMethods(component) {
var pairs = component.__reactAutoBindPairs;
for (var i = 0; i < pairs.length; i += 2) {
var autoBindKey = pairs[i];
var method = pairs[i + 1];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
var IsMountedMixin = {
componentDidMount: function () {
this.__isMounted = true;
},
componentWillUnmount: function () {
this.__isMounted = false;
}
};
/**
* Add more to the ReactClass base class. These are all legacy features and
* therefore not already part of the modern ReactComponent.
*/
var ReactClassMixin = {
/**
* TODO: This will be deprecated because state should always keep a consistent
* type signature and the only use case for this, is to avoid that.
*/
replaceState: function (newState, callback) {
this.updater.enqueueReplaceState(this, newState, callback);
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function () {
if ("development" !== 'production') {
"development" !== 'production' ? warning(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component') : void 0;
this.__didWarnIsMounted = true;
}
return !!this.__isMounted;
}
};
var ReactClassComponent = function () {};
_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
/**
* Creates a composite component class given a class specification.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
function createClass(spec) {
// To keep our warnings more understandable, we'll use a little hack here to
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
// unnecessarily identify a class without displayName as 'Constructor'.
var Constructor = identity(function (props, context, updater) {
// This constructor gets overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if ("development" !== 'production') {
"development" !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
}
// Wire up auto-binding
if (this.__reactAutoBindPairs.length) {
bindAutoBindMethods(this);
}
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
this.state = null;
// ReactClasses doesn't have constructors. Instead, they use the
// getInitialState and componentWillMount methods for initialization.
var initialState = this.getInitialState ? this.getInitialState() : null;
if ("development" !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (initialState === undefined && this.getInitialState._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
initialState = null;
}
}
_invariant(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent');
this.state = initialState;
});
Constructor.prototype = new ReactClassComponent();
Constructor.prototype.constructor = Constructor;
Constructor.prototype.__reactAutoBindPairs = [];
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
mixSpecIntoComponent(Constructor, IsMountedMixin);
mixSpecIntoComponent(Constructor, spec);
// Initialize the defaultProps property after all mixins have been merged.
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
if ("development" !== 'production') {
// This is a tag to indicate that the use of these method names is ok,
// since it's used with createClass. If it's not, then it's likely a
// mistake so we'll warn you to use the static property, property
// initializer or constructor respectively.
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps.isReactClassApproved = {};
}
if (Constructor.prototype.getInitialState) {
Constructor.prototype.getInitialState.isReactClassApproved = {};
}
}
_invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.');
if ("development" !== 'production') {
"development" !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
"development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactClassInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
return Constructor;
}
return createClass;
}
module.exports = factory;
},{"29":29,"30":30,"31":31,"32":32}],28:[function(_dereq_,module,exports){
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = function emptyFunction() {};
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
return arg;
};
module.exports = emptyFunction;
},{}],29:[function(_dereq_,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var emptyObject = {};
if ("development" !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
},{}],30:[function(_dereq_,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if ("development" !== 'production') {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return args[argIndex++];
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
module.exports = invariant;
},{}],31:[function(_dereq_,module,exports){
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var emptyFunction = _dereq_(28);
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if ("development" !== 'production') {
(function () {
var printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
warning = function warning(condition, format) {
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (format.indexOf('Failed Composite propType: ') === 0) {
return; // Ignore CompositeComponent proptype check.
}
if (!condition) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
})();
}
module.exports = warning;
},{"28":28}],32:[function(_dereq_,module,exports){
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
},{}],33:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
if ("development" !== 'production') {
var invariant = _dereq_(30);
var warning = _dereq_(31);
var ReactPropTypesSecret = _dereq_(36);
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if ("development" !== 'production') {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
module.exports = checkPropTypes;
},{"30":30,"31":31,"36":36}],34:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
// React 15.5 references this module, and assumes PropTypes are still callable in production.
// Therefore we re-export development-only version with all the PropTypes checks here.
// However if one is migrating to the `prop-types` npm library, they will go through the
// `index.js` entry point, and it will branch depending on the environment.
var factory = _dereq_(35);
module.exports = function(isValidElement) {
// It is still allowed in 15.5.
var throwOnDirectAccess = false;
return factory(isValidElement, throwOnDirectAccess);
};
},{"35":35}],35:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
var emptyFunction = _dereq_(28);
var invariant = _dereq_(30);
var warning = _dereq_(31);
var ReactPropTypesSecret = _dereq_(36);
var checkPropTypes = _dereq_(33);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
/*eslint-disable no-self-compare*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/*eslint-enable no-self-compare*/
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However, we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if ("development" !== 'production') {
var manualPropTypeCallCache = {};
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
} else if ("development" !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (!manualPropTypeCallCache[cacheKey]) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
'function for the `%s` prop on `%s`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
propFullName,
componentName
);
manualPropTypeCallCache[cacheKey] = true;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
"development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
"development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
},{"28":28,"30":30,"31":31,"33":33,"36":36}],36:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
},{}]},{},[16])(16)
}); | tholu/cdnjs | ajax/libs/react/15.6.0-rc.1/react.js | JavaScript | mit | 142,452 |
"use strict"
const report = require("../../utils/report")
const ruleMessages = require("../../utils/ruleMessages")
const validateOptions = require("../../utils/validateOptions")
const ruleName = "stylelint-disable-reason"
const messages = ruleMessages(ruleName, {
expectedBefore: "Expected comment reason before `stylelint-disable` comment",
expectedAfter: "Expected comment reason after `stylelint-disable` comment",
})
const stylelintDisableCommand = "stylelint-disable"
const stylelintDisableLineCommand = "stylelint-disable-line"
const rule = function (expectation) {
return function (root, result) {
const validOptions = validateOptions(result, ruleName, {
actual: expectation,
possible: [
"always-before",
"always-after",
],
})
if (!validOptions) {
return
}
result.warn((
`'${ruleName}' has been deprecated and in 8.0 will be removed.`
), {
stylelintType: "deprecation",
stylelintReference: `https://stylelint.io/user-guide/rules/${ruleName}/`,
})
root.walkComments(function (comment) {
if (comment.text.indexOf(stylelintDisableCommand) !== 0) {
return
}
if (expectation === "always-before") {
const prev = comment.prev()
const prevIsCommentAndValid = prev && prev.type === "comment" && !isDisableCommand(prev.text)
let prevDisableLineIsCommentAndValid = false
if (comment.text.indexOf(stylelintDisableLineCommand) === 0 && !prevIsCommentAndValid && prev) {
const friendlyPrev = prev.prev()
prevDisableLineIsCommentAndValid = friendlyPrev && friendlyPrev.type === "comment" && !isDisableCommand(friendlyPrev.text)
}
if (!prevIsCommentAndValid && !prevDisableLineIsCommentAndValid) {
const disabledRanges = result.stylelint.disabledRanges
result.stylelint.disabledRanges = false
report({
message: messages.expectedBefore,
node: comment,
result,
ruleName,
})
result.stylelint.disabledRanges = disabledRanges
}
} else if (expectation === "always-after") {
const next = comment.next()
const nextIsCommentAndValid = next && next.type === "comment" && !isDisableCommand(next.text)
if (!nextIsCommentAndValid) {
const disabledRanges = result.stylelint.disabledRanges
result.stylelint.disabledRanges = false
report({
message: messages.expectedAfter,
node: comment,
result,
ruleName,
})
result.stylelint.disabledRanges = disabledRanges
}
}
})
function isDisableCommand(text) {
return text.indexOf(stylelintDisableCommand) === 0
}
}
}
rule.ruleName = ruleName
rule.messages = messages
module.exports = rule
| asrar7787/Test-Frontools | node_modules/stylelint/lib/rules/stylelint-disable-reason/index.js | JavaScript | mit | 2,878 |
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/ex3ndr/Develop/actor-platform/actor-apps/core/src/main/java/im/actor/model/modules/messages/entity/DialogHistory.java
//
#include "J2ObjC_source.h"
#include "im/actor/model/entity/MessageState.h"
#include "im/actor/model/entity/Peer.h"
#include "im/actor/model/entity/content/AbsContent.h"
#include "im/actor/model/modules/messages/entity/DialogHistory.h"
@interface ImActorModelModulesMessagesEntityDialogHistory () {
@public
AMPeer *peer_;
jint unreadCount_;
jlong sortDate_;
jlong rid_;
jlong date_;
jint senderId_;
AMAbsContent *content_;
AMMessageStateEnum *status_;
}
@end
J2OBJC_FIELD_SETTER(ImActorModelModulesMessagesEntityDialogHistory, peer_, AMPeer *)
J2OBJC_FIELD_SETTER(ImActorModelModulesMessagesEntityDialogHistory, content_, AMAbsContent *)
J2OBJC_FIELD_SETTER(ImActorModelModulesMessagesEntityDialogHistory, status_, AMMessageStateEnum *)
@implementation ImActorModelModulesMessagesEntityDialogHistory
- (instancetype)initWithAMPeer:(AMPeer *)peer
withInt:(jint)unreadCount
withLong:(jlong)sortDate
withLong:(jlong)rid
withLong:(jlong)date
withInt:(jint)senderId
withAMAbsContent:(AMAbsContent *)content
withAMMessageStateEnum:(AMMessageStateEnum *)status {
ImActorModelModulesMessagesEntityDialogHistory_initWithAMPeer_withInt_withLong_withLong_withLong_withInt_withAMAbsContent_withAMMessageStateEnum_(self, peer, unreadCount, sortDate, rid, date, senderId, content, status);
return self;
}
- (AMPeer *)getPeer {
return peer_;
}
- (jint)getUnreadCount {
return unreadCount_;
}
- (jlong)getSortDate {
return sortDate_;
}
- (jlong)getRid {
return rid_;
}
- (jlong)getDate {
return date_;
}
- (jint)getSenderId {
return senderId_;
}
- (AMAbsContent *)getContent {
return content_;
}
- (AMMessageStateEnum *)getStatus {
return status_;
}
@end
void ImActorModelModulesMessagesEntityDialogHistory_initWithAMPeer_withInt_withLong_withLong_withLong_withInt_withAMAbsContent_withAMMessageStateEnum_(ImActorModelModulesMessagesEntityDialogHistory *self, AMPeer *peer, jint unreadCount, jlong sortDate, jlong rid, jlong date, jint senderId, AMAbsContent *content, AMMessageStateEnum *status) {
(void) NSObject_init(self);
self->peer_ = peer;
self->unreadCount_ = unreadCount;
self->sortDate_ = sortDate;
self->rid_ = rid;
self->date_ = date;
self->senderId_ = senderId;
self->content_ = content;
self->status_ = status;
}
ImActorModelModulesMessagesEntityDialogHistory *new_ImActorModelModulesMessagesEntityDialogHistory_initWithAMPeer_withInt_withLong_withLong_withLong_withInt_withAMAbsContent_withAMMessageStateEnum_(AMPeer *peer, jint unreadCount, jlong sortDate, jlong rid, jlong date, jint senderId, AMAbsContent *content, AMMessageStateEnum *status) {
ImActorModelModulesMessagesEntityDialogHistory *self = [ImActorModelModulesMessagesEntityDialogHistory alloc];
ImActorModelModulesMessagesEntityDialogHistory_initWithAMPeer_withInt_withLong_withLong_withLong_withInt_withAMAbsContent_withAMMessageStateEnum_(self, peer, unreadCount, sortDate, rid, date, senderId, content, status);
return self;
}
J2OBJC_CLASS_TYPE_LITERAL_SOURCE(ImActorModelModulesMessagesEntityDialogHistory)
| JamesWatling/actor-platform | actor-apps/core-async-cocoa/src/im/actor/model/modules/messages/entity/DialogHistory.m | Matlab | mit | 3,385 |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
using System;
using System.Drawing;
namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Behaviors
{
/// <summary>
/// Provides a property dongle for opening the side bar.
/// </summary>
public class SidebarDongleController
{
private const int WIDGET_HORIZONTAL_OVERLAY = 10;
private const int WIDGET_VERTICAL_OFFSET = 5;
private ElementControlBehavior _parent;
private PropertiesDongleControl _dongle;
private IBlogPostSidebarContext _sidebarContext;
private SidebarDongleController(ElementControlBehavior parent, IBlogPostSidebarContext sidebarContext)
{
_parent = parent;
_sidebarContext = sidebarContext;
_sidebarContext.SidebarVisibleChanged += new EventHandler(_sidebarContext_SidebarVisibleChanged);
_dongle = new PropertiesDongleControl();
_parent.Controls.Add(_dongle);
_dongle.Click += new EventHandler(_dongle_Click);
_dongle.Visible = !_sidebarContext.SidebarVisible;
AttachPropertiesDongle();
}
public static SidebarDongleController AttachPropertiesDongle(ElementControlBehavior parent, IBlogPostSidebarContext sidebarContext)
{
return new SidebarDongleController(parent, sidebarContext);
}
private void AttachPropertiesDongle()
{
_parent.SelectedChanged += new EventHandler(_parent_SelectedChanged);
_parent.ElementSizeChanged += new EventHandler(_parent_ElementSizeChanged);
}
public void DetachPropertiesDongle()
{
_parent.SelectedChanged -= new EventHandler(_parent_SelectedChanged);
_parent.ElementSizeChanged -= new EventHandler(_parent_ElementSizeChanged);
}
private void _parent_ElementSizeChanged(object sender, EventArgs e)
{
SetDonglePosition();
}
private void SetDonglePosition()
{
_dongle.VirtualSize = _dongle.MinimumVirtualSize;
_dongle.VirtualLocation = new Point(_parent.ElementRectangle.Width - _dongle.VirtualWidth + WIDGET_HORIZONTAL_OVERLAY, 0 + WIDGET_VERTICAL_OFFSET);
}
private void _dongle_Click(object sender, EventArgs e)
{
_sidebarContext.SidebarVisible = true;
}
private void _sidebarContext_SidebarVisibleChanged(object sender, EventArgs e)
{
updateVisibility();
}
private void _parent_SelectedChanged(object sender, EventArgs e)
{
updateVisibility();
}
private void updateVisibility()
{
_dongle.Visible = _parent.Selected && !_sidebarContext.SidebarVisible;
_parent.Invalidate();
}
}
}
| MitchMilam/OpenLiveWriter | src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Behaviors/SidebarDongleController.cs | C# | mit | 2,938 |
/**
* @author mrdoob / http://mrdoob.com/
*/
function RollerCoasterGeometry( curve, divisions ) {
THREE.BufferGeometry.call( this );
var vertices = [];
var normals = [];
var colors = [];
var color1 = [ 1, 1, 1 ];
var color2 = [ 1, 1, 0 ];
var up = new THREE.Vector3( 0, 1, 0 );
var forward = new THREE.Vector3();
var right = new THREE.Vector3();
var quaternion = new THREE.Quaternion();
var prevQuaternion = new THREE.Quaternion();
prevQuaternion.setFromAxisAngle( up, Math.PI / 2 );
var point = new THREE.Vector3();
var prevPoint = new THREE.Vector3();
prevPoint.copy( curve.getPointAt( 0 ) );
// shapes
var step = [
new THREE.Vector3( - 0.225, 0, 0 ),
new THREE.Vector3( 0, - 0.050, 0 ),
new THREE.Vector3( 0, - 0.175, 0 ),
new THREE.Vector3( 0, - 0.050, 0 ),
new THREE.Vector3( 0.225, 0, 0 ),
new THREE.Vector3( 0, - 0.175, 0 )
];
var PI2 = Math.PI * 2;
var sides = 5;
var tube1 = [];
for ( var i = 0; i < sides; i ++ ) {
var angle = ( i / sides ) * PI2;
tube1.push( new THREE.Vector3( Math.sin( angle ) * 0.06, Math.cos( angle ) * 0.06, 0 ) );
}
var sides = 6;
var tube2 = [];
for ( var i = 0; i < sides; i ++ ) {
var angle = ( i / sides ) * PI2;
tube2.push( new THREE.Vector3( Math.sin( angle ) * 0.025, Math.cos( angle ) * 0.025, 0 ) );
}
var vector = new THREE.Vector3();
var normal = new THREE.Vector3();
function drawShape( shape, color ) {
normal.set( 0, 0, - 1 ).applyQuaternion( quaternion );
for ( var j = 0; j < shape.length; j ++ ) {
vector.copy( shape[ j ] );
vector.applyQuaternion( quaternion );
vector.add( point );
vertices.push( vector.x, vector.y, vector.z );
normals.push( normal.x, normal.y, normal.z );
colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
}
normal.set( 0, 0, 1 ).applyQuaternion( quaternion );
for ( var j = shape.length - 1; j >= 0; j -- ) {
vector.copy( shape[ j ] );
vector.applyQuaternion( quaternion );
vector.add( point );
vertices.push( vector.x, vector.y, vector.z );
normals.push( normal.x, normal.y, normal.z );
colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
}
}
var vector1 = new THREE.Vector3();
var vector2 = new THREE.Vector3();
var vector3 = new THREE.Vector3();
var vector4 = new THREE.Vector3();
var normal1 = new THREE.Vector3();
var normal2 = new THREE.Vector3();
var normal3 = new THREE.Vector3();
var normal4 = new THREE.Vector3();
function extrudeShape( shape, offset, color ) {
for ( var j = 0, jl = shape.length; j < jl; j ++ ) {
var point1 = shape[ j ];
var point2 = shape[ ( j + 1 ) % jl ];
vector1.copy( point1 ).add( offset );
vector1.applyQuaternion( quaternion );
vector1.add( point );
vector2.copy( point2 ).add( offset );
vector2.applyQuaternion( quaternion );
vector2.add( point );
vector3.copy( point2 ).add( offset );
vector3.applyQuaternion( prevQuaternion );
vector3.add( prevPoint );
vector4.copy( point1 ).add( offset );
vector4.applyQuaternion( prevQuaternion );
vector4.add( prevPoint );
vertices.push( vector1.x, vector1.y, vector1.z );
vertices.push( vector2.x, vector2.y, vector2.z );
vertices.push( vector4.x, vector4.y, vector4.z );
vertices.push( vector2.x, vector2.y, vector2.z );
vertices.push( vector3.x, vector3.y, vector3.z );
vertices.push( vector4.x, vector4.y, vector4.z );
//
normal1.copy( point1 );
normal1.applyQuaternion( quaternion );
normal1.normalize();
normal2.copy( point2 );
normal2.applyQuaternion( quaternion );
normal2.normalize();
normal3.copy( point2 );
normal3.applyQuaternion( prevQuaternion );
normal3.normalize();
normal4.copy( point1 );
normal4.applyQuaternion( prevQuaternion );
normal4.normalize();
normals.push( normal1.x, normal1.y, normal1.z );
normals.push( normal2.x, normal2.y, normal2.z );
normals.push( normal4.x, normal4.y, normal4.z );
normals.push( normal2.x, normal2.y, normal2.z );
normals.push( normal3.x, normal3.y, normal3.z );
normals.push( normal4.x, normal4.y, normal4.z );
colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
}
}
var offset = new THREE.Vector3();
for ( var i = 1; i <= divisions; i ++ ) {
point.copy( curve.getPointAt( i / divisions ) );
up.set( 0, 1, 0 );
forward.subVectors( point, prevPoint ).normalize();
right.crossVectors( up, forward ).normalize();
up.crossVectors( forward, right );
var angle = Math.atan2( forward.x, forward.z );
quaternion.setFromAxisAngle( up, angle );
if ( i % 2 === 0 ) {
drawShape( step, color2 );
}
extrudeShape( tube1, offset.set( 0, - 0.125, 0 ), color2 );
extrudeShape( tube2, offset.set( 0.2, 0, 0 ), color1 );
extrudeShape( tube2, offset.set( - 0.2, 0, 0 ), color1 );
prevPoint.copy( point );
prevQuaternion.copy( quaternion );
}
// console.log( vertices.length );
this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );
this.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( normals ), 3 ) );
this.addAttribute( 'color', new THREE.BufferAttribute( new Float32Array( colors ), 3 ) );
}
RollerCoasterGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
function RollerCoasterLiftersGeometry( curve, divisions ) {
THREE.BufferGeometry.call( this );
var vertices = [];
var normals = [];
var quaternion = new THREE.Quaternion();
var up = new THREE.Vector3( 0, 1, 0 );
var point = new THREE.Vector3();
var tangent = new THREE.Vector3();
// shapes
var tube1 = [
new THREE.Vector3( 0, 0.05, - 0.05 ),
new THREE.Vector3( 0, 0.05, 0.05 ),
new THREE.Vector3( 0, - 0.05, 0 )
];
var tube2 = [
new THREE.Vector3( - 0.05, 0, 0.05 ),
new THREE.Vector3( - 0.05, 0, - 0.05 ),
new THREE.Vector3( 0.05, 0, 0 )
];
var tube3 = [
new THREE.Vector3( 0.05, 0, - 0.05 ),
new THREE.Vector3( 0.05, 0, 0.05 ),
new THREE.Vector3( - 0.05, 0, 0 )
];
var vector1 = new THREE.Vector3();
var vector2 = new THREE.Vector3();
var vector3 = new THREE.Vector3();
var vector4 = new THREE.Vector3();
var normal1 = new THREE.Vector3();
var normal2 = new THREE.Vector3();
var normal3 = new THREE.Vector3();
var normal4 = new THREE.Vector3();
function extrudeShape( shape, fromPoint, toPoint ) {
for ( var j = 0, jl = shape.length; j < jl; j ++ ) {
var point1 = shape[ j ];
var point2 = shape[ ( j + 1 ) % jl ];
vector1.copy( point1 );
vector1.applyQuaternion( quaternion );
vector1.add( fromPoint );
vector2.copy( point2 );
vector2.applyQuaternion( quaternion );
vector2.add( fromPoint );
vector3.copy( point2 );
vector3.applyQuaternion( quaternion );
vector3.add( toPoint );
vector4.copy( point1 );
vector4.applyQuaternion( quaternion );
vector4.add( toPoint );
vertices.push( vector1.x, vector1.y, vector1.z );
vertices.push( vector2.x, vector2.y, vector2.z );
vertices.push( vector4.x, vector4.y, vector4.z );
vertices.push( vector2.x, vector2.y, vector2.z );
vertices.push( vector3.x, vector3.y, vector3.z );
vertices.push( vector4.x, vector4.y, vector4.z );
//
normal1.copy( point1 );
normal1.applyQuaternion( quaternion );
normal1.normalize();
normal2.copy( point2 );
normal2.applyQuaternion( quaternion );
normal2.normalize();
normal3.copy( point2 );
normal3.applyQuaternion( quaternion );
normal3.normalize();
normal4.copy( point1 );
normal4.applyQuaternion( quaternion );
normal4.normalize();
normals.push( normal1.x, normal1.y, normal1.z );
normals.push( normal2.x, normal2.y, normal2.z );
normals.push( normal4.x, normal4.y, normal4.z );
normals.push( normal2.x, normal2.y, normal2.z );
normals.push( normal3.x, normal3.y, normal3.z );
normals.push( normal4.x, normal4.y, normal4.z );
}
}
var fromPoint = new THREE.Vector3();
var toPoint = new THREE.Vector3();
for ( var i = 1; i <= divisions; i ++ ) {
point.copy( curve.getPointAt( i / divisions ) );
tangent.copy( curve.getTangentAt( i / divisions ) );
var angle = Math.atan2( tangent.x, tangent.z );
quaternion.setFromAxisAngle( up, angle );
//
if ( point.y > 10 ) {
fromPoint.set( - 0.75, - 0.35, 0 );
fromPoint.applyQuaternion( quaternion );
fromPoint.add( point );
toPoint.set( 0.75, - 0.35, 0 );
toPoint.applyQuaternion( quaternion );
toPoint.add( point );
extrudeShape( tube1, fromPoint, toPoint );
fromPoint.set( - 0.7, - 0.3, 0 );
fromPoint.applyQuaternion( quaternion );
fromPoint.add( point );
toPoint.set( - 0.7, - point.y, 0 );
toPoint.applyQuaternion( quaternion );
toPoint.add( point );
extrudeShape( tube2, fromPoint, toPoint );
fromPoint.set( 0.7, - 0.3, 0 );
fromPoint.applyQuaternion( quaternion );
fromPoint.add( point );
toPoint.set( 0.7, - point.y, 0 );
toPoint.applyQuaternion( quaternion );
toPoint.add( point );
extrudeShape( tube3, fromPoint, toPoint );
} else {
fromPoint.set( 0, - 0.2, 0 );
fromPoint.applyQuaternion( quaternion );
fromPoint.add( point );
toPoint.set( 0, - point.y, 0 );
toPoint.applyQuaternion( quaternion );
toPoint.add( point );
extrudeShape( tube3, fromPoint, toPoint );
}
}
this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );
this.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( normals ), 3 ) );
}
RollerCoasterLiftersGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
function RollerCoasterShadowGeometry( curve, divisions ) {
THREE.BufferGeometry.call( this );
var vertices = [];
var up = new THREE.Vector3( 0, 1, 0 );
var forward = new THREE.Vector3();
var quaternion = new THREE.Quaternion();
var prevQuaternion = new THREE.Quaternion();
prevQuaternion.setFromAxisAngle( up, Math.PI / 2 );
var point = new THREE.Vector3();
var prevPoint = new THREE.Vector3();
prevPoint.copy( curve.getPointAt( 0 ) );
prevPoint.y = 0;
var vector1 = new THREE.Vector3();
var vector2 = new THREE.Vector3();
var vector3 = new THREE.Vector3();
var vector4 = new THREE.Vector3();
for ( var i = 1; i <= divisions; i ++ ) {
point.copy( curve.getPointAt( i / divisions ) );
point.y = 0;
forward.subVectors( point, prevPoint );
var angle = Math.atan2( forward.x, forward.z );
quaternion.setFromAxisAngle( up, angle );
vector1.set( - 0.3, 0, 0 );
vector1.applyQuaternion( quaternion );
vector1.add( point );
vector2.set( 0.3, 0, 0 );
vector2.applyQuaternion( quaternion );
vector2.add( point );
vector3.set( 0.3, 0, 0 );
vector3.applyQuaternion( prevQuaternion );
vector3.add( prevPoint );
vector4.set( - 0.3, 0, 0 );
vector4.applyQuaternion( prevQuaternion );
vector4.add( prevPoint );
vertices.push( vector1.x, vector1.y, vector1.z );
vertices.push( vector2.x, vector2.y, vector2.z );
vertices.push( vector4.x, vector4.y, vector4.z );
vertices.push( vector2.x, vector2.y, vector2.z );
vertices.push( vector3.x, vector3.y, vector3.z );
vertices.push( vector4.x, vector4.y, vector4.z );
prevPoint.copy( point );
prevQuaternion.copy( quaternion );
}
this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );
}
RollerCoasterShadowGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
function SkyGeometry() {
THREE.BufferGeometry.call( this );
var vertices = [];
for ( var i = 0; i < 100; i ++ ) {
var x = Math.random() * 800 - 400;
var y = Math.random() * 50 + 50;
var z = Math.random() * 800 - 400;
var size = Math.random() * 40 + 20;
vertices.push( x - size, y, z - size );
vertices.push( x + size, y, z - size );
vertices.push( x - size, y, z + size );
vertices.push( x + size, y, z - size );
vertices.push( x + size, y, z + size );
vertices.push( x - size, y, z + size );
}
this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );
}
SkyGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
function TreesGeometry( landscape ) {
THREE.BufferGeometry.call( this );
var vertices = [];
var colors = [];
var raycaster = new THREE.Raycaster();
raycaster.ray.direction.set( 0, - 1, 0 );
for ( var i = 0; i < 2000; i ++ ) {
var x = Math.random() * 500 - 250;
var z = Math.random() * 500 - 250;
raycaster.ray.origin.set( x, 50, z );
var intersections = raycaster.intersectObject( landscape );
if ( intersections.length === 0 ) continue;
var y = intersections[ 0 ].point.y;
var height = Math.random() * 5 + 0.5;
var angle = Math.random() * Math.PI * 2;
vertices.push( x + Math.sin( angle ), y, z + Math.cos( angle ) );
vertices.push( x, y + height, z );
vertices.push( x + Math.sin( angle + Math.PI ), y, z + Math.cos( angle + Math.PI ) );
angle += Math.PI / 2;
vertices.push( x + Math.sin( angle ), y, z + Math.cos( angle ) );
vertices.push( x, y + height, z );
vertices.push( x + Math.sin( angle + Math.PI ), y, z + Math.cos( angle + Math.PI ) );
var random = Math.random() * 0.1;
for ( var j = 0; j < 6; j ++ ) {
colors.push( 0.2 + random, 0.4 + random, 0 );
}
}
this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );
this.addAttribute( 'color', new THREE.BufferAttribute( new Float32Array( colors ), 3 ) );
}
TreesGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
| Michayal/michayal.github.io | node_modules/super-three/examples/js/RollerCoaster.js | JavaScript | mit | 13,765 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.Network
{
using Azure;
using Management;
using Rest;
using Rest.Azure;
using Models;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Extension methods for NetworkInterfacesOperations.
/// </summary>
public static partial class NetworkInterfacesOperationsExtensions
{
/// <summary>
/// Deletes the specified network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
public static void Delete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName)
{
operations.DeleteAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult();
}
/// <summary>
/// Deletes the specified network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task DeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken))
{
await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Gets information about the specified network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='expand'>
/// Expands referenced resources.
/// </param>
public static NetworkInterface Get(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string))
{
return operations.GetAsync(resourceGroupName, networkInterfaceName, expand).GetAwaiter().GetResult();
}
/// <summary>
/// Gets information about the specified network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='expand'>
/// Expands referenced resources.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<NetworkInterface> GetAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Creates or updates a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the create or update network interface operation.
/// </param>
public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters)
{
return operations.CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult();
}
/// <summary>
/// Creates or updates a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the create or update network interface operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<NetworkInterface> CreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all network interfaces in a subscription.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
public static IPage<NetworkInterface> ListAll(this INetworkInterfacesOperations operations)
{
return operations.ListAllAsync().GetAwaiter().GetResult();
}
/// <summary>
/// Gets all network interfaces in a subscription.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<NetworkInterface>> ListAllAsync(this INetworkInterfacesOperations operations, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all network interfaces in a resource group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
public static IPage<NetworkInterface> List(this INetworkInterfacesOperations operations, string resourceGroupName)
{
return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all network interfaces in a resource group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<NetworkInterface>> ListAsync(this INetworkInterfacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all route tables applied to a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName)
{
return operations.GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all route tables applied to a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<EffectiveRouteListResult> GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all network security groups applied to a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName)
{
return operations.ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all network security groups applied to a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<EffectiveNetworkSecurityGroupListResult> ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets information about all network interfaces in a virtual machine in a
/// virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='virtualMachineScaleSetName'>
/// The name of the virtual machine scale set.
/// </param>
/// <param name='virtualmachineIndex'>
/// The virtual machine index.
/// </param>
public static IPage<NetworkInterface> ListVirtualMachineScaleSetVMNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex)
{
return operations.ListVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).GetAwaiter().GetResult();
}
/// <summary>
/// Gets information about all network interfaces in a virtual machine in a
/// virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='virtualMachineScaleSetName'>
/// The name of the virtual machine scale set.
/// </param>
/// <param name='virtualmachineIndex'>
/// The virtual machine index.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<NetworkInterface>> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all network interfaces in a virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='virtualMachineScaleSetName'>
/// The name of the virtual machine scale set.
/// </param>
public static IPage<NetworkInterface> ListVirtualMachineScaleSetNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName)
{
return operations.ListVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all network interfaces in a virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='virtualMachineScaleSetName'>
/// The name of the virtual machine scale set.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<NetworkInterface>> ListVirtualMachineScaleSetNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Get the specified network interface in a virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='virtualMachineScaleSetName'>
/// The name of the virtual machine scale set.
/// </param>
/// <param name='virtualmachineIndex'>
/// The virtual machine index.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='expand'>
/// Expands referenced resources.
/// </param>
public static NetworkInterface GetVirtualMachineScaleSetNetworkInterface(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string))
{
return operations.GetVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).GetAwaiter().GetResult();
}
/// <summary>
/// Get the specified network interface in a virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='virtualMachineScaleSetName'>
/// The name of the virtual machine scale set.
/// </param>
/// <param name='virtualmachineIndex'>
/// The virtual machine index.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='expand'>
/// Expands referenced resources.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<NetworkInterface> GetVirtualMachineScaleSetNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Deletes the specified network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
public static void BeginDelete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName)
{
operations.BeginDeleteAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult();
}
/// <summary>
/// Deletes the specified network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken))
{
await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Creates or updates a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the create or update network interface operation.
/// </param>
public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters)
{
return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult();
}
/// <summary>
/// Creates or updates a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the create or update network interface operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<NetworkInterface> BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all route tables applied to a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName)
{
return operations.BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all route tables applied to a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<EffectiveRouteListResult> BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all network security groups applied to a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName)
{
return operations.BeginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all network security groups applied to a network interface.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='networkInterfaceName'>
/// The name of the network interface.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<EffectiveNetworkSecurityGroupListResult> BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all network interfaces in a subscription.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
public static IPage<NetworkInterface> ListAllNext(this INetworkInterfacesOperations operations, string nextPageLink)
{
return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all network interfaces in a subscription.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<NetworkInterface>> ListAllNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all network interfaces in a resource group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
public static IPage<NetworkInterface> ListNext(this INetworkInterfacesOperations operations, string nextPageLink)
{
return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all network interfaces in a resource group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<NetworkInterface>> ListNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets information about all network interfaces in a virtual machine in a
/// virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
public static IPage<NetworkInterface> ListVirtualMachineScaleSetVMNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink)
{
return operations.ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult();
}
/// <summary>
/// Gets information about all network interfaces in a virtual machine in a
/// virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<NetworkInterface>> ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Gets all network interfaces in a virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
public static IPage<NetworkInterface> ListVirtualMachineScaleSetNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink)
{
return operations.ListVirtualMachineScaleSetNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult();
}
/// <summary>
/// Gets all network interfaces in a virtual machine scale set.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<NetworkInterface>> ListVirtualMachineScaleSetNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
}
}
| AzCiS/azure-sdk-for-net | src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs | C# | mit | 37,061 |
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies
http://www.cocos2d-x.org
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.
****************************************************************************/
#include "CCNS.h"
#include <string>
#include <vector>
#include <string.h>
#include <stdlib.h>
using namespace std;
NS_CC_BEGIN
typedef std::vector<std::string> strArray;
// string toolkit
static inline void split(const std::string& src, const std::string& token, strArray& vect)
{
size_t nend = 0;
size_t nbegin = 0;
size_t tokenSize = token.size();
while(nend != std::string::npos)
{
nend = src.find(token, nbegin);
if(nend == std::string::npos)
vect.push_back(src.substr(nbegin, src.length()-nbegin));
else
vect.push_back(src.substr(nbegin, nend-nbegin));
nbegin = nend + tokenSize;
}
}
// first, judge whether the form of the string like this: {x,y}
// if the form is right,the string will be split into the parameter strs;
// or the parameter strs will be empty.
// if the form is right return true,else return false.
static bool splitWithForm(const std::string& str, strArray& strs)
{
bool bRet = false;
do
{
CC_BREAK_IF(str.empty());
// string is empty
std::string content = str;
CC_BREAK_IF(content.length() == 0);
size_t nPosLeft = content.find('{');
size_t nPosRight = content.find('}');
// don't have '{' and '}'
CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos);
// '}' is before '{'
CC_BREAK_IF(nPosLeft > nPosRight);
std::string pointStr = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1);
// nothing between '{' and '}'
CC_BREAK_IF(pointStr.length() == 0);
size_t nPos1 = pointStr.find('{');
size_t nPos2 = pointStr.find('}');
// contain '{' or '}'
CC_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos);
split(pointStr, ",", strs);
if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0)
{
strs.clear();
break;
}
bRet = true;
} while (0);
return bRet;
}
// implement the functions
Rect RectFromString(const std::string& str)
{
Rect result = Rect::ZERO;
do
{
CC_BREAK_IF(str.empty());
std::string content = str;
// find the first '{' and the third '}'
size_t nPosLeft = content.find('{');
size_t nPosRight = content.find('}');
for (int i = 1; i < 3; ++i)
{
if (nPosRight == std::string::npos)
{
break;
}
nPosRight = content.find('}', nPosRight + 1);
}
CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos);
content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1);
size_t nPointEnd = content.find('}');
CC_BREAK_IF(nPointEnd == std::string::npos);
nPointEnd = content.find(',', nPointEnd);
CC_BREAK_IF(nPointEnd == std::string::npos);
// get the point string and size string
std::string pointStr = content.substr(0, nPointEnd);
std::string sizeStr = content.substr(nPointEnd + 1, content.length() - nPointEnd);
// split the string with ','
strArray pointInfo;
CC_BREAK_IF(!splitWithForm(pointStr.c_str(), pointInfo));
strArray sizeInfo;
CC_BREAK_IF(!splitWithForm(sizeStr.c_str(), sizeInfo));
float x = (float) atof(pointInfo[0].c_str());
float y = (float) atof(pointInfo[1].c_str());
float width = (float) atof(sizeInfo[0].c_str());
float height = (float) atof(sizeInfo[1].c_str());
result = Rect(x, y, width, height);
} while (0);
return result;
}
Point PointFromString(const std::string& str)
{
Point ret = Point::ZERO;
do
{
strArray strs;
CC_BREAK_IF(!splitWithForm(str, strs));
float x = (float) atof(strs[0].c_str());
float y = (float) atof(strs[1].c_str());
ret = Point(x, y);
} while (0);
return ret;
}
Size SizeFromString(const std::string& pszContent)
{
Size ret = Size::ZERO;
do
{
strArray strs;
CC_BREAK_IF(!splitWithForm(pszContent, strs));
float width = (float) atof(strs[0].c_str());
float height = (float) atof(strs[1].c_str());
ret = Size(width, height);
} while (0);
return ret;
}
NS_CC_END
| nagyistoce/OpenBird | cocos2d/cocos/base/CCNS.cpp | C++ | mit | 5,672 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Dumper;
use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/**
* GraphvizDumper dumps a service container as a graphviz file.
*
* You can convert the generated dot file with the dot utility (http://www.graphviz.org/):
*
* dot -Tpng container.dot > foo.png
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class GraphvizDumper extends Dumper
{
private $nodes;
private $edges;
private $options = array(
'graph' => array('ratio' => 'compress'),
'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'),
'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5),
'node.instance' => array('fillcolor' => '#9999ff', 'style' => 'filled'),
'node.definition' => array('fillcolor' => '#eeeeee'),
'node.missing' => array('fillcolor' => '#ff9999', 'style' => 'filled'),
);
/**
* Dumps the service container as a graphviz graph.
*
* Available options:
*
* * graph: The default options for the whole graph
* * node: The default options for nodes
* * edge: The default options for edges
* * node.instance: The default options for services that are defined directly by object instances
* * node.definition: The default options for services that are defined via service definition instances
* * node.missing: The default options for missing services
*
* @return string The dot representation of the service container
*/
public function dump(array $options = array())
{
foreach (array('graph', 'node', 'edge', 'node.instance', 'node.definition', 'node.missing') as $key) {
if (isset($options[$key])) {
$this->options[$key] = array_merge($this->options[$key], $options[$key]);
}
}
$this->nodes = $this->findNodes();
$this->edges = array();
foreach ($this->container->getDefinitions() as $id => $definition) {
$this->edges[$id] = array_merge(
$this->findEdges($id, $definition->getArguments(), true, ''),
$this->findEdges($id, $definition->getProperties(), false, '')
);
foreach ($definition->getMethodCalls() as $call) {
$this->edges[$id] = array_merge(
$this->edges[$id],
$this->findEdges($id, $call[1], false, $call[0].'()')
);
}
}
return $this->container->resolveEnvPlaceholders($this->startDot().$this->addNodes().$this->addEdges().$this->endDot(), '__ENV_%s__');
}
private function addNodes(): string
{
$code = '';
foreach ($this->nodes as $id => $node) {
$aliases = $this->getAliases($id);
$code .= sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id), $id.($aliases ? ' ('.implode(', ', $aliases).')' : ''), $node['class'], $this->options['node']['shape'], $this->addAttributes($node['attributes']));
}
return $code;
}
private function addEdges(): string
{
$code = '';
foreach ($this->edges as $id => $edges) {
foreach ($edges as $edge) {
$code .= sprintf(" node_%s -> node_%s [label=\"%s\" style=\"%s\"%s];\n", $this->dotize($id), $this->dotize($edge['to']), $edge['name'], $edge['required'] ? 'filled' : 'dashed', $edge['lazy'] ? ' color="#9999ff"' : '');
}
}
return $code;
}
/**
* Finds all edges belonging to a specific service id.
*/
private function findEdges(string $id, array $arguments, bool $required, string $name, bool $lazy = false): array
{
$edges = array();
foreach ($arguments as $argument) {
if ($argument instanceof Parameter) {
$argument = $this->container->hasParameter($argument) ? $this->container->getParameter($argument) : null;
} elseif (is_string($argument) && preg_match('/^%([^%]+)%$/', $argument, $match)) {
$argument = $this->container->hasParameter($match[1]) ? $this->container->getParameter($match[1]) : null;
}
if ($argument instanceof Reference) {
$lazyEdge = $lazy;
if (!$this->container->has((string) $argument)) {
$this->nodes[(string) $argument] = array('name' => $name, 'required' => $required, 'class' => '', 'attributes' => $this->options['node.missing']);
} elseif ('service_container' !== (string) $argument) {
$lazyEdge = $lazy || $this->container->getDefinition((string) $argument)->isLazy();
}
$edges[] = array('name' => $name, 'required' => $required, 'to' => $argument, 'lazy' => $lazyEdge);
} elseif ($argument instanceof ArgumentInterface) {
$edges = array_merge($edges, $this->findEdges($id, $argument->getValues(), $required, $name, true));
} elseif (is_array($argument)) {
$edges = array_merge($edges, $this->findEdges($id, $argument, $required, $name, $lazy));
}
}
return $edges;
}
private function findNodes(): array
{
$nodes = array();
$container = $this->cloneContainer();
foreach ($container->getDefinitions() as $id => $definition) {
$class = $definition->getClass();
if ('\\' === substr($class, 0, 1)) {
$class = substr($class, 1);
}
try {
$class = $this->container->getParameterBag()->resolveValue($class);
} catch (ParameterNotFoundException $e) {
}
$nodes[$id] = array('class' => str_replace('\\', '\\\\', $class), 'attributes' => array_merge($this->options['node.definition'], array('style' => $definition->isShared() ? 'filled' : 'dotted')));
$container->setDefinition($id, new Definition('stdClass'));
}
foreach ($container->getServiceIds() as $id) {
if (array_key_exists($id, $container->getAliases())) {
continue;
}
if (!$container->hasDefinition($id)) {
$nodes[$id] = array('class' => str_replace('\\', '\\\\', get_class($container->get($id))), 'attributes' => $this->options['node.instance']);
}
}
return $nodes;
}
private function cloneContainer()
{
$parameterBag = new ParameterBag($this->container->getParameterBag()->all());
$container = new ContainerBuilder($parameterBag);
$container->setDefinitions($this->container->getDefinitions());
$container->setAliases($this->container->getAliases());
$container->setResources($this->container->getResources());
foreach ($this->container->getExtensions() as $extension) {
$container->registerExtension($extension);
}
return $container;
}
private function startDot(): string
{
return sprintf("digraph sc {\n %s\n node [%s];\n edge [%s];\n\n",
$this->addOptions($this->options['graph']),
$this->addOptions($this->options['node']),
$this->addOptions($this->options['edge'])
);
}
private function endDot(): string
{
return "}\n";
}
private function addAttributes(array $attributes): string
{
$code = array();
foreach ($attributes as $k => $v) {
$code[] = sprintf('%s="%s"', $k, $v);
}
return $code ? ', '.implode(', ', $code) : '';
}
private function addOptions(array $options): string
{
$code = array();
foreach ($options as $k => $v) {
$code[] = sprintf('%s="%s"', $k, $v);
}
return implode(' ', $code);
}
private function dotize(string $id): string
{
return preg_replace('/\W/i', '_', $id);
}
private function getAliases(string $id): array
{
$aliases = array();
foreach ($this->container->getAliases() as $alias => $origin) {
if ($id == $origin) {
$aliases[] = $alias;
}
}
return $aliases;
}
}
| gencer/symfony | src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php | PHP | mit | 9,004 |
'use strict';
var angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray']);
angularMeteorObject.factory('AngularMeteorObject', [
'$q', '$meteorSubscribe', '$meteorCollection', '$meteorUtils', 'diffArray',
function($q, $meteorSubscribe, $meteorCollection, $meteorUtils, diffArray) {
// A list of internals properties to not watch for, nor pass to the Document on update and etc.
AngularMeteorObject.$$internalProps = [
'$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope',
'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject',
'_auto', '_setAutos', '_eventEmitter', '_serverBackup'
];
function AngularMeteorObject (collection, id, options){
// Make data not be an object so we can extend it to preserve
// Collection Helpers and the like
var data = new function SubObject() {};
var doc = collection.findOne(id, options);
angular.extend(data, doc);
angular.extend(data, AngularMeteorObject);
data._serverBackup = doc || {};
data.$$collection = collection;
data.$$options = options;
data.$$id = id;
return data;
}
AngularMeteorObject.getRawObject = function () {
return angular.copy(_.omit(this, this.$$internalProps));
};
AngularMeteorObject.subscribe = function () {
$meteorSubscribe.subscribe.apply(this, arguments);
return this;
};
AngularMeteorObject.save = function(changes) {
var deferred = $q.defer();
var updates;
if (changes)
updates = { $set: changes };
else
updates = this.getRawObject();
this.$$collection.update(this._id, updates, $meteorUtils.fulfill(deferred));
return deferred.promise;
};
AngularMeteorObject.reset = function(keepClientProps) {
var self = this;
var options = this.$$options;
var id = this.$$id;
var doc = this.$$collection.findOne(id, options);
if (doc) {
// extend SubObject
var docKeys = _.keys(doc);
var docExtension = _.pick(doc, docKeys);
var clientProps;
angular.extend(Object.getPrototypeOf(self), Object.getPrototypeOf(doc));
_.extend(self, docExtension);
_.extend(self._serverBackup, docExtension);
if (keepClientProps) {
clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup));
} else {
clientProps = _.keys(self);
}
var serverProps = _.keys(doc);
var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps);
removedKeys.forEach(function (prop) {
delete self[prop];
delete self._serverBackup[prop];
});
}
else {
_.keys(this.getRawObject()).forEach(function(prop) {
delete self[prop];
});
self._serverBackup = {};
}
};
AngularMeteorObject.stop = function () {
if (this.unregisterAutoDestroy)
this.unregisterAutoDestroy();
if (this.unregisterAutoBind)
this.unregisterAutoBind();
if (this.autorunComputation && this.autorunComputation.stop)
this.autorunComputation.stop();
};
return AngularMeteorObject;
}]);
angularMeteorObject.factory('$meteorObject', [
'$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject',
function($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {
function $meteorObject(collection, id, auto, options) {
// Validate parameters
if (!collection) {
throw new TypeError("The first argument of $meteorObject is undefined.");
}
if (!angular.isFunction(collection.findOne)) {
throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.");
}
var data = new AngularMeteorObject(collection, id, options);
data._auto = auto !== false; // Making auto default true - http://stackoverflow.com/a/15464208/1426570
angular.extend(data, $meteorObject);
data._setAutos();
return data;
}
$meteorObject._setAutos = function() {
var self = this;
this.autorunComputation = $meteorUtils.autorun($rootScope, function() {
self.reset(true);
});
// Deep watches the model and performs autobind
this.unregisterAutoBind = this._auto && $rootScope.$watch(function(){
return self.getRawObject();
}, function (item, oldItem) {
if (item === oldItem) return;
var id = item._id;
delete item._id;
delete oldItem._id;
var updates = getUpdates(oldItem, item);
if (_.isEmpty(updates)) return;
self.$$collection.update({_id: id}, updates);
}, true);
this.unregisterAutoDestroy = $rootScope.$on('$destroy', function() {
if (self && self.stop) {
self.stop();
}
});
};
return $meteorObject;
}]);
angularMeteorObject.run([
'$rootScope', '$meteorObject', '$meteorStopper',
function ($rootScope, $meteorObject, $meteorStopper) {
var scopeProto = Object.getPrototypeOf($rootScope);
scopeProto.$meteorObject = $meteorStopper($meteorObject);
}]);
| mauricionr/angular-meteor | modules/angular-meteor-object.js | JavaScript | mit | 5,379 |
/*
This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License Usage
This file may be used under the terms of the GNU General Public License version 3.0 as
published by the Free Software Foundation and appearing in the file LICENSE included in the
packaging of this file.
Please review the following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2013-04-03 15:07:25
*/
Ext.data.JsonP.Ext_list_DateColumn({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.list.Column","uses":[],"html":"<div><pre class=\"hierarchy\"><h4>Hierarchy</h4><div class='subclass first-child'><a href='#!/api/Ext.list.Column' rel='Ext.list.Column' class='docClass'>Ext.list.Column</a><div class='subclass '><strong>Ext.list.DateColumn</strong></div></div><h4>Files</h4><div class='dependency'><a href='source/Column2.html#Ext-list-DateColumn' target='_blank'>Column.js</a></div></pre><div class='doc-contents'><p>A Column definition class which renders a passed date according to the default locale, or a configured\n<a href=\"#!/api/Ext.list.DateColumn-property-format\" rel=\"Ext.list.DateColumn-property-format\" class=\"docClass\">format</a>. See the xtype config option of <a href=\"#!/api/Ext.list.Column\" rel=\"Ext.list.Column\" class=\"docClass\">Ext.list.Column</a>\nfor more details.</p>\n\n</div><div class='members'><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-cfg'>Config options</h3><div class='subsection'><div id='cfg-align' class='member first-child inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><a href='#!/api/Ext.list.Column' rel='Ext.list.Column' class='defined-in docClass'>Ext.list.Column</a><br/><a href='source/Column2.html#Ext-list-Column-cfg-align' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Ext.list.Column-cfg-align' class='name expandable'>align</a><span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a></span></div><div class='description'><div class='short'>Set the CSS text-align property of the column. ...</div><div class='long'><p>Set the CSS text-align property of the column. Defaults to <tt>'left'</tt>.</p>\n<p>Defaults to: <code>'left'</code></p></div></div></div><div id='cfg-cls' class='member inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><a href='#!/api/Ext.list.Column' rel='Ext.list.Column' class='defined-in docClass'>Ext.list.Column</a><br/><a href='source/Column2.html#Ext-list-Column-cfg-cls' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Ext.list.Column-cfg-cls' class='name expandable'>cls</a><span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a></span></div><div class='description'><div class='short'>Optional. ...</div><div class='long'><p>Optional. This option can be used to add a CSS class to the cell of each\nrow for this column.</p>\n<p>Defaults to: <code>''</code></p></div></div></div><div id='cfg-dataIndex' class='member inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><a href='#!/api/Ext.list.Column' rel='Ext.list.Column' class='defined-in docClass'>Ext.list.Column</a><br/><a href='source/Column2.html#Ext-list-Column-cfg-dataIndex' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Ext.list.Column-cfg-dataIndex' class='name expandable'>dataIndex</a><span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a></span></div><div class='description'><div class='short'>Required. ...</div><div class='long'><p><b>Required</b>. The name of the field in the\nListViews's <a href=\"#!/api/Ext.data.Store\" rel=\"Ext.data.Store\" class=\"docClass\">Ext.data.Store</a>'s <a href=\"#!/api/Ext.data.Record\" rel=\"Ext.data.Record\" class=\"docClass\">Ext.data.Record</a> definition from\nwhich to draw the column's value.</p>\n\n</div></div></div><div id='cfg-header' class='member inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><a href='#!/api/Ext.list.Column' rel='Ext.list.Column' class='defined-in docClass'>Ext.list.Column</a><br/><a href='source/Column2.html#Ext-list-Column-cfg-header' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Ext.list.Column-cfg-header' class='name expandable'>header</a><span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a></span></div><div class='description'><div class='short'>Optional. ...</div><div class='long'><p>Optional. The header text to be used as innerHTML\n(html tags are accepted) to display in the ListView. <b>Note</b>: to\nhave a clickable header with no text displayed use <tt>' '</tt>.</p>\n<p>Defaults to: <code>''</code></p></div></div></div><div id='cfg-isColumn' class='member inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><a href='#!/api/Ext.list.Column' rel='Ext.list.Column' class='defined-in docClass'>Ext.list.Column</a><br/><a href='source/Column2.html#Ext-list-Column-cfg-isColumn' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Ext.list.Column-cfg-isColumn' class='name expandable'>isColumn</a><span> : Boolean</span><strong class='private signature' >private</strong></div><div class='description'><div class='short'>Used by ListView constructor method to avoid reprocessing a Column\nif isColumn is not set ListView will recreate a ne...</div><div class='long'><p>Used by ListView constructor method to avoid reprocessing a Column\nif <code>isColumn</code> is not set ListView will recreate a new <a href=\"#!/api/Ext.list.Column\" rel=\"Ext.list.Column\" class=\"docClass\">Ext.list.Column</a>\nDefaults to true.</p>\n<p>Defaults to: <code>true</code></p></div></div></div><div id='cfg-tpl' class='member inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><a href='#!/api/Ext.list.Column' rel='Ext.list.Column' class='defined-in docClass'>Ext.list.Column</a><br/><a href='source/Column2.html#Ext-list-Column-cfg-tpl' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Ext.list.Column-cfg-tpl' class='name expandable'>tpl</a><span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a></span></div><div class='description'><div class='short'>Optional. ...</div><div class='long'><p>Optional. Specify a string to pass as the\nconfiguration string for <a href=\"#!/api/Ext.XTemplate\" rel=\"Ext.XTemplate\" class=\"docClass\">Ext.XTemplate</a>. By default an <a href=\"#!/api/Ext.XTemplate\" rel=\"Ext.XTemplate\" class=\"docClass\">Ext.XTemplate</a>\nwill be implicitly created using the <tt>dataIndex</tt>.</p>\n</div></div></div><div id='cfg-width' class='member inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><a href='#!/api/Ext.list.Column' rel='Ext.list.Column' class='defined-in docClass'>Ext.list.Column</a><br/><a href='source/Column2.html#Ext-list-Column-cfg-width' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Ext.list.Column-cfg-width' class='name expandable'>width</a><span> : <a href=\"#!/api/Number\" rel=\"Number\" class=\"docClass\">Number</a></span></div><div class='description'><div class='short'>Optional. ...</div><div class='long'><p>Optional. Percentage of the container width\nthis column should be allocated. Columns that have no width specified will be\nallocated with an equal percentage to fill 100% of the container width. To easily take\nadvantage of the full container width, leave the width of at least one column undefined.\nNote that if you do not want to take up the full width of the container, the width of\nevery column needs to be explicitly defined.</p>\n</div></div></div></div></div><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-property'>Properties</h3><div class='subsection'><div id='property-format' class='member first-child not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='Ext.list.DateColumn'>Ext.list.DateColumn</span><br/><a href='source/Column2.html#Ext-list-DateColumn-property-format' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Ext.list.DateColumn-property-format' class='name expandable'>format</a><span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a></span><strong class='private signature' >private</strong></div><div class='description'><div class='short'> ...</div><div class='long'>\n<p>Defaults to: <code>'m/d/Y'</code></p></div></div></div></div></div><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-method'>Methods</h3><div class='subsection'><div id='method-constructor' class='member first-child not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='Ext.list.DateColumn'>Ext.list.DateColumn</span><br/><a href='source/Column2.html#Ext-list-DateColumn-method-constructor' target='_blank' class='view-source'>view source</a></div><strong class='new-keyword'>new</strong><a href='#!/api/Ext.list.DateColumn-method-constructor' class='name expandable'>Ext.list.DateColumn</a>( <span class='pre'>c</span> ) : <a href=\"#!/api/Ext.list.DateColumn\" rel=\"Ext.list.DateColumn\" class=\"docClass\">Ext.list.DateColumn</a></div><div class='description'><div class='short'> ...</div><div class='long'>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>c</span> : Object<div class='sub-desc'>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/Ext.list.DateColumn\" rel=\"Ext.list.DateColumn\" class=\"docClass\">Ext.list.DateColumn</a></span><div class='sub-desc'>\n</div></li></ul></div></div></div></div></div></div></div>","superclasses":["Ext.list.Column"],"meta":{},"requires":[],"html_meta":{},"statics":{"property":[],"cfg":[],"css_var":[],"method":[],"event":[],"css_mixin":[]},"files":[{"href":"Column2.html#Ext-list-DateColumn","filename":"Column.js"}],"linenr":94,"members":{"property":[{"tagname":"property","owner":"Ext.list.DateColumn","meta":{"private":true},"name":"format","id":"property-format"}],"cfg":[{"tagname":"cfg","owner":"Ext.list.Column","meta":{},"name":"align","id":"cfg-align"},{"tagname":"cfg","owner":"Ext.list.Column","meta":{},"name":"cls","id":"cfg-cls"},{"tagname":"cfg","owner":"Ext.list.Column","meta":{},"name":"dataIndex","id":"cfg-dataIndex"},{"tagname":"cfg","owner":"Ext.list.Column","meta":{},"name":"header","id":"cfg-header"},{"tagname":"cfg","owner":"Ext.list.Column","meta":{"private":true},"name":"isColumn","id":"cfg-isColumn"},{"tagname":"cfg","owner":"Ext.list.Column","meta":{},"name":"tpl","id":"cfg-tpl"},{"tagname":"cfg","owner":"Ext.list.Column","meta":{},"name":"width","id":"cfg-width"}],"css_var":[],"method":[{"tagname":"method","owner":"Ext.list.DateColumn","meta":{},"name":"constructor","id":"method-constructor"}],"event":[],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.list.DateColumn","singleton":false,"override":null,"inheritdoc":null,"id":"class-Ext.list.DateColumn","mixins":[],"mixedInto":[]}); | andchir/extjs-grid | lib/ext-3.4.1/docs/output/Ext.list.DateColumn.js | JavaScript | mit | 11,795 |
(function(){
// -----------------------------------------------------------------------
// PubNub Settings
// -----------------------------------------------------------------------
var channel = 'my-channel-name-here'
, pubnub = PUBNUB.init({
publish_key : 'demo',
subscribe_key : 'demo'
});
// -----------------------------------------------------------------------
// My-Example-Event Event
// -----------------------------------------------------------------------
pubnub.events.bind( 'My-Example-Event', function(message) {
message
} )
// -----------------------------------------------------------------------
// Presence Data Event
// -----------------------------------------------------------------------
pubnub.events.bind( 'presence', function(data) {
// Show User Count, etc.
data.occupancy
} );
// -----------------------------------------------------------------------
// Open Receiving Socket Connection
// -----------------------------------------------------------------------
pubnub.subscribe({
channel : channel,
presence : presence,
callback : receive
});
// -----------------------------------------------------------------------
// Presence Event
// -----------------------------------------------------------------------
function presence( data, envelope, source_channel ) {
pubnub.events.fire( 'presence', {
occupancy : data.occupancy,
user_ids : data.uuids,
channel : source_channel
});
}
// -----------------------------------------------------------------------
// Receive Data
// -----------------------------------------------------------------------
function receive( message, envelope, source_channel ) {
pubnub.events.fire( message.type, {
message : message,
channel : source_channel
});
}
// -----------------------------------------------------------------------
// New channels -AUTO MULTIPLEXES FOR YOU. v3.4 only.
// -----------------------------------------------------------------------
pubnub.subscribe({ channel : 'friend_ID1', callback : receive });
pubnub.subscribe({ channel : 'friend_ID2', callback : receive });
// Adding More Channels Using Array
pubnub.subscribe({
channel : ['friend_ID3','friend_ID4','friend_ID5','friend_ID6'],
callback : receive
});
// Adding More Channels Using Comma List
pubnub.subscribe({
channel : 'friend_ID7,friend_ID8,friend_ID9',
callback : receive
});
// -----------------------------------------------------------------------
// Send Data From Browser (only if publish_key key supplied)
// -----------------------------------------------------------------------
function send( type, data ) {
pubnub.publish({
channel : channel,
message : { type : type, data : data }
});
}
})();
| gcnonato/javascript | examples/event-example/event-example.js | JavaScript | mit | 3,096 |
/*************************************************************
*
* MathJax/localization/es/es.js
*
* Copyright (c) 2009-2017 The MathJax Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
MathJax.Localization.addTranslation("es",null,{
menuTitle: "espa\u00F1ol",
version: "2.7.1",
isLoaded: true,
domains: {
"_": {
version: "2.7.1",
isLoaded: true,
strings: {
CookieConfig: "MathJax ha encontrado una cookie de configuraci\u00F3n de usuario que incluye c\u00F3digo para ser ejecutado.\u00BFQuieres ejecutarlo?\n\\n\n(Pulse Cancelar al menos que configure la cookie).",
MathProcessingError: "Error de procesamiento de matem\u00E1ticas",
MathError: "Error de matem\u00E1ticas",
LoadFile: "Cargando %1",
Loading: "Cargando",
LoadFailed: "Fall\u00F3 la carga del archivo: %1",
ProcessMath: "Procesando notaci\u00F3n matem\u00E1tica: %1\u00A0%%",
Processing: "Procesando",
TypesetMath: "Composici\u00F3n tipogr\u00E1fica en curso: %1 %%",
Typesetting: "Composici\u00F3n tipogr\u00E1fica",
MathJaxNotSupported: "El navegador no admite MathJax"
}
},
"FontWarnings": {},
"HTML-CSS": {},
"HelpDialog": {},
"MathML": {},
"MathMenu": {},
"TeX": {}
},
plural: function (n) {
if (n === 1) return 1; // one
return 2; // other
},
number: function (n) {
return n;
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/es/es.js");
| quandqn/quandqn.github.io | mathjax/unpacked/localization/es/es.js | JavaScript | mit | 2,070 |
RocketChat.callbacks.add('afterSaveMessage', function(message, room) {
// skips this callback if the message was edited
if (message.editedAt) {
return message;
}
if (message.ts && Math.abs(moment(message.ts).diff()) > 60000) {
return message;
}
var emailSubject, usersToSendEmail = {};
var directMessage = room.t === 'd';
if (directMessage) {
usersToSendEmail[message.rid.replace(message.u._id, '')] = 1;
emailSubject = TAPi18n.__('Offline_DM_Email', {
user: message.u.username
});
} else {
if (message.mentions) {
message.mentions.forEach(function(mention) {
usersToSendEmail[mention._id] = 1;
});
}
emailSubject = TAPi18n.__('Offline_Mention_Email', {
user: message.u.username,
room: room.name
});
}
var getMessageLink = (room, sub) => {
var roomPath = RocketChat.roomTypes.getRouteLink(room.t, sub);
var path = Meteor.absoluteUrl(roomPath ? roomPath.replace(/^\//, '') : '');
var style = [
'color: #fff;',
'padding: 9px 12px;',
'border-radius: 4px;',
'background-color: #04436a;',
'text-decoration: none;'
].join(' ');
var message = TAPi18n.__('Offline_Link_Message');
return `<p style="text-align:center;margin-bottom:8px;"><a style="${ style }" href="${ path }">${ message }</a>`;
};
var divisorMessage = '<hr style="margin: 20px auto; border: none; border-bottom: 1px solid #dddddd;">';
var messageHTML = s.escapeHTML(message.msg);
message = RocketChat.callbacks.run('renderMessage', message);
if (message.tokens && message.tokens.length > 0) {
message.tokens.forEach((token) => {
token.text = token.text.replace(/([^\$])(\$[^\$])/gm, '$1$$$2');
messageHTML = messageHTML.replace(token.token, token.text);
});
}
var header = RocketChat.placeholders.replace(RocketChat.settings.get('Email_Header') || '');
var footer = RocketChat.placeholders.replace(RocketChat.settings.get('Email_Footer') || '');
messageHTML = messageHTML.replace(/\n/gm, '<br/>');
RocketChat.models.Subscriptions.findWithSendEmailByRoomId(room._id).forEach((sub) => {
switch (sub.emailNotifications) {
case 'all':
usersToSendEmail[sub.u._id] = 'force';
break;
case 'mentions':
if (usersToSendEmail[sub.u._id]) {
usersToSendEmail[sub.u._id] = 'force';
}
break;
case 'nothing':
delete usersToSendEmail[sub.u._id];
break;
case 'default':
break;
}
});
var userIdsToSendEmail = Object.keys(usersToSendEmail);
var defaultLink;
var linkByUser = {};
if (RocketChat.roomTypes.hasCustomLink(room.t)) {
RocketChat.models.Subscriptions.findByRoomIdAndUserIds(room._id, userIdsToSendEmail).forEach((sub) => {
linkByUser[sub.u._id] = getMessageLink(room, sub);
});
} else {
defaultLink = getMessageLink(room, { name: room.name });
}
if (userIdsToSendEmail.length > 0) {
var usersOfMention = RocketChat.models.Users.getUsersToSendOfflineEmail(userIdsToSendEmail).fetch();
if (usersOfMention && usersOfMention.length > 0) {
var siteName = RocketChat.settings.get('Site_Name');
usersOfMention.forEach((user) => {
if (user.settings && user.settings.preferences && user.settings.preferences.emailNotificationMode && user.settings.preferences.emailNotificationMode === 'disabled' && usersToSendEmail[user._id] !== 'force') {
return;
}
// Checks if user is in the room he/she is mentioned (unless it's public channel)
if (room.t !== 'c' && room.usernames.indexOf(user.username) === -1) {
return;
}
user.emails.some((email) => {
if (email.verified) {
email = {
to: email.address,
from: RocketChat.settings.get('From_Email'),
subject: `[${ siteName }] ${ emailSubject }`,
html: header + messageHTML + divisorMessage + (linkByUser[user._id] || defaultLink) + footer
};
Meteor.defer(() => {
Email.send(email);
});
return true;
}
});
});
}
}
return message;
}, RocketChat.callbacks.priority.LOW, 'sendEmailOnMessage');
| JamesHGreen/Rocket_API | packages/rocketchat-lib/server/lib/sendEmailOnMessage.js | JavaScript | mit | 3,986 |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
using System.ComponentModel;
namespace OpenLiveWriter.ApplicationFramework.Commands
{
/// <summary>
/// Summary description for PrintCommand.
/// </summary>
public class CommandPageSetup : Command
{
public CommandPageSetup(IContainer container)
{
///
/// Required for Windows.Forms Class Composition Designer support
///
InitializeComponent();
}
public CommandPageSetup()
{
///
/// Required for Windows.Forms Class Composition Designer support
///
InitializeComponent();
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// CommandPageSetup
//
this.Identifier = "MindShare.ApplicationCore.Commands.PageSetup";
this.MainMenuPath = "&File@0/-Page Set&up...@120";
this.Text = "Page Setup";
}
#endregion
}
}
| lisardggY/OpenLiveWriter | src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPageSetup.cs | C# | mit | 1,338 |
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.nipplejs=t()}}(function(){function t(){}function e(t,i){return this.identifier=i.identifier,this.position=i.position,this.frontPosition=i.frontPosition,this.collection=t,this.defaults={size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,mode:"dynamic",zone:document.body},this.config(i),"dynamic"===this.options.mode&&(this.options.restOpacity=0),this.id=e.id,e.id+=1,this.buildEl().stylize(),this.instance={el:this.ui.el,on:this.on.bind(this),off:this.off.bind(this),show:this.show.bind(this),hide:this.hide.bind(this),add:this.addToDom.bind(this),remove:this.removeFromDom.bind(this),destroy:this.destroy.bind(this),resetDirection:this.resetDirection.bind(this),computeDirection:this.computeDirection.bind(this),trigger:this.trigger.bind(this),position:this.position,frontPosition:this.frontPosition,ui:this.ui,identifier:this.identifier,id:this.id,options:this.options},this.instance}function i(t,e){var n=this;return n.nipples=[],n.idles=[],n.actives=[],n.ids=[],n.pressureIntervals={},n.manager=t,n.id=i.id,i.id+=1,n.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5},n.config(e),"static"!==n.options.mode&&"semi"!==n.options.mode||(n.options.multitouch=!1),n.options.multitouch||(n.options.maxNumberOfNipples=1),n.updateBox(),n.prepareNipples(),n.bindings(),n.begin(),n.nipples}function n(t){var e=this;e.ids={},e.index=0,e.collections=[],e.config(t),e.prepareCollections();var i;return c.bindEvt(window,"resize",function(t){clearTimeout(i),i=setTimeout(function(){var t,i=c.getScroll();e.collections.forEach(function(e){e.forEach(function(e){t=e.el.getBoundingClientRect(),e.position={x:i.x+t.left,y:i.y+t.top}})})},100)}),e.collections}var o,r=!!("ontouchstart"in window),s=!!window.PointerEvent,d=!!window.MSPointerEvent,a={touch:{start:"touchstart",move:"touchmove",end:"touchend, touchcancel"},mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},pointer:{start:"pointerdown",move:"pointermove",end:"pointerup"},MSPointer:{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}},p={};s?o=a.pointer:d?o=a.MSPointer:r?(o=a.touch,p=a.mouse):o=a.mouse;var c={};c.distance=function(t,e){var i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)},c.angle=function(t,e){var i=e.x-t.x,n=e.y-t.y;return c.degrees(Math.atan2(n,i))},c.findCoord=function(t,e,i){var n={x:0,y:0};return i=c.radians(i),n.x=t.x-e*Math.cos(i),n.y=t.y-e*Math.sin(i),n},c.radians=function(t){return t*(Math.PI/180)},c.degrees=function(t){return t*(180/Math.PI)},c.bindEvt=function(t,e,i){for(var n,o=e.split(/[ ,]+/g),r=0;r<o.length;r+=1)n=o[r],t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent&&t.attachEvent(n,i)},c.unbindEvt=function(t,e,i){for(var n,o=e.split(/[ ,]+/g),r=0;r<o.length;r+=1)n=o[r],t.removeEventListener?t.removeEventListener(n,i):t.detachEvent&&t.detachEvent(n,i)},c.trigger=function(t,e,i){var n=new CustomEvent(e,i);t.dispatchEvent(n)},c.prepareEvent=function(t){return t.preventDefault(),t.type.match(/^touch/)?t.changedTouches:t},c.getScroll=function(){return{x:void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop}},c.applyPosition=function(t,e){e.x&&e.y?(t.style.left=e.x+"px",t.style.top=e.y+"px"):(e.top||e.right||e.bottom||e.left)&&(t.style.top=e.top,t.style.right=e.right,t.style.bottom=e.bottom,t.style.left=e.left)},c.getTransitionStyle=function(t,e,i){var n=c.configStylePropertyObject(t);for(var o in n)if(n.hasOwnProperty(o))if("string"==typeof e)n[o]=e+" "+i;else{for(var r="",s=0,d=e.length;s<d;s+=1)r+=e[s]+" "+i+", ";n[o]=r.slice(0,-2)}return n},c.getVendorStyle=function(t,e){var i=c.configStylePropertyObject(t);for(var n in i)i.hasOwnProperty(n)&&(i[n]=e);return i},c.configStylePropertyObject=function(t){var e={};return e[t]="",["webkit","Moz","o"].forEach(function(i){e[i+t.charAt(0).toUpperCase()+t.slice(1)]=""}),e},c.extend=function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},c.safeExtend=function(t,e){var i={};for(var n in t)t.hasOwnProperty(n)&&e.hasOwnProperty(n)?i[n]=e[n]:t.hasOwnProperty(n)&&(i[n]=t[n]);return i},c.map=function(t,e){if(t.length)for(var i=0,n=t.length;i<n;i+=1)e(t[i]);else e(t)},t.prototype.on=function(t,e){var i,n=this,o=t.split(/[ ,]+/g);n._handlers_=n._handlers_||{};for(var r=0;r<o.length;r+=1)i=o[r],n._handlers_[i]=n._handlers_[i]||[],n._handlers_[i].push(e);return n},t.prototype.off=function(t,e){var i=this;return i._handlers_=i._handlers_||{},void 0===t?i._handlers_={}:void 0===e?i._handlers_[t]=null:i._handlers_[t]&&i._handlers_[t].indexOf(e)>=0&&i._handlers_[t].splice(i._handlers_[t].indexOf(e),1),i},t.prototype.trigger=function(t,e){var i,n=this,o=t.split(/[ ,]+/g);n._handlers_=n._handlers_||{};for(var r=0;r<o.length;r+=1)i=o[r],n._handlers_[i]&&n._handlers_[i].length&&n._handlers_[i].forEach(function(t){t.call(n,{type:i,target:n},e)})},t.prototype.config=function(t){var e=this;e.options=e.defaults||{},t&&(e.options=c.safeExtend(e.options,t))},t.prototype.bindEvt=function(t,e){var i=this;return i._domHandlers_=i._domHandlers_||{},i._domHandlers_[e]=function(){"function"==typeof i["on"+e]?i["on"+e].apply(i,arguments):console.warn('[WARNING] : Missing "on'+e+'" handler.')},c.bindEvt(t,o[e],i._domHandlers_[e]),p[e]&&c.bindEvt(t,p[e],i._domHandlers_[e]),i},t.prototype.unbindEvt=function(t,e){var i=this;return i._domHandlers_=i._domHandlers_||{},c.unbindEvt(t,o[e],i._domHandlers_[e]),p[e]&&c.unbindEvt(t,p[e],i._domHandlers_[e]),delete i._domHandlers_[e],this},e.prototype=new t,e.constructor=e,e.id=0,e.prototype.buildEl=function(t){return this.ui={},this.options.dataOnly?this:(this.ui.el=document.createElement("div"),this.ui.back=document.createElement("div"),this.ui.front=document.createElement("div"),this.ui.el.className="nipple collection_"+this.collection.id,this.ui.back.className="back",this.ui.front.className="front",this.ui.el.setAttribute("id","nipple_"+this.collection.id+"_"+this.id),this.ui.el.appendChild(this.ui.back),this.ui.el.appendChild(this.ui.front),this)},e.prototype.stylize=function(){if(this.options.dataOnly)return this;var t=this.options.fadeTime+"ms",e=c.getVendorStyle("borderRadius","50%"),i=c.getTransitionStyle("transition","opacity",t),n={};return n.el={position:"absolute",opacity:this.options.restOpacity,display:"block",zIndex:999},n.back={position:"absolute",display:"block",width:this.options.size+"px",height:this.options.size+"px",marginLeft:-this.options.size/2+"px",marginTop:-this.options.size/2+"px",background:this.options.color,opacity:".5"},n.front={width:this.options.size/2+"px",height:this.options.size/2+"px",position:"absolute",display:"block",marginLeft:-this.options.size/4+"px",marginTop:-this.options.size/4+"px",background:this.options.color,opacity:".5"},c.extend(n.el,i),c.extend(n.back,e),c.extend(n.front,e),this.applyStyles(n),this},e.prototype.applyStyles=function(t){for(var e in this.ui)if(this.ui.hasOwnProperty(e))for(var i in t[e])this.ui[e].style[i]=t[e][i];return this},e.prototype.addToDom=function(){return this.options.dataOnly||document.body.contains(this.ui.el)?this:(this.options.zone.appendChild(this.ui.el),this)},e.prototype.removeFromDom=function(){return this.options.dataOnly||!document.body.contains(this.ui.el)?this:(this.options.zone.removeChild(this.ui.el),this)},e.prototype.destroy=function(){clearTimeout(this.removeTimeout),clearTimeout(this.showTimeout),clearTimeout(this.restTimeout),this.trigger("destroyed",this.instance),this.removeFromDom(),this.off()},e.prototype.show=function(t){var e=this;return e.options.dataOnly?e:(clearTimeout(e.removeTimeout),clearTimeout(e.showTimeout),clearTimeout(e.restTimeout),e.addToDom(),e.restCallback(),setTimeout(function(){e.ui.el.style.opacity=1},0),e.showTimeout=setTimeout(function(){e.trigger("shown",e.instance),"function"==typeof t&&t.call(this)},e.options.fadeTime),e)},e.prototype.hide=function(t){var e=this;return e.options.dataOnly?e:(e.ui.el.style.opacity=e.options.restOpacity,clearTimeout(e.removeTimeout),clearTimeout(e.showTimeout),clearTimeout(e.restTimeout),e.removeTimeout=setTimeout(function(){var i="dynamic"===e.options.mode?"none":"block";e.ui.el.style.display=i,"function"==typeof t&&t.call(e),e.trigger("hidden",e.instance)},e.options.fadeTime),e.options.restJoystick&&e.restPosition(),e)},e.prototype.restPosition=function(t){var e=this;e.frontPosition={x:0,y:0};var i=e.options.fadeTime+"ms",n={};n.front=c.getTransitionStyle("transition",["top","left"],i);var o={front:{}};o.front={left:e.frontPosition.x+"px",top:e.frontPosition.y+"px"},e.applyStyles(n),e.applyStyles(o),e.restTimeout=setTimeout(function(){"function"==typeof t&&t.call(e),e.restCallback()},e.options.fadeTime)},e.prototype.restCallback=function(){var t=this,e={};e.front=c.getTransitionStyle("transition","none",""),t.applyStyles(e),t.trigger("rested",t.instance)},e.prototype.resetDirection=function(){this.direction={x:!1,y:!1,angle:!1}},e.prototype.computeDirection=function(t){var e,i,n,o=t.angle.radian,r=Math.PI/4,s=Math.PI/2;if(e=o>r&&o<3*r?"up":o>-r&&o<=r?"left":o>3*-r&&o<=-r?"down":"right",i=o>-s&&o<s?"left":"right",n=o>0?"up":"down",t.force>this.options.threshold){var d={};for(var a in this.direction)this.direction.hasOwnProperty(a)&&(d[a]=this.direction[a]);var p={};this.direction={x:i,y:n,angle:e},t.direction=this.direction;for(var a in d)d[a]===this.direction[a]&&(p[a]=!0);if(p.x&&p.y&&p.angle)return t;p.x&&p.y||this.trigger("plain",t),p.x||this.trigger("plain:"+i,t),p.y||this.trigger("plain:"+n,t),p.angle||this.trigger("dir dir:"+e,t)}return t},i.prototype=new t,i.constructor=i,i.id=0,i.prototype.prepareNipples=function(){var t=this,e=t.nipples;e.on=t.on.bind(t),e.off=t.off.bind(t),e.options=t.options,e.destroy=t.destroy.bind(t),e.ids=t.ids,e.id=t.id,e.processOnMove=t.processOnMove.bind(t),e.processOnEnd=t.processOnEnd.bind(t),e.get=function(t){if(void 0===t)return e[0];for(var i=0,n=e.length;i<n;i+=1)if(e[i].identifier===t)return e[i];return!1}},i.prototype.bindings=function(){var t=this;t.bindEvt(t.options.zone,"start"),t.options.zone.style.touchAction="none",t.options.zone.style.msTouchAction="none"},i.prototype.begin=function(){var t=this,e=t.options;if("static"===e.mode){var i=t.createNipple(e.position,t.manager.getIdentifier());i.add(),t.idles.push(i)}},i.prototype.createNipple=function(t,i){var n=this,o=c.getScroll(),r={},s=n.options;if(t.x&&t.y)r={x:t.x-(o.x+n.box.left),y:t.y-(o.y+n.box.top)};else if(t.top||t.right||t.bottom||t.left){var d=document.createElement("DIV");d.style.display="hidden",d.style.top=t.top,d.style.right=t.right,d.style.bottom=t.bottom,d.style.left=t.left,d.style.position="absolute",s.zone.appendChild(d);var a=d.getBoundingClientRect();s.zone.removeChild(d),r=t,t={x:a.left+o.x,y:a.top+o.y}}var p=new e(n,{color:s.color,size:s.size,threshold:s.threshold,fadeTime:s.fadeTime,dataOnly:s.dataOnly,restJoystick:s.restJoystick,restOpacity:s.restOpacity,mode:s.mode,identifier:i,position:t,zone:s.zone,frontPosition:{x:0,y:0}});return s.dataOnly||(c.applyPosition(p.ui.el,r),c.applyPosition(p.ui.front,p.frontPosition)),n.nipples.push(p),n.trigger("added "+p.identifier+":added",p),n.manager.trigger("added "+p.identifier+":added",p),n.bindNipple(p),p},i.prototype.updateBox=function(){var t=this;t.box=t.options.zone.getBoundingClientRect()},i.prototype.bindNipple=function(t){var e,i=this,n=function(t,n){e=t.type+" "+n.id+":"+t.type,i.trigger(e,n)};t.on("destroyed",i.onDestroyed.bind(i)),t.on("shown hidden rested dir plain",n),t.on("dir:up dir:right dir:down dir:left",n),t.on("plain:up plain:right plain:down plain:left",n)},i.prototype.pressureFn=function(t,e,i){var n=this,o=0;clearInterval(n.pressureIntervals[i]),n.pressureIntervals[i]=setInterval(function(){var i=t.force||t.pressure||t.webkitForce||0;i!==o&&(e.trigger("pressure",i),n.trigger("pressure "+e.identifier+":pressure",i),o=i)}.bind(n),100)},i.prototype.onstart=function(t){var e=this,i=e.options;t=c.prepareEvent(t),e.updateBox();var n=function(t){e.actives.length<i.maxNumberOfNipples&&e.processOnStart(t)};return c.map(t,n),e.manager.bindDocument(),!1},i.prototype.processOnStart=function(t){var e,i=this,n=i.options,o=i.manager.getIdentifier(t),r=t.force||t.pressure||t.webkitForce||0,s={x:t.pageX,y:t.pageY},d=i.getOrCreate(o,s);d.identifier!==o&&i.manager.removeIdentifier(d.identifier),d.identifier=o;var a=function(e){e.trigger("start",e),i.trigger("start "+e.id+":start",e),e.show(),r>0&&i.pressureFn(t,e,e.identifier),i.processOnMove(t)};if((e=i.idles.indexOf(d))>=0&&i.idles.splice(e,1),i.actives.push(d),i.ids.push(d.identifier),"semi"!==n.mode)a(d);else{if(!(c.distance(s,d.position)<=n.catchDistance))return d.destroy(),void i.processOnStart(t);a(d)}return d},i.prototype.getOrCreate=function(t,e){var i,n=this,o=n.options;return/(semi|static)/.test(o.mode)?(i=n.idles[0])?(n.idles.splice(0,1),i):"semi"===o.mode?n.createNipple(e,t):(console.warn("Coudln't find the needed nipple."),!1):i=n.createNipple(e,t)},i.prototype.processOnMove=function(t){var e=this,i=e.options,n=e.manager.getIdentifier(t),o=e.nipples.get(n);if(!o)return console.error("Found zombie joystick with ID "+n),void e.manager.removeIdentifier(n);o.identifier=n;var r=o.options.size/2,s={x:t.pageX,y:t.pageY},d=c.distance(s,o.position),a=c.angle(s,o.position),p=c.radians(a),l=d/r;d>r&&(d=r,s=c.findCoord(o.position,d,a)),o.frontPosition={x:s.x-o.position.x,y:s.y-o.position.y},i.dataOnly||c.applyPosition(o.ui.front,o.frontPosition);var u={identifier:o.identifier,position:s,force:l,pressure:t.force||t.pressure||t.webkitForce||0,distance:d,angle:{radian:p,degree:a},instance:o};u=o.computeDirection(u),u.angle={radian:c.radians(180-a),degree:180-a},o.trigger("move",u),e.trigger("move "+o.id+":move",u)},i.prototype.processOnEnd=function(t){var e=this,i=e.options,n=e.manager.getIdentifier(t),o=e.nipples.get(n),r=e.manager.removeIdentifier(o.identifier);o&&(i.dataOnly||o.hide(function(){"dynamic"===i.mode&&(o.trigger("removed",o),e.trigger("removed "+o.id+":removed",o),e.manager.trigger("removed "+o.id+":removed",o),o.destroy())}),clearInterval(e.pressureIntervals[o.identifier]),o.resetDirection(),o.trigger("end",o),e.trigger("end "+o.id+":end",o),e.ids.indexOf(o.identifier)>=0&&e.ids.splice(e.ids.indexOf(o.identifier),1),e.actives.indexOf(o)>=0&&e.actives.splice(e.actives.indexOf(o),1),/(semi|static)/.test(i.mode)?e.idles.push(o):e.nipples.indexOf(o)>=0&&e.nipples.splice(e.nipples.indexOf(o),1),e.manager.unbindDocument(),/(semi|static)/.test(i.mode)&&(e.manager.ids[r.id]=r.identifier))},i.prototype.onDestroyed=function(t,e){var i=this;i.nipples.indexOf(e)>=0&&i.nipples.splice(i.nipples.indexOf(e),1),i.actives.indexOf(e)>=0&&i.actives.splice(i.actives.indexOf(e),1),i.idles.indexOf(e)>=0&&i.idles.splice(i.idles.indexOf(e),1),i.ids.indexOf(e.identifier)>=0&&i.ids.splice(i.ids.indexOf(e.identifier),1),i.manager.removeIdentifier(e.identifier),i.manager.unbindDocument()},i.prototype.destroy=function(){var t=this;t.unbindEvt(t.options.zone,"start"),t.nipples.forEach(function(t){t.destroy()});for(var e in t.pressureIntervals)t.pressureIntervals.hasOwnProperty(e)&&clearInterval(t.pressureIntervals[e]);t.trigger("destroyed",t.nipples),t.manager.unbindDocument(),t.off()},n.prototype=new t,n.constructor=n,n.prototype.prepareCollections=function(){var t=this;t.collections.create=t.create.bind(t),t.collections.on=t.on.bind(t),t.collections.off=t.off.bind(t),t.collections.destroy=t.destroy.bind(t),t.collections.get=function(e){var i;return t.collections.every(function(t){return!(i=t.get(e))}),i}},n.prototype.create=function(t){return this.createCollection(t)},n.prototype.createCollection=function(t){var e=this,n=new i(e,t);return e.bindCollection(n),e.collections.push(n),n},n.prototype.bindCollection=function(t){var e,i=this,n=function(t,n){e=t.type+" "+n.id+":"+t.type,i.trigger(e,n)};t.on("destroyed",i.onDestroyed.bind(i)),t.on("shown hidden rested dir plain",n),t.on("dir:up dir:right dir:down dir:left",n),t.on("plain:up plain:right plain:down plain:left",n)},n.prototype.bindDocument=function(){var t=this;t.binded||(t.bindEvt(document,"move").bindEvt(document,"end"),t.binded=!0)},n.prototype.unbindDocument=function(t){var e=this;Object.keys(e.ids).length&&!0!==t||(e.unbindEvt(document,"move").unbindEvt(document,"end"),e.binded=!1)},n.prototype.getIdentifier=function(t){var e;return t?void 0===(e=void 0===t.identifier?t.pointerId:t.identifier)&&(e=this.latest||0):e=this.index,void 0===this.ids[e]&&(this.ids[e]=this.index,this.index+=1),this.latest=e,this.ids[e]},n.prototype.removeIdentifier=function(t){var e={};for(var i in this.ids)if(this.ids[i]===t){e.id=i,e.identifier=this.ids[i],delete this.ids[i];break}return e},n.prototype.onmove=function(t){return this.onAny("move",t),!1},n.prototype.onend=function(t){return this.onAny("end",t),!1},n.prototype.onAny=function(t,e){var i,n=this,o="processOn"+t.charAt(0).toUpperCase()+t.slice(1);e=c.prepareEvent(e);var r=function(t,e,i){i.ids.indexOf(e)>=0&&(i[o](t),t._found_=!0)},s=function(t){i=n.getIdentifier(t),c.map(n.collections,r.bind(null,t,i)),t._found_||n.removeIdentifier(i)};return c.map(e,s),!1},n.prototype.destroy=function(){var t=this;t.unbindDocument(!0),t.ids={},t.index=0,t.collections.forEach(function(t){t.destroy()}),t.off()},n.prototype.onDestroyed=function(t,e){var i=this;if(i.collections.indexOf(e)<0)return!1;i.collections.splice(i.collections.indexOf(e),1)};var l=new n;return{create:function(t){return l.create(t)},factory:l}}); | jonobr1/cdnjs | ajax/libs/nipplejs/0.6.8/nipplejs.min.js | JavaScript | mit | 17,987 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\VarDumper\Tests\Dumper;
use PHPUnit\Framework\TestCase;
use Symfony\Component\VarDumper\Caster\ImgStub;
use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
/**
* @author Nicolas Grekas <p@tchwork.com>
*/
class HtmlDumperTest extends TestCase
{
public function testGet()
{
if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
$this->markTestSkipped('A custom file_link_format is defined.');
}
require __DIR__.'/../Fixtures/dumb-var.php';
$dumper = new HtmlDumper('php://output');
$dumper->setDumpHeader('<foo></foo>');
$dumper->setDumpBoundaries('<bar>', '</bar>');
$cloner = new VarCloner();
$cloner->addCasters([
':stream' => function ($res, $a) {
unset($a['uri'], $a['wrapper_data']);
return $a;
},
]);
$data = $cloner->cloneVar($var);
ob_start();
$dumper->dump($data);
$out = ob_get_clean();
$out = preg_replace('/[ \t]+$/m', '', $out);
$var['file'] = htmlspecialchars($var['file'], \ENT_QUOTES, 'UTF-8');
$intMax = \PHP_INT_MAX;
preg_match('/sf-dump-\d+/', $out, $dumpId);
$dumpId = $dumpId[0];
$res = (int) $var['res'];
$this->assertStringMatchesFormat(
<<<EOTXT
<foo></foo><bar><span class=sf-dump-note>array:24</span> [<samp data-depth=1 class=sf-dump-expanded>
"<span class=sf-dump-key>number</span>" => <span class=sf-dump-num>1</span>
<span class=sf-dump-key>0</span> => <a class=sf-dump-ref href=#{$dumpId}-ref01 title="2 occurrences">&1</a> <span class=sf-dump-const>null</span>
"<span class=sf-dump-key>const</span>" => <span class=sf-dump-num>1.1</span>
<span class=sf-dump-key>1</span> => <span class=sf-dump-const>true</span>
<span class=sf-dump-key>2</span> => <span class=sf-dump-const>false</span>
<span class=sf-dump-key>3</span> => <span class=sf-dump-num>NAN</span>
<span class=sf-dump-key>4</span> => <span class=sf-dump-num>INF</span>
<span class=sf-dump-key>5</span> => <span class=sf-dump-num>-INF</span>
<span class=sf-dump-key>6</span> => <span class=sf-dump-num>{$intMax}</span>
"<span class=sf-dump-key>str</span>" => "<span class=sf-dump-str title="5 characters">d&%s;j&%s;<span class="sf-dump-default sf-dump-ns">\\n</span></span>"
<span class=sf-dump-key>7</span> => b"""
<span class=sf-dump-str title="11 binary or non-UTF-8 characters">é<span class="sf-dump-default">\\x01</span>test<span class="sf-dump-default">\\t</span><span class="sf-dump-default sf-dump-ns">\\n</span></span>
<span class=sf-dump-str title="11 binary or non-UTF-8 characters">ing</span>
"""
"<span class=sf-dump-key>[]</span>" => []
"<span class=sf-dump-key>res</span>" => <span class=sf-dump-note>stream resource</span> <a class=sf-dump-ref>@{$res}</a><samp data-depth=2 class=sf-dump-compact>
%A <span class=sf-dump-meta>wrapper_type</span>: "<span class=sf-dump-str title="9 characters">plainfile</span>"
<span class=sf-dump-meta>stream_type</span>: "<span class=sf-dump-str title="5 characters">STDIO</span>"
<span class=sf-dump-meta>mode</span>: "<span class=sf-dump-str>r</span>"
<span class=sf-dump-meta>unread_bytes</span>: <span class=sf-dump-num>0</span>
<span class=sf-dump-meta>seekable</span>: <span class=sf-dump-const>true</span>
%A <span class=sf-dump-meta>options</span>: []
</samp>}
"<span class=sf-dump-key>obj</span>" => <span class=sf-dump-note title="Symfony\Component\VarDumper\Tests\Fixture\DumbFoo
"><span class="sf-dump-ellipsis sf-dump-ellipsis-note">Symfony\Component\VarDumper\Tests\Fixture</span><span class="sf-dump-ellipsis sf-dump-ellipsis-note">\</span>DumbFoo</span> {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="2 occurrences">#%d</a><samp data-depth=2 id={$dumpId}-ref2%d class=sf-dump-compact>
+<span class=sf-dump-public title="Public property">foo</span>: "<span class=sf-dump-str title="3 characters">foo</span>"
+"<span class=sf-dump-public title="Runtime added dynamic property">bar</span>": "<span class=sf-dump-str title="3 characters">bar</span>"
</samp>}
"<span class=sf-dump-key>closure</span>" => <span class=sf-dump-note>Closure(\$a, PDO &\$b = null)</span> {<a class=sf-dump-ref>#%d</a><samp data-depth=2 class=sf-dump-compact>
<span class=sf-dump-meta>class</span>: "<span class=sf-dump-str title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest
55 characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-class">Symfony\Component\VarDumper\Tests\Dumper</span><span class="sf-dump-ellipsis sf-dump-ellipsis-class">\</span>HtmlDumperTest</span>"
<span class=sf-dump-meta>this</span>: <span class=sf-dump-note title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest
"><span class="sf-dump-ellipsis sf-dump-ellipsis-note">Symfony\Component\VarDumper\Tests\Dumper</span><span class="sf-dump-ellipsis sf-dump-ellipsis-note">\</span>HtmlDumperTest</span> {<a class=sf-dump-ref>#%d</a> &%s;}
<span class=sf-dump-meta>file</span>: "<span class=sf-dump-str title="{$var['file']}
%d characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%e</span>Tests%eFixtures%edumb-var.php</span>"
<span class=sf-dump-meta>line</span>: "<span class=sf-dump-str title="%d characters">{$var['line']} to {$var['line']}</span>"
</samp>}
"<span class=sf-dump-key>line</span>" => <span class=sf-dump-num>{$var['line']}</span>
"<span class=sf-dump-key>nobj</span>" => <span class=sf-dump-note>array:1</span> [<samp data-depth=2 class=sf-dump-compact>
<span class=sf-dump-index>0</span> => <a class=sf-dump-ref href=#{$dumpId}-ref03 title="2 occurrences">&3</a> {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="3 occurrences">#%d</a>}
</samp>]
"<span class=sf-dump-key>recurs</span>" => <a class=sf-dump-ref href=#{$dumpId}-ref04 title="2 occurrences">&4</a> <span class=sf-dump-note>array:1</span> [<samp data-depth=2 id={$dumpId}-ref04 class=sf-dump-compact>
<span class=sf-dump-index>0</span> => <a class=sf-dump-ref href=#{$dumpId}-ref04 title="2 occurrences">&4</a> <span class=sf-dump-note>array:1</span> [<a class=sf-dump-ref href=#{$dumpId}-ref04 title="2 occurrences">&4</a>]
</samp>]
<span class=sf-dump-key>8</span> => <a class=sf-dump-ref href=#{$dumpId}-ref01 title="2 occurrences">&1</a> <span class=sf-dump-const>null</span>
"<span class=sf-dump-key>sobj</span>" => <span class=sf-dump-note title="Symfony\Component\VarDumper\Tests\Fixture\DumbFoo
"><span class="sf-dump-ellipsis sf-dump-ellipsis-note">Symfony\Component\VarDumper\Tests\Fixture</span><span class="sf-dump-ellipsis sf-dump-ellipsis-note">\</span>DumbFoo</span> {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="2 occurrences">#%d</a>}
"<span class=sf-dump-key>snobj</span>" => <a class=sf-dump-ref href=#{$dumpId}-ref03 title="2 occurrences">&3</a> {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="3 occurrences">#%d</a>}
"<span class=sf-dump-key>snobj2</span>" => {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="3 occurrences">#%d</a>}
"<span class=sf-dump-key>file</span>" => "<span class=sf-dump-str title="%d characters">{$var['file']}</span>"
b"<span class=sf-dump-key>bin-key-&%s;</span>" => ""
</samp>]
</bar>
EOTXT
,
$out
);
}
public function testCharset()
{
$var = mb_convert_encoding('Словарь', 'CP1251', 'UTF-8');
$dumper = new HtmlDumper('php://output', 'CP1251');
$dumper->setDumpHeader('<foo></foo>');
$dumper->setDumpBoundaries('<bar>', '</bar>');
$cloner = new VarCloner();
$data = $cloner->cloneVar($var);
$out = $dumper->dump($data, true);
$this->assertStringMatchesFormat(
<<<'EOTXT'
<foo></foo><bar>b"<span class=sf-dump-str title="7 binary or non-UTF-8 characters">Словарь</span>"
</bar>
EOTXT
,
$out
);
}
public function testAppend()
{
$out = fopen('php://memory', 'r+');
$dumper = new HtmlDumper();
$dumper->setDumpHeader('<foo></foo>');
$dumper->setDumpBoundaries('<bar>', '</bar>');
$cloner = new VarCloner();
$dumper->dump($cloner->cloneVar(123), $out);
$dumper->dump($cloner->cloneVar(456), $out);
$out = stream_get_contents($out, -1, 0);
$this->assertSame(<<<'EOTXT'
<foo></foo><bar><span class=sf-dump-num>123</span>
</bar>
<bar><span class=sf-dump-num>456</span>
</bar>
EOTXT
,
$out
);
}
/**
* @dataProvider varToDumpProvider
*/
public function testDumpString($var, $needle)
{
$dumper = new HtmlDumper();
$cloner = new VarCloner();
ob_start();
$dumper->dump($cloner->cloneVar($var));
$out = ob_get_clean();
$this->assertStringContainsString($needle, $out);
}
public function varToDumpProvider()
{
return [
[['dummy' => new ImgStub('dummy', 'img/png', '100em')], '<img src="data:img/png;base64,ZHVtbXk=" />'],
['foo', '<span class=sf-dump-str title="3 characters">foo</span>'],
];
}
}
| derrabus/symfony | src/Symfony/Component/VarDumper/Tests/Dumper/HtmlDumperTest.php | PHP | mit | 9,667 |
/*!
* # Semantic UI - API
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
"use strict";
var
window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;
$.api = $.fn.api = function(parameters) {
var
// use window context if none specified
$allModules = $.isFunction(this)
? $(window)
: $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
returnedValue
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.api.settings, parameters)
: $.extend({}, $.fn.api.settings),
// internal aliases
namespace = settings.namespace,
metadata = settings.metadata,
selector = settings.selector,
error = settings.error,
className = settings.className,
// define namespaces for modules
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
// element that creates request
$module = $(this),
$form = $module.closest(selector.form),
// context used for state
$context = (settings.stateContext)
? $(settings.stateContext)
: $module,
// request details
ajaxSettings,
requestSettings,
url,
data,
requestStartTime,
// standard module
element = this,
context = $context[0],
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
if(!methodInvoked) {
module.bind.events();
}
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, instance)
;
},
destroy: function() {
module.verbose('Destroying previous module for', element);
$module
.removeData(moduleNamespace)
.off(eventNamespace)
;
},
bind: {
events: function() {
var
triggerEvent = module.get.event()
;
if( triggerEvent ) {
module.verbose('Attaching API events to element', triggerEvent);
$module
.on(triggerEvent + eventNamespace, module.event.trigger)
;
}
else if(settings.on == 'now') {
module.debug('Querying API endpoint immediately');
module.query();
}
}
},
decode: {
json: function(response) {
if(response !== undefined && typeof response == 'string') {
try {
response = JSON.parse(response);
}
catch(e) {
// isnt json string
}
}
return response;
}
},
read: {
cachedResponse: function(url) {
var
response
;
if(window.Storage === undefined) {
module.error(error.noStorage);
return;
}
response = sessionStorage.getItem(url);
module.debug('Using cached response', url, response);
response = module.decode.json(response);
return response;
}
},
write: {
cachedResponse: function(url, response) {
if(response && response === '') {
module.debug('Response empty, not caching', response);
return;
}
if(window.Storage === undefined) {
module.error(error.noStorage);
return;
}
if( $.isPlainObject(response) ) {
response = JSON.stringify(response);
}
sessionStorage.setItem(url, response);
module.verbose('Storing cached response for url', url, response);
}
},
query: function() {
if(module.is.disabled()) {
module.debug('Element is disabled API request aborted');
return;
}
if(module.is.loading()) {
if(settings.interruptRequests) {
module.debug('Interrupting previous request');
module.abort();
}
else {
module.debug('Cancelling request, previous request is still pending');
return;
}
}
// pass element metadata to url (value, text)
if(settings.defaultData) {
$.extend(true, settings.urlData, module.get.defaultData());
}
// Add form content
if(settings.serializeForm) {
settings.data = module.add.formData(settings.data);
}
// call beforesend and get any settings changes
requestSettings = module.get.settings();
// check if before send cancelled request
if(requestSettings === false) {
module.cancelled = true;
module.error(error.beforeSend);
return;
}
else {
module.cancelled = false;
}
// get url
url = module.get.templatedURL();
if(!url && !module.is.mocked()) {
module.error(error.missingURL);
return;
}
// replace variables
url = module.add.urlData( url );
// missing url parameters
if( !url && !module.is.mocked()) {
return;
}
requestSettings.url = settings.base + url;
// look for jQuery ajax parameters in settings
ajaxSettings = $.extend(true, {}, settings, {
type : settings.method || settings.type,
data : data,
url : settings.base + url,
beforeSend : settings.beforeXHR,
success : function() {},
failure : function() {},
complete : function() {}
});
module.debug('Querying URL', ajaxSettings.url);
module.verbose('Using AJAX settings', ajaxSettings);
if(settings.cache === 'local' && module.read.cachedResponse(url)) {
module.debug('Response returned from local cache');
module.request = module.create.request();
module.request.resolveWith(context, [ module.read.cachedResponse(url) ]);
return;
}
if( !settings.throttle ) {
module.debug('Sending request', data, ajaxSettings.method);
module.send.request();
}
else {
if(!settings.throttleFirstRequest && !module.timer) {
module.debug('Sending request', data, ajaxSettings.method);
module.send.request();
module.timer = setTimeout(function(){}, settings.throttle);
}
else {
module.debug('Throttling request', settings.throttle);
clearTimeout(module.timer);
module.timer = setTimeout(function() {
if(module.timer) {
delete module.timer;
}
module.debug('Sending throttled request', data, ajaxSettings.method);
module.send.request();
}, settings.throttle);
}
}
},
should: {
removeError: function() {
return ( settings.hideError === true || (settings.hideError === 'auto' && !module.is.form()) );
}
},
is: {
disabled: function() {
return ($module.filter(selector.disabled).length > 0);
},
expectingJSON: function() {
return settings.dataType === 'json' || settings.dataType === 'jsonp';
},
form: function() {
return $module.is('form') || $context.is('form');
},
mocked: function() {
return (settings.mockResponse || settings.mockResponseAsync || settings.response || settings.responseAsync);
},
input: function() {
return $module.is('input');
},
loading: function() {
return (module.request)
? (module.request.state() == 'pending')
: false
;
},
abortedRequest: function(xhr) {
if(xhr && xhr.readyState !== undefined && xhr.readyState === 0) {
module.verbose('XHR request determined to be aborted');
return true;
}
else {
module.verbose('XHR request was not aborted');
return false;
}
},
validResponse: function(response) {
if( (!module.is.expectingJSON()) || !$.isFunction(settings.successTest) ) {
module.verbose('Response is not JSON, skipping validation', settings.successTest, response);
return true;
}
module.debug('Checking JSON returned success', settings.successTest, response);
if( settings.successTest(response) ) {
module.debug('Response passed success test', response);
return true;
}
else {
module.debug('Response failed success test', response);
return false;
}
}
},
was: {
cancelled: function() {
return (module.cancelled || false);
},
succesful: function() {
return (module.request && module.request.state() == 'resolved');
},
failure: function() {
return (module.request && module.request.state() == 'rejected');
},
complete: function() {
return (module.request && (module.request.state() == 'resolved' || module.request.state() == 'rejected') );
}
},
add: {
urlData: function(url, urlData) {
var
requiredVariables,
optionalVariables
;
if(url) {
requiredVariables = url.match(settings.regExp.required);
optionalVariables = url.match(settings.regExp.optional);
urlData = urlData || settings.urlData;
if(requiredVariables) {
module.debug('Looking for required URL variables', requiredVariables);
$.each(requiredVariables, function(index, templatedString) {
var
// allow legacy {$var} style
variable = (templatedString.indexOf('$') !== -1)
? templatedString.substr(2, templatedString.length - 3)
: templatedString.substr(1, templatedString.length - 2),
value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
? urlData[variable]
: ($module.data(variable) !== undefined)
? $module.data(variable)
: ($context.data(variable) !== undefined)
? $context.data(variable)
: urlData[variable]
;
// remove value
if(value === undefined) {
module.error(error.requiredParameter, variable, url);
url = false;
return false;
}
else {
module.verbose('Found required variable', variable, value);
value = (settings.encodeParameters)
? module.get.urlEncodedValue(value)
: value
;
url = url.replace(templatedString, value);
}
});
}
if(optionalVariables) {
module.debug('Looking for optional URL variables', requiredVariables);
$.each(optionalVariables, function(index, templatedString) {
var
// allow legacy {/$var} style
variable = (templatedString.indexOf('$') !== -1)
? templatedString.substr(3, templatedString.length - 4)
: templatedString.substr(2, templatedString.length - 3),
value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
? urlData[variable]
: ($module.data(variable) !== undefined)
? $module.data(variable)
: ($context.data(variable) !== undefined)
? $context.data(variable)
: urlData[variable]
;
// optional replacement
if(value !== undefined) {
module.verbose('Optional variable Found', variable, value);
url = url.replace(templatedString, value);
}
else {
module.verbose('Optional variable not found', variable);
// remove preceding slash if set
if(url.indexOf('/' + templatedString) !== -1) {
url = url.replace('/' + templatedString, '');
}
else {
url = url.replace(templatedString, '');
}
}
});
}
}
return url;
},
formData: function(data) {
var
canSerialize = ($.fn.serializeObject !== undefined),
formData = (canSerialize)
? $form.serializeObject()
: $form.serialize(),
hasOtherData
;
data = data || settings.data;
hasOtherData = $.isPlainObject(data);
if(hasOtherData) {
if(canSerialize) {
module.debug('Extending existing data with form data', data, formData);
data = $.extend(true, {}, data, formData);
}
else {
module.error(error.missingSerialize);
module.debug('Cant extend data. Replacing data with form data', data, formData);
data = formData;
}
}
else {
module.debug('Adding form data', formData);
data = formData;
}
return data;
}
},
send: {
request: function() {
module.set.loading();
module.request = module.create.request();
if( module.is.mocked() ) {
module.mockedXHR = module.create.mockedXHR();
}
else {
module.xhr = module.create.xhr();
}
settings.onRequest.call(context, module.request, module.xhr);
}
},
event: {
trigger: function(event) {
module.query();
if(event.type == 'submit' || event.type == 'click') {
event.preventDefault();
}
},
xhr: {
always: function() {
// nothing special
},
done: function(response, textStatus, xhr) {
var
context = this,
elapsedTime = (new Date().getTime() - requestStartTime),
timeLeft = (settings.loadingDuration - elapsedTime),
translatedResponse = ( $.isFunction(settings.onResponse) )
? module.is.expectingJSON()
? settings.onResponse.call(context, $.extend(true, {}, response))
: settings.onResponse.call(context, response)
: false
;
timeLeft = (timeLeft > 0)
? timeLeft
: 0
;
if(translatedResponse) {
module.debug('Modified API response in onResponse callback', settings.onResponse, translatedResponse, response);
response = translatedResponse;
}
if(timeLeft > 0) {
module.debug('Response completed early delaying state change by', timeLeft);
}
setTimeout(function() {
if( module.is.validResponse(response) ) {
module.request.resolveWith(context, [response, xhr]);
}
else {
module.request.rejectWith(context, [xhr, 'invalid']);
}
}, timeLeft);
},
fail: function(xhr, status, httpMessage) {
var
context = this,
elapsedTime = (new Date().getTime() - requestStartTime),
timeLeft = (settings.loadingDuration - elapsedTime)
;
timeLeft = (timeLeft > 0)
? timeLeft
: 0
;
if(timeLeft > 0) {
module.debug('Response completed early delaying state change by', timeLeft);
}
setTimeout(function() {
if( module.is.abortedRequest(xhr) ) {
module.request.rejectWith(context, [xhr, 'aborted', httpMessage]);
}
else {
module.request.rejectWith(context, [xhr, 'error', status, httpMessage]);
}
}, timeLeft);
}
},
request: {
done: function(response, xhr) {
module.debug('Successful API Response', response);
if(settings.cache === 'local' && url) {
module.write.cachedResponse(url, response);
module.debug('Saving server response locally', module.cache);
}
settings.onSuccess.call(context, response, $module, xhr);
},
complete: function(firstParameter, secondParameter) {
var
xhr,
response
;
// have to guess callback parameters based on request success
if( module.was.succesful() ) {
response = firstParameter;
xhr = secondParameter;
}
else {
xhr = firstParameter;
response = module.get.responseFromXHR(xhr);
}
module.remove.loading();
settings.onComplete.call(context, response, $module, xhr);
},
fail: function(xhr, status, httpMessage) {
var
// pull response from xhr if available
response = module.get.responseFromXHR(xhr),
errorMessage = module.get.errorFromRequest(response, status, httpMessage)
;
if(status == 'aborted') {
module.debug('XHR Aborted (Most likely caused by page navigation or CORS Policy)', status, httpMessage);
settings.onAbort.call(context, status, $module, xhr);
return true;
}
else if(status == 'invalid') {
module.debug('JSON did not pass success test. A server-side error has most likely occurred', response);
}
else if(status == 'error') {
if(xhr !== undefined) {
module.debug('XHR produced a server error', status, httpMessage);
// make sure we have an error to display to console
if( xhr.status != 200 && httpMessage !== undefined && httpMessage !== '') {
module.error(error.statusMessage + httpMessage, ajaxSettings.url);
}
settings.onError.call(context, errorMessage, $module, xhr);
}
}
if(settings.errorDuration && status !== 'aborted') {
module.debug('Adding error state');
module.set.error();
if( module.should.removeError() ) {
setTimeout(module.remove.error, settings.errorDuration);
}
}
module.debug('API Request failed', errorMessage, xhr);
settings.onFailure.call(context, response, $module, xhr);
}
}
},
create: {
request: function() {
// api request promise
return $.Deferred()
.always(module.event.request.complete)
.done(module.event.request.done)
.fail(module.event.request.fail)
;
},
mockedXHR: function () {
var
// xhr does not simulate these properties of xhr but must return them
textStatus = false,
status = false,
httpMessage = false,
responder = settings.mockResponse || settings.response,
asyncResponder = settings.mockResponseAsync || settings.responseAsync,
asyncCallback,
response,
mockedXHR
;
mockedXHR = $.Deferred()
.always(module.event.xhr.complete)
.done(module.event.xhr.done)
.fail(module.event.xhr.fail)
;
if(responder) {
if( $.isFunction(responder) ) {
module.debug('Using specified synchronous callback', responder);
response = responder.call(context, requestSettings);
}
else {
module.debug('Using settings specified response', responder);
response = responder;
}
// simulating response
mockedXHR.resolveWith(context, [ response, textStatus, { responseText: response }]);
}
else if( $.isFunction(asyncResponder) ) {
asyncCallback = function(response) {
module.debug('Async callback returned response', response);
if(response) {
mockedXHR.resolveWith(context, [ response, textStatus, { responseText: response }]);
}
else {
mockedXHR.rejectWith(context, [{ responseText: response }, status, httpMessage]);
}
};
module.debug('Using specified async response callback', asyncResponder);
asyncResponder.call(context, requestSettings, asyncCallback);
}
return mockedXHR;
},
xhr: function() {
var
xhr
;
// ajax request promise
xhr = $.ajax(ajaxSettings)
.always(module.event.xhr.always)
.done(module.event.xhr.done)
.fail(module.event.xhr.fail)
;
module.verbose('Created server request', xhr, ajaxSettings);
return xhr;
}
},
set: {
error: function() {
module.verbose('Adding error state to element', $context);
$context.addClass(className.error);
},
loading: function() {
module.verbose('Adding loading state to element', $context);
$context.addClass(className.loading);
requestStartTime = new Date().getTime();
}
},
remove: {
error: function() {
module.verbose('Removing error state from element', $context);
$context.removeClass(className.error);
},
loading: function() {
module.verbose('Removing loading state from element', $context);
$context.removeClass(className.loading);
}
},
get: {
responseFromXHR: function(xhr) {
return $.isPlainObject(xhr)
? (module.is.expectingJSON())
? module.decode.json(xhr.responseText)
: xhr.responseText
: false
;
},
errorFromRequest: function(response, status, httpMessage) {
return ($.isPlainObject(response) && response.error !== undefined)
? response.error // use json error message
: (settings.error[status] !== undefined) // use server error message
? settings.error[status]
: httpMessage
;
},
request: function() {
return module.request || false;
},
xhr: function() {
return module.xhr || false;
},
settings: function() {
var
runSettings
;
runSettings = settings.beforeSend.call(context, settings);
if(runSettings) {
if(runSettings.success !== undefined) {
module.debug('Legacy success callback detected', runSettings);
module.error(error.legacyParameters, runSettings.success);
runSettings.onSuccess = runSettings.success;
}
if(runSettings.failure !== undefined) {
module.debug('Legacy failure callback detected', runSettings);
module.error(error.legacyParameters, runSettings.failure);
runSettings.onFailure = runSettings.failure;
}
if(runSettings.complete !== undefined) {
module.debug('Legacy complete callback detected', runSettings);
module.error(error.legacyParameters, runSettings.complete);
runSettings.onComplete = runSettings.complete;
}
}
if(runSettings === undefined) {
module.error(error.noReturnedValue);
}
if(runSettings === false) {
return runSettings;
}
return (runSettings !== undefined)
? $.extend(true, {}, runSettings)
: $.extend(true, {}, settings)
;
},
urlEncodedValue: function(value) {
var
decodedValue = window.decodeURIComponent(value),
encodedValue = window.encodeURIComponent(value),
alreadyEncoded = (decodedValue !== value)
;
if(alreadyEncoded) {
module.debug('URL value is already encoded, avoiding double encoding', value);
return value;
}
module.verbose('Encoding value using encodeURIComponent', value, encodedValue);
return encodedValue;
},
defaultData: function() {
var
data = {}
;
if( !$.isWindow(element) ) {
if( module.is.input() ) {
data.value = $module.val();
}
else if( module.is.form() ) {
}
else {
data.text = $module.text();
}
}
return data;
},
event: function() {
if( $.isWindow(element) || settings.on == 'now' ) {
module.debug('API called without element, no events attached');
return false;
}
else if(settings.on == 'auto') {
if( $module.is('input') ) {
return (element.oninput !== undefined)
? 'input'
: (element.onpropertychange !== undefined)
? 'propertychange'
: 'keyup'
;
}
else if( $module.is('form') ) {
return 'submit';
}
else {
return 'click';
}
}
else {
return settings.on;
}
},
templatedURL: function(action) {
action = action || $module.data(metadata.action) || settings.action || false;
url = $module.data(metadata.url) || settings.url || false;
if(url) {
module.debug('Using specified url', url);
return url;
}
if(action) {
module.debug('Looking up url for action', action, settings.api);
if(settings.api[action] === undefined && !module.is.mocked()) {
module.error(error.missingAction, settings.action, settings.api);
return;
}
url = settings.api[action];
}
else if( module.is.form() ) {
url = $module.attr('action') || $context.attr('action') || false;
module.debug('No url or action specified, defaulting to form action', url);
}
return url;
}
},
abort: function() {
var
xhr = module.get.xhr()
;
if( xhr && xhr.state() !== 'resolved') {
module.debug('Cancelling API request');
xhr.abort();
}
},
// reset state
reset: function() {
module.remove.error();
module.remove.loading();
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
if($.isPlainObject(settings[name])) {
$.extend(true, settings[name], value);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else if(value !== undefined) {
module[name] = value;
}
else {
return module[name];
}
},
debug: function() {
if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
if(!settings.silent) {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
}
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
//'Element' : element,
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 500);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
object = instance,
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
}
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false;
}
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false;
}
else {
module.error(error.method, query);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
returnedValue = [returnedValue, response];
}
else if(response !== undefined) {
returnedValue = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
instance.invoke('destroy');
}
module.initialize();
}
})
;
return (returnedValue !== undefined)
? returnedValue
: this
;
};
$.api.settings = {
name : 'API',
namespace : 'api',
debug : false,
verbose : false,
performance : true,
// object containing all templates endpoints
api : {},
// whether to cache responses
cache : true,
// whether new requests should abort previous requests
interruptRequests : true,
// event binding
on : 'auto',
// context for applying state classes
stateContext : false,
// duration for loading state
loadingDuration : 0,
// whether to hide errors after a period of time
hideError : 'auto',
// duration for error state
errorDuration : 2000,
// whether parameters should be encoded with encodeURIComponent
encodeParameters : true,
// API action to use
action : false,
// templated URL to use
url : false,
// base URL to apply to all endpoints
base : '',
// data that will
urlData : {},
// whether to add default data to url data
defaultData : true,
// whether to serialize closest form
serializeForm : false,
// how long to wait before request should occur
throttle : 0,
// whether to throttle first request or only repeated
throttleFirstRequest : true,
// standard ajax settings
method : 'get',
data : {},
dataType : 'json',
// mock response
mockResponse : false,
mockResponseAsync : false,
// aliases for mock
response : false,
responseAsync : false,
// callbacks before request
beforeSend : function(settings) { return settings; },
beforeXHR : function(xhr) {},
onRequest : function(promise, xhr) {},
// after request
onResponse : false, // function(response) { },
// response was successful, if JSON passed validation
onSuccess : function(response, $module) {},
// request finished without aborting
onComplete : function(response, $module) {},
// failed JSON success test
onFailure : function(response, $module) {},
// server error
onError : function(errorMessage, $module) {},
// request aborted
onAbort : function(errorMessage, $module) {},
successTest : false,
// errors
error : {
beforeSend : 'The before send function has aborted the request',
error : 'There was an error with your request',
exitConditions : 'API Request Aborted. Exit conditions met',
JSONParse : 'JSON could not be parsed during error handling',
legacyParameters : 'You are using legacy API success callback names',
method : 'The method you called is not defined',
missingAction : 'API action used but no url was defined',
missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
missingURL : 'No URL specified for api event',
noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
noStorage : 'Caching responses locally requires session storage',
parseError : 'There was an error parsing your request',
requiredParameter : 'Missing a required URL parameter: ',
statusMessage : 'Server gave an error: ',
timeout : 'Your request timed out'
},
regExp : {
required : /\{\$*[A-z0-9]+\}/g,
optional : /\{\/\$*[A-z0-9]+\}/g,
},
className: {
loading : 'loading',
error : 'error'
},
selector: {
disabled : '.disabled',
form : 'form'
},
metadata: {
action : 'action',
url : 'url'
}
};
})( jQuery, window, document );
| nestor-qa/nestor | docs/public/js/libs/semantic/src/definitions/behaviors/api.js | JavaScript | mit | 39,779 |
!function(t){Galleria.requires(1.25,"The Flickr Plugin requires Galleria version 1.2.5 or later.");var i=Galleria.utils.getScriptPath();Galleria.Flickr=function(t){this.api_key=t||"2a2ce06c15780ebeb0b706650fc890b2";this.options={max:30,imageSize:"medium",thumbSize:"thumb",sort:"interestingness-desc",description:false,complete:function(){},backlink:false}};Galleria.Flickr.prototype={constructor:Galleria.Flickr,search:function(t,i){return this._find({text:t},i)},tags:function(t,i){return this._find({tags:t},i)},user:function(t,i){return this._call({method:"flickr.urls.lookupUser",url:"flickr.com/photos/"+t},function(t){this._find({user_id:t.user.id,method:"flickr.people.getPublicPhotos"},i)})},set:function(t,i){return this._find({photoset_id:t,method:"flickr.photosets.getPhotos"},i)},gallery:function(t,i){return this._find({gallery_id:t,method:"flickr.galleries.getPhotos"},i)},groupsearch:function(t,i){return this._call({text:t,method:"flickr.groups.search"},function(t){this.group(t.groups.group[0].nsid,i)})},group:function(t,i){return this._find({group_id:t,method:"flickr.groups.pools.getPhotos"},i)},setOptions:function(i){t.extend(this.options,i);return this},_call:function(i,e){var r="https://api.flickr.com/services/rest/?";var o=this;i=t.extend({format:"json",jsoncallback:"?",api_key:this.api_key},i);t.each(i,function(t,i){r+="&"+t+"="+i});t.getJSON(r,function(t){if(t.stat==="ok"){e.call(o,t)}else{Galleria.raise(t.code.toString()+" "+t.stat+": "+t.message,true)}});return o},_getBig:function(t){if(t.url_l){return t.url_l}else if(parseInt(t.width_o,10)>1280){return"https://farm"+t.farm+".static.flickr.com/"+t.server+"/"+t.id+"_"+t.secret+"_b.jpg"}return t.url_o||t.url_z||t.url_m},_getSize:function(t,i){var e;switch(i){case"thumb":e=t.url_t;break;case"small":e=t.url_s;break;case"big":e=this._getBig(t);break;case"original":e=t.url_o?t.url_o:this._getBig(t);break;default:e=t.url_z||t.url_m;break}return e},_find:function(i,e){i=t.extend({method:"flickr.photos.search",extras:"url_t,url_m,url_o,url_s,url_l,url_z,description",sort:this.options.sort,per_page:Math.min(this.options.max,500)},i);return this._call(i,function(t){var i=[],r=t.photos?t.photos.photo:t.photoset.photo,o=r.length,s,l;for(l=0;l<o;l++){s=r[l];i.push({thumb:this._getSize(s,this.options.thumbSize),image:this._getSize(s,this.options.imageSize),big:this._getBig(s),title:r[l].title,description:this.options.description&&r[l].description?r[l].description._content:"",link:this.options.backlink?"https://flickr.com/photos/"+s.owner+"/"+s.id:""})}e.call(this,i)})}};var e=Galleria.prototype.load;Galleria.prototype.load=function(){if(arguments.length||typeof this._options.flickr!=="string"){e.apply(this,Galleria.utils.array(arguments));return}var r=this,o=Galleria.utils.array(arguments),s=this._options.flickr.split(":"),l,n=t.extend({},r._options.flickrOptions),a=typeof n.loader!=="undefined"?n.loader:t("<div>").css({width:48,height:48,opacity:.7,background:"#000 url("+i+"loader.gif) no-repeat 50% 50%"});if(s.length){if(typeof Galleria.Flickr.prototype[s[0]]!=="function"){Galleria.raise(s[0]+" method not found in Flickr plugin");return e.apply(this,o)}if(!s[1]){Galleria.raise("No flickr argument found");return e.apply(this,o)}window.setTimeout(function(){r.$("target").append(a)},100);l=new Galleria.Flickr;if(typeof r._options.flickrOptions==="object"){l.setOptions(r._options.flickrOptions)}l[s[0]](s[1],function(t){r._data=t;a.remove();r.trigger(Galleria.DATA);l.options.complete.call(l,t)})}else{e.apply(this,o)}}}(jQuery); | brix/cdnjs | ajax/libs/galleria/1.3.6/plugins/flickr/galleria.flickr.min.js | JavaScript | mit | 3,536 |
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\Common;
/**
* The EventManager is the central point of Doctrine's event listener system.
* Listeners are registered on the manager and events are dispatched through the
* manager.
*
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class EventManager
{
/**
* Map of registered listeners.
* <event> => <listeners>
*
* @var array
*/
private $_listeners = array();
/**
* Dispatches an event to all registered listeners.
*
* @param string $eventName The name of the event to dispatch. The name of the event is
* the name of the method that is invoked on listeners.
* @param EventArgs|null $eventArgs The event arguments to pass to the event handlers/listeners.
* If not supplied, the single empty EventArgs instance is used.
*
* @return boolean
*/
public function dispatchEvent($eventName, EventArgs $eventArgs = null)
{
if (isset($this->_listeners[$eventName])) {
$eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs;
foreach ($this->_listeners[$eventName] as $listener) {
$listener->$eventName($eventArgs);
}
}
}
/**
* Gets the listeners of a specific event or all listeners.
*
* @param string|null $event The name of the event.
*
* @return array The event listeners for the specified event, or all event listeners.
*/
public function getListeners($event = null)
{
return $event ? $this->_listeners[$event] : $this->_listeners;
}
/**
* Checks whether an event has any registered listeners.
*
* @param string $event
*
* @return boolean TRUE if the specified event has any listeners, FALSE otherwise.
*/
public function hasListeners($event)
{
return isset($this->_listeners[$event]) && $this->_listeners[$event];
}
/**
* Adds an event listener that listens on the specified events.
*
* @param string|array $events The event(s) to listen on.
* @param object $listener The listener object.
*
* @return void
*/
public function addEventListener($events, $listener)
{
// Picks the hash code related to that listener
$hash = spl_object_hash($listener);
foreach ((array) $events as $event) {
// Overrides listener if a previous one was associated already
// Prevents duplicate listeners on same event (same instance only)
$this->_listeners[$event][$hash] = $listener;
}
}
/**
* Removes an event listener from the specified events.
*
* @param string|array $events
* @param object $listener
*
* @return void
*/
public function removeEventListener($events, $listener)
{
// Picks the hash code related to that listener
$hash = spl_object_hash($listener);
foreach ((array) $events as $event) {
// Check if actually have this listener associated
if (isset($this->_listeners[$event][$hash])) {
unset($this->_listeners[$event][$hash]);
}
}
}
/**
* Adds an EventSubscriber. The subscriber is asked for all the events it is
* interested in and added as a listener for these events.
*
* @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
*
* @return void
*/
public function addEventSubscriber(EventSubscriber $subscriber)
{
$this->addEventListener($subscriber->getSubscribedEvents(), $subscriber);
}
/**
* Removes an EventSubscriber. The subscriber is asked for all the events it is
* interested in and removed as a listener for these events.
*
* @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
*
* @return void
*/
public function removeEventSubscriber(EventSubscriber $subscriber)
{
$this->removeEventListener($subscriber->getSubscribedEvents(), $subscriber);
}
}
| anchorfree-market/af | concrete/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php | PHP | mit | 5,317 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2015, British Columbia Institute of Technology
*
* 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.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
* @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link http://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* CodeIgniter String Helpers
*
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
* @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/string_helper.html
*/
// ------------------------------------------------------------------------
if ( ! function_exists('trim_slashes'))
{
/**
* Trim Slashes
*
* Removes any leading/trailing slashes from a string:
*
* /this/that/theother/
*
* becomes:
*
* this/that/theother
*
* @todo Remove in version 3.1+.
* @deprecated 3.0.0 This is just an alias for PHP's native trim()
*
* @param string
* @return string
*/
function trim_slashes($str)
{
return trim($str, '/');
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('strip_slashes'))
{
/**
* Strip Slashes
*
* Removes slashes contained in a string or in an array
*
* @param mixed string or array
* @return mixed string or array
*/
function strip_slashes($str)
{
if ( ! is_array($str))
{
return stripslashes($str);
}
foreach ($str as $key => $val)
{
$str[$key] = strip_slashes($val);
}
return $str;
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('strip_quotes'))
{
/**
* Strip Quotes
*
* Removes single and double quotes from a string
*
* @param string
* @return string
*/
function strip_quotes($str)
{
return str_replace(array('"', "'"), '', $str);
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('quotes_to_entities'))
{
/**
* Quotes to Entities
*
* Converts single and double quotes to entities
*
* @param string
* @return string
*/
function quotes_to_entities($str)
{
return str_replace(array("\'","\"","'",'"'), array("'",""","'","""), $str);
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('reduce_double_slashes'))
{
/**
* Reduce Double Slashes
*
* Converts double slashes in a string to a single slash,
* except those found in http://
*
* http://www.some-site.com//index.php
*
* becomes:
*
* http://www.some-site.com/index.php
*
* @param string
* @return string
*/
function reduce_double_slashes($str)
{
return preg_replace('#(^|[^:])//+#', '\\1/', $str);
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('reduce_multiples'))
{
/**
* Reduce Multiples
*
* Reduces multiple instances of a particular character. Example:
*
* Fred, Bill,, Joe, Jimmy
*
* becomes:
*
* Fred, Bill, Joe, Jimmy
*
* @param string
* @param string the character you wish to reduce
* @param bool TRUE/FALSE - whether to trim the character from the beginning/end
* @return string
*/
function reduce_multiples($str, $character = ',', $trim = FALSE)
{
$str = preg_replace('#'.preg_quote($character, '#').'{2,}#', $character, $str);
return ($trim === TRUE) ? trim($str, $character) : $str;
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('random_string'))
{
/**
* Create a Random String
*
* Useful for generating passwords or hashes.
*
* @param string type of random string. basic, alpha, alnum, numeric, nozero, unique, md5, encrypt and sha1
* @param int number of characters
* @return string
*/
function random_string($type = 'alnum', $len = 8)
{
switch ($type)
{
case 'basic':
return mt_rand();
case 'alnum':
case 'numeric':
case 'nozero':
case 'alpha':
switch ($type)
{
case 'alpha':
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'alnum':
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'numeric':
$pool = '0123456789';
break;
case 'nozero':
$pool = '123456789';
break;
}
return substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len);
case 'unique': // todo: remove in 3.1+
case 'md5':
return md5(uniqid(mt_rand()));
case 'encrypt': // todo: remove in 3.1+
case 'sha1':
return sha1(uniqid(mt_rand(), TRUE));
}
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('increment_string'))
{
/**
* Add's _1 to a string or increment the ending number to allow _2, _3, etc
*
* @param string required
* @param string What should the duplicate number be appended with
* @param string Which number should be used for the first dupe increment
* @return string
*/
function increment_string($str, $separator = '_', $first = 1)
{
preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match);
return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first;
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('alternator'))
{
/**
* Alternator
*
* Allows strings to be alternated. See docs...
*
* @param string (as many parameters as needed)
* @return string
*/
function alternator($args)
{
static $i;
if (func_num_args() === 0)
{
$i = 0;
return '';
}
$args = func_get_args();
return $args[($i++ % count($args))];
}
}
// ------------------------------------------------------------------------
if ( ! function_exists('repeater'))
{
/**
* Repeater function
*
* @todo Remove in version 3.1+.
* @deprecated 3.0.0 This is just an alias for PHP's native str_repeat()
*
* @param string $data String to repeat
* @param int $num Number of repeats
* @return string
*/
function repeater($data, $num = 1)
{
return ($num > 0) ? str_repeat($data, $num) : '';
}
}
| yah952/Blog | system/helpers/string_helper.php | PHP | mit | 7,584 |
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document);
/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
(function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this);
| toanhv/proscom | source/backend/web/plugins/respond.min.js | JavaScript | mit | 4,047 |
var baseSetData = require('./baseSetData'),
createBindWrapper = require('./createBindWrapper'),
createHybridWrapper = require('./createHybridWrapper'),
createPartialWrapper = require('./createPartialWrapper'),
getData = require('./getData'),
mergeData = require('./mergeData'),
setData = require('./setData');
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,
BIND_KEY_FLAG = 2,
PARTIAL_FLAG = 32,
PARTIAL_RIGHT_FLAG = 64;
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Native method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to reference.
* @param {number} bitmask The bitmask of flags.
* The bitmask may be composed of the following flags:
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
length -= (holders ? holders.length : 0);
if (bitmask & PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func),
newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
if (data) {
mergeData(newData, data);
bitmask = newData[1];
arity = newData[9];
}
newData[9] = arity == null
? (isBindKey ? 0 : func.length)
: (nativeMax(arity - length, 0) || 0);
if (bitmask == BIND_FLAG) {
var result = createBindWrapper(newData[0], newData[2]);
} else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
result = createPartialWrapper.apply(undefined, newData);
} else {
result = createHybridWrapper.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setter(result, newData);
}
module.exports = createWrapper;
| BabbleCar/demo-mirrorlink-cordova | plugins/cordova-plugin-mirrorlink/www/node_modules/eslint/node_modules/inquirer/node_modules/lodash/internal/createWrapper.js | JavaScript | mit | 3,075 |
define([
"../core",
"../ajax"
], function( jQuery ) {
// Install script dataType
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
});
// Handle cache's special case and crossDomain
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
}
});
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function( s ) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script, callback;
return {
send: function( _, complete ) {
script = jQuery("<script>").prop({
async: true,
charset: s.scriptCharset,
src: s.url
}).on(
"load error",
callback = function( evt ) {
script.remove();
callback = null;
if ( evt ) {
complete( evt.type === "error" ? 404 : 200, evt.type );
}
}
);
document.head.appendChild( script[ 0 ] );
},
abort: function() {
if ( callback ) {
callback();
}
}
};
}
});
});
| iandees/membership | members/static/libs/jQuery/src/ajax/script.js | JavaScript | mit | 1,271 |
webshims.validityMessages.nl={typeMismatch:{defaultMessage:"Voer een geldige waarde in.",email:"Voer een geldig e-mailadres in.",url:"Voer een geldige website url in."},badInput:{defaultMessage:"Voer een geldige waarde in.",number:"Voer een nummer in.",date:"Voer een datum in.",time:"Voer een tijd in.",range:"Voer een bereik in.",month:"Voer een maand in.","datetime-local":"Voer een lokale datumtijd in."},rangeUnderflow:{defaultMessage:"Waarde moet groter dan of gelijk zijn aan {%min}.",date:"Datum moet op of na {%min} zijn.",time:"Tijd moet op of na {%min} zijn.","datetime-local":"Datumtijd moet op of na {%min} zijn.",month:"Maand moet op of na {%min} zijn."},rangeOverflow:{defaultMessage:"Waarde moet kleiner dan of gelijk zijn aan {%max}.",date:"Datum moet op of voor {%max} zijn.",time:"Tijd moet op of voor {%max} zijn.","datetime-local":"Waarde moet kleiner dan of gelijk zijn aan {%max}.",month:"Maand moet op of voor {%max} zijn."},stepMismatch:"Ongeldige invoer.",tooLong:"Voer maximaal {%maxLength} karakter(s) in. {%valueLen} is te lang.",tooShort:"Voer minimaal {%minLength} karakter(s) in. {%valueLen} is te kort.",patternMismatch:"Voer een waarde in met de gevraagde opmaak: {%title}.",valueMissing:{defaultMessage:"Vul dit veld in.",checkbox:"Vink dit vakje aan als u wilt doorgaan.",select:"Selecteer een item in de lijst.",radio:"Selecteer \xe9\xe9n van deze opties."}},webshims.formcfg.nl={numberFormat:{",":".",".":","},numberSigns:",",dateSigns:"-",timeSigns:":. ",dFormat:"-",patterns:{d:"dd-mm-yy"},month:{currentText:"Huidige maand"},time:{currentText:"Nu"},date:{closeText:"Sluiten",clear:"Wissen",prevText:"Vorige",nextText:"Volgende",currentText:"Vandaag",monthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],dayNamesShort:["zon","maa","din","woe","don","vri","zat"],dayNamesMin:["zo","ma","di","wo","do","vr","za"],weekHeader:"Wk",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}}; | bdukes/cdnjs | ajax/libs/webshim/1.14.6-RC2/minified/shims/i18n/formcfg-nl.js | JavaScript | mit | 2,171 |
using Abp.Domain.Uow;
using Abp.EntityFramework;
using Abp.Modules;
using Abp.MultiTenancy;
using Abp.Reflection.Extensions;
using Castle.MicroKernel.Registration;
namespace Abp.Zero.EntityFramework
{
/// <summary>
/// Entity framework integration module for ASP.NET Boilerplate Zero.
/// </summary>
[DependsOn(typeof(AbpZeroCoreModule), typeof(AbpEntityFrameworkModule))]
public class AbpZeroCoreEntityFrameworkModule : AbpModule
{
public override void PreInitialize()
{
Configuration.ReplaceService(typeof(IConnectionStringResolver), () =>
{
IocManager.IocContainer.Register(
Component.For<IConnectionStringResolver, IDbPerTenantConnectionStringResolver>()
.ImplementedBy<DbPerTenantConnectionStringResolver>()
.LifestyleTransient()
);
});
}
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(typeof(AbpZeroCoreEntityFrameworkModule).GetAssembly());
}
}
}
| Nongzhsh/aspnetboilerplate | src/Abp.ZeroCore.EntityFramework/Zero/EntityFramework/AbpZeroCoreEntityFrameworkModule.cs | C# | mit | 1,116 |
<?php
require_once '_inc.php';
require_once 'Minify/Build.php';
function test_Minify_Build()
{
global $thisDir;
$file1 = $thisDir . '/_test_files/css/paths_prepend.css';
$file2 = $thisDir . '/_test_files/css/styles.css';
$maxTime = max(filemtime($file1), filemtime($file2));
$b = new Minify_Build($file1);
assertTrue($b->lastModified == filemtime($file1)
,'Minify_Build : single file path');
$b = new Minify_Build(array($file1, $file2));
assertTrue($maxTime == $b->lastModified
,'Minify_Build : multiple file paths');
require_once 'Minify.php';
$b = new Minify_Build(array(
$file1
,new Minify_Source(array('filepath' => $file2))
));
assertTrue($maxTime == $b->lastModified
,'Minify_Build : file path and a Minify_Source');
assertTrue($b->uri('/path') == "/path?{$maxTime}"
,'Minify_Build : uri() with no querystring');
assertTrue($b->uri('/path?hello') == "/path?hello&{$maxTime}"
,'Minify_Build : uri() with existing querystring');
}
test_Minify_Build(); | collab-uniba/eConference-3P-mobile | min/min_unit_tests/test_Minify_Build.php | PHP | mit | 1,099 |
#!/bin/sh
test_description='rev-list/rev-parse --glob'
. ./test-lib.sh
commit () {
test_tick &&
echo $1 > foo &&
git add foo &&
git commit -m "$1"
}
compare () {
# Split arguments on whitespace.
git $1 $2 >expected &&
git $1 $3 >actual &&
test_cmp expected actual
}
test_expect_success 'setup' '
commit master &&
git checkout -b subspace/one master &&
commit one &&
git checkout -b subspace/two master &&
commit two &&
git checkout -b subspace-x master &&
commit subspace-x &&
git checkout -b other/three master &&
commit three &&
git checkout -b someref master &&
commit some &&
git checkout master &&
commit master2 &&
git tag foo/bar master &&
commit master3 &&
git update-ref refs/remotes/foo/baz master &&
commit master4 &&
git update-ref refs/remotes/upstream/one subspace/one &&
git update-ref refs/remotes/upstream/two subspace/two &&
git update-ref refs/remotes/upstream/x subspace-x &&
git tag qux/one subspace/one &&
git tag qux/two subspace/two &&
git tag qux/x subspace-x
'
test_expect_success 'rev-parse --glob=refs/heads/subspace/*' '
compare rev-parse "subspace/one subspace/two" "--glob=refs/heads/subspace/*"
'
test_expect_success 'rev-parse --glob=heads/subspace/*' '
compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace/*"
'
test_expect_success 'rev-parse --glob=refs/heads/subspace/' '
compare rev-parse "subspace/one subspace/two" "--glob=refs/heads/subspace/"
'
test_expect_success 'rev-parse --glob=heads/subspace/' '
compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace/"
'
test_expect_success 'rev-parse --glob=heads/subspace' '
compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace"
'
test_expect_failure 'rev-parse accepts --glob as detached option' '
compare rev-parse "subspace/one subspace/two" "--glob heads/subspace"
'
test_expect_failure 'rev-parse is not confused by option-like glob' '
compare rev-parse "master" "--glob --symbolic master"
'
test_expect_success 'rev-parse --branches=subspace/*' '
compare rev-parse "subspace/one subspace/two" "--branches=subspace/*"
'
test_expect_success 'rev-parse --branches=subspace/' '
compare rev-parse "subspace/one subspace/two" "--branches=subspace/"
'
test_expect_success 'rev-parse --branches=subspace' '
compare rev-parse "subspace/one subspace/two" "--branches=subspace"
'
test_expect_success 'rev-parse --glob=heads/subspace/* --glob=heads/other/*' '
compare rev-parse "subspace/one subspace/two other/three" "--glob=heads/subspace/* --glob=heads/other/*"
'
test_expect_success 'rev-parse --glob=heads/someref/* master' '
compare rev-parse "master" "--glob=heads/someref/* master"
'
test_expect_success 'rev-parse --glob=heads/*' '
compare rev-parse "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
'
test_expect_success 'rev-parse --tags=foo' '
compare rev-parse "foo/bar" "--tags=foo"
'
test_expect_success 'rev-parse --remotes=foo' '
compare rev-parse "foo/baz" "--remotes=foo"
'
test_expect_success 'rev-parse --exclude with --branches' '
compare rev-parse "--exclude=*/* --branches" "master someref subspace-x"
'
test_expect_success 'rev-parse --exclude with --all' '
compare rev-parse "--exclude=refs/remotes/* --all" "--branches --tags"
'
test_expect_success 'rev-parse accumulates multiple --exclude' '
compare rev-parse "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches
'
test_expect_success 'rev-parse --branches clears --exclude' '
compare rev-parse "--exclude=* --branches --branches" "--branches"
'
test_expect_success 'rev-parse --tags clears --exclude' '
compare rev-parse "--exclude=* --tags --tags" "--tags"
'
test_expect_success 'rev-parse --all clears --exclude' '
compare rev-parse "--exclude=* --all --all" "--all"
'
test_expect_success 'rev-parse --exclude=glob with --branches=glob' '
compare rev-parse "--exclude=subspace-* --branches=sub*" "subspace/one subspace/two"
'
test_expect_success 'rev-parse --exclude=glob with --tags=glob' '
compare rev-parse "--exclude=qux/? --tags=qux/*" "qux/one qux/two"
'
test_expect_success 'rev-parse --exclude=glob with --remotes=glob' '
compare rev-parse "--exclude=upstream/? --remotes=upstream/*" "upstream/one upstream/two"
'
test_expect_success 'rev-parse --exclude=ref with --branches=glob' '
compare rev-parse "--exclude=subspace-x --branches=sub*" "subspace/one subspace/two"
'
test_expect_success 'rev-parse --exclude=ref with --tags=glob' '
compare rev-parse "--exclude=qux/x --tags=qux/*" "qux/one qux/two"
'
test_expect_success 'rev-parse --exclude=ref with --remotes=glob' '
compare rev-parse "--exclude=upstream/x --remotes=upstream/*" "upstream/one upstream/two"
'
test_expect_success 'rev-list --exclude=glob with --branches=glob' '
compare rev-list "--exclude=subspace-* --branches=sub*" "subspace/one subspace/two"
'
test_expect_success 'rev-list --exclude=glob with --tags=glob' '
compare rev-list "--exclude=qux/? --tags=qux/*" "qux/one qux/two"
'
test_expect_success 'rev-list --exclude=glob with --remotes=glob' '
compare rev-list "--exclude=upstream/? --remotes=upstream/*" "upstream/one upstream/two"
'
test_expect_success 'rev-list --exclude=ref with --branches=glob' '
compare rev-list "--exclude=subspace-x --branches=sub*" "subspace/one subspace/two"
'
test_expect_success 'rev-list --exclude=ref with --tags=glob' '
compare rev-list "--exclude=qux/x --tags=qux/*" "qux/one qux/two"
'
test_expect_success 'rev-list --exclude=ref with --remotes=glob' '
compare rev-list "--exclude=upstream/x --remotes=upstream/*" "upstream/one upstream/two"
'
test_expect_success 'rev-list --glob=refs/heads/subspace/*' '
compare rev-list "subspace/one subspace/two" "--glob=refs/heads/subspace/*"
'
test_expect_success 'rev-list --glob refs/heads/subspace/*' '
compare rev-list "subspace/one subspace/two" "--glob refs/heads/subspace/*"
'
test_expect_success 'rev-list not confused by option-like --glob arg' '
compare rev-list "master" "--glob -0 master"
'
test_expect_success 'rev-list --glob=heads/subspace/*' '
compare rev-list "subspace/one subspace/two" "--glob=heads/subspace/*"
'
test_expect_success 'rev-list --glob=refs/heads/subspace/' '
compare rev-list "subspace/one subspace/two" "--glob=refs/heads/subspace/"
'
test_expect_success 'rev-list --glob=heads/subspace/' '
compare rev-list "subspace/one subspace/two" "--glob=heads/subspace/"
'
test_expect_success 'rev-list --glob=heads/subspace' '
compare rev-list "subspace/one subspace/two" "--glob=heads/subspace"
'
test_expect_success 'rev-list --branches=subspace/*' '
compare rev-list "subspace/one subspace/two" "--branches=subspace/*"
'
test_expect_success 'rev-list --branches=subspace/' '
compare rev-list "subspace/one subspace/two" "--branches=subspace/"
'
test_expect_success 'rev-list --branches=subspace' '
compare rev-list "subspace/one subspace/two" "--branches=subspace"
'
test_expect_success 'rev-list --branches' '
compare rev-list "master subspace-x someref other/three subspace/one subspace/two" "--branches"
'
test_expect_success 'rev-list --glob=heads/someref/* master' '
compare rev-list "master" "--glob=heads/someref/* master"
'
test_expect_success 'rev-list --glob=heads/subspace/* --glob=heads/other/*' '
compare rev-list "subspace/one subspace/two other/three" "--glob=heads/subspace/* --glob=heads/other/*"
'
test_expect_success 'rev-list --glob=heads/*' '
compare rev-list "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
'
test_expect_success 'rev-list --tags=foo' '
compare rev-list "foo/bar" "--tags=foo"
'
test_expect_success 'rev-list --tags' '
compare rev-list "foo/bar qux/x qux/two qux/one" "--tags"
'
test_expect_success 'rev-list --remotes=foo' '
compare rev-list "foo/baz" "--remotes=foo"
'
test_expect_success 'rev-list --exclude with --branches' '
compare rev-list "--exclude=*/* --branches" "master someref subspace-x"
'
test_expect_success 'rev-list --exclude with --all' '
compare rev-list "--exclude=refs/remotes/* --all" "--branches --tags"
'
test_expect_success 'rev-list accumulates multiple --exclude' '
compare rev-list "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches
'
test_expect_success 'rev-list should succeed with empty output on empty stdin' '
git rev-list --stdin </dev/null >actual &&
test_must_be_empty actual
'
test_expect_success 'rev-list should succeed with empty output with all refs excluded' '
git rev-list --exclude=* --all >actual &&
test_must_be_empty actual
'
test_expect_success 'rev-list should succeed with empty output with empty --all' '
(
test_create_repo empty &&
cd empty &&
git rev-list --all >actual &&
test_must_be_empty actual
)
'
test_expect_success 'rev-list should succeed with empty output with empty glob' '
git rev-list --glob=does-not-match-anything >actual &&
test_must_be_empty actual
'
test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
compare shortlog "subspace/one subspace/two" --branches=subspace &&
compare shortlog \
"master subspace-x someref other/three subspace/one subspace/two" \
--branches &&
compare shortlog master "--glob=heads/someref/* master" &&
compare shortlog "subspace/one subspace/two other/three" \
"--glob=heads/subspace/* --glob=heads/other/*" &&
compare shortlog \
"master other/three someref subspace-x subspace/one subspace/two" \
"--glob=heads/*" &&
compare shortlog foo/bar --tags=foo &&
compare shortlog "foo/bar qux/one qux/two qux/x" --tags &&
compare shortlog foo/baz --remotes=foo
'
test_expect_failure 'shortlog accepts --glob as detached option' '
compare shortlog \
"master other/three someref subspace-x subspace/one subspace/two" \
"--glob heads/*"
'
test_expect_failure 'shortlog --glob is not confused by option-like argument' '
compare shortlog master "--glob -e master"
'
test_done
| astabschneider/astabschneider.github.io | _site/git/t/t6018-rev-list-glob.sh | Shell | mit | 9,974 |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Auxiliary Generators</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../../../index.html" title="Spirit 2.5.2">
<link rel="up" href="../primitive_generators.html" title="Karma Generators">
<link rel="prev" href="binary.html" title="Binary Generators">
<link rel="next" href="auto.html" title="Auto Generators">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="binary.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../primitive_generators.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="auto.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="spirit.karma.quick_reference.primitive_generators.auxiliary"></a><a class="link" href="auxiliary.html" title="Auxiliary Generators">Auxiliary
Generators</a>
</h5></div></div></div>
<p>
See here for more information about <a class="link" href="../../reference/auxiliary.html" title="Auxiliary Generators">Auxiliary
Generators</a>.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression
</p>
</th>
<th>
<p>
Attribute
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<a class="link" href="../../reference/auxiliary/attr_cast.html" title="Attribute Transformation Pseudo Generator (attr_cast)"><code class="computeroutput"><span class="identifier">attr_cast</span><span class="special"><</span><span class="identifier">Exposed</span><span class="special">>(</span><span class="identifier">a</span><span class="special">)</span></code></a>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Exposed</span></code>
</p>
</td>
<td>
<p>
Invoke <code class="computeroutput"><span class="identifier">a</span></code> while
supplying an attribute of type <code class="computeroutput"><span class="identifier">Exposed</span></code>.
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/auxiliary/eol.html" title="End of Line Generator (eol)"><code class="computeroutput"><span class="identifier">eol</span></code></a>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Unused</span></code>
</p>
</td>
<td>
<p>
Generate the end of line (<code class="computeroutput"><span class="special">\</span><span class="identifier">n</span></code>)
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/auxiliary/eps.html" title="Epsilon Generator (eps)"><code class="computeroutput"><span class="identifier">eps</span></code></a>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Unused</span></code>
</p>
</td>
<td>
<p>
Generate an empty string
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/auxiliary/eps.html" title="Epsilon Generator (eps)"><code class="computeroutput"><span class="identifier">eps</span><span class="special">(</span><span class="identifier">b</span><span class="special">)</span></code></a>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">Unused</span></code>
</p>
</td>
<td>
<p>
If <code class="computeroutput"><span class="identifier">b</span></code> is true,
generate an empty string
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/auxiliary/lazy.html" title="Lazy Generator (lazy)"><code class="computeroutput"><span class="identifier">lazy</span><span class="special">(</span><span class="identifier">fg</span><span class="special">)</span></code></a>
</p>
</td>
<td>
<p>
Attribute of <code class="computeroutput"><span class="identifier">G</span></code>
where <code class="computeroutput"><span class="identifier">G</span></code> is
the return type of <code class="computeroutput"><span class="identifier">fg</span></code>
</p>
</td>
<td>
<p>
Invoke <code class="computeroutput"><span class="identifier">fg</span></code> at
generation time, returning a generator <code class="computeroutput"><span class="identifier">g</span></code>
which is then called to generate.
</p>
</td>
</tr>
<tr>
<td>
<p>
<a class="link" href="../../reference/auxiliary/lazy.html" title="Lazy Generator (lazy)"><code class="computeroutput"><span class="identifier">fg</span></code></a>
</p>
</td>
<td>
<p>
see <a class="link" href="../../reference/auxiliary/lazy.html" title="Lazy Generator (lazy)"><code class="computeroutput"><span class="identifier">lazy</span><span class="special">(</span><span class="identifier">fg</span><span class="special">)</span></code></a>
above
</p>
</td>
<td>
<p>
Equivalent to <a class="link" href="../../reference/auxiliary/lazy.html" title="Lazy Generator (lazy)"><code class="computeroutput"><span class="identifier">lazy</span><span class="special">(</span><span class="identifier">fg</span><span class="special">)</span></code></a>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="binary.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../primitive_generators.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="auto.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| yinchunlong/abelkhan-1 | ext/c++/thirdpart/c++/boost/libs/spirit/doc/html/spirit/karma/quick_reference/primitive_generators/auxiliary.html | HTML | mit | 8,867 |
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Management.DataLake.Store.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
/// <summary>
/// Data Lake Store account name availability check parameters.
/// </summary>
public partial class CheckNameAvailabilityParameters
{
/// <summary>
/// Initializes a new instance of the CheckNameAvailabilityParameters
/// class.
/// </summary>
public CheckNameAvailabilityParameters()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the CheckNameAvailabilityParameters
/// class.
/// </summary>
/// <param name="name">The Data Lake Store name to check availability
/// for.</param>
public CheckNameAvailabilityParameters(string name)
{
Name = name;
CustomInit();
}
/// <summary>
/// Static constructor for CheckNameAvailabilityParameters class.
/// </summary>
static CheckNameAvailabilityParameters()
{
Type = "Microsoft.DataLakeStore/accounts";
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets the Data Lake Store name to check availability for.
/// </summary>
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
/// <summary>
/// The resource type. Note: This should not be set by the user, as the
/// constant value is Microsoft.DataLakeStore/accounts
/// </summary>
[JsonProperty(PropertyName = "type")]
public static string Type { get; private set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Name == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Name");
}
}
}
}
| jackmagic313/azure-sdk-for-net | sdk/datalake-store/Microsoft.Azure.Management.DataLake.Store/src/Generated/Models/CheckNameAvailabilityParameters.cs | C# | mit | 2,593 |
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
* (c) Jonathan H. Wage <jonwage@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once(dirname(__FILE__).'/sfDoctrineBaseTask.class.php');
/**
* Creates a schema.xml from an existing database.
*
* @package symfony
* @subpackage doctrine
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Jonathan H. Wage <jonwage@gmail.com>
* @version SVN: $Id: sfDoctrineBuildSchemaTask.class.php 14213 2008-12-19 21:03:13Z Jonathan.Wage $
*/
class sfDoctrineBuildSchemaTask extends sfDoctrineBaseTask
{
/**
* @see sfTask
*/
protected function configure()
{
$this->addOptions(array(
new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true),
new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
));
$this->aliases = array('doctrine-build-schema');
$this->namespace = 'doctrine';
$this->name = 'build-schema';
$this->briefDescription = 'Creates a schema from an existing database';
$this->detailedDescription = <<<EOF
The [doctrine:build-schema|INFO] task introspects a database to create a schema:
[./symfony doctrine:build-schema|INFO]
The task creates a yml file in [config/doctrine|COMMENT]
EOF;
}
/**
* @see sfTask
*/
protected function execute($arguments = array(), $options = array())
{
$this->logSection('doctrine', 'generating yaml schema from database');
$databaseManager = new sfDatabaseManager($this->configuration);
$this->callDoctrineCli('generate-yaml-db');
}
} | wboray/symfony | lib/symfony/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildSchemaTask.class.php | PHP | mit | 1,813 |
module.exports={D:{"10":0.00206,"11":0.06592,"17":0.09064,"18":0.00412,"19":0.00206,"21":0.01236,"22":0.01442,"26":0.08446,"27":0.01854,"28":0.0103,"29":0.01236,"30":0.00618,"31":0.01236,"32":0.01854,"33":0.00618,"34":0.00206,"35":0.00824,"36":0.01854,"37":0.0103,"38":0.00206,"39":0.01854,"40":0.00206,"41":0.09476,"43":0.10094,"44":0.00824,"45":0.12978,"46":0.00618,"47":0.0103,"48":0.00618,"49":0.14832,"50":0.02472,"51":0.06798,"52":0.00412,"53":0.01236,"54":0.0103,"55":0.4841,"56":0.08652,"57":0.14626,"58":4.76066,"59":0.8755,"60":0.00412,"61":0.00412,_:"4 5 6 7 8 9 12 13 14 15 16 20 23 24 25 42 62"},C:{"2":0.00206,"3":1.09592,"4":0.00412,"8":0.01648,"11":0.00412,"12":0.00618,"13":0.00206,"14":0.00618,"15":0.00206,"16":0.02472,"17":0.00206,"18":0.00618,"20":0.00412,"21":0.01236,"22":0.0103,"23":0.00412,"24":0.00618,"25":0.01648,"27":0.00412,"28":0.00412,"29":0.00412,"30":0.01854,"31":0.00824,"32":0.00618,"33":0.00618,"34":0.00412,"35":0.01442,"36":0.00618,"37":0.01648,"38":0.0309,"39":0.02472,"40":0.01442,"41":0.01236,"42":0.0515,"43":0.0515,"44":0.01648,"45":0.06798,"46":0.02678,"47":0.17098,"48":0.11124,"49":0.1751,"50":0.04326,"51":0.0927,"52":0.33784,"53":2.6986,"54":1.2566,"55":0.0206,_:"5 6 7 9 10 19 26 56 57","3.5":0.0103,"3.6":0.01854},F:{"12":0.01236,"15":0.00206,"20":0.00206,"21":0.01854,"24":0.0309,"28":0.09682,"30":0.00412,"33":0.00412,"34":0.00412,"35":0.00412,"36":0.01236,"37":0.01648,"38":0.00618,"40":0.00412,"41":0.05356,"42":0.04326,"43":0.03914,"44":0.02678,"45":0.6386,"46":0.03296,"48":0.00206,_:"9 11 16 17 18 19 22 23 25 26 27 29 31 32 39 47 9.5-9.6 10.5 10.6 11.1 11.5","10.0-10.1":0,"11.6":0.0103,"12.1":0.02266},E:{"4":0,"5":0.00824,"7":0.08652,"8":0.03914,"9":0.04944,"10":0.1648,_:"0 6 11 3.1 3.2","5.1":0.01442,"6.1":0.00412,"7.1":0.0103,"9.1":0.15038,"10.1":0.21424},G:{"8":0,_:"11","3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0.0104435334507,"8.1-8.4":0.0079862314623,"9.0-9.2":0.006143254971,"9.3":0.112216790804,"10.0-10.2":0.382724784693,"10.3":1.45779440462},I:{"3":0,"4":0,_:"56","2.1":0,"2.2":0,"2.3":0,"4.1":0.595276229703,"4.2-4.3":1.53970486337,"4.4":4.13831455842,"4.4.3-4.4.4":2.39827634851},K:{"0":0.0467656230599,"10":0,"11":0,"12":0,"11.1":0,"11.5":0,"12.1":0},A:{"7":0.0020985323741,"8":0.130109007194,"9":0.0902368920863,"10":0.237134158273,"11":0.998901410072,_:"6 5.5"},B:{"12":0.10094,"13":0.17098,"14":0.34608,_:"15 16"},J:{"7":0.1469085,_:"10"},P:{"4":2.032896,_:"5"},N:{"10":0.0855184615385,"11":0.470351538462},H:{"0":10.4988823769},L:{"0":24.78701},R:{_:"0"},M:{"0":0.055587},Q:{_:"1.2"},O:{"0":31.096956}};
| xbpp/xbpp.github.io | node_modules/caniuse-lite/data/regions/CG.js | JavaScript | mit | 2,609 |
# ----------------------------------------------------------------------------
# A dictionary of dicts, with only the minimum required is_selected attribute,
# for use with examples using a simple list of integers in a list view.
integers_dict = \
{ str(i): {'text': str(i), 'is_selected': False} for i in range(100)}
# ----------------------------------------------------------------------------
# A dataset of fruit category and fruit data for use in examples.
#
# Data from http://www.fda.gov/Food/LabelingNutrition/\
# FoodLabelingGuidanceRegulatoryInformation/\
# InformationforRestaurantsRetailEstablishments/\
# ucm063482.htm
#
# Available items for import are:
#
# fruit_categories
# fruit_data_attributes
# fruit_data_attribute_units
# fruit_data_list_of_dicts
# fruit_data
#
fruit_categories = \
{'Melons': {'name': 'Melons',
'fruits': ['Cantaloupe', 'Honeydew', 'Watermelon'],
'is_selected': False},
'Tree Fruits': {'name': 'Tree Fruits',
'fruits': ['Apple', 'Avocado', 'Banana', 'Nectarine',
'Peach', 'Pear', 'Pineapple', 'Plum',
'Cherry'],
'is_selected': False},
'Citrus Fruits': {'name': 'Citrus Fruits',
'fruits': ['Grapefruit', 'Lemon', 'Lime', 'Orange',
'Tangerine'],
'is_selected': False},
'Other Fruits': {'name': 'Other Fruits',
'fruits': ['Grape', 'Kiwifruit',
'Strawberry'],
'is_selected': False}}
fruit_data_list_of_dicts = [
{'name':'Apple',
'Serving Size': '1 large (242 g/8 oz)',
'data': [130, 0, 0, 0, 0, 0, 260, 7, 34, 11, 5, 20, 25, 1, 2, 8, 2, 2],
'is_selected': False},
{'name':'Avocado',
'Serving Size': '1/5 medium (30 g/1.1 oz)',
'data': [50, 35, 4.5, 7, 0, 0, 140, 4, 3, 1, 1, 4, 0, 1, 0, 4, 0, 2],
'is_selected': False},
{'name':'Banana',
'Serving Size': '1 medium (126 g/4.5 oz)',
'data': [110, 0, 0, 0, 0, 0, 450, 13, 30, 10, 3, 12, 19, 1, 2, 15, 0, 2],
'is_selected': False},
{'name':'Cantaloupe',
'Serving Size': '1/4 medium (134 g/4.8 oz)',
'data': [50, 0, 0, 0, 20, 1, 240, 7, 12, 4, 1, 4, 11, 1, 120, 80, 2, 2],
'is_selected': False},
{'name':'Grapefruit',
'Serving Size': '1/2 medium (154 g/5.5 oz)',
'data': [60, 0, 0, 0, 0, 0, 160, 5, 15, 5, 2, 8, 11, 1, 35, 100, 4, 0],
'is_selected': False},
{'name':'Grape',
'Serving Size': '3/4 cup (126 g/4.5 oz)',
'data': [90, 0, 0, 0, 15, 1, 240, 7, 23, 8, 1, 4, 20, 0, 0, 2, 2, 0],
'is_selected': False},
{'name':'Honeydew',
'Serving Size': '1/10 medium melon (134 g/4.8 oz)',
'data': [50, 0, 0, 0, 30, 1, 210, 6, 12, 4, 1, 4, 11, 1, 2, 45, 2, 2],
'is_selected': False},
{'name':'Kiwifruit',
'Serving Size': '2 medium (148 g/5.3 oz)',
'data': [90, 10, 1, 2, 0, 0, 450, 13, 20, 7, 4, 16, 13, 1, 2, 240, 4, 2],
'is_selected': False},
{'name':'Lemon',
'Serving Size': '1 medium (58 g/2.1 oz)',
'data': [15, 0, 0, 0, 0, 0, 75, 2, 5, 2, 2, 8, 2, 0, 0, 40, 2, 0],
'is_selected': False},
{'name':'Lime',
'Serving Size': '1 medium (67 g/2.4 oz)',
'data': [20, 0, 0, 0, 0, 0, 75, 2, 7, 2, 2, 8, 0, 0, 0, 35, 0, 0],
'is_selected': False},
{'name':'Nectarine',
'Serving Size': '1 medium (140 g/5.0 oz)',
'data': [60, 5, 0.5, 1, 0, 0, 250, 7, 15, 5, 2, 8, 11, 1, 8, 15, 0, 2],
'is_selected': False},
{'name':'Orange',
'Serving Size': '1 medium (154 g/5.5 oz)',
'data': [80, 0, 0, 0, 0, 0, 250, 7, 19, 6, 3, 12, 14, 1, 2, 130, 6, 0],
'is_selected': False},
{'name':'Peach',
'Serving Size': '1 medium (147 g/5.3 oz)',
'data': [60, 0, 0.5, 1, 0, 0, 230, 7, 15, 5, 2, 8, 13, 1, 6, 15, 0, 2],
'is_selected': False},
{'name':'Pear',
'Serving Size': '1 medium (166 g/5.9 oz)',
'data': [100, 0, 0, 0, 0, 0, 190, 5, 26, 9, 6, 24, 16, 1, 0, 10, 2, 0],
'is_selected': False},
{'name':'Pineapple',
'Serving Size': '2 slices, 3" diameter, 3/4" thick (112 g/4 oz)',
'data': [50, 0, 0, 0, 10, 0, 120, 3, 13, 4, 1, 4, 10, 1, 2, 50, 2, 2],
'is_selected': False},
{'name':'Plum',
'Serving Size': '2 medium (151 g/5.4 oz)',
'data': [70, 0, 0, 0, 0, 0, 230, 7, 19, 6, 2, 8, 16, 1, 8, 10, 0, 2],
'is_selected': False},
{'name':'Strawberry',
'Serving Size': '8 medium (147 g/5.3 oz)',
'data': [50, 0, 0, 0, 0, 0, 170, 5, 11, 4, 2, 8, 8, 1, 0, 160, 2, 2],
'is_selected': False},
{'name':'Cherry',
'Serving Size': '21 cherries; 1 cup (140 g/5.0 oz)',
'data': [100, 0, 0, 0, 0, 0, 350, 10, 26, 9, 1, 4, 16, 1, 2, 15, 2, 2],
'is_selected': False},
{'name':'Tangerine',
'Serving Size': '1 medium (109 g/3.9 oz)',
'data': [50, 0, 0, 0, 0, 0, 160, 5, 13, 4, 2, 8, 9, 1, 6, 45, 4, 0],
'is_selected': False},
{'name':'Watermelon',
'Serving Size': '1/18 medium melon; 2 cups diced pieces (280 g/10.0 oz)',
'data': [80, 0, 0, 0, 0, 0, 270, 8, 21, 7, 1, 4, 20, 1, 30, 25, 2, 4],
'is_selected': False}]
fruit_data_attributes = ['(gram weight/ ounce weight)',
'Calories',
'Calories from Fat',
'Total Fat',
'Sodium',
'Potassium',
'Total Carbo-hydrate',
'Dietary Fiber',
'Sugars',
'Protein',
'Vitamin A',
'Vitamin C',
'Calcium',
'Iron']
fruit_data_attribute_units = ['(g)',
'(%DV)',
'(mg)',
'(%DV)',
'(mg)',
'(%DV)',
'(g)',
'(%DV)',
'(g)(%DV)',
'(g)',
'(g)',
'(%DV)',
'(%DV)',
'(%DV)',
'(%DV)']
attributes_and_units = dict(list(zip(fruit_data_attributes, fruit_data_attribute_units)))
fruit_data = {}
for fruit_record in fruit_data_list_of_dicts:
fruit_data[fruit_record['name']] = {}
fruit_data[fruit_record['name']] = \
dict({'name': fruit_record['name'],
'Serving Size': fruit_record['Serving Size'],
'is_selected': fruit_record['is_selected']},
**dict(list(zip(list(attributes_and_units.keys()), fruit_record['data']))))
| abhishekgahlot/kivy | examples/widgets/lists/fixtures.py | Python | mit | 6,693 |
/*! jQuery UI - v1.10.1 - 2013-03-10
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.datepicker.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
* Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-clearfix {
min-height: 0; /* support: IE7 */
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0);
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month-year {
width: 100%;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 49%;
}
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em;
}
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: bold;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: right;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
/* Component containers
----------------------------------*/
.ui-widget {
font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
font-size: 1.1em;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
font-size: 1em;
}
.ui-widget-content {
border: 1px solid #dddddd;
background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x;
color: #333333;
}
.ui-widget-content a {
color: #333333;
}
.ui-widget-header {
border: 1px solid #e78f08;
background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x;
color: #ffffff;
font-weight: bold;
}
.ui-widget-header a {
color: #ffffff;
}
/* Interaction states
----------------------------------*/
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
border: 1px solid #cccccc;
background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x;
font-weight: bold;
color: #1c94c4;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited {
color: #1c94c4;
text-decoration: none;
}
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
border: 1px solid #fbcb09;
background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x;
font-weight: bold;
color: #c77405;
}
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited {
color: #c77405;
text-decoration: none;
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
border: 1px solid #fbd850;
background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
font-weight: bold;
color: #eb8f00;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
color: #eb8f00;
text-decoration: none;
}
/* Interaction Cues
----------------------------------*/
.ui-state-highlight,
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
border: 1px solid #fed22f;
background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x;
color: #363636;
}
.ui-state-highlight a,
.ui-widget-content .ui-state-highlight a,
.ui-widget-header .ui-state-highlight a {
color: #363636;
}
.ui-state-error,
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
border: 1px solid #cd0a0a;
background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat;
color: #ffffff;
}
.ui-state-error a,
.ui-widget-content .ui-state-error a,
.ui-widget-header .ui-state-error a {
color: #ffffff;
}
.ui-state-error-text,
.ui-widget-content .ui-state-error-text,
.ui-widget-header .ui-state-error-text {
color: #ffffff;
}
.ui-priority-primary,
.ui-widget-content .ui-priority-primary,
.ui-widget-header .ui-priority-primary {
font-weight: bold;
}
.ui-priority-secondary,
.ui-widget-content .ui-priority-secondary,
.ui-widget-header .ui-priority-secondary {
opacity: .7;
filter:Alpha(Opacity=70);
font-weight: normal;
}
.ui-state-disabled,
.ui-widget-content .ui-state-disabled,
.ui-widget-header .ui-state-disabled {
opacity: .35;
filter:Alpha(Opacity=35);
background-image: none;
}
.ui-state-disabled .ui-icon {
filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
width: 16px;
height: 16px;
background-position: 16px 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png);
}
.ui-widget-header .ui-icon {
background-image: url(images/ui-icons_ffffff_256x240.png);
}
.ui-state-default .ui-icon {
background-image: url(images/ui-icons_ef8c08_256x240.png);
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon {
background-image: url(images/ui-icons_ef8c08_256x240.png);
}
.ui-state-active .ui-icon {
background-image: url(images/ui-icons_ef8c08_256x240.png);
}
.ui-state-highlight .ui-icon {
background-image: url(images/ui-icons_228ef1_256x240.png);
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url(images/ui-icons_ffd27a_256x240.png);
}
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 4px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 4px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 4px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 4px;
}
/* Overlays */
.ui-widget-overlay {
background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat;
opacity: .5;
filter: Alpha(Opacity=50);
}
.ui-widget-shadow {
margin: -5px 0 0 -5px;
padding: 5px;
background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x;
opacity: .2;
filter: Alpha(Opacity=20);
border-radius: 5px;
}
| huny0522/bh-board | Skin/css/jquery-ui-1.10.1.css | CSS | mit | 21,840 |
// jquery.pjax.js
// copyright chris wanstrath
// https://github.com/defunkt/jquery-pjax
(function($){
// When called on a container with a selector, fetches the href with
// ajax into the container or with the data-pjax attribute on the link
// itself.
//
// Tries to make sure the back button and ctrl+click work the way
// you'd expect.
//
// Exported as $.fn.pjax
//
// Accepts a jQuery ajax options object that may include these
// pjax specific options:
//
//
// container - Where to stick the response body. Usually a String selector.
// $(container).html(xhr.responseBody)
// (default: current jquery context)
// push - Whether to pushState the URL. Defaults to true (of course).
// replace - Want to use replaceState instead? That's cool.
//
// For convenience the second parameter can be either the container or
// the options object.
//
// Returns the jQuery object
function fnPjax(selector, container, options) {
var context = this
return this.on('click.pjax', selector, function(event) {
var opts = $.extend({}, optionsFor(container, options))
if (!opts.container)
opts.container = $(this).attr('data-pjax') || context
handleClick(event, opts)
})
}
// Public: pjax on click handler
//
// Exported as $.pjax.click.
//
// event - "click" jQuery.Event
// options - pjax options
//
// Examples
//
// $(document).on('click', 'a', $.pjax.click)
// // is the same as
// $(document).pjax('a')
//
// $(document).on('click', 'a', function(event) {
// var container = $(this).closest('[data-pjax-container]')
// $.pjax.click(event, container)
// })
//
// Returns nothing.
function handleClick(event, container, options) {
options = optionsFor(container, options)
var link = event.currentTarget
if (link.tagName.toUpperCase() !== 'A')
throw "$.fn.pjax or $.pjax.click requires an anchor element"
// Middle click, cmd click, and ctrl click should open
// links in a new tab as normal.
if ( event.which > 1 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey )
return
// Ignore cross origin links
if ( location.protocol !== link.protocol || location.hostname !== link.hostname )
return
// Ignore anchors on the same page
if (link.hash && link.href.replace(link.hash, '') ===
location.href.replace(location.hash, ''))
return
// Ignore empty anchor "foo.html#"
if (link.href === location.href + '#')
return
var defaults = {
url: link.href,
container: $(link).attr('data-pjax'),
target: link
}
var opts = $.extend({}, defaults, options)
var clickEvent = $.Event('pjax:click')
$(link).trigger(clickEvent, [opts])
if (!clickEvent.isDefaultPrevented()) {
pjax(opts)
event.preventDefault()
}
}
// Public: pjax on form submit handler
//
// Exported as $.pjax.submit
//
// event - "click" jQuery.Event
// options - pjax options
//
// Examples
//
// $(document).on('submit', 'form', function(event) {
// var container = $(this).closest('[data-pjax-container]')
// $.pjax.submit(event, container)
// })
//
// Returns nothing.
function handleSubmit(event, container, options) {
options = optionsFor(container, options)
var form = event.currentTarget
if (form.tagName.toUpperCase() !== 'FORM')
throw "$.pjax.submit requires a form element"
var defaults = {
type: form.method.toUpperCase(),
url: form.action,
data: $(form).serializeArray(),
container: $(form).attr('data-pjax'),
target: form
}
pjax($.extend({}, defaults, options))
event.preventDefault()
}
// Loads a URL with ajax, puts the response body inside a container,
// then pushState()'s the loaded URL.
//
// Works just like $.ajax in that it accepts a jQuery ajax
// settings object (with keys like url, type, data, etc).
//
// Accepts these extra keys:
//
// container - Where to stick the response body.
// $(container).html(xhr.responseBody)
// push - Whether to pushState the URL. Defaults to true (of course).
// replace - Want to use replaceState instead? That's cool.
//
// Use it just like $.ajax:
//
// var xhr = $.pjax({ url: this.href, container: '#main' })
// console.log( xhr.readyState )
//
// Returns whatever $.ajax returns.
function pjax(options) {
options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options)
if ($.isFunction(options.url)) {
options.url = options.url()
}
var target = options.target
var hash = parseURL(options.url).hash
var context = options.context = findContainerFor(options.container)
// We want the browser to maintain two separate internal caches: one
// for pjax'd partial page loads and one for normal page loads.
// Without adding this secret parameter, some browsers will often
// confuse the two.
if (!options.data) options.data = {}
options.data._pjax = context.selector
function fire(type, args) {
var event = $.Event(type, { relatedTarget: target })
context.trigger(event, args)
return !event.isDefaultPrevented()
}
var timeoutTimer
options.beforeSend = function(xhr, settings) {
// No timeout for non-GET requests
// Its not safe to request the resource again with a fallback method.
if (settings.type !== 'GET') {
settings.timeout = 0
}
xhr.setRequestHeader('X-PJAX', 'true')
xhr.setRequestHeader('X-PJAX-Container', context.selector)
if (!fire('pjax:beforeSend', [xhr, settings]))
return false
if (settings.timeout > 0) {
timeoutTimer = setTimeout(function() {
if (fire('pjax:timeout', [xhr, options]))
xhr.abort('timeout')
}, settings.timeout)
// Clear timeout setting so jquerys internal timeout isn't invoked
settings.timeout = 0
}
options.requestUrl = parseURL(settings.url).href
}
options.complete = function(xhr, textStatus) {
if (timeoutTimer)
clearTimeout(timeoutTimer)
fire('pjax:complete', [xhr, textStatus, options])
fire('pjax:end', [xhr, options])
}
options.error = function(xhr, textStatus, errorThrown) {
var container = extractContainer("", xhr, options)
var allowed = fire('pjax:error', [xhr, textStatus, errorThrown, options])
if (options.type == 'GET' && textStatus !== 'abort' && allowed) {
locationReplace(container.url)
}
}
options.success = function(data, status, xhr) {
// If $.pjax.defaults.version is a function, invoke it first.
// Otherwise it can be a static string.
var currentVersion = (typeof $.pjax.defaults.version === 'function') ?
$.pjax.defaults.version() :
$.pjax.defaults.version
var latestVersion = xhr.getResponseHeader('X-PJAX-Version')
var container = extractContainer(data, xhr, options)
// If there is a layout version mismatch, hard load the new url
if (currentVersion && latestVersion && currentVersion !== latestVersion) {
locationReplace(container.url)
return
}
// If the new response is missing a body, hard load the page
if (!container.contents) {
locationReplace(container.url)
return
}
pjax.state = {
id: options.id || uniqueId(),
url: container.url,
title: container.title,
container: context.selector,
fragment: options.fragment,
timeout: options.timeout
}
if (options.push || options.replace) {
window.history.replaceState(pjax.state, container.title, container.url)
}
if (container.title) document.title = container.title
context.html(container.contents)
executeScriptTags(container.scripts)
// Scroll to top by default
if (typeof options.scrollTo === 'number')
$(window).scrollTop(options.scrollTo)
// If the URL has a hash in it, make sure the browser
// knows to navigate to the hash.
if ( hash !== '' ) {
// Avoid using simple hash set here. Will add another history
// entry. Replace the url with replaceState and scroll to target
// by hand.
//
// window.location.hash = hash
var url = parseURL(container.url)
url.hash = hash
pjax.state.url = url.href
window.history.replaceState(pjax.state, container.title, url.href)
var target = $(url.hash)
if (target.length) $(window).scrollTop(target.offset().top)
}
fire('pjax:success', [data, status, xhr, options])
}
// Initialize pjax.state for the initial page load. Assume we're
// using the container and options of the link we're loading for the
// back button to the initial page. This ensures good back button
// behavior.
if (!pjax.state) {
pjax.state = {
id: uniqueId(),
url: window.location.href,
title: document.title,
container: context.selector,
fragment: options.fragment,
timeout: options.timeout
}
window.history.replaceState(pjax.state, document.title)
}
// Cancel the current request if we're already pjaxing
var xhr = pjax.xhr
if ( xhr && xhr.readyState < 4) {
xhr.onreadystatechange = $.noop
xhr.abort()
}
pjax.options = options
var xhr = pjax.xhr = $.ajax(options)
if (xhr.readyState > 0) {
if (options.push && !options.replace) {
// Cache current container element before replacing it
cachePush(pjax.state.id, context.clone().contents())
window.history.pushState(null, "", stripPjaxParam(options.requestUrl))
}
fire('pjax:start', [xhr, options])
fire('pjax:send', [xhr, options])
}
return pjax.xhr
}
// Public: Reload current page with pjax.
//
// Returns whatever $.pjax returns.
function pjaxReload(container, options) {
var defaults = {
url: window.location.href,
push: false,
replace: true,
scrollTo: false
}
return pjax($.extend(defaults, optionsFor(container, options)))
}
// Internal: Hard replace current state with url.
//
// Work for around WebKit
// https://bugs.webkit.org/show_bug.cgi?id=93506
//
// Returns nothing.
function locationReplace(url) {
window.history.replaceState(null, "", "#")
window.location.replace(url)
}
var initialPop = true
var initialURL = window.location.href
var initialState = window.history.state
// Initialize $.pjax.state if possible
// Happens when reloading a page and coming forward from a different
// session history.
if (initialState && initialState.container) {
pjax.state = initialState
}
// Non-webkit browsers don't fire an initial popstate event
if ('state' in window.history) {
initialPop = false
}
// popstate handler takes care of the back and forward buttons
//
// You probably shouldn't use pjax on pages with other pushState
// stuff yet.
function onPjaxPopstate(event) {
var state = event.state
if (state && state.container) {
// When coming forward from a separate history session, will get an
// initial pop with a state we are already at. Skip reloading the current
// page.
if (initialPop && initialURL == state.url) return
var container = $(state.container)
if (container.length) {
var direction, contents = cacheMapping[state.id]
if (pjax.state) {
// Since state ids always increase, we can deduce the history
// direction from the previous state.
direction = pjax.state.id < state.id ? 'forward' : 'back'
// Cache current container before replacement and inform the
// cache which direction the history shifted.
cachePop(direction, pjax.state.id, container.clone().contents())
}
var popstateEvent = $.Event('pjax:popstate', {
state: state,
direction: direction
})
container.trigger(popstateEvent)
var options = {
id: state.id,
url: state.url,
container: container,
push: false,
fragment: state.fragment,
timeout: state.timeout,
scrollTo: false
}
if (contents) {
container.trigger('pjax:start', [null, options])
if (state.title) document.title = state.title
container.html(contents)
pjax.state = state
container.trigger('pjax:end', [null, options])
} else {
pjax(options)
}
// Force reflow/relayout before the browser tries to restore the
// scroll position.
container[0].offsetHeight
} else {
locationReplace(location.href)
}
}
initialPop = false
}
// Fallback version of main pjax function for browsers that don't
// support pushState.
//
// Returns nothing since it retriggers a hard form submission.
function fallbackPjax(options) {
var url = $.isFunction(options.url) ? options.url() : options.url,
method = options.type ? options.type.toUpperCase() : 'GET'
var form = $('<form>', {
method: method === 'GET' ? 'GET' : 'POST',
action: url,
style: 'display:none'
})
if (method !== 'GET' && method !== 'POST') {
form.append($('<input>', {
type: 'hidden',
name: '_method',
value: method.toLowerCase()
}))
}
var data = options.data
if (typeof data === 'string') {
$.each(data.split('&'), function(index, value) {
var pair = value.split('=')
form.append($('<input>', {type: 'hidden', name: pair[0], value: pair[1]}))
})
} else if (typeof data === 'object') {
for (key in data)
form.append($('<input>', {type: 'hidden', name: key, value: data[key]}))
}
$(document.body).append(form)
form.submit()
}
// Internal: Generate unique id for state object.
//
// Use a timestamp instead of a counter since ids should still be
// unique across page loads.
//
// Returns Number.
function uniqueId() {
return (new Date).getTime()
}
// Internal: Strips _pjax param from url
//
// url - String
//
// Returns String.
function stripPjaxParam(url) {
return url
.replace(/\?_pjax=[^&]+&?/, '?')
.replace(/_pjax=[^&]+&?/, '')
.replace(/[\?&]$/, '')
}
// Internal: Parse URL components and returns a Locationish object.
//
// url - String URL
//
// Returns HTMLAnchorElement that acts like Location.
function parseURL(url) {
var a = document.createElement('a')
a.href = url
return a
}
// Internal: Build options Object for arguments.
//
// For convenience the first parameter can be either the container or
// the options object.
//
// Examples
//
// optionsFor('#container')
// // => {container: '#container'}
//
// optionsFor('#container', {push: true})
// // => {container: '#container', push: true}
//
// optionsFor({container: '#container', push: true})
// // => {container: '#container', push: true}
//
// Returns options Object.
function optionsFor(container, options) {
// Both container and options
if ( container && options )
options.container = container
// First argument is options Object
else if ( $.isPlainObject(container) )
options = container
// Only container
else
options = {container: container}
// Find and validate container
if (options.container)
options.container = findContainerFor(options.container)
return options
}
// Internal: Find container element for a variety of inputs.
//
// Because we can't persist elements using the history API, we must be
// able to find a String selector that will consistently find the Element.
//
// container - A selector String, jQuery object, or DOM Element.
//
// Returns a jQuery object whose context is `document` and has a selector.
function findContainerFor(container) {
container = $(container)
if ( !container.length ) {
throw "no pjax container for " + container.selector
} else if ( container.selector !== '' && container.context === document ) {
return container
} else if ( container.attr('id') ) {
return $('#' + container.attr('id'))
} else {
throw "cant get selector for pjax container!"
}
}
// Internal: Filter and find all elements matching the selector.
//
// Where $.fn.find only matches descendants, findAll will test all the
// top level elements in the jQuery object as well.
//
// elems - jQuery object of Elements
// selector - String selector to match
//
// Returns a jQuery object.
function findAll(elems, selector) {
return elems.filter(selector).add(elems.find(selector));
}
function parseHTML(html) {
return $.parseHTML(html, document, true)
}
// Internal: Extracts container and metadata from response.
//
// 1. Extracts X-PJAX-URL header if set
// 2. Extracts inline <title> tags
// 3. Builds response Element and extracts fragment if set
//
// data - String response data
// xhr - XHR response
// options - pjax options Object
//
// Returns an Object with url, title, and contents keys.
function extractContainer(data, xhr, options) {
var obj = {}
// Prefer X-PJAX-URL header if it was set, otherwise fallback to
// using the original requested url.
obj.url = stripPjaxParam(xhr.getResponseHeader('X-PJAX-URL') || options.requestUrl)
// Attempt to parse response html into elements
if (/<html/i.test(data)) {
var $head = $(parseHTML(data.match(/<head[^>]*>([\s\S.]*)<\/head>/i)[0]))
var $body = $(parseHTML(data.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0]))
} else {
var $head = $body = $(parseHTML(data))
}
// If response data is empty, return fast
if ($body.length === 0)
return obj
// If there's a <title> tag in the header, use it as
// the page's title.
obj.title = findAll($head, 'title').last().text()
if (options.fragment) {
// If they specified a fragment, look for it in the response
// and pull it out.
if (options.fragment === 'body') {
var $fragment = $body
} else {
var $fragment = findAll($body, options.fragment).first()
}
if ($fragment.length) {
obj.contents = $fragment.contents()
// If there's no title, look for data-title and title attributes
// on the fragment
if (!obj.title)
obj.title = $fragment.attr('title') || $fragment.data('title')
}
} else if (!/<html/i.test(data)) {
obj.contents = $body
}
// Clean up any <title> tags
if (obj.contents) {
// Remove any parent title elements
obj.contents = obj.contents.not(function() { return $(this).is('title') })
// Then scrub any titles from their descendants
obj.contents.find('title').remove()
// Gather all script[src] elements
obj.scripts = findAll(obj.contents, 'script[src]').remove()
obj.contents = obj.contents.not(obj.scripts)
}
// Trim any whitespace off the title
if (obj.title) obj.title = $.trim(obj.title)
return obj
}
// Load an execute scripts using standard script request.
//
// Avoids jQuery's traditional $.getScript which does a XHR request and
// globalEval.
//
// scripts - jQuery object of script Elements
//
// Returns nothing.
function executeScriptTags(scripts) {
if (!scripts) return
var existingScripts = $('script[src]')
scripts.each(function() {
var src = this.src
var matchedScripts = existingScripts.filter(function() {
return this.src === src
})
if (matchedScripts.length) return
var script = document.createElement('script')
script.type = $(this).attr('type')
script.src = $(this).attr('src')
document.head.appendChild(script)
})
}
// Internal: History DOM caching class.
var cacheMapping = {}
var cacheForwardStack = []
var cacheBackStack = []
// Push previous state id and container contents into the history
// cache. Should be called in conjunction with `pushState` to save the
// previous container contents.
//
// id - State ID Number
// value - DOM Element to cache
//
// Returns nothing.
function cachePush(id, value) {
cacheMapping[id] = value
cacheBackStack.push(id)
// Remove all entires in forward history stack after pushing
// a new page.
while (cacheForwardStack.length)
delete cacheMapping[cacheForwardStack.shift()]
// Trim back history stack to max cache length.
while (cacheBackStack.length > pjax.defaults.maxCacheLength)
delete cacheMapping[cacheBackStack.shift()]
}
// Shifts cache from directional history cache. Should be
// called on `popstate` with the previous state id and container
// contents.
//
// direction - "forward" or "back" String
// id - State ID Number
// value - DOM Element to cache
//
// Returns nothing.
function cachePop(direction, id, value) {
var pushStack, popStack
cacheMapping[id] = value
if (direction === 'forward') {
pushStack = cacheBackStack
popStack = cacheForwardStack
} else {
pushStack = cacheForwardStack
popStack = cacheBackStack
}
pushStack.push(id)
if (id = popStack.pop())
delete cacheMapping[id]
}
// Public: Find version identifier for the initial page load.
//
// Returns String version or undefined.
function findVersion() {
return $('meta').filter(function() {
var name = $(this).attr('http-equiv')
return name && name.toUpperCase() === 'X-PJAX-VERSION'
}).attr('content')
}
// Install pjax functions on $.pjax to enable pushState behavior.
//
// Does nothing if already enabled.
//
// Examples
//
// $.pjax.enable()
//
// Returns nothing.
function enable() {
$.fn.pjax = fnPjax
$.pjax = pjax
$.pjax.enable = $.noop
$.pjax.disable = disable
$.pjax.click = handleClick
$.pjax.submit = handleSubmit
$.pjax.reload = pjaxReload
$.pjax.defaults = {
timeout: 650,
push: true,
replace: false,
type: 'GET',
dataType: 'html',
scrollTo: 0,
maxCacheLength: 20,
version: findVersion
}
$(window).on('popstate.pjax', onPjaxPopstate)
}
// Disable pushState behavior.
//
// This is the case when a browser doesn't support pushState. It is
// sometimes useful to disable pushState for debugging on a modern
// browser.
//
// Examples
//
// $.pjax.disable()
//
// Returns nothing.
function disable() {
$.fn.pjax = function() { return this }
$.pjax = fallbackPjax
$.pjax.enable = enable
$.pjax.disable = $.noop
$.pjax.click = $.noop
$.pjax.submit = $.noop
$.pjax.reload = function() { window.location.reload() }
$(window).off('popstate.pjax', onPjaxPopstate)
}
// Add the state property to jQuery's event object so we can use it in
// $(window).bind('popstate')
if ( $.inArray('state', $.event.props) < 0 )
$.event.props.push('state')
// Is pjax supported by this browser?
$.support.pjax =
window.history && window.history.pushState && window.history.replaceState &&
// pushState isn't reliable on iOS until 5.
!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/)
$.support.pjax ? enable() : disable()
})(jQuery);
| camelotceo/cdnjs | ajax/libs/jquery.pjax/1.7.1/jquery.pjax.js | JavaScript | mit | 22,533 |
/*!
* # Semantic UI 1.11.6 - Grid
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Standard
*******************************/
.ui.grid {
display: block;
text-align: left;
font-size: 0em;
padding: 0em;
}
.ui.grid:after,
.ui.grid > .row:after {
content: '';
display: block;
height: 0px;
clear: both;
visibility: hidden;
}
/*----------------------
Remove Gutters
-----------------------*/
.ui.grid {
margin-top: -1rem;
margin-bottom: -1rem;
margin-left: -1rem;
margin-right: -1rem;
}
.ui.relaxed.grid {
margin-left: -1.5rem;
margin-right: -1.5rem;
}
.ui[class*="very relaxed"].grid {
margin-left: -2.5rem;
margin-right: -2.5rem;
}
/* Collapse Margins on Consecutive Grids */
.ui.grid + .grid {
margin-top: 1rem;
}
/*-------------------
Columns
--------------------*/
/* Standard 16 column */
.ui.grid > .column:not(.row),
.ui.grid > .row > .column {
position: relative;
display: inline-block;
font-size: 1rem;
width: 6.25%;
padding-left: 1rem;
padding-right: 1rem;
vertical-align: top;
}
.ui.grid > * {
padding-left: 1rem;
padding-right: 1rem;
}
/*-------------------
Rows
--------------------*/
.ui.grid > .row {
position: relative;
display: block;
width: auto !important;
padding: 0rem;
font-size: 0rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
/*-------------------
Columns
--------------------*/
/* Vertical padding when no rows */
.ui.grid > .column:not(.row) {
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .row > .column {
margin-top: 0em;
margin-bottom: 0em;
}
/*-------------------
Content
--------------------*/
.ui.grid > .row > img,
.ui.grid > .row > .column > img {
max-width: 100%;
}
/*-------------------
Loose Coupling
--------------------*/
.ui.grid .row + .ui.divider {
margin: 1rem 1rem;
}
/* remove Border on last horizontal segment */
.ui.grid > .row > .column:last-child > .horizontal.segment,
.ui.grid > .column:last-child > .horizontal.segment {
box-shadow: none;
}
/*******************************
Variations
*******************************/
/*-----------------------
Page Grid
-------------------------*/
.ui.page.grid {
padding-left: 8%;
padding-right: 8%;
width: auto;
}
/* Collapse Margin */
.ui.grid > .ui.grid:first-child {
margin-top: 0em;
}
.ui.grid > .ui.grid:last-child {
margin-bottom: 0em;
}
@media only screen and (max-width: 767px) {
.ui.page.grid {
width: auto;
padding-left: 0em;
padding-right: 0em;
margin-left: 0em;
margin-right: 0em;
}
}
@media only screen and (min-width: 768px) {
.ui.page.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 4em;
padding-right: 4em;
}
}
@media only screen and (min-width: 992px) {
.ui.page.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 8%;
padding-right: 8%;
}
}
@media only screen and (min-width: 1400px) {
.ui.page.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 15%;
padding-right: 15%;
}
}
@media only screen and (min-width: 1920px) {
.ui.page.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 23%;
padding-right: 23%;
}
}
/*-------------------
Column Count
--------------------*/
/* Assume full width with one column */
.ui.grid > .column:only-child,
.ui.grid > .row > .column:only-child {
width: 100%;
}
/* Grid Based */
.ui[class*="one column"].grid > .row > .column,
.ui[class*="one column"].grid > .column {
width: 100%;
}
.ui[class*="two column"].grid > .row > .column,
.ui[class*="two column"].grid > .column {
width: 50%;
}
.ui[class*="three column"].grid > .row > .column,
.ui[class*="three column"].grid > .column {
width: 33.33333333%;
}
.ui[class*="four column"].grid > .row > .column,
.ui[class*="four column"].grid > .column {
width: 25%;
}
.ui[class*="five column"].grid > .row > .column,
.ui[class*="five column"].grid > .column {
width: 20%;
}
.ui[class*="six column"].grid > .row > .column,
.ui[class*="six column"].grid > .column {
width: 16.66666667%;
}
.ui[class*="seven column"].grid > .row > .column,
.ui[class*="seven column"].grid > .column {
width: 14.28571429%;
}
.ui[class*="eight column"].grid > .row > .column,
.ui[class*="eight column"].grid > .column {
width: 12.5%;
}
.ui[class*="nine column"].grid > .row > .column,
.ui[class*="nine column"].grid > .column {
width: 11.11111111%;
}
.ui[class*="ten column"].grid > .row > .column,
.ui[class*="ten column"].grid > .column {
width: 10%;
}
.ui[class*="eleven column"].grid > .row > .column,
.ui[class*="eleven column"].grid > .column {
width: 9.09090909%;
}
.ui[class*="twelve column"].grid > .row > .column,
.ui[class*="twelve column"].grid > .column {
width: 8.33333333%;
}
.ui[class*="thirteen column"].grid > .row > .column,
.ui[class*="thirteen column"].grid > .column {
width: 7.69230769%;
}
.ui[class*="fourteen column"].grid > .row > .column,
.ui[class*="fourteen column"].grid > .column {
width: 7.14285714%;
}
.ui[class*="fifteen column"].grid > .row > .column,
.ui[class*="fifteen column"].grid > .column {
width: 6.66666667%;
}
.ui[class*="sixteen column"].grid > .row > .column,
.ui[class*="sixteen column"].grid > .column {
width: 6.25%;
}
/* Row Based Overrides */
.ui.grid > [class*="one column"].row > .column {
width: 100% !important;
}
.ui.grid > [class*="two column"].row > .column {
width: 50% !important;
}
.ui.grid > [class*="three column"].row > .column {
width: 33.33333333% !important;
}
.ui.grid > [class*="four column"].row > .column {
width: 25% !important;
}
.ui.grid > [class*="five column"].row > .column {
width: 20% !important;
}
.ui.grid > [class*="six column"].row > .column {
width: 16.66666667% !important;
}
.ui.grid > [class*="seven column"].row > .column {
width: 14.28571429% !important;
}
.ui.grid > [class*="eight column"].row > .column {
width: 12.5% !important;
}
.ui.grid > [class*="nine column"].row > .column {
width: 11.11111111% !important;
}
.ui.grid > [class*="ten column"].row > .column {
width: 10% !important;
}
.ui.grid > [class*="eleven column"].row > .column {
width: 9.09090909% !important;
}
.ui.grid > [class*="twelve column"].row > .column {
width: 8.33333333% !important;
}
.ui.grid > [class*="thirteen column"].row > .column {
width: 7.69230769% !important;
}
.ui.grid > [class*="fourteen column"].row > .column {
width: 7.14285714% !important;
}
.ui.grid > [class*="fifteen column"].row > .column {
width: 6.66666667% !important;
}
.ui.grid > [class*="sixteen column"].row > .column {
width: 6.25% !important;
}
/*-------------------
Column Width
--------------------*/
/* Sizing Combinations */
.ui.grid > .row > [class*="one wide"].column,
.ui.grid > .column.row > [class*="one wide"].column,
.ui.grid > [class*="one wide"].column,
.ui.column.grid > [class*="one wide"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide"].column,
.ui.grid > .column.row > [class*="two wide"].column,
.ui.grid > [class*="two wide"].column,
.ui.column.grid > [class*="two wide"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide"].column,
.ui.grid > .column.row > [class*="three wide"].column,
.ui.grid > [class*="three wide"].column,
.ui.column.grid > [class*="three wide"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide"].column,
.ui.grid > .column.row > [class*="four wide"].column,
.ui.grid > [class*="four wide"].column,
.ui.column.grid > [class*="four wide"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide"].column,
.ui.grid > .column.row > [class*="five wide"].column,
.ui.grid > [class*="five wide"].column,
.ui.column.grid > [class*="five wide"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide"].column,
.ui.grid > .column.row > [class*="six wide"].column,
.ui.grid > [class*="six wide"].column,
.ui.column.grid > [class*="six wide"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide"].column,
.ui.grid > .column.row > [class*="seven wide"].column,
.ui.grid > [class*="seven wide"].column,
.ui.column.grid > [class*="seven wide"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide"].column,
.ui.grid > .column.row > [class*="eight wide"].column,
.ui.grid > [class*="eight wide"].column,
.ui.column.grid > [class*="eight wide"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide"].column,
.ui.grid > .column.row > [class*="nine wide"].column,
.ui.grid > [class*="nine wide"].column,
.ui.column.grid > [class*="nine wide"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide"].column,
.ui.grid > .column.row > [class*="ten wide"].column,
.ui.grid > [class*="ten wide"].column,
.ui.column.grid > [class*="ten wide"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide"].column,
.ui.grid > .column.row > [class*="eleven wide"].column,
.ui.grid > [class*="eleven wide"].column,
.ui.column.grid > [class*="eleven wide"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide"].column,
.ui.grid > .column.row > [class*="twelve wide"].column,
.ui.grid > [class*="twelve wide"].column,
.ui.column.grid > [class*="twelve wide"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide"].column,
.ui.grid > .column.row > [class*="thirteen wide"].column,
.ui.grid > [class*="thirteen wide"].column,
.ui.column.grid > [class*="thirteen wide"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide"].column,
.ui.grid > .column.row > [class*="fourteen wide"].column,
.ui.grid > [class*="fourteen wide"].column,
.ui.column.grid > [class*="fourteen wide"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide"].column,
.ui.grid > .column.row > [class*="fifteen wide"].column,
.ui.grid > [class*="fifteen wide"].column,
.ui.column.grid > [class*="fifteen wide"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide"].column,
.ui.grid > .column.row > [class*="sixteen wide"].column,
.ui.grid > [class*="sixteen wide"].column,
.ui.column.grid > [class*="sixteen wide"].column {
width: 100% !important;
}
/*----------------------
Width per Device
-----------------------*/
/* Mobile Sizing Combinations */
@media only screen and (min-width: 320px) and (max-width: 767px) {
.ui.grid > .row > [class*="one wide mobile"].column,
.ui.grid > .column.row > [class*="one wide mobile"].column,
.ui.grid > [class*="one wide mobile"].column,
.ui.column.grid > [class*="one wide mobile"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide mobile"].column,
.ui.grid > .column.row > [class*="two wide mobile"].column,
.ui.grid > [class*="two wide mobile"].column,
.ui.column.grid > [class*="two wide mobile"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide mobile"].column,
.ui.grid > .column.row > [class*="three wide mobile"].column,
.ui.grid > [class*="three wide mobile"].column,
.ui.column.grid > [class*="three wide mobile"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide mobile"].column,
.ui.grid > .column.row > [class*="four wide mobile"].column,
.ui.grid > [class*="four wide mobile"].column,
.ui.column.grid > [class*="four wide mobile"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide mobile"].column,
.ui.grid > .column.row > [class*="five wide mobile"].column,
.ui.grid > [class*="five wide mobile"].column,
.ui.column.grid > [class*="five wide mobile"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide mobile"].column,
.ui.grid > .column.row > [class*="six wide mobile"].column,
.ui.grid > [class*="six wide mobile"].column,
.ui.column.grid > [class*="six wide mobile"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide mobile"].column,
.ui.grid > .column.row > [class*="seven wide mobile"].column,
.ui.grid > [class*="seven wide mobile"].column,
.ui.column.grid > [class*="seven wide mobile"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide mobile"].column,
.ui.grid > .column.row > [class*="eight wide mobile"].column,
.ui.grid > [class*="eight wide mobile"].column,
.ui.column.grid > [class*="eight wide mobile"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide mobile"].column,
.ui.grid > .column.row > [class*="nine wide mobile"].column,
.ui.grid > [class*="nine wide mobile"].column,
.ui.column.grid > [class*="nine wide mobile"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide mobile"].column,
.ui.grid > .column.row > [class*="ten wide mobile"].column,
.ui.grid > [class*="ten wide mobile"].column,
.ui.column.grid > [class*="ten wide mobile"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide mobile"].column,
.ui.grid > .column.row > [class*="eleven wide mobile"].column,
.ui.grid > [class*="eleven wide mobile"].column,
.ui.column.grid > [class*="eleven wide mobile"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide mobile"].column,
.ui.grid > .column.row > [class*="twelve wide mobile"].column,
.ui.grid > [class*="twelve wide mobile"].column,
.ui.column.grid > [class*="twelve wide mobile"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide mobile"].column,
.ui.grid > .column.row > [class*="thirteen wide mobile"].column,
.ui.grid > [class*="thirteen wide mobile"].column,
.ui.column.grid > [class*="thirteen wide mobile"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide mobile"].column,
.ui.grid > .column.row > [class*="fourteen wide mobile"].column,
.ui.grid > [class*="fourteen wide mobile"].column,
.ui.column.grid > [class*="fourteen wide mobile"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide mobile"].column,
.ui.grid > .column.row > [class*="fifteen wide mobile"].column,
.ui.grid > [class*="fifteen wide mobile"].column,
.ui.column.grid > [class*="fifteen wide mobile"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide mobile"].column,
.ui.grid > .column.row > [class*="sixteen wide mobile"].column,
.ui.grid > [class*="sixteen wide mobile"].column,
.ui.column.grid > [class*="sixteen wide mobile"].column {
width: 100% !important;
}
}
/* Tablet Sizing Combinations */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui.grid > .row > [class*="one wide tablet"].column,
.ui.grid > .column.row > [class*="one wide tablet"].column,
.ui.grid > [class*="one wide tablet"].column,
.ui.column.grid > [class*="one wide tablet"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide tablet"].column,
.ui.grid > .column.row > [class*="two wide tablet"].column,
.ui.grid > [class*="two wide tablet"].column,
.ui.column.grid > [class*="two wide tablet"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide tablet"].column,
.ui.grid > .column.row > [class*="three wide tablet"].column,
.ui.grid > [class*="three wide tablet"].column,
.ui.column.grid > [class*="three wide tablet"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide tablet"].column,
.ui.grid > .column.row > [class*="four wide tablet"].column,
.ui.grid > [class*="four wide tablet"].column,
.ui.column.grid > [class*="four wide tablet"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide tablet"].column,
.ui.grid > .column.row > [class*="five wide tablet"].column,
.ui.grid > [class*="five wide tablet"].column,
.ui.column.grid > [class*="five wide tablet"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide tablet"].column,
.ui.grid > .column.row > [class*="six wide tablet"].column,
.ui.grid > [class*="six wide tablet"].column,
.ui.column.grid > [class*="six wide tablet"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide tablet"].column,
.ui.grid > .column.row > [class*="seven wide tablet"].column,
.ui.grid > [class*="seven wide tablet"].column,
.ui.column.grid > [class*="seven wide tablet"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide tablet"].column,
.ui.grid > .column.row > [class*="eight wide tablet"].column,
.ui.grid > [class*="eight wide tablet"].column,
.ui.column.grid > [class*="eight wide tablet"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide tablet"].column,
.ui.grid > .column.row > [class*="nine wide tablet"].column,
.ui.grid > [class*="nine wide tablet"].column,
.ui.column.grid > [class*="nine wide tablet"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide tablet"].column,
.ui.grid > .column.row > [class*="ten wide tablet"].column,
.ui.grid > [class*="ten wide tablet"].column,
.ui.column.grid > [class*="ten wide tablet"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide tablet"].column,
.ui.grid > .column.row > [class*="eleven wide tablet"].column,
.ui.grid > [class*="eleven wide tablet"].column,
.ui.column.grid > [class*="eleven wide tablet"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide tablet"].column,
.ui.grid > .column.row > [class*="twelve wide tablet"].column,
.ui.grid > [class*="twelve wide tablet"].column,
.ui.column.grid > [class*="twelve wide tablet"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide tablet"].column,
.ui.grid > .column.row > [class*="thirteen wide tablet"].column,
.ui.grid > [class*="thirteen wide tablet"].column,
.ui.column.grid > [class*="thirteen wide tablet"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide tablet"].column,
.ui.grid > .column.row > [class*="fourteen wide tablet"].column,
.ui.grid > [class*="fourteen wide tablet"].column,
.ui.column.grid > [class*="fourteen wide tablet"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide tablet"].column,
.ui.grid > .column.row > [class*="fifteen wide tablet"].column,
.ui.grid > [class*="fifteen wide tablet"].column,
.ui.column.grid > [class*="fifteen wide tablet"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide tablet"].column,
.ui.grid > .column.row > [class*="sixteen wide tablet"].column,
.ui.grid > [class*="sixteen wide tablet"].column,
.ui.column.grid > [class*="sixteen wide tablet"].column {
width: 100% !important;
}
}
/* Computer/Desktop Sizing Combinations */
@media only screen and (min-width: 992px) {
.ui.grid > .row > [class*="one wide computer"].column,
.ui.grid > .column.row > [class*="one wide computer"].column,
.ui.grid > [class*="one wide computer"].column,
.ui.column.grid > [class*="one wide computer"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide computer"].column,
.ui.grid > .column.row > [class*="two wide computer"].column,
.ui.grid > [class*="two wide computer"].column,
.ui.column.grid > [class*="two wide computer"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide computer"].column,
.ui.grid > .column.row > [class*="three wide computer"].column,
.ui.grid > [class*="three wide computer"].column,
.ui.column.grid > [class*="three wide computer"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide computer"].column,
.ui.grid > .column.row > [class*="four wide computer"].column,
.ui.grid > [class*="four wide computer"].column,
.ui.column.grid > [class*="four wide computer"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide computer"].column,
.ui.grid > .column.row > [class*="five wide computer"].column,
.ui.grid > [class*="five wide computer"].column,
.ui.column.grid > [class*="five wide computer"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide computer"].column,
.ui.grid > .column.row > [class*="six wide computer"].column,
.ui.grid > [class*="six wide computer"].column,
.ui.column.grid > [class*="six wide computer"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide computer"].column,
.ui.grid > .column.row > [class*="seven wide computer"].column,
.ui.grid > [class*="seven wide computer"].column,
.ui.column.grid > [class*="seven wide computer"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide computer"].column,
.ui.grid > .column.row > [class*="eight wide computer"].column,
.ui.grid > [class*="eight wide computer"].column,
.ui.column.grid > [class*="eight wide computer"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide computer"].column,
.ui.grid > .column.row > [class*="nine wide computer"].column,
.ui.grid > [class*="nine wide computer"].column,
.ui.column.grid > [class*="nine wide computer"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide computer"].column,
.ui.grid > .column.row > [class*="ten wide computer"].column,
.ui.grid > [class*="ten wide computer"].column,
.ui.column.grid > [class*="ten wide computer"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide computer"].column,
.ui.grid > .column.row > [class*="eleven wide computer"].column,
.ui.grid > [class*="eleven wide computer"].column,
.ui.column.grid > [class*="eleven wide computer"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide computer"].column,
.ui.grid > .column.row > [class*="twelve wide computer"].column,
.ui.grid > [class*="twelve wide computer"].column,
.ui.column.grid > [class*="twelve wide computer"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide computer"].column,
.ui.grid > .column.row > [class*="thirteen wide computer"].column,
.ui.grid > [class*="thirteen wide computer"].column,
.ui.column.grid > [class*="thirteen wide computer"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide computer"].column,
.ui.grid > .column.row > [class*="fourteen wide computer"].column,
.ui.grid > [class*="fourteen wide computer"].column,
.ui.column.grid > [class*="fourteen wide computer"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide computer"].column,
.ui.grid > .column.row > [class*="fifteen wide computer"].column,
.ui.grid > [class*="fifteen wide computer"].column,
.ui.column.grid > [class*="fifteen wide computer"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide computer"].column,
.ui.grid > .column.row > [class*="sixteen wide computer"].column,
.ui.grid > [class*="sixteen wide computer"].column,
.ui.column.grid > [class*="sixteen wide computer"].column {
width: 100% !important;
}
}
/* Large Monitor Sizing Combinations */
@media only screen and (min-width: 1400px) and (max-width: 1919px) {
.ui.grid > .row > [class*="one wide large screen"].column,
.ui.grid > .column.row > [class*="one wide large screen"].column,
.ui.grid > [class*="one wide large screen"].column,
.ui.column.grid > [class*="one wide large screen"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide large screen"].column,
.ui.grid > .column.row > [class*="two wide large screen"].column,
.ui.grid > [class*="two wide large screen"].column,
.ui.column.grid > [class*="two wide large screen"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide large screen"].column,
.ui.grid > .column.row > [class*="three wide large screen"].column,
.ui.grid > [class*="three wide large screen"].column,
.ui.column.grid > [class*="three wide large screen"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide large screen"].column,
.ui.grid > .column.row > [class*="four wide large screen"].column,
.ui.grid > [class*="four wide large screen"].column,
.ui.column.grid > [class*="four wide large screen"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide large screen"].column,
.ui.grid > .column.row > [class*="five wide large screen"].column,
.ui.grid > [class*="five wide large screen"].column,
.ui.column.grid > [class*="five wide large screen"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide large screen"].column,
.ui.grid > .column.row > [class*="six wide large screen"].column,
.ui.grid > [class*="six wide large screen"].column,
.ui.column.grid > [class*="six wide large screen"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide large screen"].column,
.ui.grid > .column.row > [class*="seven wide large screen"].column,
.ui.grid > [class*="seven wide large screen"].column,
.ui.column.grid > [class*="seven wide large screen"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide large screen"].column,
.ui.grid > .column.row > [class*="eight wide large screen"].column,
.ui.grid > [class*="eight wide large screen"].column,
.ui.column.grid > [class*="eight wide large screen"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide large screen"].column,
.ui.grid > .column.row > [class*="nine wide large screen"].column,
.ui.grid > [class*="nine wide large screen"].column,
.ui.column.grid > [class*="nine wide large screen"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide large screen"].column,
.ui.grid > .column.row > [class*="ten wide large screen"].column,
.ui.grid > [class*="ten wide large screen"].column,
.ui.column.grid > [class*="ten wide large screen"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide large screen"].column,
.ui.grid > .column.row > [class*="eleven wide large screen"].column,
.ui.grid > [class*="eleven wide large screen"].column,
.ui.column.grid > [class*="eleven wide large screen"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide large screen"].column,
.ui.grid > .column.row > [class*="twelve wide large screen"].column,
.ui.grid > [class*="twelve wide large screen"].column,
.ui.column.grid > [class*="twelve wide large screen"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide large screen"].column,
.ui.grid > .column.row > [class*="thirteen wide large screen"].column,
.ui.grid > [class*="thirteen wide large screen"].column,
.ui.column.grid > [class*="thirteen wide large screen"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide large screen"].column,
.ui.grid > .column.row > [class*="fourteen wide large screen"].column,
.ui.grid > [class*="fourteen wide large screen"].column,
.ui.column.grid > [class*="fourteen wide large screen"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide large screen"].column,
.ui.grid > .column.row > [class*="fifteen wide large screen"].column,
.ui.grid > [class*="fifteen wide large screen"].column,
.ui.column.grid > [class*="fifteen wide large screen"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide large screen"].column,
.ui.grid > .column.row > [class*="sixteen wide large screen"].column,
.ui.grid > [class*="sixteen wide large screen"].column,
.ui.column.grid > [class*="sixteen wide large screen"].column {
width: 100% !important;
}
}
/* Widescreen Sizing Combinations */
@media only screen and (min-width: 1920px) {
.ui.grid > .row > [class*="one wide widescreen"].column,
.ui.grid > .column.row > [class*="one wide widescreen"].column,
.ui.grid > [class*="one wide widescreen"].column,
.ui.column.grid > [class*="one wide widescreen"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide widescreen"].column,
.ui.grid > .column.row > [class*="two wide widescreen"].column,
.ui.grid > [class*="two wide widescreen"].column,
.ui.column.grid > [class*="two wide widescreen"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide widescreen"].column,
.ui.grid > .column.row > [class*="three wide widescreen"].column,
.ui.grid > [class*="three wide widescreen"].column,
.ui.column.grid > [class*="three wide widescreen"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide widescreen"].column,
.ui.grid > .column.row > [class*="four wide widescreen"].column,
.ui.grid > [class*="four wide widescreen"].column,
.ui.column.grid > [class*="four wide widescreen"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide widescreen"].column,
.ui.grid > .column.row > [class*="five wide widescreen"].column,
.ui.grid > [class*="five wide widescreen"].column,
.ui.column.grid > [class*="five wide widescreen"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide widescreen"].column,
.ui.grid > .column.row > [class*="six wide widescreen"].column,
.ui.grid > [class*="six wide widescreen"].column,
.ui.column.grid > [class*="six wide widescreen"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide widescreen"].column,
.ui.grid > .column.row > [class*="seven wide widescreen"].column,
.ui.grid > [class*="seven wide widescreen"].column,
.ui.column.grid > [class*="seven wide widescreen"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide widescreen"].column,
.ui.grid > .column.row > [class*="eight wide widescreen"].column,
.ui.grid > [class*="eight wide widescreen"].column,
.ui.column.grid > [class*="eight wide widescreen"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide widescreen"].column,
.ui.grid > .column.row > [class*="nine wide widescreen"].column,
.ui.grid > [class*="nine wide widescreen"].column,
.ui.column.grid > [class*="nine wide widescreen"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide widescreen"].column,
.ui.grid > .column.row > [class*="ten wide widescreen"].column,
.ui.grid > [class*="ten wide widescreen"].column,
.ui.column.grid > [class*="ten wide widescreen"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide widescreen"].column,
.ui.grid > .column.row > [class*="eleven wide widescreen"].column,
.ui.grid > [class*="eleven wide widescreen"].column,
.ui.column.grid > [class*="eleven wide widescreen"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide widescreen"].column,
.ui.grid > .column.row > [class*="twelve wide widescreen"].column,
.ui.grid > [class*="twelve wide widescreen"].column,
.ui.column.grid > [class*="twelve wide widescreen"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide widescreen"].column,
.ui.grid > .column.row > [class*="thirteen wide widescreen"].column,
.ui.grid > [class*="thirteen wide widescreen"].column,
.ui.column.grid > [class*="thirteen wide widescreen"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide widescreen"].column,
.ui.grid > .column.row > [class*="fourteen wide widescreen"].column,
.ui.grid > [class*="fourteen wide widescreen"].column,
.ui.column.grid > [class*="fourteen wide widescreen"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide widescreen"].column,
.ui.grid > .column.row > [class*="fifteen wide widescreen"].column,
.ui.grid > [class*="fifteen wide widescreen"].column,
.ui.column.grid > [class*="fifteen wide widescreen"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide widescreen"].column,
.ui.grid > .column.row > [class*="sixteen wide widescreen"].column,
.ui.grid > [class*="sixteen wide widescreen"].column,
.ui.column.grid > [class*="sixteen wide widescreen"].column {
width: 100% !important;
}
}
/*----------------------
Centered
-----------------------*/
.ui.centered.grid,
.ui.centered.grid > .row,
.ui.grid > .centered.row {
text-align: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.ui.centered.grid > .column:not(.aligned):not(.row),
.ui.centered.grid > .row > .column:not(.aligned),
.ui.grid .centered.row > .column:not(.aligned) {
text-align: left;
}
.ui.grid > .centered.column,
.ui.grid > .row > .centered.column {
display: block;
margin-left: auto;
margin-right: auto;
}
/*----------------------
Relaxed
-----------------------*/
.ui.relaxed.grid > .column:not(.row),
.ui.relaxed.grid > .row > .column,
.ui.grid > .relaxed.row > .column {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.ui[class*="very relaxed"].grid > .column:not(.row),
.ui[class*="very relaxed"].grid > .row > .column,
.ui.grid > [class*="very relaxed"].row > .column {
padding-left: 2.5rem;
padding-right: 2.5rem;
}
/* Coupling with UI Divider */
.ui.relaxed.grid .row + .ui.divider,
.ui.grid .relaxed.row + .ui.divider {
margin-left: 1.5rem;
margin-right: 1.5rem;
}
.ui[class*="very relaxed"].grid .row + .ui.divider,
.ui.grid [class*="very relaxed"].row + .ui.divider {
margin-left: 2.5rem;
margin-right: 2.5rem;
}
/*----------------------
Padded
-----------------------*/
.ui.padded.grid:not(.vertically):not(.horizontally) {
margin: 0em !important;
}
[class*="horizontally padded"].ui.grid {
margin-left: 0em !important;
margin-right: 0em !important;
}
[class*="vertically padded"].ui.grid {
margin-top: 0em !important;
margin-bottom: 0em !important;
}
/*----------------------
"Floated"
-----------------------*/
.ui.grid [class*="left floated"].column {
float: left;
}
.ui.grid [class*="right floated"].column {
float: right;
}
/*----------------------
Divided
-----------------------*/
.ui.divided.grid:not([class*="vertically divided"]) > .column:not(.row),
.ui.divided.grid:not([class*="vertically divided"]) > .row > .column {
box-shadow: -1px 0px 0px 0px rgba(39, 41, 43, 0.15);
}
/* Swap from padding to margin on columns to have dividers align */
.ui[class*="vertically divided"].grid > .column:not(.row),
.ui[class*="vertically divided"].grid > .row > .column {
margin-top: 1rem;
margin-bottom: 1rem;
padding-top: 0rem;
padding-bottom: 0rem;
}
.ui[class*="vertically divided"].grid > .row {
margin-top: 0em;
margin-bottom: 0em;
padding-top: 0em;
padding-bottom: 0em;
}
/* No divider on first column on row */
.ui.divided.grid:not([class*="vertically divided"]) > .column:first-child,
.ui.divided.grid:not([class*="vertically divided"]) > .row > .column:first-child {
box-shadow: none;
}
/* Divided Row */
.ui.grid > .divided.row > .column {
box-shadow: -1px 0px 0px 0px rgba(39, 41, 43, 0.15);
}
.ui.grid > .divided.row > .column:first-child {
box-shadow: none;
}
/* Vertically Divided */
.ui[class*="vertically divided"].grid > .row {
position: relative;
}
.ui[class*="vertically divided"].grid > .row:before {
position: absolute;
content: "";
top: 0em;
left: 0px;
width: -webkit-calc(100% - 2rem );
width: calc(100% - 2rem );
height: 1px;
margin: 0% 1rem;
box-shadow: 0px -1px 0px 0px rgba(39, 41, 43, 0.15);
}
/* Padded Horizontally Divided */
[class*="horizontally padded"].ui.divided.grid,
.ui.padded.divided.grid:not(.vertically):not(.horizontally) {
width: 100%;
}
/* First Row Vertically Divided */
.ui[class*="vertically divided"].grid > .row:first-child:before {
box-shadow: none;
}
/* Inverted Divided */
.ui.inverted.divided.grid:not([class*="vertically divided"]) > .column:not(.row),
.ui.inverted.divided.grid:not([class*="vertically divided"]) > .row > .column {
box-shadow: -1px 0px 0px 0px rgba(255, 255, 255, 0.2);
}
.ui.inverted.divided.grid:not([class*="vertically divided"]) > .column:not(.row):first-child,
.ui.inverted.divided.grid:not([class*="vertically divided"]) > .row > .column:first-child {
box-shadow: none;
}
.ui.inverted[class*="vertically divided"].grid > .row:before {
box-shadow: 0px -1px 0px 0px rgba(255, 255, 255, 0.2);
}
/* Relaxed */
.ui.relaxed[class*="vertically divided"].grid > .row:before {
margin-left: 1.5rem;
margin-right: 1.5rem;
width: -webkit-calc(100% - 3rem );
width: calc(100% - 3rem );
}
.ui[class*="very relaxed"][class*="vertically divided"].grid > .row:before {
margin-left: 5rem;
margin-right: 5rem;
width: -webkit-calc(100% - 5rem );
width: calc(100% - 5rem );
}
/*----------------------
Celled
-----------------------*/
.ui.celled.grid {
display: table;
table-layout: fixed;
width: 100%;
margin: 1em 0em;
box-shadow: 0px 0px 0px 1px #d4d4d5;
}
.ui.celled.grid > .row,
.ui.celled.grid > .column.row,
.ui.celled.grid > .column.row:first-child {
display: table;
table-layout: fixed;
width: 100% !important;
margin: 0em;
padding: 0em;
box-shadow: 0px -1px 0px 0px #d4d4d5;
}
.ui.celled.grid > .column:not(.row),
.ui.celled.grid > .row > .column {
display: table-cell;
box-shadow: -1px 0px 0px 0px #d4d4d5;
}
.ui.celled.grid > .column:first-child,
.ui.celled.grid > .row > .column:first-child {
box-shadow: none;
}
.ui.celled.page.grid {
box-shadow: none;
}
.ui.celled.grid > .column:not(.row),
.ui.celled.grid > .row > .column {
padding: 0.75em;
}
.ui.relaxed.celled.grid > .column:not(.row),
.ui.relaxed.celled.grid > .row > .column {
padding: 1em;
}
.ui[class*="very relaxed"].celled.grid > .column:not(.row),
.ui[class*="very relaxed"].celled.grid > .row > .column {
padding: 2em;
}
/* Internally Celled */
.ui[class*="internally celled"].grid {
box-shadow: none;
}
.ui[class*="internally celled"].grid > .row:first-child {
box-shadow: none;
}
.ui[class*="internally celled"].grid > .row > .column:first-child {
box-shadow: none;
}
/*----------------------
Horizontally Centered
-----------------------*/
/* Left Aligned */
.ui[class*="left aligned"].grid,
.ui[class*="left aligned"].grid > .row > .column,
.ui[class*="left aligned"].grid > .column,
.ui.grid [class*="left aligned"].column,
.ui.grid > [class*="left aligned"].row > .column {
text-align: left;
-webkit-box-align: start !important;
-webkit-align-items: flex-start !important;
-ms-flex-align: start !important;
align-items: flex-start !important;
}
.ui.grid [class*="left aligned"].column {
text-align: left !important;
}
/* Center Aligned */
.ui[class*="center aligned"].grid,
.ui[class*="center aligned"].grid > .row > .column,
.ui[class*="center aligned"].grid > .column,
.ui.grid > [class*="center aligned"].row > .column {
text-align: center;
-webkit-box-align: center !important;
-webkit-align-items: center !important;
-ms-flex-align: center !important;
align-items: center !important;
}
.ui.grid [class*="center aligned"].column {
text-align: center !important;
}
/* Right Aligned */
.ui[class*="right aligned"].grid,
.ui[class*="right aligned"].grid > .row > .column,
.ui[class*="right aligned"].grid > .column,
.ui.grid > [class*="right aligned"].row > .column {
text-align: right;
-webkit-box-align: end !important;
-webkit-align-items: flex-end !important;
-ms-flex-align: end !important;
align-items: flex-end !important;
}
.ui.grid [class*="right aligned"].column {
text-align: right !important;
}
/* Justified */
.ui.justified.grid,
.ui.justified.grid > .row > .column,
.ui.justified.grid > .column,
.ui.grid .justified.column,
.ui.grid > .justified.row > .column {
text-align: justify;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
.ui.grid .justified.column {
text-align: justify !important;
-webkit-hyphens: auto !important;
-moz-hyphens: auto !important;
-ms-hyphens: auto !important;
hyphens: auto !important;
}
/*----------------------
Vertically Aligned
-----------------------*/
/* Top Aligned */
.ui[class*="top aligned"].grid,
.ui[class*="top aligned"].grid > .row > .column,
.ui[class*="top aligned"].grid > .column,
.ui.grid [class*="top aligned"].column,
.ui.grid > [class*="top aligned"].row > .column {
vertical-align: top;
-webkit-box-pack: start !important;
-webkit-justify-content: flex-start !important;
-ms-flex-pack: start !important;
justify-content: flex-start !important;
}
.ui.grid [class*="top aligned"].column {
vertical-align: top !important;
-webkit-box-pack: start !important;
-webkit-justify-content: flex-start !important;
-ms-flex-pack: start !important;
justify-content: flex-start !important;
}
.ui.stretched.grid > .row > .column,
.ui.stretched.grid > .column:not(.row),
.ui.grid .stretched.column,
.ui.grid > .stretched.row > .column {
display: -webkit-box !important;
display: -webkit-flex !important;
display: -ms-flexbox !important;
display: flex !important;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.ui.stretched.grid > .row > .column > *,
.ui.stretched.grid > .column > *,
.ui.grid .stretched.column > *,
.ui.grid > .stretched.row > .column > * {
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
/* Middle Aligned */
.ui[class*="middle aligned"].grid,
.ui[class*="middle aligned"].grid > .row > .column,
.ui[class*="middle aligned"].grid > .column,
.ui.grid > [class*="middle aligned"].row > .column {
vertical-align: middle;
-webkit-box-pack: center !important;
-webkit-justify-content: center !important;
-ms-flex-pack: center !important;
justify-content: center !important;
}
.ui.grid [class*="middle aligned"].column {
vertical-align: middle !important;
-webkit-box-pack: center !important;
-webkit-justify-content: center !important;
-ms-flex-pack: center !important;
justify-content: center !important;
}
/* Bottom Aligned */
.ui[class*="bottom aligned"].grid,
.ui[class*="bottom aligned"].grid > .row > .column,
.ui[class*="bottom aligned"].grid > .column,
.ui.grid > [class*="bottom aligned"].row > .column {
vertical-align: bottom;
-webkit-box-pack: end !important;
-webkit-justify-content: flex-end !important;
-ms-flex-pack: end !important;
justify-content: flex-end !important;
}
.ui.grid [class*="bottom aligned"].column {
-webkit-box-pack: end !important;
-webkit-justify-content: flex-end !important;
-ms-flex-pack: end !important;
justify-content: flex-end !important;
vertical-align: bottom !important;
}
/*----------------------
Colored
-----------------------*/
.ui.grid > .white.row,
.ui.grid > .row > .white.column {
background-color: #ffffff !important;
color: rgba(0, 0, 0, 0.8);
}
.ui.grid > .row > .white.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .black.row,
.ui.grid > .row > .black.column {
background-color: #1b1c1d !important;
color: #ffffff;
}
.ui.grid > .row > .black.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .blue.row,
.ui.grid > .row > .blue.column {
background-color: #3b83c0 !important;
color: #ffffff;
}
.ui.grid > .row > .blue.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .green.row,
.ui.grid > .row > .green.column {
background-color: #5bbd72 !important;
color: #ffffff;
}
.ui.grid > .row > .green.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .orange.row,
.ui.grid > .row > .orange.column {
background-color: #e07b53 !important;
color: #ffffff;
}
.ui.grid > .row > .orange.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .pink.row,
.ui.grid .pink.column {
background-color: #d9499a !important;
color: #ffffff;
}
.ui.grid > .row > .pink.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .purple.row,
.ui.grid > .row > .purple.column {
background-color: #564f8a !important;
color: #ffffff;
}
.ui.grid > .row > .purple.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .red.row,
.ui.grid > .row > .red.column {
background-color: #d95c5c !important;
color: #ffffff;
}
.ui.grid > .row > .red.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .teal.row,
.ui.grid > .row > .teal.column {
background-color: #00b5ad !important;
color: #ffffff;
}
.ui.grid > .row > .teal.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .yellow.row,
.ui.grid > .row > .yellow.column {
background-color: #f2c61f !important;
color: #ffffff;
}
.ui.grid > .row > .yellow.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
/*----------------------
Equal Width
-----------------------*/
.ui[class*="equal width"].grid {
display: table;
table-layout: fixed;
}
.ui[class*="equal width"].grid > .row,
.ui.grid > [class*="equal width"].row {
display: table;
table-layout: fixed;
width: 100% !important;
}
.ui[class*="equal width"].grid > .column:not(.row),
.ui[class*="equal width"].grid > .row > .column,
.ui.grid > [class*="equal width"].row > .column {
display: table-cell;
}
/* Flexbox (Experimental / Overrides Where Supported) */
.ui[class*="equal width"].grid,
.ui[class*="equal width"].grid > .row,
.ui.grid > [class*="equal width"].row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.ui[class*="equal width"].grid > .column:not(.row),
.ui[class*="equal width"].grid > .row > .column,
.ui.grid > [class*="equal width"].row > .column {
display: block;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
/*----------------------
Equal Height Columns
-----------------------*/
.ui[class*="equal height"].grid {
display: table;
table-layout: fixed;
}
.ui[class*="equal height"].grid > .row,
.ui.grid > [class*="equal height"].row {
display: table;
table-layout: fixed;
width: 100% !important;
}
.ui[class*="equal height"].grid > .column:not(.row),
.ui[class*="equal height"].grid > .row > .column,
.ui.grid > [class*="equal height"].row > .column {
display: table-cell;
}
/* Flexbox (Experimental / Overrides Where Supported) */
.ui[class*="equal height"].grid,
.ui[class*="equal height"].grid > .row,
.ui.grid > [class*="equal height"].row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.ui[class*="equal height"].grid > .column:not(.row),
.ui[class*="equal height"].grid > .row > .column,
.ui.grid > [class*="equal height"].row > .column {
display: block;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
/*-------------------
Doubling
--------------------*/
/* Tablet Only */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui.doubling.grid {
width: 100% !important;
}
.ui.grid > .doubling.row,
.ui.doubling.grid > .row {
margin: 0em !important;
padding: 0em !important;
}
.ui.grid > .doubling.row > .column,
.ui.doubling.grid > .row > .column {
display: inline-block !important;
padding-top: 1rem !important;
padding-bottom: 1rem !important;
margin: 0em;
}
.ui[class*="two column"].doubling.grid > .row > .column,
.ui[class*="two column"].doubling.grid > .column,
.ui.grid > [class*="two column"].doubling.row > .column {
width: 100% !important;
}
.ui[class*="three column"].doubling.grid > .row > .column,
.ui[class*="three column"].doubling.grid > .column,
.ui.grid > [class*="three column"].doubling.row > .column {
width: 50% !important;
}
.ui[class*="four column"].doubling.grid > .row > .column,
.ui[class*="four column"].doubling.grid > .column,
.ui.grid > [class*="four column"].doubling.row > .column {
width: 50% !important;
}
.ui[class*="five column"].doubling.grid > .row > .column,
.ui[class*="five column"].doubling.grid > .column,
.ui.grid > [class*="five column"].doubling.row > .column {
width: 33.33333333% !important;
}
.ui[class*="six column"].doubling.grid > .row > .column,
.ui[class*="six column"].doubling.grid > .column,
.ui.grid > [class*="six column"].doubling.row > .column {
width: 33.33333333% !important;
}
.ui[class*="seven column"].doubling.grid > .row > .column,
.ui[class*="seven column"].doubling.grid > .column,
.ui.grid > [class*="seven column"].doubling.row > .column {
width: 33.33333333% !important;
}
.ui[class*="eight column"].doubling.grid > .row > .column,
.ui[class*="eight column"].doubling.grid > .column,
.ui.grid > [class*="eight column"].doubling.row > .column {
width: 25% !important;
}
.ui[class*="nine column"].doubling.grid > .row > .column,
.ui[class*="nine column"].doubling.grid > .column,
.ui.grid > [class*="nine column"].doubling.row > .column {
width: 25% !important;
}
.ui[class*="ten column"].doubling.grid > .row > .column,
.ui[class*="ten column"].doubling.grid > .column,
.ui.grid > [class*="ten column"].doubling.row > .column {
width: 20% !important;
}
.ui[class*="eleven column"].doubling.grid > .row > .column,
.ui[class*="eleven column"].doubling.grid > .column,
.ui.grid > [class*="eleven column"].doubling.row > .column {
width: 20% !important;
}
.ui[class*="twelve column"].doubling.grid > .row > .column,
.ui[class*="twelve column"].doubling.grid > .column,
.ui.grid > [class*="twelve column"].doubling.row > .column {
width: 16.66666667% !important;
}
.ui[class*="thirteen column"].doubling.grid > .row > .column,
.ui[class*="thirteen column"].doubling.grid > .column,
.ui.grid > [class*="thirteen column"].doubling.row > .column {
width: 16.66666667% !important;
}
.ui[class*="fourteen column"].doubling.grid > .row > .column,
.ui[class*="fourteen column"].doubling.grid > .column,
.ui.grid > [class*="fourteen column"].doubling.row > .column {
width: 14.28571429% !important;
}
.ui[class*="fifteen column"].doubling.grid > .row > .column,
.ui[class*="fifteen column"].doubling.grid > .column,
.ui.grid > [class*="fifteen column"].doubling.row > .column {
width: 14.28571429% !important;
}
.ui[class*="sixteen column"].doubling.grid > .row > .column,
.ui[class*="sixteen column"].doubling.grid > .column,
.ui.grid > [class*="sixteen column"].doubling.row > .column {
width: 12.5% !important;
}
}
/* Mobily Only */
@media only screen and (max-width: 767px) {
.ui.grid > .doubling.row,
.ui.doubling.grid > .row {
display: block !important;
margin: 0em !important;
padding: 0em !important;
}
.ui.grid > .doubling.row > .column,
.ui.doubling.grid > .row > .column {
display: inline-block !important;
padding-top: 1rem !important;
padding-bottom: 1rem !important;
margin: 0em !important;
}
.ui[class*="two column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="two column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="two column"].doubling:not(.stackable).row > .column {
width: 100% !important;
}
.ui[class*="three column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="three column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="three column"].doubling:not(.stackable).row > .column {
width: 50% !important;
}
.ui[class*="four column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="four column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="four column"].doubling:not(.stackable).row > .column {
width: 50% !important;
}
.ui[class*="five column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="five column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="five column"].doubling:not(.stackable).row > .column {
width: 50% !important;
}
.ui[class*="six column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="six column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="six column"].doubling:not(.stackable).row > .column {
width: 50% !important;
}
.ui[class*="seven column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="seven column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="seven column"].doubling:not(.stackable).row > .column {
width: 50% !important;
}
.ui[class*="eight column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="eight column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="eight column"].doubling:not(.stackable).row > .column {
width: 50% !important;
}
.ui[class*="nine column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="nine column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="nine column"].doubling:not(.stackable).row > .column {
width: 33.33333333% !important;
}
.ui[class*="ten column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="ten column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="ten column"].doubling:not(.stackable).row > .column {
width: 33.33333333% !important;
}
.ui[class*="eleven column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="eleven column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="eleven column"].doubling:not(.stackable).row > .column {
width: 33.33333333% !important;
}
.ui[class*="twelve column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="twelve column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="twelve column"].doubling:not(.stackable).row > .column {
width: 33.33333333% !important;
}
.ui[class*="thirteen column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="thirteen column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="thirteen column"].doubling:not(.stackable).row > .column {
width: 33.33333333% !important;
}
.ui[class*="fourteen column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="fourteen column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="fourteen column"].doubling:not(.stackable).row > .column {
width: 25% !important;
}
.ui[class*="fifteen column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="fifteen column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="fifteen column"].doubling:not(.stackable).row > .column {
width: 25% !important;
}
.ui[class*="sixteen column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="sixteen column"].doubling:not(.stackable).grid > .column,
.ui.grid > [class*="sixteen column"].doubling:not(.stackable).row > .column {
width: 25% !important;
}
}
/*-------------------
Stackable
--------------------*/
@media only screen and (max-width: 767px) {
.ui.stackable.grid {
display: block !important;
width: auto;
margin-left: 0em !important;
margin-right: 0em !important;
padding: 0em;
}
.ui.stackable.grid > .row > .wide.column,
.ui.stackable.grid > .wide.column,
.ui.stackable.grid > .column.grid > .column,
.ui.stackable.grid > .column.row > .column,
.ui.stackable.grid > .row > .column,
.ui.stackable.grid > .column:not(.row) {
display: block !important;
width: auto !important;
margin: 0em 0em !important;
box-shadow: none !important;
float: none !important;
padding: 1rem 1rem !important;
}
.ui.stackable.grid > .row {
display: block !important;
margin: 0em;
padding: 0em;
}
/* Don't pad inside segment or nested grid */
.ui.grid .ui.stackable.grid,
.ui.segment:not(.vertical) .ui.stackable.page.grid {
margin-left: -1rem !important;
margin-right: -1rem !important;
}
/* Equal Height Stackable */
.ui[class*="equal height"].stackable.page.grid {
display: block !important;
}
/* Divided Stackable */
.ui.stackable.divided.grid > .row:first-child > .column:first-child,
.ui.stackable.celled.grid > .row:first-child > .column:first-child,
.ui.stackable.divided.grid > .column:not(.row):first-child,
.ui.stackable.celled.grid > .column:not(.row):first-child {
border-top: none !important;
}
.ui.inverted.stackable.celled.grid > .column:not(.row),
.ui.inverted.stackable.divided.grid > .column:not(.row),
.ui.inverted.stackable.celled.grid > .row > .column,
.ui.inverted.stackable.divided.grid > .row > .column {
border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.ui.stackable.celled.grid > .column:not(.row),
.ui.stackable.divided.grid > .column:not(.row),
.ui.stackable.celled.grid > .row > .column,
.ui.stackable.divided.grid > .row > .column {
border-top: 1px solid rgba(39, 41, 43, 0.15);
box-shadow: none !important;
padding-top: 2rem !important;
padding-bottom: 2rem !important;
}
}
/*----------------------
Only (Device)
-----------------------*/
/* These include arbitrary class repetitions for forced specificity */
/* Mobile Only Hide */
@media only screen and (max-width: 767px) {
.ui.tablet:not(.mobile).only.grid.grid.grid,
.ui.grid.grid.grid > [class*="tablet only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="tablet only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="tablet only"].column:not(.mobile) {
display: none !important;
}
.ui[class*="computer only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="computer only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="computer only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="computer only"].column:not(.mobile) {
display: none !important;
}
}
/* Tablet Only Hide */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui[class*="mobile only"].grid.grid.grid:not(.tablet),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.tablet),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.tablet),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.tablet) {
display: none !important;
}
.ui[class*="computer only"].grid.grid.grid:not(.tablet),
.ui.grid.grid.grid > [class*="computer only"].row:not(.tablet),
.ui.grid.grid.grid > [class*="computer only"].column:not(.tablet),
.ui.grid.grid.grid > .row > [class*="computer only"].column:not(.tablet) {
display: none !important;
}
}
/* Computer Only Hide */
@media only screen and (min-width: 992px) {
.ui[class*="mobile only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.computer) {
display: none !important;
}
.ui[class*="tablet only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="tablet only"].row:not(.computer),
.ui.grid.grid.grid > [class*="tablet only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="tablet only"].column:not(.computer) {
display: none !important;
}
}
/*******************************
Theme Overrides
*******************************/
/*******************************
Site Overrides
*******************************/
| holtkamp/cdnjs | ajax/libs/semantic-ui/1.11.6/components/grid.css | CSS | mit | 61,235 |
// jquery.pjax.js
// copyright chris wanstrath
// https://github.com/defunkt/jquery-pjax
(function($){
// When called on a container with a selector, fetches the href with
// ajax into the container or with the data-pjax attribute on the link
// itself.
//
// Tries to make sure the back button and ctrl+click work the way
// you'd expect.
//
// Exported as $.fn.pjax
//
// Accepts a jQuery ajax options object that may include these
// pjax specific options:
//
//
// container - Where to stick the response body. Usually a String selector.
// $(container).html(xhr.responseBody)
// (default: current jquery context)
// push - Whether to pushState the URL. Defaults to true (of course).
// replace - Want to use replaceState instead? That's cool.
//
// For convenience the second parameter can be either the container or
// the options object.
//
// Returns the jQuery object
function fnPjax(selector, container, options) {
var context = this
return this.on('click.pjax', selector, function(event) {
options = optionsFor(container, options)
if (!options.container)
options.container = $(this).attr('data-pjax') || context
handleClick(event, options)
})
}
// Public: pjax on click handler
//
// Exported as $.pjax.click.
//
// event - "click" jQuery.Event
// options - pjax options
//
// Examples
//
// $(document).on('click', 'a', $.pjax.click)
// // is the same as
// $(document).pjax('a')
//
// $(document).on('click', 'a', function(event) {
// var container = $(this).closest('[data-pjax-container]')
// $.pjax.click(event, container)
// })
//
// Returns nothing.
function handleClick(event, container, options) {
options = optionsFor(container, options)
var link = event.currentTarget
if (link.tagName.toUpperCase() !== 'A')
throw "$.fn.pjax or $.pjax.click requires an anchor element"
// Middle click, cmd click, and ctrl click should open
// links in a new tab as normal.
if ( event.which > 1 || event.metaKey || event.ctrlKey )
return
// Ignore cross origin links
if ( location.protocol !== link.protocol || location.host !== link.host )
return
// Ignore anchors on the same page
if (link.hash && link.href.replace(link.hash, '') ===
location.href.replace(location.hash, ''))
return
// Ignore empty anchor "foo.html#"
if (link.href === location.href + '#')
return
var defaults = {
url: link.href,
container: $(link).attr('data-pjax'),
target: link,
fragment: null
}
pjax($.extend({}, defaults, options))
event.preventDefault()
}
// Public: pjax on form submit handler
//
// Exported as $.pjax.submit
//
// event - "click" jQuery.Event
// options - pjax options
//
// Examples
//
// $(document).on('submit', 'form', function(event) {
// var container = $(this).closest('[data-pjax-container]')
// $.pjax.submit(event, container)
// })
//
// Returns nothing.
function handleSubmit(event, container, options) {
options = optionsFor(container, options)
var form = event.currentTarget
if (form.tagName.toUpperCase() !== 'FORM')
throw "$.pjax.submit requires a form element"
var defaults = {
type: form.method,
url: form.action,
data: $(form).serializeArray(),
container: $(form).attr('data-pjax'),
target: form,
fragment: null,
timeout: 0
}
pjax($.extend({}, defaults, options))
event.preventDefault()
}
// Loads a URL with ajax, puts the response body inside a container,
// then pushState()'s the loaded URL.
//
// Works just like $.ajax in that it accepts a jQuery ajax
// settings object (with keys like url, type, data, etc).
//
// Accepts these extra keys:
//
// container - Where to stick the response body.
// $(container).html(xhr.responseBody)
// push - Whether to pushState the URL. Defaults to true (of course).
// replace - Want to use replaceState instead? That's cool.
//
// Use it just like $.ajax:
//
// var xhr = $.pjax({ url: this.href, container: '#main' })
// console.log( xhr.readyState )
//
// Returns whatever $.ajax returns.
function pjax(options) {
options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options)
if ($.isFunction(options.url)) {
options.url = options.url()
}
var target = options.target
var hash = parseURL(options.url).hash
var context = options.context = findContainerFor(options.container)
// We want the browser to maintain two separate internal caches: one
// for pjax'd partial page loads and one for normal page loads.
// Without adding this secret parameter, some browsers will often
// confuse the two.
if (!options.data) options.data = {}
options.data._pjax = context.selector
function fire(type, args) {
var event = $.Event(type, { relatedTarget: target })
context.trigger(event, args)
return !event.isDefaultPrevented()
}
var timeoutTimer
options.beforeSend = function(xhr, settings) {
// No timeout for non-GET requests
// Its not safe to request the resource again with a fallback method.
if (settings.type !== 'GET') {
settings.timeout = 0
}
if (settings.timeout > 0) {
timeoutTimer = setTimeout(function() {
if (fire('pjax:timeout', [xhr, options]))
xhr.abort('timeout')
}, settings.timeout)
// Clear timeout setting so jquerys internal timeout isn't invoked
settings.timeout = 0
}
xhr.setRequestHeader('X-PJAX', 'true')
xhr.setRequestHeader('X-PJAX-Container', context.selector)
var result
if (!fire('pjax:beforeSend', [xhr, settings]))
return false
options.requestUrl = parseURL(settings.url).href
}
options.complete = function(xhr, textStatus) {
if (timeoutTimer)
clearTimeout(timeoutTimer)
fire('pjax:complete', [xhr, textStatus, options])
fire('pjax:end', [xhr, options])
}
options.error = function(xhr, textStatus, errorThrown) {
var container = extractContainer("", xhr, options)
var allowed = fire('pjax:error', [xhr, textStatus, errorThrown, options])
if (textStatus !== 'abort' && allowed)
locationReplace(container.url)
}
options.success = function(data, status, xhr) {
var container = extractContainer(data, xhr, options)
if (!container.contents) {
locationReplace(container.url)
return
}
pjax.state = {
id: options.id || uniqueId(),
url: container.url,
title: container.title,
container: context.selector,
fragment: options.fragment,
timeout: options.timeout
}
if (options.push || options.replace) {
window.history.replaceState(pjax.state, container.title, container.url)
}
if (container.title) document.title = container.title
context.html(container.contents)
// Scroll to top by default
if (typeof options.scrollTo === 'number')
$(window).scrollTop(options.scrollTo)
// Google Analytics support
if ( (options.replace || options.push) && window._gaq )
_gaq.push(['_trackPageview'])
// If the URL has a hash in it, make sure the browser
// knows to navigate to the hash.
if ( hash !== '' ) {
// Avoid using simple hash set here. Will add another history
// entry. Replace the url with replaceState and scroll to target
// by hand.
//
// window.location.hash = hash
var url = parseURL(container.url)
url.hash = hash
pjax.state.url = url.href
window.history.replaceState(pjax.state, container.title, url.href)
var target = $(url.hash)
if (target.length) $(window).scrollTop(target.offset().top)
}
fire('pjax:success', [data, status, xhr, options])
}
// Initialize pjax.state for the initial page load. Assume we're
// using the container and options of the link we're loading for the
// back button to the initial page. This ensures good back button
// behavior.
if (!pjax.state) {
pjax.state = {
id: uniqueId(),
url: window.location.href,
title: document.title,
container: context.selector,
fragment: options.fragment,
timeout: options.timeout
}
window.history.replaceState(pjax.state, document.title)
}
// Cancel the current request if we're already pjaxing
var xhr = pjax.xhr
if ( xhr && xhr.readyState < 4) {
xhr.onreadystatechange = $.noop
xhr.abort()
}
pjax.options = options
var xhr = pjax.xhr = $.ajax(options)
if (xhr.readyState > 0) {
if (options.push && !options.replace) {
// Cache current container element before replacing it
cachePush(pjax.state.id, context.clone().contents())
window.history.pushState(null, "", stripPjaxParam(options.requestUrl))
}
fire('pjax:start', [xhr, options])
fire('pjax:send', [xhr, options])
}
return pjax.xhr
}
// Public: Reload current page with pjax.
//
// Returns whatever $.pjax returns.
function pjaxReload(container, options) {
var defaults = {
url: window.location.href,
push: false,
replace: true,
scrollTo: false
}
return pjax($.extend(defaults, optionsFor(container, options)))
}
// Internal: Hard replace current state with url.
//
// Work for around WebKit
// https://bugs.webkit.org/show_bug.cgi?id=93506
//
// Returns nothing.
function locationReplace(url) {
window.history.replaceState(null, "", "#")
window.location.replace(url)
}
// popstate handler takes care of the back and forward buttons
//
// You probably shouldn't use pjax on pages with other pushState
// stuff yet.
function onPjaxPopstate(event) {
var state = event.state
if (state && state.container) {
var container = $(state.container)
if (container.length) {
var contents = cacheMapping[state.id]
if (pjax.state) {
// Since state ids always increase, we can deduce the history
// direction from the previous state.
var direction = pjax.state.id < state.id ? 'forward' : 'back'
// Cache current container before replacement and inform the
// cache which direction the history shifted.
cachePop(direction, pjax.state.id, container.clone().contents())
}
var popstateEvent = $.Event('pjax:popstate', {
state: state,
direction: direction
})
container.trigger(popstateEvent)
var options = {
id: state.id,
url: state.url,
container: container,
push: false,
fragment: state.fragment,
timeout: state.timeout,
scrollTo: false
}
if (contents) {
container.trigger('pjax:start', [null, options])
if (state.title) document.title = state.title
container.html(contents)
pjax.state = state
container.trigger('pjax:end', [null, options])
} else {
pjax(options)
}
// Force reflow/relayout before the browser tries to restore the
// scroll position.
container[0].offsetHeight
} else {
locationReplace(location.href)
}
}
}
// Fallback version of main pjax function for browsers that don't
// support pushState.
//
// Returns nothing since it retriggers a hard form submission.
function fallbackPjax(options) {
var url = $.isFunction(options.url) ? options.url() : options.url,
method = options.type ? options.type.toUpperCase() : 'GET'
var form = $('<form>', {
method: method === 'GET' ? 'GET' : 'POST',
action: url,
style: 'display:none'
})
if (method !== 'GET' && method !== 'POST') {
form.append($('<input>', {
type: 'hidden',
name: '_method',
value: method.toLowerCase()
}))
}
var data = options.data
if (typeof data === 'string') {
$.each(data.split('&'), function(index, value) {
var pair = value.split('=')
form.append($('<input>', {type: 'hidden', name: pair[0], value: pair[1]}))
})
} else if (typeof data === 'object') {
for (key in data)
form.append($('<input>', {type: 'hidden', name: key, value: data[key]}))
}
$(document.body).append(form)
form.submit()
}
// Internal: Generate unique id for state object.
//
// Use a timestamp instead of a counter since ids should still be
// unique across page loads.
//
// Returns Number.
function uniqueId() {
return (new Date).getTime()
}
// Internal: Strips _pjax param from url
//
// url - String
//
// Returns String.
function stripPjaxParam(url) {
return url
.replace(/\?_pjax=[^&]+&?/, '?')
.replace(/_pjax=[^&]+&?/, '')
.replace(/[\?&]$/, '')
}
// Internal: Parse URL components and returns a Locationish object.
//
// url - String URL
//
// Returns HTMLAnchorElement that acts like Location.
function parseURL(url) {
var a = document.createElement('a')
a.href = url
return a
}
// Internal: Build options Object for arguments.
//
// For convenience the first parameter can be either the container or
// the options object.
//
// Examples
//
// optionsFor('#container')
// // => {container: '#container'}
//
// optionsFor('#container', {push: true})
// // => {container: '#container', push: true}
//
// optionsFor({container: '#container', push: true})
// // => {container: '#container', push: true}
//
// Returns options Object.
function optionsFor(container, options) {
// Both container and options
if ( container && options )
options.container = container
// First argument is options Object
else if ( $.isPlainObject(container) )
options = container
// Only container
else
options = {container: container}
// Find and validate container
if (options.container)
options.container = findContainerFor(options.container)
return options
}
// Internal: Find container element for a variety of inputs.
//
// Because we can't persist elements using the history API, we must be
// able to find a String selector that will consistently find the Element.
//
// container - A selector String, jQuery object, or DOM Element.
//
// Returns a jQuery object whose context is `document` and has a selector.
function findContainerFor(container) {
container = $(container)
if ( !container.length ) {
throw "no pjax container for " + container.selector
} else if ( container.selector !== '' && container.context === document ) {
return container
} else if ( container.attr('id') ) {
return $('#' + container.attr('id'))
} else {
throw "cant get selector for pjax container!"
}
}
// Internal: Filter and find all elements matching the selector.
//
// Where $.fn.find only matches descendants, findAll will test all the
// top level elements in the jQuery object as well.
//
// elems - jQuery object of Elements
// selector - String selector to match
//
// Returns a jQuery object.
function findAll(elems, selector) {
return elems.filter(selector).add(elems.find(selector));
}
// Internal: Extracts container and metadata from response.
//
// 1. Extracts X-PJAX-URL header if set
// 2. Extracts inline <title> tags
// 3. Builds response Element and extracts fragment if set
//
// data - String response data
// xhr - XHR response
// options - pjax options Object
//
// Returns an Object with url, title, and contents keys.
function extractContainer(data, xhr, options) {
var obj = {}
// Prefer X-PJAX-URL header if it was set, otherwise fallback to
// using the original requested url.
obj.url = stripPjaxParam(xhr.getResponseHeader('X-PJAX-URL') || options.requestUrl)
// Attempt to parse response html into elements
var $data = $(data)
// If response data is empty, return fast
if ($data.length === 0)
return obj
// If there's a <title> tag in the response, use it as
// the page's title.
obj.title = findAll($data, 'title').last().text()
if (options.fragment) {
// If they specified a fragment, look for it in the response
// and pull it out.
var $fragment = findAll($data, options.fragment).first()
if ($fragment.length) {
obj.contents = $fragment.contents()
// If there's no title, look for data-title and title attributes
// on the fragment
if (!obj.title)
obj.title = $fragment.attr('title') || $fragment.data('title')
}
} else if (!/<html/i.test(data)) {
obj.contents = $data
}
// Clean up any <title> tags
if (obj.contents) {
// Remove any parent title elements
obj.contents = obj.contents.not('title')
// Then scrub any titles from their descendents
obj.contents.find('title').remove()
}
// Trim any whitespace off the title
if (obj.title) obj.title = $.trim(obj.title)
return obj
}
// Internal: History DOM caching class.
var cacheMapping = {}
var cacheForwardStack = []
var cacheBackStack = []
// Push previous state id and container contents into the history
// cache. Should be called in conjunction with `pushState` to save the
// previous container contents.
//
// id - State ID Number
// value - DOM Element to cache
//
// Returns nothing.
function cachePush(id, value) {
cacheMapping[id] = value
cacheBackStack.push(id)
// Remove all entires in forward history stack after pushing
// a new page.
while (cacheForwardStack.length)
delete cacheMapping[cacheForwardStack.shift()]
// Trim back history stack to max cache length.
while (cacheBackStack.length > pjax.defaults.maxCacheLength)
delete cacheMapping[cacheBackStack.shift()]
}
// Shifts cache from directional history cache. Should be
// called on `popstate` with the previous state id and container
// contents.
//
// direction - "forward" or "back" String
// id - State ID Number
// value - DOM Element to cache
//
// Returns nothing.
function cachePop(direction, id, value) {
var pushStack, popStack
cacheMapping[id] = value
if (direction === 'forward') {
pushStack = cacheBackStack
popStack = cacheForwardStack
} else {
pushStack = cacheForwardStack
popStack = cacheBackStack
}
pushStack.push(id)
if (id = popStack.pop())
delete cacheMapping[id]
}
// Install pjax functions on $.pjax to enable pushState behavior.
//
// Does nothing if already enabled.
//
// Examples
//
// $.pjax.enable()
//
// Returns nothing.
function enable() {
$.fn.pjax = fnPjax
$.pjax = pjax
$.pjax.enable = $.noop
$.pjax.disable = disable
$.pjax.click = handleClick
$.pjax.submit = handleSubmit
$.pjax.reload = pjaxReload
$.pjax.defaults = {
timeout: 650,
push: true,
replace: false,
type: 'GET',
dataType: 'html',
scrollTo: 0,
maxCacheLength: 20
}
$(window).bind('popstate.pjax', onPjaxPopstate)
}
// Disable pushState behavior.
//
// This is the case when a browser doesn't support pushState. It is
// sometimes useful to disable pushState for debugging on a modern
// browser.
//
// Examples
//
// $.pjax.disable()
//
// Returns nothing.
function disable() {
$.fn.pjax = function() { return this }
$.pjax = fallbackPjax
$.pjax.enable = enable
$.pjax.disable = $.noop
$.pjax.click = $.noop
$.pjax.submit = $.noop
$.pjax.reload = window.location.reload
$(window).unbind('popstate.pjax', onPjaxPopstate)
}
// Add the state property to jQuery's event object so we can use it in
// $(window).bind('popstate')
if ( $.inArray('state', $.event.props) < 0 )
$.event.props.push('state')
// Is pjax supported by this browser?
$.support.pjax =
window.history && window.history.pushState && window.history.replaceState &&
// pushState isn't reliable on iOS until 5.
!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/)
$.support.pjax ? enable() : disable()
})(jQuery);
| kennynaoh/cdnjs | ajax/libs/jquery.pjax/1.0.0/jquery.pjax.js | JavaScript | mit | 19,614 |
/*!
* # Semantic UI 1.11.6 - Nag
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
"use strict";
$.fn.nag = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
returnedValue
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.nag.settings, parameters)
: $.extend({}, $.fn.nag.settings),
className = settings.className,
selector = settings.selector,
error = settings.error,
namespace = settings.namespace,
eventNamespace = '.' + namespace,
moduleNamespace = namespace + '-module',
$module = $(this),
$close = $module.find(selector.close),
$context = (settings.context)
? $(settings.context)
: $('body'),
element = this,
instance = $module.data(moduleNamespace),
moduleOffset,
moduleHeight,
contextWidth,
contextHeight,
contextOffset,
yOffset,
yPosition,
timer,
module,
requestAnimationFrame = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(callback) { setTimeout(callback, 0); }
;
module = {
initialize: function() {
module.verbose('Initializing element');
$module
.data(moduleNamespace, module)
;
$close
.on('click' + eventNamespace, module.dismiss)
;
if(settings.detachable && $module.parent()[0] !== $context[0]) {
$module
.detach()
.prependTo($context)
;
}
if(settings.displayTime > 0) {
setTimeout(module.hide, settings.displayTime);
}
module.show();
},
destroy: function() {
module.verbose('Destroying instance');
$module
.removeData(moduleNamespace)
.off(eventNamespace)
;
},
show: function() {
if( module.should.show() && !$module.is(':visible') ) {
module.debug('Showing nag', settings.animation.show);
if(settings.animation.show == 'fade') {
$module
.fadeIn(settings.duration, settings.easing)
;
}
else {
$module
.slideDown(settings.duration, settings.easing)
;
}
}
},
hide: function() {
module.debug('Showing nag', settings.animation.hide);
if(settings.animation.show == 'fade') {
$module
.fadeIn(settings.duration, settings.easing)
;
}
else {
$module
.slideUp(settings.duration, settings.easing)
;
}
},
onHide: function() {
module.debug('Removing nag', settings.animation.hide);
$module.remove();
if (settings.onHide) {
settings.onHide();
}
},
dismiss: function(event) {
if(settings.storageMethod) {
module.storage.set(settings.key, settings.value);
}
module.hide();
event.stopImmediatePropagation();
event.preventDefault();
},
should: {
show: function() {
if(settings.persist) {
module.debug('Persistent nag is set, can show nag');
return true;
}
if( module.storage.get(settings.key) != settings.value.toString() ) {
module.debug('Stored value is not set, can show nag', module.storage.get(settings.key));
return true;
}
module.debug('Stored value is set, cannot show nag', module.storage.get(settings.key));
return false;
}
},
get: {
storageOptions: function() {
var
options = {}
;
if(settings.expires) {
options.expires = settings.expires;
}
if(settings.domain) {
options.domain = settings.domain;
}
if(settings.path) {
options.path = settings.path;
}
return options;
}
},
clear: function() {
module.storage.remove(settings.key);
},
storage: {
set: function(key, value) {
var
options = module.get.storageOptions()
;
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
window.localStorage.setItem(key, value);
module.debug('Value stored using local storage', key, value);
}
else if($.cookie !== undefined) {
$.cookie(key, value, options);
module.debug('Value stored using cookie', key, value, options);
}
else {
module.error(error.noCookieStorage);
return;
}
},
get: function(key, value) {
var
storedValue
;
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
storedValue = window.localStorage.getItem(key);
}
// get by cookie
else if($.cookie !== undefined) {
storedValue = $.cookie(key);
}
else {
module.error(error.noCookieStorage);
}
if(storedValue == 'undefined' || storedValue == 'null' || storedValue === undefined || storedValue === null) {
storedValue = undefined;
}
return storedValue;
},
remove: function(key) {
var
options = module.get.storageOptions()
;
if(settings.storageMethod == 'local' && window.store !== undefined) {
window.localStorage.removeItem(key);
}
// store by cookie
else if($.cookie !== undefined) {
$.removeCookie(key, options);
}
else {
module.error(error.noStorage);
}
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
settings[name] = value;
}
else {
return settings[name];
}
},
internal: function(name, value) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else if(value !== undefined) {
module[name] = value;
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Element' : element,
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
object = instance,
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
}
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false;
}
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false;
}
else {
module.error(error.method, query);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
returnedValue = [returnedValue, response];
}
else if(response !== undefined) {
returnedValue = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
instance.invoke('destroy');
}
module.initialize();
}
})
;
return (returnedValue !== undefined)
? returnedValue
: this
;
};
$.fn.nag.settings = {
name : 'Nag',
debug : false,
verbose : true,
performance : true,
namespace : 'Nag',
// allows cookie to be overriden
persist : false,
// set to zero to require manually dismissal, otherwise hides on its own
displayTime : 0,
animation : {
show : 'slide',
hide : 'slide'
},
context : false,
detachable : false,
expires : 30,
domain : false,
path : '/',
// type of storage to use
storageMethod : 'cookie',
// value to store in dismissed localstorage/cookie
key : 'nag',
value : 'dismiss',
error: {
noStorage : 'Neither $.cookie or store is defined. A storage solution is required for storing state',
method : 'The method you called is not defined.'
},
className : {
bottom : 'bottom',
fixed : 'fixed'
},
selector : {
close : '.close.icon'
},
speed : 500,
easing : 'easeOutQuad',
onHide: function() {}
};
})( jQuery, window , document );
| him2him2/cdnjs | ajax/libs/semantic-ui/1.11.6/components/nag.js | JavaScript | mit | 13,813 |
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.dialog.add('paste',function(a){var b=a.lang.clipboard,c=CKEDITOR.env.isCustomDomain();function d(e){var f=new CKEDITOR.dom.document(e.document),g=f.$,h=f.getById('cke_actscrpt');h&&h.remove();CKEDITOR.env.ie?g.body.contentEditable='true':g.designMode='on';if(CKEDITOR.env.ie&&CKEDITOR.env.version<8)f.getWindow().on('blur',function(){g.selection.empty();});f.on('keydown',function(i){var j=i.data,k=j.getKeystroke(),l;switch(k){case 27:this.hide();l=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(1);l=1;}l&&j.preventDefault();},this);a.fire('ariaWidget',new CKEDITOR.dom.element(e.frameElement));};return{title:b.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight;this.setupContent();},onHide:function(){if(CKEDITOR.env.ie)this.getParentEditor().document.getBody().$.contentEditable='true';},onLoad:function(){if((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&a.lang.dir=='rtl')this.parts.contents.setStyle('overflow','hidden');},onOk:function(){this.commitContent();},contents:[{id:'general',label:a.lang.common.generalTab,elements:[{type:'html',id:'securityMsg',html:'<div style="white-space:normal;width:340px;">'+b.securityMsg+'</div>'},{type:'html',id:'pasteMsg',html:'<div style="white-space:normal;width:340px;">'+b.pasteMsg+'</div>'},{type:'html',id:'editing_area',style:'width: 100%; height: 100%;',html:'',focus:function(){var e=this.getInputElement().$.contentWindow;setTimeout(function(){e.focus();},500);},setup:function(){var e=this.getDialog(),f='<html dir="'+a.config.contentsLangDirection+'"'+' lang="'+(a.config.contentsLanguage||a.langCode)+'">'+'<head><style>body { margin: 3px; height: 95%; } </style></head><body>'+'<script id="cke_actscrpt" type="text/javascript">'+'window.parent.CKEDITOR.tools.callFunction( '+CKEDITOR.tools.addFunction(d,e)+', this );'+'</script></body>'+'</html>',g=CKEDITOR.env.air?'javascript:void(0)':c?"javascript:void((function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})())"':'',h=CKEDITOR.dom.element.createFromHtml('<iframe class="cke_pasteframe" frameborder="0" allowTransparency="true" src="'+g+'"'+' role="region"'+' aria-label="'+b.pasteArea+'"'+' aria-describedby="'+e.getContentElement('general','pasteMsg').domId+'"'+' aria-multiple="true"'+'></iframe>');h.on('load',function(k){k.removeListener();var l=h.getFrameDocument();l.write(f);if(CKEDITOR.env.air)d.call(this,l.getWindow().$);
},e);h.setCustomData('dialog',e);var i=this.getElement();i.setHtml('');i.append(h);if(CKEDITOR.env.ie){var j=CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute;" role="presentation"></span>');j.on('focus',function(){h.$.contentWindow.focus();});i.append(j);this.focus=function(){j.focus();this.fire('focus');};}this.getInputElement=function(){return h;};if(CKEDITOR.env.ie){i.setStyle('display','block');i.setStyle('height',h.$.offsetHeight+2+'px');}},commit:function(e){var f=this.getElement(),g=this.getDialog().getParentEditor(),h=this.getInputElement().getFrameDocument().getBody(),i=h.getBogus(),j;i&&i.remove();j=h.getHtml();setTimeout(function(){g.fire('paste',{html:j});},0);}}]}]};});
| keithpops/rich | vendor/assets/ckeditor/ckeditor/plugins/clipboard/dialogs/paste.js | JavaScript | mit | 3,383 |
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.dialog.add('about',function(a){var b=a.lang.about;return{title:CKEDITOR.env.ie?b.dlgTitle:b.title,minWidth:390,minHeight:230,contents:[{id:'tab1',label:'',title:'',expand:true,padding:0,elements:[{type:'html',html:'<style type="text/css">.cke_about_container{color:#000 !important;padding:10px 10px 0;margin-top:5px}.cke_about_container p{margin: 0 0 10px;}.cke_about_container .cke_about_logo{height:81px;background-color:#fff;background-image:url('+CKEDITOR.plugins.get('about').path+'dialogs/logo_ckeditor.png);'+'background-position:center; '+'background-repeat:no-repeat;'+'margin-bottom:10px;'+'}'+'.cke_about_container a'+'{'+'cursor:pointer !important;'+'color:blue !important;'+'text-decoration:underline !important;'+'}'+'</style>'+'<div class="cke_about_container">'+'<div class="cke_about_logo"></div>'+'<p>'+'CKEditor '+CKEDITOR.version+' (revision '+CKEDITOR.revision+')<br>'+'<a href="http://ckeditor.com/">http://ckeditor.com</a>'+'</p>'+'<p>'+b.help.replace('$1','<a href="http://docs.cksource.com/CKEditor_3.x/Users_Guide/Quick_Reference">'+b.userGuide+'</a>')+'</p>'+'<p>'+b.moreInfo+'<br>'+'<a href="http://ckeditor.com/license">http://ckeditor.com/license</a>'+'</p>'+'<p>'+b.copy.replace('$1','<a href="http://cksource.com/">CKSource</a> - Frederico Knabben')+'</p>'+'</div>'}]}],buttons:[CKEDITOR.dialog.cancelButton]};});
| franciscofuentesDWEB/Experiencia4 | assets/grocery_crud/texteditor/ckeditor/plugins/about/dialogs/about.js | JavaScript | mit | 1,510 |
/*! UIkit 2.13.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Component: Flex
========================================================================== */
.uk-flex {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.uk-flex-inline {
display: -ms-inline-flexbox;
display: -webkit-inline-flex;
display: inline-flex;
}
/*
* Fixes initial flex-shrink value in IE10
*/
.uk-flex > *,
.uk-flex-inline > * {
-ms-flex-negative: 1;
}
/* Alignment
========================================================================== */
/*
* Vertical alignment
* Default value is `stretch`
*/
.uk-flex-top {
-ms-flex-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
}
.uk-flex-middle {
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.uk-flex-bottom {
-ms-flex-align: end;
-webkit-align-items: flex-end;
align-items: flex-end;
}
/*
* Horizontal alignment
* Default value is `flex-start`
*/
.uk-flex-center {
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.uk-flex-right {
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.uk-flex-space-between {
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.uk-flex-space-around {
-ms-flex-pack: distribute;
-webkit-justify-content: space-around;
justify-content: space-around;
}
/* Direction
========================================================================== */
.uk-flex-row-reverse {
-ms-flex-direction: row-reverse;
-webkit-flex-direction: row-reverse;
flex-direction: row-reverse;
}
.uk-flex-column {
-ms-flex-direction: column;
-webkit-flex-direction: column;
flex-direction: column;
}
.uk-flex-column-reverse {
-ms-flex-direction: column-reverse;
-webkit-flex-direction: column-reverse;
flex-direction: column-reverse;
}
/* Wrap
========================================================================== */
.uk-flex-wrap {
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
.uk-flex-wrap-reverse {
-ms-flex-wrap: wrap-reverse;
-webkit-flex-wrap: wrap-reverse;
flex-wrap: wrap-reverse;
}
/*
* Horizontal alignment
* Default value is `stretch`
*/
.uk-flex-wrap-top {
-ms-flex-line-pack: start;
-webkit-align-content: flex-start;
align-content: flex-start;
}
.uk-flex-wrap-middle {
-ms-flex-line-pack: center;
-webkit-align-content: center;
align-content: center;
}
.uk-flex-wrap-bottom {
-ms-flex-line-pack: end;
-webkit-align-content: flex-end;
align-content: flex-end;
}
.uk-flex-wrap-space-between {
-ms-flex-line-pack: justify;
-webkit-align-content: space-between;
align-content: space-between;
}
.uk-flex-wrap-space-around {
-ms-flex-line-pack: distribute;
-webkit-align-content: space-around;
align-content: space-around;
}
/* Item ordering
========================================================================== */
/*
* Default is 0
*/
.uk-flex-order-first {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
/* Phone landscape and bigger */
@media (min-width: 480px) {
.uk-flex-order-first-small {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last-small {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
}
/* Tablet and bigger */
@media (min-width: 768px) {
.uk-flex-order-first-medium {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last-medium {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
}
/* Desktop and bigger */
@media (min-width: 960px) {
.uk-flex-order-first-large {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last-large {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
}
/* Large screen and bigger */
@media (min-width: 1220px) {
.uk-flex-order-first-xlarge {
-ms-flex-order: -1;
-webkit-order: -1;
order: -1;
}
.uk-flex-order-last-xlarge {
-ms-flex-order: 99;
-webkit-order: 99;
order: 99;
}
}
/* Item dimensions
========================================================================== */
/*
* Initial: 0 1 auto
* Content dimensions, but shrinks
*/
/*
* No Flex: 0 0 auto
* Content dimensions
*/
.uk-flex-item-none {
-ms-flex: none;
-webkit-flex: none;
flex: none;
}
/*
* Relative Flex: 1 1 auto
* Space is allocated considering content
* 1. Fixes flex-shrink value in IE10
*/
.uk-flex-item-auto {
-ms-flex: auto;
-webkit-flex: auto;
flex: auto;
/* 1 */
-ms-flex-negative: 1;
}
/*
* Absolute Flex: 1 1 0%
* Space is allocated solely based on flex
*/
.uk-flex-item-1 {
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
}
| jdanyow/cdnjs | ajax/libs/uikit/2.13.1/css/components/flex.css | CSS | mit | 4,928 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Extension\Core\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\DataTransformer\PercentToLocalizedStringTransformer;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class PercentType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->addViewTransformer(new PercentToLocalizedStringTransformer($options['precision'], $options['type']));
}
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'precision' => 0,
'type' => 'fractional',
'compound' => false,
));
$resolver->setAllowedValues(array(
'type' => array(
'fractional',
'integer',
),
));
}
/**
* {@inheritdoc}
*/
public function getName()
{
return 'percent';
}
}
| Laurence11/EFT | vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php | PHP | mit | 1,374 |
// Copyright Joyent, Inc. and other Node contributors.
//
// 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.
var tape = require('tape');
var zlib = require('../');
tape(function(t) {
t.plan(1);
zlib.gzip('hello', function(err, out) {
var unzip = zlib.createGunzip();
unzip.write(out);
unzip.close(function() {
t.ok(true);
});
});
});
| BeejLuig/flash-cards | node_modules/browserify-zlib/test/test-zlib-close-after-write.js | JavaScript | mit | 1,391 |
angular.module("materialCalendar", ["ngMaterial", "ngSanitize"]);
angular.module("materialCalendar").constant("materialCalendar.config", {
version: "0.2.13",
debug: document.domain.indexOf("localhost") > -1
});
angular.module("materialCalendar").config(["materialCalendar.config", "$logProvider", "$compileProvider", function (config, $logProvider, $compileProvider) {
if (config.debug) {
$logProvider.debugEnabled(false);
$compileProvider.debugInfoEnabled(false);
}
}]);
angular.module("materialCalendar").service("materialCalendar.Calendar", [function () {
function Calendar(year, month, options) {
var now = new Date();
this.setWeekStartsOn = function (i) {
var d = parseInt(i || 0, 10);
if (!isNaN(d) && d >= 0 && d <= 6) {
this.weekStartsOn = d;
} else {
this.weekStartsOn = 0;
}
return this.weekStartsOn;
};
this.options = angular.isObject(options) ? options : {};
this.year = now.getFullYear();
this.month = now.getMonth();
this.weeks = [];
this.weekStartsOn = this.setWeekStartsOn(this.options.weekStartsOn);
this.next = function () {
if (this.start.getMonth() < 11) {
this.init(this.start.getFullYear(), this.start.getMonth() + 1);
return;
}
this.init(this.start.getFullYear() + 1, 0);
};
this.prev = function () {
if (this.month) {
this.init(this.start.getFullYear(), this.start.getMonth() - 1);
return;
}
this.init(this.start.getFullYear() - 1, 11);
};
// Month should be the javascript indexed month, 0 is January, etc.
this.init = function (year, month) {
var now = new Date();
this.year = angular.isDefined(year) ? year : now.getFullYear();
this.month = angular.isDefined(month) ? month : now.getMonth();
var daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var monthLength = daysInMonth[this.month];
// Figure out if is a leap year.
if (this.month === 1) {
if ((this.year % 4 === 0 && this.year % 100 !== 0) || this.year % 400 === 0) {
monthLength = 29;
}
}
// First day of calendar month.
this.start = new Date(this.year, this.month, 1);
var date = angular.copy(this.start);
while (date.getDay() !== this.weekStartsOn) {
date.setDate(date.getDate() - 1);
monthLength++;
}
// Last day of calendar month.
while (monthLength % 7 !== 0) {
monthLength++;
}
this.weeks = [];
for (var i = 0; i < monthLength; ++i) {
// Let's start a new week.
if (i % 7 === 0) {
this.weeks.push([]);
}
// Add copy of the date. If not a copy,
// it will get updated shortly.
this.weeks[this.weeks.length - 1].push(angular.copy(date));
// Increment it.
date.setDate(date.getDate() + 1);
}
};
this.init(year, month);
}
return Calendar;
}]);
angular.module("materialCalendar").service("MaterialCalendarData", [function () {
function CalendarData() {
this.data = {};
this.getDayKey = function(date) {
return [date.getFullYear(), date.getMonth() + 1, date.getDate()].join("-");
};
this.setDayContent = function(date, content) {
this.data[this.getDayKey(date)] = content || this.data[this.getDayKey(date)] || "";
};
}
return new CalendarData();
}]);
angular.module("materialCalendar").directive("calendarMd", ["$compile", "$parse", "$http", "$q", "materialCalendar.Calendar", "MaterialCalendarData", function ($compile, $parse, $http, $q, Calendar, CalendarData) {
var defaultTemplate = "<md-content layout='column' layout-fill md-swipe-left='next()' md-swipe-right='prev()'><md-toolbar><div class='md-toolbar-tools' layout='row'><md-button class='md-icon-button' ng-click='prev()' aria-label='Previous month'><md-tooltip ng-if='::tooltips()'>Previous month</md-tooltip>«</md-button><div flex></div><h2 class='calendar-md-title'><span>{{ calendar.start | date:titleFormat:timezone }}</span></h2><div flex></div><md-button class='md-icon-button' ng-click='next()' aria-label='Next month'><md-tooltip ng-if='::tooltips()'>Next month</md-tooltip>»</md-button></div></md-toolbar><!-- agenda view --><md-content ng-if='weekLayout === columnWeekLayout' class='agenda'><div ng-repeat='week in calendar.weeks track by $index'><div ng-if='sameMonth(day)' ng-class='{"disabled" : isDisabled(day), active: active === day }' ng-click='handleDayClick(day)' ng-repeat='day in week' layout><md-tooltip ng-if='::tooltips()'>{{ day | date:dayTooltipFormat:timezone }}</md-tooltip><div>{{ day | date:dayFormat:timezone }}</div><div flex ng-bind-html='dataService.data[dayKey(day)]'></div></div></div></md-content><!-- calendar view --><md-content ng-if='weekLayout !== columnWeekLayout' flex layout='column' class='calendar'><div layout='row' class='subheader'><div layout-padding class='subheader-day' flex ng-repeat='day in calendar.weeks[0]'><md-tooltip ng-if='::tooltips()'>{{ day | date:dayLabelTooltipFormat }}</md-tooltip>{{ day | date:dayLabelFormat }}</div></div><div ng-if='week.length' ng-repeat='week in calendar.weeks track by $index' flex layout='row'><div tabindex='{{ sameMonth(day) ? (day | date:dayFormat:timezone) : 0 }}' ng-repeat='day in week track by $index' ng-click='handleDayClick(day)' flex layout layout-padding ng-class='{"disabled" : isDisabled(day), "active": isActive(day), "md-whiteframe-12dp": hover || focus }' ng-focus='focus = true;' ng-blur='focus = false;' ng-mouseleave='hover = false' ng-mouseenter='hover = true'><md-tooltip ng-if='::tooltips()'>{{ day | date:dayTooltipFormat }}</md-tooltip><div>{{ day | date:dayFormat }}</div><div flex ng-bind-html='dataService.data[dayKey(day)]'></div></div></div></md-content></md-content>";
var injectCss = function () {
var styleId = "calendarMdCss";
if (!document.getElementById(styleId)) {
var head = document.getElementsByTagName("head")[0];
var css = document.createElement("style");
css.type = "text/css";
css.id = styleId;
css.innerHTML = "calendar-md md-content>md-content.agenda>*>* :not(:first-child),calendar-md md-content>md-content.calendar>:not(:first-child)>* :last-child{overflow:hidden;text-overflow:ellipsis}calendar-md{display:block;max-height:100%}calendar-md .md-toolbar-tools h2{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}calendar-md md-content>md-content{border:1px solid rgba(0,0,0,.12)}calendar-md md-content>md-content.agenda>*>*{border-bottom:1px solid rgba(0,0,0,.12)}calendar-md md-content>md-content.agenda>*>.disabled{color:rgba(0,0,0,.3);pointer-events:none;cursor:auto}calendar-md md-content>md-content.agenda>*>* :first-child{padding:12px;width:200px;text-align:right;color:rgba(0,0,0,.75);font-weight:100;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}calendar-md md-content>md-content>*>*{min-width:48px}calendar-md md-content>md-content.calendar>:first-child{background:rgba(0,0,0,.02);border-bottom:1px solid rgba(0,0,0,.12);margin-right:0;min-height:36px}calendar-md md-content>md-content.calendar>:not(:first-child)>*{border-bottom:1px solid rgba(0,0,0,.12);border-right:1px solid rgba(0,0,0,.12);cursor:pointer}calendar-md md-content>md-content.calendar>:not(:first-child)>:hover{background:rgba(0,0,0,.04)}calendar-md md-content>md-content.calendar>:not(:first-child)>.disabled{color:rgba(0,0,0,.3);pointer-events:none;cursor:auto}calendar-md md-content>md-content.calendar>:not(:first-child)>.active{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);background:rgba(0,0,0,.02)}calendar-md md-content>md-content.calendar>:not(:first-child)>* :first-child{padding:0}";
head.insertBefore(css, head.firstChild);
}
};
return {
restrict: "E",
scope: {
ngModel: "=?",
template: "&",
templateUrl: "=?",
onDayClick: "=?",
onPrevMonth: "=?",
onNextMonth: "=?",
calendarDirection: "=?",
dayContent: "&?",
timezone: "=?",
titleFormat: "=?",
dayFormat: "=?",
dayLabelFormat: "=?",
dayLabelTooltipFormat: "=?",
dayTooltipFormat: "=?",
weekStartsOn: "=?",
tooltips: "&?",
clearDataCacheOnLoad: "=?",
disableFutureSelection: "=?"
},
link: function ($scope, $element, $attrs) {
// Add the CSS here.
injectCss();
var date = new Date();
var month = parseInt($attrs.startMonth || date.getMonth());
var year = parseInt($attrs.startYear || date.getFullYear());
$scope.columnWeekLayout = "column";
$scope.weekLayout = "row";
$scope.timezone = $scope.timezone || null;
$scope.noCache = $attrs.clearDataCacheOnLoad || false;
// Parse the parent model to determine if it's an array.
// If it is an array, than we'll automatically be able to select
// more than one date.
if ($attrs.ngModel) {
$scope.active = $scope.$parent.$eval($attrs.ngModel);
if ($attrs.ngModel) {
$scope.$watch("$parent." + $attrs.ngModel, function (val) {
$scope.active = val;
});
}
} else {
$scope.active = null;
}
// Set the defaults here.
$scope.titleFormat = $scope.titleFormat || "MMMM yyyy";
$scope.dayLabelFormat = $scope.dayLabelFormat || "EEE";
$scope.dayLabelTooltipFormat = $scope.dayLabelTooltipFormat || "EEEE";
$scope.dayFormat = $scope.dayFormat || "d";
$scope.dayTooltipFormat = $scope.dayTooltipFormat || "fullDate";
$scope.disableFutureSelection = $scope.disableFutureSelection || false;
$scope.sameMonth = function (date) {
var d = angular.copy(date);
return d.getFullYear() === $scope.calendar.year &&
d.getMonth() === $scope.calendar.month;
};
$scope.isDisabled = function (date) {
if ($scope.disableFutureSelection && date > new Date()) { return true; }
return !$scope.sameMonth(date);
};
$scope.calendarDirection = $scope.calendarDirection || "horizontal";
$scope.$watch("calendarDirection", function (val) {
$scope.weekLayout = val === "horizontal" ? "row" : "column";
});
$scope.$watch("weekLayout", function () {
year = $scope.calendar.year;
month = $scope.calendar.month;
bootstrap();
});
var handleCb = function (cb, data) {
(cb || angular.noop)(data);
};
var dateFind = function (arr, date) {
var index = -1;
angular.forEach(arr, function (d, k) {
if (index < 0) {
if (angular.equals(date, d)) {
index = k;
}
}
});
return index;
};
$scope.isActive = function (date) {
var match;
var active = angular.copy($scope.active);
if (!angular.isArray(active)) {
match = angular.equals(date, active);
} else {
match = dateFind(active, date) > -1;
}
return match;
};
$scope.prev = function () {
$scope.calendar.prev();
var data = {
year: $scope.calendar.year,
month: $scope.calendar.month + 1
};
setData();
handleCb($scope.onPrevMonth, data);
};
$scope.next = function () {
$scope.calendar.next();
var data = {
year: $scope.calendar.year,
month: $scope.calendar.month + 1
};
setData();
handleCb($scope.onNextMonth, data);
};
$scope.handleDayClick = function (date) {
if($scope.disableFutureSelection && date > new Date()) {
return;
}
var active = angular.copy($scope.active);
if (angular.isArray(active)) {
var idx = dateFind(active, date);
if (idx > -1) {
active.splice(idx, 1);
} else {
active.push(date);
}
} else {
if (angular.equals(active, date)) {
active = null;
} else {
active = date;
}
}
$scope.active = active;
if ($attrs.ngModel) {
$parse($attrs.ngModel).assign($scope.$parent, angular.copy($scope.active));
}
handleCb($scope.onDayClick, angular.copy(date));
};
// Small helper function to set the contents of the template.
var setTemplate = function (contents) {
$element.html(contents);
$compile($element.contents())($scope);
};
var init = function () {
$scope.calendar = new Calendar(year, month, {
weekStartsOn: $scope.weekStartsOn || 0
});
var deferred = $q.defer();
// Allows fetching of dynamic templates via $http.
if ($scope.templateUrl) {
$http
.get($scope.templateUrl)
.success(deferred.resolve)
.error(deferred.reject);
} else {
deferred.resolve($scope.template() || defaultTemplate);
}
return deferred.promise;
};
$scope.dataService = CalendarData;
// Set the html contents of each date.
var getDayKey = function (date) {
return $scope.dataService.getDayKey(date);
};
$scope.dayKey = getDayKey;
var getDayContent = function (date) {
// Initialize the data in the data array.
if ($scope.noCache) {
$scope.dataService.setDayContent(date, "");
} else {
$scope.dataService.setDayContent(date, ($scope.dataService.data[getDayKey(date)] || ""));
}
var cb = ($scope.dayContent || angular.noop)();
var result = (cb || angular.noop)(date);
// Check for async function. This should support $http.get() and also regular $q.defer() functions.
if (angular.isObject(result) && "function" === typeof result.success) {
result.success(function (html) {
$scope.dataService.setDayContent(date, html);
});
} else if (angular.isObject(result) && "function" === typeof result.then) {
result.then(function (html) {
$scope.dataService.setDayContent(date, html);
});
} else {
$scope.dataService.setDayContent(date, result);
}
};
var setData = function () {
angular.forEach($scope.calendar.weeks, function (week) {
angular.forEach(week, getDayContent);
});
};
window.data = $scope.data;
var bootstrap = function () {
init().then(function (contents) {
setTemplate(contents);
setData();
});
};
$scope.$watch("weekStartsOn", init);
bootstrap();
// These are for tests, don't remove them..
$scope._$$init = init;
$scope._$$setTemplate = setTemplate;
$scope._$$bootstrap = bootstrap;
}
};
}]);
| delainewendling/NP_trip_planner | deploy/lib/bower_components/material-calendar/dist/angular-material-calendar.js | JavaScript | mit | 17,161 |
//------------------------------------------------------------------------------
// <copyright file="PropertySourceInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Configuration.Internal;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Security.Permissions;
using System.Xml;
using System.Globalization;
using System.ComponentModel;
using System.Security;
using System.Text;
namespace System.Configuration {
internal class PropertySourceInfo {
private string _fileName;
private int _lineNumber;
internal PropertySourceInfo(XmlReader reader) {
_fileName = GetFilename(reader);
_lineNumber = GetLineNumber(reader);
}
internal string FileName {
get {
//
// Ensure we return the same string to the caller as the one on which we issued the demand.
//
string filename = _fileName;
try {
new FileIOPermission(FileIOPermissionAccess.PathDiscovery, filename).Demand();
}
catch (SecurityException) {
// don't expose the path to this user but show the filename
filename = Path.GetFileName(_fileName);
if (filename == null) {
filename = String.Empty;
}
}
return filename;
}
}
internal int LineNumber {
get {
return _lineNumber;
}
}
private string GetFilename(XmlReader reader) {
IConfigErrorInfo err = reader as IConfigErrorInfo;
if (err != null) {
return (string)err.Filename;
}
return "";
}
private int GetLineNumber(XmlReader reader) {
IConfigErrorInfo err = reader as IConfigErrorInfo;
if (err != null) {
return (int)err.LineNumber;
}
return 0;
}
}
}
| AndroidPolice/referencesource | System.Configuration/System/Configuration/PropertySourceInfo.cs | C# | mit | 2,319 |
/**********************************/
/* */
/* Copyright 2000, David Grant */
/* */
/* see LICENSE for more details */
/* */
/**********************************/
#include "coldfire.h"
/* SubX instruction */
/* Format
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| 1 | 0 | 0 | 1 |Register Dx| 1 | 1 | 0 | 0 | 0 | 0 |Register Dy|
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
*/
int SUBXTime=1;
INSTRUCTION_4ARGS(SUBX,
unsigned Code2,4,
unsigned RegisterDx,3,
unsigned Code1,6,
unsigned RegisterDy,3);
static void execute(void)
{
struct _Address Source,Destination;
unsigned int Result, SValue, DValue;
SUBX_Instr Instr;
Memory_RetrWordFromPC(&Instr.Code);
if(!EA_GetFromPC(&Source, 32, 0, Instr.Bits.RegisterDy)) return;
if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.RegisterDx)) return;
EA_GetValue(&SValue, &Source);
EA_GetValue(&DValue, &Destination);
Result = DValue - SValue - (int)SRBits->X;
SR_Set(I_SUBX, SValue, DValue, Result);
EA_PutValue(&Destination, Result);
cycle(SUBXTime);
return;
}
static int disassemble(char *Instruction, char *Arg1, char *Arg2)
{
SUBX_Instr Instr;
Memory_RetrWordFromPC(&Instr.Code);
sprintf(Instruction, "SUBX.L");
Addressing_Print(32, 0, Instr.Bits.RegisterDy, Arg1);
Addressing_Print(32, 0, Instr.Bits.RegisterDx, Arg2);
return 0;
}
int subx_5206_register(void)
{
instruction_register(0x9180, 0xF1F8, &execute, &disassemble);
return 1;
}
| zecke/old-pharo-vm-sctp | processors/ARM/skyeye/arch/coldfire/instruction/i_subx.c | C | mit | 1,633 |
var utils = require('util');
var EventEmitter = require('events').EventEmitter;
/**
* Token assertions class.
*
* @name {TokenAssert}
* @param {JsFile} file
*/
function TokenAssert(file) {
EventEmitter.call(this);
this._file = file;
}
utils.inherits(TokenAssert, EventEmitter);
/**
* Requires to have whitespace between specified tokens. Ignores newlines.
*
* @param {Object} options.token
* @param {Object} options.nextToken
* @param {String} [options.message]
* @param {Number} [options.spaces] Amount of spaces between tokens.
*/
TokenAssert.prototype.whitespaceBetween = function(options) {
var token = options.token;
var nextToken = options.nextToken;
if (options.hasOwnProperty('spaces')) {
var spaces = options.spaces;
if (nextToken.loc.start.line === token.loc.end.line &&
(nextToken.loc.start.column - token.loc.end.column) !== spaces
) {
this.emit('error', {
message: options.message ||
spaces + ' spaces required between ' + token.value + ' and ' + nextToken.value,
line: token.loc.end.line,
column: token.loc.end.column
});
}
} else {
if (nextToken.range[0] === token.range[1]) {
this.emit('error', {
message: options.message || 'Missing space between ' + token.value + ' and ' + nextToken.value,
line: token.loc.end.line,
column: token.loc.end.column
});
}
}
};
/**
* Requires to have no whitespace between specified tokens.
*
* @param {Object} options.token
* @param {Object} options.nextToken
* @param {String} [options.message]
* @param {Boolean} [options.disallowNewLine=false]
*/
TokenAssert.prototype.noWhitespaceBetween = function(options) {
var token = options.token;
var nextToken = options.nextToken;
if (nextToken.range[0] !== token.range[1] &&
(options.disallowNewLine || token.loc.end.line === nextToken.loc.start.line)
) {
this.emit('error', {
message: options.message || 'Unexpected whitespace between ' + token.value + ' and ' + nextToken.value,
line: token.loc.end.line,
column: token.loc.end.column
});
}
};
/**
* Requires tokens to be on the same line.
*
* @param {Object} options.token
* @param {Object} options.nextToken
* @param {String} [options.message]
*/
TokenAssert.prototype.sameLine = function(options) {
var token = options.token;
var nextToken = options.nextToken;
if (!token || !nextToken) {
return;
}
if (token.loc.end.line !== nextToken.loc.start.line) {
this.emit('error', {
message: options.message || token.value + ' and ' + nextToken.value + ' should be on the same line',
line: token.loc.end.line,
column: token.loc.end.column
});
}
};
/**
* Requires tokens to be on different lines.
*
* @param {Object} options.token
* @param {Object} options.nextToken
* @param {Object} [options.message]
*/
TokenAssert.prototype.differentLine = function(options) {
var token = options.token;
var nextToken = options.nextToken;
if (!token || !nextToken) {
return;
}
if (token.loc.end.line === nextToken.loc.start.line) {
this.emit('error', {
message: options.message || token.value + ' and ' + nextToken.value + ' should be on different lines',
line: token.loc.end.line,
column: token.loc.end.column
});
}
};
/**
* Requires specific token before given.
*
* @param {Object} options.token
* @param {Object} options.expectedTokenBefore
* @param {String} [options.message]
*/
TokenAssert.prototype.tokenBefore = function(options) {
var token = options.token;
var actualTokenBefore = this._file.getPrevToken(token);
var expectedTokenBefore = options.expectedTokenBefore;
if (!actualTokenBefore) {
this.emit('error', {
message: expectedTokenBefore.value + ' was expected before ' + token.value + ' but document start found',
line: token.loc.start.line,
column: token.loc.start.column
});
return;
}
if (
actualTokenBefore.type !== expectedTokenBefore.type ||
actualTokenBefore.value !== expectedTokenBefore.value
) {
var message = options.message;
if (!message) {
var showTypes = expectedTokenBefore.value === actualTokenBefore.value;
message =
expectedTokenBefore.value + (showTypes ? ' (' + expectedTokenBefore.type + ')' : '') +
' was expected before ' + token.value +
' but ' + actualTokenBefore.value + (showTypes ? ' (' + actualTokenBefore.type + ')' : '') + ' found';
}
this.emit('error', {
message: message,
line: actualTokenBefore.loc.end.line,
column: actualTokenBefore.loc.end.column
});
}
};
/**
* Disallows specific token before given.
*
* @param {Object} options.token
* @param {Object} options.expectedTokenBefore
* @param {String} [options.message]
*/
TokenAssert.prototype.noTokenBefore = function(options) {
var token = options.token;
var actualTokenBefore = this._file.getPrevToken(token);
if (!actualTokenBefore) {
// document start
return;
}
var expectedTokenBefore = options.expectedTokenBefore;
if (actualTokenBefore.type === expectedTokenBefore.type &&
actualTokenBefore.value === expectedTokenBefore.value
) {
this.emit('error', {
message: options.message || 'Illegal ' + expectedTokenBefore.value + ' was found before ' + token.value,
line: actualTokenBefore.loc.end.line,
column: actualTokenBefore.loc.end.column
});
}
};
module.exports = TokenAssert;
| Cloudoki/Unified-bootstrap | node_modules/grunt-jscs/node_modules/jscs/lib/token-assert.js | JavaScript | mit | 5,929 |
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<script>
'use strict';
Polymer({
is: 'iron-query-params',
properties: {
paramsString: {
type: String,
notify: true,
observer: 'paramsStringChanged',
},
paramsObject: {
type: Object,
notify: true,
value: function() {
return {};
}
},
_dontReact: {
type: Boolean,
value: false
}
},
hostAttributes: {
hidden: true
},
observers: [
'paramsObjectChanged(paramsObject.*)'
],
paramsStringChanged: function() {
this._dontReact = true;
this.paramsObject = this._decodeParams(this.paramsString);
this._dontReact = false;
},
paramsObjectChanged: function() {
if (this._dontReact) {
return;
}
this.paramsString = this._encodeParams(this.paramsObject);
},
_encodeParams: function(params) {
var encodedParams = [];
for (var key in params) {
var value = params[key];
if (value === '') {
encodedParams.push(encodeURIComponent(key));
} else if (value) {
encodedParams.push(
encodeURIComponent(key) +
'=' +
encodeURIComponent(value.toString())
);
}
}
return encodedParams.join('&');
},
_decodeParams: function(paramString) {
var params = {};
// Work around a bug in decodeURIComponent where + is not
// converted to spaces:
paramString = (paramString || '').replace(/\+/g, '%20');
var paramList = paramString.split('&');
for (var i = 0; i < paramList.length; i++) {
var param = paramList[i].split('=');
if (param[0]) {
params[decodeURIComponent(param[0])] =
decodeURIComponent(param[1] || '');
}
}
return params;
}
});
</script>
| drunkchih/kazlist | polymerUI/dashboard/bower_components/iron-location/iron-query-params.html | HTML | mit | 2,443 |
#! /usr/bin/env ruby
require 'spec_helper'
require 'puppet/network/format_handler'
require 'puppet/network/format_support'
class FormatTester
include Puppet::Network::FormatSupport
end
describe Puppet::Network::FormatHandler do
before(:each) do
@saved_formats = Puppet::Network::FormatHandler.instance_variable_get(:@formats).dup
Puppet::Network::FormatHandler.instance_variable_set(:@formats, {})
end
after(:each) do
Puppet::Network::FormatHandler.instance_variable_set(:@formats, @saved_formats)
end
describe "when listing formats" do
before(:each) do
one = Puppet::Network::FormatHandler.create(:one, :weight => 1)
one.stubs(:supported?).returns(true)
two = Puppet::Network::FormatHandler.create(:two, :weight => 6)
two.stubs(:supported?).returns(true)
three = Puppet::Network::FormatHandler.create(:three, :weight => 2)
three.stubs(:supported?).returns(true)
four = Puppet::Network::FormatHandler.create(:four, :weight => 8)
four.stubs(:supported?).returns(false)
end
it "should return all supported formats in decreasing order of weight" do
FormatTester.supported_formats.should == [:two, :three, :one]
end
end
it "should return the first format as the default format" do
FormatTester.expects(:supported_formats).returns [:one, :two]
FormatTester.default_format.should == :one
end
describe "with a preferred serialization format setting" do
before do
one = Puppet::Network::FormatHandler.create(:one, :weight => 1)
one.stubs(:supported?).returns(true)
two = Puppet::Network::FormatHandler.create(:two, :weight => 6)
two.stubs(:supported?).returns(true)
end
describe "that is supported" do
before do
Puppet[:preferred_serialization_format] = :one
end
it "should return the preferred serialization format first" do
FormatTester.supported_formats.should == [:one, :two]
end
end
describe "that is not supported" do
before do
Puppet[:preferred_serialization_format] = :unsupported
end
it "should return the default format first" do
FormatTester.supported_formats.should == [:two, :one]
end
it "should log a debug message" do
Puppet.expects(:debug).with("Value of 'preferred_serialization_format' (unsupported) is invalid for FormatTester, using default (two)")
Puppet.expects(:debug).with("FormatTester supports formats: two one")
FormatTester.supported_formats
end
end
end
describe "when using formats" do
let(:format) { Puppet::Network::FormatHandler.create(:my_format, :mime => "text/myformat") }
it "should use the Format to determine whether a given format is supported" do
format.expects(:supported?).with(FormatTester)
FormatTester.support_format?(:my_format)
end
it "should call the format-specific converter when asked to convert from a given format" do
format.expects(:intern).with(FormatTester, "mydata")
FormatTester.convert_from(:my_format, "mydata")
end
it "should call the format-specific converter when asked to convert from a given format by mime-type" do
format.expects(:intern).with(FormatTester, "mydata")
FormatTester.convert_from("text/myformat", "mydata")
end
it "should call the format-specific converter when asked to convert from a given format by format instance" do
format.expects(:intern).with(FormatTester, "mydata")
FormatTester.convert_from(format, "mydata")
end
it "should raise a FormatError when an exception is encountered when converting from a format" do
format.expects(:intern).with(FormatTester, "mydata").raises "foo"
expect do
FormatTester.convert_from(:my_format, "mydata")
end.to raise_error(
Puppet::Network::FormatHandler::FormatError,
'Could not intern from my_format: foo'
)
end
it "should be able to use a specific hook for converting into multiple instances" do
format.expects(:intern_multiple).with(FormatTester, "mydata")
FormatTester.convert_from_multiple(:my_format, "mydata")
end
it "should raise a FormatError when an exception is encountered when converting multiple items from a format" do
format.expects(:intern_multiple).with(FormatTester, "mydata").raises "foo"
expect do
FormatTester.convert_from_multiple(:my_format, "mydata")
end.to raise_error(Puppet::Network::FormatHandler::FormatError, 'Could not intern_multiple from my_format: foo')
end
it "should be able to use a specific hook for rendering multiple instances" do
format.expects(:render_multiple).with("mydata")
FormatTester.render_multiple(:my_format, "mydata")
end
it "should raise a FormatError when an exception is encountered when rendering multiple items into a format" do
format.expects(:render_multiple).with("mydata").raises "foo"
expect do
FormatTester.render_multiple(:my_format, "mydata")
end.to raise_error(Puppet::Network::FormatHandler::FormatError, 'Could not render_multiple to my_format: foo')
end
end
describe "when an instance" do
let(:format) { Puppet::Network::FormatHandler.create(:foo, :mime => "text/foo") }
it "should list as supported a format that reports itself supported" do
format.expects(:supported?).returns true
FormatTester.new.support_format?(:foo).should be_true
end
it "should raise a FormatError when a rendering error is encountered" do
tester = FormatTester.new
format.expects(:render).with(tester).raises "eh"
expect do
tester.render(:foo)
end.to raise_error(Puppet::Network::FormatHandler::FormatError, 'Could not render to foo: eh')
end
it "should call the format-specific converter when asked to convert to a given format" do
tester = FormatTester.new
format.expects(:render).with(tester).returns "foo"
tester.render(:foo).should == "foo"
end
it "should call the format-specific converter when asked to convert to a given format by mime-type" do
tester = FormatTester.new
format.expects(:render).with(tester).returns "foo"
tester.render("text/foo").should == "foo"
end
it "should call the format converter when asked to convert to a given format instance" do
tester = FormatTester.new
format.expects(:render).with(tester).returns "foo"
tester.render(format).should == "foo"
end
it "should render to the default format if no format is provided when rendering" do
FormatTester.expects(:default_format).returns :foo
tester = FormatTester.new
format.expects(:render).with(tester)
tester.render
end
it "should call the format-specific converter when asked for the mime-type of a given format" do
tester = FormatTester.new
format.expects(:mime).returns "text/foo"
tester.mime(:foo).should == "text/foo"
end
it "should return the default format mime-type if no format is provided" do
FormatTester.expects(:default_format).returns :foo
tester = FormatTester.new
format.expects(:mime).returns "text/foo"
tester.mime.should == "text/foo"
end
end
end
| pheekra/our-boxen | vendor/bundle/ruby/2.0.0/gems/puppet-3.7.1/spec/unit/network/format_support_spec.rb | Ruby | mit | 7,312 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.