code stringlengths 3 1.01M | repo_name stringlengths 5 116 | path stringlengths 3 311 | language stringclasses 30
values | license stringclasses 15
values | size int64 3 1.01M |
|---|---|---|---|---|---|
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is machine-generated by lib/unicore/mktables from the Unicode
# database, Version 6.2.0. Any changes made here will be lost!
# !!!!!!! INTERNAL PERL USE ONLY !!!!!!!
# This file is for internal use by core Perl only. The format and even the
# name or existence of this file are subject to change without notice. Don't
# use it directly.
return <<'END';
0700 074F
END
| Bjay1435/capstone | rootfs/usr/share/perl/5.18.2/unicore/lib/Blk/Syriac.pl | Perl | mit | 433 |
---
date: "2016-12-01T16:00:00+02:00"
title: "从源代码安装"
slug: "install-from-source"
weight: 10
toc: false
draft: false
menu:
sidebar:
parent: "installation"
name: "从源代码安装"
weight: 30
identifier: "install-from-source"
---
# 从源代码安装
首先你需要安装Golang,关于Golang的安装,参见官方文档 [install instructions](https://golang.org/doc/install)。
## 下载
你需要获取Gitea的源码,最方便的方式是使用 go 命令。执行以下命令:
```
go get -d -u code.gitea.io/gitea
cd $GOPATH/src/code.gitea.io/gitea
```
然后你可以选择编译和安装的版本,当前你有多个选择。如果你想编译 `master` 版本,你可以直接跳到 [编译](#build) 部分,这是我们的开发分支,虽然也很稳定但不建议您在正式产品中使用。
如果你想编译最新稳定分支,你可以执行以下命令签出源码:
```
git branch -a
git checkout v{{< version >}}
```
最后,你也可以直接使用标签版本如 `v{{< version >}}`。你可以执行以下命令列出可用的版本并选择某个版本签出:
```
git tag -l
git checkout v{{< version >}}
```
## 编译
要从源代码进行编译,以下依赖程序必须事先安装好:
- `go` {{< min-go-version >}} 或以上版本, 详见 [here](https://golang.org/dl/)
- `node` {{< min-node-version >}} 或以上版本,并且安装 `npm`, 详见 [here](https://nodejs.org/en/download/)
- `make`, 详见 <a href='{{< relref "make.zh-cn.md" >}}'>这里</a>
各种可用的 [make 任务](https://github.com/go-gitea/gitea/blob/master/Makefile)
可以用来使编译过程更方便。
按照您的编译需求,以下 tags 可以使用:
* `bindata`: 这个编译选项将会把运行Gitea所需的所有外部资源都打包到可执行文件中,这样部署将非常简单因为除了可执行程序将不再需要任何其他文件。
* `sqlite sqlite_unlock_notify`: 这个编译选项将启用SQLite3数据库的支持,建议只在少数人使用时使用这个模式。
* `pam`: 这个编译选项将会启用 PAM (Linux Pluggable Authentication Modules) 认证,如果你使用这一认证模式的话需要开启这个选项。
使用 bindata 可以打包资源文件到二进制可以使开发和测试更容易,你可以根据自己的需求决定是否打包资源文件。
要包含资源文件,请使用 `bindata` tag:
```bash
TAGS="bindata" make build
```
默认的发布版本中的编译选项是: `TAGS="bindata sqlite sqlite_unlock_notify"`。以下为推荐的编译方式:
```bash
TAGS="bindata sqlite sqlite_unlock_notify" make build
```
## 测试
在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。
```
./gitea web
```
## 需要帮助?
如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}})
| go-gitea/gitea | docs/content/doc/installation/from-source.zh-cn.md | Markdown | mit | 3,036 |
// implementation for sturm_equation.h
#include <cmath>
#include <algorithm>
#include <list>
#include <utils/array1d.h>
#include <algebra/vector.h>
#include <algebra/sparse_matrix.h>
#include <numerics/eigenvalues.h>
#include <numerics/gauss_data.h>
namespace WaveletTL
{
template <class WBASIS>
SturmEquation<WBASIS>::SturmEquation(const SimpleSturmBVP& bvp,
const bool precompute_f)
: bvp_(bvp), basis_(bvp.bc_left(), bvp.bc_right()), normA(0.0), normAinv(0.0)
{
#ifdef ENERGY
// compute_diagonal();
#endif
if (precompute_f) precompute_rhs();
//const int jmax = 12;
//basis_.set_jmax(jmax);
}
template <class WBASIS>
SturmEquation<WBASIS>::SturmEquation(const SimpleSturmBVP& bvp,
const WBASIS& basis,
const bool precompute_f)
: bvp_(bvp), basis_(basis), normA(0.0), normAinv(0.0)
{
#ifdef ENERGY
compute_diagonal();
#endif
if (precompute_f) precompute_rhs();
//const int jmax = 12;
//basis_.set_jmax(jmax);
}
template <class WBASIS>
void
SturmEquation<WBASIS>::precompute_rhs() const
{
typedef typename WaveletBasis::Index Index;
cout << "precompute rhs.." << endl;
// precompute the right-hand side on a fine level
InfiniteVector<double,Index> fhelp;
InfiniteVector<double,int> fhelp_int;
#ifdef FRAME
// cout << basis_.degrees_of_freedom() << endl;
for (int i=0; i<basis_.degrees_of_freedom();i++) {
// cout << "hallo" << endl;
// cout << *(basis_.get_quarklet(i)) << endl;
const double coeff = f(*(basis_.get_quarklet(i)))/D(*(basis_.get_quarklet(i)));
fhelp.set_coefficient(*(basis_.get_quarklet(i)), coeff);
fhelp_int.set_coefficient(i, coeff);
// cout << *(basis_.get_quarklet(i)) << endl;
}
// cout << "bin hier1" << endl;
#else
for (int i=0; i<basis_.degrees_of_freedom();i++) {
// cout << "bin hier: " << i << endl;
// cout << D(*(basis_.get_wavelet(i))) << endl;
// cout << *(basis_.get_wavelet(i)) << endl;
const double coeff = f(*(basis_.get_wavelet(i)))/D(*(basis_.get_wavelet(i)));
// cout << f(*(basis_.get_wavelet(i))) << endl;
// cout << coeff << endl;
fhelp.set_coefficient(*(basis_.get_wavelet(i)), coeff);
fhelp_int.set_coefficient(i, coeff);
// cout << *(basis_.get_wavelet(i)) << endl;
}
// const int j0 = basis().j0();
// for (Index lambda(basis_.first_generator(j0));;++lambda)
// {
// const double coeff = f(lambda)/D(lambda);
// if (fabs(coeff)>1e-15)
// fhelp.set_coefficient(lambda, coeff);
// fhelp_int.set_coefficient(i, coeff);
// if (lambda == basis_.last_wavelet(jmax))
// break;
//
//
// }
#endif
fnorm_sqr = l2_norm_sqr(fhelp);
// sort the coefficients into fcoeffs
fcoeffs.resize(fhelp.size());
fcoeffs_int.resize(fhelp_int.size());
unsigned int id(0), id2(0);
for (typename InfiniteVector<double,Index>::const_iterator it(fhelp.begin()), itend(fhelp.end());
it != itend; ++it, ++id)
fcoeffs[id] = std::pair<Index,double>(it.index(), *it);
sort(fcoeffs.begin(), fcoeffs.end(), typename InfiniteVector<double,Index>::decreasing_order());
for (typename InfiniteVector<double,int>::const_iterator it(fhelp_int.begin()), itend(fhelp_int.end());
it != itend; ++it, ++id2)
fcoeffs_int[id2] = std::pair<int,double>(it.index(), *it);
sort(fcoeffs_int.begin(), fcoeffs_int.end(), typename InfiniteVector<double,int>::decreasing_order());
rhs_precomputed = true;
cout << "end precompute rhs.." << endl;
// cout << fhelp << endl;
// cout << fcoeffs << endl;
}
template <class WBASIS>
inline
double
SturmEquation<WBASIS>::D(const typename WBASIS::Index& lambda) const
{
#ifdef FRAME
#ifdef DYADIC
return mypow((1<<lambda.j())*mypow(1+lambda.p(),6),operator_order())*mypow(1+lambda.p(),2); //2^j*(p+1)^6, falls operator_order()=1 (\delta=4)
// return 1<<(lambda.j()*(int) operator_order());
#endif
#ifdef TRIVIAL
return 1;
#endif
#ifdef ENERGY
return stiff_diagonal[lambda.number()]*(lambda.p()+1);
#endif
#endif
#ifdef BASIS
#ifdef DYADIC
return 1<<(lambda.j()*(int) operator_order());
// return pow(ldexp(1.0, lambda.j()),operator_order());
#else
#ifdef TRIVIAL
return 1;
#else
#ifdef ENERGY
// return sqrt(a(lambda, lambda));
return stiff_diagonal[lambda.number()];
#else
return sqrt(a(lambda, lambda));
#endif
#endif
#endif
#else
return 1;
#endif
// return 1;
// return lambda.e() == 0 ? 1.0 : ldexp(1.0, lambda.j()); // do not scale the generators
// return lambda.e() == 0 ? 1.0 : sqrt(a(lambda, lambda)); // do not scale the generators
}
template <class WBASIS>
inline
double
SturmEquation<WBASIS>::a(const typename WBASIS::Index& lambda,
const typename WBASIS::Index& nu) const
{
return a(lambda, nu, 2*WBASIS::primal_polynomial_degree());
}
template <class WBASIS>
double
SturmEquation<WBASIS>::a(const typename WBASIS::Index& lambda,
const typename WBASIS::Index& nu,
const unsigned int p) const
{
// a(u,v) = \int_0^1 [p(t)u'(t)v'(t)+q(t)u(t)v(t)] dt
double r = 0;
// Remark: There are of course many possibilities to evaluate
// a(u,v) numerically.
// In this implementation, we rely on the fact that the primal functions in
// WBASIS are splines with respect to a dyadic subgrid.
// We can then apply an appropriate composite quadrature rule.
// In the scope of WBASIS, the routines intersect_supports() and evaluate()
// must exist, which is the case for DSBasis<d,dT>.
// First we compute the support intersection of \psi_\lambda and \psi_\nu:
typedef typename WBASIS::Support Support;
Support supp;
if (intersect_supports(basis_, lambda, nu, supp))
{
// Set up Gauss points and weights for a composite quadrature formula:
// (TODO: maybe use an instance of MathTL::QuadratureRule instead of computing
// the Gauss points and weights)
#ifdef FRAME
const unsigned int N_Gauss = std::min((unsigned int)10,(p+1)/2+ (lambda.p()+nu.p()+1)/2);
// const unsigned int N_Gauss = 10;
// const unsigned int N_Gauss = (p+1)/2;
#else
const unsigned int N_Gauss = (p+1)/2;
#endif
const double h = ldexp(1.0, -supp.j);
Array1D<double> gauss_points (N_Gauss*(supp.k2-supp.k1)), func1values, func2values, der1values, der2values;
for (int patch = supp.k1, id = 0; patch < supp.k2; patch++) // refers to 2^{-j}[patch,patch+1]
for (unsigned int n = 0; n < N_Gauss; n++, id++)
gauss_points[id] = h*(2*patch+1+GaussPoints[N_Gauss-1][n])/2.;
// - compute point values of the integrands
evaluate(basis_, lambda, gauss_points, func1values, der1values);
evaluate(basis_, nu, gauss_points, func2values, der2values);
// if((lambda.number()==19 && nu.number()==19) || (lambda.number()==26 && nu.number()==26)){
// cout << lambda << endl;
// cout << gauss_points << endl;
// cout << func1values << endl;
// cout << func2values << endl;
// }
// - add all integral shares
for (int patch = supp.k1, id = 0; patch < supp.k2; patch++)
for (unsigned int n = 0; n < N_Gauss; n++, id++) {
const double t = gauss_points[id];
const double gauss_weight = GaussWeights[N_Gauss-1][n] * h;
const double pt = bvp_.p(t);
if (pt != 0)
r += pt * der1values[id] * der2values[id] * gauss_weight;
const double qt = bvp_.q(t);
if (qt != 0)
r += qt * func1values[id] * func2values[id] * gauss_weight;
}
}
return r;
}
template <class WBASIS>
double
SturmEquation<WBASIS>::norm_A() const
{
if (normA == 0.0) {
typedef typename WaveletBasis::Index Index;
std::set<Index> Lambda;
const int j0 = basis().j0();
const int jmax = j0+3;
#ifdef FRAME
const int pmax = std::min(basis().get_pmax_(),2);
//const int pmax = 0;
int p = 0;
for (Index lambda = basis().first_generator(j0,0);;) {
Lambda.insert(lambda);
if (lambda == basis().last_wavelet(jmax,pmax)) break;
//if (i==7) break;
if (lambda == basis().last_wavelet(jmax,p)){
++p;
lambda = basis().first_generator(j0,p);
}
else
++lambda;
}
#else
for (Index lambda = first_generator(&basis(), j0);; ++lambda) {
Lambda.insert(lambda);
if (lambda == last_wavelet(&basis(), jmax)) break;
}
#endif
SparseMatrix<double> A_Lambda;
setup_stiffness_matrix(*this, Lambda, A_Lambda);
#if 1
double help;
unsigned int iterations;
LanczosIteration(A_Lambda, 1e-6, help, normA, 200, iterations);
normAinv = 1./help;
#else
Vector<double> xk(Lambda.size(), false);
xk = 1;
unsigned int iterations;
normA = PowerIteration(A_Lambda, xk, 1e-6, 100, iterations);
#endif
}
return normA;
}
template <class WBASIS>
double
SturmEquation<WBASIS>::norm_Ainv() const
{
if (normAinv == 0.0) {
typedef typename WaveletBasis::Index Index;
std::set<Index> Lambda;
const int j0 = basis().j0();
const int jmax = j0+3;
#ifdef FRAME
const int pmax = std::min(basis().get_pmax_(),2);
//const int pmax = 0;
int p = 0;
for (Index lambda = basis().first_generator(j0,0);;) {
Lambda.insert(lambda);
if (lambda == basis().last_wavelet(jmax,pmax)) break;
//if (i==7) break;
if (lambda == basis().last_wavelet(jmax,p)){
++p;
lambda = basis().first_generator(j0,p);
}
else
++lambda;
}
#else
for (Index lambda = first_generator(&basis(), j0);; ++lambda) {
Lambda.insert(lambda);
if (lambda == last_wavelet(&basis(), jmax)) break;
}
#endif
SparseMatrix<double> A_Lambda;
setup_stiffness_matrix(*this, Lambda, A_Lambda);
#if 1
double help;
unsigned int iterations;
LanczosIteration(A_Lambda, 1e-6, help, normA, 200, iterations);
normAinv = 1./help;
#else
Vector<double> xk(Lambda.size(), false);
xk = 1;
unsigned int iterations;
normAinv = InversePowerIteration(A_Lambda, xk, 1e-6, 200, iterations);
#endif
}
return normAinv;
}
template <class WBASIS>
double
SturmEquation<WBASIS>::f(const typename WBASIS::Index& lambda) const
{
// f(v) = \int_0^1 g(t)v(t) dt
// cout << "bin in f" << endl;
double r = 0;
const int j = lambda.j()+lambda.e();
int k1, k2;
support(basis_, lambda, k1, k2);
// Set up Gauss points and weights for a composite quadrature formula:
const unsigned int N_Gauss = 7; //perhaps we need +lambda.p()/2 @PHK
const double h = ldexp(1.0, -j);
Array1D<double> gauss_points (N_Gauss*(k2-k1)), vvalues;
for (int patch = k1; patch < k2; patch++) // refers to 2^{-j}[patch,patch+1]
for (unsigned int n = 0; n < N_Gauss; n++)
gauss_points[(patch-k1)*N_Gauss+n] = h*(2*patch+1+GaussPoints[N_Gauss-1][n])/2;
// - compute point values of the integrand
evaluate(basis_, 0, lambda, gauss_points, vvalues);
// cout << "bin immer noch in f" << endl;
// - add all integral shares
for (int patch = k1, id = 0; patch < k2; patch++)
for (unsigned int n = 0; n < N_Gauss; n++, id++) {
const double t = gauss_points[id];
const double gauss_weight = GaussWeights[N_Gauss-1][n] * h;
const double gt = bvp_.g(t);
if (gt != 0)
r += gt
* vvalues[id]
* gauss_weight;
}
#ifdef DELTADIS
// double tmp = 1;
// Point<1> p1;
// p1[0] = 0.5;
// Point<1> p2;
// chart->map_point_inv(p1,p2);
// tmp = evaluate(basis_, 0,
// typename WBASIS::Index(lambda.j(),
// lambda.e()[0],
// lambda.k()[0],
// basis_),
// p2[0]);
// tmp /= chart->Gram_factor(p2);
//
//
// return 4.0*tmp + r;
#ifdef NONZERONEUMANN
return r + 4*basis_.evaluate(0, lambda, 0.5)+3*M_PI*(basis_.evaluate(0, lambda, 1)+basis_.evaluate(0, lambda, 0));
#else
return r+ 4*basis_.evaluate(0, lambda, 0.5);
#endif
#else
return r;
#endif
}
template <class WBASIS>
inline
void
SturmEquation<WBASIS>::RHS(const double eta,
InfiniteVector<double, typename WBASIS::Index>& coeffs) const
{
if (!rhs_precomputed) precompute_rhs();
coeffs.clear();
double coarsenorm(0);
double bound(fnorm_sqr - eta*eta);
typedef typename WBASIS::Index Index;
typename Array1D<std::pair<Index, double> >::const_iterator it(fcoeffs.begin());
do {
coarsenorm += it->second * it->second;
coeffs.set_coefficient(it->first, it->second);
++it;
} while (it != fcoeffs.end() && coarsenorm < bound);
}
template <class WBASIS>
inline
void
SturmEquation<WBASIS>::RHS(const double eta,
InfiniteVector<double,int>& coeffs) const
{
if (!rhs_precomputed) precompute_rhs();
coeffs.clear();
double coarsenorm(0);
double bound(fnorm_sqr - eta*eta);
typename Array1D<std::pair<int, double> >::const_iterator it(fcoeffs_int.begin());
do {
coarsenorm += it->second * it->second;
coeffs.set_coefficient(it->first, it->second);
++it;
} while (it != fcoeffs_int.end() && coarsenorm < bound);
}
template <class WBASIS>
void
SturmEquation<WBASIS>::compute_diagonal()
{
cout << "SturmEquation(): precompute diagonal of stiffness matrix..." << endl;
SparseMatrix<double> diag(1,basis_.degrees_of_freedom());
char filename[50];
char matrixname[50];
#ifdef ONE_D
int d = WBASIS::primal_polynomial_degree();
int dT = WBASIS::primal_vanishing_moments();
#else
#ifdef TWO_D
int d = WBASIS::primal_polynomial_degree();
int dT = WBASIS::primal_vanishing_moments();
#endif
#endif
// prepare filenames for 1D and 2D case
#ifdef ONE_D
sprintf(filename, "%s%d%s%d", "stiff_diagonal_poisson_interval_lap07_d", d, "_dT", dT);
sprintf(matrixname, "%s%d%s%d", "stiff_diagonal_poisson_1D_lap07_d", d, "_dT", dT);
#endif
#ifdef TWO_D
sprintf(filename, "%s%d%s%d", "stiff_diagonal_poisson_lshaped_lap1_d", d, "_dT", dT);
sprintf(matrixname, "%s%d%s%d", "stiff_diagonal_poisson_2D_lap1_d", d, "_dT", dT);
#endif
#ifndef PRECOMP_DIAG
std::list<Vector<double>::size_type> indices;
std::list<double> entries;
#endif
#ifdef PRECOMP_DIAG
cout << "reading in diagonal of unpreconditioned stiffness matrix from file "
<< filename << "..." << endl;
diag.matlab_input(filename);
cout << "...ready" << endl;
#endif
stiff_diagonal.resize(basis_.degrees_of_freedom());
for (int i = 0; i < basis_.degrees_of_freedom(); i++) {
#ifdef PRECOMP_DIAG
stiff_diagonal[i] = diag.get_entry(0,i);
#endif
#ifndef PRECOMP_DIAG
#ifdef FRAME
stiff_diagonal[i] = sqrt(a(*(basis_.get_quarklet(i)),*(basis_.get_quarklet(i))));
#endif
#ifdef BASIS
stiff_diagonal[i] = sqrt(a(*(basis_.get_wavelet(i)),*(basis_.get_wavelet(i))));
#endif
indices.push_back(i);
entries.push_back(stiff_diagonal[i]);
#endif
//cout << stiff_diagonal[i] << " " << *(basis_->get_wavelet(i)) << endl;
}
#ifndef PRECOMP_DIAG
diag.set_row(0,indices, entries);
diag.matlab_output(filename, matrixname, 1);
#endif
cout << "... done, diagonal of stiffness matrix computed" << endl;
}
}
| kedingagnumerikunimarburg/Marburg_Software_Library | WaveletTL/galerkin/sturm_equation.cpp | C++ | mit | 15,625 |
module NetSuite
module Records
class CustomerSubscriptionsList < Support::Sublist
include Namespaces::ListRel
sublist :subscriptions, CustomerSubscription
end
end
end
| jeperkins4/netsuite | lib/netsuite/records/customer_subscriptions_list.rb | Ruby | mit | 193 |
# ClientSidePage.Properties PromoteAsNewsArticleSpecified
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public bool PromoteAsNewsArticleSpecified { get; set; }
```
### Property Value
Type: System.Boolean
## See also
- [ClientSidePage](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.ClientSidePage.md)
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)
| erwinvanhunen/PnP-Guidance | sitescore/OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.ClientSidePage.PromoteAsNewsArticleSpecified.md | Markdown | mit | 618 |
class Downvote < ActiveRecord::Base
validates :post, presence: true
validates :user, presence: true
belongs_to :user, counter_cache: true
belongs_to :post
end
| sudharti/2cents | app/models/downvote.rb | Ruby | mit | 169 |
<?php
/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <info@nfq.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ONGR\ElasticsearchBundle\Serializer\Normalizer;
use Symfony\Component\Serializer\Normalizer\CustomNormalizer;
/**
* Normalizer used with referenced normalized objects.
*/
class CustomReferencedNormalizer extends CustomNormalizer
{
/**
* @var array
*/
private $references = [];
/**
* {@inheritdoc}
*/
public function normalize($object, $format = null, array $context = [])
{
$object->setReferences($this->references);
$data = parent::normalize($object, $format, $context);
$this->references = array_merge($this->references, $object->getReferences());
return $data;
}
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
{
return $data instanceof AbstractNormalizable;
}
}
| lmikelionis/ElasticsearchBundle | Serializer/Normalizer/CustomReferencedNormalizer.php | PHP | mit | 1,062 |
---
title: تفکری فراتر
date: 22/02/2019
---
دام های شیطان، صفحات ۵١۸-۵۳٠، از کتاب جدال عظیم ، نوشته الن جی وایت را مطالعه کنید.
هدف باب ۱۲ مکاشفه یوحنا پیش از هر چیز این است که اولاً به قوم خدا بگوید که رویدادهای آخر زمان بخشی از نبرد بزرگ میان مسیح و شیطان است. کتاب به ایشان درباره آنچه امروزه با آن مواجه هستند و قرار است به گونهای حتی جدیتردر آینده با آن روبرو شوند - یک دشمن با تجربه و خشمگین - هشدار میدهد. پولس در مورد فعالیت آخر زمان مظهر شرارت به ما هشدار میدهد ... با انواع آیات و نشانهها و معجزات فریبنده و هر نوع شرارتی که برای محکومین به هلاکت فریبنده است همراه خواهد بود، چون آنها عشق به حقیقت را که میتواند آنان را نجات بخشد قبول نکردند (دوم تسالونیکیان باب ۲ آیات ۹ و ۱۰).
مکاشفه یوحنا ما را برمیانگیزد که آینده را جدی بگیریم و وابستگیمان به خدا را اولویت خود سازیم. از سوی دیگر، مکاشفه یوحنا به ما اطمینان میدهد که اگر چه شیطان دشمنی قوی و باتجربه است، ولی به اندازه کافی برای غلبه بر مسیح قدرتمند نیست (مکاشه یوحنا باب ۱۲ آیه ۸ را ببینید). امید برای قوم خدا تنها میتواند در کسی یافت شود که در گذشته فاتحانه شیطان و نیروهای شریر او را شکست داد. و او وعده داده است همیشه، حتی تا پایان زمان، با پیروان وفادار خود باشد (متی باب ۲۸ آیه ۲۰).
**سوالاتی برای بحث **
`۱- ما ادونتیستهای روز هفتم خود را دارای ویژگیهای بازماندگان آخر زمان میبینیم. چه امتیازی! همچنین چه مسئولیتی. (لوقا باب ۱۲ آیه ۴۸ را ببینید.) چرا با این وجود، ما باید مراقب باشیم و فکر نکنیم که این نقش، نجات شخصی ما را تضمین میکند؟`
`۲- ما بطور کلی، خیلی زیاد در مورد قدرت شیطان سخن میگوییم. این درست است که شیطان موجود قدرتمندی میباشد؛ اما من از خدا ممنونم برای نجات دهندهای توانا که شیطان را از آسمان بیرون راند. ما درباره دشمن خود صحبت میکنیم، درباره او دعا میکنیم،به او فکر میکنیم؛ و او در تصورات ما بزرگتر و بزرگتر میشود. اکنون چرا در مورد عیسی سخن نگوییم؟چرا در مورد قدرت و محبت وی نگوییم؟ شیطان از اینکه ما قدرتش را بزرگ جلوه دهیم، خشنود میشود. عیسی را در قلب خود نگه دارید، در مورد او بیاندیشید و با متشبه شدن به تصویر وی تغییر خواهید یافت. - الن جی. وایت،Ellen G. White, The Advent Review and Sabbath Herald, March 19, 1889.`
`... مسیحیان به چه روشهایی قدرت شیطان را بزرگ جلوه میدهند؟ از سوی دیگر، در انکار نمودن نه تنها حقیقت قدرت شیطان بلکه واقعیت وجودش نیز چه خطراتی وجود دارد؟` | PrJared/sabbath-school-lessons | src/fa/2019-01/08/07.md | Markdown | mit | 3,777 |
<?php
namespace PuphpetBundle\Twig;
use RandomLib;
class BaseExtension extends \Twig_Extension
{
/** @var \RandomLib\Factory */
private $randomLib;
public function __construct(RandomLib\Factory $randomLib)
{
$this->randomLib = $randomLib;
}
public function getFunctions()
{
return [
new \Twig_SimpleFunction('mt_rand', [$this, 'mt_rand']),
new \Twig_SimpleFunction('uniqid', [$this, 'uniqid']),
new \Twig_SimpleFunction('merge_unique', [$this, 'mergeUnique']),
new \Twig_SimpleFunction('add_available', [$this, 'addAvailable']),
new \Twig_SimpleFunction('formValue', [$this, 'formValue']),
];
}
public function getFilters()
{
return [
'str_replace' => new \Twig_SimpleFilter('str_replace', 'str_replace'),
];
}
public function uniqid($prefix)
{
$random = $this->randomLib->getLowStrengthGenerator();
$characters = '0123456789abcdefghijklmnopqrstuvwxyz';
return $prefix . $random->generateString(12, $characters);
}
public function mt_rand($min, $max)
{
return mt_rand($min, $max);
}
public function str_replace($subject, $search, $replace)
{
return str_replace($search, $replace, $subject);
}
public function mergeUnique(array $arr1, array $arr2)
{
return array_unique(array_merge($arr1, $arr2));
}
public function addAvailable(array $arr1, array $arr2)
{
return array_merge($arr1, ['available' => $arr2]);
}
public function formValue($value)
{
if ($value === false) {
return 'false';
}
if ($value === null) {
return 'false';
}
return $value;
}
public function getName()
{
return 'base_extension';
}
}
| thedeedawg/puphpet | src/PuphpetBundle/Twig/BaseExtension.php | PHP | mit | 1,887 |
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// 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 file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
///
// Structure used to represent a web request. The functions of this structure
// may be called on any thread.
///
typedef struct _cef_request_t {
///
// Base structure.
///
cef_base_t base;
///
// Returns true (1) if this object is read-only.
///
int (CEF_CALLBACK *is_read_only)(struct _cef_request_t* self);
///
// Get the fully qualified URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self);
///
// Set the fully qualified URL.
///
void (CEF_CALLBACK *set_url)(struct _cef_request_t* self,
const cef_string_t* url);
///
// Get the request function type. The value will default to POST if post data
// is provided and GET otherwise.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self);
///
// Set the request function type.
///
void (CEF_CALLBACK *set_method)(struct _cef_request_t* self,
const cef_string_t* method);
///
// Get the post data.
///
struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)(
struct _cef_request_t* self);
///
// Set the post data.
///
void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self,
struct _cef_post_data_t* postData);
///
// Get the header values.
///
void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self,
cef_string_multimap_t headerMap);
///
// Set the header values.
///
void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self,
cef_string_multimap_t headerMap);
///
// Set all values at one time.
///
void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url,
const cef_string_t* method, struct _cef_post_data_t* postData,
cef_string_multimap_t headerMap);
///
// Get the flags used in combination with cef_urlrequest_t. See
// cef_urlrequest_flags_t for supported values.
///
int (CEF_CALLBACK *get_flags)(struct _cef_request_t* self);
///
// Set the flags used in combination with cef_urlrequest_t. See
// cef_urlrequest_flags_t for supported values.
///
void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self, int flags);
///
// Set the URL to the first party for cookies used in combination with
// cef_urlrequest_t.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)(
struct _cef_request_t* self);
///
// Get the URL to the first party for cookies used in combination with
// cef_urlrequest_t.
///
void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self,
const cef_string_t* url);
} cef_request_t;
///
// Create a new cef_request_t object.
///
CEF_EXPORT cef_request_t* cef_request_create();
///
// Structure used to represent post data for a web request. The functions of
// this structure may be called on any thread.
///
typedef struct _cef_post_data_t {
///
// Base structure.
///
cef_base_t base;
///
// Returns true (1) if this object is read-only.
///
int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_t* self);
///
// Returns the number of existing post data elements.
///
size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self);
///
// Retrieve the post data elements.
///
void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self,
size_t* elementsCount, struct _cef_post_data_element_t** elements);
///
// Remove the specified post data element. Returns true (1) if the removal
// succeeds.
///
int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self,
struct _cef_post_data_element_t* element);
///
// Add the specified post data element. Returns true (1) if the add succeeds.
///
int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self,
struct _cef_post_data_element_t* element);
///
// Remove all existing post data elements.
///
void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self);
} cef_post_data_t;
///
// Create a new cef_post_data_t object.
///
CEF_EXPORT cef_post_data_t* cef_post_data_create();
///
// Structure used to represent a single element in the request post data. The
// functions of this structure may be called on any thread.
///
typedef struct _cef_post_data_element_t {
///
// Base structure.
///
cef_base_t base;
///
// Returns true (1) if this object is read-only.
///
int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_element_t* self);
///
// Remove all contents from the post data element.
///
void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self);
///
// The post data element will represent a file.
///
void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self,
const cef_string_t* fileName);
///
// The post data element will represent bytes. The bytes passed in will be
// copied.
///
void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self,
size_t size, const void* bytes);
///
// Return the type of this post data element.
///
enum cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
struct _cef_post_data_element_t* self);
///
// Return the file name.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_file)(
struct _cef_post_data_element_t* self);
///
// Return the number of bytes.
///
size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self);
///
// Read up to |size| bytes into |bytes| and return the number of bytes
// actually read.
///
size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self,
size_t size, void* bytes);
} cef_post_data_element_t;
///
// Create a new cef_post_data_element_t object.
///
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
| neelance/ffi_gen | test/headers/cef/include/capi/cef_request_capi.h | C | mit | 8,232 |
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pycrunchbase.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pycrunchbase.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/pycrunchbase"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pycrunchbase"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
| alabid/pycrunchbase | docs/Makefile | Makefile | mit | 7,072 |
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
*
* 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 hudson.model;
import hudson.model.MultiStageTimeSeries.TimeScale;
import hudson.model.queue.SubTask;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import org.jfree.chart.JFreeChart;
import org.junit.Test;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author Kohsuke Kawaguchi
*/
public class LoadStatisticsTest {
@Test
public void graph() throws IOException {
LoadStatistics ls = new LoadStatistics(0, 0) {
public int computeIdleExecutors() {
throw new UnsupportedOperationException();
}
public int computeTotalExecutors() {
throw new UnsupportedOperationException();
}
public int computeQueueLength() {
throw new UnsupportedOperationException();
}
@Override
protected Iterable<Node> getNodes() {
throw new UnsupportedOperationException();
}
@Override
protected boolean matches(Queue.Item item, SubTask subTask) {
throw new UnsupportedOperationException();
}
};
for (int i = 0; i < 50; i++) {
ls.onlineExecutors.update(4);
ls.busyExecutors.update(3);
ls.availableExecutors.update(1);
ls.queueLength.update(3);
}
for (int i = 0; i < 50; i++) {
ls.onlineExecutors.update(0);
ls.busyExecutors.update(0);
ls.availableExecutors.update(0);
ls.queueLength.update(1);
}
JFreeChart chart = ls.createTrendChart(TimeScale.SEC10).createChart();
BufferedImage image = chart.createBufferedImage(400, 200);
File tempFile = File.createTempFile("chart-", "png");
try (OutputStream os = Files.newOutputStream(tempFile.toPath(), StandardOpenOption.DELETE_ON_CLOSE)) {
ImageIO.write(image, "PNG", os);
} finally {
tempFile.delete();
}
}
@Test
public void isModernWorks() throws Exception {
assertThat(LoadStatistics.isModern(Modern.class), is(true));
assertThat(LoadStatistics.isModern(LoadStatistics.class), is(false));
}
private static class Modern extends LoadStatistics {
protected Modern(int initialOnlineExecutors, int initialBusyExecutors) {
super(initialOnlineExecutors, initialBusyExecutors);
}
@Override
public int computeIdleExecutors() {
return 0;
}
@Override
public int computeTotalExecutors() {
return 0;
}
@Override
public int computeQueueLength() {
return 0;
}
@Override
protected Iterable<Node> getNodes() {
return null;
}
@Override
protected boolean matches(Queue.Item item, SubTask subTask) {
return false;
}
}
}
| oleg-nenashev/jenkins | core/src/test/java/hudson/model/LoadStatisticsTest.java | Java | mit | 4,339 |
/// <reference path="../../../type-declarations/index.d.ts" />
import * as Phaser from 'phaser';
import { BootState } from './states/boot';
import { SplashState } from './states/splash';
import { GameState } from './states/game';
class Game extends Phaser.Game {
constructor() {
let width = document.documentElement.clientWidth > 768 * 1.4 // make room for chat
? 768
: document.documentElement.clientWidth * 0.7;
let height = document.documentElement.clientHeight > 1024 * 1.67 // give navbar some room
? 1024
: document.documentElement.clientHeight * 0.6;
super(width, height, Phaser.AUTO, 'game', null, false, false);
this.state.add('Boot', BootState, false);
this.state.add('Splash', SplashState, false);
this.state.add('Game', GameState, false);
this.state.start('Boot');
}
}
export const runGame = () => {
new Game();
} | fuzzwizard/builders-game | src/client/game/index.ts | TypeScript | mit | 890 |
<h1>Kitchen List</h1>
<div id="p_be_list">
<div class="table">
<div class="body">
<table>
<thead>
<tr>
<th colspan="2"><?php echo __('Name')?></th>
</tr>
</thead>
<tbody>
<?php if ($kitchen_list->count() !== false && $kitchen_list->count() == 0): ?>
<tr class="row_0">
<td colspan="2"><?php echo __('No Results') ?></td>
</tr>
<?php else: ?>
<?php foreach ($kitchen_list as $key => $kitchen): ?>
<tr class="<?php if ($key % 2 == 0) echo "row_0"; else echo "row_1"; ?>">
<td width="98%"><?php echo $kitchen->getName() ?></td>
<td width="2%"><a href="<?php echo url_for('kitchen/edit?id='.$kitchen->getId()) ?>"><?php echo image_tag('famfamicons/application_edit.png') ?></a></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th colspan="2" class="textright">
<a href="<?php echo url_for('kitchen/new') ?>" title="New">New</a>
</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div> | xop32/propertyx | apps/be/modules/kitchen/templates/indexSuccess.php | PHP | mit | 1,100 |
import { c } from 'ttag';
export class ImportFatalError extends Error {
error: Error;
constructor(error: Error) {
super(c('Error importing calendar').t`An unexpected error occurred. Import must be restarted.`);
this.error = error;
Object.setPrototypeOf(this, ImportFatalError.prototype);
}
}
| ProtonMail/WebClient | packages/shared/lib/contacts/errors/ImportFatalError.ts | TypeScript | mit | 330 |
package com.xruby.runtime.lang;
public abstract class RubyConstant extends RubyBasic {
public static RubyConstant QFALSE = new RubyConstant(RubyRuntime.FalseClassClass) {
public boolean isTrue() {
return false;
}
};
public static RubyConstant QTRUE = new RubyConstant(RubyRuntime.TrueClassClass) {
public boolean isTrue() {
return true;
}
};
public static RubyConstant QNIL = new RubyConstant(RubyRuntime.NilClassClass) {
public boolean isTrue() {
return false;
}
public String toStr() {
throw new RubyException(RubyRuntime.TypeErrorClass, "Cannot convert nil into String");
}
};
private RubyConstant(RubyClass c) {
super(c);
}
}
| Yashi100/rhodes3.3.2 | platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyConstant.java | Java | mit | 802 |
// This file was generated based on '(multiple files)'.
// WARNING: Changes might be lost if you edit this file directly.
#include <Fuse.Drawing.Meshes.MeshGenerator.h>
#include <Fuse.Entities.Mesh.h>
#include <Fuse.Entities.MeshHitTestMode.h>
#include <Fuse.Entities.Primitives.ConeRenderer.h>
#include <Fuse.Entities.Primitives.CubeRenderer.h>
#include <Fuse.Entities.Primitives.CylinderRenderer.h>
#include <Fuse.Entities.Primitives.SphereRenderer.h>
#include <Uno.Bool.h>
#include <Uno.Content.Models.ModelMesh.h>
#include <Uno.Float.h>
#include <Uno.Float3.h>
#include <Uno.Int.h>
static uType* TYPES[1];
namespace g{
namespace Fuse{
namespace Entities{
namespace Primitives{
// C:\ProgramData\Uno\Packages\Fuse.Entities\0.18.8\$.uno(1788)
// ------------------------------------------------------------
// public sealed class ConeRenderer :1788
// {
::g::Fuse::Entities::MeshRenderer_type* ConeRenderer_typeof()
{
static uSStrong< ::g::Fuse::Entities::MeshRenderer_type*> type;
if (type != NULL) return type;
uTypeOptions options;
options.FieldCount = 6;
options.ObjectSize = sizeof(ConeRenderer);
options.TypeSize = sizeof(::g::Fuse::Entities::MeshRenderer_type);
type = (::g::Fuse::Entities::MeshRenderer_type*)uClassType::New("Fuse.Entities.Primitives.ConeRenderer", options);
type->SetBase(::g::Fuse::Entities::MeshRenderer_typeof());
type->fp_ctor_ = (void*)ConeRenderer__New2_fn;
::TYPES[0] = ::g::Fuse::Entities::MeshRenderer_typeof();
type->SetFields(6);
type->Reflection.SetFunctions(1,
new uFunction(".ctor", NULL, (void*)ConeRenderer__New2_fn, 0, true, ConeRenderer_typeof(), 0));
return type;
}
// public ConeRenderer() :1790
void ConeRenderer__ctor_2_fn(ConeRenderer* __this)
{
__this->ctor_2();
}
// public ConeRenderer New() :1790
void ConeRenderer__New2_fn(ConeRenderer** __retval)
{
*__retval = ConeRenderer::New2();
}
// public ConeRenderer() [instance] :1790
void ConeRenderer::ctor_2()
{
ctor_1();
Mesh(::g::Fuse::Entities::Mesh::New2(::g::Fuse::Drawing::Meshes::MeshGenerator::CreateCone(10.0f, 5.0f, 16, 16)));
}
// public ConeRenderer New() [static] :1790
ConeRenderer* ConeRenderer::New2()
{
ConeRenderer* obj1 = (ConeRenderer*)uNew(ConeRenderer_typeof());
obj1->ctor_2();
return obj1;
}
// }
// C:\ProgramData\Uno\Packages\Fuse.Entities\0.18.8\$.uno(1729)
// ------------------------------------------------------------
// public sealed class CubeRenderer :1729
// {
::g::Fuse::Entities::MeshRenderer_type* CubeRenderer_typeof()
{
static uSStrong< ::g::Fuse::Entities::MeshRenderer_type*> type;
if (type != NULL) return type;
uTypeOptions options;
options.FieldCount = 6;
options.ObjectSize = sizeof(CubeRenderer);
options.TypeSize = sizeof(::g::Fuse::Entities::MeshRenderer_type);
type = (::g::Fuse::Entities::MeshRenderer_type*)uClassType::New("Fuse.Entities.Primitives.CubeRenderer", options);
type->SetBase(::g::Fuse::Entities::MeshRenderer_typeof());
type->fp_ctor_ = (void*)CubeRenderer__New2_fn;
::TYPES[0] = ::g::Fuse::Entities::MeshRenderer_typeof();
type->SetFields(6);
type->Reflection.SetFunctions(1,
new uFunction(".ctor", NULL, (void*)CubeRenderer__New2_fn, 0, true, CubeRenderer_typeof(), 0));
return type;
}
// public CubeRenderer() :1731
void CubeRenderer__ctor_2_fn(CubeRenderer* __this)
{
__this->ctor_2();
}
// public CubeRenderer New() :1731
void CubeRenderer__New2_fn(CubeRenderer** __retval)
{
*__retval = CubeRenderer::New2();
}
// public CubeRenderer() [instance] :1731
void CubeRenderer::ctor_2()
{
ctor_1();
Mesh(::g::Fuse::Entities::Mesh::New2(::g::Fuse::Drawing::Meshes::MeshGenerator::CreateCube(::g::Uno::Float3__New1(0.0f), 5.0f)));
HitTestMode(1);
}
// public CubeRenderer New() [static] :1731
CubeRenderer* CubeRenderer::New2()
{
CubeRenderer* obj1 = (CubeRenderer*)uNew(CubeRenderer_typeof());
obj1->ctor_2();
return obj1;
}
// }
// C:\ProgramData\Uno\Packages\Fuse.Entities\0.18.8\$.uno(1797)
// ------------------------------------------------------------
// public sealed class CylinderRenderer :1797
// {
::g::Fuse::Entities::MeshRenderer_type* CylinderRenderer_typeof()
{
static uSStrong< ::g::Fuse::Entities::MeshRenderer_type*> type;
if (type != NULL) return type;
uTypeOptions options;
options.FieldCount = 6;
options.ObjectSize = sizeof(CylinderRenderer);
options.TypeSize = sizeof(::g::Fuse::Entities::MeshRenderer_type);
type = (::g::Fuse::Entities::MeshRenderer_type*)uClassType::New("Fuse.Entities.Primitives.CylinderRenderer", options);
type->SetBase(::g::Fuse::Entities::MeshRenderer_typeof());
type->fp_ctor_ = (void*)CylinderRenderer__New2_fn;
::TYPES[0] = ::g::Fuse::Entities::MeshRenderer_typeof();
type->SetFields(6);
type->Reflection.SetFunctions(1,
new uFunction(".ctor", NULL, (void*)CylinderRenderer__New2_fn, 0, true, CylinderRenderer_typeof(), 0));
return type;
}
// public CylinderRenderer() :1799
void CylinderRenderer__ctor_2_fn(CylinderRenderer* __this)
{
__this->ctor_2();
}
// public CylinderRenderer New() :1799
void CylinderRenderer__New2_fn(CylinderRenderer** __retval)
{
*__retval = CylinderRenderer::New2();
}
// public CylinderRenderer() [instance] :1799
void CylinderRenderer::ctor_2()
{
ctor_1();
Mesh(::g::Fuse::Entities::Mesh::New2(::g::Fuse::Drawing::Meshes::MeshGenerator::CreateCylinder(10.0f, 5.0f, 16, 16)));
}
// public CylinderRenderer New() [static] :1799
CylinderRenderer* CylinderRenderer::New2()
{
CylinderRenderer* obj1 = (CylinderRenderer*)uNew(CylinderRenderer_typeof());
obj1->ctor_2();
return obj1;
}
// }
// C:\ProgramData\Uno\Packages\Fuse.Entities\0.18.8\$.uno(1739)
// ------------------------------------------------------------
// public sealed class SphereRenderer :1739
// {
::g::Fuse::Entities::MeshRenderer_type* SphereRenderer_typeof()
{
static uSStrong< ::g::Fuse::Entities::MeshRenderer_type*> type;
if (type != NULL) return type;
uTypeOptions options;
options.FieldCount = 9;
options.ObjectSize = sizeof(SphereRenderer);
options.TypeSize = sizeof(::g::Fuse::Entities::MeshRenderer_type);
type = (::g::Fuse::Entities::MeshRenderer_type*)uClassType::New("Fuse.Entities.Primitives.SphereRenderer", options);
type->SetBase(::g::Fuse::Entities::MeshRenderer_typeof());
type->fp_ctor_ = (void*)SphereRenderer__New2_fn;
type->fp_Validate = (void(*)(::g::Fuse::Entities::MeshRenderer*))SphereRenderer__Validate_fn;
::TYPES[0] = ::g::Fuse::Entities::MeshRenderer_typeof();
type->SetFields(6,
::g::Uno::Bool_typeof(), offsetof(::g::Fuse::Entities::Primitives::SphereRenderer, _isDirty), 0,
::g::Uno::Int_typeof(), offsetof(::g::Fuse::Entities::Primitives::SphereRenderer, _quality), 0,
::g::Uno::Float_typeof(), offsetof(::g::Fuse::Entities::Primitives::SphereRenderer, _radius), 0);
type->Reflection.SetFunctions(5,
new uFunction(".ctor", NULL, (void*)SphereRenderer__New2_fn, 0, true, SphereRenderer_typeof(), 0),
new uFunction("get_Quality", NULL, (void*)SphereRenderer__get_Quality_fn, 0, false, ::g::Uno::Int_typeof(), 0),
new uFunction("set_Quality", NULL, (void*)SphereRenderer__set_Quality_fn, 0, false, uVoid_typeof(), 1, ::g::Uno::Int_typeof()),
new uFunction("get_Radius", NULL, (void*)SphereRenderer__get_Radius_fn, 0, false, ::g::Uno::Float_typeof(), 0),
new uFunction("set_Radius", NULL, (void*)SphereRenderer__set_Radius_fn, 0, false, uVoid_typeof(), 1, ::g::Uno::Float_typeof()));
return type;
}
// public SphereRenderer() :1771
void SphereRenderer__ctor_2_fn(SphereRenderer* __this)
{
__this->ctor_2();
}
// public SphereRenderer New() :1771
void SphereRenderer__New2_fn(SphereRenderer** __retval)
{
*__retval = SphereRenderer::New2();
}
// public int get_Quality() :1760
void SphereRenderer__get_Quality_fn(SphereRenderer* __this, int* __retval)
{
*__retval = __this->Quality();
}
// public void set_Quality(int value) :1761
void SphereRenderer__set_Quality_fn(SphereRenderer* __this, int* value)
{
__this->Quality(*value);
}
// public float get_Radius() :1746
void SphereRenderer__get_Radius_fn(SphereRenderer* __this, float* __retval)
{
*__retval = __this->Radius();
}
// public void set_Radius(float value) :1747
void SphereRenderer__set_Radius_fn(SphereRenderer* __this, float* value)
{
__this->Radius(*value);
}
// protected override sealed void Validate() :1776
void SphereRenderer__Validate_fn(SphereRenderer* __this)
{
if (__this->_isDirty || (__this->Mesh() == NULL))
{
if (__this->Mesh() != NULL)
uPtr(__this->Mesh())->Dispose();
__this->Mesh(::g::Fuse::Entities::Mesh::New2(::g::Fuse::Drawing::Meshes::MeshGenerator::CreateSphere(::g::Uno::Float3__New1(0.0f), __this->_radius, __this->_quality, __this->_quality)));
__this->_isDirty = false;
}
}
// public SphereRenderer() [instance] :1771
void SphereRenderer::ctor_2()
{
_radius = 5.0f;
_quality = 16;
ctor_1();
HitTestMode(2);
}
// public int get_Quality() [instance] :1760
int SphereRenderer::Quality()
{
return _quality;
}
// public void set_Quality(int value) [instance] :1761
void SphereRenderer::Quality(int value)
{
if (_quality != value)
{
_quality = value;
_isDirty = true;
}
}
// public float get_Radius() [instance] :1746
float SphereRenderer::Radius()
{
return _radius;
}
// public void set_Radius(float value) [instance] :1747
void SphereRenderer::Radius(float value)
{
if (_radius != value)
{
_radius = value;
_isDirty = true;
}
}
// public SphereRenderer New() [static] :1771
SphereRenderer* SphereRenderer::New2()
{
SphereRenderer* obj1 = (SphereRenderer*)uNew(SphereRenderer_typeof());
obj1->ctor_2();
return obj1;
}
// }
}}}} // ::g::Fuse::Entities::Primitives
| blyk/BlackCode-Fuse | TestApp/.build/Simulator/Android/jni/Fuse.Entities.Primitives.g.cpp | C++ | mit | 9,980 |
game.LoadProfile = me.ScreenObject.extend({
/**
* action to perform on state change
*/
onResetEvent: function() {
me.game.world.addChild(new me.Sprite(0, 0, me.loader.getImage('load-screen')), -10);
//puts load screen in when game starts
document.getElementById("input").style.visibility = "visible";
document.getElementById("load").style.visibility = "visible";
me.input.unbindKey(me.input.KEY.B);
me.input.unbindKey(me.input.KEY.I);
me.input.unbindKey(me.input.KEY.O);
me.input.unbindKey(me.input.KEY.P);
me.input.unbindKey(me.input.KEY.SPACE);
//unbinds keys
var exp1cost = ((game.data.exp1 + 1) * 10);
var exp2cost = ((game.data.exp2 + 1) * 10);
var exp3cost = ((game.data.exp3 + 1) * 10);
var exp4cost = ((game.data.exp4 + 1) * 10);
me.game.world.addChild(new (me.Renderable.extend({
init: function() {
this._super(me.Renderable, 'init', [10, 10, 300, 50]);
this.font = new me.Font("Arial", 26, "white");
},
draw: function(renderer) {
this.font.draw(renderer.getContext(), "Enter Username & Password", this.pos.x, this.pos.y);
}
})));
},
/**
* action to perform when leaving this screen (state change)
*/
onDestroyEvent: function() {
document.getElementById("input").style.visibility = "hidden";
document.getElementById("load").style.visibility = "hidden";
}
}); | MrLarrimore/MiguelRicardo | js/screens/loadProfile.js | JavaScript | mit | 1,578 |
/*
---
MooTools: the javascript framework
web build:
- http://mootools.net/core/8423c12ffd6a6bfcde9ea22554aec795
packager build:
- packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady
...
*/
/*
---
name: Core
description: The heart of MooTools.
license: MIT-style license.
copyright: Copyright (c) 2006-2012 [Valerio Proietti](http://mad4milk.net/).
authors: The MooTools production team (http://mootools.net/developers/)
inspiration:
- Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php)
- Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php)
provides: [Core, MooTools, Type, typeOf, instanceOf, Native]
...
*/
(function(){
this.MooTools = {
version: '1.4.5',
build: 'ab8ea8824dc3b24b6666867a2c4ed58ebb762cf0'
};
// typeOf, instanceOf
var typeOf = this.typeOf = function(item){
if (item == null) return 'null';
if (item.$family != null) return item.$family();
if (item.nodeName){
if (item.nodeType == 1) return 'element';
if (item.nodeType == 3) return (/\S/).test(item.nodeValue) ? 'textnode' : 'whitespace';
} else if (typeof item.length == 'number'){
if (item.callee) return 'arguments';
if ('item' in item) return 'collection';
}
return typeof item;
};
var instanceOf = this.instanceOf = function(item, object){
if (item == null) return false;
var constructor = item.$constructor || item.constructor;
while (constructor){
if (constructor === object) return true;
constructor = constructor.parent;
}
/*<ltIE8>*/
if (!item.hasOwnProperty) return false;
/*</ltIE8>*/
return item instanceof object;
};
// Function overloading
var Function = this.Function;
var enumerables = true;
for (var i in {toString: 1}) enumerables = null;
if (enumerables) enumerables = ['hasOwnProperty', 'valueOf', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'constructor'];
Function.prototype.overloadSetter = function(usePlural){
var self = this;
return function(a, b){
if (a == null) return this;
if (usePlural || typeof a != 'string'){
for (var k in a) self.call(this, k, a[k]);
if (enumerables) for (var i = enumerables.length; i--;){
k = enumerables[i];
if (a.hasOwnProperty(k)) self.call(this, k, a[k]);
}
} else {
self.call(this, a, b);
}
return this;
};
};
Function.prototype.overloadGetter = function(usePlural){
var self = this;
return function(a){
var args, result;
if (typeof a != 'string') args = a;
else if (arguments.length > 1) args = arguments;
else if (usePlural) args = [a];
if (args){
result = {};
for (var i = 0; i < args.length; i++) result[args[i]] = self.call(this, args[i]);
} else {
result = self.call(this, a);
}
return result;
};
};
Function.prototype.extend = function(key, value){
this[key] = value;
}.overloadSetter();
Function.prototype.implement = function(key, value){
this.prototype[key] = value;
}.overloadSetter();
// From
var slice = Array.prototype.slice;
Function.from = function(item){
return (typeOf(item) == 'function') ? item : function(){
return item;
};
};
Array.from = function(item){
if (item == null) return [];
return (Type.isEnumerable(item) && typeof item != 'string') ? (typeOf(item) == 'array') ? item : slice.call(item) : [item];
};
Number.from = function(item){
var number = parseFloat(item);
return isFinite(number) ? number : null;
};
String.from = function(item){
return item + '';
};
// hide, protect
Function.implement({
hide: function(){
this.$hidden = true;
return this;
},
protect: function(){
this.$protected = true;
return this;
}
});
// Type
var Type = this.Type = function(name, object){
if (name){
var lower = name.toLowerCase();
var typeCheck = function(item){
return (typeOf(item) == lower);
};
Type['is' + name] = typeCheck;
if (object != null){
object.prototype.$family = (function(){
return lower;
}).hide();
}
}
if (object == null) return null;
object.extend(this);
object.$constructor = Type;
object.prototype.$constructor = object;
return object;
};
var toString = Object.prototype.toString;
Type.isEnumerable = function(item){
return (item != null && typeof item.length == 'number' && toString.call(item) != '[object Function]' );
};
var hooks = {};
var hooksOf = function(object){
var type = typeOf(object.prototype);
return hooks[type] || (hooks[type] = []);
};
var implement = function(name, method){
if (method && method.$hidden) return;
var hooks = hooksOf(this);
for (var i = 0; i < hooks.length; i++){
var hook = hooks[i];
if (typeOf(hook) == 'type') implement.call(hook, name, method);
else hook.call(this, name, method);
}
var previous = this.prototype[name];
if (previous == null || !previous.$protected) this.prototype[name] = method;
if (this[name] == null && typeOf(method) == 'function') extend.call(this, name, function(item){
return method.apply(item, slice.call(arguments, 1));
});
};
var extend = function(name, method){
if (method && method.$hidden) return;
var previous = this[name];
if (previous == null || !previous.$protected) this[name] = method;
};
Type.implement({
implement: implement.overloadSetter(),
extend: extend.overloadSetter(),
alias: function(name, existing){
implement.call(this, name, this.prototype[existing]);
}.overloadSetter(),
mirror: function(hook){
hooksOf(this).push(hook);
return this;
}
});
new Type('Type', Type);
// Default Types
var force = function(name, object, methods){
var isType = (object != Object),
prototype = object.prototype;
if (isType) object = new Type(name, object);
for (var i = 0, l = methods.length; i < l; i++){
var key = methods[i],
generic = object[key],
proto = prototype[key];
if (generic) generic.protect();
if (isType && proto) object.implement(key, proto.protect());
}
if (isType){
var methodsEnumerable = prototype.propertyIsEnumerable(methods[0]);
object.forEachMethod = function(fn){
if (!methodsEnumerable) for (var i = 0, l = methods.length; i < l; i++){
fn.call(prototype, prototype[methods[i]], methods[i]);
}
for (var key in prototype) fn.call(prototype, prototype[key], key)
};
}
return force;
};
force('String', String, [
'charAt', 'charCodeAt', 'concat', 'indexOf', 'lastIndexOf', 'match', 'quote', 'replace', 'search',
'slice', 'split', 'substr', 'substring', 'trim', 'toLowerCase', 'toUpperCase'
])('Array', Array, [
'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice',
'indexOf', 'lastIndexOf', 'filter', 'forEach', 'every', 'map', 'some', 'reduce', 'reduceRight'
])('Number', Number, [
'toExponential', 'toFixed', 'toLocaleString', 'toPrecision'
])('Function', Function, [
'apply', 'call', 'bind'
])('RegExp', RegExp, [
'exec', 'test'
])('Object', Object, [
'create', 'defineProperty', 'defineProperties', 'keys',
'getPrototypeOf', 'getOwnPropertyDescriptor', 'getOwnPropertyNames',
'preventExtensions', 'isExtensible', 'seal', 'isSealed', 'freeze', 'isFrozen'
])('Date', Date, ['now']);
Object.extend = extend.overloadSetter();
Date.extend('now', function(){
return +(new Date);
});
new Type('Boolean', Boolean);
// fixes NaN returning as Number
Number.prototype.$family = function(){
return isFinite(this) ? 'number' : 'null';
}.hide();
// Number.random
Number.extend('random', function(min, max){
return Math.floor(Math.random() * (max - min + 1) + min);
});
// forEach, each
var hasOwnProperty = Object.prototype.hasOwnProperty;
Object.extend('forEach', function(object, fn, bind){
for (var key in object){
if (hasOwnProperty.call(object, key)) fn.call(bind, object[key], key, object);
}
});
Object.each = Object.forEach;
Array.implement({
forEach: function(fn, bind){
for (var i = 0, l = this.length; i < l; i++){
if (i in this) fn.call(bind, this[i], i, this);
}
},
each: function(fn, bind){
Array.forEach(this, fn, bind);
return this;
}
});
// Array & Object cloning, Object merging and appending
var cloneOf = function(item){
switch (typeOf(item)){
case 'array': return item.clone();
case 'object': return Object.clone(item);
default: return item;
}
};
Array.implement('clone', function(){
var i = this.length, clone = new Array(i);
while (i--) clone[i] = cloneOf(this[i]);
return clone;
});
var mergeOne = function(source, key, current){
switch (typeOf(current)){
case 'object':
if (typeOf(source[key]) == 'object') Object.merge(source[key], current);
else source[key] = Object.clone(current);
break;
case 'array': source[key] = current.clone(); break;
default: source[key] = current;
}
return source;
};
Object.extend({
merge: function(source, k, v){
if (typeOf(k) == 'string') return mergeOne(source, k, v);
for (var i = 1, l = arguments.length; i < l; i++){
var object = arguments[i];
for (var key in object) mergeOne(source, key, object[key]);
}
return source;
},
clone: function(object){
var clone = {};
for (var key in object) clone[key] = cloneOf(object[key]);
return clone;
},
append: function(original){
for (var i = 1, l = arguments.length; i < l; i++){
var extended = arguments[i] || {};
for (var key in extended) original[key] = extended[key];
}
return original;
}
});
// Object-less types
['Object', 'WhiteSpace', 'TextNode', 'Collection', 'Arguments'].each(function(name){
new Type(name);
});
// Unique ID
var UID = Date.now();
String.extend('uniqueID', function(){
return (UID++).toString(36);
});
})();
/*
---
name: Array
description: Contains Array Prototypes like each, contains, and erase.
license: MIT-style license.
requires: Type
provides: Array
...
*/
Array.implement({
/*<!ES5>*/
every: function(fn, bind){
for (var i = 0, l = this.length >>> 0; i < l; i++){
if ((i in this) && !fn.call(bind, this[i], i, this)) return false;
}
return true;
},
filter: function(fn, bind){
var results = [];
for (var value, i = 0, l = this.length >>> 0; i < l; i++) if (i in this){
value = this[i];
if (fn.call(bind, value, i, this)) results.push(value);
}
return results;
},
indexOf: function(item, from){
var length = this.length >>> 0;
for (var i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++){
if (this[i] === item) return i;
}
return -1;
},
map: function(fn, bind){
var length = this.length >>> 0, results = Array(length);
for (var i = 0; i < length; i++){
if (i in this) results[i] = fn.call(bind, this[i], i, this);
}
return results;
},
some: function(fn, bind){
for (var i = 0, l = this.length >>> 0; i < l; i++){
if ((i in this) && fn.call(bind, this[i], i, this)) return true;
}
return false;
},
/*</!ES5>*/
clean: function(){
return this.filter(function(item){
return item != null;
});
},
invoke: function(methodName){
var args = Array.slice(arguments, 1);
return this.map(function(item){
return item[methodName].apply(item, args);
});
},
associate: function(keys){
var obj = {}, length = Math.min(this.length, keys.length);
for (var i = 0; i < length; i++) obj[keys[i]] = this[i];
return obj;
},
link: function(object){
var result = {};
for (var i = 0, l = this.length; i < l; i++){
for (var key in object){
if (object[key](this[i])){
result[key] = this[i];
delete object[key];
break;
}
}
}
return result;
},
contains: function(item, from){
return this.indexOf(item, from) != -1;
},
append: function(array){
this.push.apply(this, array);
return this;
},
getLast: function(){
return (this.length) ? this[this.length - 1] : null;
},
getRandom: function(){
return (this.length) ? this[Number.random(0, this.length - 1)] : null;
},
include: function(item){
if (!this.contains(item)) this.push(item);
return this;
},
combine: function(array){
for (var i = 0, l = array.length; i < l; i++) this.include(array[i]);
return this;
},
erase: function(item){
for (var i = this.length; i--;){
if (this[i] === item) this.splice(i, 1);
}
return this;
},
empty: function(){
this.length = 0;
return this;
},
flatten: function(){
var array = [];
for (var i = 0, l = this.length; i < l; i++){
var type = typeOf(this[i]);
if (type == 'null') continue;
array = array.concat((type == 'array' || type == 'collection' || type == 'arguments' || instanceOf(this[i], Array)) ? Array.flatten(this[i]) : this[i]);
}
return array;
},
pick: function(){
for (var i = 0, l = this.length; i < l; i++){
if (this[i] != null) return this[i];
}
return null;
},
hexToRgb: function(array){
if (this.length != 3) return null;
var rgb = this.map(function(value){
if (value.length == 1) value += value;
return value.toInt(16);
});
return (array) ? rgb : 'rgb(' + rgb + ')';
},
rgbToHex: function(array){
if (this.length < 3) return null;
if (this.length == 4 && this[3] == 0 && !array) return 'transparent';
var hex = [];
for (var i = 0; i < 3; i++){
var bit = (this[i] - 0).toString(16);
hex.push((bit.length == 1) ? '0' + bit : bit);
}
return (array) ? hex : '#' + hex.join('');
}
});
/*
---
name: String
description: Contains String Prototypes like camelCase, capitalize, test, and toInt.
license: MIT-style license.
requires: Type
provides: String
...
*/
String.implement({
test: function(regex, params){
return ((typeOf(regex) == 'regexp') ? regex : new RegExp('' + regex, params)).test(this);
},
contains: function(string, separator){
return (separator) ? (separator + this + separator).indexOf(separator + string + separator) > -1 : String(this).indexOf(string) > -1;
},
trim: function(){
return String(this).replace(/^\s+|\s+$/g, '');
},
clean: function(){
return String(this).replace(/\s+/g, ' ').trim();
},
camelCase: function(){
return String(this).replace(/-\D/g, function(match){
return match.charAt(1).toUpperCase();
});
},
hyphenate: function(){
return String(this).replace(/[A-Z]/g, function(match){
return ('-' + match.charAt(0).toLowerCase());
});
},
capitalize: function(){
return String(this).replace(/\b[a-z]/g, function(match){
return match.toUpperCase();
});
},
escapeRegExp: function(){
return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1');
},
toInt: function(base){
return parseInt(this, base || 10);
},
toFloat: function(){
return parseFloat(this);
},
hexToRgb: function(array){
var hex = String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
return (hex) ? hex.slice(1).hexToRgb(array) : null;
},
rgbToHex: function(array){
var rgb = String(this).match(/\d{1,3}/g);
return (rgb) ? rgb.rgbToHex(array) : null;
},
substitute: function(object, regexp){
return String(this).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
if (match.charAt(0) == '\\') return match.slice(1);
return (object[name] != null) ? object[name] : '';
});
}
});
/*
---
name: Number
description: Contains Number Prototypes like limit, round, times, and ceil.
license: MIT-style license.
requires: Type
provides: Number
...
*/
Number.implement({
limit: function(min, max){
return Math.min(max, Math.max(min, this));
},
round: function(precision){
precision = Math.pow(10, precision || 0).toFixed(precision < 0 ? -precision : 0);
return Math.round(this * precision) / precision;
},
times: function(fn, bind){
for (var i = 0; i < this; i++) fn.call(bind, i, this);
},
toFloat: function(){
return parseFloat(this);
},
toInt: function(base){
return parseInt(this, base || 10);
}
});
Number.alias('each', 'times');
(function(math){
var methods = {};
math.each(function(name){
if (!Number[name]) methods[name] = function(){
return Math[name].apply(null, [this].concat(Array.from(arguments)));
};
});
Number.implement(methods);
})(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']);
/*
---
name: Function
description: Contains Function Prototypes like create, bind, pass, and delay.
license: MIT-style license.
requires: Type
provides: Function
...
*/
Function.extend({
attempt: function(){
for (var i = 0, l = arguments.length; i < l; i++){
try {
return arguments[i]();
} catch (e){}
}
return null;
}
});
Function.implement({
attempt: function(args, bind){
try {
return this.apply(bind, Array.from(args));
} catch (e){}
return null;
},
/*<!ES5-bind>*/
bind: function(that){
var self = this,
args = arguments.length > 1 ? Array.slice(arguments, 1) : null,
F = function(){};
var bound = function(){
var context = that, length = arguments.length;
if (this instanceof bound){
F.prototype = self.prototype;
context = new F;
}
var result = (!args && !length)
? self.call(context)
: self.apply(context, args && length ? args.concat(Array.slice(arguments)) : args || arguments);
return context == that ? result : context;
};
return bound;
},
/*</!ES5-bind>*/
pass: function(args, bind){
var self = this;
if (args != null) args = Array.from(args);
return function(){
return self.apply(bind, args || arguments);
};
},
delay: function(delay, bind, args){
return setTimeout(this.pass((args == null ? [] : args), bind), delay);
},
periodical: function(periodical, bind, args){
return setInterval(this.pass((args == null ? [] : args), bind), periodical);
}
});
/*
---
name: Object
description: Object generic methods
license: MIT-style license.
requires: Type
provides: [Object, Hash]
...
*/
(function(){
var hasOwnProperty = Object.prototype.hasOwnProperty;
Object.extend({
subset: function(object, keys){
var results = {};
for (var i = 0, l = keys.length; i < l; i++){
var k = keys[i];
if (k in object) results[k] = object[k];
}
return results;
},
map: function(object, fn, bind){
var results = {};
for (var key in object){
if (hasOwnProperty.call(object, key)) results[key] = fn.call(bind, object[key], key, object);
}
return results;
},
filter: function(object, fn, bind){
var results = {};
for (var key in object){
var value = object[key];
if (hasOwnProperty.call(object, key) && fn.call(bind, value, key, object)) results[key] = value;
}
return results;
},
every: function(object, fn, bind){
for (var key in object){
if (hasOwnProperty.call(object, key) && !fn.call(bind, object[key], key)) return false;
}
return true;
},
some: function(object, fn, bind){
for (var key in object){
if (hasOwnProperty.call(object, key) && fn.call(bind, object[key], key)) return true;
}
return false;
},
keys: function(object){
var keys = [];
for (var key in object){
if (hasOwnProperty.call(object, key)) keys.push(key);
}
return keys;
},
values: function(object){
var values = [];
for (var key in object){
if (hasOwnProperty.call(object, key)) values.push(object[key]);
}
return values;
},
getLength: function(object){
return Object.keys(object).length;
},
keyOf: function(object, value){
for (var key in object){
if (hasOwnProperty.call(object, key) && object[key] === value) return key;
}
return null;
},
contains: function(object, value){
return Object.keyOf(object, value) != null;
},
toQueryString: function(object, base){
var queryString = [];
Object.each(object, function(value, key){
if (base) key = base + '[' + key + ']';
var result;
switch (typeOf(value)){
case 'object': result = Object.toQueryString(value, key); break;
case 'array':
var qs = {};
value.each(function(val, i){
qs[i] = val;
});
result = Object.toQueryString(qs, key);
break;
default: result = key + '=' + encodeURIComponent(value);
}
if (value != null) queryString.push(result);
});
return queryString.join('&');
}
});
})();
/*
---
name: Browser
description: The Browser Object. Contains Browser initialization, Window and Document, and the Browser Hash.
license: MIT-style license.
requires: [Array, Function, Number, String]
provides: [Browser, Window, Document]
...
*/
(function(){
var document = this.document;
var window = document.window = this;
var ua = navigator.userAgent.toLowerCase(),
platform = navigator.platform.toLowerCase(),
UA = ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/) || [null, 'unknown', 0],
mode = UA[1] == 'ie' && document.documentMode;
var Browser = this.Browser = {
extend: Function.prototype.extend,
name: (UA[1] == 'version') ? UA[3] : UA[1],
version: mode || parseFloat((UA[1] == 'opera' && UA[4]) ? UA[4] : UA[2]),
Platform: {
name: ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match(/(?:webos|android)/) || platform.match(/mac|win|linux/) || ['other'])[0]
},
Features: {
xpath: !!(document.evaluate),
air: !!(window.runtime),
query: !!(document.querySelector),
json: !!(window.JSON)
},
Plugins: {}
};
Browser[Browser.name] = true;
Browser[Browser.name + parseInt(Browser.version, 10)] = true;
Browser.Platform[Browser.Platform.name] = true;
// Request
Browser.Request = (function(){
var XMLHTTP = function(){
return new XMLHttpRequest();
};
var MSXML2 = function(){
return new ActiveXObject('MSXML2.XMLHTTP');
};
var MSXML = function(){
return new ActiveXObject('Microsoft.XMLHTTP');
};
return Function.attempt(function(){
XMLHTTP();
return XMLHTTP;
}, function(){
MSXML2();
return MSXML2;
}, function(){
MSXML();
return MSXML;
});
})();
Browser.Features.xhr = !!(Browser.Request);
// Flash detection
var version = (Function.attempt(function(){
return navigator.plugins['Shockwave Flash'].description;
}, function(){
return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
}) || '0 r0').match(/\d+/g);
Browser.Plugins.Flash = {
version: Number(version[0] || '0.' + version[1]) || 0,
build: Number(version[2]) || 0
};
// String scripts
Browser.exec = function(text){
if (!text) return text;
if (window.execScript){
window.execScript(text);
} else {
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.text = text;
document.head.appendChild(script);
document.head.removeChild(script);
}
return text;
};
String.implement('stripScripts', function(exec){
var scripts = '';
var text = this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(all, code){
scripts += code + '\n';
return '';
});
if (exec === true) Browser.exec(scripts);
else if (typeOf(exec) == 'function') exec(scripts, text);
return text;
});
// Window, Document
Browser.extend({
Document: this.Document,
Window: this.Window,
Element: this.Element,
Event: this.Event
});
this.Window = this.$constructor = new Type('Window', function(){});
this.$family = Function.from('window').hide();
Window.mirror(function(name, method){
window[name] = method;
});
this.Document = document.$constructor = new Type('Document', function(){});
document.$family = Function.from('document').hide();
Document.mirror(function(name, method){
document[name] = method;
});
document.html = document.documentElement;
if (!document.head) document.head = document.getElementsByTagName('head')[0];
if (document.execCommand) try {
document.execCommand("BackgroundImageCache", false, true);
} catch (e){}
/*<ltIE9>*/
if (this.attachEvent && !this.addEventListener){
var unloadEvent = function(){
this.detachEvent('onunload', unloadEvent);
document.head = document.html = document.window = null;
};
this.attachEvent('onunload', unloadEvent);
}
// IE fails on collections and <select>.options (refers to <select>)
var arrayFrom = Array.from;
try {
arrayFrom(document.html.childNodes);
} catch(e){
Array.from = function(item){
if (typeof item != 'string' && Type.isEnumerable(item) && typeOf(item) != 'array'){
var i = item.length, array = new Array(i);
while (i--) array[i] = item[i];
return array;
}
return arrayFrom(item);
};
var prototype = Array.prototype,
slice = prototype.slice;
['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice'].each(function(name){
var method = prototype[name];
Array[name] = function(item){
return method.apply(Array.from(item), slice.call(arguments, 1));
};
});
}
/*</ltIE9>*/
})();
/*
---
name: Event
description: Contains the Event Type, to make the event object cross-browser.
license: MIT-style license.
requires: [Window, Document, Array, Function, String, Object]
provides: Event
...
*/
(function() {
var _keys = {};
var DOMEvent = this.DOMEvent = new Type('DOMEvent', function(event, win){
if (!win) win = window;
event = event || win.event;
if (event.$extended) return event;
this.event = event;
this.$extended = true;
this.shift = event.shiftKey;
this.control = event.ctrlKey;
this.alt = event.altKey;
this.meta = event.metaKey;
var type = this.type = event.type;
var target = event.target || event.srcElement;
while (target && target.nodeType == 3) target = target.parentNode;
this.target = document.id(target);
if (type.indexOf('key') == 0){
var code = this.code = (event.which || event.keyCode);
this.key = _keys[code];
if (type == 'keydown'){
if (code > 111 && code < 124) this.key = 'f' + (code - 111);
else if (code > 95 && code < 106) this.key = code - 96;
}
if (this.key == null) this.key = String.fromCharCode(code).toLowerCase();
} else if (type == 'click' || type == 'dblclick' || type == 'contextmenu' || type == 'DOMMouseScroll' || type.indexOf('mouse') == 0){
var doc = win.document;
doc = (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body;
this.page = {
x: (event.pageX != null) ? event.pageX : event.clientX + doc.scrollLeft,
y: (event.pageY != null) ? event.pageY : event.clientY + doc.scrollTop
};
this.client = {
x: (event.pageX != null) ? event.pageX - win.pageXOffset : event.clientX,
y: (event.pageY != null) ? event.pageY - win.pageYOffset : event.clientY
};
if (type == 'DOMMouseScroll' || type == 'mousewheel')
this.wheel = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3;
this.rightClick = (event.which == 3 || event.button == 2);
if (type == 'mouseover' || type == 'mouseout'){
var related = event.relatedTarget || event[(type == 'mouseover' ? 'from' : 'to') + 'Element'];
while (related && related.nodeType == 3) related = related.parentNode;
this.relatedTarget = document.id(related);
}
} else if (type.indexOf('touch') == 0 || type.indexOf('gesture') == 0){
this.rotation = event.rotation;
this.scale = event.scale;
this.targetTouches = event.targetTouches;
this.changedTouches = event.changedTouches;
var touches = this.touches = event.touches;
if (touches && touches[0]){
var touch = touches[0];
this.page = {x: touch.pageX, y: touch.pageY};
this.client = {x: touch.clientX, y: touch.clientY};
}
}
if (!this.client) this.client = {};
if (!this.page) this.page = {};
});
DOMEvent.implement({
stop: function(){
return this.preventDefault().stopPropagation();
},
stopPropagation: function(){
if (this.event.stopPropagation) this.event.stopPropagation();
else this.event.cancelBubble = true;
return this;
},
preventDefault: function(){
if (this.event.preventDefault) this.event.preventDefault();
else this.event.returnValue = false;
return this;
}
});
DOMEvent.defineKey = function(code, key){
_keys[code] = key;
return this;
};
DOMEvent.defineKeys = DOMEvent.defineKey.overloadSetter(true);
DOMEvent.defineKeys({
'38': 'up', '40': 'down', '37': 'left', '39': 'right',
'27': 'esc', '32': 'space', '8': 'backspace', '9': 'tab',
'46': 'delete', '13': 'enter'
});
})();
/*
---
name: Class
description: Contains the Class Function for easily creating, extending, and implementing reusable Classes.
license: MIT-style license.
requires: [Array, String, Function, Number]
provides: Class
...
*/
(function(){
var Class = this.Class = new Type('Class', function(params){
if (instanceOf(params, Function)) params = {initialize: params};
var newClass = function(){
reset(this);
if (newClass.$prototyping) return this;
this.$caller = null;
var value = (this.initialize) ? this.initialize.apply(this, arguments) : this;
this.$caller = this.caller = null;
return value;
}.extend(this).implement(params);
newClass.$constructor = Class;
newClass.prototype.$constructor = newClass;
newClass.prototype.parent = parent;
return newClass;
});
var parent = function(){
if (!this.$caller) throw new Error('The method "parent" cannot be called.');
var name = this.$caller.$name,
parent = this.$caller.$owner.parent,
previous = (parent) ? parent.prototype[name] : null;
if (!previous) throw new Error('The method "' + name + '" has no parent.');
return previous.apply(this, arguments);
};
var reset = function(object){
for (var key in object){
var value = object[key];
switch (typeOf(value)){
case 'object':
var F = function(){};
F.prototype = value;
object[key] = reset(new F);
break;
case 'array': object[key] = value.clone(); break;
}
}
return object;
};
var wrap = function(self, key, method){
if (method.$origin) method = method.$origin;
var wrapper = function(){
if (method.$protected && this.$caller == null) throw new Error('The method "' + key + '" cannot be called.');
var caller = this.caller, current = this.$caller;
this.caller = current; this.$caller = wrapper;
var result = method.apply(this, arguments);
this.$caller = current; this.caller = caller;
return result;
}.extend({$owner: self, $origin: method, $name: key});
return wrapper;
};
var implement = function(key, value, retain){
if (Class.Mutators.hasOwnProperty(key)){
value = Class.Mutators[key].call(this, value);
if (value == null) return this;
}
if (typeOf(value) == 'function'){
if (value.$hidden) return this;
this.prototype[key] = (retain) ? value : wrap(this, key, value);
} else {
Object.merge(this.prototype, key, value);
}
return this;
};
var getInstance = function(klass){
klass.$prototyping = true;
var proto = new klass;
delete klass.$prototyping;
return proto;
};
Class.implement('implement', implement.overloadSetter());
Class.Mutators = {
Extends: function(parent){
this.parent = parent;
this.prototype = getInstance(parent);
},
Implements: function(items){
Array.from(items).each(function(item){
var instance = new item;
for (var key in instance) implement.call(this, key, instance[key], true);
}, this);
}
};
})();
/*
---
name: Class.Extras
description: Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks.
license: MIT-style license.
requires: Class
provides: [Class.Extras, Chain, Events, Options]
...
*/
(function(){
this.Chain = new Class({
$chain: [],
chain: function(){
this.$chain.append(Array.flatten(arguments));
return this;
},
callChain: function(){
return (this.$chain.length) ? this.$chain.shift().apply(this, arguments) : false;
},
clearChain: function(){
this.$chain.empty();
return this;
}
});
var removeOn = function(string){
return string.replace(/^on([A-Z])/, function(full, first){
return first.toLowerCase();
});
};
this.Events = new Class({
$events: {},
addEvent: function(type, fn, internal){
type = removeOn(type);
this.$events[type] = (this.$events[type] || []).include(fn);
if (internal) fn.internal = true;
return this;
},
addEvents: function(events){
for (var type in events) this.addEvent(type, events[type]);
return this;
},
fireEvent: function(type, args, delay){
type = removeOn(type);
var events = this.$events[type];
if (!events) return this;
args = Array.from(args);
events.each(function(fn){
if (delay) fn.delay(delay, this, args);
else fn.apply(this, args);
}, this);
return this;
},
removeEvent: function(type, fn){
type = removeOn(type);
var events = this.$events[type];
if (events && !fn.internal){
var index = events.indexOf(fn);
if (index != -1) delete events[index];
}
return this;
},
removeEvents: function(events){
var type;
if (typeOf(events) == 'object'){
for (type in events) this.removeEvent(type, events[type]);
return this;
}
if (events) events = removeOn(events);
for (type in this.$events){
if (events && events != type) continue;
var fns = this.$events[type];
for (var i = fns.length; i--;) if (i in fns){
this.removeEvent(type, fns[i]);
}
}
return this;
}
});
this.Options = new Class({
setOptions: function(){
var options = this.options = Object.merge.apply(null, [{}, this.options].append(arguments));
if (this.addEvent) for (var option in options){
if (typeOf(options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue;
this.addEvent(option, options[option]);
delete options[option];
}
return this;
}
});
})();
/*
---
name: Slick.Parser
description: Standalone CSS3 Selector parser
provides: Slick.Parser
...
*/
;(function(){
var parsed,
separatorIndex,
combinatorIndex,
reversed,
cache = {},
reverseCache = {},
reUnescape = /\\/g;
var parse = function(expression, isReversed){
if (expression == null) return null;
if (expression.Slick === true) return expression;
expression = ('' + expression).replace(/^\s+|\s+$/g, '');
reversed = !!isReversed;
var currentCache = (reversed) ? reverseCache : cache;
if (currentCache[expression]) return currentCache[expression];
parsed = {
Slick: true,
expressions: [],
raw: expression,
reverse: function(){
return parse(this.raw, true);
}
};
separatorIndex = -1;
while (expression != (expression = expression.replace(regexp, parser)));
parsed.length = parsed.expressions.length;
return currentCache[parsed.raw] = (reversed) ? reverse(parsed) : parsed;
};
var reverseCombinator = function(combinator){
if (combinator === '!') return ' ';
else if (combinator === ' ') return '!';
else if ((/^!/).test(combinator)) return combinator.replace(/^!/, '');
else return '!' + combinator;
};
var reverse = function(expression){
var expressions = expression.expressions;
for (var i = 0; i < expressions.length; i++){
var exp = expressions[i];
var last = {parts: [], tag: '*', combinator: reverseCombinator(exp[0].combinator)};
for (var j = 0; j < exp.length; j++){
var cexp = exp[j];
if (!cexp.reverseCombinator) cexp.reverseCombinator = ' ';
cexp.combinator = cexp.reverseCombinator;
delete cexp.reverseCombinator;
}
exp.reverse().push(last);
}
return expression;
};
var escapeRegExp = function(string){// Credit: XRegExp 0.6.1 (c) 2007-2008 Steven Levithan <http://stevenlevithan.com/regex/xregexp/> MIT License
return string.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, function(match){
return '\\' + match;
});
};
var regexp = new RegExp(
/*
#!/usr/bin/env ruby
puts "\t\t" + DATA.read.gsub(/\(\?x\)|\s+#.*$|\s+|\\$|\\n/,'')
__END__
"(?x)^(?:\
\\s* ( , ) \\s* # Separator \n\
| \\s* ( <combinator>+ ) \\s* # Combinator \n\
| ( \\s+ ) # CombinatorChildren \n\
| ( <unicode>+ | \\* ) # Tag \n\
| \\# ( <unicode>+ ) # ID \n\
| \\. ( <unicode>+ ) # ClassName \n\
| # Attribute \n\
\\[ \
\\s* (<unicode1>+) (?: \
\\s* ([*^$!~|]?=) (?: \
\\s* (?:\
([\"']?)(.*?)\\9 \
)\
) \
)? \\s* \
\\](?!\\]) \n\
| :+ ( <unicode>+ )(?:\
\\( (?:\
(?:([\"'])([^\\12]*)\\12)|((?:\\([^)]+\\)|[^()]*)+)\
) \\)\
)?\
)"
*/
"^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)"
.replace(/<combinator>/, '[' + escapeRegExp(">+~`!@$%^&={}\\;</") + ']')
.replace(/<unicode>/g, '(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])')
.replace(/<unicode1>/g, '(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])')
);
function parser(
rawMatch,
separator,
combinator,
combinatorChildren,
tagName,
id,
className,
attributeKey,
attributeOperator,
attributeQuote,
attributeValue,
pseudoMarker,
pseudoClass,
pseudoQuote,
pseudoClassQuotedValue,
pseudoClassValue
){
if (separator || separatorIndex === -1){
parsed.expressions[++separatorIndex] = [];
combinatorIndex = -1;
if (separator) return '';
}
if (combinator || combinatorChildren || combinatorIndex === -1){
combinator = combinator || ' ';
var currentSeparator = parsed.expressions[separatorIndex];
if (reversed && currentSeparator[combinatorIndex])
currentSeparator[combinatorIndex].reverseCombinator = reverseCombinator(combinator);
currentSeparator[++combinatorIndex] = {combinator: combinator, tag: '*'};
}
var currentParsed = parsed.expressions[separatorIndex][combinatorIndex];
if (tagName){
currentParsed.tag = tagName.replace(reUnescape, '');
} else if (id){
currentParsed.id = id.replace(reUnescape, '');
} else if (className){
className = className.replace(reUnescape, '');
if (!currentParsed.classList) currentParsed.classList = [];
if (!currentParsed.classes) currentParsed.classes = [];
currentParsed.classList.push(className);
currentParsed.classes.push({
value: className,
regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)')
});
} else if (pseudoClass){
pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue;
pseudoClassValue = pseudoClassValue ? pseudoClassValue.replace(reUnescape, '') : null;
if (!currentParsed.pseudos) currentParsed.pseudos = [];
currentParsed.pseudos.push({
key: pseudoClass.replace(reUnescape, ''),
value: pseudoClassValue,
type: pseudoMarker.length == 1 ? 'class' : 'element'
});
} else if (attributeKey){
attributeKey = attributeKey.replace(reUnescape, '');
attributeValue = (attributeValue || '').replace(reUnescape, '');
var test, regexp;
switch (attributeOperator){
case '^=' : regexp = new RegExp( '^'+ escapeRegExp(attributeValue) ); break;
case '$=' : regexp = new RegExp( escapeRegExp(attributeValue) +'$' ); break;
case '~=' : regexp = new RegExp( '(^|\\s)'+ escapeRegExp(attributeValue) +'(\\s|$)' ); break;
case '|=' : regexp = new RegExp( '^'+ escapeRegExp(attributeValue) +'(-|$)' ); break;
case '=' : test = function(value){
return attributeValue == value;
}; break;
case '*=' : test = function(value){
return value && value.indexOf(attributeValue) > -1;
}; break;
case '!=' : test = function(value){
return attributeValue != value;
}; break;
default : test = function(value){
return !!value;
};
}
if (attributeValue == '' && (/^[*$^]=$/).test(attributeOperator)) test = function(){
return false;
};
if (!test) test = function(value){
return value && regexp.test(value);
};
if (!currentParsed.attributes) currentParsed.attributes = [];
currentParsed.attributes.push({
key: attributeKey,
operator: attributeOperator,
value: attributeValue,
test: test
});
}
return '';
};
// Slick NS
var Slick = (this.Slick || {});
Slick.parse = function(expression){
return parse(expression);
};
Slick.escapeRegExp = escapeRegExp;
if (!this.Slick) this.Slick = Slick;
}).apply(/*<CommonJS>*/(typeof exports != 'undefined') ? exports : /*</CommonJS>*/this);
/*
---
name: Slick.Finder
description: The new, superfast css selector engine.
provides: Slick.Finder
requires: Slick.Parser
...
*/
;(function(){
var local = {},
featuresCache = {},
toString = Object.prototype.toString;
// Feature / Bug detection
local.isNativeCode = function(fn){
return (/\{\s*\[native code\]\s*\}/).test('' + fn);
};
local.isXML = function(document){
return (!!document.xmlVersion) || (!!document.xml) || (toString.call(document) == '[object XMLDocument]') ||
(document.nodeType == 9 && document.documentElement.nodeName != 'HTML');
};
local.setDocument = function(document){
// convert elements / window arguments to document. if document cannot be extrapolated, the function returns.
var nodeType = document.nodeType;
if (nodeType == 9); // document
else if (nodeType) document = document.ownerDocument; // node
else if (document.navigator) document = document.document; // window
else return;
// check if it's the old document
if (this.document === document) return;
this.document = document;
// check if we have done feature detection on this document before
var root = document.documentElement,
rootUid = this.getUIDXML(root),
features = featuresCache[rootUid],
feature;
if (features){
for (feature in features){
this[feature] = features[feature];
}
return;
}
features = featuresCache[rootUid] = {};
features.root = root;
features.isXMLDocument = this.isXML(document);
features.brokenStarGEBTN
= features.starSelectsClosedQSA
= features.idGetsName
= features.brokenMixedCaseQSA
= features.brokenGEBCN
= features.brokenCheckedQSA
= features.brokenEmptyAttributeQSA
= features.isHTMLDocument
= features.nativeMatchesSelector
= false;
var starSelectsClosed, starSelectsComments,
brokenSecondClassNameGEBCN, cachedGetElementsByClassName,
brokenFormAttributeGetter;
var selected, id = 'slick_uniqueid';
var testNode = document.createElement('div');
var testRoot = document.body || document.getElementsByTagName('body')[0] || root;
testRoot.appendChild(testNode);
// on non-HTML documents innerHTML and getElementsById doesnt work properly
try {
testNode.innerHTML = '<a id="'+id+'"></a>';
features.isHTMLDocument = !!document.getElementById(id);
} catch(e){};
if (features.isHTMLDocument){
testNode.style.display = 'none';
// IE returns comment nodes for getElementsByTagName('*') for some documents
testNode.appendChild(document.createComment(''));
starSelectsComments = (testNode.getElementsByTagName('*').length > 1);
// IE returns closed nodes (EG:"</foo>") for getElementsByTagName('*') for some documents
try {
testNode.innerHTML = 'foo</foo>';
selected = testNode.getElementsByTagName('*');
starSelectsClosed = (selected && !!selected.length && selected[0].nodeName.charAt(0) == '/');
} catch(e){};
features.brokenStarGEBTN = starSelectsComments || starSelectsClosed;
// IE returns elements with the name instead of just id for getElementsById for some documents
try {
testNode.innerHTML = '<a name="'+ id +'"></a><b id="'+ id +'"></b>';
features.idGetsName = document.getElementById(id) === testNode.firstChild;
} catch(e){};
if (testNode.getElementsByClassName){
// Safari 3.2 getElementsByClassName caches results
try {
testNode.innerHTML = '<a class="f"></a><a class="b"></a>';
testNode.getElementsByClassName('b').length;
testNode.firstChild.className = 'b';
cachedGetElementsByClassName = (testNode.getElementsByClassName('b').length != 2);
} catch(e){};
// Opera 9.6 getElementsByClassName doesnt detects the class if its not the first one
try {
testNode.innerHTML = '<a class="a"></a><a class="f b a"></a>';
brokenSecondClassNameGEBCN = (testNode.getElementsByClassName('a').length != 2);
} catch(e){};
features.brokenGEBCN = cachedGetElementsByClassName || brokenSecondClassNameGEBCN;
}
if (testNode.querySelectorAll){
// IE 8 returns closed nodes (EG:"</foo>") for querySelectorAll('*') for some documents
try {
testNode.innerHTML = 'foo</foo>';
selected = testNode.querySelectorAll('*');
features.starSelectsClosedQSA = (selected && !!selected.length && selected[0].nodeName.charAt(0) == '/');
} catch(e){};
// Safari 3.2 querySelectorAll doesnt work with mixedcase on quirksmode
try {
testNode.innerHTML = '<a class="MiX"></a>';
features.brokenMixedCaseQSA = !testNode.querySelectorAll('.MiX').length;
} catch(e){};
// Webkit and Opera dont return selected options on querySelectorAll
try {
testNode.innerHTML = '<select><option selected="selected">a</option></select>';
features.brokenCheckedQSA = (testNode.querySelectorAll(':checked').length == 0);
} catch(e){};
// IE returns incorrect results for attr[*^$]="" selectors on querySelectorAll
try {
testNode.innerHTML = '<a class=""></a>';
features.brokenEmptyAttributeQSA = (testNode.querySelectorAll('[class*=""]').length != 0);
} catch(e){};
}
// IE6-7, if a form has an input of id x, form.getAttribute(x) returns a reference to the input
try {
testNode.innerHTML = '<form action="s"><input id="action"/></form>';
brokenFormAttributeGetter = (testNode.firstChild.getAttribute('action') != 's');
} catch(e){};
// native matchesSelector function
features.nativeMatchesSelector = root.matchesSelector || /*root.msMatchesSelector ||*/ root.mozMatchesSelector || root.webkitMatchesSelector;
if (features.nativeMatchesSelector) try {
// if matchesSelector trows errors on incorrect sintaxes we can use it
features.nativeMatchesSelector.call(root, ':slick');
features.nativeMatchesSelector = null;
} catch(e){};
}
try {
root.slick_expando = 1;
delete root.slick_expando;
features.getUID = this.getUIDHTML;
} catch(e) {
features.getUID = this.getUIDXML;
}
testRoot.removeChild(testNode);
testNode = selected = testRoot = null;
// getAttribute
features.getAttribute = (features.isHTMLDocument && brokenFormAttributeGetter) ? function(node, name){
var method = this.attributeGetters[name];
if (method) return method.call(node);
var attributeNode = node.getAttributeNode(name);
return (attributeNode) ? attributeNode.nodeValue : null;
} : function(node, name){
var method = this.attributeGetters[name];
return (method) ? method.call(node) : node.getAttribute(name);
};
// hasAttribute
features.hasAttribute = (root && this.isNativeCode(root.hasAttribute)) ? function(node, attribute) {
return node.hasAttribute(attribute);
} : function(node, attribute) {
node = node.getAttributeNode(attribute);
return !!(node && (node.specified || node.nodeValue));
};
// contains
// FIXME: Add specs: local.contains should be different for xml and html documents?
var nativeRootContains = root && this.isNativeCode(root.contains),
nativeDocumentContains = document && this.isNativeCode(document.contains);
features.contains = (nativeRootContains && nativeDocumentContains) ? function(context, node){
return context.contains(node);
} : (nativeRootContains && !nativeDocumentContains) ? function(context, node){
// IE8 does not have .contains on document.
return context === node || ((context === document) ? document.documentElement : context).contains(node);
} : (root && root.compareDocumentPosition) ? function(context, node){
return context === node || !!(context.compareDocumentPosition(node) & 16);
} : function(context, node){
if (node) do {
if (node === context) return true;
} while ((node = node.parentNode));
return false;
};
// document order sorting
// credits to Sizzle (http://sizzlejs.com/)
features.documentSorter = (root.compareDocumentPosition) ? function(a, b){
if (!a.compareDocumentPosition || !b.compareDocumentPosition) return 0;
return a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
} : ('sourceIndex' in root) ? function(a, b){
if (!a.sourceIndex || !b.sourceIndex) return 0;
return a.sourceIndex - b.sourceIndex;
} : (document.createRange) ? function(a, b){
if (!a.ownerDocument || !b.ownerDocument) return 0;
var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
aRange.setStart(a, 0);
aRange.setEnd(a, 0);
bRange.setStart(b, 0);
bRange.setEnd(b, 0);
return aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
} : null ;
root = null;
for (feature in features){
this[feature] = features[feature];
}
};
// Main Method
var reSimpleSelector = /^([#.]?)((?:[\w-]+|\*))$/,
reEmptyAttribute = /\[.+[*$^]=(?:""|'')?\]/,
qsaFailExpCache = {};
local.search = function(context, expression, append, first){
var found = this.found = (first) ? null : (append || []);
if (!context) return found;
else if (context.navigator) context = context.document; // Convert the node from a window to a document
else if (!context.nodeType) return found;
// setup
var parsed, i,
uniques = this.uniques = {},
hasOthers = !!(append && append.length),
contextIsDocument = (context.nodeType == 9);
if (this.document !== (contextIsDocument ? context : context.ownerDocument)) this.setDocument(context);
// avoid duplicating items already in the append array
if (hasOthers) for (i = found.length; i--;) uniques[this.getUID(found[i])] = true;
// expression checks
if (typeof expression == 'string'){ // expression is a string
/*<simple-selectors-override>*/
var simpleSelector = expression.match(reSimpleSelector);
simpleSelectors: if (simpleSelector) {
var symbol = simpleSelector[1],
name = simpleSelector[2],
node, nodes;
if (!symbol){
if (name == '*' && this.brokenStarGEBTN) break simpleSelectors;
nodes = context.getElementsByTagName(name);
if (first) return nodes[0] || null;
for (i = 0; node = nodes[i++];){
if (!(hasOthers && uniques[this.getUID(node)])) found.push(node);
}
} else if (symbol == '#'){
if (!this.isHTMLDocument || !contextIsDocument) break simpleSelectors;
node = context.getElementById(name);
if (!node) return found;
if (this.idGetsName && node.getAttributeNode('id').nodeValue != name) break simpleSelectors;
if (first) return node || null;
if (!(hasOthers && uniques[this.getUID(node)])) found.push(node);
} else if (symbol == '.'){
if (!this.isHTMLDocument || ((!context.getElementsByClassName || this.brokenGEBCN) && context.querySelectorAll)) break simpleSelectors;
if (context.getElementsByClassName && !this.brokenGEBCN){
nodes = context.getElementsByClassName(name);
if (first) return nodes[0] || null;
for (i = 0; node = nodes[i++];){
if (!(hasOthers && uniques[this.getUID(node)])) found.push(node);
}
} else {
var matchClass = new RegExp('(^|\\s)'+ Slick.escapeRegExp(name) +'(\\s|$)');
nodes = context.getElementsByTagName('*');
for (i = 0; node = nodes[i++];){
className = node.className;
if (!(className && matchClass.test(className))) continue;
if (first) return node;
if (!(hasOthers && uniques[this.getUID(node)])) found.push(node);
}
}
}
if (hasOthers) this.sort(found);
return (first) ? null : found;
}
/*</simple-selectors-override>*/
/*<query-selector-override>*/
querySelector: if (context.querySelectorAll) {
if (!this.isHTMLDocument
|| qsaFailExpCache[expression]
//TODO: only skip when expression is actually mixed case
|| this.brokenMixedCaseQSA
|| (this.brokenCheckedQSA && expression.indexOf(':checked') > -1)
|| (this.brokenEmptyAttributeQSA && reEmptyAttribute.test(expression))
|| (!contextIsDocument //Abort when !contextIsDocument and...
// there are multiple expressions in the selector
// since we currently only fix non-document rooted QSA for single expression selectors
&& expression.indexOf(',') > -1
)
|| Slick.disableQSA
) break querySelector;
var _expression = expression, _context = context;
if (!contextIsDocument){
// non-document rooted QSA
// credits to Andrew Dupont
var currentId = _context.getAttribute('id'), slickid = 'slickid__';
_context.setAttribute('id', slickid);
_expression = '#' + slickid + ' ' + _expression;
context = _context.parentNode;
}
try {
if (first) return context.querySelector(_expression) || null;
else nodes = context.querySelectorAll(_expression);
} catch(e) {
qsaFailExpCache[expression] = 1;
break querySelector;
} finally {
if (!contextIsDocument){
if (currentId) _context.setAttribute('id', currentId);
else _context.removeAttribute('id');
context = _context;
}
}
if (this.starSelectsClosedQSA) for (i = 0; node = nodes[i++];){
if (node.nodeName > '@' && !(hasOthers && uniques[this.getUID(node)])) found.push(node);
} else for (i = 0; node = nodes[i++];){
if (!(hasOthers && uniques[this.getUID(node)])) found.push(node);
}
if (hasOthers) this.sort(found);
return found;
}
/*</query-selector-override>*/
parsed = this.Slick.parse(expression);
if (!parsed.length) return found;
} else if (expression == null){ // there is no expression
return found;
} else if (expression.Slick){ // expression is a parsed Slick object
parsed = expression;
} else if (this.contains(context.documentElement || context, expression)){ // expression is a node
(found) ? found.push(expression) : found = expression;
return found;
} else { // other junk
return found;
}
/*<pseudo-selectors>*//*<nth-pseudo-selectors>*/
// cache elements for the nth selectors
this.posNTH = {};
this.posNTHLast = {};
this.posNTHType = {};
this.posNTHTypeLast = {};
/*</nth-pseudo-selectors>*//*</pseudo-selectors>*/
// if append is null and there is only a single selector with one expression use pushArray, else use pushUID
this.push = (!hasOthers && (first || (parsed.length == 1 && parsed.expressions[0].length == 1))) ? this.pushArray : this.pushUID;
if (found == null) found = [];
// default engine
var j, m, n;
var combinator, tag, id, classList, classes, attributes, pseudos;
var currentItems, currentExpression, currentBit, lastBit, expressions = parsed.expressions;
search: for (i = 0; (currentExpression = expressions[i]); i++) for (j = 0; (currentBit = currentExpression[j]); j++){
combinator = 'combinator:' + currentBit.combinator;
if (!this[combinator]) continue search;
tag = (this.isXMLDocument) ? currentBit.tag : currentBit.tag.toUpperCase();
id = currentBit.id;
classList = currentBit.classList;
classes = currentBit.classes;
attributes = currentBit.attributes;
pseudos = currentBit.pseudos;
lastBit = (j === (currentExpression.length - 1));
this.bitUniques = {};
if (lastBit){
this.uniques = uniques;
this.found = found;
} else {
this.uniques = {};
this.found = [];
}
if (j === 0){
this[combinator](context, tag, id, classes, attributes, pseudos, classList);
if (first && lastBit && found.length) break search;
} else {
if (first && lastBit) for (m = 0, n = currentItems.length; m < n; m++){
this[combinator](currentItems[m], tag, id, classes, attributes, pseudos, classList);
if (found.length) break search;
} else for (m = 0, n = currentItems.length; m < n; m++) this[combinator](currentItems[m], tag, id, classes, attributes, pseudos, classList);
}
currentItems = this.found;
}
// should sort if there are nodes in append and if you pass multiple expressions.
if (hasOthers || (parsed.expressions.length > 1)) this.sort(found);
return (first) ? (found[0] || null) : found;
};
// Utils
local.uidx = 1;
local.uidk = 'slick-uniqueid';
local.getUIDXML = function(node){
var uid = node.getAttribute(this.uidk);
if (!uid){
uid = this.uidx++;
node.setAttribute(this.uidk, uid);
}
return uid;
};
local.getUIDHTML = function(node){
return node.uniqueNumber || (node.uniqueNumber = this.uidx++);
};
// sort based on the setDocument documentSorter method.
local.sort = function(results){
if (!this.documentSorter) return results;
results.sort(this.documentSorter);
return results;
};
/*<pseudo-selectors>*//*<nth-pseudo-selectors>*/
local.cacheNTH = {};
local.matchNTH = /^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;
local.parseNTHArgument = function(argument){
var parsed = argument.match(this.matchNTH);
if (!parsed) return false;
var special = parsed[2] || false;
var a = parsed[1] || 1;
if (a == '-') a = -1;
var b = +parsed[3] || 0;
parsed =
(special == 'n') ? {a: a, b: b} :
(special == 'odd') ? {a: 2, b: 1} :
(special == 'even') ? {a: 2, b: 0} : {a: 0, b: a};
return (this.cacheNTH[argument] = parsed);
};
local.createNTHPseudo = function(child, sibling, positions, ofType){
return function(node, argument){
var uid = this.getUID(node);
if (!this[positions][uid]){
var parent = node.parentNode;
if (!parent) return false;
var el = parent[child], count = 1;
if (ofType){
var nodeName = node.nodeName;
do {
if (el.nodeName != nodeName) continue;
this[positions][this.getUID(el)] = count++;
} while ((el = el[sibling]));
} else {
do {
if (el.nodeType != 1) continue;
this[positions][this.getUID(el)] = count++;
} while ((el = el[sibling]));
}
}
argument = argument || 'n';
var parsed = this.cacheNTH[argument] || this.parseNTHArgument(argument);
if (!parsed) return false;
var a = parsed.a, b = parsed.b, pos = this[positions][uid];
if (a == 0) return b == pos;
if (a > 0){
if (pos < b) return false;
} else {
if (b < pos) return false;
}
return ((pos - b) % a) == 0;
};
};
/*</nth-pseudo-selectors>*//*</pseudo-selectors>*/
local.pushArray = function(node, tag, id, classes, attributes, pseudos){
if (this.matchSelector(node, tag, id, classes, attributes, pseudos)) this.found.push(node);
};
local.pushUID = function(node, tag, id, classes, attributes, pseudos){
var uid = this.getUID(node);
if (!this.uniques[uid] && this.matchSelector(node, tag, id, classes, attributes, pseudos)){
this.uniques[uid] = true;
this.found.push(node);
}
};
local.matchNode = function(node, selector){
if (this.isHTMLDocument && this.nativeMatchesSelector){
try {
return this.nativeMatchesSelector.call(node, selector.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g, '[$1="$2"]'));
} catch(matchError) {}
}
var parsed = this.Slick.parse(selector);
if (!parsed) return true;
// simple (single) selectors
var expressions = parsed.expressions, simpleExpCounter = 0, i;
for (i = 0; (currentExpression = expressions[i]); i++){
if (currentExpression.length == 1){
var exp = currentExpression[0];
if (this.matchSelector(node, (this.isXMLDocument) ? exp.tag : exp.tag.toUpperCase(), exp.id, exp.classes, exp.attributes, exp.pseudos)) return true;
simpleExpCounter++;
}
}
if (simpleExpCounter == parsed.length) return false;
var nodes = this.search(this.document, parsed), item;
for (i = 0; item = nodes[i++];){
if (item === node) return true;
}
return false;
};
local.matchPseudo = function(node, name, argument){
var pseudoName = 'pseudo:' + name;
if (this[pseudoName]) return this[pseudoName](node, argument);
var attribute = this.getAttribute(node, name);
return (argument) ? argument == attribute : !!attribute;
};
local.matchSelector = function(node, tag, id, classes, attributes, pseudos){
if (tag){
var nodeName = (this.isXMLDocument) ? node.nodeName : node.nodeName.toUpperCase();
if (tag == '*'){
if (nodeName < '@') return false; // Fix for comment nodes and closed nodes
} else {
if (nodeName != tag) return false;
}
}
if (id && node.getAttribute('id') != id) return false;
var i, part, cls;
if (classes) for (i = classes.length; i--;){
cls = this.getAttribute(node, 'class');
if (!(cls && classes[i].regexp.test(cls))) return false;
}
if (attributes) for (i = attributes.length; i--;){
part = attributes[i];
if (part.operator ? !part.test(this.getAttribute(node, part.key)) : !this.hasAttribute(node, part.key)) return false;
}
if (pseudos) for (i = pseudos.length; i--;){
part = pseudos[i];
if (!this.matchPseudo(node, part.key, part.value)) return false;
}
return true;
};
var combinators = {
' ': function(node, tag, id, classes, attributes, pseudos, classList){ // all child nodes, any level
var i, item, children;
if (this.isHTMLDocument){
getById: if (id){
item = this.document.getElementById(id);
if ((!item && node.all) || (this.idGetsName && item && item.getAttributeNode('id').nodeValue != id)){
// all[id] returns all the elements with that name or id inside node
// if theres just one it will return the element, else it will be a collection
children = node.all[id];
if (!children) return;
if (!children[0]) children = [children];
for (i = 0; item = children[i++];){
var idNode = item.getAttributeNode('id');
if (idNode && idNode.nodeValue == id){
this.push(item, tag, null, classes, attributes, pseudos);
break;
}
}
return;
}
if (!item){
// if the context is in the dom we return, else we will try GEBTN, breaking the getById label
if (this.contains(this.root, node)) return;
else break getById;
} else if (this.document !== node && !this.contains(node, item)) return;
this.push(item, tag, null, classes, attributes, pseudos);
return;
}
getByClass: if (classes && node.getElementsByClassName && !this.brokenGEBCN){
children = node.getElementsByClassName(classList.join(' '));
if (!(children && children.length)) break getByClass;
for (i = 0; item = children[i++];) this.push(item, tag, id, null, attributes, pseudos);
return;
}
}
getByTag: {
children = node.getElementsByTagName(tag);
if (!(children && children.length)) break getByTag;
if (!this.brokenStarGEBTN) tag = null;
for (i = 0; item = children[i++];) this.push(item, tag, id, classes, attributes, pseudos);
}
},
'>': function(node, tag, id, classes, attributes, pseudos){ // direct children
if ((node = node.firstChild)) do {
if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos);
} while ((node = node.nextSibling));
},
'+': function(node, tag, id, classes, attributes, pseudos){ // next sibling
while ((node = node.nextSibling)) if (node.nodeType == 1){
this.push(node, tag, id, classes, attributes, pseudos);
break;
}
},
'^': function(node, tag, id, classes, attributes, pseudos){ // first child
node = node.firstChild;
if (node){
if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos);
else this['combinator:+'](node, tag, id, classes, attributes, pseudos);
}
},
'~': function(node, tag, id, classes, attributes, pseudos){ // next siblings
while ((node = node.nextSibling)){
if (node.nodeType != 1) continue;
var uid = this.getUID(node);
if (this.bitUniques[uid]) break;
this.bitUniques[uid] = true;
this.push(node, tag, id, classes, attributes, pseudos);
}
},
'++': function(node, tag, id, classes, attributes, pseudos){ // next sibling and previous sibling
this['combinator:+'](node, tag, id, classes, attributes, pseudos);
this['combinator:!+'](node, tag, id, classes, attributes, pseudos);
},
'~~': function(node, tag, id, classes, attributes, pseudos){ // next siblings and previous siblings
this['combinator:~'](node, tag, id, classes, attributes, pseudos);
this['combinator:!~'](node, tag, id, classes, attributes, pseudos);
},
'!': function(node, tag, id, classes, attributes, pseudos){ // all parent nodes up to document
while ((node = node.parentNode)) if (node !== this.document) this.push(node, tag, id, classes, attributes, pseudos);
},
'!>': function(node, tag, id, classes, attributes, pseudos){ // direct parent (one level)
node = node.parentNode;
if (node !== this.document) this.push(node, tag, id, classes, attributes, pseudos);
},
'!+': function(node, tag, id, classes, attributes, pseudos){ // previous sibling
while ((node = node.previousSibling)) if (node.nodeType == 1){
this.push(node, tag, id, classes, attributes, pseudos);
break;
}
},
'!^': function(node, tag, id, classes, attributes, pseudos){ // last child
node = node.lastChild;
if (node){
if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos);
else this['combinator:!+'](node, tag, id, classes, attributes, pseudos);
}
},
'!~': function(node, tag, id, classes, attributes, pseudos){ // previous siblings
while ((node = node.previousSibling)){
if (node.nodeType != 1) continue;
var uid = this.getUID(node);
if (this.bitUniques[uid]) break;
this.bitUniques[uid] = true;
this.push(node, tag, id, classes, attributes, pseudos);
}
}
};
for (var c in combinators) local['combinator:' + c] = combinators[c];
var pseudos = {
/*<pseudo-selectors>*/
'empty': function(node){
var child = node.firstChild;
return !(child && child.nodeType == 1) && !(node.innerText || node.textContent || '').length;
},
'not': function(node, expression){
return !this.matchNode(node, expression);
},
'contains': function(node, text){
return (node.innerText || node.textContent || '').indexOf(text) > -1;
},
'first-child': function(node){
while ((node = node.previousSibling)) if (node.nodeType == 1) return false;
return true;
},
'last-child': function(node){
while ((node = node.nextSibling)) if (node.nodeType == 1) return false;
return true;
},
'only-child': function(node){
var prev = node;
while ((prev = prev.previousSibling)) if (prev.nodeType == 1) return false;
var next = node;
while ((next = next.nextSibling)) if (next.nodeType == 1) return false;
return true;
},
/*<nth-pseudo-selectors>*/
'nth-child': local.createNTHPseudo('firstChild', 'nextSibling', 'posNTH'),
'nth-last-child': local.createNTHPseudo('lastChild', 'previousSibling', 'posNTHLast'),
'nth-of-type': local.createNTHPseudo('firstChild', 'nextSibling', 'posNTHType', true),
'nth-last-of-type': local.createNTHPseudo('lastChild', 'previousSibling', 'posNTHTypeLast', true),
'index': function(node, index){
return this['pseudo:nth-child'](node, '' + (index + 1));
},
'even': function(node){
return this['pseudo:nth-child'](node, '2n');
},
'odd': function(node){
return this['pseudo:nth-child'](node, '2n+1');
},
/*</nth-pseudo-selectors>*/
/*<of-type-pseudo-selectors>*/
'first-of-type': function(node){
var nodeName = node.nodeName;
while ((node = node.previousSibling)) if (node.nodeName == nodeName) return false;
return true;
},
'last-of-type': function(node){
var nodeName = node.nodeName;
while ((node = node.nextSibling)) if (node.nodeName == nodeName) return false;
return true;
},
'only-of-type': function(node){
var prev = node, nodeName = node.nodeName;
while ((prev = prev.previousSibling)) if (prev.nodeName == nodeName) return false;
var next = node;
while ((next = next.nextSibling)) if (next.nodeName == nodeName) return false;
return true;
},
/*</of-type-pseudo-selectors>*/
// custom pseudos
'enabled': function(node){
return !node.disabled;
},
'disabled': function(node){
return node.disabled;
},
'checked': function(node){
return node.checked || node.selected;
},
'focus': function(node){
return this.isHTMLDocument && this.document.activeElement === node && (node.href || node.type || this.hasAttribute(node, 'tabindex'));
},
'root': function(node){
return (node === this.root);
},
'selected': function(node){
return node.selected;
}
/*</pseudo-selectors>*/
};
for (var p in pseudos) local['pseudo:' + p] = pseudos[p];
// attributes methods
var attributeGetters = local.attributeGetters = {
'for': function(){
return ('htmlFor' in this) ? this.htmlFor : this.getAttribute('for');
},
'href': function(){
return ('href' in this) ? this.getAttribute('href', 2) : this.getAttribute('href');
},
'style': function(){
return (this.style) ? this.style.cssText : this.getAttribute('style');
},
'tabindex': function(){
var attributeNode = this.getAttributeNode('tabindex');
return (attributeNode && attributeNode.specified) ? attributeNode.nodeValue : null;
},
'type': function(){
return this.getAttribute('type');
},
'maxlength': function(){
var attributeNode = this.getAttributeNode('maxLength');
return (attributeNode && attributeNode.specified) ? attributeNode.nodeValue : null;
}
};
attributeGetters.MAXLENGTH = attributeGetters.maxLength = attributeGetters.maxlength;
// Slick
var Slick = local.Slick = (this.Slick || {});
Slick.version = '1.1.7';
// Slick finder
Slick.search = function(context, expression, append){
return local.search(context, expression, append);
};
Slick.find = function(context, expression){
return local.search(context, expression, null, true);
};
// Slick containment checker
Slick.contains = function(container, node){
local.setDocument(container);
return local.contains(container, node);
};
// Slick attribute getter
Slick.getAttribute = function(node, name){
local.setDocument(node);
return local.getAttribute(node, name);
};
Slick.hasAttribute = function(node, name){
local.setDocument(node);
return local.hasAttribute(node, name);
};
// Slick matcher
Slick.match = function(node, selector){
if (!(node && selector)) return false;
if (!selector || selector === node) return true;
local.setDocument(node);
return local.matchNode(node, selector);
};
// Slick attribute accessor
Slick.defineAttributeGetter = function(name, fn){
local.attributeGetters[name] = fn;
return this;
};
Slick.lookupAttributeGetter = function(name){
return local.attributeGetters[name];
};
// Slick pseudo accessor
Slick.definePseudo = function(name, fn){
local['pseudo:' + name] = function(node, argument){
return fn.call(node, argument);
};
return this;
};
Slick.lookupPseudo = function(name){
var pseudo = local['pseudo:' + name];
if (pseudo) return function(argument){
return pseudo.call(this, argument);
};
return null;
};
// Slick overrides accessor
Slick.override = function(regexp, fn){
local.override(regexp, fn);
return this;
};
Slick.isXML = local.isXML;
Slick.uidOf = function(node){
return local.getUIDHTML(node);
};
if (!this.Slick) this.Slick = Slick;
}).apply(/*<CommonJS>*/(typeof exports != 'undefined') ? exports : /*</CommonJS>*/this);
/*
---
name: Element
description: One of the most important items in MooTools. Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements.
license: MIT-style license.
requires: [Window, Document, Array, String, Function, Object, Number, Slick.Parser, Slick.Finder]
provides: [Element, Elements, $, $$, Iframe, Selectors]
...
*/
var Element = function(tag, props){
var konstructor = Element.Constructors[tag];
if (konstructor) return konstructor(props);
if (typeof tag != 'string') return document.id(tag).set(props);
if (!props) props = {};
if (!(/^[\w-]+$/).test(tag)){
var parsed = Slick.parse(tag).expressions[0][0];
tag = (parsed.tag == '*') ? 'div' : parsed.tag;
if (parsed.id && props.id == null) props.id = parsed.id;
var attributes = parsed.attributes;
if (attributes) for (var attr, i = 0, l = attributes.length; i < l; i++){
attr = attributes[i];
if (props[attr.key] != null) continue;
if (attr.value != null && attr.operator == '=') props[attr.key] = attr.value;
else if (!attr.value && !attr.operator) props[attr.key] = true;
}
if (parsed.classList && props['class'] == null) props['class'] = parsed.classList.join(' ');
}
return document.newElement(tag, props);
};
if (Browser.Element){
Element.prototype = Browser.Element.prototype;
// IE8 and IE9 require the wrapping.
Element.prototype._fireEvent = (function(fireEvent){
return function(type, event){
return fireEvent.call(this, type, event);
};
})(Element.prototype.fireEvent);
}
new Type('Element', Element).mirror(function(name){
if (Array.prototype[name]) return;
var obj = {};
obj[name] = function(){
var results = [], args = arguments, elements = true;
for (var i = 0, l = this.length; i < l; i++){
var element = this[i], result = results[i] = element[name].apply(element, args);
elements = (elements && typeOf(result) == 'element');
}
return (elements) ? new Elements(results) : results;
};
Elements.implement(obj);
});
if (!Browser.Element){
Element.parent = Object;
Element.Prototype = {
'$constructor': Element,
'$family': Function.from('element').hide()
};
Element.mirror(function(name, method){
Element.Prototype[name] = method;
});
}
Element.Constructors = {};
var IFrame = new Type('IFrame', function(){
var params = Array.link(arguments, {
properties: Type.isObject,
iframe: function(obj){
return (obj != null);
}
});
var props = params.properties || {}, iframe;
if (params.iframe) iframe = document.id(params.iframe);
var onload = props.onload || function(){};
delete props.onload;
props.id = props.name = [props.id, props.name, iframe ? (iframe.id || iframe.name) : 'IFrame_' + String.uniqueID()].pick();
iframe = new Element(iframe || 'iframe', props);
var onLoad = function(){
onload.call(iframe.contentWindow);
};
if (window.frames[props.id]) onLoad();
else iframe.addListener('load', onLoad);
return iframe;
});
var Elements = this.Elements = function(nodes){
if (nodes && nodes.length){
var uniques = {}, node;
for (var i = 0; node = nodes[i++];){
var uid = Slick.uidOf(node);
if (!uniques[uid]){
uniques[uid] = true;
this.push(node);
}
}
}
};
Elements.prototype = {length: 0};
Elements.parent = Array;
new Type('Elements', Elements).implement({
filter: function(filter, bind){
if (!filter) return this;
return new Elements(Array.filter(this, (typeOf(filter) == 'string') ? function(item){
return item.match(filter);
} : filter, bind));
}.protect(),
push: function(){
var length = this.length;
for (var i = 0, l = arguments.length; i < l; i++){
var item = document.id(arguments[i]);
if (item) this[length++] = item;
}
return (this.length = length);
}.protect(),
unshift: function(){
var items = [];
for (var i = 0, l = arguments.length; i < l; i++){
var item = document.id(arguments[i]);
if (item) items.push(item);
}
return Array.prototype.unshift.apply(this, items);
}.protect(),
concat: function(){
var newElements = new Elements(this);
for (var i = 0, l = arguments.length; i < l; i++){
var item = arguments[i];
if (Type.isEnumerable(item)) newElements.append(item);
else newElements.push(item);
}
return newElements;
}.protect(),
append: function(collection){
for (var i = 0, l = collection.length; i < l; i++) this.push(collection[i]);
return this;
}.protect(),
empty: function(){
while (this.length) delete this[--this.length];
return this;
}.protect()
});
(function(){
// FF, IE
var splice = Array.prototype.splice, object = {'0': 0, '1': 1, length: 2};
splice.call(object, 1, 1);
if (object[1] == 1) Elements.implement('splice', function(){
var length = this.length;
var result = splice.apply(this, arguments);
while (length >= this.length) delete this[length--];
return result;
}.protect());
Array.forEachMethod(function(method, name){
Elements.implement(name, method);
});
Array.mirror(Elements);
/*<ltIE8>*/
var createElementAcceptsHTML;
try {
createElementAcceptsHTML = (document.createElement('<input name=x>').name == 'x');
} catch (e){}
var escapeQuotes = function(html){
return ('' + html).replace(/&/g, '&').replace(/"/g, '"');
};
/*</ltIE8>*/
Document.implement({
newElement: function(tag, props){
if (props && props.checked != null) props.defaultChecked = props.checked;
/*<ltIE8>*/// Fix for readonly name and type properties in IE < 8
if (createElementAcceptsHTML && props){
tag = '<' + tag;
if (props.name) tag += ' name="' + escapeQuotes(props.name) + '"';
if (props.type) tag += ' type="' + escapeQuotes(props.type) + '"';
tag += '>';
delete props.name;
delete props.type;
}
/*</ltIE8>*/
return this.id(this.createElement(tag)).set(props);
}
});
})();
(function(){
Slick.uidOf(window);
Slick.uidOf(document);
Document.implement({
newTextNode: function(text){
return this.createTextNode(text);
},
getDocument: function(){
return this;
},
getWindow: function(){
return this.window;
},
id: (function(){
var types = {
string: function(id, nocash, doc){
id = Slick.find(doc, '#' + id.replace(/(\W)/g, '\\$1'));
return (id) ? types.element(id, nocash) : null;
},
element: function(el, nocash){
Slick.uidOf(el);
if (!nocash && !el.$family && !(/^(?:object|embed)$/i).test(el.tagName)){
var fireEvent = el.fireEvent;
// wrapping needed in IE7, or else crash
el._fireEvent = function(type, event){
return fireEvent(type, event);
};
Object.append(el, Element.Prototype);
}
return el;
},
object: function(obj, nocash, doc){
if (obj.toElement) return types.element(obj.toElement(doc), nocash);
return null;
}
};
types.textnode = types.whitespace = types.window = types.document = function(zero){
return zero;
};
return function(el, nocash, doc){
if (el && el.$family && el.uniqueNumber) return el;
var type = typeOf(el);
return (types[type]) ? types[type](el, nocash, doc || document) : null;
};
})()
});
if (window.$ == null) Window.implement('$', function(el, nc){
return document.id(el, nc, this.document);
});
Window.implement({
getDocument: function(){
return this.document;
},
getWindow: function(){
return this;
}
});
[Document, Element].invoke('implement', {
getElements: function(expression){
return Slick.search(this, expression, new Elements);
},
getElement: function(expression){
return document.id(Slick.find(this, expression));
}
});
var contains = {contains: function(element){
return Slick.contains(this, element);
}};
if (!document.contains) Document.implement(contains);
if (!document.createElement('div').contains) Element.implement(contains);
// tree walking
var injectCombinator = function(expression, combinator){
if (!expression) return combinator;
expression = Object.clone(Slick.parse(expression));
var expressions = expression.expressions;
for (var i = expressions.length; i--;)
expressions[i][0].combinator = combinator;
return expression;
};
Object.forEach({
getNext: '~',
getPrevious: '!~',
getParent: '!'
}, function(combinator, method){
Element.implement(method, function(expression){
return this.getElement(injectCombinator(expression, combinator));
});
});
Object.forEach({
getAllNext: '~',
getAllPrevious: '!~',
getSiblings: '~~',
getChildren: '>',
getParents: '!'
}, function(combinator, method){
Element.implement(method, function(expression){
return this.getElements(injectCombinator(expression, combinator));
});
});
Element.implement({
getFirst: function(expression){
return document.id(Slick.search(this, injectCombinator(expression, '>'))[0]);
},
getLast: function(expression){
return document.id(Slick.search(this, injectCombinator(expression, '>')).getLast());
},
getWindow: function(){
return this.ownerDocument.window;
},
getDocument: function(){
return this.ownerDocument;
},
getElementById: function(id){
return document.id(Slick.find(this, '#' + ('' + id).replace(/(\W)/g, '\\$1')));
},
match: function(expression){
return !expression || Slick.match(this, expression);
}
});
if (window.$$ == null) Window.implement('$$', function(selector){
if (arguments.length == 1){
if (typeof selector == 'string') return Slick.search(this.document, selector, new Elements);
else if (Type.isEnumerable(selector)) return new Elements(selector);
}
return new Elements(arguments);
});
// Inserters
var inserters = {
before: function(context, element){
var parent = element.parentNode;
if (parent) parent.insertBefore(context, element);
},
after: function(context, element){
var parent = element.parentNode;
if (parent) parent.insertBefore(context, element.nextSibling);
},
bottom: function(context, element){
element.appendChild(context);
},
top: function(context, element){
element.insertBefore(context, element.firstChild);
}
};
inserters.inside = inserters.bottom;
// getProperty / setProperty
var propertyGetters = {}, propertySetters = {};
// properties
var properties = {};
Array.forEach([
'type', 'value', 'defaultValue', 'accessKey', 'cellPadding', 'cellSpacing', 'colSpan',
'frameBorder', 'rowSpan', 'tabIndex', 'useMap'
], function(property){
properties[property.toLowerCase()] = property;
});
properties.html = 'innerHTML';
properties.text = (document.createElement('div').textContent == null) ? 'innerText': 'textContent';
Object.forEach(properties, function(real, key){
propertySetters[key] = function(node, value){
node[real] = value;
};
propertyGetters[key] = function(node){
return node[real];
};
});
// Booleans
var bools = [
'compact', 'nowrap', 'ismap', 'declare', 'noshade', 'checked',
'disabled', 'readOnly', 'multiple', 'selected', 'noresize',
'defer', 'defaultChecked', 'autofocus', 'controls', 'autoplay',
'loop'
];
var booleans = {};
Array.forEach(bools, function(bool){
var lower = bool.toLowerCase();
booleans[lower] = bool;
propertySetters[lower] = function(node, value){
node[bool] = !!value;
};
propertyGetters[lower] = function(node){
return !!node[bool];
};
});
// Special cases
Object.append(propertySetters, {
'class': function(node, value){
('className' in node) ? node.className = (value || '') : node.setAttribute('class', value);
},
'for': function(node, value){
('htmlFor' in node) ? node.htmlFor = value : node.setAttribute('for', value);
},
'style': function(node, value){
(node.style) ? node.style.cssText = value : node.setAttribute('style', value);
},
'value': function(node, value){
node.value = (value != null) ? value : '';
}
});
propertyGetters['class'] = function(node){
return ('className' in node) ? node.className || null : node.getAttribute('class');
};
/* <webkit> */
var el = document.createElement('button');
// IE sets type as readonly and throws
try { el.type = 'button'; } catch(e){}
if (el.type != 'button') propertySetters.type = function(node, value){
node.setAttribute('type', value);
};
el = null;
/* </webkit> */
/*<IE>*/
var input = document.createElement('input');
input.value = 't';
input.type = 'submit';
if (input.value != 't') propertySetters.type = function(node, type){
var value = node.value;
node.type = type;
node.value = value;
};
input = null;
/*</IE>*/
/* getProperty, setProperty */
/* <ltIE9> */
var pollutesGetAttribute = (function(div){
div.random = 'attribute';
return (div.getAttribute('random') == 'attribute');
})(document.createElement('div'));
/* <ltIE9> */
Element.implement({
setProperty: function(name, value){
var setter = propertySetters[name.toLowerCase()];
if (setter){
setter(this, value);
} else {
/* <ltIE9> */
if (pollutesGetAttribute) var attributeWhiteList = this.retrieve('$attributeWhiteList', {});
/* </ltIE9> */
if (value == null){
this.removeAttribute(name);
/* <ltIE9> */
if (pollutesGetAttribute) delete attributeWhiteList[name];
/* </ltIE9> */
} else {
this.setAttribute(name, '' + value);
/* <ltIE9> */
if (pollutesGetAttribute) attributeWhiteList[name] = true;
/* </ltIE9> */
}
}
return this;
},
setProperties: function(attributes){
for (var attribute in attributes) this.setProperty(attribute, attributes[attribute]);
return this;
},
getProperty: function(name){
var getter = propertyGetters[name.toLowerCase()];
if (getter) return getter(this);
/* <ltIE9> */
if (pollutesGetAttribute){
var attr = this.getAttributeNode(name), attributeWhiteList = this.retrieve('$attributeWhiteList', {});
if (!attr) return null;
if (attr.expando && !attributeWhiteList[name]){
var outer = this.outerHTML;
// segment by the opening tag and find mention of attribute name
if (outer.substr(0, outer.search(/\/?['"]?>(?![^<]*<['"])/)).indexOf(name) < 0) return null;
attributeWhiteList[name] = true;
}
}
/* </ltIE9> */
var result = Slick.getAttribute(this, name);
return (!result && !Slick.hasAttribute(this, name)) ? null : result;
},
getProperties: function(){
var args = Array.from(arguments);
return args.map(this.getProperty, this).associate(args);
},
removeProperty: function(name){
return this.setProperty(name, null);
},
removeProperties: function(){
Array.each(arguments, this.removeProperty, this);
return this;
},
set: function(prop, value){
var property = Element.Properties[prop];
(property && property.set) ? property.set.call(this, value) : this.setProperty(prop, value);
}.overloadSetter(),
get: function(prop){
var property = Element.Properties[prop];
return (property && property.get) ? property.get.apply(this) : this.getProperty(prop);
}.overloadGetter(),
erase: function(prop){
var property = Element.Properties[prop];
(property && property.erase) ? property.erase.apply(this) : this.removeProperty(prop);
return this;
},
hasClass: function(className){
return this.className.clean().contains(className, ' ');
},
addClass: function(className){
if (!this.hasClass(className)) this.className = (this.className + ' ' + className).clean();
return this;
},
removeClass: function(className){
this.className = this.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)'), '$1');
return this;
},
toggleClass: function(className, force){
if (force == null) force = !this.hasClass(className);
return (force) ? this.addClass(className) : this.removeClass(className);
},
adopt: function(){
var parent = this, fragment, elements = Array.flatten(arguments), length = elements.length;
if (length > 1) parent = fragment = document.createDocumentFragment();
for (var i = 0; i < length; i++){
var element = document.id(elements[i], true);
if (element) parent.appendChild(element);
}
if (fragment) this.appendChild(fragment);
return this;
},
appendText: function(text, where){
return this.grab(this.getDocument().newTextNode(text), where);
},
grab: function(el, where){
inserters[where || 'bottom'](document.id(el, true), this);
return this;
},
inject: function(el, where){
inserters[where || 'bottom'](this, document.id(el, true));
return this;
},
replaces: function(el){
el = document.id(el, true);
el.parentNode.replaceChild(this, el);
return this;
},
wraps: function(el, where){
el = document.id(el, true);
return this.replaces(el).grab(el, where);
},
getSelected: function(){
this.selectedIndex; // Safari 3.2.1
return new Elements(Array.from(this.options).filter(function(option){
return option.selected;
}));
},
toQueryString: function(){
var queryString = [];
this.getElements('input, select, textarea').each(function(el){
var type = el.type;
if (!el.name || el.disabled || type == 'submit' || type == 'reset' || type == 'file' || type == 'image') return;
var value = (el.get('tag') == 'select') ? el.getSelected().map(function(opt){
// IE
return document.id(opt).get('value');
}) : ((type == 'radio' || type == 'checkbox') && !el.checked) ? null : el.get('value');
Array.from(value).each(function(val){
if (typeof val != 'undefined') queryString.push(encodeURIComponent(el.name) + '=' + encodeURIComponent(val));
});
});
return queryString.join('&');
}
});
var collected = {}, storage = {};
var get = function(uid){
return (storage[uid] || (storage[uid] = {}));
};
var clean = function(item){
var uid = item.uniqueNumber;
if (item.removeEvents) item.removeEvents();
if (item.clearAttributes) item.clearAttributes();
if (uid != null){
delete collected[uid];
delete storage[uid];
}
return item;
};
var formProps = {input: 'checked', option: 'selected', textarea: 'value'};
Element.implement({
destroy: function(){
var children = clean(this).getElementsByTagName('*');
Array.each(children, clean);
Element.dispose(this);
return null;
},
empty: function(){
Array.from(this.childNodes).each(Element.dispose);
return this;
},
dispose: function(){
return (this.parentNode) ? this.parentNode.removeChild(this) : this;
},
clone: function(contents, keepid){
contents = contents !== false;
var clone = this.cloneNode(contents), ce = [clone], te = [this], i;
if (contents){
ce.append(Array.from(clone.getElementsByTagName('*')));
te.append(Array.from(this.getElementsByTagName('*')));
}
for (i = ce.length; i--;){
var node = ce[i], element = te[i];
if (!keepid) node.removeAttribute('id');
/*<ltIE9>*/
if (node.clearAttributes){
node.clearAttributes();
node.mergeAttributes(element);
node.removeAttribute('uniqueNumber');
if (node.options){
var no = node.options, eo = element.options;
for (var j = no.length; j--;) no[j].selected = eo[j].selected;
}
}
/*</ltIE9>*/
var prop = formProps[element.tagName.toLowerCase()];
if (prop && element[prop]) node[prop] = element[prop];
}
/*<ltIE9>*/
if (Browser.ie){
var co = clone.getElementsByTagName('object'), to = this.getElementsByTagName('object');
for (i = co.length; i--;) co[i].outerHTML = to[i].outerHTML;
}
/*</ltIE9>*/
return document.id(clone);
}
});
[Element, Window, Document].invoke('implement', {
addListener: function(type, fn){
if (type == 'unload'){
var old = fn, self = this;
fn = function(){
self.removeListener('unload', fn);
old();
};
} else {
collected[Slick.uidOf(this)] = this;
}
if (this.addEventListener) this.addEventListener(type, fn, !!arguments[2]);
else this.attachEvent('on' + type, fn);
return this;
},
removeListener: function(type, fn){
if (this.removeEventListener) this.removeEventListener(type, fn, !!arguments[2]);
else this.detachEvent('on' + type, fn);
return this;
},
retrieve: function(property, dflt){
var storage = get(Slick.uidOf(this)), prop = storage[property];
if (dflt != null && prop == null) prop = storage[property] = dflt;
return prop != null ? prop : null;
},
store: function(property, value){
var storage = get(Slick.uidOf(this));
storage[property] = value;
return this;
},
eliminate: function(property){
var storage = get(Slick.uidOf(this));
delete storage[property];
return this;
}
});
/*<ltIE9>*/
if (window.attachEvent && !window.addEventListener) window.addListener('unload', function(){
Object.each(collected, clean);
if (window.CollectGarbage) CollectGarbage();
});
/*</ltIE9>*/
Element.Properties = {};
Element.Properties.style = {
set: function(style){
this.style.cssText = style;
},
get: function(){
return this.style.cssText;
},
erase: function(){
this.style.cssText = '';
}
};
Element.Properties.tag = {
get: function(){
return this.tagName.toLowerCase();
}
};
Element.Properties.html = {
set: function(html){
if (html == null) html = '';
else if (typeOf(html) == 'array') html = html.join('');
this.innerHTML = html;
},
erase: function(){
this.innerHTML = '';
}
};
/*<ltIE9>*/
// technique by jdbarlett - http://jdbartlett.com/innershiv/
var div = document.createElement('div');
div.innerHTML = '<nav></nav>';
var supportsHTML5Elements = (div.childNodes.length == 1);
if (!supportsHTML5Elements){
var tags = 'abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' '),
fragment = document.createDocumentFragment(), l = tags.length;
while (l--) fragment.createElement(tags[l]);
}
div = null;
/*</ltIE9>*/
/*<IE>*/
var supportsTableInnerHTML = Function.attempt(function(){
var table = document.createElement('table');
table.innerHTML = '<tr><td></td></tr>';
return true;
});
/*<ltFF4>*/
var tr = document.createElement('tr'), html = '<td></td>';
tr.innerHTML = html;
var supportsTRInnerHTML = (tr.innerHTML == html);
tr = null;
/*</ltFF4>*/
if (!supportsTableInnerHTML || !supportsTRInnerHTML || !supportsHTML5Elements){
Element.Properties.html.set = (function(set){
var translations = {
table: [1, '<table>', '</table>'],
select: [1, '<select>', '</select>'],
tbody: [2, '<table><tbody>', '</tbody></table>'],
tr: [3, '<table><tbody><tr>', '</tr></tbody></table>']
};
translations.thead = translations.tfoot = translations.tbody;
return function(html){
var wrap = translations[this.get('tag')];
if (!wrap && !supportsHTML5Elements) wrap = [0, '', ''];
if (!wrap) return set.call(this, html);
var level = wrap[0], wrapper = document.createElement('div'), target = wrapper;
if (!supportsHTML5Elements) fragment.appendChild(wrapper);
wrapper.innerHTML = [wrap[1], html, wrap[2]].flatten().join('');
while (level--) target = target.firstChild;
this.empty().adopt(target.childNodes);
if (!supportsHTML5Elements) fragment.removeChild(wrapper);
wrapper = null;
};
})(Element.Properties.html.set);
}
/*</IE>*/
/*<ltIE9>*/
var testForm = document.createElement('form');
testForm.innerHTML = '<select><option>s</option></select>';
if (testForm.firstChild.value != 's') Element.Properties.value = {
set: function(value){
var tag = this.get('tag');
if (tag != 'select') return this.setProperty('value', value);
var options = this.getElements('option');
for (var i = 0; i < options.length; i++){
var option = options[i],
attr = option.getAttributeNode('value'),
optionValue = (attr && attr.specified) ? option.value : option.get('text');
if (optionValue == value) return option.selected = true;
}
},
get: function(){
var option = this, tag = option.get('tag');
if (tag != 'select' && tag != 'option') return this.getProperty('value');
if (tag == 'select' && !(option = option.getSelected()[0])) return '';
var attr = option.getAttributeNode('value');
return (attr && attr.specified) ? option.value : option.get('text');
}
};
testForm = null;
/*</ltIE9>*/
/*<IE>*/
if (document.createElement('div').getAttributeNode('id')) Element.Properties.id = {
set: function(id){
this.id = this.getAttributeNode('id').value = id;
},
get: function(){
return this.id || null;
},
erase: function(){
this.id = this.getAttributeNode('id').value = '';
}
};
/*</IE>*/
})();
/*
---
name: Element.Style
description: Contains methods for interacting with the styles of Elements in a fashionable way.
license: MIT-style license.
requires: Element
provides: Element.Style
...
*/
(function(){
var html = document.html;
//<ltIE9>
// Check for oldIE, which does not remove styles when they're set to null
var el = document.createElement('div');
el.style.color = 'red';
el.style.color = null;
var doesNotRemoveStyles = el.style.color == 'red';
el = null;
//</ltIE9>
Element.Properties.styles = {set: function(styles){
this.setStyles(styles);
}};
var hasOpacity = (html.style.opacity != null),
hasFilter = (html.style.filter != null),
reAlpha = /alpha\(opacity=([\d.]+)\)/i;
var setVisibility = function(element, opacity){
element.store('$opacity', opacity);
element.style.visibility = opacity > 0 || opacity == null ? 'visible' : 'hidden';
};
var setOpacity = (hasOpacity ? function(element, opacity){
element.style.opacity = opacity;
} : (hasFilter ? function(element, opacity){
var style = element.style;
if (!element.currentStyle || !element.currentStyle.hasLayout) style.zoom = 1;
if (opacity == null || opacity == 1) opacity = '';
else opacity = 'alpha(opacity=' + (opacity * 100).limit(0, 100).round() + ')';
var filter = style.filter || element.getComputedStyle('filter') || '';
style.filter = reAlpha.test(filter) ? filter.replace(reAlpha, opacity) : filter + opacity;
if (!style.filter) style.removeAttribute('filter');
} : setVisibility));
var getOpacity = (hasOpacity ? function(element){
var opacity = element.style.opacity || element.getComputedStyle('opacity');
return (opacity == '') ? 1 : opacity.toFloat();
} : (hasFilter ? function(element){
var filter = (element.style.filter || element.getComputedStyle('filter')),
opacity;
if (filter) opacity = filter.match(reAlpha);
return (opacity == null || filter == null) ? 1 : (opacity[1] / 100);
} : function(element){
var opacity = element.retrieve('$opacity');
if (opacity == null) opacity = (element.style.visibility == 'hidden' ? 0 : 1);
return opacity;
}));
var floatName = (html.style.cssFloat == null) ? 'styleFloat' : 'cssFloat';
Element.implement({
getComputedStyle: function(property){
if (this.currentStyle) return this.currentStyle[property.camelCase()];
var defaultView = Element.getDocument(this).defaultView,
computed = defaultView ? defaultView.getComputedStyle(this, null) : null;
return (computed) ? computed.getPropertyValue((property == floatName) ? 'float' : property.hyphenate()) : null;
},
setStyle: function(property, value){
if (property == 'opacity'){
if (value != null) value = parseFloat(value);
setOpacity(this, value);
return this;
}
property = (property == 'float' ? floatName : property).camelCase();
if (typeOf(value) != 'string'){
var map = (Element.Styles[property] || '@').split(' ');
value = Array.from(value).map(function(val, i){
if (!map[i]) return '';
return (typeOf(val) == 'number') ? map[i].replace('@', Math.round(val)) : val;
}).join(' ');
} else if (value == String(Number(value))){
value = Math.round(value);
}
this.style[property] = value;
//<ltIE9>
if ((value == '' || value == null) && doesNotRemoveStyles && this.style.removeAttribute){
this.style.removeAttribute(property);
}
//</ltIE9>
return this;
},
getStyle: function(property){
if (property == 'opacity') return getOpacity(this);
property = (property == 'float' ? floatName : property).camelCase();
var result = this.style[property];
if (!result || property == 'zIndex'){
result = [];
for (var style in Element.ShortStyles){
if (property != style) continue;
for (var s in Element.ShortStyles[style]) result.push(this.getStyle(s));
return result.join(' ');
}
result = this.getComputedStyle(property);
}
if (result){
result = String(result);
var color = result.match(/rgba?\([\d\s,]+\)/);
if (color) result = result.replace(color[0], color[0].rgbToHex());
}
if (Browser.opera || Browser.ie){
if ((/^(height|width)$/).test(property) && !(/px$/.test(result))){
var values = (property == 'width') ? ['left', 'right'] : ['top', 'bottom'], size = 0;
values.each(function(value){
size += this.getStyle('border-' + value + '-width').toInt() + this.getStyle('padding-' + value).toInt();
}, this);
return this['offset' + property.capitalize()] - size + 'px';
}
if (Browser.ie && (/^border(.+)Width|margin|padding/).test(property) && isNaN(parseFloat(result))){
return '0px';
}
}
return result;
},
setStyles: function(styles){
for (var style in styles) this.setStyle(style, styles[style]);
return this;
},
getStyles: function(){
var result = {};
Array.flatten(arguments).each(function(key){
result[key] = this.getStyle(key);
}, this);
return result;
}
});
Element.Styles = {
left: '@px', top: '@px', bottom: '@px', right: '@px',
width: '@px', height: '@px', maxWidth: '@px', maxHeight: '@px', minWidth: '@px', minHeight: '@px',
backgroundColor: 'rgb(@, @, @)', backgroundPosition: '@px @px', color: 'rgb(@, @, @)',
fontSize: '@px', letterSpacing: '@px', lineHeight: '@px', clip: 'rect(@px @px @px @px)',
margin: '@px @px @px @px', padding: '@px @px @px @px', border: '@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)',
borderWidth: '@px @px @px @px', borderStyle: '@ @ @ @', borderColor: 'rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)',
zIndex: '@', 'zoom': '@', fontWeight: '@', textIndent: '@px', opacity: '@'
};
Element.ShortStyles = {margin: {}, padding: {}, border: {}, borderWidth: {}, borderStyle: {}, borderColor: {}};
['Top', 'Right', 'Bottom', 'Left'].each(function(direction){
var Short = Element.ShortStyles;
var All = Element.Styles;
['margin', 'padding'].each(function(style){
var sd = style + direction;
Short[style][sd] = All[sd] = '@px';
});
var bd = 'border' + direction;
Short.border[bd] = All[bd] = '@px @ rgb(@, @, @)';
var bdw = bd + 'Width', bds = bd + 'Style', bdc = bd + 'Color';
Short[bd] = {};
Short.borderWidth[bdw] = Short[bd][bdw] = All[bdw] = '@px';
Short.borderStyle[bds] = Short[bd][bds] = All[bds] = '@';
Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = 'rgb(@, @, @)';
});
})();
/*
---
name: Element.Event
description: Contains Element methods for dealing with events. This file also includes mouseenter and mouseleave custom Element Events, if necessary.
license: MIT-style license.
requires: [Element, Event]
provides: Element.Event
...
*/
(function(){
Element.Properties.events = {set: function(events){
this.addEvents(events);
}};
[Element, Window, Document].invoke('implement', {
addEvent: function(type, fn){
var events = this.retrieve('events', {});
if (!events[type]) events[type] = {keys: [], values: []};
if (events[type].keys.contains(fn)) return this;
events[type].keys.push(fn);
var realType = type,
custom = Element.Events[type],
condition = fn,
self = this;
if (custom){
if (custom.onAdd) custom.onAdd.call(this, fn, type);
if (custom.condition){
condition = function(event){
if (custom.condition.call(this, event, type)) return fn.call(this, event);
return true;
};
}
if (custom.base) realType = Function.from(custom.base).call(this, type);
}
var defn = function(){
return fn.call(self);
};
var nativeEvent = Element.NativeEvents[realType];
if (nativeEvent){
if (nativeEvent == 2){
defn = function(event){
event = new DOMEvent(event, self.getWindow());
if (condition.call(self, event) === false) event.stop();
};
}
this.addListener(realType, defn, arguments[2]);
}
events[type].values.push(defn);
return this;
},
removeEvent: function(type, fn){
var events = this.retrieve('events');
if (!events || !events[type]) return this;
var list = events[type];
var index = list.keys.indexOf(fn);
if (index == -1) return this;
var value = list.values[index];
delete list.keys[index];
delete list.values[index];
var custom = Element.Events[type];
if (custom){
if (custom.onRemove) custom.onRemove.call(this, fn, type);
if (custom.base) type = Function.from(custom.base).call(this, type);
}
return (Element.NativeEvents[type]) ? this.removeListener(type, value, arguments[2]) : this;
},
addEvents: function(events){
for (var event in events) this.addEvent(event, events[event]);
return this;
},
removeEvents: function(events){
var type;
if (typeOf(events) == 'object'){
for (type in events) this.removeEvent(type, events[type]);
return this;
}
var attached = this.retrieve('events');
if (!attached) return this;
if (!events){
for (type in attached) this.removeEvents(type);
this.eliminate('events');
} else if (attached[events]){
attached[events].keys.each(function(fn){
this.removeEvent(events, fn);
}, this);
delete attached[events];
}
return this;
},
fireEvent: function(type, args, delay){
var events = this.retrieve('events');
if (!events || !events[type]) return this;
args = Array.from(args);
events[type].keys.each(function(fn){
if (delay) fn.delay(delay, this, args);
else fn.apply(this, args);
}, this);
return this;
},
cloneEvents: function(from, type){
from = document.id(from);
var events = from.retrieve('events');
if (!events) return this;
if (!type){
for (var eventType in events) this.cloneEvents(from, eventType);
} else if (events[type]){
events[type].keys.each(function(fn){
this.addEvent(type, fn);
}, this);
}
return this;
}
});
Element.NativeEvents = {
click: 2, dblclick: 2, mouseup: 2, mousedown: 2, contextmenu: 2, //mouse buttons
mousewheel: 2, DOMMouseScroll: 2, //mouse wheel
mouseover: 2, mouseout: 2, mousemove: 2, selectstart: 2, selectend: 2, //mouse movement
keydown: 2, keypress: 2, keyup: 2, //keyboard
orientationchange: 2, // mobile
touchstart: 2, touchmove: 2, touchend: 2, touchcancel: 2, // touch
gesturestart: 2, gesturechange: 2, gestureend: 2, // gesture
focus: 2, blur: 2, change: 2, reset: 2, select: 2, submit: 2, paste: 2, input: 2, //form elements
load: 2, unload: 1, beforeunload: 2, resize: 1, move: 1, DOMContentLoaded: 1, readystatechange: 1, //window
error: 1, abort: 1, scroll: 1 //misc
};
Element.Events = {mousewheel: {
base: (Browser.firefox) ? 'DOMMouseScroll' : 'mousewheel'
}};
if ('onmouseenter' in document.documentElement){
Element.NativeEvents.mouseenter = Element.NativeEvents.mouseleave = 2;
} else {
var check = function(event){
var related = event.relatedTarget;
if (related == null) return true;
if (!related) return false;
return (related != this && related.prefix != 'xul' && typeOf(this) != 'document' && !this.contains(related));
};
Element.Events.mouseenter = {
base: 'mouseover',
condition: check
};
Element.Events.mouseleave = {
base: 'mouseout',
condition: check
};
}
/*<ltIE9>*/
if (!window.addEventListener){
Element.NativeEvents.propertychange = 2;
Element.Events.change = {
base: function(){
var type = this.type;
return (this.get('tag') == 'input' && (type == 'radio' || type == 'checkbox')) ? 'propertychange' : 'change'
},
condition: function(event){
return this.type != 'radio' || (event.event.propertyName == 'checked' && this.checked);
}
}
}
/*</ltIE9>*/
})();
/*
---
name: Element.Delegation
description: Extends the Element native object to include the delegate method for more efficient event management.
license: MIT-style license.
requires: [Element.Event]
provides: [Element.Delegation]
...
*/
(function(){
var eventListenerSupport = !!window.addEventListener;
Element.NativeEvents.focusin = Element.NativeEvents.focusout = 2;
var bubbleUp = function(self, match, fn, event, target){
while (target && target != self){
if (match(target, event)) return fn.call(target, event, target);
target = document.id(target.parentNode);
}
};
var map = {
mouseenter: {
base: 'mouseover'
},
mouseleave: {
base: 'mouseout'
},
focus: {
base: 'focus' + (eventListenerSupport ? '' : 'in'),
capture: true
},
blur: {
base: eventListenerSupport ? 'blur' : 'focusout',
capture: true
}
};
/*<ltIE9>*/
var _key = '$delegation:';
var formObserver = function(type){
return {
base: 'focusin',
remove: function(self, uid){
var list = self.retrieve(_key + type + 'listeners', {})[uid];
if (list && list.forms) for (var i = list.forms.length; i--;){
list.forms[i].removeEvent(type, list.fns[i]);
}
},
listen: function(self, match, fn, event, target, uid){
var form = (target.get('tag') == 'form') ? target : event.target.getParent('form');
if (!form) return;
var listeners = self.retrieve(_key + type + 'listeners', {}),
listener = listeners[uid] || {forms: [], fns: []},
forms = listener.forms, fns = listener.fns;
if (forms.indexOf(form) != -1) return;
forms.push(form);
var _fn = function(event){
bubbleUp(self, match, fn, event, target);
};
form.addEvent(type, _fn);
fns.push(_fn);
listeners[uid] = listener;
self.store(_key + type + 'listeners', listeners);
}
};
};
var inputObserver = function(type){
return {
base: 'focusin',
listen: function(self, match, fn, event, target){
var events = {blur: function(){
this.removeEvents(events);
}};
events[type] = function(event){
bubbleUp(self, match, fn, event, target);
};
event.target.addEvents(events);
}
};
};
if (!eventListenerSupport) Object.append(map, {
submit: formObserver('submit'),
reset: formObserver('reset'),
change: inputObserver('change'),
select: inputObserver('select')
});
/*</ltIE9>*/
var proto = Element.prototype,
addEvent = proto.addEvent,
removeEvent = proto.removeEvent;
var relay = function(old, method){
return function(type, fn, useCapture){
if (type.indexOf(':relay') == -1) return old.call(this, type, fn, useCapture);
var parsed = Slick.parse(type).expressions[0][0];
if (parsed.pseudos[0].key != 'relay') return old.call(this, type, fn, useCapture);
var newType = parsed.tag;
parsed.pseudos.slice(1).each(function(pseudo){
newType += ':' + pseudo.key + (pseudo.value ? '(' + pseudo.value + ')' : '');
});
old.call(this, type, fn);
return method.call(this, newType, parsed.pseudos[0].value, fn);
};
};
var delegation = {
addEvent: function(type, match, fn){
var storage = this.retrieve('$delegates', {}), stored = storage[type];
if (stored) for (var _uid in stored){
if (stored[_uid].fn == fn && stored[_uid].match == match) return this;
}
var _type = type, _match = match, _fn = fn, _map = map[type] || {};
type = _map.base || _type;
match = function(target){
return Slick.match(target, _match);
};
var elementEvent = Element.Events[_type];
if (elementEvent && elementEvent.condition){
var __match = match, condition = elementEvent.condition;
match = function(target, event){
return __match(target, event) && condition.call(target, event, type);
};
}
var self = this, uid = String.uniqueID();
var delegator = _map.listen ? function(event, target){
if (!target && event && event.target) target = event.target;
if (target) _map.listen(self, match, fn, event, target, uid);
} : function(event, target){
if (!target && event && event.target) target = event.target;
if (target) bubbleUp(self, match, fn, event, target);
};
if (!stored) stored = {};
stored[uid] = {
match: _match,
fn: _fn,
delegator: delegator
};
storage[_type] = stored;
return addEvent.call(this, type, delegator, _map.capture);
},
removeEvent: function(type, match, fn, _uid){
var storage = this.retrieve('$delegates', {}), stored = storage[type];
if (!stored) return this;
if (_uid){
var _type = type, delegator = stored[_uid].delegator, _map = map[type] || {};
type = _map.base || _type;
if (_map.remove) _map.remove(this, _uid);
delete stored[_uid];
storage[_type] = stored;
return removeEvent.call(this, type, delegator);
}
var __uid, s;
if (fn) for (__uid in stored){
s = stored[__uid];
if (s.match == match && s.fn == fn) return delegation.removeEvent.call(this, type, match, fn, __uid);
} else for (__uid in stored){
s = stored[__uid];
if (s.match == match) delegation.removeEvent.call(this, type, match, s.fn, __uid);
}
return this;
}
};
[Element, Window, Document].invoke('implement', {
addEvent: relay(addEvent, delegation.addEvent),
removeEvent: relay(removeEvent, delegation.removeEvent)
});
})();
/*
---
name: Element.Dimensions
description: Contains methods to work with size, scroll, or positioning of Elements and the window object.
license: MIT-style license.
credits:
- Element positioning based on the [qooxdoo](http://qooxdoo.org/) code and smart browser fixes, [LGPL License](http://www.gnu.org/licenses/lgpl.html).
- Viewport dimensions based on [YUI](http://developer.yahoo.com/yui/) code, [BSD License](http://developer.yahoo.com/yui/license.html).
requires: [Element, Element.Style]
provides: [Element.Dimensions]
...
*/
(function(){
var element = document.createElement('div'),
child = document.createElement('div');
element.style.height = '0';
element.appendChild(child);
var brokenOffsetParent = (child.offsetParent === element);
element = child = null;
var isOffset = function(el){
return styleString(el, 'position') != 'static' || isBody(el);
};
var isOffsetStatic = function(el){
return isOffset(el) || (/^(?:table|td|th)$/i).test(el.tagName);
};
Element.implement({
scrollTo: function(x, y){
if (isBody(this)){
this.getWindow().scrollTo(x, y);
} else {
this.scrollLeft = x;
this.scrollTop = y;
}
return this;
},
getSize: function(){
if (isBody(this)) return this.getWindow().getSize();
return {x: this.offsetWidth, y: this.offsetHeight};
},
getScrollSize: function(){
if (isBody(this)) return this.getWindow().getScrollSize();
return {x: this.scrollWidth, y: this.scrollHeight};
},
getScroll: function(){
if (isBody(this)) return this.getWindow().getScroll();
return {x: this.scrollLeft, y: this.scrollTop};
},
getScrolls: function(){
var element = this.parentNode, position = {x: 0, y: 0};
while (element && !isBody(element)){
position.x += element.scrollLeft;
position.y += element.scrollTop;
element = element.parentNode;
}
return position;
},
getOffsetParent: brokenOffsetParent ? function(){
var element = this;
if (isBody(element) || styleString(element, 'position') == 'fixed') return null;
var isOffsetCheck = (styleString(element, 'position') == 'static') ? isOffsetStatic : isOffset;
while ((element = element.parentNode)){
if (isOffsetCheck(element)) return element;
}
return null;
} : function(){
var element = this;
if (isBody(element) || styleString(element, 'position') == 'fixed') return null;
try {
return element.offsetParent;
} catch(e) {}
return null;
},
getOffsets: function(){
if (this.getBoundingClientRect && !Browser.Platform.ios){
var bound = this.getBoundingClientRect(),
html = document.id(this.getDocument().documentElement),
htmlScroll = html.getScroll(),
elemScrolls = this.getScrolls(),
isFixed = (styleString(this, 'position') == 'fixed');
return {
x: bound.left.toInt() + elemScrolls.x + ((isFixed) ? 0 : htmlScroll.x) - html.clientLeft,
y: bound.top.toInt() + elemScrolls.y + ((isFixed) ? 0 : htmlScroll.y) - html.clientTop
};
}
var element = this, position = {x: 0, y: 0};
if (isBody(this)) return position;
while (element && !isBody(element)){
position.x += element.offsetLeft;
position.y += element.offsetTop;
if (Browser.firefox){
if (!borderBox(element)){
position.x += leftBorder(element);
position.y += topBorder(element);
}
var parent = element.parentNode;
if (parent && styleString(parent, 'overflow') != 'visible'){
position.x += leftBorder(parent);
position.y += topBorder(parent);
}
} else if (element != this && Browser.safari){
position.x += leftBorder(element);
position.y += topBorder(element);
}
element = element.offsetParent;
}
if (Browser.firefox && !borderBox(this)){
position.x -= leftBorder(this);
position.y -= topBorder(this);
}
return position;
},
getPosition: function(relative){
var offset = this.getOffsets(),
scroll = this.getScrolls();
var position = {
x: offset.x - scroll.x,
y: offset.y - scroll.y
};
if (relative && (relative = document.id(relative))){
var relativePosition = relative.getPosition();
return {x: position.x - relativePosition.x - leftBorder(relative), y: position.y - relativePosition.y - topBorder(relative)};
}
return position;
},
getCoordinates: function(element){
if (isBody(this)) return this.getWindow().getCoordinates();
var position = this.getPosition(element),
size = this.getSize();
var obj = {
left: position.x,
top: position.y,
width: size.x,
height: size.y
};
obj.right = obj.left + obj.width;
obj.bottom = obj.top + obj.height;
return obj;
},
computePosition: function(obj){
return {
left: obj.x - styleNumber(this, 'margin-left'),
top: obj.y - styleNumber(this, 'margin-top')
};
},
setPosition: function(obj){
return this.setStyles(this.computePosition(obj));
}
});
[Document, Window].invoke('implement', {
getSize: function(){
var doc = getCompatElement(this);
return {x: doc.clientWidth, y: doc.clientHeight};
},
getScroll: function(){
var win = this.getWindow(), doc = getCompatElement(this);
return {x: win.pageXOffset || doc.scrollLeft, y: win.pageYOffset || doc.scrollTop};
},
getScrollSize: function(){
var doc = getCompatElement(this),
min = this.getSize(),
body = this.getDocument().body;
return {x: Math.max(doc.scrollWidth, body.scrollWidth, min.x), y: Math.max(doc.scrollHeight, body.scrollHeight, min.y)};
},
getPosition: function(){
return {x: 0, y: 0};
},
getCoordinates: function(){
var size = this.getSize();
return {top: 0, left: 0, bottom: size.y, right: size.x, height: size.y, width: size.x};
}
});
// private methods
var styleString = Element.getComputedStyle;
function styleNumber(element, style){
return styleString(element, style).toInt() || 0;
}
function borderBox(element){
return styleString(element, '-moz-box-sizing') == 'border-box';
}
function topBorder(element){
return styleNumber(element, 'border-top-width');
}
function leftBorder(element){
return styleNumber(element, 'border-left-width');
}
function isBody(element){
return (/^(?:body|html)$/i).test(element.tagName);
}
function getCompatElement(element){
var doc = element.getDocument();
return (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body;
}
})();
//aliases
Element.alias({position: 'setPosition'}); //compatability
[Window, Document, Element].invoke('implement', {
getHeight: function(){
return this.getSize().y;
},
getWidth: function(){
return this.getSize().x;
},
getScrollTop: function(){
return this.getScroll().y;
},
getScrollLeft: function(){
return this.getScroll().x;
},
getScrollHeight: function(){
return this.getScrollSize().y;
},
getScrollWidth: function(){
return this.getScrollSize().x;
},
getTop: function(){
return this.getPosition().y;
},
getLeft: function(){
return this.getPosition().x;
}
});
/*
---
name: Fx
description: Contains the basic animation logic to be extended by all other Fx Classes.
license: MIT-style license.
requires: [Chain, Events, Options]
provides: Fx
...
*/
(function(){
var Fx = this.Fx = new Class({
Implements: [Chain, Events, Options],
options: {
/*
onStart: nil,
onCancel: nil,
onComplete: nil,
*/
fps: 60,
unit: false,
duration: 500,
frames: null,
frameSkip: true,
link: 'ignore'
},
initialize: function(options){
this.subject = this.subject || this;
this.setOptions(options);
},
getTransition: function(){
return function(p){
return -(Math.cos(Math.PI * p) - 1) / 2;
};
},
step: function(now){
if (this.options.frameSkip){
var diff = (this.time != null) ? (now - this.time) : 0, frames = diff / this.frameInterval;
this.time = now;
this.frame += frames;
} else {
this.frame++;
}
if (this.frame < this.frames){
var delta = this.transition(this.frame / this.frames);
this.set(this.compute(this.from, this.to, delta));
} else {
this.frame = this.frames;
this.set(this.compute(this.from, this.to, 1));
this.stop();
}
},
set: function(now){
return now;
},
compute: function(from, to, delta){
return Fx.compute(from, to, delta);
},
check: function(){
if (!this.isRunning()) return true;
switch (this.options.link){
case 'cancel': this.cancel(); return true;
case 'chain': this.chain(this.caller.pass(arguments, this)); return false;
}
return false;
},
start: function(from, to){
if (!this.check(from, to)) return this;
this.from = from;
this.to = to;
this.frame = (this.options.frameSkip) ? 0 : -1;
this.time = null;
this.transition = this.getTransition();
var frames = this.options.frames, fps = this.options.fps, duration = this.options.duration;
this.duration = Fx.Durations[duration] || duration.toInt();
this.frameInterval = 1000 / fps;
this.frames = frames || Math.round(this.duration / this.frameInterval);
this.fireEvent('start', this.subject);
pushInstance.call(this, fps);
return this;
},
stop: function(){
if (this.isRunning()){
this.time = null;
pullInstance.call(this, this.options.fps);
if (this.frames == this.frame){
this.fireEvent('complete', this.subject);
if (!this.callChain()) this.fireEvent('chainComplete', this.subject);
} else {
this.fireEvent('stop', this.subject);
}
}
return this;
},
cancel: function(){
if (this.isRunning()){
this.time = null;
pullInstance.call(this, this.options.fps);
this.frame = this.frames;
this.fireEvent('cancel', this.subject).clearChain();
}
return this;
},
pause: function(){
if (this.isRunning()){
this.time = null;
pullInstance.call(this, this.options.fps);
}
return this;
},
resume: function(){
if ((this.frame < this.frames) && !this.isRunning()) pushInstance.call(this, this.options.fps);
return this;
},
isRunning: function(){
var list = instances[this.options.fps];
return list && list.contains(this);
}
});
Fx.compute = function(from, to, delta){
return (to - from) * delta + from;
};
Fx.Durations = {'short': 250, 'normal': 500, 'long': 1000};
// global timers
var instances = {}, timers = {};
var loop = function(){
var now = Date.now();
for (var i = this.length; i--;){
var instance = this[i];
if (instance) instance.step(now);
}
};
var pushInstance = function(fps){
var list = instances[fps] || (instances[fps] = []);
list.push(this);
if (!timers[fps]) timers[fps] = loop.periodical(Math.round(1000 / fps), list);
};
var pullInstance = function(fps){
var list = instances[fps];
if (list){
list.erase(this);
if (!list.length && timers[fps]){
delete instances[fps];
timers[fps] = clearInterval(timers[fps]);
}
}
};
})();
/*
---
name: Fx.CSS
description: Contains the CSS animation logic. Used by Fx.Tween, Fx.Morph, Fx.Elements.
license: MIT-style license.
requires: [Fx, Element.Style]
provides: Fx.CSS
...
*/
Fx.CSS = new Class({
Extends: Fx,
//prepares the base from/to object
prepare: function(element, property, values){
values = Array.from(values);
var from = values[0], to = values[1];
if (to == null){
to = from;
from = element.getStyle(property);
var unit = this.options.unit;
// adapted from: https://github.com/ryanmorr/fx/blob/master/fx.js#L299
if (unit && from.slice(-unit.length) != unit && parseFloat(from) != 0){
element.setStyle(property, to + unit);
var value = element.getComputedStyle(property);
// IE and Opera support pixelLeft or pixelWidth
if (!(/px$/.test(value))){
value = element.style[('pixel-' + property).camelCase()];
if (value == null){
// adapted from Dean Edwards' http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
var left = element.style.left;
element.style.left = to + unit;
value = element.style.pixelLeft;
element.style.left = left;
}
}
from = (to || 1) / (parseFloat(value) || 1) * (parseFloat(from) || 0);
element.setStyle(property, from + unit);
}
}
return {from: this.parse(from), to: this.parse(to)};
},
//parses a value into an array
parse: function(value){
value = Function.from(value)();
value = (typeof value == 'string') ? value.split(' ') : Array.from(value);
return value.map(function(val){
val = String(val);
var found = false;
Object.each(Fx.CSS.Parsers, function(parser, key){
if (found) return;
var parsed = parser.parse(val);
if (parsed || parsed === 0) found = {value: parsed, parser: parser};
});
found = found || {value: val, parser: Fx.CSS.Parsers.String};
return found;
});
},
//computes by a from and to prepared objects, using their parsers.
compute: function(from, to, delta){
var computed = [];
(Math.min(from.length, to.length)).times(function(i){
computed.push({value: from[i].parser.compute(from[i].value, to[i].value, delta), parser: from[i].parser});
});
computed.$family = Function.from('fx:css:value');
return computed;
},
//serves the value as settable
serve: function(value, unit){
if (typeOf(value) != 'fx:css:value') value = this.parse(value);
var returned = [];
value.each(function(bit){
returned = returned.concat(bit.parser.serve(bit.value, unit));
});
return returned;
},
//renders the change to an element
render: function(element, property, value, unit){
element.setStyle(property, this.serve(value, unit));
},
//searches inside the page css to find the values for a selector
search: function(selector){
if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector];
var to = {}, selectorTest = new RegExp('^' + selector.escapeRegExp() + '$');
Array.each(document.styleSheets, function(sheet, j){
var href = sheet.href;
if (href && href.contains('://') && !href.contains(document.domain)) return;
var rules = sheet.rules || sheet.cssRules;
Array.each(rules, function(rule, i){
if (!rule.style) return;
var selectorText = (rule.selectorText) ? rule.selectorText.replace(/^\w+/, function(m){
return m.toLowerCase();
}) : null;
if (!selectorText || !selectorTest.test(selectorText)) return;
Object.each(Element.Styles, function(value, style){
if (!rule.style[style] || Element.ShortStyles[style]) return;
value = String(rule.style[style]);
to[style] = ((/^rgb/).test(value)) ? value.rgbToHex() : value;
});
});
});
return Fx.CSS.Cache[selector] = to;
}
});
Fx.CSS.Cache = {};
Fx.CSS.Parsers = {
Color: {
parse: function(value){
if (value.match(/^#[0-9a-f]{3,6}$/i)) return value.hexToRgb(true);
return ((value = value.match(/(\d+),\s*(\d+),\s*(\d+)/))) ? [value[1], value[2], value[3]] : false;
},
compute: function(from, to, delta){
return from.map(function(value, i){
return Math.round(Fx.compute(from[i], to[i], delta));
});
},
serve: function(value){
return value.map(Number);
}
},
Number: {
parse: parseFloat,
compute: Fx.compute,
serve: function(value, unit){
return (unit) ? value + unit : value;
}
},
String: {
parse: Function.from(false),
compute: function(zero, one){
return one;
},
serve: function(zero){
return zero;
}
}
};
/*
---
name: Fx.Tween
description: Formerly Fx.Style, effect to transition any CSS property for an element.
license: MIT-style license.
requires: Fx.CSS
provides: [Fx.Tween, Element.fade, Element.highlight]
...
*/
Fx.Tween = new Class({
Extends: Fx.CSS,
initialize: function(element, options){
this.element = this.subject = document.id(element);
this.parent(options);
},
set: function(property, now){
if (arguments.length == 1){
now = property;
property = this.property || this.options.property;
}
this.render(this.element, property, now, this.options.unit);
return this;
},
start: function(property, from, to){
if (!this.check(property, from, to)) return this;
var args = Array.flatten(arguments);
this.property = this.options.property || args.shift();
var parsed = this.prepare(this.element, this.property, args);
return this.parent(parsed.from, parsed.to);
}
});
Element.Properties.tween = {
set: function(options){
this.get('tween').cancel().setOptions(options);
return this;
},
get: function(){
var tween = this.retrieve('tween');
if (!tween){
tween = new Fx.Tween(this, {link: 'cancel'});
this.store('tween', tween);
}
return tween;
}
};
Element.implement({
tween: function(property, from, to){
this.get('tween').start(property, from, to);
return this;
},
fade: function(how){
var fade = this.get('tween'), method, args = ['opacity'].append(arguments), toggle;
if (args[1] == null) args[1] = 'toggle';
switch (args[1]){
case 'in': method = 'start'; args[1] = 1; break;
case 'out': method = 'start'; args[1] = 0; break;
case 'show': method = 'set'; args[1] = 1; break;
case 'hide': method = 'set'; args[1] = 0; break;
case 'toggle':
var flag = this.retrieve('fade:flag', this.getStyle('opacity') == 1);
method = 'start';
args[1] = flag ? 0 : 1;
this.store('fade:flag', !flag);
toggle = true;
break;
default: method = 'start';
}
if (!toggle) this.eliminate('fade:flag');
fade[method].apply(fade, args);
var to = args[args.length - 1];
if (method == 'set' || to != 0) this.setStyle('visibility', to == 0 ? 'hidden' : 'visible');
else fade.chain(function(){
this.element.setStyle('visibility', 'hidden');
this.callChain();
});
return this;
},
highlight: function(start, end){
if (!end){
end = this.retrieve('highlight:original', this.getStyle('background-color'));
end = (end == 'transparent') ? '#fff' : end;
}
var tween = this.get('tween');
tween.start('background-color', start || '#ffff88', end).chain(function(){
this.setStyle('background-color', this.retrieve('highlight:original'));
tween.callChain();
}.bind(this));
return this;
}
});
/*
---
name: Fx.Morph
description: Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.
license: MIT-style license.
requires: Fx.CSS
provides: Fx.Morph
...
*/
Fx.Morph = new Class({
Extends: Fx.CSS,
initialize: function(element, options){
this.element = this.subject = document.id(element);
this.parent(options);
},
set: function(now){
if (typeof now == 'string') now = this.search(now);
for (var p in now) this.render(this.element, p, now[p], this.options.unit);
return this;
},
compute: function(from, to, delta){
var now = {};
for (var p in from) now[p] = this.parent(from[p], to[p], delta);
return now;
},
start: function(properties){
if (!this.check(properties)) return this;
if (typeof properties == 'string') properties = this.search(properties);
var from = {}, to = {};
for (var p in properties){
var parsed = this.prepare(this.element, p, properties[p]);
from[p] = parsed.from;
to[p] = parsed.to;
}
return this.parent(from, to);
}
});
Element.Properties.morph = {
set: function(options){
this.get('morph').cancel().setOptions(options);
return this;
},
get: function(){
var morph = this.retrieve('morph');
if (!morph){
morph = new Fx.Morph(this, {link: 'cancel'});
this.store('morph', morph);
}
return morph;
}
};
Element.implement({
morph: function(props){
this.get('morph').start(props);
return this;
}
});
/*
---
name: Fx.Transitions
description: Contains a set of advanced transitions to be used with any of the Fx Classes.
license: MIT-style license.
credits:
- Easing Equations by Robert Penner, <http://www.robertpenner.com/easing/>, modified and optimized to be used with MooTools.
requires: Fx
provides: Fx.Transitions
...
*/
Fx.implement({
getTransition: function(){
var trans = this.options.transition || Fx.Transitions.Sine.easeInOut;
if (typeof trans == 'string'){
var data = trans.split(':');
trans = Fx.Transitions;
trans = trans[data[0]] || trans[data[0].capitalize()];
if (data[1]) trans = trans['ease' + data[1].capitalize() + (data[2] ? data[2].capitalize() : '')];
}
return trans;
}
});
Fx.Transition = function(transition, params){
params = Array.from(params);
var easeIn = function(pos){
return transition(pos, params);
};
return Object.append(easeIn, {
easeIn: easeIn,
easeOut: function(pos){
return 1 - transition(1 - pos, params);
},
easeInOut: function(pos){
return (pos <= 0.5 ? transition(2 * pos, params) : (2 - transition(2 * (1 - pos), params))) / 2;
}
});
};
Fx.Transitions = {
linear: function(zero){
return zero;
}
};
Fx.Transitions.extend = function(transitions){
for (var transition in transitions) Fx.Transitions[transition] = new Fx.Transition(transitions[transition]);
};
Fx.Transitions.extend({
Pow: function(p, x){
return Math.pow(p, x && x[0] || 6);
},
Expo: function(p){
return Math.pow(2, 8 * (p - 1));
},
Circ: function(p){
return 1 - Math.sin(Math.acos(p));
},
Sine: function(p){
return 1 - Math.cos(p * Math.PI / 2);
},
Back: function(p, x){
x = x && x[0] || 1.618;
return Math.pow(p, 2) * ((x + 1) * p - x);
},
Bounce: function(p){
var value;
for (var a = 0, b = 1; 1; a += b, b /= 2){
if (p >= (7 - 4 * a) / 11){
value = b * b - Math.pow((11 - 6 * a - 11 * p) / 4, 2);
break;
}
}
return value;
},
Elastic: function(p, x){
return Math.pow(2, 10 * --p) * Math.cos(20 * p * Math.PI * (x && x[0] || 1) / 3);
}
});
['Quad', 'Cubic', 'Quart', 'Quint'].each(function(transition, i){
Fx.Transitions[transition] = new Fx.Transition(function(p){
return Math.pow(p, i + 2);
});
});
/*
---
name: Request
description: Powerful all purpose Request Class. Uses XMLHTTPRequest.
license: MIT-style license.
requires: [Object, Element, Chain, Events, Options, Browser]
provides: Request
...
*/
(function(){
var empty = function(){},
progressSupport = ('onprogress' in new Browser.Request);
var Request = this.Request = new Class({
Implements: [Chain, Events, Options],
options: {/*
onRequest: function(){},
onLoadstart: function(event, xhr){},
onProgress: function(event, xhr){},
onUploadProgress: function(event, xhr){},
onComplete: function(){},
onCancel: function(){},
onSuccess: function(responseText, responseXML){},
onFailure: function(xhr){},
onException: function(headerName, value){},
onTimeout: function(){},
user: '',
password: '',*/
url: '',
data: '',
processData: true,
responseType: null,
headers: {
'X-Requested-With': 'XMLHttpRequest',
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
},
async: true,
format: false,
method: 'post',
link: 'ignore',
isSuccess: null,
emulation: true,
urlEncoded: true,
encoding: 'utf-8',
evalScripts: false,
evalResponse: false,
timeout: 0,
noCache: false
},
initialize: function(options){
this.xhr = new Browser.Request();
this.setOptions(options);
if ((typeof ArrayBuffer != 'undefined' && options.data instanceof ArrayBuffer) || (typeof Blob != 'undefined' && options.data instanceof Blob) || (typeof Uint8Array != 'undefined' && options.data instanceof Uint8Array)){
// set data in directly if we're passing binary data because
// otherwise setOptions will convert the data into an empty object
this.options.data = options.data;
}
this.headers = this.options.headers;
},
onStateChange: function(){
var xhr = this.xhr;
if (xhr.readyState != 4 || !this.running) return;
this.running = false;
this.status = 0;
Function.attempt(function(){
var status = xhr.status;
this.status = (status == 1223) ? 204 : status;
}.bind(this));
xhr.onreadystatechange = empty;
if (progressSupport) xhr.onprogress = xhr.onloadstart = empty;
clearTimeout(this.timer);
this.response = {text: (!this.options.responseType && this.xhr.responseText) || '', xml: (!this.options.responseType && this.xhr.responseXML)};
if (this.options.isSuccess.call(this, this.status))
this.success(this.options.responseType ? this.xhr.response : this.response.text, this.response.xml);
else
this.failure();
},
isSuccess: function(){
var status = this.status;
return (status >= 200 && status < 300);
},
isRunning: function(){
return !!this.running;
},
processScripts: function(text){
if (typeof text != 'string') return text;
if (this.options.evalResponse || (/(ecma|java)script/).test(this.getHeader('Content-type'))) return Browser.exec(text);
return text.stripScripts(this.options.evalScripts);
},
success: function(text, xml){
this.onSuccess(this.processScripts(text), xml);
},
onSuccess: function(){
this.fireEvent('complete', arguments).fireEvent('success', arguments).callChain();
},
failure: function(){
this.onFailure();
},
onFailure: function(){
this.fireEvent('complete').fireEvent('failure', this.xhr);
},
loadstart: function(event){
this.fireEvent('loadstart', [event, this.xhr]);
},
progress: function(event){
this.fireEvent('progress', [event, this.xhr]);
},
uploadprogress: function(event){
this.fireEvent('uploadprogress', [event, this.xhr]);
},
timeout: function(){
this.fireEvent('timeout', this.xhr);
},
setHeader: function(name, value){
this.headers[name] = value;
return this;
},
getHeader: function(name){
return Function.attempt(function(){
return this.xhr.getResponseHeader(name);
}.bind(this));
},
check: function(){
if (!this.running) return true;
switch (this.options.link){
case 'cancel': this.cancel(); return true;
case 'chain': this.chain(this.caller.pass(arguments, this)); return false;
}
return false;
},
send: function(options){
if (!this.check(options)) return this;
this.options.isSuccess = this.options.isSuccess || this.isSuccess;
this.running = true;
var type = typeOf(options);
if (type == 'string' || type == 'element') options = {data: options};
var old = this.options;
options = Object.append({data: old.data, url: old.url, method: old.method}, options);
var data = options.data, url = String(options.url), method = options.method.toLowerCase();
if (this.options.processData || method == 'get' || method == 'delete'){
switch (typeOf(data)){
case 'element': data = document.id(data).toQueryString(); break;
case 'object': case 'hash': data = Object.toQueryString(data);
}
if (this.options.format){
var format = 'format=' + this.options.format;
data = (data) ? format + '&' + data : format;
}
if (this.options.emulation && !['get', 'post'].contains(method)){
var _method = '_method=' + method;
data = (data) ? _method + '&' + data : _method;
method = 'post';
}
}
if (this.options.urlEncoded && ['post', 'put'].contains(method)){
var encoding = (this.options.encoding) ? '; charset=' + this.options.encoding : '';
this.headers['Content-type'] = 'application/x-www-form-urlencoded' + encoding;
}
if (!url) url = document.location.pathname;
var trimPosition = url.lastIndexOf('/');
if (trimPosition > -1 && (trimPosition = url.indexOf('#')) > -1) url = url.substr(0, trimPosition);
if (this.options.noCache)
url += (url.contains('?') ? '&' : '?') + String.uniqueID();
if (data && method == 'get'){
url += (url.contains('?') ? '&' : '?') + data;
data = null;
}
var xhr = this.xhr;
if (progressSupport){
xhr.onloadstart = this.loadstart.bind(this);
xhr.onprogress = this.progress.bind(this);
if(xhr.upload) xhr.upload.onprogress = this.uploadprogress.bind(this);
}
xhr.open(method.toUpperCase(), url, this.options.async, this.options.user, this.options.password);
if (this.options.user && 'withCredentials' in xhr) xhr.withCredentials = true;
xhr.onreadystatechange = this.onStateChange.bind(this);
Object.each(this.headers, function(value, key){
try {
xhr.setRequestHeader(key, value);
} catch (e){
this.fireEvent('exception', [key, value]);
}
}, this);
if (this.options.responseType){
xhr.responseType = this.options.responseType.toLowerCase();
}
this.fireEvent('request');
xhr.send(data);
if (!this.options.async) this.onStateChange();
else if (this.options.timeout) this.timer = this.timeout.delay(this.options.timeout, this);
return this;
},
cancel: function(){
if (!this.running) return this;
this.running = false;
var xhr = this.xhr;
xhr.abort();
clearTimeout(this.timer);
xhr.onreadystatechange = empty;
if (progressSupport) xhr.onprogress = xhr.onloadstart = empty;
this.xhr = new Browser.Request();
this.fireEvent('cancel');
return this;
}
});
var methods = {};
['get', 'post', 'put', 'delete', 'GET', 'POST', 'PUT', 'DELETE'].each(function(method){
methods[method] = function(data){
var object = {
method: method
};
if (data != null) object.data = data;
return this.send(object);
};
});
Request.implement(methods);
Element.Properties.send = {
set: function(options){
var send = this.get('send').cancel();
send.setOptions(options);
return this;
},
get: function(){
var send = this.retrieve('send');
if (!send){
send = new Request({
data: this, link: 'cancel', method: this.get('method') || 'post', url: this.get('action')
});
this.store('send', send);
}
return send;
}
};
Element.implement({
send: function(url){
var sender = this.get('send');
sender.send({data: this, url: url || sender.options.url});
return this;
}
});
})();
/*
---
name: Request.HTML
description: Extends the basic Request Class with additional methods for interacting with HTML responses.
license: MIT-style license.
requires: [Element, Request]
provides: Request.HTML
...
*/
Request.HTML = new Class({
Extends: Request,
options: {
update: false,
append: false,
evalScripts: true,
filter: false,
headers: {
Accept: 'text/html, application/xml, text/xml, */*'
}
},
success: function(text){
var options = this.options, response = this.response;
response.html = text.stripScripts(function(script){
response.javascript = script;
});
var match = response.html.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
if (match) response.html = match[1];
var temp = new Element('div').set('html', response.html);
response.tree = temp.childNodes;
response.elements = temp.getElements(options.filter || '*');
if (options.filter) response.tree = response.elements;
if (options.update){
var update = document.id(options.update).empty();
if (options.filter) update.adopt(response.elements);
else update.set('html', response.html);
} else if (options.append){
var append = document.id(options.append);
if (options.filter) response.elements.reverse().inject(append);
else append.adopt(temp.getChildren());
}
if (options.evalScripts) Browser.exec(response.javascript);
this.onSuccess(response.tree, response.elements, response.html, response.javascript);
}
});
Element.Properties.load = {
set: function(options){
var load = this.get('load').cancel();
load.setOptions(options);
return this;
},
get: function(){
var load = this.retrieve('load');
if (!load){
load = new Request.HTML({data: this, link: 'cancel', update: this, method: 'get'});
this.store('load', load);
}
return load;
}
};
Element.implement({
load: function(){
this.get('load').send(Array.link(arguments, {data: Type.isObject, url: Type.isString}));
return this;
}
});
/*
---
name: JSON
description: JSON encoder and decoder.
license: MIT-style license.
SeeAlso: <http://www.json.org/>
requires: [Array, String, Number, Function]
provides: JSON
...
*/
if (typeof JSON == 'undefined') this.JSON = {};
(function(){
var special = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'};
var escape = function(chr){
return special[chr] || '\\u' + ('0000' + chr.charCodeAt(0).toString(16)).slice(-4);
};
JSON.validate = function(string){
string = string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, '');
return (/^[\],:{}\s]*$/).test(string);
};
JSON.encode = JSON.stringify ? function(obj){
return JSON.stringify(obj);
} : function(obj){
if (obj && obj.toJSON) obj = obj.toJSON();
switch (typeOf(obj)){
case 'string':
return '"' + obj.replace(/[\x00-\x1f\\"]/g, escape) + '"';
case 'array':
return '[' + obj.map(JSON.encode).clean() + ']';
case 'object': case 'hash':
var string = [];
Object.each(obj, function(value, key){
var json = JSON.encode(value);
if (json) string.push(JSON.encode(key) + ':' + json);
});
return '{' + string + '}';
case 'number': case 'boolean': return '' + obj;
case 'null': return 'null';
}
return null;
};
JSON.decode = function(string, secure){
if (!string || typeOf(string) != 'string') return null;
if (secure || JSON.secure){
if (JSON.parse) return JSON.parse(string);
if (!JSON.validate(string)) throw new Error('JSON could not decode the input; security is enabled and the value is not secure.');
}
return eval('(' + string + ')');
};
})();
/*
---
name: Request.JSON
description: Extends the basic Request Class with additional methods for sending and receiving JSON data.
license: MIT-style license.
requires: [Request, JSON]
provides: Request.JSON
...
*/
Request.JSON = new Class({
Extends: Request,
options: {
/*onError: function(text, error){},*/
secure: true
},
initialize: function(options){
this.parent(options);
Object.append(this.headers, {
'Accept': 'application/json',
'X-Request': 'JSON'
});
},
success: function(text){
var json;
try {
json = this.response.json = JSON.decode(text, this.options.secure);
} catch (error){
this.fireEvent('error', [text, error]);
return;
}
if (json == null) this.onFailure();
else this.onSuccess(json, text);
}
});
/*
---
name: Cookie
description: Class for creating, reading, and deleting browser Cookies.
license: MIT-style license.
credits:
- Based on the functions by Peter-Paul Koch (http://quirksmode.org).
requires: [Options, Browser]
provides: Cookie
...
*/
var Cookie = new Class({
Implements: Options,
options: {
path: '/',
domain: false,
duration: false,
secure: false,
document: document,
encode: true
},
initialize: function(key, options){
this.key = key;
this.setOptions(options);
},
write: function(value){
if (this.options.encode) value = encodeURIComponent(value);
if (this.options.domain) value += '; domain=' + this.options.domain;
if (this.options.path) value += '; path=' + this.options.path;
if (this.options.duration){
var date = new Date();
date.setTime(date.getTime() + this.options.duration * 24 * 60 * 60 * 1000);
value += '; expires=' + date.toGMTString();
}
if (this.options.secure) value += '; secure';
this.options.document.cookie = this.key + '=' + value;
return this;
},
read: function(){
var value = this.options.document.cookie.match('(?:^|;)\\s*' + this.key.escapeRegExp() + '=([^;]*)');
return (value) ? decodeURIComponent(value[1]) : null;
},
dispose: function(){
new Cookie(this.key, Object.merge({}, this.options, {duration: -1})).write('');
return this;
}
});
Cookie.write = function(key, value, options){
return new Cookie(key, options).write(value);
};
Cookie.read = function(key){
return new Cookie(key).read();
};
Cookie.dispose = function(key, options){
return new Cookie(key, options).dispose();
};
/*
---
name: DOMReady
description: Contains the custom event domready.
license: MIT-style license.
requires: [Browser, Element, Element.Event]
provides: [DOMReady, DomReady]
...
*/
(function(window, document){
var ready,
loaded,
checks = [],
shouldPoll,
timer,
testElement = document.createElement('div');
var domready = function(){
clearTimeout(timer);
if (ready) return;
Browser.loaded = ready = true;
document.removeListener('DOMContentLoaded', domready).removeListener('readystatechange', check);
document.fireEvent('domready');
window.fireEvent('domready');
};
var check = function(){
for (var i = checks.length; i--;) if (checks[i]()){
domready();
return true;
}
return false;
};
var poll = function(){
clearTimeout(timer);
if (!check()) timer = setTimeout(poll, 10);
};
document.addListener('DOMContentLoaded', domready);
/*<ltIE8>*/
// doScroll technique by Diego Perini http://javascript.nwbox.com/IEContentLoaded/
// testElement.doScroll() throws when the DOM is not ready, only in the top window
var doScrollWorks = function(){
try {
testElement.doScroll();
return true;
} catch (e){}
return false;
};
// If doScroll works already, it can't be used to determine domready
// e.g. in an iframe
if (testElement.doScroll && !doScrollWorks()){
checks.push(doScrollWorks);
shouldPoll = true;
}
/*</ltIE8>*/
if (document.readyState) checks.push(function(){
var state = document.readyState;
return (state == 'loaded' || state == 'complete');
});
if ('onreadystatechange' in document) document.addListener('readystatechange', check);
else shouldPoll = true;
if (shouldPoll) poll();
Element.Events.domready = {
onAdd: function(fn){
if (ready) fn.call(this);
}
};
// Make sure that domready fires before load
Element.Events.load = {
base: 'load',
onAdd: function(fn){
if (loaded && this == window) fn.call(this);
},
condition: function(){
if (this == window){
domready();
delete Element.Events.load;
}
return true;
}
};
// This is based on the custom load event
window.addEvent('load', function(){
loaded = true;
});
})(window, document);
| lyonbros/composer.js | test/lib/mootools-core-1.4.5.js | JavaScript | mit | 149,108 |
using System;
namespace TestAPI.Areas.HelpPage
{
/// <summary>
/// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class.
/// </summary>
public class InvalidSample
{
public InvalidSample(string errorMessage)
{
if (errorMessage == null)
{
throw new ArgumentNullException("errorMessage");
}
ErrorMessage = errorMessage;
}
public string ErrorMessage { get; private set; }
public override bool Equals(object obj)
{
InvalidSample other = obj as InvalidSample;
return other != null && ErrorMessage == other.ErrorMessage;
}
public override int GetHashCode()
{
return ErrorMessage.GetHashCode();
}
public override string ToString()
{
return ErrorMessage;
}
}
} | OasesOng/TestVS | TestAPI/TestAPI/Areas/HelpPage/SampleGeneration/InvalidSample.cs | C# | mit | 969 |
//
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions
//are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
//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 HOLDERS 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.
//
#include "osinclude.h"
#define STRICT
#define VC_EXTRALEAN 1
#include <windows.h>
#include <assert.h>
#include <process.h>
#include <psapi.h>
#include <stdio.h>
//
// This file contains contains the Window-OS-specific functions
//
#if !(defined(_WIN32) || defined(_WIN64))
#error Trying to build a windows specific file in a non windows build.
#endif
namespace glslang {
//
// Thread Local Storage Operations
//
OS_TLSIndex OS_AllocTLSIndex()
{
DWORD dwIndex = TlsAlloc();
if (dwIndex == TLS_OUT_OF_INDEXES) {
assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
return OS_INVALID_TLS_INDEX;
}
return dwIndex;
}
bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
{
if (nIndex == OS_INVALID_TLS_INDEX) {
assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
return false;
}
if (TlsSetValue(nIndex, lpvValue))
return true;
else
return false;
}
void* OS_GetTLSValue(OS_TLSIndex nIndex)
{
assert(nIndex != OS_INVALID_TLS_INDEX);
return TlsGetValue(nIndex);
}
bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
{
if (nIndex == OS_INVALID_TLS_INDEX) {
assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
return false;
}
if (TlsFree(nIndex))
return true;
else
return false;
}
HANDLE GlobalLock;
void InitGlobalLock()
{
GlobalLock = CreateMutex(0, false, 0);
}
void GetGlobalLock()
{
WaitForSingleObject(GlobalLock, INFINITE);
}
void ReleaseGlobalLock()
{
ReleaseMutex(GlobalLock);
}
void* OS_CreateThread(TThreadEntrypoint entry)
{
return (void*)_beginthreadex(0, 0, entry, 0, 0, 0);
//return CreateThread(0, 0, entry, 0, 0, 0);
}
void OS_WaitForAllThreads(void* threads, int numThreads)
{
WaitForMultipleObjects(numThreads, (HANDLE*)threads, true, INFINITE);
}
void OS_Sleep(int milliseconds)
{
Sleep(milliseconds);
}
void OS_DumpMemoryCounters()
{
#ifdef DUMP_COUNTERS
PROCESS_MEMORY_COUNTERS counters;
GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters));
printf("Working set size: %d\n", counters.WorkingSetSize);
#else
printf("Recompile with DUMP_COUNTERS defined to see counters.\n");
#endif
}
} // namespace glslang
| TimNN/glslang-sys | extern/glslang/glslang/OSDependent/Windows/ossource.cpp | C++ | mit | 3,734 |
/* swdp-m0sub.c
*
* Copyright 2015 Brian Swetland <swetland@frotz.net>
*
* 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.
*/
#include <app.h>
#include <debug.h>
#include <string.h>
#include <stdlib.h>
#include <printf.h>
#include <platform.h>
#include <arch/arm.h>
#include <kernel/thread.h>
#include <platform/lpc43xx-gpio.h>
#include <platform/lpc43xx-sgpio.h>
#include <platform/lpc43xx-clocks.h>
#include "rswdp.h"
#define PIN_LED PIN(1,1)
#define PIN_RESET PIN(2,5)
#define PIN_RESET_TXEN PIN(2,6)
#define PIN_SWDIO_TXEN PIN(1,5) // SGPIO15=6
#define PIN_SWDIO PIN(1,6) // SGPIO14=6
#define PIN_SWO PIN(1,14) // U1_RXD=1
#define PIN_SWCLK PIN(1,17) // SGPIO11=6
#define GPIO_LED GPIO(0,8)
#define GPIO_RESET GPIO(5,5)
#define GPIO_RESET_TXEN GPIO(5,6)
#define GPIO_SWDIO_TXEN GPIO(1,8)
#define GPIO_SWDIO GPIO(1,9)
#define GPIO_SWCLK GPIO(0,12)
static void gpio_init(void) {
pin_config(PIN_LED, PIN_MODE(0) | PIN_PLAIN);
pin_config(PIN_RESET, PIN_MODE(4) | PIN_PLAIN);
pin_config(PIN_RESET_TXEN, PIN_MODE(4) | PIN_PLAIN);
pin_config(PIN_SWDIO_TXEN, PIN_MODE(6) | PIN_PLAIN | PIN_FAST);
pin_config(PIN_SWDIO, PIN_MODE(6) | PIN_PLAIN | PIN_INPUT | PIN_FAST);
pin_config(PIN_SWCLK, PIN_MODE(6) | PIN_PLAIN | PIN_FAST);
pin_config(PIN_SWO, PIN_MODE(1) | PIN_PLAIN | PIN_INPUT | PIN_FAST);
gpio_set(GPIO_LED, 0);
gpio_set(GPIO_RESET, 1);
gpio_set(GPIO_RESET_TXEN, 0);
gpio_config(GPIO_LED, GPIO_OUTPUT);
gpio_config(GPIO_RESET, GPIO_OUTPUT);
gpio_config(GPIO_RESET_TXEN, GPIO_OUTPUT);
}
/* returns 1 if the number of bits set in n is odd */
static unsigned parity(unsigned n) {
n = (n & 0x55555555) + ((n & 0xaaaaaaaa) >> 1);
n = (n & 0x33333333) + ((n & 0xcccccccc) >> 2);
n = (n & 0x0f0f0f0f) + ((n & 0xf0f0f0f0) >> 4);
n = (n & 0x00ff00ff) + ((n & 0xff00ff00) >> 8);
n = (n & 0x0000ffff) + ((n & 0xffff0000) >> 16);
return n & 1;
}
#include "fw-m0sub.h"
#define M0SUB_ZEROMAP 0x40043308
#define M0SUB_TXEV 0x40043314 // write 0 to clear
#define M4_TXEV 0x40043130 // write 0 to clear
#define RESET_CTRL0 0x40053100
#define M0_SUB_RST (1 << 12)
#define COMM_CMD 0x18004000
#define COMM_ARG1 0x18004004
#define COMM_ARG2 0x18004008
#define COMM_RESP 0x1800400C
#define CMD_ERR 0
#define CMD_NOP 1
#define CMD_READ 2
#define CMD_WRITE 3
#define CMD_RESET 4
#define CMD_SETCLOCK 5
#define RSP_BUSY 0xFFFFFFFF
void swd_init(void) {
gpio_init();
writel(BASE_CLK_SEL(CLK_PLL1), BASE_PERIPH_CLK);
spin(1000);
// SGPIO15 SWDIO_TXEN
writel(CFG_OUT_GPIO | CFG_OE_GPIO, SGPIO_OUT_CFG(15));
// SGPIO14 SWDIO
writel(CFG_OUT_GPIO | CFG_OE_GPIO, SGPIO_OUT_CFG(14));
// SGPIO11 SWCLK
writel(CFG_OUT_GPIO | CFG_OE_GPIO, SGPIO_OUT_CFG(11));
// all outputs enabled and high
writel((1 << 11) | (1 << 14) | (1 << 15), SGPIO_OUT);
writel((1 << 11) | (1 << 14) | (1 << 15), SGPIO_OEN);
writel(0, M4_TXEV);
writel(M0_SUB_RST, RESET_CTRL0);
writel(0x18000000, M0SUB_ZEROMAP);
writel(0xffffffff, 0x18004000);
memcpy((void*) 0x18000000, zero_bin, sizeof(zero_bin));
DSB;
writel(0, RESET_CTRL0);
}
int swd_write(unsigned hdr, unsigned data) {
unsigned n;
unsigned p = parity(data);
writel(CMD_WRITE, COMM_CMD);
writel((hdr << 8) | (p << 16), COMM_ARG1);
writel(data, COMM_ARG2);
writel(RSP_BUSY, COMM_RESP);
DSB;
asm("sev");
while ((n = readl(COMM_RESP)) == RSP_BUSY) ;
//printf("wr s=%d\n", n);
return n;
}
int swd_read(unsigned hdr, unsigned *val) {
unsigned n, data, p;
writel(CMD_READ, COMM_CMD);
writel(hdr << 8, COMM_ARG1);
writel(RSP_BUSY, COMM_RESP);
DSB;
asm("sev");
while ((n = readl(COMM_RESP)) == RSP_BUSY) ;
if (n) {
return n;
}
data = readl(COMM_ARG1);
p = readl(COMM_ARG2);
if (p != parity(data)) {
return ERR_PARITY;
}
//printf("rd s=%d p=%d d=%08x\n", n, p, data);
*val = data;
return 0;
}
void swd_reset(void) {
unsigned n;
writel(CMD_RESET, COMM_CMD);
writel(RSP_BUSY, COMM_RESP);
DSB;
asm("sev");
while ((n = readl(COMM_RESP)) == RSP_BUSY) ;
}
unsigned swd_set_clock(unsigned khz) {
unsigned n;
if (khz > 8000) {
khz = 8000;
}
writel(CMD_SETCLOCK, COMM_CMD);
writel(khz/1000, COMM_ARG1);
writel(RSP_BUSY, COMM_RESP);
DSB;
asm("sev");
while ((n = readl(COMM_RESP)) == RSP_BUSY) ;
// todo: accurate value
return khz;
}
void swd_hw_reset(int assert) {
if (assert) {
gpio_set(GPIO_RESET, 0);
gpio_set(GPIO_RESET_TXEN, 1);
} else {
gpio_set(GPIO_RESET, 1);
gpio_set(GPIO_RESET_TXEN, 0);
}
}
| nvll/lk | app/mdebug/swd-m0sub.c | C | mit | 4,971 |
/* General styles */
body {
background-color:#fff;
font-family:Arial,Verdan,Sans-Serif;
font-size:75%;
}
/* Text Shadow ( CSS3 ony ) */
#navigation li a, .portlet-header, .ui-datepicker-title, .page-title h1, .ui-widget-header, .hastable thead td, .hastable thead th, #page-wrapper .other-box h3 {
text-shadow:0 1px 0 #fff;
}
/* Rounded corners ( CSS3 ony ) */
.ui-corner-tl {
-moz-border-radius-topleft:3px;
-webkit-border-top-left-radius:3px;
}
.ui-corner-tr {
-moz-border-radius-topright:3px;
-webkit-border-top-right-radius:3px;
}
.ui-corner-bl {
-moz-border-radius-bottomleft:3px;
-webkit-border-bottom-left-radius:3px;
}
.ui-corner-br {
-moz-border-radius-bottomright:3px;
-webkit-border-bottom-right-radius:3px;
}
.ui-corner-top {
-moz-border-radius-topleft:3px;
-webkit-border-top-left-radius:3px;
-moz-border-radius-topright:3px;
-webkit-border-top-right-radius:3px;
}
.ui-corner-bottom {
-moz-border-radius-bottomleft:3px;
-webkit-border-bottom-left-radius:3px;
-moz-border-radius-bottomright:3px;
-webkit-border-bottom-right-radius:3px;
}
.ui-corner-right {
-moz-border-radius-topright:3px;
-webkit-border-top-right-radius:3px;
-moz-border-radius-bottomright:3px;
-webkit-border-bottom-right-radius:3px;
}
.ui-corner-left {
-moz-border-radius-topleft:3px;
-webkit-border-top-left-radius:3px;
-moz-border-radius-bottomleft:3px;
-webkit-border-bottom-left-radius:3px;
}
.ui-corner-all, .pagination li a, .pagination li, #tooltip, ul#dashboard-buttons li a, .fixed #sidebar {
-moz-border-radius:3px;
-webkit-border-radius:3px;
}
/* States and Images */
.ui-icon {
background-image:url(images/icons-blue.png);
}
.ui-widget-content .ui-icon {
background-image: url(images/icons-blue.png);
}
.ui-widget-header .ui-icon {
background-image: url(images/icons-lgray.png);
}
.ui-state-default .ui-icon {
background-image:url(images/icons-lgray.png);
}
.ui-state-hover .ui-icon {
background-image: url(images/icons-gray.png);
}
.ui-state-focus .ui-icon {
background-image: url(images/icons-blue.png);
}
.ui-state-active .ui-icon {
background-image:url(images/icons-blue.png);
}
.ui-state-highlight .ui-icon {
background-image:url(images/icons-blue.png);
}
/* Component containers */
.ui-widget-content {
border: 1px solid #ddd;
background: #fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
color:#444;
}
.ui-widget-header {
border:1px solid #ddd;
background:#ddd url(images/ui-bg_highlight-soft_50_dddddd_1x100.png) 50% 50% repeat-x;
color:#444;
text-transform:uppercase;
}
.ui-widget-header a {
color: #444;
}
/* Interaction states */
.ui-state-default, .ui-widget-content .ui-state-default, .pagination a {
border:1px solid #ddd;
background:#f6f6f6 url(images/ui-bg_highlight-soft_100_f6f6f6_1x100.png) 50% 50% repeat-x;
font-weight:bold;
color:#0073ea;
outline:none;
}
#page-wrapper #main-wrapper #main-content .page-title h1 b, .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited, #page-wrapper #main-wrapper .title h2, #page-wrapper #main-wrapper .title h3, a {
color:#0073ea;
text-decoration:none;outline:none;
}
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .pagination a:hover, a.btn:hover, button.ui-state-default:hover {
border: 1px solid #9d9d9d;
background:#0073ea url(images/ui-bg_highlight-soft_25_0073ea_1x100.png) 50% 50% repeat-x;
font-weight:bold;
color:#333;
outline:none;
}
.ui-state-hover a, .ui-state-hover a:hover {
color:#222;
text-decoration:none;outline:none;
}
.ui-state-active, .ui-widget-content .ui-state-active {
border:1px solid #ddd!important;
background: #fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
font-weight:bold;
color:#333;
outline:none;
}
a:hover, .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
color:#333;
outline:none;
text-decoration:none;
}
#main-content .page-title, .form-bg, #page-wrapper #sidebar .side-menu li a:hover { /* add to any div to change background color */
background:#F9F9F9;
}
.linetop {
border-top:#c7c7c7 solid 1px;
}
/* Header Style */
#header {
background:url('images/header-bg.png') repeat-x;
}
#header #top-menu {
color:#646464;
}
#header #top-menu a {
color:#e6e6e6;
}
#header #top-menu span {
color:#d7d7d7;
}
#header #sitename a.logo {
color:#fff;
background:url('../../../images/logo.png') no-repeat;
text-shadow:1px 1px 0 #000;
}
#header #top-menu a:hover, #header #sitename a.logo:hover {
color:#b7cbdf;
}
/* Header navigation menu */
#navigation li a {
color:#454545;
font-weight:bold;
border-right:#d0d0d0 solid 1px;
border-left:#f7f7f7 solid 1px;
}
#navigation li.sfHover, #navigation li.sfHover2 {
background:#fff;
border-left:#b2b2b2 solid 1px;
border-right:#b2b2b2 solid 1px;
}
#navigation li ul {
background:#fff;
border:#b2b2b2 solid 1px;
}
#navigation li ul li {
border-bottom:#ccc dotted 1px;
background:#f0f0f0;
}
#navigation li ul li a {
color:#7c7c7c;
}
#navigation li ul li a:hover {
color:#696969;
background:#f7f7f7;
}
#navigation li ul li.sfHover, #navigation li ul li.sfHover2 {
background:#e0e0e0;
}
#navigation li ul li.sfHover a {
color:#333;
}
#navigation li ul li ul li a:hover {
color:#000;
}
/* Pages title box */
#page-wrapper #main-wrapper #main-content .page-title .other {
color:#515151;
border-top:#dadada dotted 1px;
}
/* Dashboard buttons */
#page-wrapper #main-wrapper #main-content .page-title .other ul#dashboard-buttons li {
border:#fff solid 4px;
}
#page-wrapper #main-wrapper #main-content .page-title .other ul#dashboard-buttons li a {
background-color:#f3f3f3;
border:#dcdfe3 solid 1px;
border-color:#dcdfe3 #d0d4d8 #d0d4d8 #dcdfe3;
color:#666;
}
#page-wrapper #main-wrapper #main-content .page-title .other ul#dashboard-buttons li a:hover {
background-color:#e4e7ea;
border-color:#c3c9ce;
color:#333;
}
#page-wrapper #main-wrapper #main-content .page-title .other ul#dashboard-buttons li a:active {
border-color:#9d9d9d;
}
/* Different title styles */
#page-wrapper #main-wrapper .title, #page-wrapper #sidebar .side-menu li {
color:#616161;
border-bottom:#8f8f8f dotted 1px;
}
.ui-sortable-placeholder {
background:#ffffcc;
}
#page-wrapper #sidebar {
background:#f4f4f4;
border-color:#d0d0d0;
}
/* Note */
i.note {
font-weight:bold;
padding:15px 0 15px 25px;
color:#8f8f8f;
display:block;
}
.red {
color:red;
}
/* Footer */
#footer {
border-top:#e3e3e3 solid 6px;
background:#4c4c4c;
color:#c1c1c1;
}
#footer #menu a {
color:#fff;
}
#footer #menu a:hover {
text-decoration:underline;
} | hoaitn/bmw-site | public/css/admin/ui.css | CSS | mit | 6,663 |
/*
* Changes:
* Jan 22, 2010: Created (Cristiano Giuffrida)
*/
#include "inc.h"
/*===========================================================================*
* do_up *
*===========================================================================*/
PUBLIC int do_up(m_ptr)
message *m_ptr; /* request message pointer */
{
/* A request was made to start a new system service. */
struct rproc *rp;
struct rprocpub *rpub;
int r;
struct rs_start rs_start;
int noblock;
/* Check if the call can be allowed. */
if((r = check_call_permission(m_ptr->m_source, RS_UP, NULL)) != OK)
return r;
/* Allocate a new system service slot. */
r = alloc_slot(&rp);
if(r != OK) {
printf("RS: do_up: unable to allocate a new slot: %d\n", r);
return r;
}
rpub = rp->r_pub;
/* Copy the request structure. */
r = copy_rs_start(m_ptr->m_source, m_ptr->RS_CMD_ADDR, &rs_start);
if (r != OK) {
return r;
}
noblock = (rs_start.rss_flags & RSS_NOBLOCK);
/* Initialize the slot as requested. */
r = init_slot(rp, &rs_start, m_ptr->m_source);
if(r != OK) {
printf("RS: do_up: unable to init the new slot: %d\n", r);
return r;
}
/* Check for duplicates */
if(lookup_slot_by_label(rpub->label)) {
printf("RS: service with the same label '%s' already exists\n",
rpub->label);
return EBUSY;
}
if(rpub->dev_nr>0 && lookup_slot_by_dev_nr(rpub->dev_nr)) {
printf("RS: service with the same device number %d already exists\n",
rpub->dev_nr);
return EBUSY;
}
/* All information was gathered. Now try to start the system service. */
r = start_service(rp);
if(r != OK) {
return r;
}
/* Unblock the caller immediately if requested. */
if(noblock) {
return OK;
}
/* Late reply - send a reply when service completes initialization. */
rp->r_flags |= RS_LATEREPLY;
rp->r_caller = m_ptr->m_source;
rp->r_caller_request = RS_UP;
return EDONTREPLY;
}
/*===========================================================================*
* do_down *
*===========================================================================*/
PUBLIC int do_down(message *m_ptr)
{
register struct rproc *rp;
register struct rprocpub *rpub;
int s;
char label[RS_MAX_LABEL_LEN];
/* Copy label. */
s = copy_label(m_ptr->m_source, m_ptr->RS_CMD_ADDR,
m_ptr->RS_CMD_LEN, label, sizeof(label));
if(s != OK) {
return s;
}
/* Lookup slot by label. */
rp = lookup_slot_by_label(label);
if(!rp) {
if(rs_verbose)
printf("RS: do_down: service '%s' not found\n", label);
return(ESRCH);
}
rpub = rp->r_pub;
/* Check if the call can be allowed. */
if((s = check_call_permission(m_ptr->m_source, RS_DOWN, rp)) != OK)
return s;
/* Stop service. */
if (rp->r_flags & RS_TERMINATED) {
/* A recovery script is requesting us to bring down the service.
* The service is already gone, simply perform cleanup.
*/
if(rs_verbose)
printf("RS: recovery script performs service down...\n");
unpublish_service(rp);
cleanup_service(rp);
return(OK);
}
stop_service(rp,RS_EXITING);
/* Late reply - send a reply when service dies. */
rp->r_flags |= RS_LATEREPLY;
rp->r_caller = m_ptr->m_source;
rp->r_caller_request = RS_DOWN;
return EDONTREPLY;
}
/*===========================================================================*
* do_restart *
*===========================================================================*/
PUBLIC int do_restart(message *m_ptr)
{
struct rproc *rp;
int s, r;
char label[RS_MAX_LABEL_LEN];
char script[MAX_SCRIPT_LEN];
/* Copy label. */
s = copy_label(m_ptr->m_source, m_ptr->RS_CMD_ADDR,
m_ptr->RS_CMD_LEN, label, sizeof(label));
if(s != OK) {
return s;
}
/* Lookup slot by label. */
rp = lookup_slot_by_label(label);
if(!rp) {
if(rs_verbose)
printf("RS: do_restart: service '%s' not found\n", label);
return(ESRCH);
}
/* Check if the call can be allowed. */
if((r = check_call_permission(m_ptr->m_source, RS_RESTART, rp)) != OK)
return r;
/* We can only be asked to restart a service from a recovery script. */
if (! (rp->r_flags & RS_TERMINATED) ) {
if(rs_verbose)
printf("RS: %s is still running\n", srv_to_string(rp));
return EBUSY;
}
if(rs_verbose)
printf("RS: recovery script performs service restart...\n");
/* Restart the service, but make sure we don't call the script again. */
strcpy(script, rp->r_script);
rp->r_script[0] = '\0';
restart_service(rp);
strcpy(rp->r_script, script);
return OK;
}
/*===========================================================================*
* do_refresh *
*===========================================================================*/
PUBLIC int do_refresh(message *m_ptr)
{
register struct rproc *rp;
register struct rprocpub *rpub;
int s;
char label[RS_MAX_LABEL_LEN];
/* Copy label. */
s = copy_label(m_ptr->m_source, m_ptr->RS_CMD_ADDR,
m_ptr->RS_CMD_LEN, label, sizeof(label));
if(s != OK) {
return s;
}
/* Lookup slot by label. */
rp = lookup_slot_by_label(label);
if(!rp) {
if(rs_verbose)
printf("RS: do_refresh: service '%s' not found\n", label);
return(ESRCH);
}
rpub = rp->r_pub;
/* Check if the call can be allowed. */
if((s = check_call_permission(m_ptr->m_source, RS_REFRESH, rp)) != OK)
return s;
/* Refresh service. */
if(rs_verbose)
printf("RS: %s refreshing\n", srv_to_string(rp));
stop_service(rp,RS_REFRESHING);
return OK;
}
/*===========================================================================*
* do_shutdown *
*===========================================================================*/
PUBLIC int do_shutdown(message *m_ptr)
{
int slot_nr;
struct rproc *rp;
int r;
/* Check if the call can be allowed. */
if (m_ptr != NULL) {
if((r = check_call_permission(m_ptr->m_source, RS_SHUTDOWN, NULL)) != OK)
return r;
}
if(rs_verbose)
printf("RS: shutting down...\n");
/* Set flag to tell RS we are shutting down. */
shutting_down = TRUE;
/* Don't restart dead services. */
for (slot_nr = 0; slot_nr < NR_SYS_PROCS; slot_nr++) {
rp = &rproc[slot_nr];
if (rp->r_flags & RS_IN_USE) {
rp->r_flags |= RS_EXITING;
}
}
return(OK);
}
/*===========================================================================*
* do_init_ready *
*===========================================================================*/
PUBLIC int do_init_ready(message *m_ptr)
{
int who_p;
struct rproc *rp;
struct rprocpub *rpub;
int result;
int r;
who_p = _ENDPOINT_P(m_ptr->m_source);
rp = rproc_ptr[who_p];
rpub = rp->r_pub;
result = m_ptr->RS_INIT_RESULT;
/* Make sure the originating service was requested to initialize. */
if(! (rp->r_flags & RS_INITIALIZING) ) {
if(rs_verbose)
printf("RS: do_init_ready: got unexpected init ready msg from %d\n",
m_ptr->m_source);
return(EDONTREPLY);
}
/* Check if something went wrong and the service failed to init.
* In that case, kill the service.
*/
if(result != OK) {
if(rs_verbose)
printf("RS: %s initialization error: %s\n", srv_to_string(rp),
init_strerror(result));
crash_service(rp); /* simulate crash */
return(EDONTREPLY);
}
/* Mark the slot as no longer initializing. */
rp->r_flags &= ~RS_INITIALIZING;
rp->r_check_tm = 0;
getuptime(&rp->r_alive_tm);
/* See if a late reply has to be sent. */
late_reply(rp, OK);
if(rs_verbose)
printf("RS: %s initialized\n", srv_to_string(rp));
/* If the service has completed initialization after a live
* update, end the update now.
*/
if(rp->r_flags & RS_UPDATING) {
printf("RS: update succeeded\n");
end_update(OK);
}
/* If the service has completed initialization after a crash
* make the new instance active and cleanup the old replica.
*/
if(rp->r_prev_rp) {
cleanup_service(rp->r_prev_rp);
rp->r_prev_rp = NULL;
if(rs_verbose)
printf("RS: %s completed restart\n", srv_to_string(rp));
}
/* If we must keep a replica of this system service, create it now. */
if(rpub->sys_flags & SF_USE_REPL) {
if ((r = clone_service(rp)) != OK) {
printf("RS: warning: unable to clone %s\n", srv_to_string(rp));
}
}
return(OK);
}
/*===========================================================================*
* do_update *
*===========================================================================*/
PUBLIC int do_update(message *m_ptr)
{
struct rproc *rp;
struct rproc *new_rp;
struct rprocpub *rpub;
struct rs_start rs_start;
int noblock;
int s;
char label[RS_MAX_LABEL_LEN];
int lu_state;
int prepare_maxtime;
/* Copy the request structure. */
s = copy_rs_start(m_ptr->m_source, m_ptr->RS_CMD_ADDR, &rs_start);
if (s != OK) {
return s;
}
noblock = (rs_start.rss_flags & RSS_NOBLOCK);
/* Copy label. */
s = copy_label(m_ptr->m_source, rs_start.rss_label.l_addr,
rs_start.rss_label.l_len, label, sizeof(label));
if(s != OK) {
return s;
}
/* Lookup slot by label. */
rp = lookup_slot_by_label(label);
if(!rp) {
if(rs_verbose)
printf("RS: do_update: service '%s' not found\n", label);
return ESRCH;
}
rpub = rp->r_pub;
/* Check if the call can be allowed. */
if((s = check_call_permission(m_ptr->m_source, RS_UPDATE, rp)) != OK)
return s;
/* Retrieve live update state. */
lu_state = m_ptr->RS_LU_STATE;
if(lu_state == SEF_LU_STATE_NULL) {
return(EINVAL);
}
/* Retrieve prepare max time. */
prepare_maxtime = m_ptr->RS_LU_PREPARE_MAXTIME;
if(prepare_maxtime) {
if(prepare_maxtime < 0 || prepare_maxtime > RS_MAX_PREPARE_MAXTIME) {
return(EINVAL);
}
}
else {
prepare_maxtime = RS_DEFAULT_PREPARE_MAXTIME;
}
/* Make sure we are not already updating. */
if(rupdate.flags & RS_UPDATING) {
if(rs_verbose)
printf("RS: do_update: an update is already in progress\n");
return EBUSY;
}
/* Allocate a system service slot for the new version. */
s = alloc_slot(&new_rp);
if(s != OK) {
printf("RS: do_update: unable to allocate a new slot: %d\n", s);
return s;
}
/* Initialize the slot as requested. */
s = init_slot(new_rp, &rs_start, m_ptr->m_source);
if(s != OK) {
printf("RS: do_update: unable to init the new slot: %d\n", s);
return s;
}
/* Let the new version inherit defaults from the old one. */
inherit_service_defaults(rp, new_rp);
/* Create new version of the service but don't let it run. */
s = create_service(new_rp);
if(s != OK) {
printf("RS: do_update: unable to create a new service: %d\n", s);
return s;
}
/* Link old version to new version and mark both as updating. */
rp->r_new_rp = new_rp;
new_rp->r_old_rp = rp;
rp->r_flags |= RS_UPDATING;
rp->r_new_rp->r_flags |= RS_UPDATING;
rupdate.flags |= RS_UPDATING;
getuptime(&rupdate.prepare_tm);
rupdate.prepare_maxtime = prepare_maxtime;
rupdate.rp = rp;
if(rs_verbose)
printf("RS: %s updating\n", srv_to_string(rp));
/* Request to update. */
m_ptr->m_type = RS_LU_PREPARE;
asynsend3(rpub->endpoint, m_ptr, AMF_NOREPLY);
/* Unblock the caller immediately if requested. */
if(noblock) {
return OK;
}
/* Late reply - send a reply when the new version completes initialization. */
rp->r_flags |= RS_LATEREPLY;
rp->r_caller = m_ptr->m_source;
rp->r_caller_request = RS_UPDATE;
return EDONTREPLY;
}
/*===========================================================================*
* do_upd_ready *
*===========================================================================*/
PUBLIC int do_upd_ready(message *m_ptr)
{
struct rproc *rp, *old_rp, *new_rp;
int who_p;
int result;
int r;
who_p = _ENDPOINT_P(m_ptr->m_source);
rp = rproc_ptr[who_p];
result = m_ptr->RS_LU_RESULT;
/* Make sure the originating service was requested to prepare for update. */
if(rp != rupdate.rp) {
if(rs_verbose)
printf("RS: do_upd_ready: got unexpected update ready msg from %d\n",
m_ptr->m_source);
return(EINVAL);
}
/* Check if something went wrong and the service failed to prepare
* for the update. In that case, end the update process. The old version will
* be replied to and continue executing.
*/
if(result != OK) {
end_update(result);
printf("RS: update failed: %s\n", lu_strerror(result));
return OK;
}
/* Perform the update. */
old_rp = rp;
new_rp = rp->r_new_rp;
r = update_service(&old_rp, &new_rp);
if(r != OK) {
end_update(r);
printf("RS: update failed: error %d\n", r);
return r;
}
/* Let the new version run. */
r = run_service(new_rp, SEF_INIT_LU);
if(r != OK) {
update_service(&new_rp, &old_rp); /* rollback, can't fail. */
end_update(r);
printf("RS: update failed: error %d\n", r);
return r;
}
return(EDONTREPLY);
}
/*===========================================================================*
* do_period *
*===========================================================================*/
PUBLIC void do_period(m_ptr)
message *m_ptr;
{
register struct rproc *rp;
register struct rprocpub *rpub;
clock_t now = m_ptr->NOTIFY_TIMESTAMP;
int s;
long period;
/* If an update is in progress, check its status. */
if(rupdate.flags & RS_UPDATING) {
update_period(m_ptr);
}
/* Search system services table. Only check slots that are in use and not
* updating.
*/
for (rp=BEG_RPROC_ADDR; rp<END_RPROC_ADDR; rp++) {
rpub = rp->r_pub;
if ((rp->r_flags & RS_IN_USE) && !(rp->r_flags & RS_UPDATING)) {
/* Compute period. */
period = rpub->period;
if(rp->r_flags & RS_INITIALIZING) {
period = RS_INIT_T;
}
/* If the service is to be revived (because it repeatedly exited,
* and was not directly restarted), the binary backoff field is
* greater than zero.
*/
if (rp->r_backoff > 0) {
rp->r_backoff -= 1;
if (rp->r_backoff == 0) {
restart_service(rp);
}
}
/* If the service was signaled with a SIGTERM and fails to respond,
* kill the system service with a SIGKILL signal.
*/
else if (rp->r_stop_tm > 0 && now - rp->r_stop_tm > 2*RS_DELTA_T
&& rp->r_pid > 0) {
crash_service(rp); /* simulate crash */
rp->r_stop_tm = 0;
}
/* There seems to be no special conditions. If the service has a
* period assigned check its status.
*/
else if (period > 0) {
/* Check if an answer to a status request is still pending. If
* the service didn't respond within time, kill it to simulate
* a crash. The failure will be detected and the service will
* be restarted automatically.
*/
if (rp->r_alive_tm < rp->r_check_tm) {
if (now - rp->r_alive_tm > 2*period &&
rp->r_pid > 0 && !(rp->r_flags & RS_NOPINGREPLY)) {
if(rs_verbose)
printf("RS: %s reported late\n",
srv_to_string(rp));
rp->r_flags |= RS_NOPINGREPLY;
crash_service(rp); /* simulate crash */
}
}
/* No answer pending. Check if a period expired since the last
* check and, if so request the system service's status.
*/
else if (now - rp->r_check_tm > rpub->period) {
notify(rpub->endpoint); /* request status */
rp->r_check_tm = now; /* mark time */
}
}
}
}
/* Reschedule a synchronous alarm for the next period. */
if (OK != (s=sys_setalarm(RS_DELTA_T, 0)))
panic("couldn't set alarm: %d", s);
}
/*===========================================================================*
* do_sigchld *
*===========================================================================*/
PUBLIC void do_sigchld()
{
/* PM informed us that there are dead children to cleanup. Go get them. */
pid_t pid;
int status;
struct rproc *rp;
struct rproc **rps;
struct rprocpub *rpub;
int i, nr_rps;
if(rs_verbose)
printf("RS: got SIGCHLD signal, cleaning up dead children\n");
while ( (pid = waitpid(-1, &status, WNOHANG)) != 0 ) {
rp = lookup_slot_by_pid(pid);
if(rp != NULL) {
rpub = rp->r_pub;
if(rs_verbose)
printf("RS: %s exited via another signal manager\n",
srv_to_string(rp));
/* The slot is still there. This means RS is not the signal
* manager assigned to the process. Ignore the event but
* free slots for all the service instances and send a late
* reply if necessary.
*/
get_service_instances(rp, &rps, &nr_rps);
for(i=0;i<nr_rps;i++) {
if(rupdate.flags & RS_UPDATING) {
rupdate.flags &= ~RS_UPDATING;
}
free_slot(rps[i]);
}
}
}
}
/*===========================================================================*
* do_getsysinfo *
*===========================================================================*/
PUBLIC int do_getsysinfo(m_ptr)
message *m_ptr;
{
vir_bytes src_addr, dst_addr;
int dst_proc;
size_t len;
int s;
/* Check if the call can be allowed. */
if((s = check_call_permission(m_ptr->m_source, 0, NULL)) != OK)
return s;
switch(m_ptr->m1_i1) {
case SI_PROC_TAB:
src_addr = (vir_bytes) rproc;
len = sizeof(struct rproc) * NR_SYS_PROCS;
break;
case SI_PROCPUB_TAB:
src_addr = (vir_bytes) rprocpub;
len = sizeof(struct rprocpub) * NR_SYS_PROCS;
break;
default:
return(EINVAL);
}
dst_proc = m_ptr->m_source;
dst_addr = (vir_bytes) m_ptr->m1_p1;
if (OK != (s=sys_datacopy(SELF, src_addr, dst_proc, dst_addr, len)))
return(s);
return(OK);
}
/*===========================================================================*
* do_lookup *
*===========================================================================*/
PUBLIC int do_lookup(m_ptr)
message *m_ptr;
{
static char namebuf[100];
int len, r;
struct rproc *rrp;
struct rprocpub *rrpub;
len = m_ptr->RS_NAME_LEN;
if(len < 2 || len >= sizeof(namebuf)) {
printf("RS: len too weird (%d)\n", len);
return EINVAL;
}
if((r=sys_vircopy(m_ptr->m_source, D, (vir_bytes) m_ptr->RS_NAME,
SELF, D, (vir_bytes) namebuf, len)) != OK) {
printf("RS: name copy failed\n");
return r;
}
namebuf[len] = '\0';
rrp = lookup_slot_by_label(namebuf);
if(!rrp) {
return ESRCH;
}
rrpub = rrp->r_pub;
m_ptr->RS_ENDPOINT = rrpub->endpoint;
return OK;
}
| ducis/operating-system-labs | src.clean/servers/rs/request.c | C | mit | 19,836 |
Template.HostList.events({
});
Template.HostList.helpers({
// Get list of Hosts sorted by the sort field.
hosts: function () {
return Hosts.find({}, {sort: {sort: 1}});
}
});
Template.HostList.rendered = function () {
// Make rows sortable/draggable using Jquery-UI.
this.$('#sortable').sortable({
stop: function (event, ui) {
// Define target row items.
target = ui.item.get(0);
before = ui.item.prev().get(0);
after = ui.item.next().get(0);
// Change the sort value dependnig on target location.
// If target is now first, subtract 1 from sort value.
if (!before) {
newSort = Blaze.getData(after).sort - 1;
// If target is now last, add 1 to sort value.
} else if (!after) {
newSort = Blaze.getData(before).sort + 1;
// Get value of prev and next elements
// to determine new target sort value.
} else {
newSort = (Blaze.getData(after).sort +
Blaze.getData(before).sort) / 2;
}
// Update the database with new sort value.
Hosts.update({_id: Blaze.getData(target)._id}, {
$set: {
sort: newSort
}
});
}
});
};
| bfodeke/syrinx | client/views/hosts/hostList/hostList.js | JavaScript | mit | 1,204 |
import Helper, { states } from './_helper';
import { module, test } from 'qunit';
module('Integration | ORM | Has Many | Named Reflexive | association #set', function(hooks) {
hooks.beforeEach(function() {
this.helper = new Helper();
});
/*
The model can update its association via parent, for all states
*/
states.forEach((state) => {
test(`a ${state} can update its association to a list of saved children`, function(assert) {
let [ tag, originalTags ] = this.helper[state]();
let savedTag = this.helper.savedChild();
tag.labels = [ savedTag ];
assert.ok(tag.labels.includes(savedTag));
assert.equal(tag.labelIds[0], savedTag.id);
assert.ok(savedTag.labels.includes(tag), 'the inverse was set');
tag.save();
originalTags.forEach(originalTag => {
originalTag.reload();
assert.notOk(originalTag.labels.includes(tag), 'old inverses were cleared');
});
});
test(`a ${state} can update its association to a new parent`, function(assert) {
let [ tag, originalTags ] = this.helper[state]();
let newTag = this.helper.newChild();
tag.labels = [ newTag ];
assert.ok(tag.labels.includes(newTag));
assert.equal(tag.labelIds[0], undefined);
assert.ok(newTag.labels.includes(tag), 'the inverse was set');
tag.save();
originalTags.forEach(originalTag => {
originalTag.reload();
assert.notOk(originalTag.labels.includes(tag), 'old inverses were cleared');
});
});
test(`a ${state} can clear its association via an empty list`, function(assert) {
let [ tag, originalTags ] = this.helper[state]();
tag.labels = [ ];
assert.deepEqual(tag.labelIds, [ ]);
assert.equal(tag.labels.models.length, 0);
tag.save();
originalTags.forEach(originalTag => {
originalTag.reload();
assert.notOk(originalTag.labels.includes(tag), 'old inverses were cleared');
});
});
test(`a ${state} can clear its association via an empty list`, function(assert) {
let [ tag, originalTags ] = this.helper[state]();
tag.labels = null;
assert.deepEqual(tag.labelIds, [ ]);
assert.equal(tag.labels.models.length, 0);
tag.save();
originalTags.forEach(originalTag => {
originalTag.reload();
assert.notOk(originalTag.labels.includes(tag), 'old inverses were cleared');
});
});
});
});
| jherdman/ember-cli-mirage | tests/integration/orm/has-many/4-named-reflexive/association-set-test.js | JavaScript | mit | 2,462 |
{{ partial "head.html" . }}
{{ partial "body-before.html" . }}
<!-- Layout for Content Area of Markdown Page Goes Here -->
<div id="default__title">{{ .Title }}</div>
<div id="default__subtitle">{{ .Params.subtitle }}</div>
<div>{{ .Date.Format "Jan 02, 2006" }}</div>
<div id="default_text"> {{ .Content }} </div>
<!-- ************************************************** -->
{{ partial "body-after.html" . }}
| dkebler/hugo-sass-bower-gulp-starter | html/hugo/layouts/_default/single.html | HTML | mit | 425 |
import * as React from 'react';
export interface LabelDetailProps {
[key: string]: any;
/** An element type to render as (string or function). */
as?: any;
/** Primary content. */
children?: React.ReactNode;
/** Additional classes. */
className?: string;
/** Shorthand for primary content. */
content?: React.ReactNode;
}
declare const LabelDetail: React.StatelessComponent<LabelDetailProps>;
export default LabelDetail;
| aabustamante/Semantic-UI-React | src/elements/Label/LabelDetail.d.ts | TypeScript | mit | 446 |
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Orleans;
using Orleans.Runtime;
using Orleans.Runtime.Scheduler;
using UnitTests.GrainInterfaces;
using UnitTests.Grains;
namespace UnitTestGrains
{
public class TimerGrain : Grain, ITimerGrain
{
private bool deactivating;
int counter = 0;
Dictionary<string, IDisposable> allTimers;
IDisposable defaultTimer;
private static readonly TimeSpan period = TimeSpan.FromMilliseconds(100);
string DefaultTimerName = "DEFAULT TIMER";
ISchedulingContext context;
private Logger logger;
public override Task OnActivateAsync()
{
ThrowIfDeactivating();
logger = this.GetLogger("TimerGrain_" + base.Data.Address.ToString());
context = RuntimeContext.Current.ActivationContext;
defaultTimer = this.RegisterTimer(Tick, DefaultTimerName, period, period);
allTimers = new Dictionary<string, IDisposable>();
return Task.CompletedTask;
}
public Task StopDefaultTimer()
{
ThrowIfDeactivating();
defaultTimer.Dispose();
return Task.CompletedTask;
}
private Task Tick(object data)
{
counter++;
logger.Info(data.ToString() + " Tick # " + counter + " RuntimeContext = " + RuntimeContext.Current.ActivationContext.ToString());
// make sure we run in the right activation context.
if(!Equals(context, RuntimeContext.Current.ActivationContext))
logger.Error((int)ErrorCode.Runtime_Error_100146, "grain not running in the right activation context");
string name = (string)data;
IDisposable timer = null;
if (name == DefaultTimerName)
{
timer = defaultTimer;
}
else
{
timer = allTimers[(string)data];
}
if(timer == null)
logger.Error((int)ErrorCode.Runtime_Error_100146, "Timer is null");
if (timer != null && counter > 10000)
{
// do not let orphan timers ticking for long periods
timer.Dispose();
}
return Task.CompletedTask;
}
public Task<TimeSpan> GetTimerPeriod()
{
return Task.FromResult(period);
}
public Task<int> GetCounter()
{
ThrowIfDeactivating();
return Task.FromResult(counter);
}
public Task SetCounter(int value)
{
ThrowIfDeactivating();
lock (this)
{
counter = value;
}
return Task.CompletedTask;
}
public Task StartTimer(string timerName)
{
ThrowIfDeactivating();
IDisposable timer = this.RegisterTimer(Tick, timerName, TimeSpan.Zero, period);
allTimers.Add(timerName, timer);
return Task.CompletedTask;
}
public Task StopTimer(string timerName)
{
ThrowIfDeactivating();
IDisposable timer = allTimers[timerName];
timer.Dispose();
return Task.CompletedTask;
}
public Task LongWait(TimeSpan time)
{
ThrowIfDeactivating();
Thread.Sleep(time);
return Task.CompletedTask;
}
public Task Deactivate()
{
deactivating = true;
DeactivateOnIdle();
return Task.CompletedTask;
}
private void ThrowIfDeactivating()
{
if (deactivating) throw new InvalidOperationException("This activation is deactivating");
}
}
public class TimerCallGrain : Grain, ITimerCallGrain
{
private int tickCount;
private Exception tickException;
private IDisposable timer;
private string timerName;
private ISchedulingContext context;
private TaskScheduler activationTaskScheduler;
private Logger logger;
public Task<int> GetTickCount() { return Task.FromResult(tickCount); }
public Task<Exception> GetException() { return Task.FromResult(tickException); }
public override Task OnActivateAsync()
{
logger = this.GetLogger("TimerCallGrain_" + base.Data.Address);
context = RuntimeContext.Current.ActivationContext;
activationTaskScheduler = TaskScheduler.Current;
return Task.CompletedTask;
}
public Task StartTimer(string name, TimeSpan delay)
{
logger.Info("StartTimer Name={0} Delay={1}", name, delay);
this.timerName = name;
this.timer = base.RegisterTimer(TimerTick, name, delay, Constants.INFINITE_TIMESPAN); // One shot timer
return Task.CompletedTask;
}
public Task StopTimer(string name)
{
logger.Info("StopTimer Name={0}", name);
if (name != this.timerName)
{
throw new ArgumentException(string.Format("Wrong timer name: Expected={0} Actual={1}", this.timerName, name));
}
timer.Dispose();
return Task.CompletedTask;
}
private async Task TimerTick(object data)
{
try
{
await ProcessTimerTick(data);
}
catch (Exception exc)
{
this.tickException = exc;
throw;
}
}
private async Task ProcessTimerTick(object data)
{
string step = "TimerTick";
LogStatus(step);
// make sure we run in the right activation context.
CheckRuntimeContext(step);
string name = (string)data;
if (name != this.timerName)
{
throw new ArgumentException(string.Format("Wrong timer name: Expected={0} Actual={1}", this.timerName, name));
}
ISimpleGrain grain = GrainFactory.GetGrain<ISimpleGrain>(0, SimpleGrain.SimpleGrainNamePrefix);
LogStatus("Before grain call #1");
await grain.SetA(tickCount);
step = "After grain call #1";
LogStatus(step);
CheckRuntimeContext(step);
LogStatus("Before Delay");
await Task.Delay(TimeSpan.FromSeconds(1));
step = "After Delay";
LogStatus(step);
CheckRuntimeContext(step);
LogStatus("Before grain call #2");
await grain.SetB(tickCount);
step = "After grain call #2";
LogStatus(step);
CheckRuntimeContext(step);
LogStatus("Before grain call #3");
int res = await grain.GetAxB();
step = "After grain call #3 - Result = " + res;
LogStatus(step);
CheckRuntimeContext(step);
tickCount++;
}
private void CheckRuntimeContext(string what)
{
if (RuntimeContext.Current.ActivationContext == null
|| !RuntimeContext.Current.ActivationContext.Equals(context))
{
throw new InvalidOperationException(
string.Format("{0} in timer callback with unexpected activation context: Expected={1} Actual={2}",
what, context, RuntimeContext.Current.ActivationContext));
}
if (TaskScheduler.Current.Equals(activationTaskScheduler) && TaskScheduler.Current is ActivationTaskScheduler)
{
// Everything is as expected
}
else
{
throw new InvalidOperationException(
string.Format("{0} in timer callback with unexpected TaskScheduler.Current context: Expected={1} Actual={2}",
what, activationTaskScheduler, TaskScheduler.Current));
}
}
private void LogStatus(string what)
{
logger.Info("{0} Tick # {1} - {2} - RuntimeContext.Current={3} TaskScheduler.Current={4} CurrentWorkerThread={5}",
timerName, tickCount, what, RuntimeContext.Current, TaskScheduler.Current,
WorkerPoolThread.CurrentWorkerThread);
}
}
}
| jokin/orleans | test/TestInternalGrains/TimerGrain.cs | C# | mit | 8,499 |
---
layout: theme
title: "Streamflow Prediction Research"
date: 2016-08-03 16:55:00
categories:
- themes
img: theme_streamflow_prediction.jpg
ref: stream
tags: [themes]
---
One of the four overarching research themes addressed in this collection of work. Our ability to understand how much and when... < more about this research theme, coming soon >
| anewman89/hydrology | demos/demo3/_posts/themes/2016-10-08-streamflow_prediction.md | Markdown | mit | 354 |
#!/usr/bin/env python
import sys
def fix_terminator(tokens):
if not tokens:
return
last = tokens[-1]
if last not in ('.', '?', '!') and last.endswith('.'):
tokens[-1] = last[:-1]
tokens.append('.')
def balance_quotes(tokens):
count = tokens.count("'")
if not count:
return
processed = 0
for i, token in enumerate(tokens):
if token == "'":
if processed % 2 == 0 and (i == 0 or processed != count - 1):
tokens[i] = "`"
processed += 1
def output(tokens):
if not tokens:
return
# fix_terminator(tokens)
balance_quotes(tokens)
print ' '.join(tokens)
prev = None
for line in sys.stdin:
tokens = line.split()
if len(tokens) == 1 and tokens[0] in ('"', "'", ')', ']'):
prev.append(tokens[0])
else:
output(prev)
prev = tokens
output(prev)
| TeamSPoon/logicmoo_workspace | packs_sys/logicmoo_nlu/ext/candc/src/lib/tokeniser/fixes.py | Python | mit | 820 |
<?php
namespace YOOtheme\Widgetkit\Framework\View\Asset;
interface AssetInterface
{
/**
* Gets the name.
*
* @return string
*/
public function getName();
/**
* Gets the source.
*
* @return string
*/
public function getSource();
/**
* Gets the dependencies.
*
* @return array
*/
public function getDependencies();
/**
* Gets the content.
*
* @return string
*/
public function getContent();
/**
* Sets the content.
*
* @param string $content
*/
public function setContent($content);
/**
* Gets all options.
*
* @return array
*/
public function getOptions();
/**
* Gets a option.
*
* @param string $name
* @return mixed
*/
public function getOption($name);
/**
* Sets a option.
*
* @param string $name
* @param mixed $value
*/
public function setOption($name, $value);
/**
* Gets the unique hash.
*
* @param string $salt
* @return string
*/
public function hash($salt = '');
/**
* Applies filters and returns the asset as a string.
*
* @param array $filters
* @return string
*/
public function dump(array $filters = array());
}
| yaelduckwen/libriastore | joomla/administrator/components/com_widgetkit/src/Framework/src/View/Asset/AssetInterface.php | PHP | mit | 1,339 |
class Item < ActiveRecord::Base
serialize :raw_info , Hash
has_many :ownerships , foreign_key: "item_id" , dependent: :destroy
has_many :users , through: :ownerships
has_many :wants, class_name: "Want", foreign_key: "item_id", dependent: :destroy
has_many :want_users, through: :wants, source: :user
has_many :haves, class_name: "Have", foreign_key: "item_id", dependent: :destroy
has_many :have_users, through: :haves, source: :user
end
| nekocreate/monolist | app/models/item.rb | Ruby | mit | 460 |
unsigned, 32-bit integer | vineetreddyrajula/pharo | src/Fuel.package/FLPositive32SmallIntegerCluster.class/README.md | Markdown | mit | 24 |
package br.pucrio.opus.smells.tests.visitor;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import br.pucrio.opus.smells.ast.visitors.FieldDeclarationCollector;
import br.pucrio.opus.smells.tests.util.CompilationUnitLoader;
public class FieldDeclarationCollectorTest {
private CompilationUnit compilationUnit;
@Before
public void setUp() throws IOException{
File file = new File("test/br/pucrio/opus/smells/tests/dummy/FieldDeclaration.java");
this.compilationUnit = CompilationUnitLoader.getCompilationUnit(file);
}
@Test
public void allFieldsCollectionCountTest() {
FieldDeclarationCollector visitor = new FieldDeclarationCollector();
this.compilationUnit.accept(visitor);
List<FieldDeclaration> collectedFields = visitor.getNodesCollected();
Assert.assertEquals(6, collectedFields.size());
}
}
| diegocedrim/organic | test/br/pucrio/opus/smells/tests/visitor/FieldDeclarationCollectorTest.java | Java | mit | 1,022 |
module rl.utilities.services.momentWrapper {
export var moduleName: string = 'rl.utilities.services.momentWrapper';
export var serviceName: string = 'momentWrapper';
export function momentWrapper(): void {
'use strict';
// Using `any` instead of MomentStatic because
// createFromInputFallback doesn't appear to be
// defined in MomentStatic... :-(
var momentWrapper: any = moment; // moment must already be loaded
// Set default method for handling non-ISO date conversions.
// See 4/28 comment in https://github.com/moment/moment/issues/1407
// This also prevents the deprecation warning message to the console.
momentWrapper.createFromInputFallback = (config: any): void => {
config._d = new Date(config._i);
};
return momentWrapper;
}
angular.module(moduleName, [])
.factory(serviceName, momentWrapper);
}
| csengineer13/TypeScript-Angular-Utilities | source/services/moment/moment.module.ts | TypeScript | mit | 851 |
/* describe, it, afterEach, beforeEach */
import './snoocore-mocha';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
chai.use(chaiAsPromised);
let expect = chai.expect;
import config from '../config';
import util from './util';
import ResponseError from '../../src/ResponseError';
import Endpoint from '../../src/Endpoint';
describe(__filename, function () {
this.timeout(config.testTimeout);
it('should get a proper response error', function() {
var message = 'oh hello there';
var response = { _status: 200, _body: 'a response body' };
var userConfig = util.getScriptUserConfig();
var endpoint = new Endpoint(userConfig,
userConfig.serverOAuth,
'get',
'/some/path',
{}, // headers
{ some: 'args' });
var responseError = new ResponseError(message,
response,
endpoint);
expect(responseError instanceof ResponseError);
expect(responseError.status).to.eql(200);
expect(responseError.url).to.eql('https://oauth.reddit.com/some/path');
expect(responseError.args).to.eql({ some: 'args', api_type: 'json' });
expect(responseError.message.indexOf('oh hello there')).to.not.eql(-1);
expect(responseError.message.indexOf('Response Status')).to.not.eql(-1);
expect(responseError.message.indexOf('Endpoint URL')).to.not.eql(-1);
expect(responseError.message.indexOf('Arguments')).to.not.eql(-1);
expect(responseError.message.indexOf('Response Body')).to.not.eql(-1);
});
});
| empyrical/snoocore | test/src/ResponseError-test.js | JavaScript | mit | 1,705 |
# -*- coding: utf-8 -*-
"""
webModifySqlAPI
~~~~~~~~~~~~~~
为web应用与后台数据库操作(插入,更新,删除操作)的接口
api_functions 中的DataApiFunc.py为其接口函数汇聚点,所有全局变量设置都在此;所有后台函数调用都在此设置
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2015 by Armin kissf lu.
:license: ukl, see LICENSE for more details.
"""
from . import api
from flask import json
from flask import request
from bson import json_util
# DataApiFunc 为数据库更新、插入、删除数据等操作函数
from api_functions.DataApiFunc import (deleManuleVsimSrc,
insertManuleVsimSrc,
updateManuleVsimSrc,
deleteNewVsimTestInfo,
insertNewVsimTestInfo,
updateNewVsimTestInfo)
@api.route('/delet_manulVsim/', methods=['POST'])
def delet_manulVsim():
"""
:return:
"""
if request.method == 'POST':
arrayData = request.get_array(field_name='file')
return deleManuleVsimSrc(array_data=arrayData)
else:
returnJsonData = {'err': True, 'errinfo': '操作违法!', 'data': []}
return json.dumps(returnJsonData, sort_keys=True, indent=4, default=json_util.default)
@api.route('/insert_manulVsim/', methods=['POST'])
def insert_manulVsim():
"""
:return:
"""
if request.method == 'POST':
arrayData = request.get_array(field_name='file')
return insertManuleVsimSrc(array_data=arrayData)
else:
returnJsonData = {'err': True, 'errinfo': '操作违法!', 'data': []}
return json.dumps(returnJsonData, sort_keys=True, indent=4, default=json_util.default)
@api.route('/update_manulVsim/', methods=['POST'])
def update_manulVsim():
"""
:return:
"""
if request.method == 'POST':
arrayData = request.get_array(field_name='file')
return updateManuleVsimSrc(array_data=arrayData)
else:
returnJsonData = {'err': True, 'errinfo': '操作违法!', 'data': []}
return json.dumps(returnJsonData, sort_keys=True, indent=4, default=json_util.default)
@api.route('/delet_newvsimtest_info_table/', methods=['POST'])
def delet_newvsimtest_info_table():
"""
:return:
"""
if request.method == 'POST':
arrayData = request.get_array(field_name='file')
return deleteNewVsimTestInfo(array_data=arrayData)
else:
returnJsonData = {'err': True, 'errinfo': '操作违法!', 'data': []}
return json.dumps(returnJsonData, sort_keys=True, indent=4, default=json_util.default)
@api.route('/insert_newvsimtest_info_table/', methods=['POST'])
def insert_newvsimtest_info_table():
"""
:return:
"""
if request.method == 'POST':
arrayData = request.get_array(field_name='file')
return insertNewVsimTestInfo(array_data=arrayData)
else:
returnJsonData = {'err': True, 'errinfo': '操作违法!', 'data': []}
return json.dumps(returnJsonData, sort_keys=True, indent=4, default=json_util.default)
@api.route('/update_newvsimtest_info_table/', methods=['POST'])
def update_newvsimtest_info_table():
"""
:return:
"""
if request.method == 'POST':
arrayData = request.get_array(field_name='file')
return updateNewVsimTestInfo(array_data=arrayData)
else:
returnJsonData = {'err': True, 'errinfo': '操作违法!', 'data': []}
return json.dumps(returnJsonData, sort_keys=True, indent=4, default=json_util.default) | dadawangweb/ukl-gsvc-web | app/api_1_0/webModifySqlAPI.py | Python | mit | 3,719 |
---
title: 異言の賜物
date: 08/07/2018
---
イエスの命令に従い、信者たちはエルサレムで約束の“霊”を待ちました。彼らは熱心に祈り、心から悔い改め、賛美しながら待ったのです。その日が来たとき、彼らは「一つになって集まって」(使徒 2:1)いました。たぶん、使徒言行録 1章の同じ家の上の部屋でしょう。しかし間もなく、彼らはもっと公の場に出て行くことになります(同 2:6 ~ 13)。
使徒言行録 2:1 ~ 3を読んでください。“霊”の注ぎの光景は強烈なものでした。突然、激しい嵐のとどろきのような音が天から聞こえてきてその場を満たし、次には炎の舌のようなものがあらわれて、そこにいた人々の上にとどまったのです。聖書では、「神の顕現」、つまり神が姿をあらわされることに、火や風がしばしば伴います(例えば、出 3:2、19:18、申 4:15)。加えて、火や風は神の“霊”をあらわすためにも用いられます(ヨハ 3:8、マタ3:11)。五旬祭の場合、そのような現象の正確な意味がどうであれ、それらは、約束された霊”の注ぎという特異な瞬間が救済史の中に入り込んだしるしでした。
“霊”は常に働いてこられました。旧約聖書の時代、神の民に対するその影響力は、しばしば目立つ形であらわれましたが、決して満ちあふれるほどではありませんでした。「父祖の時代には聖霊の感化はしばしば著しく現されたが、決して満ちあふれるほどではなかった。今、救い主のみ言葉に従って、弟子たちはこの賜物を懇願し、天においてはキリストがそのとりなしをしておられた。主はその民にみ霊を注ぐことができるように、み霊の賜物をお求めになったのである」(『希望への光』1369 ページ、『患難から栄光へ』上巻 31 ページ)。
バプテスマのヨハネは、メシアの到来に伴う“霊”によるバプテスマを予告し(ルカ3:16 参照、使徒 11:16と比較)、イエス御自身もこのことを何度か口になさいました(ルカ24:49、使徒 1:8)。この注ぎは、神の前におけるイエスの最初の執り成しの業だったのでしょう(ヨハ14:16、26、15:26)。五旬祭で、その約束は成就しました。
五旬祭での“霊”によるバプテスマは、十字架におけるイエスの勝利と天でイエスが高められたことに関係する特別な出来事でしたが、“霊”に満たされることは、信者たちの人生の中で継続的に繰り返される体験です(使徒 4:8、31、11:24、13:9、52、エフェ5:18)。
`◆ あなた自身の人生の中で“霊”が働いておられるというどのような証拠を、あなたは持っていますか。` | imasaru/sabbath-school-lessons | src/ja/2018-03/02/02.md | Markdown | mit | 3,079 |
using System;
using System.Collections.Generic;
using Csla;
namespace Templates
{
[Serializable]
public class DynamicRootBindingList :
DynamicBindingListBase<DynamicRoot>
{
protected override object AddNewCore()
{
DynamicRoot item = DataPortal.Create<DynamicRoot>();
Add(item);
return item;
}
private static void AddObjectAuthorizationRules()
{
// TODO: add authorization rules
//AuthorizationRules.AllowGet(typeof(DynamicRootBindingList), "Role");
//AuthorizationRules.AllowEdit(typeof(DynamicRootBindingList), "Role");
}
[Fetch]
private void Fetch()
{
// TODO: load values
RaiseListChangedEvents = false;
object listData = null;
foreach (var item in (List<object>)listData)
Add(DataPortal.Fetch<DynamicRoot>(item));
RaiseListChangedEvents = true;
}
}
} | MarimerLLC/csla | Support/Templates/cs/Files/DynamicRootBindingList.cs | C# | mit | 883 |
/*
* Copyright (c) 1999-2003 Damien Miller. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
#ifndef _DEFINES_H
#define _DEFINES_H
/* $Id: defines.h,v 1.171 2013/03/07 09:06:13 dtucker Exp $ */
/* Constants */
#if defined(HAVE_DECL_SHUT_RD) && HAVE_DECL_SHUT_RD == 0
enum
{
SHUT_RD = 0, /* No more receptions. */
SHUT_WR, /* No more transmissions. */
SHUT_RDWR /* No more receptions or transmissions. */
};
# define SHUT_RD SHUT_RD
# define SHUT_WR SHUT_WR
# define SHUT_RDWR SHUT_RDWR
#endif
/*
* Definitions for IP type of service (ip_tos)
*/
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#ifndef IPTOS_LOWDELAY
# define IPTOS_LOWDELAY 0x10
# define IPTOS_THROUGHPUT 0x08
# define IPTOS_RELIABILITY 0x04
# define IPTOS_LOWCOST 0x02
# define IPTOS_MINCOST IPTOS_LOWCOST
#endif /* IPTOS_LOWDELAY */
/*
* Definitions for DiffServ Codepoints as per RFC2474
*/
#ifndef IPTOS_DSCP_AF11
# define IPTOS_DSCP_AF11 0x28
# define IPTOS_DSCP_AF12 0x30
# define IPTOS_DSCP_AF13 0x38
# define IPTOS_DSCP_AF21 0x48
# define IPTOS_DSCP_AF22 0x50
# define IPTOS_DSCP_AF23 0x58
# define IPTOS_DSCP_AF31 0x68
# define IPTOS_DSCP_AF32 0x70
# define IPTOS_DSCP_AF33 0x78
# define IPTOS_DSCP_AF41 0x88
# define IPTOS_DSCP_AF42 0x90
# define IPTOS_DSCP_AF43 0x98
# define IPTOS_DSCP_EF 0xb8
#endif /* IPTOS_DSCP_AF11 */
#ifndef IPTOS_DSCP_CS0
# define IPTOS_DSCP_CS0 0x00
# define IPTOS_DSCP_CS1 0x20
# define IPTOS_DSCP_CS2 0x40
# define IPTOS_DSCP_CS3 0x60
# define IPTOS_DSCP_CS4 0x80
# define IPTOS_DSCP_CS5 0xa0
# define IPTOS_DSCP_CS6 0xc0
# define IPTOS_DSCP_CS7 0xe0
#endif /* IPTOS_DSCP_CS0 */
#ifndef IPTOS_DSCP_EF
# define IPTOS_DSCP_EF 0xb8
#endif /* IPTOS_DSCP_EF */
#ifndef PATH_MAX
# ifdef _POSIX_PATH_MAX
# define PATH_MAX _POSIX_PATH_MAX
# endif
#endif
#ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# else /* PATH_MAX */
# define MAXPATHLEN 64
/* realpath uses a fixed buffer of size MAXPATHLEN, so force use of ours */
# ifndef BROKEN_REALPATH
# define BROKEN_REALPATH 1
# endif /* BROKEN_REALPATH */
# endif /* PATH_MAX */
#endif /* MAXPATHLEN */
#if defined(HAVE_DECL_MAXSYMLINKS) && HAVE_DECL_MAXSYMLINKS == 0
# define MAXSYMLINKS 5
#endif
#ifndef STDIN_FILENO
# define STDIN_FILENO 0
#endif
#ifndef STDOUT_FILENO
# define STDOUT_FILENO 1
#endif
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
#ifndef NGROUPS_MAX /* Disable groupaccess if NGROUP_MAX is not set */
#ifdef NGROUPS
#define NGROUPS_MAX NGROUPS
#else
#define NGROUPS_MAX 0
#endif
#endif
#if defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK == 0
# define O_NONBLOCK 00004 /* Non Blocking Open */
#endif
#ifndef S_IFSOCK
# define S_IFSOCK 0
#endif /* S_IFSOCK */
#ifndef S_ISDIR
# define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
#endif /* S_ISDIR */
#ifndef S_ISREG
# define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
#endif /* S_ISREG */
#ifndef S_ISLNK
# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
#endif /* S_ISLNK */
#ifndef S_IXUSR
# define S_IXUSR 0000100 /* execute/search permission, */
# define S_IXGRP 0000010 /* execute/search permission, */
# define S_IXOTH 0000001 /* execute/search permission, */
# define _S_IWUSR 0000200 /* write permission, */
# define S_IWUSR _S_IWUSR /* write permission, owner */
# define S_IWGRP 0000020 /* write permission, group */
# define S_IWOTH 0000002 /* write permission, other */
# define S_IRUSR 0000400 /* read permission, owner */
# define S_IRGRP 0000040 /* read permission, group */
# define S_IROTH 0000004 /* read permission, other */
# define S_IRWXU 0000700 /* read, write, execute */
# define S_IRWXG 0000070 /* read, write, execute */
# define S_IRWXO 0000007 /* read, write, execute */
#endif /* S_IXUSR */
#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
#define MAP_ANON MAP_ANONYMOUS
#endif
#ifndef MAP_FAILED
# define MAP_FAILED ((void *)-1)
#endif
/* *-*-nto-qnx doesn't define this constant in the system headers */
#ifdef MISSING_NFDBITS
# define NFDBITS (8 * sizeof(unsigned long))
#endif
/*
SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but
including rpc/rpc.h breaks Solaris 6
*/
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK ((u_long)0x7f000001)
#endif
/* Types */
/* If sys/types.h does not supply intXX_t, supply them ourselves */
/* (or die trying) */
#ifndef HAVE_U_INT
typedef unsigned int u_int;
#endif
#ifndef HAVE_INTXX_T
typedef signed char int8_t;
# if (SIZEOF_SHORT_INT == 2)
typedef short int int16_t;
# else
# ifdef _UNICOS
# if (SIZEOF_SHORT_INT == 4)
typedef short int16_t;
# else
typedef long int16_t;
# endif
# else
# error "16 bit int type not found."
# endif /* _UNICOS */
# endif
# if (SIZEOF_INT == 4)
typedef int int32_t;
# else
# ifdef _UNICOS
typedef long int32_t;
# else
# error "32 bit int type not found."
# endif /* _UNICOS */
# endif
#endif
/* If sys/types.h does not supply u_intXX_t, supply them ourselves */
#ifndef HAVE_U_INTXX_T
# ifdef HAVE_UINTXX_T
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
# define HAVE_U_INTXX_T 1
# else
typedef unsigned char u_int8_t;
# if (SIZEOF_SHORT_INT == 2)
typedef unsigned short int u_int16_t;
# else
# ifdef _UNICOS
# if (SIZEOF_SHORT_INT == 4)
typedef unsigned short u_int16_t;
# else
typedef unsigned long u_int16_t;
# endif
# else
# error "16 bit int type not found."
# endif
# endif
# if (SIZEOF_INT == 4)
typedef unsigned int u_int32_t;
# else
# ifdef _UNICOS
typedef unsigned long u_int32_t;
# else
# error "32 bit int type not found."
# endif
# endif
# endif
#define __BIT_TYPES_DEFINED__
#endif
/* 64-bit types */
#ifndef HAVE_INT64_T
# if (SIZEOF_LONG_INT == 8)
typedef long int int64_t;
# else
# if (SIZEOF_LONG_LONG_INT == 8)
typedef long long int int64_t;
# endif
# endif
#endif
#ifndef HAVE_U_INT64_T
# if (SIZEOF_LONG_INT == 8)
typedef unsigned long int u_int64_t;
# else
# if (SIZEOF_LONG_LONG_INT == 8)
typedef unsigned long long int u_int64_t;
# endif
# endif
#endif
#ifndef HAVE_U_CHAR
typedef unsigned char u_char;
# define HAVE_U_CHAR
#endif /* HAVE_U_CHAR */
#ifndef ULLONG_MAX
# define ULLONG_MAX ((unsigned long long)-1)
#endif
#ifndef SIZE_T_MAX
#define SIZE_T_MAX ULONG_MAX
#endif /* SIZE_T_MAX */
#ifndef HAVE_SIZE_T
typedef unsigned int size_t;
# define HAVE_SIZE_T
# define SIZE_T_MAX UINT_MAX
#endif /* HAVE_SIZE_T */
#ifndef SIZE_MAX
#define SIZE_MAX SIZE_T_MAX
#endif
#ifndef HAVE_SSIZE_T
typedef int ssize_t;
# define HAVE_SSIZE_T
#endif /* HAVE_SSIZE_T */
#ifndef HAVE_CLOCK_T
typedef long clock_t;
# define HAVE_CLOCK_T
#endif /* HAVE_CLOCK_T */
#ifndef HAVE_SA_FAMILY_T
typedef int sa_family_t;
# define HAVE_SA_FAMILY_T
#endif /* HAVE_SA_FAMILY_T */
#ifndef HAVE_PID_T
typedef int pid_t;
# define HAVE_PID_T
#endif /* HAVE_PID_T */
#ifndef HAVE_SIG_ATOMIC_T
typedef int sig_atomic_t;
# define HAVE_SIG_ATOMIC_T
#endif /* HAVE_SIG_ATOMIC_T */
#ifndef HAVE_MODE_T
typedef int mode_t;
# define HAVE_MODE_T
#endif /* HAVE_MODE_T */
#if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
# define ss_family __ss_family
#endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */
#ifndef HAVE_SYS_UN_H
struct sockaddr_un {
short sun_family; /* AF_UNIX */
char sun_path[108]; /* path name (gag) */
};
#endif /* HAVE_SYS_UN_H */
#ifndef HAVE_IN_ADDR_T
typedef u_int32_t in_addr_t;
#endif
#ifndef HAVE_IN_PORT_T
typedef u_int16_t in_port_t;
#endif
#if defined(BROKEN_SYS_TERMIO_H) && !defined(_STRUCT_WINSIZE)
#define _STRUCT_WINSIZE
struct winsize {
unsigned short ws_row; /* rows, in characters */
unsigned short ws_col; /* columns, in character */
unsigned short ws_xpixel; /* horizontal size, pixels */
unsigned short ws_ypixel; /* vertical size, pixels */
};
#endif
/* *-*-nto-qnx does not define this type in the system headers */
#ifdef MISSING_FD_MASK
typedef unsigned long int fd_mask;
#endif
/* Paths */
#ifndef _PATH_BSHELL
# define _PATH_BSHELL "/bin/sh"
#endif
#ifdef USER_PATH
# ifdef _PATH_STDPATH
# undef _PATH_STDPATH
# endif
# define _PATH_STDPATH USER_PATH
#endif
#ifndef _PATH_STDPATH
# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
#endif
#ifndef SUPERUSER_PATH
# define SUPERUSER_PATH _PATH_STDPATH
#endif
#ifndef _PATH_DEVNULL
# define _PATH_DEVNULL "/dev/null"
#endif
/* user may have set a different path */
#if defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY)
# undef _PATH_MAILDIR MAILDIR
#endif /* defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY) */
#ifdef MAIL_DIRECTORY
# define _PATH_MAILDIR MAIL_DIRECTORY
#endif
#ifndef _PATH_NOLOGIN
# define _PATH_NOLOGIN "/etc/nologin"
#endif
/* Define this to be the path of the xauth program. */
#ifdef XAUTH_PATH
#define _PATH_XAUTH XAUTH_PATH
#endif /* XAUTH_PATH */
/* derived from XF4/xc/lib/dps/Xlibnet.h */
#ifndef X_UNIX_PATH
# ifdef __hpux
# define X_UNIX_PATH "/var/spool/sockets/X11/%u"
# else
# define X_UNIX_PATH "/tmp/.X11-unix/X%u"
# endif
#endif /* X_UNIX_PATH */
#define _PATH_UNIX_X X_UNIX_PATH
#ifndef _PATH_TTY
# define _PATH_TTY "/dev/tty"
#endif
/* Macros */
#if defined(HAVE_LOGIN_GETCAPBOOL) && defined(HAVE_LOGIN_CAP_H)
# define HAVE_LOGIN_CAP
#endif
#ifndef MAX
# define MAX(a,b) (((a)>(b))?(a):(b))
# define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef roundup
# define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
#endif
#ifndef timersub
#define timersub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
if ((result)->tv_usec < 0) { \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
} \
} while (0)
#endif
#ifndef TIMEVAL_TO_TIMESPEC
#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
}
#endif
#ifndef TIMESPEC_TO_TIMEVAL
#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
}
#endif
#ifndef __P
# define __P(x) x
#endif
#if !defined(IN6_IS_ADDR_V4MAPPED)
# define IN6_IS_ADDR_V4MAPPED(a) \
((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \
(((u_int32_t *) (a))[2] == htonl (0xffff)))
#endif /* !defined(IN6_IS_ADDR_V4MAPPED) */
#if !defined(__GNUC__) || (__GNUC__ < 2)
# define __attribute__(x)
#endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
#if !defined(HAVE_ATTRIBUTE__SENTINEL__) && !defined(__sentinel__)
# define __sentinel__
#endif
#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__bounded__)
# define __bounded__(x, y, z)
#endif
#if !defined(HAVE_ATTRIBUTE__NONNULL__) && !defined(__nonnull__)
# define __nonnull__(x)
#endif
/* *-*-nto-qnx doesn't define this macro in the system headers */
#ifdef MISSING_HOWMANY
# define howmany(x,y) (((x)+((y)-1))/(y))
#endif
#ifndef OSSH_ALIGNBYTES
#define OSSH_ALIGNBYTES (sizeof(int) - 1)
#endif
#ifndef __CMSG_ALIGN
#define __CMSG_ALIGN(p) (((u_int)(p) + OSSH_ALIGNBYTES) &~ OSSH_ALIGNBYTES)
#endif
/* Length of the contents of a control message of length len */
#ifndef CMSG_LEN
#define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
#endif
/* Length of the space taken up by a padded control message of length len */
#ifndef CMSG_SPACE
#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
#endif
/* given pointer to struct cmsghdr, return pointer to data */
#ifndef CMSG_DATA
#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
#endif /* CMSG_DATA */
/*
* RFC 2292 requires to check msg_controllen, in case that the kernel returns
* an empty list for some reasons.
*/
#ifndef CMSG_FIRSTHDR
#define CMSG_FIRSTHDR(mhdr) \
((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
(struct cmsghdr *)(mhdr)->msg_control : \
(struct cmsghdr *)NULL)
#endif /* CMSG_FIRSTHDR */
#if defined(HAVE_DECL_OFFSETOF) && HAVE_DECL_OFFSETOF == 0
# define offsetof(type, member) ((size_t) &((type *)0)->member)
#endif
/* Set up BSD-style BYTE_ORDER definition if it isn't there already */
/* XXX: doesn't try to cope with strange byte orders (PDP_ENDIAN) */
#ifndef BYTE_ORDER
# ifndef LITTLE_ENDIAN
# define LITTLE_ENDIAN 1234
# endif /* LITTLE_ENDIAN */
# ifndef BIG_ENDIAN
# define BIG_ENDIAN 4321
# endif /* BIG_ENDIAN */
# ifdef WORDS_BIGENDIAN
# define BYTE_ORDER BIG_ENDIAN
# else /* WORDS_BIGENDIAN */
# define BYTE_ORDER LITTLE_ENDIAN
# endif /* WORDS_BIGENDIAN */
#endif /* BYTE_ORDER */
/* Function replacement / compatibility hacks */
#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
# define HAVE_GETADDRINFO
#endif
#ifndef HAVE_GETOPT_OPTRESET
# undef getopt
# undef opterr
# undef optind
# undef optopt
# undef optreset
# undef optarg
# define getopt(ac, av, o) BSDgetopt(ac, av, o)
# define opterr BSDopterr
# define optind BSDoptind
# define optopt BSDoptopt
# define optreset BSDoptreset
# define optarg BSDoptarg
#endif
#if defined(BROKEN_GETADDRINFO) && defined(HAVE_GETADDRINFO)
# undef HAVE_GETADDRINFO
#endif
#if defined(BROKEN_GETADDRINFO) && defined(HAVE_FREEADDRINFO)
# undef HAVE_FREEADDRINFO
#endif
#if defined(BROKEN_GETADDRINFO) && defined(HAVE_GAI_STRERROR)
# undef HAVE_GAI_STRERROR
#endif
#if defined(BROKEN_UPDWTMPX) && defined(HAVE_UPDWTMPX)
# undef HAVE_UPDWTMPX
#endif
#if defined(BROKEN_SHADOW_EXPIRE) && defined(HAS_SHADOW_EXPIRE)
# undef HAS_SHADOW_EXPIRE
#endif
#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) && \
defined(SYSLOG_R_SAFE_IN_SIGHAND)
# define DO_LOG_SAFE_IN_SIGHAND
#endif
#if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
# define memmove(s1, s2, n) bcopy((s2), (s1), (n))
#endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */
#if defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX)
# define USE_VHANGUP
#endif /* defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX) */
#ifndef GETPGRP_VOID
# include <unistd.h>
# define getpgrp() getpgrp(0)
#endif
#ifdef USE_BSM_AUDIT
# define SSH_AUDIT_EVENTS
# define CUSTOM_SSH_AUDIT_EVENTS
#endif
#ifdef USE_LINUX_AUDIT
# define SSH_AUDIT_EVENTS
# define CUSTOM_SSH_AUDIT_EVENTS
#endif
#if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
# define __func__ __FUNCTION__
#elif !defined(HAVE___func__)
# define __func__ ""
#endif
#if defined(KRB5) && !defined(HEIMDAL)
# define krb5_get_err_text(context,code) error_message(code)
#endif
#if defined(SKEYCHALLENGE_4ARG)
# define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c,d)
#else
# define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c)
#endif
/* Maximum number of file descriptors available */
#ifdef HAVE_SYSCONF
# define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX)
#else
# define SSH_SYSFDMAX 10000
#endif
#ifdef FSID_HAS_VAL
/* encode f_fsid into a 64 bit value */
#define FSID_TO_ULONG(f) \
((((u_int64_t)(f).val[0] & 0xffffffffUL) << 32) | \
((f).val[1] & 0xffffffffUL))
#elif defined(FSID_HAS___VAL)
#define FSID_TO_ULONG(f) \
((((u_int64_t)(f).__val[0] & 0xffffffffUL) << 32) | \
((f).__val[1] & 0xffffffffUL))
#else
# define FSID_TO_ULONG(f) ((f))
#endif
#if defined(__Lynx__)
/*
* LynxOS defines these in param.h which we do not want to include since
* it will also pull in a bunch of kernel definitions.
*/
# define ALIGNBYTES (sizeof(int) - 1)
# define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES)
/* Missing prototypes on LynxOS */
int snprintf (char *, size_t, const char *, ...);
int mkstemp (char *);
char *crypt (const char *, const char *);
int seteuid (uid_t);
int setegid (gid_t);
char *mkdtemp (char *);
int rresvport_af (int *, sa_family_t);
int innetgr (const char *, const char *, const char *, const char *);
#endif
/*
* Define this to use pipes instead of socketpairs for communicating with the
* client program. Socketpairs do not seem to work on all systems.
*
* configure.ac sets this for a few OS's which are known to have problems
* but you may need to set it yourself
*/
/* #define USE_PIPES 1 */
/**
** login recorder definitions
**/
/* FIXME: put default paths back in */
#ifndef UTMP_FILE
# ifdef _PATH_UTMP
# define UTMP_FILE _PATH_UTMP
# else
# ifdef CONF_UTMP_FILE
# define UTMP_FILE CONF_UTMP_FILE
# endif
# endif
#endif
#ifndef WTMP_FILE
# ifdef _PATH_WTMP
# define WTMP_FILE _PATH_WTMP
# else
# ifdef CONF_WTMP_FILE
# define WTMP_FILE CONF_WTMP_FILE
# endif
# endif
#endif
/* pick up the user's location for lastlog if given */
#ifndef LASTLOG_FILE
# ifdef _PATH_LASTLOG
# define LASTLOG_FILE _PATH_LASTLOG
# else
# ifdef CONF_LASTLOG_FILE
# define LASTLOG_FILE CONF_LASTLOG_FILE
# endif
# endif
#endif
#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
# define USE_SHADOW
#endif
/* The login() library function in libutil is first choice */
#if defined(HAVE_LOGIN) && !defined(DISABLE_LOGIN)
# define USE_LOGIN
#else
/* Simply select your favourite login types. */
/* Can't do if-else because some systems use several... <sigh> */
# if !defined(DISABLE_UTMPX)
# define USE_UTMPX
# endif
# if defined(UTMP_FILE) && !defined(DISABLE_UTMP)
# define USE_UTMP
# endif
# if defined(WTMPX_FILE) && !defined(DISABLE_WTMPX)
# define USE_WTMPX
# endif
# if defined(WTMP_FILE) && !defined(DISABLE_WTMP)
# define USE_WTMP
# endif
#endif
#ifndef UT_LINESIZE
# define UT_LINESIZE 8
#endif
/* I hope that the presence of LASTLOG_FILE is enough to detect this */
#if defined(LASTLOG_FILE) && !defined(DISABLE_LASTLOG)
# define USE_LASTLOG
#endif
#ifdef HAVE_OSF_SIA
# ifdef USE_SHADOW
# undef USE_SHADOW
# endif
# define CUSTOM_SYS_AUTH_PASSWD 1
#endif
#if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(HAVE_SECUREWARE)
# define CUSTOM_SYS_AUTH_PASSWD 1
#endif
#if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(BROKEN_LIBIAF)
# define USE_LIBIAF
#endif
/* HP-UX 11.11 */
#ifdef BTMP_FILE
# define _PATH_BTMP BTMP_FILE
#endif
#if defined(USE_BTMP) && defined(_PATH_BTMP)
# define CUSTOM_FAILED_LOGIN
#endif
/** end of login recorder definitions */
#ifdef BROKEN_GETGROUPS
# define getgroups(a,b) ((a)==0 && (b)==NULL ? NGROUPS_MAX : getgroups((a),(b)))
#endif
#if defined(HAVE_MMAP) && defined(BROKEN_MMAP)
# undef HAVE_MMAP
#endif
#ifndef IOV_MAX
# if defined(_XOPEN_IOV_MAX)
# define IOV_MAX _XOPEN_IOV_MAX
# elif defined(DEF_IOV_MAX)
# define IOV_MAX DEF_IOV_MAX
# else
# define IOV_MAX 16
# endif
#endif
#ifndef EWOULDBLOCK
# define EWOULDBLOCK EAGAIN
#endif
#ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */
#define INET6_ADDRSTRLEN 46
#endif
#ifndef SSH_IOBUFSZ
# define SSH_IOBUFSZ 8192
#endif
#ifndef _NSIG
# ifdef NSIG
# define _NSIG NSIG
# else
# define _NSIG 128
# endif
#endif
#endif /* _DEFINES_H */
| steven-martins/openssh-git-auth-mysql | openssh-6.2p2-patched/defines.h | C | mit | 20,191 |
<?php
/**
* Created by PhpStorm.
* User: faustos
* Date: 05.06.14
* Time: 13:58
*/
namespace Tixi\App\AppBundle\Interfaces;
class DrivingOrderHandleDTO {
public $id;
public $anchorDate;
public $lookaheadaddressFrom;
public $lookaheadaddressTo;
public $zoneStatus;
public $zoneId;
public $zoneName;
public $orderTime;
public $isRepeated;
public $compagnion;
public $memo;
//repeated part
public $endDate;
public $mondayOrderTime;
public $tuesdayOrderTime;
public $wednesdayOrderTime;
public $thursdayOrderTime;
public $fridayOrderTime;
public $saturdayOrderTime;
public $sundayOrderTime;
} | Martin-Jonasse/sfitixi | src/Tixi/App/AppBundle/Interfaces/DrivingOrderHandleDTO.php | PHP | mit | 679 |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef __VMS
#include <in.h>
#include <inet.h>
#endif
#ifdef HAVE_PROCESS_H
#include <process.h>
#endif
#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
#undef in_addr_t
#define in_addr_t unsigned long
#endif
/***********************************************************************
* Only for ares-enabled builds
* And only for functions that fulfill the asynch resolver backend API
* as defined in asyn.h, nothing else belongs in this file!
**********************************************************************/
#ifdef CURLRES_ARES
#include "urldata.h"
#include "sendf.h"
#include "hostip.h"
#include "hash.h"
#include "share.h"
#include "strerror.h"
#include "url.h"
#include "multiif.h"
#include "inet_pton.h"
#include "connect.h"
#include "select.h"
#include "progress.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
# if defined(CURL_STATICLIB) && !defined(CARES_STATICLIB) && \
(defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__))
# define CARES_STATICLIB
# endif
# include <ares.h>
# include <ares_version.h> /* really old c-ares didn't include this by
itself */
#if ARES_VERSION >= 0x010500
/* c-ares 1.5.0 or later, the callback proto is modified */
#define HAVE_CARES_CALLBACK_TIMEOUTS 1
#endif
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
struct ResolverResults {
int num_pending; /* number of ares_gethostbyname() requests */
Curl_addrinfo *temp_ai; /* intermediary result while fetching c-ares parts */
int last_status;
};
/*
* Curl_resolver_global_init() - the generic low-level asynchronous name
* resolve API. Called from curl_global_init() to initialize global resolver
* environment. Initializes ares library.
*/
int Curl_resolver_global_init(void)
{
#ifdef CARES_HAVE_ARES_LIBRARY_INIT
if(ares_library_init(ARES_LIB_INIT_ALL)) {
return CURLE_FAILED_INIT;
}
#endif
return CURLE_OK;
}
/*
* Curl_resolver_global_cleanup()
*
* Called from curl_global_cleanup() to destroy global resolver environment.
* Deinitializes ares library.
*/
void Curl_resolver_global_cleanup(void)
{
#ifdef CARES_HAVE_ARES_LIBRARY_CLEANUP
ares_library_cleanup();
#endif
}
/*
* Curl_resolver_init()
*
* Called from curl_easy_init() -> Curl_open() to initialize resolver
* URL-state specific environment ('resolver' member of the UrlState
* structure). Fills the passed pointer by the initialized ares_channel.
*/
CURLcode Curl_resolver_init(void **resolver)
{
int status = ares_init((ares_channel*)resolver);
if(status != ARES_SUCCESS) {
if(status == ARES_ENOMEM)
return CURLE_OUT_OF_MEMORY;
else
return CURLE_FAILED_INIT;
}
return CURLE_OK;
/* make sure that all other returns from this function should destroy the
ares channel before returning error! */
}
/*
* Curl_resolver_cleanup()
*
* Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver
* URL-state specific environment ('resolver' member of the UrlState
* structure). Destroys the ares channel.
*/
void Curl_resolver_cleanup(void *resolver)
{
ares_destroy((ares_channel)resolver);
}
/*
* Curl_resolver_duphandle()
*
* Called from curl_easy_duphandle() to duplicate resolver URL-state specific
* environment ('resolver' member of the UrlState structure). Duplicates the
* 'from' ares channel and passes the resulting channel to the 'to' pointer.
*/
int Curl_resolver_duphandle(void **to, void *from)
{
/* Clone the ares channel for the new handle */
if(ARES_SUCCESS != ares_dup((ares_channel*)to,(ares_channel)from))
return CURLE_FAILED_INIT;
return CURLE_OK;
}
static void destroy_async_data (struct Curl_async *async);
/*
* Cancel all possibly still on-going resolves for this connection.
*/
void Curl_resolver_cancel(struct connectdata *conn)
{
if(conn && conn->data && conn->data->state.resolver)
ares_cancel((ares_channel)conn->data->state.resolver);
destroy_async_data(&conn->async);
}
/*
* destroy_async_data() cleans up async resolver data.
*/
static void destroy_async_data (struct Curl_async *async)
{
if(async->hostname)
free(async->hostname);
if(async->os_specific) {
struct ResolverResults *res = (struct ResolverResults *)async->os_specific;
if(res) {
if(res->temp_ai) {
Curl_freeaddrinfo(res->temp_ai);
res->temp_ai = NULL;
}
free(res);
}
async->os_specific = NULL;
}
async->hostname = NULL;
}
/*
* Curl_resolver_getsock() is called when someone from the outside world
* (using curl_multi_fdset()) wants to get our fd_set setup and we're talking
* with ares. The caller must make sure that this function is only called when
* we have a working ares channel.
*
* Returns: sockets-in-use-bitmap
*/
int Curl_resolver_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
{
struct timeval maxtime;
struct timeval timebuf;
struct timeval *timeout;
long milli;
int max = ares_getsock((ares_channel)conn->data->state.resolver,
(ares_socket_t *)socks, numsocks);
maxtime.tv_sec = CURL_TIMEOUT_RESOLVE;
maxtime.tv_usec = 0;
timeout = ares_timeout((ares_channel)conn->data->state.resolver, &maxtime,
&timebuf);
milli = (timeout->tv_sec * 1000) + (timeout->tv_usec/1000);
if(milli == 0)
milli += 10;
Curl_expire(conn->data, milli);
return max;
}
/*
* waitperform()
*
* 1) Ask ares what sockets it currently plays with, then
* 2) wait for the timeout period to check for action on ares' sockets.
* 3) tell ares to act on all the sockets marked as "with action"
*
* return number of sockets it worked on
*/
static int waitperform(struct connectdata *conn, int timeout_ms)
{
struct SessionHandle *data = conn->data;
int nfds;
int bitmask;
ares_socket_t socks[ARES_GETSOCK_MAXNUM];
struct pollfd pfd[ARES_GETSOCK_MAXNUM];
int i;
int num = 0;
bitmask = ares_getsock((ares_channel)data->state.resolver, socks,
ARES_GETSOCK_MAXNUM);
for(i=0; i < ARES_GETSOCK_MAXNUM; i++) {
pfd[i].events = 0;
pfd[i].revents = 0;
if(ARES_GETSOCK_READABLE(bitmask, i)) {
pfd[i].fd = socks[i];
pfd[i].events |= POLLRDNORM|POLLIN;
}
if(ARES_GETSOCK_WRITABLE(bitmask, i)) {
pfd[i].fd = socks[i];
pfd[i].events |= POLLWRNORM|POLLOUT;
}
if(pfd[i].events != 0)
num++;
else
break;
}
if(num)
nfds = Curl_poll(pfd, num, timeout_ms);
else
nfds = 0;
if(!nfds)
/* Call ares_process() unconditonally here, even if we simply timed out
above, as otherwise the ares name resolve won't timeout! */
ares_process_fd((ares_channel)data->state.resolver, ARES_SOCKET_BAD,
ARES_SOCKET_BAD);
else {
/* move through the descriptors and ask for processing on them */
for(i=0; i < num; i++)
ares_process_fd((ares_channel)data->state.resolver,
pfd[i].revents & (POLLRDNORM|POLLIN)?
pfd[i].fd:ARES_SOCKET_BAD,
pfd[i].revents & (POLLWRNORM|POLLOUT)?
pfd[i].fd:ARES_SOCKET_BAD);
}
return nfds;
}
/*
* Curl_resolver_is_resolved() is called repeatedly to check if a previous
* name resolve request has completed. It should also make sure to time-out if
* the operation seems to take too long.
*
* Returns normal CURLcode errors.
*/
CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
struct Curl_dns_entry **dns)
{
struct SessionHandle *data = conn->data;
struct ResolverResults *res = (struct ResolverResults *)
conn->async.os_specific;
CURLcode rc = CURLE_OK;
*dns = NULL;
waitperform(conn, 0);
if(res && !res->num_pending) {
(void)Curl_addrinfo_callback(conn, res->last_status, res->temp_ai);
/* temp_ai ownership is moved to the connection, so we need not free-up
them */
res->temp_ai = NULL;
if(!conn->async.dns) {
failf(data, "Could not resolve: %s (%s)",
conn->async.hostname, ares_strerror(conn->async.status));
rc = conn->bits.proxy?CURLE_COULDNT_RESOLVE_PROXY:
CURLE_COULDNT_RESOLVE_HOST;
}
else
*dns = conn->async.dns;
destroy_async_data(&conn->async);
}
return rc;
}
/*
* Curl_resolver_wait_resolv()
*
* waits for a resolve to finish. This function should be avoided since using
* this risk getting the multi interface to "hang".
*
* If 'entry' is non-NULL, make it point to the resolved dns entry
*
* Returns CURLE_COULDNT_RESOLVE_HOST if the host was not resolved, and
* CURLE_OPERATION_TIMEDOUT if a time-out occurred.
*/
CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
struct Curl_dns_entry **entry)
{
CURLcode rc=CURLE_OK;
struct SessionHandle *data = conn->data;
long timeout;
struct timeval now = Curl_tvnow();
struct Curl_dns_entry *temp_entry;
timeout = Curl_timeleft(data, &now, TRUE);
if(!timeout)
timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */
/* Wait for the name resolve query to complete. */
for(;;) {
struct timeval *tvp, tv, store;
long timediff;
int itimeout;
int timeout_ms;
itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout;
store.tv_sec = itimeout/1000;
store.tv_usec = (itimeout%1000)*1000;
tvp = ares_timeout((ares_channel)data->state.resolver, &store, &tv);
/* use the timeout period ares returned to us above if less than one
second is left, otherwise just use 1000ms to make sure the progress
callback gets called frequent enough */
if(!tvp->tv_sec)
timeout_ms = (int)(tvp->tv_usec/1000);
else
timeout_ms = 1000;
waitperform(conn, timeout_ms);
Curl_resolver_is_resolved(conn,&temp_entry);
if(conn->async.done)
break;
if(Curl_pgrsUpdate(conn)) {
rc = CURLE_ABORTED_BY_CALLBACK;
timeout = -1; /* trigger the cancel below */
}
else {
struct timeval now2 = Curl_tvnow();
timediff = Curl_tvdiff(now2, now); /* spent time */
timeout -= timediff?timediff:1; /* always deduct at least 1 */
now = now2; /* for next loop */
}
if(timeout < 0) {
/* our timeout, so we cancel the ares operation */
ares_cancel((ares_channel)data->state.resolver);
break;
}
}
/* Operation complete, if the lookup was successful we now have the entry
in the cache. */
if(entry)
*entry = conn->async.dns;
if(rc)
/* close the connection, since we can't return failure here without
cleaning up this connection properly.
TODO: remove this action from here, it is not a name resolver decision.
*/
conn->bits.close = TRUE;
return rc;
}
/* Connects results to the list */
static void compound_results(struct ResolverResults *res,
Curl_addrinfo *ai)
{
Curl_addrinfo *ai_tail;
if(!ai)
return;
ai_tail = ai;
while(ai_tail->ai_next)
ai_tail = ai_tail->ai_next;
/* Add the new results to the list of old results. */
ai_tail->ai_next = res->temp_ai;
res->temp_ai = ai;
}
/*
* ares_query_completed_cb() is the callback that ares will call when
* the host query initiated by ares_gethostbyname() from Curl_getaddrinfo(),
* when using ares, is completed either successfully or with failure.
*/
static void query_completed_cb(void *arg, /* (struct connectdata *) */
int status,
#ifdef HAVE_CARES_CALLBACK_TIMEOUTS
int timeouts,
#endif
struct hostent *hostent)
{
struct connectdata *conn = (struct connectdata *)arg;
struct ResolverResults *res;
#ifdef HAVE_CARES_CALLBACK_TIMEOUTS
(void)timeouts; /* ignored */
#endif
if(ARES_EDESTRUCTION == status)
/* when this ares handle is getting destroyed, the 'arg' pointer may not
be valid so only defer it when we know the 'status' says its fine! */
return;
res = (struct ResolverResults *)conn->async.os_specific;
res->num_pending--;
if(CURL_ASYNC_SUCCESS == status) {
Curl_addrinfo *ai = Curl_he2ai(hostent, conn->async.port);
if(ai) {
compound_results(res, ai);
}
}
/* A successful result overwrites any previous error */
if(res->last_status != ARES_SUCCESS)
res->last_status = status;
}
/*
* Curl_resolver_getaddrinfo() - when using ares
*
* Returns name information about the given hostname and port number. If
* successful, the 'hostent' is returned and the forth argument will point to
* memory we need to free after use. That memory *MUST* be freed with
* Curl_freeaddrinfo(), nothing else.
*/
Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
const char *hostname,
int port,
int *waitp)
{
char *bufp;
struct SessionHandle *data = conn->data;
struct in_addr in;
int family = PF_INET;
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
struct in6_addr in6;
#endif /* CURLRES_IPV6 */
*waitp = 0; /* default to synchronous response */
/* First check if this is an IPv4 address string */
if(Curl_inet_pton(AF_INET, hostname, &in) > 0) {
/* This is a dotted IP address 123.123.123.123-style */
return Curl_ip2addr(AF_INET, &in, hostname, port);
}
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
/* Otherwise, check if this is an IPv6 address string */
if(Curl_inet_pton (AF_INET6, hostname, &in6) > 0)
/* This must be an IPv6 address literal. */
return Curl_ip2addr(AF_INET6, &in6, hostname, port);
switch(conn->ip_version) {
default:
#if ARES_VERSION >= 0x010601
family = PF_UNSPEC; /* supported by c-ares since 1.6.1, so for older
c-ares versions this just falls through and defaults
to PF_INET */
break;
#endif
case CURL_IPRESOLVE_V4:
family = PF_INET;
break;
case CURL_IPRESOLVE_V6:
family = PF_INET6;
break;
}
#endif /* CURLRES_IPV6 */
bufp = strdup(hostname);
if(bufp) {
struct ResolverResults *res = NULL;
Curl_safefree(conn->async.hostname);
conn->async.hostname = bufp;
conn->async.port = port;
conn->async.done = FALSE; /* not done */
conn->async.status = 0; /* clear */
conn->async.dns = NULL; /* clear */
res = calloc(sizeof(struct ResolverResults),1);
if(!res) {
Curl_safefree(conn->async.hostname);
conn->async.hostname = NULL;
return NULL;
}
conn->async.os_specific = res;
/* initial status - failed */
res->last_status = ARES_ENOTFOUND;
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
if(family == PF_UNSPEC) {
if(Curl_ipv6works()) {
res->num_pending = 2;
/* areschannel is already setup in the Curl_open() function */
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
PF_INET, query_completed_cb, conn);
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
PF_INET6, query_completed_cb, conn);
}
else {
res->num_pending = 1;
/* areschannel is already setup in the Curl_open() function */
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
PF_INET, query_completed_cb, conn);
}
}
else
#endif /* CURLRES_IPV6 */
{
res->num_pending = 1;
/* areschannel is already setup in the Curl_open() function */
ares_gethostbyname((ares_channel)data->state.resolver, hostname, family,
query_completed_cb, conn);
}
*waitp = 1; /* expect asynchronous response */
}
return NULL; /* no struct yet */
}
CURLcode Curl_set_dns_servers(struct SessionHandle *data,
char *servers)
{
CURLcode result = CURLE_NOT_BUILT_IN;
int ares_result;
/* If server is NULL or empty, this would purge all DNS servers
* from ares library, which will cause any and all queries to fail.
* So, just return OK if none are configured and don't actually make
* any changes to c-ares. This lets c-ares use it's defaults, which
* it gets from the OS (for instance from /etc/resolv.conf on Linux).
*/
if(!(servers && servers[0]))
return CURLE_OK;
#if (ARES_VERSION >= 0x010704)
ares_result = ares_set_servers_csv(data->state.resolver, servers);
switch(ares_result) {
case ARES_SUCCESS:
result = CURLE_OK;
break;
case ARES_ENOMEM:
result = CURLE_OUT_OF_MEMORY;
break;
case ARES_ENOTINITIALIZED:
case ARES_ENODATA:
case ARES_EBADSTR:
default:
result = CURLE_BAD_FUNCTION_ARGUMENT;
break;
}
#else /* too old c-ares version! */
(void)data;
(void)(ares_result);
#endif
return result;
}
CURLcode Curl_set_dns_interface(struct SessionHandle *data,
const char *interf)
{
#if (ARES_VERSION >= 0x010704)
if(!interf)
interf = "";
ares_set_local_dev((ares_channel)data->state.resolver, interf);
return CURLE_OK;
#else /* c-ares version too old! */
(void)data;
(void)interf;
return CURLE_NOT_BUILT_IN;
#endif
}
CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
const char *local_ip4)
{
#if (ARES_VERSION >= 0x010704)
uint32_t a4;
if((!local_ip4) || (local_ip4[0] == 0)) {
a4 = 0; /* disabled: do not bind to a specific address */
}
else {
if(Curl_inet_pton(AF_INET, local_ip4, &a4) != 1) {
return CURLE_BAD_FUNCTION_ARGUMENT;
}
}
ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4));
return CURLE_OK;
#else /* c-ares version too old! */
(void)data;
(void)local_ip4;
return CURLE_NOT_BUILT_IN;
#endif
}
CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
const char *local_ip6)
{
#if (ARES_VERSION >= 0x010704)
unsigned char a6[INET6_ADDRSTRLEN];
if((!local_ip6) || (local_ip6[0] == 0)) {
/* disabled: do not bind to a specific address */
memset(a6, 0, sizeof(a6));
}
else {
if(Curl_inet_pton(AF_INET6, local_ip6, a6) != 1) {
return CURLE_BAD_FUNCTION_ARGUMENT;
}
}
ares_set_local_ip6((ares_channel)data->state.resolver, a6);
return CURLE_OK;
#else /* c-ares version too old! */
(void)data;
(void)local_ip6;
return CURLE_NOT_BUILT_IN;
#endif
}
#endif /* CURLRES_ARES */
| sidhujag/devcoin-wallet | src/curl/lib/asyn-ares.c | C | mit | 19,853 |
package org.jsondoc.core.issues.issue151;
import org.jsondoc.core.annotation.Api;
import org.jsondoc.core.annotation.ApiMethod;
import org.jsondoc.core.annotation.ApiResponseObject;
@Api(name = "Foo Services", description = "bla, bla, bla ...", group = "foogroup")
public class FooController {
@ApiMethod(path = { "/api/foo" }, description = "Main foo service")
@ApiResponseObject
public FooWrapper<BarPojo> getBar() {
return null;
}
@ApiMethod(path = { "/api/foo-wildcard" }, description = "Main foo service with wildcard")
@ApiResponseObject
public FooWrapper<?> wildcard() {
return null;
}
} | sarhanm/jsondoc | jsondoc-core/src/test/java/org/jsondoc/core/issues/issue151/FooController.java | Java | mit | 612 |
namespace Porter2Stemmer
{
public interface IStemmer
{
/// <summary>
/// Stem a word.
/// </summary>
/// <param name="word">Word to stem.</param>
/// <returns>
/// The stemmed word, with a reference to the original unstemmed word.
/// </returns>
StemmedWord Stem(string word);
}
}
| SDCAAU/P7_Helpdesk | sw704e17.Database/sw704e17.Database/Stemmer/IStemmer.cs | C# | mit | 361 |
function someFunctionWithAVeryLongName(firstParameter='something',
secondParameter='booooo',
third=null, fourthParameter=false,
fifthParameter=123.12,
sixthParam=true
){
}
function someFunctionWithAVeryLongName2(
firstParameter='something',
secondParameter='booooo',
) {
}
function blah() {
}
function blah()
{
}
var object =
{
someFunctionWithAVeryLongName: function(
firstParameter='something',
secondParameter='booooo',
third=null,
fourthParameter=false,
fifthParameter=123.12,
sixthParam=true
) /** w00t */ {
}
someFunctionWithAVeryLongName2: function (firstParameter='something',
secondParameter='booooo',
third=null
) {
}
someFunctionWithAVeryLongName3: function (
firstParameter, secondParameter, third=null
) {
}
someFunctionWithAVeryLongName4: function (
firstParameter, secondParameter
) {
}
someFunctionWithAVeryLongName5: function (
firstParameter,
secondParameter=array(1,2,3),
third=null
) {
}
}
var a = Function('return 1+1');
| oknoorap/wpcs | scripts/phpcs/CodeSniffer/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.js | JavaScript | mit | 1,148 |
---
category: section-tools-geolocation
---
Endpoint
```
GET https://api.paymentwall.com/api/rest/country
```
Sample Response
```json
{
"code":"US",
"country":"United States"
}
```
| paymentwall/paymentwall.github.io | _apicode-js/js-tools-geolocation.md | Markdown | mit | 194 |
#!/usr/bin/env node
require("babel/register")({
"stage": 1
});
var fs = require("fs");
GLOBAL.WALLACEVERSION = "Err";
GLOBAL.PLUGIN_CONTRIBUTORS = [];
try {
var p = JSON.parse(fs.readFileSync(__dirname+"/package.json"));
GLOBAL.WALLACEVERSION = p.version;
}
catch(e) {}
var Core = require("./core/Core.js");
process.on('uncaughtException', function (err) {
console.error(err);
});
GLOBAL.core = new Core();
| Reanmachine/Wallace | main.js | JavaScript | mit | 432 |
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::group([ 'middleware' => 'guest' ], function () {
Route::get('login', 'Auth\AuthController@getLogin');
Route::post('login', 'Auth\AuthController@postLogin');
// Password reset link request routes...
Route::get('password/email', 'Auth\PasswordController@getEmail');
Route::post('password/email', 'Auth\PasswordController@postEmail');
// Password reset routes...
Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
Route::post('password/reset', 'Auth\PasswordController@postReset');
});
Route::group([ 'middleware' => 'auth' ], function () {
Route::get('/', [
'as' => 'home',
'uses' => 'ProjectController@index'
]);
Route::get('/project/create', [
'as' => 'project.create',
'uses' => 'ProjectController@create'
]);
Route::post('/project/create', [
'as' => 'project.store',
'uses' => 'ProjectController@store'
]);
Route::post('/project/search', [
'as' => 'project.search',
'uses' => 'ProjectController@search'
]);
Route::get('/project/{project}/graph', [
'as' => 'detail.graph',
'uses' => 'ProjectDetailController@graph'
]);
Route::get('/project/{project}/overview', [
'as' => 'detail.overview',
'uses' => 'ProjectDetailController@overview'
]);
Route::get('/project/{project}/activity', [
'as' => 'detail.activity',
'uses' => 'ProjectDetailController@activity'
]);
Route::get('/project/{project}/inspection-{issue}/{category}', [
'as' => 'detail.issue',
'uses' => 'ProjectDetailController@issue'
]);
Route::post('/project/{project}/inspection-{issue}/', [
'as' => 'detail.issue.category',
'uses' => 'ProjectDetailController@issueByCategory'
]);
Route::delete('/project/{project}', [
'as' => 'project.destroy',
'uses' => 'ProjectController@destroy'
]);
Route::get('/project/{project}/inspect', [
'as' => 'inspection.create',
'uses' => 'ProjectDetailController@create'
]);
Route::post('/project/{project}/inspect', [
'as' => 'inspection.store',
'uses' => 'ProjectDetailController@store'
]);
Route::get('logout', 'Auth\AuthController@getLogout');
Route::group([ 'middleware' => 'role' ], function () {
Route::resource('user', 'UserController');
});
});
| suitmedia/suitcoda | app/Http/routes.php | PHP | mit | 2,811 |
## Ruby
These settings apply only when `--ruby` is specified on the command line.
``` yaml $(ruby)
ruby:
package-name: azure_mgmt_search
package-version: "0.16.0"
azure-arm: true
```
### Ruby multi-api
``` yaml $(ruby) && $(multiapi)
batch:
- tag: package-2015-08
```
### Tag: package-2015-08 and ruby
These settings apply only when `--tag=package-2015-08 --ruby` is specified on the command line.
Please also specify `--ruby-sdks-folder=<path to the root directory of your azure-sdk-for-ruby clone>`.
``` yaml $(tag) == 'package-2015-08' && $(ruby)
namespace: "Azure::Search::Mgmt::V2015_08_19"
output-folder: $(ruby-sdks-folder)/management/azure_mgmt_search/lib
```
| dashimi16/azure-rest-api-specs | specification/search/resource-manager/readme.ruby.md | Markdown | mit | 683 |
---
title: Faire l’expérience des offrandes
date: 01/03/2018
---
Si Christ est venu nous révéler le caractère de Dieu, une chose devrait être claire maintenant: Dieu nous aime et Il veut le meilleur pour nous. Il nous demande de faire seulement ce qui sera de notre propre intérêt, jamais à notre détriment. C’est aussi, Son appel pour nous d’être des donneurs généreux et joyeux de ce qui nous a été donné. Les offrandes volontaires et généreuses que nous donnons sont autant un avantage pour nous qui donnons, tout comme elles peuvent l’être pour ceux qui les reçoivent. Seuls ceux qui donnent de cette manière peuvent savoir par eux-mêmes à quel point il y a plus de bonheur à donner qu’à recevoir.
`Lisez 2 Corinthiens 9:6, 7. Comment ce texte résume-t-il parfaitement ce que devraient être les offrandes?`
Faire une offrande généreuse peut et doit être un acte très personnel et spirituel. C’est une œuvre de foi, une expression de gratitude pour ce qui nous a été donné en Christ.
Et, comme tout autre Acte de foi, le fait même de donner augmente la foi, car « la foi sans les œuvres est morte » (Jacques 2:20). Et il n’y a de meilleur moyen d’augmenter sa foi que de la vivre de façon pratique, ce qui signifie que nous devons faire des choses qui jaillissent de notre foi.
Quand nous donnons, volontairement et généreusement, nous reflétons à notre manière le caractère de Christ. Nous apprenons davantage à agir comme Dieu en faisant l’expérience de nos propres actes. Ainsi, l’acte des offrandes inspire la confiance en Dieu et l’occasion de « [sentir et voir] combien l’Éternel est bon! Heureux l’homme qui cherche en Lui Son refuge! » (Ps. 34: 8, LSG).
« On verra que la gloire qui resplendit sur la face du Christ c’est la gloire de l’amour qui se sacrifie. On verra, à la lumière du calvaire, que la loi de l’amour qui renonce à soi-même est la loi de la vie pour la terre et pour le ciel; que l’amour qui “ne cherche pas son intérêt” a sa source dans le cœur de Dieu; et qu’en celui qui est doux et humble se manifeste le caractère de celui qui habite une lumière dont aucun homme ne peut s’approcher. » – Ellen G. White, Jésus-Christ, pp. 9, 10.
`Comment avez-vous vécu la réalité de comment la foi grandit grâce au fait de donner volontairement et généreusement de ce que vous avez reçu?` | imasaru/sabbath-school-lessons | src/fr/2018-01/09/06.md | Markdown | mit | 2,540 |
<?php return unserialize('a:1:{i:0;O:27:"Doctrine\\ORM\\Mapping\\Column":10:{s:4:"type";s:8:"datetime";s:6:"length";N;s:9:"precision";i:0;s:5:"scale";i:0;s:6:"unique";b:0;s:8:"nullable";b:0;s:4:"name";s:16:"fecha_nacimiento";s:7:"options";a:0:{}s:16:"columnDefinition";N;s:5:"value";N;}}'); | ilaguardia/cupon | cupon/app/cache/prod/annotations/Cupon-UsuarioBundle-Entity-Usuario$fecha_nacimiento.cache.php | PHP | mit | 290 |
(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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(require,module,exports){
'use strict';
/*global cEngine */
/*eslint no-console:0*/
(function (cEngine) {
cEngine.extend('__name__', {
create: function create(config) {
config = config || {};
var __name__ = {
cEnginePlugin: {
name: '__name__',
version: '0.0.1'
},
init: function init(engine) {
console.log('init', engine);
},
start: function start() {
console.log('start');
},
stop: function stop() {
console.log('stop');
},
preStep: function preStep(context, width, height, dt) {
console.log('preStep', context, width, height, dt);
},
postStep: function postStep(context, width, height, dt) {
console.log('postStep', context, width, height, dt);
},
destroy: function destroy() {
console.log('destroy');
}
};
return __name__;
}
});
})(cEngine);
},{}]},{},[1]) | renmuell/makrenejs | docs/vendors/cEngine/plugins/cEngine.__pluginTemplate__.js | JavaScript | mit | 1,422 |
---
title: Elsõ Gyümölcsök
date: 12/07/2018
---
Péter szavai szíven találták a hallgatóságát. Némelyek közülük néhány héttel korábban még bizonyára Jézus keresztre feszítését követelték (Lk 23:13-25). Miután viszont meggyõzõdtek arról, hogy a názáreti Jézus Isten által kijelölt Messiás, elkeseredetten kiáltottak fel: "Mit cselekedjünk, atyámfiai, férfiak" (ApCsel 2:37)?
`Olvassuk el ApCsel 2:38 versét! Mi a megbocsátás két alapvetõ feltétele?`
A bûnbánat azt jelenti, hogy határozottan megváltozik az életünk menete, elfordulunk a bûntõl (ApCsel 3:19; 26:20), és nem csupán szomorkodunk vagy furdal a lelkiismeretünk. A valódi bûnbánat Isten ajándéka a hittel együtt, de mint minden ajándékot, vissza is lehet utasítani (ApCsel 5:31-33; 26:19-21; Róm 2:4).
Keresztelõ János ideje óta a keresztséggel hozzák összefüggésbe a bûnbánatot (Mk 1:4). Azaz a keresztség a bûnbánat kifejezése lett, a szertartás a bûnök elmosását és a Szentlélek általi, erkölcsi helyreállítást jelképezi (ApCsel 2:38; 22:16; vö. Tit 3:5-7).
`Olvassuk el ApCsel 2:38-39 verseit! Milyen különleges ígéretet kapnak, akik megbánják bûneiket és megkeresztelkednek?`
Az emberek pünkösdkor nemcsak a bûnbocsánat, hanem a Szentlélek teljességének ígéretét is megkapták a személyes növekedésükhöz, az egyházban végzett szolgálathoz és fõként a misszióhoz. Talán ez volt a legnagyobb áldás az összes közül, hiszen az egyház tulajdonképpen azért létezik ma is, hogy hirdesse az evangélium jó hírét (1Pt 2:9). Így ettõl kezdve üdvbizonyosságuk lehetett, a Szentlélek erejét is megkaphatták, ami alkalmassá tette õket arra a küldetésre, amelyre az egyház elhívást kapott.
`Azoknak, akik az evangéliumot akarják hirdetni, miért fontos felismerniük, hogy Isten megbocsátotta a bûneinket? Végsõ soron milyen reménységet kínálhatunk másoknak Jézusban, ha mi magunk nem rendelkezünk vele?` | PrJared/sabbath-school-lessons | src/hu/2018-03/02/06.md | Markdown | mit | 2,051 |
// Copyright (c) 2015 Uber Technologies, Inc.
//
// 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.
'use strict';
var EventEmitter = require('./lib/event_emitter');
var stat = require('./lib/stat');
var inherits = require('util').inherits;
var errors = require('./errors');
var States = require('./reqres_states');
function TChannelOutResponse(id, options) {
options = options || {};
var self = this;
EventEmitter.call(self);
self.errorEvent = self.defineEvent('error');
self.spanEvent = self.defineEvent('span');
self.finishEvent = self.defineEvent('finish');
self.channel = options.channel;
self.inreq = options.inreq;
self.logger = options.logger;
self.random = options.random;
self.timers = options.timers;
self.start = 0;
self.end = 0;
self.state = States.Initial;
self.id = id || 0;
self.code = options.code || 0;
self.tracing = options.tracing || null;
self.headers = options.headers || {};
self.checksumType = options.checksumType || 0;
self.checksum = options.checksum || null;
self.ok = self.code === 0;
self.span = options.span || null;
self.streamed = false;
self._argstream = null;
self.arg1 = null;
self.arg2 = null;
self.arg3 = null;
self.codeString = null;
self.message = null;
}
inherits(TChannelOutResponse, EventEmitter);
TChannelOutResponse.prototype.type = 'tchannel.outgoing-response';
TChannelOutResponse.prototype._sendCallResponse = function _sendCallResponse(args, isLast) {
var self = this;
throw errors.UnimplementedMethod({
className: self.constructor.name,
methodName: '_sendCallResponse'
});
};
TChannelOutResponse.prototype._sendCallResponseCont = function _sendCallResponseCont(args, isLast) {
var self = this;
throw errors.UnimplementedMethod({
className: self.constructor.name,
methodName: '_sendCallResponseCont'
});
};
TChannelOutResponse.prototype._sendError = function _sendError(codeString, message) {
var self = this;
throw errors.UnimplementedMethod({
className: self.constructor.name,
methodName: '_sendError'
});
};
TChannelOutResponse.prototype.sendParts = function sendParts(parts, isLast) {
var self = this;
switch (self.state) {
case States.Initial:
self.sendCallResponseFrame(parts, isLast);
break;
case States.Streaming:
self.sendCallResponseContFrame(parts, isLast);
break;
case States.Done:
self.errorEvent.emit(self, errors.ResponseFrameState({
attempted: 'arg parts',
state: 'Done'
}));
break;
case States.Error:
// TODO: log warn
break;
default:
self.channel.logger.error('TChannelOutResponse is in a wrong state', {
state: self.state
});
break;
}
};
TChannelOutResponse.prototype.sendCallResponseFrame = function sendCallResponseFrame(args, isLast) {
var self = this;
switch (self.state) {
case States.Initial:
self.start = self.timers.now();
self._sendCallResponse(args, isLast);
if (self.span) {
self.span.annotate('ss');
}
if (isLast) self.state = States.Done;
else self.state = States.Streaming;
break;
case States.Streaming:
self.errorEvent.emit(self, errors.ResponseFrameState({
attempted: 'call response',
state: 'Streaming'
}));
break;
case States.Done:
case States.Error:
var arg2 = args[1] || '';
var arg3 = args[2] || '';
self.errorEvent.emit(self, errors.ResponseAlreadyDone({
attempted: 'call response',
state: self.state,
method: 'sendCallResponseFrame',
bufArg2: arg2.slice(0, 50),
arg2: String(arg2).slice(0, 50),
bufArg3: arg3.slice(0, 50),
arg3: String(arg3).slice(0, 50)
}));
}
};
TChannelOutResponse.prototype.sendCallResponseContFrame = function sendCallResponseContFrame(args, isLast) {
var self = this;
switch (self.state) {
case States.Initial:
self.errorEvent.emit(self, errors.ResponseFrameState({
attempted: 'call response continuation',
state: 'Initial'
}));
break;
case States.Streaming:
self._sendCallResponseCont(args, isLast);
if (isLast) self.state = States.Done;
break;
case States.Done:
case States.Error:
self.errorEvent.emit(self, errors.ResponseAlreadyDone({
attempted: 'call response continuation',
state: self.state,
method: 'sendCallResponseContFrame'
}));
}
};
TChannelOutResponse.prototype.sendError = function sendError(codeString, message) {
var self = this;
if (self.state === States.Done || self.state === States.Error) {
self.errorEvent.emit(self, errors.ResponseAlreadyDone({
attempted: 'send error frame: ' + codeString + ': ' + message,
currentState: self.state,
method: 'sendError',
codeString: codeString,
errMessage: message
}));
} else {
if (self.span) {
self.span.annotate('ss');
}
self.state = States.Error;
self.codeString = codeString;
self.message = message;
self.channel.inboundCallsSystemErrorsStat.increment(1, {
'calling-service': self.inreq.headers.cn,
'service': self.inreq.serviceName,
'endpoint': String(self.inreq.arg1),
'type': self.codeString
});
self._sendError(codeString, message);
self.emitFinish();
}
};
TChannelOutResponse.prototype.emitFinish = function emitFinish() {
var self = this;
var now = self.timers.now();
if (self.end) {
self.logger.warn('out response double emitFinish', {
end: self.end,
now: now,
serviceName: self.inreq.serviceName,
cn: self.inreq.headers.cn,
endpoint: String(self.inreq.arg1),
codeString: self.codeString,
errorMessage: self.message,
remoteAddr: self.inreq.connection.socketRemoteAddr,
state: self.state,
isOk: self.ok
});
return;
}
self.end = now;
var latency = self.end - self.inreq.start;
self.channel.emitFastStat(self.channel.buildStat(
'tchannel.inbound.calls.latency',
'timing',
latency,
new stat.InboundCallsLatencyTags(
self.inreq.headers.cn,
self.inreq.serviceName,
self.inreq.endpoint
)
));
if (self.span) {
self.spanEvent.emit(self, self.span);
}
self.finishEvent.emit(self);
};
TChannelOutResponse.prototype.setOk = function setOk(ok) {
var self = this;
if (self.state !== States.Initial) {
self.errorEvent.emit(self, errors.ResponseAlreadyStarted({
state: self.state,
method: 'setOk',
ok: ok
}));
return false;
}
self.ok = ok;
self.code = ok ? 0 : 1; // TODO: too coupled to v2 specifics?
return true;
};
TChannelOutResponse.prototype.sendOk = function sendOk(res1, res2) {
var self = this;
self.setOk(true);
self.send(res1, res2);
};
TChannelOutResponse.prototype.sendNotOk = function sendNotOk(res1, res2) {
var self = this;
if (self.state === States.Error) {
self.logger.error('cannot send application error, already sent error frame', {
res1: res1,
res2: res2
});
} else {
self.setOk(false);
self.send(res1, res2);
}
};
TChannelOutResponse.prototype.send = function send(res1, res2) {
var self = this;
/* send calls after finish() should be swallowed */
if (self.end) {
var logOptions = {
serviceName: self.inreq.serviceName,
cn: self.inreq.headers.cn,
endpoint: self.inreq.endpoint,
remoteAddr: self.inreq.remoteAddr,
end: self.end,
codeString: self.codeString,
errorMessage: self.message,
isOk: self.ok,
hasResponse: !!self.arg3,
state: self.state
};
if (self.inreq && self.inreq.timedOut) {
self.logger.info('OutResponse.send() after inreq timed out', logOptions);
} else {
self.logger.warn('OutResponse called send() after end', logOptions);
}
return;
}
self.arg2 = res1;
self.arg3 = res2;
if (self.ok) {
self.channel.emitFastStat(self.channel.buildStat(
'tchannel.inbound.calls.success',
'counter',
1,
new stat.InboundCallsSuccessTags(
self.inreq.headers.cn,
self.inreq.serviceName,
self.inreq.endpoint
)
));
} else {
// TODO: add outResponse.setErrorType()
self.channel.emitFastStat(self.channel.buildStat(
'tchannel.inbound.calls.app-errors',
'counter',
1,
new stat.InboundCallsAppErrorsTags(
self.inreq.headers.cn,
self.inreq.serviceName,
self.inreq.endpoint,
'unknown'
)
));
}
self.sendCallResponseFrame([self.arg1, res1, res2], true);
self.emitFinish();
return self;
};
module.exports = TChannelOutResponse;
| davewhat/tchannel | out_response.js | JavaScript | mit | 10,872 |
<div class="alert alert-{{$type}}">
<h1>{{$title}}</h1>
<p>{{$content}}</p>
</div>
| chromabits/illuminated | resources/views/alerts/alert.blade.php | PHP | mit | 92 |
using RedditSharp.Things;
using System.Threading.Tasks;
namespace RedditSharp
{
partial class Helpers
{
private const string GetThingUrl = "/api/info.json?id={0}";
/// <summary>
/// Get a <see cref="Thing"/> by full name.
/// </summary>
/// <param name="agent">IWebAgent to use to make request</param>
/// <param name="fullname">fullname including kind + underscore. EG ("t1_######")</param>
/// <returns></returns>
public static async Task<Thing> GetThingByFullnameAsync(IWebAgent agent, string fullname)
{
var json = await agent.Get(string.Format(GetThingUrl, fullname)).ConfigureAwait(false);
return Thing.Parse(agent, json["data"]["children"][0]);
}
}
}
| justcool393/RedditSharp-1 | RedditSharp/Helpers/Helpers.GetThingByFullnameAsync.cs | C# | mit | 779 |
#!/usr/bin/env node
/**
* Release this package.
*/
"use strict";
process.chdir(__dirname + '/..');
const apeTasking = require('ape-tasking'),
apeReleasing = require('ape-releasing');
apeTasking.runTasks('release', [
(callback) => {
apeReleasing.releasePackage({
beforeRelease: [
'./ci/build.js',
'./ci/test.js'
]
}, callback);
}
], true);
| ape-repo/ape-scraping | ci/release.js | JavaScript | mit | 430 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Jumbotron Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/static/static/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/static/static/css/jumbotron.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="/static/static/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="navbar-collapse collapse">
<form class="navbar-form navbar-right" role="form">
<div class="form-group">
<input type="text" placeholder="Email" class="form-control">
</div>
<div class="form-group">
<input type="password" placeholder="Password" class="form-control">
</div>
<button type="submit" class="btn btn-success">Sign in</button>
</form>
</div><!--/.navbar-collapse -->
</div>
</div>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-lg" role="button">Learn more »</a></p>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
{% if messages %}
<div class='row'>
<div class='col-xs-12'>
{% for message in messages %}
<p {% if message.tags %} class="{{ message.tags }}"{% endif %}>
{{ message }}
</p>
{% endfor %}
</div>
</div>
{% endif %}
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
{% block content %}{% endblock %}
</div>
</div>
<hr>
<footer>
<p>© Company 2014</p>
</footer>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/static/static/js/jquery.min.js"></script>
<script src="/static/static/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="/static/static/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
| KellyChan/python-examples | python/django/mvplanding/static/templates/base.html | HTML | mit | 5,212 |
@echo off
rem
rem ADOBE SYSTEMS INCORPORATED
rem Copyright 2007 Adobe Systems Incorporated
rem All Rights Reserved.
rem
rem NOTICE: Adobe permits you to use, modify, and distribute this file
rem in accordance with the terms of the license agreement accompanying it.
rem
rem
rem acompc.bat script for Windows.
rem This simply executes compc.exe in the same directory,
rem inserting the option +configname=air, which makes
rem compc.exe use air-config.xml instead of flex-config.xml.
rem On Unix, acompc is used instead.
rem
"%~dp0compc.exe" +configname=air %*
| ArcherSys/ArcherSys | drives/Flex/bin/acompc.bat | Batchfile | mit | 565 |
/*
Copyright 2016 The Kubernetes Authors.
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.
*/
package app
import (
"fmt"
"os"
"k8s.io/kubernetes/federation/pkg/kubefed"
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/logs"
"k8s.io/kubernetes/pkg/version"
_ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration
)
const hyperkubeImageName = "gcr.io/google_containers/hyperkube-amd64"
func Run() error {
logs.InitLogs()
defer logs.FlushLogs()
defaultImage := fmt.Sprintf("%s:%s", hyperkubeImageName, version.Get())
cmd := kubefed.NewKubeFedCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr, defaultImage)
return cmd.Execute()
}
| pragkent/aliyun-disk | vendor/k8s.io/kubernetes/federation/cmd/kubefed/app/kubefed.go | GO | mit | 1,274 |
import os, scrapy, argparse
from realclearpolitics.spiders.spider import RcpSpider
from scrapy.crawler import CrawlerProcess
parser = argparse.ArgumentParser('Scrap realclearpolitics polls data')
parser.add_argument('url', action="store")
parser.add_argument('--locale', action="store", default='')
parser.add_argument('--race', action="store", default='primary')
parser.add_argument('--csv', dest='to_csv', action='store_true')
parser.add_argument('--output', dest='output', action='store')
args = parser.parse_args()
url = args.url
extra_fields = { 'locale': args.locale, 'race': args.race }
if (args.to_csv):
if args.output is None:
filename = url.split('/')[-1].split('.')[0]
output = filename + ".csv"
print("No output file specified : using " + output)
else:
output = args.output
if not output.endswith(".csv"):
output = output + ".csv"
if os.path.isfile(output):
os.remove(output)
os.system("scrapy crawl realclearpoliticsSpider -a url="+url+" -o "+output)
else:
settings = {
'ITEM_PIPELINES' : {
'realclearpolitics.pipeline.PollPipeline': 300,
},
'LOG_LEVEL' : 'ERROR',
'DOWNLOAD_HANDLERS' : {'s3': None,}
}
process = CrawlerProcess(settings);
process.crawl(RcpSpider, url, extra_fields)
process.start()
| dpxxdp/berniemetrics | private/scrapers/realclearpolitics-scraper/scraper.py | Python | mit | 1,355 |
/*global d3 */
// asynchronously load data from the Lagotto API
queue()
.defer(d3.json, encodeURI("/api/agents/"))
.await(function(error, a) {
if (error) { return console.warn(error); }
agentsViz(a.agents);
});
// add data to page
function agentsViz(data) {
for (var i=0; i<data.length; i++) {
var agent = data[i];
// responses tab
d3.select("#response_count_" + agent.id)
.text(numberWithDelimiter(agent.responses.count));
d3.select("#average_count_" + agent.id)
.text(numberWithDelimiter(agent.responses.average));
}
}
| CrossRef/lagotto | app/assets/javascripts/agents/index.js | JavaScript | mit | 569 |
var test = require("tape").test
var level = require("level-test")()
var testdb = level("test-versionstream")
var version = require("../")
var db = version(testdb)
var lastVersion
test("stuff some datas", function (t) {
t.plan(2)
db.put("pet", "fluffy", {version: 0})
db.put("pet", "spot", {version: 1})
db.put("pet", "scratch", {version: 334})
db.put("watch", "calculator", {version: 11})
db.put("watch", "casio", {version: 14})
db.put("pet", "sparky", function (err, version) {
t.notOk(err, "no error")
t.ok(version > Date.now() - 1000, "Default version is a recent timestamp")
lastVersion = version
})
})
test("versionstream pets", function (t) {
t.plan(5)
var versions = []
db.createVersionStream("pet")
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [lastVersion, 334, 1, 0], "Versions came out in the correct order")
})
})
test("versionstream pets version no min", function (t) {
t.plan(2)
var versions = []
db.createVersionStream("pet", {maxVersion: 500, limit: 1})
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [334], "Versions came out in the correct order")
})
})
test("versionstream pets version reverse no min", function (t) {
t.plan(2)
var versions = []
db.createVersionStream("pet", {maxVersion: 500, limit: 1, reverse: true})
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [0], "Versions came out in the correct order")
})
})
test("versionstream pets version range no max", function (t) {
t.plan(2)
var versions = []
db.createVersionStream("pet", {minVersion: 10, limit: 1})
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [lastVersion], "Versions came out in the correct order")
})
})
test("versionstream pets version range", function (t) {
t.plan(2)
var versions = []
db.createVersionStream("pet", {minVersion: 10, maxVersion: 500, limit: 1})
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [334], "Versions came out in the correct order")
})
})
test("versionstream watches", function (t) {
t.plan(3)
var versions = []
db.createVersionStream("watch")
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [14, 11], "Versions came out in the correct order")
})
})
test("alias", function (t) {
var versions = []
db.versionStream("pet")
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [lastVersion, 334, 1, 0], "Versions came out in the correct order")
t.end()
})
})
| maxogden/level-version | test/versionstream.js | JavaScript | mit | 3,427 |
/*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2015 Scientific Computing and Imaging Institute,
University of Utah.
License for the specific language governing rights and limitations under
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.
*/
#ifndef MODULES_BASIC_PORTFEEDBACKTESTMODULES_H
#define MODULES_BASIC_PORTFEEDBACKTESTMODULES_H
#include <Dataflow/Network/Module.h>
#include <Modules/Basic/share.h>
namespace SCIRun {
namespace Modules {
namespace Basic {
class SCISHARE PortFeedbackSender : public SCIRun::Dataflow::Networks::Module,
public Has1InputPort<StringPortTag>,
public HasNoOutputPorts
{
public:
PortFeedbackSender();
virtual void execute() override;
virtual void setStateDefaults() override;
INPUT_PORT(0, Input, String);
MODULE_TRAITS_AND_INFO(NoAlgoOrUI)
};
class SCISHARE PortFeedbackReceiver : public SCIRun::Dataflow::Networks::Module,
public Has1OutputPort<StringPortTag>,
public HasNoInputPorts
{
public:
void processFeedback(const Core::Datatypes::ModuleFeedback& var);
PortFeedbackReceiver();
virtual void execute() override;
virtual void setStateDefaults() override;
OUTPUT_PORT(0, Output, String);
MODULE_TRAITS_AND_INFO(NoAlgoOrUI)
};
}}}
#endif
| jcollfont/SCIRun | src/Modules/Basic/PortFeedbackTestModules.h | C | mit | 2,350 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile Docs - Theming Pages</title>
<link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css" />
<link rel="stylesheet" href="../../_assets/css/jqm-docs.css"/>
<script src="../../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
<script src="../../../js/jquery.js"></script>
<script src="../../../docs/_assets/js/jqm-docs.js"></script>
<script src="../../../js/jquery.mobile.js"></script>
</head>
<body>
<div data-role="page" class="type-interior" data-theme="e">
<div data-role="header" data-theme="e">
<h1>Theming pages</h1>
<a href="../../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
<a href="../../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
</div><!-- /header -->
<div data-role="content">
<div class="content-primary">
<ul data-role="controlgroup" data-type="horizontal" class="localnav">
<li><a href="../pages-themes.html" data-role="button" data-transition="fade">Theme Overview</a></li>
<li><a href="theme-a.html" data-role="button" data-transition="fade">A </a></li>
<li><a href="theme-b.html" data-role="button" data-transition="fade">B </a></li>
<li><a href="theme-c.html" data-role="button" data-transition="fade">C </a></li>
<li><a href="theme-d.html" data-role="button" data-transition="fade">D </a></li>
<li><a href="theme-e.html" data-role="button" data-transition="fade" class="ui-btn-active">E </a></li>
</ul>
<h2>Theme E Sample Page</h2>
<p>This is an example of <code>data-theme="e"</code> applied to the same element as <code>data-role="page"</code>, showing how the theme is inherited by widgets throughout the page.</p>
<div data-role="fieldcontain">
<label for="name-a">Text Input:</label>
<input type="text" name="name" id="name-a" value="" />
</div>
<div data-role="fieldcontain">
<label for="switch-a">Flip switch:</label>
<select name="switch-a" id="switch-a" data-role="slider">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</div>
<div data-role="fieldcontain">
<label for="slider-a">Slider:</label>
<input type="range" name="slider" id="slider-a" value="0" min="0" max="100" />
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup" data-type="horizontal">
<legend>Font styling:</legend>
<input type="checkbox" name="checkbox-6a" id="checkbox-6a" class="custom" />
<label for="checkbox-6a">b</label>
<input type="checkbox" name="checkbox-7a" id="checkbox-7a" class="custom" />
<label for="checkbox-7a"><em>i</em></label>
<input type="checkbox" name="checkbox-8a" id="checkbox-8a" class="custom" />
<label for="checkbox-8a">u</label>
</fieldset>
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Choose a pet:</legend>
<input type="radio" name="radio-choice-1" id="radio-choice-1a" value="choice-1" />
<label for="radio-choice-1a">Cat</label>
<input type="radio" name="radio-choice-1" id="radio-choice-2a" value="choice-2" />
<label for="radio-choice-2a">Dog</label>
<input type="radio" name="radio-choice-1" id="radio-choice-3a" value="choice-3" />
<label for="radio-choice-3a">Hamster</label>
<input type="radio" name="radio-choice-1" id="radio-choice-4a" value="choice-4" />
<label for="radio-choice-4a">Lizard</label>
</fieldset>
</div>
<div data-role="fieldcontain">
<label for="select-choice-a" class="select">Choose shipping method:</label>
<select name="select-choice-a" id="select-choice-a">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
<h2>Collapsible Sets</h2>
<div data-role="collapsible-set">
<div data-role="collapsible" data-collapsed="false">
<h3>Section 1</h3>
<p>I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the <code>data-collapsed="false"</code> attribute; to collapse me, either click my header or expand another header in my set.</p>
</div>
<div data-role="collapsible">
<h3>Section 2</h3>
<p>I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.</p>
</div>
<div data-role="collapsible">
<h3>Section 3</h3>
<p>I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.</p>
</div>
</div>
<h2>Inset List</h2>
<ul data-role="listview" data-inset="true">
<li><a href="index.html">Inbox <span class="ui-li-count" >12</span></a></li>
<li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
<li><a href="index.html">Drafts <span class="ui-li-count">4</span></a></li>
<li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
<li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
</ul>
</div><!--/content-primary -->
<div class="content-secondary">
<div data-role="collapsible" data-collapsed="true" data-theme="e" data-content-theme="e">
<h3>More in this section</h3>
<ul data-role="listview" data-theme="e" data-dividertheme="e">
<li data-role="list-divider">Pages & Dialogs</li>
<li><a href="../../page-anatomy.html">Anatomy of a page</a></li>
<li><a href="../../page-template.html" data-ajax="false">Single page template</a></li>
<li><a href="../../multipage-template.html" data-ajax="false">Multi-page template</a></li>
<li><a href="../../page-titles.html">Page titles</a></li>
<li><a href="../../page-links.html">Linking pages</a></li>
<li><a href="../../page-transitions.html" data-ajax="false">Page transitions</a></li>
<li><a href="../../page-dialogs.html">Dialogs</a></li>
<li><a href="../../page-cache.html">Prefetching & caching pages</a></li>
<li><a href="../../page-navmodel.html">Ajax, hashes & history</a></li>
<li><a href="../../page-dynamic.html">Dynamically Injecting Pages</a></li>
<li><a href="../../page-scripting.html">Scripting pages</a></li>
<li data-theme="a"><a href="../../pages-themes.html">Theming pages</a></li>
</ul>
</div>
</div>
</div><!-- /content -->
<div data-role="footer" class="footer-docs" data-theme="e">
<p>© 2011-12 The jQuery Foundation</p>
</div>
</div><!-- /page -->
</body>
</html>
| c9s/WireRoom | public/js/jquery.mobile-1.1.0/demos/docs/pages/pages-themes/theme-e.html | HTML | mit | 7,310 |
describe 'font' do
before do
@rmq = RubyMotionQuery::RMQ
end
it 'should return font from RMQ or an instance of rmq' do
@rmq.font.should == RubyMotionQuery::Font
rmq = RubyMotionQuery::RMQ.new
rmq.font.should == RubyMotionQuery::Font
end
it 'should return a list of font families' do
@rmq.font.family_list.grep(/Helvetica/).length.should > 0
end
it 'should return a list of fonts for one family' do
@rmq.font.for_family('Arial').grep(/Arial/).length.should > 0
end
it 'should return a system font given a size' do
@rmq.font.system(11).is_a?(UIFont).should == true
end
it 'should return a system font with system default font size' do
@rmq.font.system.pointSize.should == UIFont.systemFontSize
end
it 'should return font with name' do
@rmq.font.with_name('American Typewriter', 11).is_a?(UIFont).should == true
end
it "should return fonts that have been named" do
@rmq.font.add_named('awesome_font', 'American Typewriter', 12)
@rmq.font.awesome_font.is_a?(UIFont).should.be.true
end
end
| infinitered/rmq | spec/font.rb | Ruby | mit | 1,069 |
/*================================================================================
code generated by: java2cpp
author: Zoran Angelov, mailto://baldzar@gmail.com
class: java.io.WriteAbortedException
================================================================================*/
#ifndef J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_JAVA_IO_WRITEABORTEDEXCEPTION_HPP_DECL
#define J2CPP_JAVA_IO_WRITEABORTEDEXCEPTION_HPP_DECL
namespace j2cpp { namespace java { namespace lang { class Exception; } } }
namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace java { namespace lang { class Throwable; } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace io { class IOException; } } }
namespace j2cpp { namespace java { namespace io { class Serializable; } } }
namespace j2cpp { namespace java { namespace io { class ObjectStreamException; } } }
#include <java/io/IOException.hpp>
#include <java/io/ObjectStreamException.hpp>
#include <java/io/Serializable.hpp>
#include <java/lang/Exception.hpp>
#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>
#include <java/lang/Throwable.hpp>
namespace j2cpp {
namespace java { namespace io {
class WriteAbortedException;
class WriteAbortedException
: public object<WriteAbortedException>
{
public:
J2CPP_DECLARE_CLASS
J2CPP_DECLARE_METHOD(0)
J2CPP_DECLARE_METHOD(1)
J2CPP_DECLARE_METHOD(2)
J2CPP_DECLARE_FIELD(0)
explicit WriteAbortedException(jobject jobj)
: object<WriteAbortedException>(jobj)
, detail(jobj)
{
}
operator local_ref<java::lang::Exception>() const;
operator local_ref<java::lang::Throwable>() const;
operator local_ref<java::lang::Object>() const;
operator local_ref<java::io::IOException>() const;
operator local_ref<java::io::Serializable>() const;
operator local_ref<java::io::ObjectStreamException>() const;
WriteAbortedException(local_ref< java::lang::String > const&, local_ref< java::lang::Exception > const&);
local_ref< java::lang::String > getMessage();
local_ref< java::lang::Throwable > getCause();
field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(0), J2CPP_FIELD_SIGNATURE(0), local_ref< java::lang::Exception > > detail;
}; //class WriteAbortedException
} //namespace io
} //namespace java
} //namespace j2cpp
#endif //J2CPP_JAVA_IO_WRITEABORTEDEXCEPTION_HPP_DECL
#else //J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_JAVA_IO_WRITEABORTEDEXCEPTION_HPP_IMPL
#define J2CPP_JAVA_IO_WRITEABORTEDEXCEPTION_HPP_IMPL
namespace j2cpp {
java::io::WriteAbortedException::operator local_ref<java::lang::Exception>() const
{
return local_ref<java::lang::Exception>(get_jobject());
}
java::io::WriteAbortedException::operator local_ref<java::lang::Throwable>() const
{
return local_ref<java::lang::Throwable>(get_jobject());
}
java::io::WriteAbortedException::operator local_ref<java::lang::Object>() const
{
return local_ref<java::lang::Object>(get_jobject());
}
java::io::WriteAbortedException::operator local_ref<java::io::IOException>() const
{
return local_ref<java::io::IOException>(get_jobject());
}
java::io::WriteAbortedException::operator local_ref<java::io::Serializable>() const
{
return local_ref<java::io::Serializable>(get_jobject());
}
java::io::WriteAbortedException::operator local_ref<java::io::ObjectStreamException>() const
{
return local_ref<java::io::ObjectStreamException>(get_jobject());
}
java::io::WriteAbortedException::WriteAbortedException(local_ref< java::lang::String > const &a0, local_ref< java::lang::Exception > const &a1)
: object<java::io::WriteAbortedException>(
call_new_object<
java::io::WriteAbortedException::J2CPP_CLASS_NAME,
java::io::WriteAbortedException::J2CPP_METHOD_NAME(0),
java::io::WriteAbortedException::J2CPP_METHOD_SIGNATURE(0)
>(a0, a1)
)
, detail(get_jobject())
{
}
local_ref< java::lang::String > java::io::WriteAbortedException::getMessage()
{
return call_method<
java::io::WriteAbortedException::J2CPP_CLASS_NAME,
java::io::WriteAbortedException::J2CPP_METHOD_NAME(1),
java::io::WriteAbortedException::J2CPP_METHOD_SIGNATURE(1),
local_ref< java::lang::String >
>(get_jobject());
}
local_ref< java::lang::Throwable > java::io::WriteAbortedException::getCause()
{
return call_method<
java::io::WriteAbortedException::J2CPP_CLASS_NAME,
java::io::WriteAbortedException::J2CPP_METHOD_NAME(2),
java::io::WriteAbortedException::J2CPP_METHOD_SIGNATURE(2),
local_ref< java::lang::Throwable >
>(get_jobject());
}
J2CPP_DEFINE_CLASS(java::io::WriteAbortedException,"java/io/WriteAbortedException")
J2CPP_DEFINE_METHOD(java::io::WriteAbortedException,0,"<init>","(Ljava/lang/String;Ljava/lang/Exception;)V")
J2CPP_DEFINE_METHOD(java::io::WriteAbortedException,1,"getMessage","()Ljava/lang/String;")
J2CPP_DEFINE_METHOD(java::io::WriteAbortedException,2,"getCause","()Ljava/lang/Throwable;")
J2CPP_DEFINE_FIELD(java::io::WriteAbortedException,0,"detail","Ljava/lang/Exception;")
} //namespace j2cpp
#endif //J2CPP_JAVA_IO_WRITEABORTEDEXCEPTION_HPP_IMPL
#endif //J2CPP_INCLUDE_IMPLEMENTATION
| hyEvans/ph-open | proj.android/jni/puzzleHero/platforms/android-9/java/io/WriteAbortedException.hpp | C++ | mit | 5,303 |
<?php
namespace Concrete\Tests\Core\File;
use Concrete\Core\File\Importer;
use Concrete\Core\Attribute\Type as AttributeType;
use Concrete\Core\Attribute\Key\FileKey;
use Concrete\Core\Attribute\Key\Category;
class FileListTest extends \FileStorageTestCase
{
/** @var \Concrete\Core\File\FileList */
protected $list;
protected function setUp()
{
$this->tables = array_merge($this->tables, array(
'Users',
'PermissionAccessEntityTypes',
'FileAttributeValues',
'FileImageThumbnailTypes',
'ConfigStore',
'FileSets',
'FileVersionLog',
'FileSetFiles',
));
$this->metadatas = array_merge($this->metadatas, array(
'Concrete\Core\Entity\Attribute\Key\Type\NumberType',
'Concrete\Core\Entity\Attribute\Key\Type\Type',
'Concrete\Core\Entity\Attribute\Key\FileKey',
'Concrete\Core\Entity\Attribute\Value\FileValue',
'Concrete\Core\Entity\Attribute\Key\Key',
'Concrete\Core\Entity\Attribute\Value\Value',
'Concrete\Core\Entity\Attribute\Value\Value\NumberValue',
'Concrete\Core\Entity\Attribute\Value\Value\Value',
'Concrete\Core\Entity\Attribute\Type',
'Concrete\Core\Entity\Attribute\Category',
));
parent::setUp();
\Config::set('concrete.upload.extensions', '*.txt;*.jpg;*.jpeg;*.png');
Category::add('file');
\Concrete\Core\Permission\Access\Entity\Type::add('file_uploader', 'File Uploader');
$number = AttributeType::add('number', 'Number');
FileKey::add($number, array('akHandle' => 'width', 'akName' => 'Width'));
FileKey::add($number, array('akHandle' => 'height', 'akName' => 'Height'));
mkdir($this->getStorageDirectory());
$this->getStorageLocation();
$sample = dirname(__FILE__) . '/StorageLocation/fixtures/sample.txt';
$image = DIR_BASE . '/concrete/images/logo.png';
$fi = new Importer();
$files = array(
'sample1.txt' => $sample,
'sample2.txt' => $sample,
'sample4.txt' => $sample,
'sample5.txt' => $sample,
'awesome.txt' => $sample,
'testing.txt' => $sample,
'logo1.png' => $image,
'logo2.png' => $image,
'logo3.png' => $image,
'foobley.png' => $image,
'test.png' => $image,
);
foreach ($files as $filename => $pointer) {
$fi->import($pointer, $filename);
}
$this->list = new \Concrete\Core\File\FileList();
$this->list->ignorePermissions();
}
protected function cleanup()
{
parent::cleanup();
if (file_exists(dirname(__FILE__) . '/test.txt')) {
unlink(dirname(__FILE__) . '/test.txt');
}
if (file_exists(dirname(__FILE__) . '/test.invalid')) {
unlink(dirname(__FILE__) . '/test.invalid');
}
}
public function testGetPaginationObject()
{
$pagination = $this->list->getPagination();
$this->assertInstanceOf('\Concrete\Core\Search\Pagination\Pagination', $pagination);
}
public function testGetUnfilteredTotal()
{
$this->assertEquals(11, $this->list->getTotalResults());
}
public function testGetUnfilteredTotalFromPagination()
{
$pagination = $this->list->getPagination();
$this->assertEquals(11, $pagination->getTotalResults());
}
public function testFilterByTypeValid1()
{
$this->list->filterByType(\Concrete\Core\File\Type\Type::T_IMAGE);
$this->assertEquals(5, $this->list->getTotalResults());
$pagination = $this->list->getPagination();
$this->assertEquals(5, $pagination->getTotalResults());
$pagination->setMaxPerPage(3)->setCurrentPage(1);
$results = $pagination->getCurrentPageResults();
$this->assertEquals(3, count($results));
$this->assertInstanceOf('\Concrete\Core\Entity\File\File', $results[0]);
}
public function testFilterByExtensionAndType()
{
$this->list->filterByType(\Concrete\Core\File\Type\Type::T_TEXT);
$this->list->filterByExtension('txt');
$this->assertEquals(6, $this->list->getTotalResults());
}
public function testFilterByKeywords()
{
$this->list->filterByKeywords('le');
$pagination = $this->list->getPagination();
$this->assertEquals(5, $pagination->getTotalResults());
}
public function testFilterBySet()
{
$fs = \FileSet::add('test');
$f = \File::getByID(1);
$f2 = \File::getByID(4);
$fs->addFileToSet($f);
$fs->addFileToSet($f2);
$fs2 = \FileSet::add('test2');
$fs2->addFiletoSet($f);
$this->list->filterBySet($fs);
$pagination = $this->list->getPagination();
$this->assertEquals(2, $pagination->getTotalResults());
$results = $this->list->getResults();
$this->assertEquals(2, count($results));
$this->assertEquals(4, $results[1]->getFileID());
$this->list->filterBySet($fs2);
$results = $this->list->getResults();
$this->assertEquals(1, count($results));
$this->assertEquals(1, $results[0]->getFileID());
$nl = new \Concrete\Core\File\FileList();
$nl->ignorePermissions();
$nl->filterByNoSet();
$results = $nl->getResults();
$this->assertEquals(9, count($results));
}
public function testSortByFilename()
{
$this->list->sortByFilenameAscending();
$pagination = $this->list->getPagination();
$pagination->setMaxPerPage(2);
$results = $pagination->getCurrentPageResults();
$this->assertEquals(2, count($results));
$this->assertEquals(5, $results[0]->getFileID());
}
public function testAutoSort()
{
$req = \Request::getInstance();
$req->query->set($this->list->getQuerySortColumnParameter(), 'fv.fvFilename');
$req->query->set($this->list->getQuerySortDirectionParameter(), 'desc');
$nl = new \Concrete\Core\File\FileList();
$nl->ignorePermissions();
$results = $nl->getResults();
$this->assertEquals(6, $results[0]->getFileID());
$this->assertEquals('testing.txt', $results[0]->getFilename());
$req->query->set($this->list->getQuerySortColumnParameter(), null);
$req->query->set($this->list->getQuerySortDirectionParameter(), null);
}
public function testPaginationPagesWithoutPermissions()
{
$pagination = $this->list->getPagination();
$pagination->setMaxPerPage(2)->setCurrentPage(1);
$this->assertEquals(6, $pagination->getTotalPages());
$this->list->filterByType(\Concrete\Core\File\Type\Type::T_IMAGE);
$pagination = $this->list->getPagination();
$this->assertEquals(5, $pagination->getTotalResults());
$pagination->setMaxPerPage(2)->setCurrentPage(2);
$this->assertEquals(3, $pagination->getTotalPages());
$this->assertTrue($pagination->hasNextPage());
$this->assertTrue($pagination->hasPreviousPage());
$pagination->setCurrentPage(1);
$this->assertTrue($pagination->hasNextPage());
$this->assertFalse($pagination->hasPreviousPage());
$pagination->setCurrentPage(3);
$this->assertFalse($pagination->hasNextPage());
$this->assertTrue($pagination->hasPreviousPage());
$results = $pagination->getCurrentPageResults();
$this->assertInstanceOf('\Concrete\Core\Entity\File\File', $results[0]);
$this->assertEquals(1, count($results[0]));
}
public function testPaginationWithPermissions()
{
// first lets make some more files.
$sample = dirname(__FILE__) . '/StorageLocation/fixtures/sample.txt';
$image = DIR_BASE . '/concrete/images/logo.png';
$fi = new Importer();
$files = array(
'another.txt' => $sample,
'funtime.txt' => $sample,
'funtime2.txt' => $sample,
'awesome-o' => $sample,
'image.png' => $image,
);
foreach ($files as $filename => $pointer) {
$fi->import($pointer, $filename);
}
$nl = new \Concrete\Core\File\FileList();
$nl->setPermissionsChecker(function ($file) {
if ($file->getTypeObject()->getGenericType() == \Concrete\Core\File\Type\Type::T_IMAGE) {
return true;
} else {
return false;
}
});
$nl->sortByFilenameAscending();
$results = $nl->getResults();
$pagination = $nl->getPagination();
$this->assertEquals(-1, $nl->getTotalResults());
$this->assertEquals(6, $pagination->getTotalResults());
$this->assertEquals(6, count($results));
// so there are six "real" results, and 15 total results without filtering.
$pagination->setMaxPerPage(4)->setCurrentPage(1);
$this->assertEquals(2, $pagination->getTotalPages());
$this->assertTrue($pagination->hasNextPage());
$this->assertFalse($pagination->hasPreviousPage());
// Ok, so the results ought to be the following files, broken up into pages of four, in this order:
// foobley.png
// image.png
// logo1.png
// logo2.png
// -- page break --
// logo3.png
// test.png
$results = $pagination->getCurrentPageResults();
$this->assertInstanceOf('\Concrete\Core\Search\Pagination\PermissionablePagination', $pagination);
$this->assertEquals(4, count($results));
$this->assertEquals('foobley.png', $results[0]->getFilename());
$this->assertEquals('image.png', $results[1]->getFilename());
$this->assertEquals('logo1.png', $results[2]->getFilename());
$this->assertEquals('logo2.png', $results[3]->getFilename());
$pagination->setCurrentPage(2);
$results = $pagination->getCurrentPageResults();
$this->assertEquals('logo3.png', $results[0]->getFilename());
$this->assertEquals('test.png', $results[1]->getFilename());
$this->assertEquals(2, count($results));
$this->assertTrue($pagination->hasPreviousPage());
$this->assertFalse($pagination->hasNextPage());
}
public function testFileSearchDefaultColumnSet()
{
$set = \Concrete\Core\File\Search\ColumnSet\ColumnSet::getCurrent();
$this->assertInstanceOf('\Concrete\Core\File\Search\ColumnSet\DefaultSet', $set);
$columns = $set->getColumns();
$this->assertEquals(4, count($columns));
}
}
| MichaelMaar/concrete5 | tests/tests/Core/File/FileListTest.php | PHP | mit | 10,797 |
package com.tale.model;
import com.blade.jdbc.annotation.Table;
import java.io.Serializable;
//
@Table(name = "t_comments", pk = "coid")
public class Comments implements Serializable {
private static final long serialVersionUID = 1L;
// comment表主键
private Integer coid;
// post表主键,关联字段
private Integer cid;
// 评论生成时的GMT unix时间戳
private Integer created;
// 评论作者
private String author;
// 评论所属用户id
private Integer author_id;
// 评论所属内容作者id
private Integer owner_id;
// 评论者邮件
private String mail;
// 评论者网址
private String url;
// 评论者ip地址
private String ip;
// 评论者客户端
private String agent;
// 评论内容
private String content;
// 评论类型
private String type;
// 评论状态
private String status;
// 父级评论
private Integer parent;
public Comments() {
}
public Integer getCoid() {
return coid;
}
public void setCoid(Integer coid) {
this.coid = coid;
}
public Integer getCid() {
return cid;
}
public void setCid(Integer cid) {
this.cid = cid;
}
public Integer getCreated() {
return created;
}
public void setCreated(Integer created) {
this.created = created;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getAgent() {
return agent;
}
public void setAgent(String agent) {
this.agent = agent;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getParent() {
return parent;
}
public void setParent(Integer parent) {
this.parent = parent;
}
public Integer getAuthor_id() {
return author_id;
}
public void setAuthor_id(Integer author_id) {
this.author_id = author_id;
}
public Integer getOwner_id() {
return owner_id;
}
public void setOwner_id(Integer owner_id) {
this.owner_id = owner_id;
}
} | sanmubird/yuanjihua_blog | src/main/java/com/tale/model/Comments.java | Java | mit | 2,962 |
---
title: பாபிலோனின் விழுகை
date: 06/02/2020
---
`கேள்வி: கடைசிக்கால பாபிலோனின் விழுகைக்கு அடையாளமாக இருக்கும் பெல்ஷாத் சாருடைய பாபிலோனின் விழுகைபற்றி நாம் என்ன கற்றுக்கொள்ள முடிகிறது? தானி 5:29-31; வெளி 14:8; 16:19; 18:2.`
எவ்வளவுதான் குறைகள் இருந்தாலும் பெல்ஷாத்சார் வாக்குத் தவறவில்லை. தானியேல் சொன்ன விளக்கம் கெட்ட செய்தியாக இருந் தாலும்கூட விளக்கத்தை ஏற்றுக்கொண்டான். தான் உறுதியளித்தபடி தீர்க்கதரிசிக்கு பரிசுகளை வழங்குகிறான். தானியேலுடைய செய்தி உண்மை என்பதைஅவன் உணர்ந்த செயலானது, தானியேலுடைய தேவன் உண்மையானவரென அவன் உணர்ந்ததை எடுத்துக்காட்டியது. முன்பு பரிசுகளை மறுத்த தானியேலும்கூட இப்போது ஏற்றுக்கொள் கிறான். விளக்கம்சொல்வதற்கு இனி அவை தடையாக இருக்காது என்பதும் காரணமாக இருக்கலாம். ஆனால் அந்தச் சூழ்நிலையில் அந்தப் பரிசுகளால் பயனில்லை; சாம்ராஜ்யம் விழ இருந்தது. அப்படி யிருந்தாலும் ஒரு மனிதாபிமானத்திற்காக, தீர்க்கதரிசி அந்தப் பரிசை ஏற்றுக்கொள்கிறான்; ஒரு சில மணி நேரங்களே ராஜ்யத்திற்கு தான் மூன்றாம் அதிபதியாக இருக்கப்போவதையும் அறிந்திருந்தான்.
தீர்க்கதரிசி சொன்னபடி பாபிலோன் விழுகிறது. ராஜாவும் அவ னுடைய அரசவையினரும் குடித்து வெறித்திருந்த நிலையில், சண்டை யில்லாமல் சடிதியில் பாபிலோன் விழுகிறது. பெர்சியர்கள் கால்வாய் ஒன்றை வெட்டி, ஐபிராத்தைத் திருப்பிவிட்டு, அந்த ஆற்றுப்படுகை வழியாக நகரத்திற்குள் அணிவகுத்துச் சென்றதாக ஹெரோடாடஸ் எனும் வரலாற்றாசிரியர் எழுதுகிறார். அன்று இராத்திரியில் பெல்ஷாத் சார் கொல்லப்பட்டான். அவனுடைய அப்பா நபோனிடஸ் ஏற்கனவே நகரத்தை விட்டு ஓடியிருந்தான்; பின்னர் புதிய ஆட்சியாளர்களிடம் சரணடைந்தான். எனவே வரலாற்றிலேயே மிகப்பெரிதான சாம் ராஜ்யம் விழுந்தது.; பொன்னான தலையாகிய பாபிலோன் முடிந்தது.
‘தேவனை அறிந்து, அவருடைய சித்தப்படி செய்ய பெல்ஷாத் சாருக்கு பல வாய்ப்புகள் கொடுக்கப்பட்டன. தன்னுடைய தாத்தா நேபு காத்நேச்சார் மனிதர்களிடமிருந்து தள்ளப்பட்டதைக் கண்டிருந்தான். அரசன் அகந்தையோடு தன் அறிவை குறித்து பெருமைபாராட்டியபோது அதைக் கொடுத்தவர் அதை எடுத்ததையும் பார்த்திருந்தான். ராஜா ராஜ் யத்திலிருந்து துரத்தப்பட்டு, வெளியின் மிருகங்களோடு சஞ்சரிக்க விடப்பட்டதையும் கண்டிருந்தான். அந்தப் பாடங்களை அவன் மறந் திருக்கக் கூடாது; ஆனால் கேளிக்கையும் சுயமகிமையும் மறக்கச்செய் தன. நேபுகாத்நேச்சார்மேல் நியாயத்தீர்ப்பைக் கொண்டுவந்த அதே பாவங்களைச் செய்தான். கிருபையாகக் கொடுக்கப்பட்ட தருணங் களை வீணாக்கினான்; சத்தியத்தை அறியும்படி கொடுக்கப்பட்ட வாய்பப்புகளைப் புறக்கணித்தான்.’ - BE, Apr 25, 1898.
`‘சத்தியத்தை அறிந்துகொள்ள’ என்னென்ன வாய்ப்புகள் கொடுக்கப்பட்டுள்ளன? அறிந்து கொள்ளவேண்டிய அனைத்து சத்தியங்களையும் அறிந்ததாக எப்போது சொல்லமுடியும்?` | PrJared/sabbath-school-lessons | src/ta/2020-01/06/06.md | Markdown | mit | 6,399 |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template as_feature<tag::weighted_tail_variate_means< LeftRight, VariateType, VariateTag >(absolute)></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="Chapter 1. Boost.Accumulators">
<link rel="up" href="../../statistics_library_reference.html#header.boost.accumulators.statistics.weighted_tail_variate_means_hpp" title="Header <boost/accumulators/statistics/weighted_tail_variate_means.hpp>">
<link rel="prev" href="tag/relative_weigh_idp19953936.html" title="Struct template relative_weighted_tail_variate_means">
<link rel="next" href="as_feature_tag_idp19898304.html" title="Struct template as_feature<tag::weighted_tail_variate_means< LeftRight, VariateType, VariateTag >(relative)>">
</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="tag/relative_weigh_idp19953936.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../statistics_library_reference.html#header.boost.accumulators.statistics.weighted_tail_variate_means_hpp"><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="as_feature_tag_idp19898304.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.accumulators.as_feature_tag_idp19893728"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template as_feature<tag::weighted_tail_variate_means< LeftRight, VariateType, VariateTag >(absolute)></span></h2>
<p>boost::accumulators::as_feature<tag::weighted_tail_variate_means< LeftRight, VariateType, VariateTag >(absolute)></p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../statistics_library_reference.html#header.boost.accumulators.statistics.weighted_tail_variate_means_hpp" title="Header <boost/accumulators/statistics/weighted_tail_variate_means.hpp>">boost/accumulators/statistics/weighted_tail_variate_means.hpp</a>>
</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> LeftRight<span class="special">,</span> <span class="keyword">typename</span> VariateType<span class="special">,</span> <span class="keyword">typename</span> VariateTag<span class="special">></span>
<span class="keyword">struct</span> <a class="link" href="as_feature_tag_idp19893728.html" title="Struct template as_feature<tag::weighted_tail_variate_means< LeftRight, VariateType, VariateTag >(absolute)>">as_feature</a><span class="special"><</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">weighted_tail_variate_means</span><span class="special"><</span> <span class="identifier">LeftRight</span><span class="special">,</span> <span class="identifier">VariateType</span><span class="special">,</span> <span class="identifier">VariateTag</span> <span class="special">></span><span class="special">(</span><span class="identifier">absolute</span><span class="special">)</span><span class="special">></span> <span class="special">{</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <a class="link" href="tag/absolute_weigh_idp19949216.html" title="Struct template absolute_weighted_tail_variate_means">tag::absolute_weighted_tail_variate_means</a><span class="special"><</span> <span class="identifier">LeftRight</span><span class="special">,</span> <span class="identifier">VariateType</span><span class="special">,</span> <span class="identifier">VariateTag</span> <span class="special">></span> <a name="boost.accumulators.as_feature_tag_idp19893728.type"></a><span class="identifier">type</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></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 © 2005, 2006 Eric Niebler<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="tag/relative_weigh_idp19953936.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../statistics_library_reference.html#header.boost.accumulators.statistics.weighted_tail_variate_means_hpp"><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="as_feature_tag_idp19898304.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| yinchunlong/abelkhan-1 | ext/c++/thirdpart/c++/boost/libs/accumulators/doc/html/boost/accumulators/as_feature_tag_idp19893728.html | HTML | mit | 6,168 |
"use strict";
const lua = require("../src/lua.js");
const lauxlib = require("../src/lauxlib.js");
const {to_luastring} = require("../src/fengaricore.js");
const toByteCode = function(luaCode) {
let L = lauxlib.luaL_newstate();
if (!L) throw Error("failed to create lua state");
if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) !== lua.LUA_OK)
throw Error(lua.lua_tojsstring(L, -1));
let b = [];
if (lua.lua_dump(L, function(L, b, size, B) {
B.push(...b.slice(0, size));
return 0;
}, b, false) !== 0)
throw Error("unable to dump given function");
return Uint8Array.from(b);
};
module.exports.toByteCode = toByteCode;
| daurnimator/fengari | test/tests.js | JavaScript | mit | 690 |
<!doctype html>
<html>
<head>
<title>ATS-Queen-Puzzle</title>
<style>
#canvas-container
{
margin: 0 auto; width: 920px; height: auto;
}
</style>
<script
src="https://cdn.jsdelivr.net/jquery/2.1.1/jquery.min.js">
</script>
<script
src="https://ats-lang.github.io/LIBRARY/libatscc2js/ATS2-0.3.2/libatscc2js_all.js">
</script>
</head>
<body>
<h1>ATS->C->JS via atscc2js</h1>
<div id="canvas-container">
<canvas
id="Patsoptaas-Evaluate-canvas"
width="920px" height="600px"
oncontextmenu="event.preventDefault()">
It seems that canvas is not supported by your browser!
</canvas>
</div>
<!--
HX-2014-11: it must be the last one!
-->
<script src="./Queen_puzzle_php_dats.js"></script>
</body>
</html>
| bbarker/ATS-Postiats-contrib | projects/SMALL/JSmydraw/Queen_puzzle/Queen_puzzle.html | HTML | mit | 702 |
require 'active_support/inflector'
module Trello
class BasicData
include ActiveModel::Validations
include ActiveModel::Dirty
include ActiveModel::Serializers::JSON
include Trello::JsonUtils
class << self
def path_name
name.split("::").last.underscore
end
def find(id, params = {})
client.find(path_name, id, params)
end
def create(options)
client.create(path_name, options)
end
def save(options)
new(options).tap do |basic_data|
yield basic_data if block_given?
end.save
end
def parse(response)
from_response(response).tap do |basic_data|
yield basic_data if block_given?
end
end
def parse_many(response)
from_response(response).map do |data|
data.tap do |d|
yield d if block_given?
end
end
end
end
def self.register_attributes(*names)
options = { readonly: [] }
options.merge!(names.pop) if names.last.kind_of? Hash
# Defines the attribute getter and setters.
class_eval do
define_method :attributes do
@attributes ||= names.reduce({}) { |hash, k| hash.merge(k.to_sym => nil) }
end
names.each do |key|
define_method(:"#{key}") { @attributes[key] }
unless options[:readonly].include?(key.to_sym)
define_method :"#{key}=" do |val|
send(:"#{key}_will_change!") unless val == @attributes[key]
@attributes[key] = val
end
end
end
define_attribute_methods names
end
end
def self.one(name, opts = {})
class_eval do
define_method(:"#{name}") do |*args|
options = opts.dup
klass = options.delete(:via) || Trello.const_get(name.to_s.camelize)
ident = options.delete(:using) || :id
path = options.delete(:path)
if path
client.find(path, self.send(ident))
else
klass.find(self.send(ident))
end
end
end
end
def self.many(name, opts = {})
class_eval do
define_method(:"#{name}") do |*args|
options = opts.dup
resource = options.delete(:in) || self.class.to_s.split("::").last.downcase.pluralize
klass = options.delete(:via) || Trello.const_get(name.to_s.singularize.camelize)
params = options.merge(args[0] || {})
resources = client.find_many(klass, "/#{resource}/#{id}/#{name}", params)
MultiAssociation.new(self, resources).proxy
end
end
end
def self.client
Trello.client
end
register_attributes :id, readonly: [ :id ]
attr_writer :client
def initialize(fields = {})
update_fields(fields)
end
def update_fields(fields)
raise NotImplementedError, "#{self.class} does not implement update_fields."
end
# Refresh the contents of our object.
def refresh!
self.class.find(id)
end
# Two objects are equal if their _id_ methods are equal.
def ==(other)
id == other.id
end
def client
@client ||= self.class.client
end
end
end
| brycemcd/ruby-trello | lib/trello/basic_data.rb | Ruby | mit | 3,268 |
/**
* Copyright 2015 Telerik AD
*
* 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.
*/
/* Common Platform CSS */
@-ms-viewport {
width: device-width;
user-zoom: fixed;
max-zoom: 1;
min-zoom: 1;
}
@media (orientation: landscape) {
.km-tablet .km-on-ios.km-horizontal.km-web:not(.km-ios-chrome) {
position: fixed;
bottom: 0;
}
}
.km-root {
font-size: .92em;
}
.km-root.km-retina input,
.km-root.km-retina select,
.km-root.km-retina textarea {
font-size: 1em;
}
.km-root a {
color: inherit;
}
.km-tablet {
font-size: 1em;
}
.km-root *:focus {
outline-width: 0;
}
.km-root,
.km-pane,
.km-pane-wrapper {
width: 100%;
height: 100%;
-ms-touch-action: none;
-ms-content-zooming: none;
-ms-user-select: none;
-webkit-user-select: none;
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
text-size-adjust: none;
overflow-x: hidden;
}
.km-pane-wrapper {
position: absolute;
}
.km-pane,
.km-shim {
font-family: sans-serif;
}
.km-pane {
overflow-x: hidden;
position: relative;
}
.km-vertical .km-collapsible-pane {
position: absolute;
z-index: 2 !important;
-webkit-transition: -webkit-transform 350ms ease-out;
-ms-transition: -ms-transform 350ms ease-out;
-o-transition: -o-transform 350ms ease-out;
transition: transform 350ms ease-out;
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.km-vertical .km-expanded-splitview .km-collapsible-pane {
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.km-expanded-pane-shim {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
display: none;
}
.km-expanded-splitview .km-expanded-pane-shim {
display: block;
z-index: 1;
}
.km-root > * {
margin: 0;
padding: 0;
}
.km-root * {
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.km-content {
display: block;
}
.km-view,
.km-split-content {
top: 0;
left: 0;
position: absolute;
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
height: 100%;
width: 100%;
-moz-box-orient: vertical;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: stretch;
-ms-align-items: stretch;
align-items: stretch;
-webkit-align-content: stretch;
align-content: stretch;
vertical-align: top;
}
.k-ff .km-view,
.k-ff .km-pane {
overflow: hidden;
}
.k-ff18 .km-view,
.k-ff18 .km-pane,
.k-ff19 .km-view,
.k-ff19 .km-pane,
.k-ff20 .km-view,
.k-ff20 .km-pane,
.k-ff21 .km-view,
.k-ff21 .km-pane {
position: relative;
}
.k-ff .km-view {
display: -moz-inline-box;
display: inline-flex;
}
.km-content {
min-height: 1px;
-moz-box-flex: 1;
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-moz-box-align: stretch;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
flex-align: stretch;
width: auto;
overflow: hidden;
position: relative;
}
.km-content p,
.km-content h1,
.km-content h2,
.km-content h3,
.km-content h4,
.km-content h5,
.km-content h6 {
margin-left: 1rem;
margin-right: 1rem;
}
.km-header,
.km-footer {
display: block;
display: -moz-box;
-moz-box-orient: vertical;
width: 100%;
}
.km-header {
padding: 0;
}
.km-footer {
background: #1a1a1a;
}
[data-role="layout"] {
display: none;
}
/**
* The angular tags will be converted to div kendo-mobile-view
*
*/
[data-role="view"],
[data-role="drawer"],
kendo-mobile-view,
kendo-mobile-split-view,
kendo-mobile-drawer {
visibility: hidden;
}
.km-view {
visibility: visible;
}
.km-header,
.km-footer {
position: relative;
z-index: 1;
}
@media all and (-webkit-min-device-pixel-ratio: 10000), not all and (-webkit-min-device-pixel-ratio: 0) {
.km-view {
display: table;
}
.km-header,
.km-footer,
.km-content {
display: table-row;
}
.km-header,
.km-footer {
height: 1px;
}
}
.km-root .k-toolbar,
.km-navbar,
.km-button,
.km-buttongroup,
.km-tabstrip,
.km-blackberry li.km-actionsheet-cancel > a {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-origin: border-box;
position: relative;
display: inline-block;
padding: .4em .7em;
margin: .1rem;
overflow: visible;
text-decoration: none;
}
.km-tabstrip,
.km-root .k-toolbar,
.km-navbar {
display: block;
padding: .8em;
margin: 0;
width: 100%;
border-width: 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-native-scroller {
overflow: auto;
-webkit-overflow-scrolling: touch;
-ms-touch-action: pan-x pan-y;
-ms-overflow-style: -ms-autohiding-scrollbar;
-ms-scroll-snap-type: proximity;
}
.km-default-content {
padding: 1em;
}
.km-shim {
left: 0;
bottom: 0;
position: fixed;
width: 100%;
height: 100% !important;
background: rgba(0, 0, 0, 0.6);
z-index: 10001;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-root .km-shim {
position: absolute;
}
.km-shim:before {
content: "\a0";
height: 100%;
width: 0;
display: inline-block;
vertical-align: middle;
}
.km-shim .k-animation-container {
box-shadow: none;
-webkit-box-shadow: none;
border: 0;
width: auto;
}
/* Loader */
.km-loader {
top: 50%;
left: 50%;
width: 180px;
height: 130px;
z-index: 100000;
padding: 30px 30px;
position: absolute;
margin-top: -70px;
margin-left: -90px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.5);
}
.km-loader h1 {
font-size: 1rem;
color: white;
text-align: center;
vertical-align: middle;
}
.km-loader .km-loading,
.km-load-more .km-icon,
.km-scroller-refresh .km-icon {
animation: km-spin 1s infinite linear;
-webkit-animation: km-spin 1s infinite linear;
display: block;
margin: 0 auto;
width: 35px;
height: 35px;
font-size: 35px;
}
.km-loader .km-loading:after,
.km-load-more .km-icon:after {
color: #ccc;
}
.km-loading-left,
.km-loading-right {
display: none;
}
@-webkit-keyframes km-spin {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes km-spin {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
@-ms-keyframes km-spin {
from {
-ms-transform: rotate(0deg);
}
to {
-ms-transform: rotate(360deg);
}
}
@-o-keyframes km-spin {
from {
-o-transform: rotate(0deg);
}
to {
-o-transform: rotate(360deg);
}
}
@-webkit-keyframes km-ios-spin {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-webkit-keyframes km-ios-spin1 {
from {
-webkit-transform: rotate(-135deg);
}
to {
-webkit-transform: rotate(225deg);
}
}
@-moz-keyframes km-ios-spin {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
@-moz-keyframes km-ios-spin1 {
from {
-moz-transform: rotate(-135deg);
}
to {
-moz-transform: rotate(225deg);
}
}
@keyframes km-ios-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes km-ios-spin1 {
from {
transform: rotate(-135deg);
}
to {
transform: rotate(225deg);
}
}
/* Stretched View */
.km-stretched-view {
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.km-stretched-view > * {
width: 100%;
}
.km-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
z-index: 100000;
}
.km-root.km-native-scrolling,
.km-root.km-native-scrolling .km-view,
.km-root.km-native-scrolling .km-splitview .km-pane {
min-height: 100%;
height: auto;
-webkit-transform: none;
overflow-x: visible;
}
.km-native-scrolling,
.km-native-scrolling .km-pane,
.km-native-scrolling .km-view {
-ms-touch-action: auto;
}
.km-native-scrolling .km-pane,
.km-native-scrolling .km-view {
display: block;
}
.km-native-scrolling .km-content {
-ms-flex: auto;
}
.km-native-scrolling .km-blackberry .km-content {
min-height: auto;
}
/* Restore position:absolute during animation */
.km-native-scrolling .km-splitview {
position: absolute;
}
.km-native-scrolling .km-header {
position: fixed;
top: 0;
}
.km-native-scrolling .km-android .km-header {
top: auto;
bottom: 0;
}
.km-native-scrolling .km-footer {
position: fixed;
bottom: 0;
}
.km-native-scrolling .km-android .km-footer {
top: 0;
bottom: auto;
}
.km-native-scrolling .km-badge {
z-index: auto;
}
.km-native-scrolling .km-splitview .km-header,
.km-native-scrolling .km-splitview .km-footer,
.km-native-scrolling .km-popup.km-pane .km-header,
.km-native-scrolling .km-popup.km-pane .km-footer {
position: absolute;
}
.km-native-scrolling .km-modalview .km-header,
.km-native-scrolling .km-modalview .km-footer {
position: relative;
}
.km-native-scrolling .km-content {
width: 100%;
}
.km-native-scrolling .km-shim,
.km-native-scrolling .km-popup-overlay {
position: fixed;
top: 0;
bottom: 0;
height: auto !important;
}
.km-native-scrolling .km-drawer {
position: fixed;
top: 0;
height: 100% !important;
overflow: auto !important;
-webkit-overflow-scrolling: touch;
}
.km-native-scrolling > .km-pane > .km-loader {
position: fixed;
top: 50%;
margin-top: -2em;
}
.km-native-scrolling .km-header,
.km-native-scrolling .km-footer {
z-index: 2;
}
/* Disabled states */
.km-state-disabled {
opacity: 0.5;
}
.km-badge,
.km-detail {
text-decoration: none;
display: inline-block;
vertical-align: middle;
overflow: hidden;
text-align: center;
position: absolute;
z-index: 1;
height: 2em;
font-size: .6rem;
text-shadow: none;
}
.km-badge {
top: -1em;
right: -1em;
line-height: 2em;
margin-left: .5em;
min-width: .9em;
padding: 0 .55em;
-moz-background-clip: padding-box;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.km-tabstrip .km-badge {
top: -0.2em;
right: auto;
margin-left: -1em;
}
/* DetailButtons */
.km-detail {
position: absolute;
float: right;
right: .8rem;
top: 50%;
margin-top: -0.7rem;
width: 1.3rem;
height: 1.3rem;
font-size: 1rem;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-widget .km-detaildisclose {
font-size: .8em;
}
.k-ff .km-detail {
width: 1rem;
height: 1rem;
}
.km-detail .km-text {
display: none;
}
.km-widget .km-rowinsert:after,
.km-widget .km-rowdelete:after,
.km-widget .km-contactadd:after,
.km-widget .km-detaildisclose:after,
.km-widget .km-rowinsert:before,
.km-widget .km-rowdelete:before,
.km-widget .km-contactadd:before,
.km-widget .km-detaildisclose:before,
.km-detail .km-icon {
left: .15em;
top: .15em;
line-height: 1em;
font-size: 1em;
position: absolute;
}
.km-widget .km-detaildisclose:after {
left: .1em;
top: .25em;
text-align: center;
font-weight: bold;
}
/* Buttons */
.km-button {
cursor: pointer;
outline: 0;
text-align: center;
}
button.km-button {
display: inline-block;
font: inherit;
}
.km-button:hover {
text-decoration: none;
}
.km-button::-moz-focus-inner {
padding: 0;
border: 0;
}
.km-ios .km-state-disabled .km-button,
.km-android .km-state-disabled .km-button,
.km-blackberry .km-state-disabled .km-button,
.km-meego .km-state-disabled .km-button {
color: #aaa;
text-shadow: none;
}
.km-root .km-pane .k-button:focus,
.km-root .km-pane .k-button:active,
.km-root .km-pane .k-button:focus:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.km-buttongroup {
padding: .4rem .7rem;
-webkit-margin-collapse: separate;
margin-collapse: separate;
margin: .5em auto;
}
.km-widget.km-buttongroup {
padding: 0;
border-color: transparent;
background: none;
white-space: nowrap;
display: table;
}
.km-buttongroup > .km-button {
display: table-cell;
}
.km-widget.km-buttongroup .km-button {
margin: 0;
border-width: 1px 0 1px 1px;
padding: .48em .9em .44em;
}
.km-tablet .km-buttongroup .km-button {
padding: .4em .8em .34em;
}
.km-widget.km-navbar .km-buttongroup {
font-size: .95rem;
line-height: 1em;
margin: 0 0 .2em;
display: inline-block;
height: 1.5em;
top: -2px;
}
.k-toolbar .km-buttongroup {
margin: 0;
display: inline-block;
}
.km-tablet .km-navbar .km-buttongroup {
top: -1px;
}
.km-widget.km-navbar .km-buttongroup > .km-button {
font-size: 1em;
min-width: 4rem;
text-align: center;
}
.km-tablet .km-navbar .km-buttongroup > .km-button {
min-width: 6rem;
}
.km-view .km-buttongroup .km-button:last-child {
border-right-width: 1px;
}
.km-ios .km-buttongroup .km-button {
font-size: 1.2em;
font-weight: bold;
}
.km-collapsible {
margin: 1em 0;
}
.km-collapsible.km-collapsibleinset {
margin: 1em;
}
.km-collapsible + .km-collapsible {
margin-top: -1em;
}
.km-collapsible-header {
position: relative;
border-style: solid;
border-width: 1px 0;
padding: .4em 20px;
}
.km-collapsibleinset > .km-collapsible-header {
border-width: 1px;
}
.km-collapsible + .km-collapsible > .km-collapsible-header {
border-top-width: 0;
}
.km-collapsibleinset.km-collapsed > .km-collapsible-header {
border-radius: .5em;
}
.km-collapsibleinset.km-expanded > .km-collapsible-header {
border-radius: .5em .5em 0 0;
}
.km-collapsible-header .km-icon {
display: inline-block;
font-size: .8em;
margin-right: .3em;
}
.km-collapsible-header > h1,
.km-collapsible-header > h2,
.km-collapsible-header > h3,
.km-collapsible-header > h4,
.km-collapsible-header > h5,
.km-collapsible-header > h6 {
margin: 0;
}
.km-collapsible-content {
border-style: solid;
border-width: 1px 0;
border-top: 0;
padding: .4em;
overflow: hidden;
}
.km-collapsible-header .km-arrow-s,
.km-collapsible-header .km-arrow-n {
position: absolute;
top: .4em;
}
.km-icon-left .km-arrow-s,
.km-icon-left .km-arrow-n {
left: .2em;
}
.km-icon-right .km-arrow-s,
.km-icon-right .km-arrow-n {
left: auto;
right: .2em;
}
.km-icon-top .km-arrow-s,
.km-icon-top .km-arrow-n {
position: static;
display: block;
margin: 0 auto;
width: 1em;
}
.km-collapsibleinset > .km-collapsible-content {
border-radius: 0 0 .5em .5em;
border-width: 1px;
}
.km-collapsed > .km-collapsible-content.km-animated {
transform: translateY(-0.8em);
border-color: transparent;
border-bottom: none;
visibility: hidden;
}
.km-animated {
-webkit-transition: -webkit-all 0.2s ease-in-out;
-ms-transition: -ms-all 0.2s ease-in-out;
-o-transition: -o-all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.km-hide-title {
display: none;
}
.km-show-title:after {
display: block;
content: "\a0";
height: 0;
}
.km-fill-title:after {
height: auto;
}
.km-footer .km-show-title:after {
display: inline-block;
}
.km-view-title,
.km-dialog-title {
position: relative;
visibility: visible;
text-align: center;
font-size: 1.4em;
line-height: 2.3em;
margin-left: auto;
margin-right: auto;
}
.km-horizontal .km-view-title {
line-height: 2em;
}
.km-root .k-toolbar,
.km-navbar {
padding: 0;
-moz-box-flex: 1;
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
position: relative;
overflow: hidden;
display: block;
border-width: 0 0 1px 0;
background-color: #fff;
}
.k-ff.km-root .k-toolbar,
.k-ff .km-navbar {
overflow: visible;
}
.km-navbar .km-button {
margin-top: .5rem;
margin-bottom: .5rem;
}
.km-navbar .km-no-title {
padding-top: .7rem;
padding-bottom: .7rem;
}
.km-horizontal .km-navbar .km-button {
margin-top: .3rem;
margin-bottom: .3rem;
}
.km-horizontal .km-navbar .km-no-title {
padding-top: .5rem;
padding-bottom: .5rem;
}
.km-tablet.km-root .km-no-title {
padding-top: .55rem;
padding-bottom: .55rem;
}
.km-tablet .km-navbar .km-button {
margin-top: .45rem;
margin-bottom: .45rem;
}
.km-root .km-pane .km-navbar .km-no-title {
visibility: visible;
line-height: 0;
}
/* Navbar */
.km-on-ios.km-black-translucent-status-bar.km-app .km-header .km-navbar {
padding-top: 1.4em;
background-clip: border-box;
}
.km-on-ios.km-ios5.km-cordova .km-header .km-navbar,
.km-on-ios.km-ios6.km-cordova .km-header .km-navbar {
padding-top: 0;
}
.km-leftitem,
.km-rightitem {
z-index: 1;
position: absolute;
right: .5em;
}
.km-popup .km-rightitem {
right: 0;
}
.km-leftitem {
left: .5em;
right: auto;
}
.km-popup .km-leftitem {
left: 0;
}
/* Center left/right item contents */
.km-leftitem,
.km-rightitem {
height: 100%;
}
.km-on-ios.km-black-translucent-status-bar.km-app .km-leftitem,
.km-on-ios.km-black-translucent-status-bar.km-app .km-rightitem {
height: auto;
}
.km-leftitem > *,
.km-rightitem > * {
display: inline-block;
vertical-align: middle;
}
.km-leftitem:before,
.km-rightitem:before {
content: "\a0";
display: inline-block;
height: 100%;
width: 0;
vertical-align: middle;
}
/* Toolbar */
.km-root .k-toolbar {
position: relative;
display: block;
vertical-align: middle;
text-align: right;
line-height: 2.2em;
border-style: solid;
box-shadow: none;
-webkit-box-shadow: none;
padding: .55em 3.4em .55em .5em;
}
.km-root .km-widget.k-toolbar {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-root .k-toolbar span.km-icon {
vertical-align: middle;
}
.km-root .k-toolbar .k-button-icon {
padding-left: .4em;
padding-right: .4em;
}
.km-root .k-toolbar .k-button-icon .km-icon {
margin-left: 0;
margin-right: 0;
}
.km-root .k-toolbar-resizable {
overflow: hidden;
white-space: nowrap;
}
.km-root .k-toolbar > * {
display: inline-block;
vertical-align: middle;
text-align: left;
line-height: inherit;
}
.km-root .k-toolbar .km-button {
line-height: inherit;
}
.km-root div.k-toolbar > .k-align-left {
float: left;
line-height: inherit;
}
.km-root div.k-toolbar > .k-align-right {
float: none;
}
.km-root .k-toolbar > .km-button,
.km-root .k-toolbar .km-buttongroup,
.km-root .k-toolbar .k-split-button,
.km-root .k-toolbar .k-widget,
.km-root .k-toolbar .km-widget,
.km-root .k-toolbar .k-textbox,
.km-root .k-toolbar label,
.km-root .k-toolbar .k-separator {
margin: 0 .4em;
}
.km-root .k-toolbar .k-button-icontext .km-icon {
margin-left: -0.15em;
}
.km-root .k-toolbar .k-split-button {
padding-left: 0;
}
.km-root .k-toolbar .k-split-button .km-button,
.km-root .k-toolbar .km-buttongroup .km-group-start {
margin: 0;
}
.km-root .k-toolbar .k-split-button > .km-button {
padding-left: 1em;
padding-right: .6em;
}
.km-root .k-toolbar .k-split-button .k-split-button-arrow {
margin: 0 0 0 -1px;
padding-left: .2em;
padding-right: .2em;
}
.km-root .km-pane .k-toolbar .k-overflow-anchor {
border-width: 0;
width: 1.5em;
height: 100%;
margin: 0;
font-size: 2.2em;
border-radius: 0;
position: absolute;
top: 0;
right: 0;
padding: 0;
}
.km-root .k-overflow-anchor span.km-icon {
position: absolute;
top: 50%;
left: 50%;
margin: -0.5em 0 0 -0.5em;
}
.km-root .k-overflow-anchor .km-icon:after,
.km-root .k-overflow-anchor .km-icon:before {
margin-left: 0;
}
.km-root .k-overflow-container .k-item {
float: none;
border: 0;
}
.km-root .k-overflow-container .k-overflow-button,
.km-root .k-split-container .km-button {
text-align: left;
display: block;
white-space: nowrap;
margin: 0 0 1px;
}
.km-root .k-overflow-container li:last-child .k-overflow-button,
.km-root .k-split-container li:last-child .km-button {
margin: 0;
}
.km-root .k-overflow-container .km-buttongroup {
padding: 0;
}
.km-root .k-overflow-container .km-buttongroup > li {
display: block;
}
.km-root .k-overflow-container .k-overflow-group {
border-width: 1px 0;
border-style: solid;
border-radius: 0;
padding: 1px 0 0;
margin: 0 0 1px;
}
.km-root .k-overflow-container .km-state-disabled {
opacity: 1;
}
.km-root .k-overflow-container .k-overflow-hidden {
display: none;
}
.km-root .k-overflow-container .k-toolbar-first-visible,
.km-root .k-overflow-container .k-overflow-group + .k-overflow-group {
border-top: 0;
margin-top: 0;
padding-top: 0;
}
.km-root .k-overflow-container .k-toolbar-last-visible {
border-bottom: 0;
margin-bottom: 0;
}
.km-root .k-overflow-wrapper .km-actionsheet-wrapper .km-actionsheet {
overflow: hidden;
overflow-y: auto;
}
.km-tabstrip {
padding: .4rem .7rem;
}
.km-horizontal .km-tabstrip {
padding: .2rem .7rem;
}
.km-tabstrip {
-moz-box-orient: horizontal;
-webkit-box-orient: horizontal;
-moz-box-align: start;
-webkit-box-align: start;
-ms-flex-align: start;
flex-align: start;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-moz-box-pack: start;
padding: 0;
text-align: center;
word-spacing: -1em;
}
.km-tabstrip .km-button {
word-spacing: normal;
box-shadow: none;
-webkit-box-shadow: none;
vertical-align: bottom;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
.km-tabstrip {
word-spacing: normal;
width: 100%;
}
}
.km-tabstrip .km-button {
font-family: Arial, Helvetica, sans-serif;
color: #a8a8a8;
padding: .4em .8em;
border-width: 0;
border-color: transparent;
background: none;
margin: 0;
text-align: center;
}
.km-tabstrip .km-button:first-child {
border-left: 0;
}
.km-tabstrip .km-button:last-child {
border-right: 0;
}
.km-switch input[type=checkbox] {
display: none;
}
.km-switch,
.km-checkbox {
text-align: left;
font-size: 1rem;
display: inline-block;
width: 6.4rem;
height: 2rem;
line-height: 2rem;
position: relative;
overflow: hidden;
}
.km-switch-wrapper,
.km-slider-wrapper {
display: block;
height: 100%;
width: 100%;
overflow: hidden;
}
.km-switch-background,
.km-slider-background {
display: block;
margin: 0 1px 1px -5em;
height: 100%;
width: 200%;
}
.km-switch-container {
top: 0;
left: 0;
position: absolute;
display: block;
height: 100%;
width: 100%;
overflow: hidden;
background: transparent;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-checkbox {
width: 1.8rem;
height: 1.8rem;
}
.km-checkbox-checked:after {
content: "\a0";
display: block;
width: 100%;
height: 100%;
}
.km-switch-handle {
top: 0;
left: 0;
width: 2.72em;
height: 100%;
display: inline-block;
margin: -1px 0 0 -1px;
background-color: #000;
}
.km-switch-label-on,
.km-switch-label-off {
display: block;
width: 130%;
font-size: 1em;
line-height: 2em;
text-align: center;
position: absolute;
text-transform: uppercase;
}
.km-switch-label-off {
left: 104%;
}
.km-switch-label-on {
left: -134%;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.km-list .km-switch {
position: absolute;
top: 50%;
right: .8rem;
margin-top: -1rem;
}
.km-listview-link:after {
width: .5rem;
height: .5rem;
content: "\a0";
display: inline-block;
vertical-align: middle;
margin-left: -0.2rem;
border-style: solid;
border-width: .24rem .24rem 0 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.km-listview-wrapper > ul:not(.km-listview) {
margin: 0 auto;
}
.km-list,
.km-listview {
padding: 0;
margin: 0;
list-style-type: none;
}
.km-listinset,
.km-listgroupinset {
margin: 1em;
}
.k-ff .km-listinset:after,
.k-ff .km-listgroupinset:after {
display: block;
height: 0;
content: "\a0";
}
.km-listinset,
.km-listgroupinset .km-list {
overflow: hidden;
}
.km-listview .km-switch {
margin-top: -0.95rem;
position: absolute;
right: .8rem;
top: 50%;
}
.km-listview .km-list {
text-indent: 0;
}
.km-list > li,
.km-widget .km-listview-link,
.km-widget .km-listview-label {
margin: 0;
display: block;
position: relative;
list-style-type: none;
vertical-align: middle;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: .5em .7em;
}
.km-list > li {
line-height: 1.6em;
overflow: hidden;
}
.km-virtual-list {
position: relative;
width: 100%;
-webkit-transform: translateZ(0);
}
.km-virtual-list > li {
width: 100%;
position: absolute;
top: 0;
-webkit-transform: translateZ(0);
}
.km-widget.km-list .km-load-more,
.km-widget .km-list .km-load-more {
border-bottom: 0;
}
.km-list > li > * {
line-height: normal;
}
.km-group-title {
display: block;
font-weight: bold;
padding: .2em 0;
text-indent: .8em;
}
.km-listgroupinset .km-group-title {
margin-top: .65em;
line-height: 2em;
}
.km-list:not(.km-virtual-list) > li:first-child {
border-top-width: 0;
}
.km-list:not(.km-virtual-list) > li:last-child {
border-bottom-width: 0;
}
.km-widget .km-listview-link,
.km-widget .km-listview-label {
line-height: inherit;
text-decoration: none;
margin: -0.5em -0.7em;
}
.km-listview-link:after,
.km-listview-label:after {
border-color: #777;
content: "\a0";
display: block;
position: absolute;
right: 1rem;
top: 50%;
margin-top: -0.32rem;
}
/* Filtering */
.km-filter-form {
width: 100%;
padding: .5em 0;
border: 1px solid transparent;
border-width: 1px 0;
-webkit-transform: translatez(0);
-ms-transform: translatez(0);
-o-transform: translatez(0);
transform: translatez(0);
}
.km-filter-wrap {
position: relative;
margin: 0 .7em;
padding: .2em .4em;
border: 1px solid transparent;
}
.km-widget .km-filter-wrap:before {
display: inline-block;
vertical-align: middle;
content: "\e0e9";
font-size: 1.6em;
width: 1em;
height: 1em;
margin-right: -1em;
color: inherit;
}
.km-tablet .km-filter-wrap {
max-width: 24em;
margin: 0 auto;
}
.km-filter-wrap > input[type="search"]::-webkit-search-cancel-button {
display: none;
}
.km-filter-wrap input {
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 0;
background: transparent;
-moz-appearance: none;
-webkit-appearance: none;
vertical-align: middle;
padding: 0 1.4em;
}
.km-filter-reset {
display: inline-block;
margin-left: -1.6em;
vertical-align: middle;
text-align: center;
z-index: 1;
text-decoration: none;
height: 100%;
}
.km-filter-reset .km-clear {
font-size: 1.6em;
width: 1em;
height: 1em;
display: block;
}
.km-filter-reset > .km-text {
position: absolute;
top: -3333px;
left: -3333px;
}
/* Load more */
.km-load-more {
display: block;
padding: .3em 0 1.2em;
height: 3.2em;
text-align: center;
}
/* Pull to refresh */
.km-scroller-pull {
width: 100%;
display: block;
position: absolute;
line-height: 3em;
font-size: 1.4em;
text-align: center;
-webkit-transform: translate3d(0, -3em, 0);
-ms-transform: translate3d(0, -3em, 0);
-o-transform: translate3d(0, -3em, 0);
transform: translate3d(0, -3em, 0);
}
.km-scroller-pull .km-template {
display: inline-block;
min-width: 200px;
text-align: left;
}
.km-load-more .km-icon,
.km-widget .km-scroller-pull .km-icon {
display: inline-block;
height: 2rem;
margin-right: 1rem;
vertical-align: middle;
width: 2rem;
font-size: 2rem;
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: -webkit-transform 300ms linear;
-ms-transition: -ms-transform 300ms linear;
-o-transition: -o-transform 300ms linear;
transition: transform 300ms linear;
}
.km-widget .km-scroller-release .km-icon {
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
.km-widget .km-scroller-refresh .km-icon {
-webkit-transition: none;
-ms-transition: none;
-o-transition: none;
transition: none;
}
/* Scroller */
.km-touch-scrollbar {
position: absolute;
visibility: hidden;
z-index: 200000;
height: .4em;
width: .4em;
background-color: #333;
opacity: 0;
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
-o-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transition: opacity 0.3s linear;
-ms-transition: opacity 0.3s linear;
-o-transition: opacity 0.3s linear;
transition: opacity 0.3s linear;
}
.km-vertical-scrollbar {
height: 100%;
right: 2px;
top: 0;
}
.km-horizontal-scrollbar {
width: 100%;
left: 0;
bottom: 2px;
}
.km-scrollview,
.km-scroll-container {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
-moz-user-select: -moz-none;
-webkit-margin-collapse: separate;
margin-collapse: separate;
}
.km-scroll-wrapper {
position: relative;
}
.km-scroll-header {
position: absolute;
z-index: 1001;
width: 100%;
top: 0;
left: 0;
}
.km-scrollview {
white-space: nowrap;
overflow: hidden;
position: relative;
width: 100%;
}
.km-scrollview > div > * {
-webkit-transform: translatez(0);
}
.km-scrollview > div > [data-role=page] {
vertical-align: top;
display: inline-block;
min-height: 1px;
}
.km-scrollview .km-virtual-page {
min-height: 1px;
position: absolute;
top: 0;
left: 0;
display: inline-block;
}
.k-ff18 .km-scrollview > div,
.k-ff19 .km-scrollview > div,
.k-ff20 .km-scrollview > div,
.k-ff21 .km-scrollview > div {
width: 0;
}
.km-pages {
text-align: center;
margin: 0;
padding: .6em 0 0;
height: 1.5em;
}
.km-pages li {
display: inline-block;
width: .5em;
height: .55em;
margin: 0 .3em;
}
/* PopUp + ActionSheet */
.km-root .km-popup .k-item,
.km-widget.km-actionsheet > li {
list-style-type: none;
padding: inherit 1em;
border-bottom: 1px solid #555;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-widget.km-actionsheet > li {
line-height: 2em;
border-bottom: 0;
}
.km-widget.km-actionsheet > li > a {
line-height: 1.5em;
text-align: left;
background: transparent;
}
.km-root .km-popup .k-list,
.km-widget.km-actionsheet {
padding: 0;
margin: 0;
}
.km-root .km-popup .k-item:last-child,
.km-widget.km-actionsheet > li:last-child {
border: 0;
}
.km-widget.km-actionsheet-wrapper {
width: 100%;
box-shadow: none;
-webkit-box-shadow: none;
border: 0;
}
.km-actionsheet-root.km-shim .k-animation-container {
width: 100% !important;
height: 100% !important;
}
.km-tablet .km-pane div.km-actionsheet-phone {
background: transparent;
}
.km-tablet .km-actionsheet-phone li.km-actionsheet-title,
.km-tablet div.km-actionsheet-phone li.km-actionsheet-cancel {
display: block;
}
/* PopOver */
.km-popover-root .km-popup-wrapper {
position: relative !important;
}
.km-popup-wrapper,
.km-modalview-wrapper {
z-index: 10001;
position: relative;
background: none;
border: 0;
box-shadow: none;
-webkit-box-shadow: none;
}
.km-popup-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10002;
}
.km-popup-arrow,
.km-popup-arrow:after,
.km-popup-arrow:before {
position: absolute;
width: 15px;
height: 15px;
top: 0;
left: 0;
z-index: 2;
}
.km-left .km-popup-arrow,
.km-right .km-popup-arrow {
margin-top: -8px;
}
.km-up .km-popup-arrow,
.km-down .km-popup-arrow {
margin-left: -8px;
}
.km-popup-arrow:after,
.km-popup-arrow:before {
display: block;
content: "\a0";
width: 0;
height: 0;
}
.km-up .km-popup-arrow {
top: auto;
bottom: 0;
}
.km-left .km-popup-arrow {
left: auto;
right: 0;
}
.km-popup.km-pane {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
height: 100%;
min-height: 100px;
background: transparent;
}
.km-popover-root .km-view {
position: relative;
}
.km-popover-root .km-content {
-ms-flex: auto;
}
/* SplitView */
div.km-splitview > .km-content,
kendo-mobile-split-view.km-splitview > .km-content {
-moz-box-orient: horizontal;
-webkit-box-orient: horizontal;
-moz-box-direction: normal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
}
div.km-split-vertical > .km-content,
kendo-mobile-split-view.km-split-vertical > .km-content {
-moz-box-orient: vertical;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
div.km-split-content > .km-pane {
-moz-box-flex: 2;
-webkit-box-flex: 2;
-webkit-flex: 2;
-ms-flex: 2;
flex: 2;
width: auto;
height: auto;
}
div.km-split-content > .km-pane:first-child {
-moz-box-flex: 1;
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
}
div.km-split-horizontal > .km-content > .km-pane {
top: 0;
bottom: 0;
}
.km-split-vertical > .km-content > .km-pane > .km-view {
display: -webkit-box;
}
/* ModalView */
.km-modalview-root {
text-align: center;
}
.km-modalview-root > .k-animation-container {
text-align: left;
position: relative !important;
top: auto !important;
left: auto !important;
display: inline-block !important;
vertical-align: middle;
}
.km-modalview,
.km-modalview-wrapper:before {
overflow: hidden;
position: relative;
display: -moz-inline-box;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
width: 100%;
height: 100%;
vertical-align: middle;
max-height: 100%;
}
.km-modalview .km-content {
box-flex: 1;
}
.km-auto-height .km-content {
-ms-flex: auto;
}
.km-native-scrolling .km-view.km-modalview {
display: -webkit-inline-flex;
display: inline-flex;
}
.km-modalview-root:before,
.km-modalview-wrapper:before {
vertical-align: middle;
height: 100%;
margin-left: -1px;
content: "\a0";
width: 0px;
display: inline-block;
}
/* Drawer */
.km-drawer,
[data-role=drawer] {
top: 0;
left: auto;
width: 250px;
}
.km-drawer .km-header,
.km-drawer .km-footer {
z-index: 0;
}
.km-left-drawer {
left: 0;
}
.km-right-drawer {
right: 0;
}
/* Forms and icons */
.km-item label:before,
.km-item label.km-item-checked:after {
position: absolute;
content: " ";
display: block;
top: 50%;
left: .6em;
width: 36px;
height: 36px;
margin-top: -18px;
}
/* Slider */
.km-widget .k-slider {
line-height: .6em;
position: relative;
display: inline-block;
vertical-align: middle;
text-align: center;
}
.km-widget .k-slider-horizontal {
width: 50%;
height: .6em;
line-height: .6em;
}
.km-list .k-slider {
position: absolute;
right: 0;
margin-top: -0.5em;
top: 50%;
}
.km-root .k-slider-track {
left: 1em !important;
right: 1em;
height: 100%;
display: block;
position: absolute;
border: .5em solid transparent;
border-width: .5em 0;
}
.km-widget .k-slider-horizontal .k-slider-track {
width: auto !important;
}
.km-widget .k-slider .k-slider-track {
background-clip: padding-box;
}
.km-widget .k-slider-track,
.km-widget .k-slider-selection {
margin-top: 0;
border-radius: 5px;
box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
}
.km-widget .k-slider-horizontal .k-slider-selection {
top: 0;
height: 100%;
}
.km-widget .k-slider-items {
margin: 0;
}
.km-widget .k-slider .k-draghandle {
text-indent: -3333px;
left: 0;
width: 1.2em;
height: 1.2em;
display: block;
position: absolute;
}
.km-widget .k-slider-tooltip {
display: none;
}
/* Dialog */
.km-dialog {
position: absolute;
min-width: 19em;
max-width: 25em;
overflow: hidden;
}
.km-dialog-title {
position: static;
float: none;
height: 2.6em;
margin-top: -2.6em;
font-size: 1.22em;
line-height: 3em;
}
.km-dialog:before {
content: "\a0";
display: block;
overflow: visible;
width: 100%;
height: 3em;
opacity: .2;
}
.km-dialog-content {
font-weight: normal;
min-height: 2em;
text-align: center;
}
.km-dialog .km-button {
display: block;
margin: .4em;
font-size: 1.3em;
text-align: center;
padding: .44em;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Form elements */
.km-list input[type=text]:not(.k-input),
.km-list input[type=password],
.km-list input[type=search],
.km-list input[type=number],
.km-list input[type=tel],
.km-list input[type=url],
.km-list input[type=email],
.km-list input[type=file],
.km-list input[type=month],
.km-list input[type=color],
.km-list input[type=week],
.km-list input[type=date],
.km-list input[type=time],
.km-list input[type=datetime],
.km-list input[type=datetime-local],
.km-list select:not([multiple]),
.km-list .k-dropdown,
.km-list textarea {
width: 50%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 1.2em;
position: absolute;
top: 50%;
line-height: normal;
z-index: 1;
right: 0;
margin-top: -1em;
}
.km-widget .k-slider .k-tick,
.km-widget .k-slider .k-label,
.km-widget .k-slider .k-button {
display: none;
}
.km-list textarea {
position: relative;
width: -webkit-calc(50% + .7em);
width: -moz-calc(50% + .7em);
width: calc(50% + .7em);
margin-right: -0.7em;
}
.km-list input,
.km-list select,
.km-list textarea,
.km-list input[type=checkbox],
.km-list input[type=radio] {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
}
.km-list input[type=checkbox],
.km-list input[type=radio] {
position: absolute;
top: 50%;
right: .7em;
margin-top: -0.5em;
background: none;
}
.km-widget input,
.km-widget textarea {
-moz-user-select: text;
-webkit-user-select: text;
-ms-user-select: text;
user-select: text;
}
.km-widget input[readonly],
.km-widget input[type=image],
.km-widget select:not([multiple]) {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.km-list textarea {
top: 0;
}
.km-list .k-dropdown {
line-height: 1.4em;
}
.km-list .k-dropdown,
.km-list .k-dropdown .k-input {
background-color: transparent;
}
.km-list .k-dropdown-wrap {
display: inline-block;
}
.km-list .km-listview-label:after,
.km-list input ~ .km-listview-link:after,
.km-list textarea ~ .km-listview-link:after,
.km-list select ~ .km-listview-link:after,
.km-list .k-dropdown ~ .km-listview-link:after {
display: none;
}
.km-list .k-dropdown select,
.km-list .k-dropdown .k-select {
display: none;
}
.km-widget .km-list textarea {
position: relative;
float: right;
margin-top: 0;
font-family: inherit;
}
/* Checkboxes and Radios */
.km-listview-label input[type=radio],
.km-listview-label input[type=checkbox] {
border: 0;
font-size: inherit;
width: 1em;
height: .9em;
}
/* animation classes */
.k-fx-end .k-fx-next,
.k-fx-end .k-fx-current {
-webkit-transition: all 350ms ease-out;
-ms-transition: all 350ms ease-out;
-o-transition: all 350ms ease-out;
transition: all 350ms ease-out;
}
.k-fx {
position: relative;
}
.k-fx .k-fx-current {
z-index: 0;
}
.k-fx .k-fx-next {
z-index: 1;
}
.k-fx-hidden,
.k-fx-hidden * {
visibility: hidden !important;
}
.k-fx-reverse .k-fx-current {
z-index: 1;
}
.k-fx-reverse .k-fx-next {
z-index: 0;
}
/* Zoom */
.k-fx-zoom.k-fx-start .k-fx-next {
-webkit-transform: scale(0) !important;
-ms-transform: scale(0) !important;
-o-transform: scale(0) !important;
transform: scale(0) !important;
}
.k-fx-zoom.k-fx-end .k-fx-next {
-webkit-transform: scale(1) !important;
-ms-transform: scale(1) !important;
-o-transform: scale(1) !important;
transform: scale(1) !important;
}
.k-fx-zoom.k-fx-reverse.k-fx-start .k-fx-next,
.k-fx-zoom.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: scale(1) !important;
-ms-transform: scale(1) !important;
-o-transform: scale(1) !important;
transform: scale(1) !important;
}
.k-fx-zoom.k-fx-reverse.k-fx-start .k-fx-current {
-webkit-transform: scale(1) !important;
-ms-transform: scale(1) !important;
-o-transform: scale(1) !important;
transform: scale(1) !important;
}
.k-fx-zoom.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: scale(0) !important;
-ms-transform: scale(0) !important;
-o-transform: scale(0) !important;
transform: scale(0) !important;
}
/* Fade */
.k-fx-fade.k-fx-start .k-fx-next {
will-change: opacity;
opacity: 0;
}
.k-fx-fade.k-fx-end .k-fx-next {
opacity: 1;
}
.k-fx-fade.k-fx-reverse.k-fx-start .k-fx-current {
will-change: opacity;
opacity: 1;
}
.k-fx-fade.k-fx-reverse.k-fx-end .k-fx-current {
opacity: 0;
}
/* Slide */
.k-fx-slide {
/* left */
/* left reverse */
/* right */
}
.k-fx-slide.k-fx-end .k-fx-next .km-content,
.k-fx-slide.k-fx-end .k-fx-next .km-header,
.k-fx-slide.k-fx-end .k-fx-next .km-footer,
.k-fx-slide.k-fx-end .k-fx-current .km-content,
.k-fx-slide.k-fx-end .k-fx-current .km-header,
.k-fx-slide.k-fx-end .k-fx-current .km-footer {
-webkit-transition: all 350ms ease-out;
-ms-transition: all 350ms ease-out;
-o-transition: all 350ms ease-out;
transition: all 350ms ease-out;
}
.k-fx-slide.k-fx-start .k-fx-next .km-content {
will-change: transform;
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-slide.k-fx-start .k-fx-next .km-header,
.k-fx-slide.k-fx-start .k-fx-next .km-footer {
will-change: opacity;
opacity: 0;
}
.k-fx-slide.k-fx-end .k-fx-current .km-content {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-slide.k-fx-end .k-fx-next .km-header,
.k-fx-slide.k-fx-end .k-fx-next .km-footer {
opacity: 1;
}
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-current .km-content {
will-change: transform;
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-slide.k-fx-reverse.k-fx-end .k-fx-current .km-content {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-next .km-content {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-slide.k-fx-reverse.k-fx-end .k-fx-next .km-content {
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-current .km-header,
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-current .km-footer {
will-change: opacity;
opacity: 1;
}
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-next .km-header,
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-next .km-footer {
opacity: 1;
}
.k-fx-slide.k-fx-reverse.k-fx-end .k-fx-current .km-header,
.k-fx-slide.k-fx-reverse.k-fx-end .k-fx-current .km-footer {
opacity: 0;
}
.k-fx-slide.k-fx-reverse.k-fx-end .k-fx-next .km-header,
.k-fx-slide.k-fx-reverse.k-fx-end .k-fx-next .km-footer {
opacity: 1;
}
.k-fx-slide.k-fx-right {
/* right reverse */
}
.k-fx-slide.k-fx-right.k-fx-start .k-fx-next .km-content {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-slide.k-fx-right.k-fx-end .k-fx-current .km-content {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-slide.k-fx-right.k-fx-reverse.k-fx-start .k-fx-current .km-content {
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-slide.k-fx-right.k-fx-reverse.k-fx-end .k-fx-current .km-content {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-slide.k-fx-right.k-fx-reverse.k-fx-start .k-fx-next .km-content {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-slide.k-fx-right.k-fx-reverse.k-fx-end .k-fx-next .km-content {
-webkit-transform: translatex(0%);
-ms-transform: translatex(0%);
-o-transform: translatex(0%);
transform: translatex(0%);
}
/* Tile */
.k-fx-tile {
/* left */
/* left reverse */
/* right */
}
.k-fx-tile.k-fx-start .k-fx-next {
will-change: transform;
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-tile.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-tile.k-fx-reverse.k-fx-start .k-fx-current {
will-change: transform;
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-tile.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-tile.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-tile.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-tile.k-fx-right {
/* right reverse */
}
.k-fx-tile.k-fx-right.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-tile.k-fx-right.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-start .k-fx-current {
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: translatex(0%);
-ms-transform: translatex(0%);
-o-transform: translatex(0%);
transform: translatex(0%);
}
/* Tile */
.k-fx-tile {
/* left */
/* left reverse */
/* right */
}
.k-fx-tile.k-fx-start .k-fx-next {
will-change: transform;
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-tile.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-tile.k-fx-reverse.k-fx-start .k-fx-current {
will-change: transform;
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-tile.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-tile.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-tile.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-tile.k-fx-right {
/* right reverse */
}
.k-fx-tile.k-fx-right.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-tile.k-fx-right.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-start .k-fx-current {
-webkit-transform: translatex(0);
-ms-transform: translatex(0);
-o-transform: translatex(0);
transform: translatex(0);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: translatex(0%);
-ms-transform: translatex(0%);
-o-transform: translatex(0%);
transform: translatex(0%);
}
/* Overlay */
.k-fx.k-fx-overlay.k-fx-start .k-fx-next,
.k-fx.k-fx-overlay.k-fx-left.k-fx-start .k-fx-next {
will-change: transform;
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx.k-fx-overlay.k-fx-right.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx.k-fx-overlay.k-fx-up.k-fx-start .k-fx-next {
-webkit-transform: translatey(100%);
-ms-transform: translatey(100%);
-o-transform: translatey(100%);
transform: translatey(100%);
}
.k-fx.k-fx-overlay.k-fx-down.k-fx-start .k-fx-next {
-webkit-transform: translatey(-100%);
-ms-transform: translatey(-100%);
-o-transform: translatey(-100%);
transform: translatey(-100%);
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-start .k-fx-current {
will-change: transform;
-webkit-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-end .k-fx-current,
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-left.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
-ms-transform: translatex(100%);
-o-transform: translatex(100%);
transform: translatex(100%);
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-right.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
-ms-transform: translatex(-100%);
-o-transform: translatex(-100%);
transform: translatex(-100%);
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-up.k-fx-end .k-fx-current {
-webkit-transform: translatey(100%);
-ms-transform: translatey(100%);
-o-transform: translatey(100%);
transform: translatey(100%);
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-down.k-fx-end .k-fx-current {
-webkit-transform: translatey(-100%);
-ms-transform: translatey(-100%);
-o-transform: translatey(-100%);
transform: translatey(-100%);
}
/* Platform specific workarounds */
.km-on-wp .km-view,
.km-on-wp .km-header,
.km-on-wp .km-footer,
.km-on-wp .km-slider,
.km-on-wp .km-switch,
.km-on-wp .km-filter-reset,
.km-on-wp .km-shim .k-animation-container,
.km-on-wp .km-scroll-container {
transform: translateZ(0);
}
.km-ios,
.km-blackberry,
.km-on-ios .km-view,
.km-on-ios .km-header,
.km-on-ios .km-footer,
.km-on-ios .km-slider,
.km-on-ios .km-switch,
.km-on-ios .km-group-title,
.km-on-ios .km-filter-reset,
.km-on-ios .km-shim .k-animation-container,
.km-on-ios .km-scroll-container,
.km-on-blackberry .km-view,
.km-on-blackberry .km-content,
.km-on-blackberry .km-header,
.km-on-blackberry .km-footer,
.km-on-blackberry .km-icon,
.km-on-blackberry .km-switch,
.km-on-blackberry .km-popup .k-item,
.km-on-blackberry .km-actionsheet-wrapper,
.km-on-android.km-4 .k-slider {
-webkit-transform: translatez(0);
}
.km-on-android.km-4 .km-switch,
.km-on-android.km-4 .km-listview-wrapper,
.km-on-android.km-4 .km-content,
.km-on-android.km-4 .km-switch-handle,
.km-android.km-4.km-on-android .km-switch-wrapper,
.km-on-android.km-4 .km-scroll-container,
.km-on-meego .km-content,
.km-on-meego .km-switch,
.km-on-meego .km-icon,
.km-on-meego .km-header,
.km-on-meego .km-footer,
.km-on-meego .km-content,
.km-on-meego .km-switch-handle,
.km-on-meego .km-switch-wrapper {
-webkit-transform: translatez(0);
-webkit-backface-visibility: hidden;
}
.km-android4.km-ios-chrome .km-listview-wrapper {
-webkit-transform: none;
}
.km-native-scrolling .km-header,
.km-native-scrolling .km-footer,
.km-native-scrolling .km-shim,
.km-native-scrolling .km-popup-overlay,
.km-native-scrolling .km-drawer,
.km-native-scrolling > .km-pane > .km-loader,
.km-on-android.km-4 .km-scroller-pull .km-icon {
-webkit-backface-visibility: hidden;
}
.km-on-android.km-4 input {
-webkit-user-modify: read-write-plaintext-only;
}
.km-wp .km-view .km-absolute,
.km-meego .km-view .km-absolute {
position: absolute;
}
/* Icon per-widget styles */
.km-detail .km-icon,
.km-button .km-icon,
.km-list .km-icon,
.km-ios .km-button .km-icon {
width: 1em;
height: 1em;
font-size: 1em;
margin-left: -0.3em;
margin-right: 0.3em;
vertical-align: baseline;
display: inline-block;
background-size: auto 100%;
}
html .km-widget .km-view .km-notext {
margin-left: 0;
margin-right: 0;
}
.km-buttongroup .km-button .km-icon {
width: 1em;
height: 1em;
font-size: 1em;
margin: .05em .16em 0 0;
}
.km-tabstrip .km-button .km-icon {
width: 2.5rem;
height: 2.5rem;
font-size: 2.5rem;
}
.km-tabstrip .km-image,
.km-tabstrip .km-button .km-icon {
margin: 0 auto .1em;
display: inline-block;
}
.km-tabstrip .km-text {
display: block;
}
.km-phone .km-tabstrip .km-icon {
height: 2.2rem;
width: 2.2rem;
font-size: 2.2rem;
}
.km-phone .km-horizontal .km-tabstrip .km-icon {
height: 2rem;
width: 2rem;
font-size: 2rem;
}
/* Icons */
@font-face {
font-family: "Kendo UI";
src: url("images/kendoui.woff?v=1.1") format("woff"), url("images/kendoui.ttf?v=1.1") format("truetype"), url("images/kendoui.svg#kendoui") format("svg");
}
body:before {
font-family: "Kendo UI";
content: "\a0";
font-size: 0;
width: 0;
height: 0;
position: absolute;
z-index: -1;
}
.km-root .km-pane .km-view .km-icon {
-webkit-background-clip: text;
background-size: 0 0;
}
.km-icon {
position: relative;
}
.km-icon:after,
.km-icon:before,
.km-contactadd:after,
.km-contactadd:before,
.km-rowdelete:after,
.km-rowdelete:before,
.km-rowinsert:after,
.km-rowinsert:before,
.km-detaildisclose:after,
.km-detaildisclose:before,
.km-loading:after,
.km-filter-wrap:before {
position: relative;
content: "\a0";
display: block;
width: 100%;
height: 100%;
text-align: left;
vertical-align: middle;
background-size: auto;
font: 1em/1em "Kendo UI";
}
.km-icon:before,
.km-contactadd:before,
.km-rowdelete:before,
.km-rowinsert:before,
.km-detaildisclose:before {
position: absolute;
margin-top: 1px;
color: rgba(0, 0, 0, 0.7);
display: none;
}
.km-state-active .km-icon:before,
.km-state-active .km-contactadd:before,
.km-state-active .km-rowdelete:before,
.km-state-active .km-rowinsert:before,
.km-state-active .km-detaildisclose:before {
display: block;
}
.km-ios7 .km-detaildisclose:after {
font-family: serif;
}
.km-ios7 .km-icon:before,
.km-ios7 .km-contactadd:before,
.km-ios7 .km-rowdelete:before,
.km-ios7 .km-rowinsert:before,
.km-ios7 .km-detaildisclose:before {
display: none;
}
.k-webkit .km-ios:not(.km-android):not(.km-blackberry6):not(.km-blackberry7) .km-icon:after,
.k-webkit .km-blackberry:not(.km-android):not(.km-blackberry6):not(.km-blackberry7) .km-icon:after,
.k-safari .km-ios:not(.km-android):not(.km-blackberry6):not(.km-blackberry7) .km-icon:after,
.k-safari .km-blackberry:not(.km-android):not(.km-blackberry6):not(.km-blackberry7) .km-icon:after {
background-image: inherit;
background-repeat: inherit;
background-position: inherit;
background-color: currentcolor;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.km-root .km-pane.km-on-blackberry.km-blackberry6 .km-view .km-icon:after,
.km-root .km-pane.km-on-blackberry.km-blackberry7 .km-view .km-icon:after,
.km-root .km-pane.km-pane.km-on-android .km-view .km-icon:after,
.km-root .km-pane.km-pane.km-on-meego .km-view .km-icon:after {
background: none;
-webkit-text-fill-color: inherit;
}
.km-contactadd:after,
.km-contactadd:before,
.km-rowinsert:after,
.km-rowinsert:before {
content: "\E039";
}
.km-rowdelete:after,
.km-rowdelete:before {
content: "\E03a";
}
.km-detaildisclose:after,
.km-detaildisclose:before {
content: "\E0E2";
}
.km-action:after,
.km-action:before {
content: "\e0ca";
}
.km-add:after,
.km-add:before {
content: "\e0cb";
}
.km-arrow-n:after,
.km-arrow-n:before {
content: "\e001";
}
.km-arrow-s:after,
.km-arrow-s:before {
content: "\e002";
}
.km-battery:after,
.km-battery:before {
content: "\e0ce";
}
.km-bookmarks:after,
.km-bookmarks:before {
content: "\e0cf";
}
.km-camera:after,
.km-camera:before {
content: "\e0d0";
}
.km-cart:after,
.km-cart:before {
content: "\e0d1";
}
.km-edit:after,
.km-compose:after,
.km-edit:before,
.km-compose:before {
content: "\e0d5";
}
.km-contacts:after,
.km-contacts:before {
content: "\e0e4";
}
.km-trash:after,
.km-delete:after,
.km-trash:before,
.km-delete:before {
content: "\e0ec";
}
.km-details:after,
.km-details:before {
content: "\e0e2";
}
.km-download:after,
.km-downloads:after,
.km-download:before,
.km-downloads:before {
content: "\e0d4";
}
.km-fastforward:after,
.km-fastforward:before {
content: "\e0d9";
}
.km-toprated:after,
.km-favorites:after,
.km-toprated:before,
.km-favorites:before {
content: "\e0d7";
}
.km-featured:after,
.km-featured:before {
content: "\e0d8";
}
.km-globe:after,
.km-globe:before {
content: "\e0dc";
}
.km-history:after,
.km-history:before {
content: "\e0e7";
}
.km-home:after,
.km-home:before {
content: "\e0dd";
}
.km-info:after,
.km-about:after,
.km-info:before,
.km-about:before {
content: "\e0de";
}
.km-minus:after,
.km-minus:before {
content: "\e033";
}
.km-more:after,
.km-more:before {
content: "\e0e0";
}
.km-mostrecent:after,
.km-mostrecent:before {
content: "\e0cc";
}
.km-mostviewed:after,
.km-mostviewed:before {
content: "\e0d6";
}
.km-organize:after,
.km-organize:before {
content: "\e0eb";
}
.km-pause:after,
.km-pause:before {
content: "\e0e3";
}
.km-play:after,
.km-play:before {
content: "\e0e5";
}
.km-plus:after,
.km-plus:before {
content: "\e032";
}
.km-recents:after,
.km-recents:before {
content: "\e0d2";
}
.km-refresh:after,
.km-refresh:before {
content: "\e0e6";
}
.km-reply:after,
.km-reply:before {
content: "\e0ed";
}
.km-rewind:after,
.km-rewind:before {
content: "\e0e8";
}
.km-search:after,
.km-search:before {
content: "\e0e9";
}
.km-settings:after,
.km-settings:before {
content: "\e0da";
}
.km-share:after,
.km-share:before {
content: "\e0df";
}
.km-sounds:after,
.km-volume:after,
.km-sounds:before,
.km-volume:before {
content: "\e0ef";
}
.km-stop:after,
.km-stop:before {
content: "\e0ea";
}
.km-wifi:after,
.km-wifi:before {
content: "\e0f0";
}
.km-drawer-icon:after,
.km-drawer-icon:before {
content: "\e105";
}
.km-root .km-pane .km-icon.km-check {
-webkit-background-clip: initial;
}
.km-root .km-pane .km-check:checked:after,
.km-widget .km-check:checked:after {
content: "\e227";
}
.km-android .km-more:after,
.km-android .km-more:before {
content: "\e0e1";
}
.km-meego .km-more:after,
.km-meego .km-more:before {
content: "\e0f1";
}
.km-wp .km-loading:after,
.km-wp .km-load-more .km-icon:after,
.km-wp .km-scroller-refresh .km-icon:after {
content: "\e0f6";
}
.km-meego .km-loading:after,
.km-meego .km-load-more .km-icon:after,
.km-meego .km-scroller-refresh .km-icon:after {
content: "\e0f6";
}
.km-root .km-android .km-loading:after,
.km-android .km-load-more .km-icon:after,
.km-root .km-android .km-scroller-refresh .km-icon:after {
content: "\e0f6";
}
.km-scroller-pull .km-icon:after {
content: "\e0f2";
}
.km-icon.km-phone:after,
.km-ios7 .km-state-active .km-phone:after {
content: "\e326";
}
.km-ios7 .km-detaildisclose:after {
content: "i";
}
.km-ios7 .km-action:after {
content: "\e1ff";
}
.km-ios7 .km-add:after {
content: "\e200";
}
.km-ios7 .km-mostrecent:after {
content: "\e201";
}
.km-ios7 .km-battery:after {
content: "\e203";
}
.km-ios7 .km-bookmarks:after {
content: "\e204";
}
.km-ios7 .km-camera:after {
content: "\e205";
}
.km-ios7 .km-cart:after {
content: "\e206";
}
.km-ios7 .km-recents:after {
content: "\e207";
}
.km-ios7 .km-download:after,
.km-ios7 .km-downloads:after {
content: "\e209";
}
.km-ios7 .km-edit:after {
content: "\e20a";
}
.km-ios7 .km-mostviewed:after {
content: "\e20b";
}
.km-ios7 .km-toprated:after,
.km-ios7 .km-favorites:after {
content: "\e20c";
}
.km-ios7 .km-featured:after {
content: "\e20d";
}
.km-ios7 .km-fastforward:after {
content: "\e20e";
}
.km-ios7 .km-settings:after {
content: "\e20f";
}
.km-ios7 .km-globe:after {
content: "\e211";
}
.km-ios7 .km-home:after {
content: "\e212";
}
.km-ios7 .km-info:after,
.km-ios7 .km-about:after {
content: "\e213";
}
.km-ios7 .km-share:after {
content: "\e214";
}
.km-ios7 .km-more:after {
content: "\e215";
}
.km-ios7 .km-details:after {
content: "\e217";
}
.km-ios7 .km-pause:after {
content: "\e218";
}
.km-ios7 .km-contacts:after {
content: "\e219";
}
.km-ios7 .km-play:after {
content: "\e21a";
}
.km-ios7 .km-refresh:after {
content: "\e21b";
}
.km-ios7 .km-history:after {
content: "\e21c";
}
.km-ios7 .km-rewind:after {
content: "\e21d";
}
.km-ios7 .km-search:after {
content: "\e21e";
}
.km-ios7 .km-stop:after {
content: "\e21f";
}
.km-ios7 .km-organize:after {
content: "\e220";
}
.km-ios7 .km-trash:after,
.km-ios7 .km-delete:after {
content: "\e221";
}
.km-ios7 .km-reply:after {
content: "\e222";
}
.km-ios7 .km-forward:after {
content: "\e223";
}
.km-ios7 .km-sounds:after,
.km-ios7 .km-volume:after {
content: "\e224";
}
.km-ios7 .km-wifi:after {
content: "\e225";
}
.km-ios7 .km-phone:after {
content: "\e226";
}
.km-ios7 .km-state-active .km-action:after {
content: "\e2ff";
}
.km-ios7 .km-state-active .km-add:after {
content: "\e300";
}
.km-ios7 .km-state-active .km-mostrecent:after {
content: "\e301";
}
.km-ios7 .km-state-active .km-battery:after {
content: "\e303";
}
.km-ios7 .km-state-active .km-bookmarks:after {
content: "\e304";
}
.km-ios7 .km-state-active .km-camera:after {
content: "\e305";
}
.km-ios7 .km-state-active .km-cart:after {
content: "\e306";
}
.km-ios7 .km-state-active .km-recents:after {
content: "\e307";
}
.km-ios7 .km-state-active .km-download:after,
.km-ios7 .km-state-active .km-downloads:after {
content: "\e309";
}
.km-ios7 .km-state-active .km-edit:after {
content: "\e30a";
}
.km-ios7 .km-state-active .km-mostviewed:after {
content: "\e30b";
}
.km-ios7 .km-state-active .km-toprated:after,
.km-ios7 .km-state-active .km-favorites:after {
content: "\e30c";
}
.km-ios7 .km-state-active .km-featured:after {
content: "\e30d";
}
.km-ios7 .km-state-active .km-fastforward:after {
content: "\e30e";
}
.km-ios7 .km-state-active .km-settings:after {
content: "\e30f";
}
.km-ios7 .km-state-active .km-globe:after {
content: "\e311";
}
.km-ios7 .km-state-active .km-home:after {
content: "\e312";
}
.km-ios7 .km-state-active .km-info:after,
.km-ios7 .km-state-active .km-about:after {
content: "\e313";
}
.km-ios7 .km-state-active .km-share:after {
content: "\e314";
}
.km-ios7 .km-state-active .km-more:after {
content: "\e315";
}
.km-ios7 .km-state-active .km-details:after {
content: "\e317";
}
.km-ios7 .km-state-active .km-pause:after {
content: "\e318";
}
.km-ios7 .km-state-active .km-contacts:after {
content: "\e319";
}
.km-ios7 .km-state-active .km-play:after {
content: "\e31a";
}
.km-ios7 .km-state-active .km-refresh:after {
content: "\e31b";
}
.km-ios7 .km-state-active .km-history:after {
content: "\e31c";
}
.km-ios7 .km-state-active .km-rewind:after {
content: "\e31d";
}
.km-ios7 .km-state-active .km-search:after {
content: "\e31e";
}
.km-ios7 .km-state-active .km-stop:after {
content: "\e31f";
}
.km-ios7 .km-state-active .km-organize:after {
content: "\e320";
}
.km-ios7 .km-state-active .km-trash:after,
.km-ios7 .km-state-active .km-delete:after {
content: "\e321";
}
.km-ios7 .km-state-active .km-reply:after {
content: "\e322";
}
.km-ios7 .km-state-active .km-forward:after {
content: "\e323";
}
.km-ios7 .km-state-active .km-sounds:after,
.km-ios7 .km-state-active .km-volume:after {
content: "\e324";
}
.km-ios7 .km-state-active .km-wifi:after {
content: "\e325";
}
.km-arrowdown:after,
.km-arrowdown:before {
content: "\e002";
}
.km-wp .km-scroller-pull .km-icon:after {
content: "\E0D4";
}
.km-on-wp.km-app .km-icon:after,
.km-on-wp.km-app .km-filter-wrap:before,
.km-on-wp.km-app .km-state-active .km-icon:after {
color: transparent;
background-image: url("images/wp8_icons.png");
background-size: auto 100%;
height: 1em;
margin-top: 0;
vertical-align: middle;
}
.km-wp-light.km-app .km-icon:after,
.km-wp-light.km-app .km-filter-wrap:before {
background-image: url("images/wp8_inverseicons.png");
}
.km-on-wp.km-app .km-icon {
line-height: 1em;
}
.km-on-wp.km-app .km-icon:before {
display: none;
}
.km-on-wp.km-app .km-action:after {
background-position-x: 20%;
}
.km-on-wp.km-app .km-add:after,
.km-on-wp.km-app .km-filter-reset .km-clear:after {
background-position-x: 22%;
}
.km-on-wp.km-app .km-battery:after {
background-position-x: 24%;
}
.km-on-wp.km-app .km-bookmarks:after {
background-position-x: 26%;
}
.km-on-wp.km-app .km-camera:after {
background-position-x: 28%;
}
.km-on-wp.km-app .km-cart:after {
background-position-x: 30%;
}
.km-on-wp.km-app .km-edit:after,
.km-on-wp.km-app .km-compose:after {
background-position-x: 32%;
}
.km-on-wp.km-app .km-contacts:after {
background-position-x: 34%;
}
.km-on-wp.km-app .km-trash:after,
.km-on-wp.km-app .km-delete:after {
background-position-x: 36%;
}
.km-on-wp.km-app .km-details:after {
background-position-x: 38%;
}
.km-on-wp.km-app .km-download:after,
.km-on-wp.km-app .km-downloads:after {
background-position-x: 40%;
}
.km-on-wp.km-app .km-fastforward:after {
background-position-x: 42%;
}
.km-on-wp.km-app .km-toprated:after,
.km-on-wp.km-app .km-favorites:after {
background-position-x: 44%;
}
.km-on-wp.km-app .km-featured:after {
background-position-x: 46%;
}
.km-on-wp.km-app .km-globe:after {
background-position-x: 48%;
}
.km-on-wp.km-app .km-history:after {
background-position-x: 50%;
}
.km-on-wp.km-app .km-home:after {
background-position-x: 52%;
}
.km-on-wp.km-app .km-info:after,
.km-on-wp.km-app .km-about:after {
background-position-x: 54%;
}
.km-on-wp.km-app .km-more:after {
background-position-x: 56%;
}
.km-on-wp.km-app .km-mostrecent:after {
background-position-x: 58%;
}
.km-on-wp.km-app .km-mostviewed:after {
background-position-x: 60%;
}
.km-on-wp.km-app .km-organize:after {
background-position-x: 62%;
}
.km-on-wp.km-app .km-pause:after {
background-position-x: 64%;
}
.km-on-wp.km-app .km-play:after {
background-position-x: 66%;
}
.km-on-wp.km-app .km-recents:after {
background-position-x: 68%;
}
.km-on-wp.km-app .km-refresh:after {
background-position-x: 70%;
}
.km-on-wp.km-app .km-reply:after {
background-position-x: 72%;
}
.km-on-wp.km-app .km-rewind:after {
background-position-x: 74%;
}
.km-on-wp.km-app .km-search:after,
.km-on-wp.km-app .km-filter-wrap:before {
background-position-x: 76%;
}
.km-on-wp.km-app .km-settings:after {
background-position-x: 78%;
}
.km-on-wp.km-app .km-share:after {
background-position-x: 80%;
}
.km-on-wp.km-app .km-sounds:after,
.km-on-wp.km-app .km-volume:after {
background-position-x: 82%;
}
.km-on-wp.km-app .km-stop:after {
background-position-x: 84%;
}
.km-on-wp.km-app .km-wifi:after {
background-position-x: 86%;
}
.km-on-wp.km-app.km-android .km-more:after {
background-position-x: 88%;
}
.km-on-wp.km-app.km-meego .km-more:after {
background-position-x: 90%;
}
.km-on-wp.km-app.km-meego .km-loading:after,
.km-on-wp.km-app.km-meego .km-load-more .km-icon:after,
.km-on-wp.km-app.km-meego .km-scroller-refresh .km-icon:after {
background-position-x: 94%;
}
.km-on-wp.km-app .km-scroller-pull .km-icon:after {
background-position-x: 100%;
}
.km-on-wp.km-app .km-filter-wrap:before {
display: inline-block;
content: "\a0";
}
.km-on-wp.km-app .km-filter-reset .km-clear:after {
transform: rotate(45deg);
}
.km-fiori {
font: normal 1em "HelveticaNeue Light", "Roboto Light", "Slate Light", "Segoe WP", NokiaPureTextLight, sans-serif;
}
/* override transform options for performance */
.km-root .km-fiori.km-pane,
.km-root .km-fiori .km-view,
.km-root .km-fiori .km-slider,
.km-root .km-fiori .km-switch,
.km-root .km-fiori .km-group-title,
.km-root .km-fiori .km-filter-reset,
.km-root .km-fiori .km-shim .k-animation-container {
-webkit-transform: none;
}
.km-fiori,
.km-fiori * {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-moz-background-clip: border-box;
-webkit-background-clip: border-box;
background-clip: border-box;
}
/* Revert box/clip for Web widgets */
.km-fiori [class^=k-] {
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
.km-fiori .km-tabstrip .km-button {
background: none;
}
/* PopUp */
.km-fiori .km-popup .k-popup {
font-size: 1em !important;
}
.km-fiori .km-popup .k-item,
.km-fiori .km-actionsheet > li > a {
text-decoration: none;
padding: .5em .6em;
border-radius: 0;
border-width: 0 0 1px;
border-style: solid;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-fiori .km-popup {
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-fiori .km-popup .k-list-container {
width: 100% !important;
height: auto !important;
}
.km-fiori .km-actionsheet,
.km-fiori .km-popup .k-list-container {
max-height: 80%;
}
.km-fiori .km-actionsheet-wrapper,
.km-fiori .km-popup .k-list-container {
bottom: 0;
border-width: 1px 0 0;
border-style: solid;
border-radius: 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.km-fiori .km-shim .k-animation-container {
left: 0;
top: auto;
bottom: 0;
}
.km-fiori .km-popup-wrapper {
padding: 15px;
}
.km-fiori .km-popup.km-pane,
.km-fiori .km-actionsheet-wrapper.km-popup {
border-radius: 2px;
}
/* Loader & Pull-to-refresh */
.km-fiori .km-load-more {
height: 3.4em;
}
.km-fiori .km-load-more .km-button {
margin: 0 .8em;
display: block;
}
.km-fiori .km-loader:before,
.km-fiori .km-scroller-refresh.km-load-more,
.km-fiori .km-scroller-pull {
border-radius: 20em;
overflow: visible;
}
.km-fiori .km-loader:before {
content: "\a0";
display: block;
position: absolute;
margin-top: -2em;
margin-left: -2em;
width: 4em;
height: 4em;
top: 50%;
left: 50%;
border-radius: 5em;
}
.km-fiori .km-loader {
left: 0;
top: 0;
margin: 0;
width: 100%;
height: 100%;
}
.km-fiori .km-scroller-refresh.km-load-more {
padding: 0;
position: relative;
margin: auto;
}
.km-fiori .km-scroller-refresh.km-load-more,
.km-fiori .km-scroller-pull {
font-size: 1em;
width: 2.5em;
height: 2.5em;
top: .25em;
white-space: nowrap;
}
.km-fiori .km-scroller-pull {
left: 50%;
margin: 0 0 0 -90px;
}
.km-fiori .km-loader h1 {
display: none;
font-size: 1em;
position: absolute;
left: -50%;
width: 200%;
top: 55%;
}
.km-fiori .km-scroller-pull .km-template {
position: absolute;
line-height: 2em;
font-size: 1.2em;
min-width: 0;
top: 0;
left: 3em;
}
.km-fiori .km-loading,
.km-fiori .km-loader .km-loading-left,
.km-fiori .km-loader .km-loading-right,
.km-fiori .km-load-more.km-scroller-refresh .km-icon,
.km-fiori .km-scroller-pull.km-scroller-refresh .km-icon,
.km-fiori .km-scroller-refresh .km-loading-left,
.km-fiori .km-scroller-refresh .km-loading-right {
font-size: 1em;
display: block;
width: .36em;
height: 1em;
position: absolute;
top: 50%;
left: 50%;
margin-left: -0.8em;
margin-top: -0.5em;
border-radius: 1em;
animation: km-fioriload 0.6s infinite linear;
-webkit-animation: km-fioriload 0.6s infinite linear;
-webkit-background-clip: none;
}
.km-fiori .km-scroller-pull .km-icon {
margin-right: 0;
display: block;
position: absolute;
top: 50%;
left: 50%;
margin-left: -1rem;
margin-top: -1rem;
}
.km-fiori .km-load-more.km-scroller-refresh .km-icon,
.km-fiori .km-scroller-pull.km-scroller-refresh .km-icon,
.km-fiori .km-scroller-refresh .km-loading-left,
.km-fiori .km-scroller-refresh .km-loading-right {
height: .6em;
margin-top: -0.3em;
margin-left: -0.6em;
width: .25em;
animation: km-fiorirefresh 0.6s infinite linear;
-webkit-animation: km-fiorirefresh 0.6s infinite linear;
}
.km-fiori .km-scroller-pull .km-icon:after {
content: "\e012";
margin-left: -3px;
}
.km-fiori .km-scroller-refresh .km-icon:after {
display: none;
}
.km-root .km-fiori .km-loading-left {
margin-left: -0.2em;
animation-delay: 0.2s;
-webkit-animation-delay: 0.2s;
}
.km-root .km-fiori .km-loading-right {
margin-left: .42em;
animation-delay: 0.4s;
-webkit-animation-delay: 0.4s;
}
.km-fiori .km-scroller-refresh .km-loading-left {
margin-left: -0.18em;
}
.km-fiori .km-scroller-refresh .km-loading-right {
margin-left: .28em;
}
@keyframes km-fioriload {
0% {
height: 1em;
margin-top: -0.5em;
}
33% {
height: 2em;
margin-top: -1em;
}
66% {
height: 1em;
margin-top: -0.5em;
}
}
@-moz-keyframes km-fioriload {
0% {
height: 1em;
margin-top: -0.5em;
}
33% {
height: 2em;
margin-top: -1em;
}
66% {
height: 1em;
margin-top: -0.5em;
}
}
@-webkit-keyframes km-fioriload {
0% {
height: 1em;
margin-top: -0.5em;
}
33% {
height: 2em;
margin-top: -1em;
}
66% {
height: 1em;
margin-top: -0.5em;
}
}
@keyframes km-fiorirefresh {
0% {
height: .6em;
margin-top: -0.3em;
}
33% {
height: 1.2em;
margin-top: -0.6em;
}
66% {
height: .6em;
margin-top: -0.3em;
}
}
@-moz-keyframes km-fiorirefresh {
0% {
height: .6em;
margin-top: -0.3em;
}
33% {
height: 1.2em;
margin-top: -0.6em;
}
66% {
height: .6em;
margin-top: -0.3em;
}
}
@-webkit-keyframes km-fiorirefresh {
0% {
height: .6em;
margin-top: -0.3em;
}
33% {
height: 1.2em;
margin-top: -0.6em;
}
66% {
height: .6em;
margin-top: -0.3em;
}
}
/* Color Template */
/*
--- main text #333
---- main background #f3f8fc
--- navbar text #666
--- popover and modalview background #fff
--- item borders #333
--- actionsheet and modalview button and footer tabstrip background #40464b
--- actionsheet borders #7b7b7c
--- actionsheet and button #fff
--- primary button and counter background #009de0
--- selected state background #007cc0
--- list background #fafafa
--- list hover background and modal view title #f0f0f0
--- list selected background #e6f2f9
--- list selected #fff
--- list group title background #f7f7f7
--- list group title #004990
--- switch #979797
--- button group background #fff
--- button (group) hover background #eaeaea
--- button (group) selected background #007cc0
--- button (group) selected #fff
--- button selected border #005483
--- footer tabstrip hover background #4c5358
*/
/*switch, popover, modalview*/
/*navbar*/
/*buttons*/
/*actionsheet, popover and modalview buttons*/
/*also listview and button selected text*/
/*listview*/
/*also modalview title*/
.km-fiori {
background-color: #f3f8fc;
}
.km-fiori {
color: #333333;
}
.km-fiori .km-navbar {
color: #666666;
}
/* ActionSheet, Footer */
.km-fiori .km-footer,
.km-fiori .km-actionsheet > li > a {
background: #40464b;
color: #ffffff;
}
.km-fiori .km-footer .km-tabstrip .km-button:hover,
.km-fiori .km-actionsheet > li > a:active,
.km-fiori .km-actionsheet > li > a:hover,
.km-fiori .km-actionsheet > li > .km-state-active {
background: #4c5358;
}
.km-fiori .km-footer .km-tabstrip .km-button,
.km-fiori .km-actionsheet > li > a {
border-color: #7b7b7c;
}
.km-fiori .km-actionsheet > .km-actionsheet-cancel > a {
background: #009de0;
}
/* Button */
.km-fiori .km-button {
background: #f2f2f2;
border-color: #bfbfbf;
}
.km-fiori .km-button:hover {
background: #eaeaea;
}
.km-fiori .km-button.km-state-active {
background: #007cc0;
}
/* Badges and Details */
.km-fiori .km-detail,
.km-fiori .k-toolbar {
border-color: #bfbfbf;
}
/* Switch */
.km-fiori .km-switch-wrapper {
background-color: #ffffff;
}
.km-modalview,
.km-fiori .km-switch-background {
background: #ffffff;
}
.km-fiori .km-switch-handle {
background: #ffffff;
border-color: #ffffff;
}
.km-fiori .km-switch-container,
.km-fiori .km-switch-wrapper {
border-color: #ffffff;
}
/* Slider */
/* ListView */
.km-fiori .km-list > li {
background: #fafafa;
border-color: #bfbfbf;
}
.km-fiori .km-list > li:hover,
.km-navbar .km-view-title {
background-color: #f0f0f0;
}
.km-fiori .km-listinset > li:first-child,
.km-fiori .km-listgroupinset .km-list > li:first-child {
border-color: #bfbfbf;
}
.km-fiori .km-listinset > li:last-child,
.km-fiori .km-listgroupinset .km-list > li:last-child {
border-color: #bfbfbf;
}
.km-fiori .km-listview-link:after {
color: #808080;
border-color: currentcolor;
}
.km-fiori .km-group-title {
background: #f7f7f7;
border-color: #dddddd transparent #a4bdd4;
color: #004990;
}
.km-fiori .km-listview .km-state-active > .km-listview-link {
color: #333333;
}
.km-fiori .km-filter-wrap:before,
.km-fiori .km-filter-reset .km-clear {
color: #333333;
}
.km-fiori .km-filter-wrap > input {
color: #333333;
border-color: #bfbfbf;
}
.km-fiori .km-filter-wrap > input:focus {
border-color: #000;
}
/* ScrollView */
.km-fiori .km-pages li {
background: #bfbfbf;
}
/* Forms */
.km-fiori .km-list input[type=password],
.km-fiori .km-list input[type=search],
.km-fiori .km-list input[type=number],
.km-fiori .km-list input[type=tel],
.km-fiori .km-list input[type=url],
.km-fiori .km-list input[type=email],
.km-fiori .km-list input[type=month],
.km-fiori .km-list input[type=color],
.km-fiori .km-list input[type=week],
.km-fiori .km-list input[type=date],
.km-fiori .km-list input[type=time],
.km-fiori .km-list input[type=datetime],
.km-fiori .km-list input[type=datetime-local],
.km-fiori .km-list input[type=text]:not(.k-input),
.km-fiori .km-list select:not([multiple]),
.km-fiori .km-list .k-dropdown-wrap,
.km-fiori .km-list textarea,
.km-fiori .km-list .k-dropdown-wrap .k-input {
color: #333333;
}
.km-fiori .km-list select:not([multiple]) option {
color: #333;
}
/* Checkboxes and Radios */
.km-fiori .km-listview-label input[type=radio],
.km-fiori .km-listview-label input[type=checkbox] {
border-color: #979797;
background: #fff;
}
.km-fiori .km-listview-label input[type=checkbox]:checked:after {
color: #007cc0;
}
/* Shim */
.km-fiori .km-shim,
.km-phone .km-fiori .km-actionsheet-wrapper {
background: rgba(0, 0, 0, 0.4);
}
/* PopUp */
.km-fiori .km-popup {
background: rgba(64, 70, 75, 0.6);
}
.km-fiori .km-actionsheet-wrapper,
.km-fiori .km-popup .k-list-container {
background: rgba(64, 70, 75, 0.6);
border-top-color: rgba(0, 0, 0, 0.2);
}
.km-fiori .km-popup.km-pane,
.km-tablet .km-fiori .km-actionsheet-wrapper {
background-color: #40464b;
}
.km-fiori .km-popup-arrow:after {
border-color: #40464b transparent;
}
.km-fiori .km-left .km-popup-arrow:after,
.km-fiori .km-right .km-popup-arrow:after {
border-color: transparent #40464b;
}
/* Loader & Pull-to-refresh */
.km-fiori .km-loader {
background: rgba(0, 0, 0, 0.05);
}
.km-fiori .km-loader h1 {
color: #333333;
}
/* Active States */
.km-fiori .km-detail:active,
.km-fiori .km-state-active .km-detail,
.km-fiori .km-state-active[style*=background] {
box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.2);
}
/* Active States */
.km-fiori .km-badge,
.km-fiori .km-rowinsert,
.km-fiori .km-rowdelete,
.km-fiori .km-state-active,
.km-fiori .km-switch-label-on,
.km-fiori .km-switch-label-off,
.km-fiori .km-tabstrip .km-button,
.km-fiori .km-popup .k-item,
.km-fiori .km-actionsheet > li > a,
.km-fiori .km-tabstrip .km-state-active,
.km-fiori .k-slider .k-draghandle,
.km-fiori .k-slider .k-draghandle:hover,
.km-fiori .km-scroller-pull .km-icon,
.km-fiori .km-popup.km-pane .km-navbar,
.km-fiori .km-popup.km-pane .k-toolbar,
.km-fiori .km-popup.km-pane .km-tabstrip,
.km-fiori .km-popup .k-state-hover,
.km-fiori .km-popup .k-state-focused,
.km-fiori .km-popup .k-state-selected,
.km-fiori li.km-state-active .km-listview-link,
.km-fiori li.km-state-active .km-listview-label,
.km-fiori .km-state-active .km-listview-link:after {
color: #ffffff;
}
.km-fiori .km-loader > *:not(h1),
.km-fiori .km-filter-wrap > input,
.km-fiori .km-switch-handle.km-state-active,
.km-root .km-fiori .km-scroller-refresh span:not(.km-template) {
background: #007cc0;
}
.km-fiori .km-switch-handle,
.km-fiori .k-slider-selection,
.km-fiori .km-switch-background {
color: #007cc0;
}
.km-fiori .km-rowinsert,
.km-fiori .km-state-active,
.km-fiori .km-scroller-pull,
.km-fiori .km-loader:before,
.km-fiori .k-slider-selection,
.km-fiori .km-touch-scrollbar,
.km-fiori .km-pages .km-current-page,
.km-fiori .k-slider .k-draghandle,
.km-fiori .k-slider .k-draghandle:hover,
.km-fiori .km-tabstrip .km-state-active,
.km-fiori .km-scroller-refresh.km-load-more,
.km-fiori .km-popup .k-state-selected,
.km-fiori li.km-state-active .km-listview-link,
.km-fiori li.km-state-active .km-listview-label,
.km-fiori .km-listview-label input[type=radio]:checked,
.km-fiori .km-listview-label input[type=checkbox]:checked {
background: #007cc0;
}
.km-fiori .km-filter-wrap > input:focus {
border-color: #007cc0;
}
.km-fiori .km-badge,
.km-fiori .km-rowdelete {
background: #009de0;
}
/* Tablet Styles */
.km-tablet .km-fiori.km-horizontal .km-navbar .km-button,
.km-tablet .km-fiori.km-horizontal .km-toolbar .km-button {
margin-top: .2rem;
margin-bottom: .2rem;
}
/* Button */
.km-fiori .km-button {
padding: .5em .8em;
border-style: solid;
border-width: 1px;
border-radius: 2px;
}
/* Badges and Details */
.km-fiori .km-badge,
.km-fiori .km-detail {
border: 0;
min-width: 2em;
height: 2em;
line-height: 2em;
border-radius: 5em;
font-size: .8em;
}
.km-fiori .km-detail {
min-width: 1.4em;
height: 1.4em;
line-height: 1.4em;
border-width: 1px;
border-style: solid;
}
.km-fiori .km-detaildisclose {
min-width: 2em;
height: 2em;
line-height: 2em;
}
.km-fiori .km-detaildisclose:after,
.km-fiori .km-detaildisclose:before {
left: .1em;
top: 0.35em;
}
.km-fiori .km-detail .km-icon:before {
display: none;
}
/* ButtonGroup */
.km-fiori .km-buttongroup > *:not(:first-child):not(:last-child) {
border-radius: 0;
}
.km-fiori .km-buttongroup > *:first-child {
border-radius: 2px 0 0 2px;
}
.km-fiori .km-buttongroup > *:last-child {
border-radius: 0 2px 2px 0;
}
.km-fiori .km-buttongroup > *.km-state-active {
border-right-width: 1px;
}
.km-fiori .km-buttongroup > *.km-state-active + * {
border-left-width: 0;
}
/* NavBar */
.km-fiori .km-navbar {
border: 1px solid #bfbfbf;
}
.km-fiori .km-header .km-navbar {
border-width: 0 0 1px;
}
.km-fiori .km-footer .km-navbar {
border-width: 1px 0 0;
}
.km-fiori .km-toolbar,
.km-fiori .km-navbar,
.km-fiori .km-tabstrip,
.km-fiori .km-tabstrip .km-button {
border-radius: 0;
}
/* ToolBar */
.km-fiori .k-toolbar {
line-height: 2.1em;
}
.km-fiori .k-toolbar .km-button,
.km-fiori .k-toolbar .k-split-button {
padding-top: 0;
padding-bottom: 0;
line-height: inherit;
}
.km-fiori .k-toolbar .k-button-icon .km-icon,
.km-fiori .k-toolbar .k-button-icontext .km-icon,
.km-fiori .k-split-button .km-arrowdown {
width: 1em;
height: 1em;
font-size: 1.2em;
margin-top: -7px;
margin-bottom: -2px;
vertical-align: middle;
}
.km-fiori .k-split-button .km-arrowdown {
margin-left: 2px;
margin-right: 1px;
}
.km-fiori .k-split-button .k-button-icontext {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.km-fiori .k-split-button-arrow {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.km-fiori .km-actionsheet.k-split-container > li > .km-button,
.km-fiori .km-actionsheet.k-overflow-container > li > .km-button {
min-width: 10em;
text-align: center;
font-size: 1.1em;
border: 0;
border-radius: 0;
}
.km-fiori .km-actionsheet.k-split-container > li > .km-button {
min-width: 5em;
}
.km-fiori .k-split-wrapper .km-actionsheet-wrapper,
.km-fiori .k-overflow-wrapper .km-actionsheet-wrapper {
padding: 1px;
}
html .km-fiori .k-split-container.km-actionsheet > li,
html .km-fiori .k-overflow-container.km-actionsheet > li {
margin-top: 0;
margin-bottom: 0;
}
.km-fiori .k-split-container.km-actionsheet,
.km-fiori .k-overflow-container.km-actionsheet {
border-top: 0;
}
/* TabStrip */
.km-fiori .km-tabstrip {
padding: 0;
display: table;
table-layout: fixed;
}
.km-fiori .km-tabstrip .km-button {
font-size: .7em;
display: table-cell;
border: 0;
}
.km-fiori .km-tabstrip .km-icon:before {
display: none;
}
/* Switch */
.km-fiori .km-switch {
width: 5rem;
height: 2.4rem;
line-height: 2.2rem;
overflow: hidden;
}
.km-fiori .km-switch-wrapper {
overflow: hidden;
}
.km-fiori .km-switch-background,
.km-fiori .k-slider-selection {
background-position: 4.25em 0;
background-repeat: no-repeat;
background-color: currentcolor;
margin-left: -3.4rem;
}
.km-fiori .km-switch-container {
padding: 1px 0 1px 1px;
border-width: 0;
}
.km-fiori .km-switch-handle {
width: 2em;
margin: 0 4px 0 0;
border-width: 1px;
border-style: solid;
}
.km-fiori .km-switch-label-off {
left: 1.5em;
}
.km-fiori .km-switch-label-on {
left: -2.8em;
}
.km-fiori .km-switch-label-on,
.km-fiori .km-switch-label-off {
text-shadow: none;
width: 185%;
font-size: 1em;
line-height: 2em;
vertical-align: middle;
}
.km-fiori .km-switch-wrapper,
.km-fiori .km-switch-container,
.km-fiori .km-switch-background {
border-radius: 1.1rem;
}
.km-fiori .km-switch-handle {
border-radius: 50%;
}
.km-fiori .km-switch-container,
.km-fiori .km-switch-wrapper {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-width: 1px;
border-style: solid;
background-clip: content-box;
}
/* ListView */
.km-fiori .km-list > li {
border-style: solid;
border-width: 0 0 1px 0;
line-height: 2.2em;
}
.km-fiori .km-listinset > li:first-child,
.km-fiori .km-listgroupinset .km-list > li:first-child {
border-style: solid;
border-width: 1px;
border-radius: 2px 2px 0 0;
}
.km-fiori .km-listinset > li,
.km-fiori .km-listgroupinset .km-list > li {
border-width: 0 1px 1px 1px;
}
.km-fiori .km-listinset > li:last-child,
.km-fiori .km-listgroupinset .km-list > li:last-child {
border-style: solid;
border-width: 0 1px 1px 1px;
border-radius: 0 0 2px 2px;
}
.km-fiori .km-listinset > li:first-child:last-child,
.km-fiori .km-listgroupinset .km-list > li:first-child:last-child {
border-width: 1px;
border-radius: 2px;
}
.km-fiori .km-listview-link:after {
border-width: .2rem .2rem 0 0;
}
.km-fiori:not(.km-on-android) .km-listview-link:after {
width: .66rem;
height: .64rem;
border-width: 0;
box-shadow: inset -0.2rem 0.2rem 0;
}
.km-fiori .km-listinset li:first-child > .km-listview-link,
.km-fiori .km-listgroupinset li:first-child > .km-listview-link,
.km-fiori .km-listinset li:first-child > .km-listview-label,
.km-fiori .km-listgroupinset li:first-child > .km-listview-label {
border-radius: 1px 1px 0 0;
}
.km-fiori .km-listinset li:last-child > .km-listview-link,
.km-fiori .km-listgroupinset li:last-child > .km-listview-link,
.km-fiori .km-listinset li:last-child > .km-listview-label,
.km-fiori .km-listgroupinset li:last-child > .km-listview-label {
border-radius: 0 0 1px 1px;
}
.km-fiori .km-listinset li:first-child:last-child > .km-listview-link,
.km-fiori .km-listgroupinset li:first-child:last-child > .km-listview-link,
.km-fiori .km-listinset li:first-child:last-child > .km-listview-label,
.km-fiori .km-listgroupinset li:first-child:last-child > .km-listview-label {
border-radius: 1px;
}
.km-fiori .km-group-title {
border-style: solid;
border-width: 1px 0;
line-height: 1.6;
}
.km-fiori .km-scroll-header .km-group-title {
border-width: 0 0 1px;
}
.km-fiori .km-listgroupinset .km-group-title {
border: 0;
background: none;
}
.km-fiori .km-listview .km-switch {
margin-top: -1.2rem;
}
/* Filter box */
.km-fiori .km-listview-wrapper form .km-filter-wrap > input {
font-size: 1.2em;
padding: .3em 1.8em;
}
.km-fiori .km-filter-wrap:before {
margin: 0.05em -1.3em 0 0.3em;
}
.km-fiori .km-filter-reset {
margin: 0.05em 0 0 -2em;
}
.km-fiori .km-filter-reset .km-clear:after {
content: "\e038";
}
.km-fiori .km-filter-wrap > input {
border-radius: 2px;
border-width: 1px;
border-style: solid;
}
.km-fiori .km-filter-wrap > input:focus {
border-width: 1px;
border-style: solid;
}
/* ScrollView */
.km-fiori .km-pages {
padding-top: .4em;
}
.km-fiori .km-pages li {
border-radius: 1em;
}
/* Slider */
.km-fiori .k-slider .k-draghandle,
.km-fiori .k-slider .k-draghandle:hover {
border: 0;
border-radius: 5em;
box-shadow: 0 0 0 3px currentcolor;
-webkit-box-shadow: 0 0 0 3px currentcolor;
}
.km-fiori .k-slider-track {
margin: -0.5em 0.5em 0 0;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
border-radius: .5em;
background-color: #f0f0f0;
}
.km-fiori .k-slider-selection {
margin-left: 0;
}
/* Forms */
.km-fiori .km-list input[type=password],
.km-fiori .km-list input[type=search],
.km-fiori .km-list input[type=number],
.km-fiori .km-list input[type=tel],
.km-fiori .km-list input[type=url],
.km-fiori .km-list input[type=email],
.km-fiori .km-list input[type=month],
.km-fiori .km-list input[type=color],
.km-fiori .km-list input[type=week],
.km-fiori .km-list input[type=date],
.km-fiori .km-list input[type=time],
.km-fiori .km-list input[type=datetime],
.km-fiori .km-list input[type=datetime-local],
.km-fiori .km-list input[type=text]:not(.k-input),
.km-fiori .km-list select:not([multiple]),
.km-fiori .km-list .k-dropdown-wrap,
.km-fiori .km-list textarea {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
font-size: 1.1rem;
min-width: 6em;
border: 0;
padding: .4em;
outline: none;
background: transparent;
}
.km-fiori .km-list .k-dropdown-wrap {
padding: .2em;
}
.km-fiori .km-list .k-dropdown {
margin-top: -1.05em;
font-weight: normal;
}
.km-fiori .km-list input[type=color],
.km-fiori .km-list input[type=week],
.km-fiori .km-list input[type=date],
.km-fiori .km-list input[type=time],
.km-fiori .km-list input[type=month],
.km-fiori .km-list input[type=datetime],
.km-fiori .km-list input[type=datetime-local],
.km-fiori .km-list .k-dropdown {
text-align: left;
}
.km-fiori .km-list .k-dropdown .k-dropdown-wrap {
display: block;
border-radius: 0;
background: transparent;
box-shadow: none;
-webkit-box-shadow: none;
}
/* Checkboxes and Radios */
.km-fiori .km-listview-label input[type=checkbox] {
margin-top: -0.7em;
}
.km-fiori .km-listview-label input[type=radio],
.km-fiori .km-listview-label input[type=checkbox] {
border-width: 1px;
border-style: solid;
width: 1.4em;
height: 1.4em;
border-radius: 2px;
}
.km-fiori .km-listview-label input[type=radio] {
width: 1.2em;
height: 1.2em;
border-radius: 1em;
}
.km-fiori .km-listview-label input[type=checkbox]:after {
content: "\a0";
display: block;
width: 90%;
height: 76%;
-webkit-transform: scale(0.9, 1);
-ms-transform: scale(0.9, 1);
-o-transform: scale(0.9, 1);
transform: scale(0.9, 1);
-webkit-transform-origin: 10% 50%;
-ms-transform-origin: 10% 50%;
-o-transform-origin: 10% 50%;
transform-origin: 10% 50%;
}
.km-fiori .km-listview-label input[type=checkbox]:checked:after {
font-size: 1.4em;
}
.km-fiori .km-listview-label input[type=radio]:after {
color: transparent;
}
/* ActionSheet */
.km-fiori .km-actionsheet > li > a {
font-size: 1.4em;
font-weight: normal;
text-align: center;
}
.km-fiori .km-actionsheet > li > a {
display: block;
}
.km-fiori .km-actionsheet > li:last-child > a {
border: 0;
}
.km-fiori .km-shim li.km-actionsheet-title,
.km-fiori .km-popup li.km-actionsheet-title {
display: none;
}
.km-fiori .km-actionsheet-wrapper.km-popup {
padding: 2px 0;
}
/* PopOver */
.km-fiori .km-popup.km-pane {
border: 5px solid transparent;
}
.km-fiori .km-popup.km-pane .km-navbar,
.km-fiori .km-popup.km-pane .km-toolbar,
.km-fiori .km-popup.km-pane .km-tabstrip {
background: none;
}
.km-fiori .km-popup.km-pane .km-header {
padding: 0 5px;
margin: -5px -5px 2px;
border-radius: 2px 2px 0 0;
-webkit-margin-collapse: separate;
}
.km-fiori .km-popup-arrow:after {
border-color: rgba(0, 0, 0, 0.5) transparent;
border-style: solid;
border-width: 0 15px 15px;
}
.km-fiori .km-down .km-popup-arrow:before {
margin-top: -1px;
}
.km-fiori .km-up .km-popup-arrow:after {
border-width: 15px 15px 0 15px;
}
.km-fiori .km-left .km-popup-arrow:after {
border-width: 15px 0 15px 15px;
}
.km-fiori .km-right .km-popup-arrow:after {
border-width: 15px 15px 15px 0;
}
/* Scroller */
.km-fiori .km-touch-scrollbar {
border: 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-radius: 1em;
}
.km-android4.km-fiori .km-scroller-pull .km-icon:after {
margin-left: -6px;
margin-top: -3px;
}
/* SplitView */
.km-on-blackberry.km-blackberry6 .km-view .km-icon,
.km-on-blackberry.km-blackberry7 .km-view .km-icon,
.km-on-blackberry.km-ios .km-view .km-icon,
.km-pane.km-on-android .km-view .km-icon,
.km-pane.km-on-meego .km-view .km-icon {
background: none;
}
| burkeholland/itunes-artist-search | jspm_packages/github/kendo-labs/bower-kendo-ui@2015.2.720/src/styles/mobile/kendo.mobile.fiori.css | CSS | mit | 95,146 |
from panda3d.core import NodePath, DecalEffect
import DNANode
import DNAWall
import random
class DNAFlatBuilding(DNANode.DNANode):
COMPONENT_CODE = 9
currentWallHeight = 0
def __init__(self, name):
DNANode.DNANode.__init__(self, name)
self.width = 0
self.hasDoor = False
def setWidth(self, width):
self.width = width
def getWidth(self):
return self.width
def setCurrentWallHeight(self, currentWallHeight):
DNAFlatBuilding.currentWallHeight = currentWallHeight
def getCurrentWallHeight(self):
return DNAFlatBuilding.currentWallHeight
def setHasDoor(self, hasDoor):
self.hasDoor = hasDoor
def getHasDoor(self):
return self.hasDoor
def makeFromDGI(self, dgi):
DNANode.DNANode.makeFromDGI(self, dgi)
self.width = dgi.getInt16() / 100.0
self.hasDoor = dgi.getBool()
def setupSuitFlatBuilding(self, nodePath, dnaStorage):
name = self.getName()
if name[:2] != 'tb':
return
name = 'sb' + name[2:]
node = nodePath.attachNewNode(name)
node.setPosHpr(self.getPos(), self.getHpr())
numCodes = dnaStorage.getNumCatalogCodes('suit_wall')
if numCodes < 1:
return
code = dnaStorage.getCatalogCode(
'suit_wall', random.randint(0, numCodes - 1))
wallNode = dnaStorage.findNode(code)
if not wallNode:
return
wallNode = wallNode.copyTo(node, 0)
wallScale = wallNode.getScale()
wallScale.setX(self.width)
wallScale.setZ(DNAFlatBuilding.currentWallHeight)
wallNode.setScale(wallScale)
if self.getHasDoor():
wallNodePath = node.find('wall_*')
doorNode = dnaStorage.findNode('suit_door')
doorNode = doorNode.copyTo(wallNodePath, 0)
doorNode.setScale(NodePath(), (1, 1, 1))
doorNode.setPosHpr(0.5, 0, 0, 0, 0, 0)
wallNodePath.setEffect(DecalEffect.make())
node.flattenMedium()
node.stash()
def setupCogdoFlatBuilding(self, nodePath, dnaStorage):
name = self.getName()
if name[:2] != 'tb':
return
name = 'cb' + name[2:]
node = nodePath.attachNewNode(name)
node.setPosHpr(self.getPos(), self.getHpr())
numCodes = dnaStorage.getNumCatalogCodes('cogdo_wall')
if numCodes < 1:
return
code = dnaStorage.getCatalogCode(
'cogdo_wall', random.randint(0, numCodes - 1))
wallNode = dnaStorage.findNode(code)
if not wallNode:
return
wallNode = wallNode.copyTo(node, 0)
wallScale = wallNode.getScale()
wallScale.setX(self.width)
wallScale.setZ(DNAFlatBuilding.currentWallHeight)
wallNode.setScale(wallScale)
if self.getHasDoor():
wallNodePath = node.find('wall_*')
doorNode = dnaStorage.findNode('suit_door')
doorNode = doorNode.copyTo(wallNodePath, 0)
doorNode.setScale(NodePath(), (1, 1, 1))
doorNode.setPosHpr(0.5, 0, 0, 0, 0, 0)
wallNodePath.setEffect(DecalEffect.make())
node.flattenMedium()
node.stash()
def traverse(self, nodePath, dnaStorage):
DNAFlatBuilding.currentWallHeight = 0
node = nodePath.attachNewNode(self.getName())
internalNode = node.attachNewNode(self.getName() + '-internal')
scale = self.getScale()
scale.setX(self.width)
internalNode.setScale(scale)
node.setPosHpr(self.getPos(), self.getHpr())
for child in self.children:
if isinstance(child, DNAWall.DNAWall):
child.traverse(internalNode, dnaStorage)
else:
child.traverse(node, dnaStorage)
if DNAFlatBuilding.currentWallHeight == 0:
print 'empty flat building with no walls'
else:
cameraBarrier = dnaStorage.findNode('wall_camera_barrier')
if cameraBarrier is None:
raise DNAError.DNAError('DNAFlatBuilding requires that there is a wall_camera_barrier in storage')
cameraBarrier = cameraBarrier.copyTo(internalNode, 0)
cameraBarrier.setScale((1, 1, DNAFlatBuilding.currentWallHeight))
internalNode.flattenStrong()
collisionNode = node.find('**/door_*/+CollisionNode')
if not collisionNode.isEmpty():
collisionNode.setName('KnockKnockDoorSphere_' + dnaStorage.getBlock(self.getName()))
cameraBarrier.wrtReparentTo(nodePath, 0)
wallCollection = internalNode.findAllMatches('wall*')
wallHolder = node.attachNewNode('wall_holder')
wallDecal = node.attachNewNode('wall_decal')
windowCollection = internalNode.findAllMatches('**/window*')
doorCollection = internalNode.findAllMatches('**/door*')
corniceCollection = internalNode.findAllMatches('**/cornice*_d')
wallCollection.reparentTo(wallHolder)
windowCollection.reparentTo(wallDecal)
doorCollection.reparentTo(wallDecal)
corniceCollection.reparentTo(wallDecal)
for i in xrange(wallHolder.getNumChildren()):
iNode = wallHolder.getChild(i)
iNode.clearTag('DNACode')
iNode.clearTag('DNARoot')
wallHolder.flattenStrong()
wallDecal.flattenStrong()
holderChild0 = wallHolder.getChild(0)
wallDecal.getChildren().reparentTo(holderChild0)
holderChild0.reparentTo(internalNode)
holderChild0.setEffect(DecalEffect.make())
wallHolder.removeNode()
wallDecal.removeNode()
self.setupSuitFlatBuilding(nodePath, dnaStorage)
self.setupCogdoFlatBuilding(nodePath, dnaStorage)
node.flattenStrong()
| Spiderlover/Toontown | toontown/dna/DNAFlatBuilding.py | Python | mit | 5,943 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MvcThrottle")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("stefanprodan.eu")]
[assembly: AssemblyProduct("MvcThrottle")]
[assembly: AssemblyCopyright("Copyright © Stefan Prodan 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b78fdf2f-12cf-49fb-a9ea-bc72ddafec19")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| modulexcite/MvcThrottle | MvcThrottle/Properties/AssemblyInfo.cs | C# | mit | 1,426 |
// This file was generated based on 'C:\ProgramData\Uno\Packages\Experimental.Physics\0.18.8\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Int.h>
namespace g{
namespace Experimental{
namespace Physics{
// private enum BasicBoundedRegion2D.MoveMode :37
uEnumType* BasicBoundedRegion2D__MoveMode_typeof();
}}} // ::g::Experimental::Physics
| blyk/BlackCode-Fuse | TestApp/.build/Simulator/Android/include/Experimental.Physics.BasicBoundedRegion2D.MoveMode.h | C | mit | 397 |
/* Get Programming with JavaScript
* Listing 4.01
* Displaying an object's properties on the console
*/
var movie1;
movie1 = {
title: "Inside Out",
actors: "Amy Poehler, Bill Hader",
directors: "Pete Doctor, Ronaldo Del Carmen"
};
console.log("Movie information for " + movie1.title);
console.log("------------------------------");
console.log("Actors: " + movie1.actors);
console.log("Directors: " + movie1.directors);
console.log("------------------------------");
/* Further Adventures
*
* 1) Add a second movie and display the same info for it.
*
* 2) Create an object to represent a blog post.
*
* 3) Write code to display info about the blog post.
*
*/
| jrlarsen/GetProgramming | Ch04_Functions/listing4.01.js | JavaScript | mit | 688 |
describe('Component: Product Search', function(){
var scope,
q,
oc,
state,
_ocParameters,
parameters,
mockProductList
;
beforeEach(module(function($provide) {
$provide.value('Parameters', {searchTerm: null, page: null, pageSize: null, sortBy: null});
}));
beforeEach(module('orderCloud'));
beforeEach(module('orderCloud.sdk'));
beforeEach(inject(function($rootScope, $q, OrderCloud, ocParameters, $state, Parameters){
scope = $rootScope.$new();
q = $q;
oc = OrderCloud;
state = $state;
_ocParameters = ocParameters;
parameters = Parameters;
mockProductList = {
Items:['product1', 'product2'],
Meta:{
ItemRange:[1, 3],
TotalCount: 50
}
};
}));
describe('State: productSearchResults', function(){
var state;
beforeEach(inject(function($state){
state = $state.get('productSearchResults');
spyOn(_ocParameters, 'Get');
spyOn(oc.Me, 'ListProducts');
}));
it('should resolve Parameters', inject(function($injector){
$injector.invoke(state.resolve.Parameters);
expect(_ocParameters.Get).toHaveBeenCalled();
}));
it('should resolve ProductList', inject(function($injector){
parameters.filters = {ParentID:'12'};
$injector.invoke(state.resolve.ProductList);
expect(oc.Me.ListProducts).toHaveBeenCalled();
}));
});
describe('Controller: ProductSearchController', function(){
var productSearchCtrl;
beforeEach(inject(function($state, $controller){
var state = $state;
productSearchCtrl = $controller('ProductSearchCtrl', {
$state: state,
ocParameters: _ocParameters,
$scope: scope,
ProductList: mockProductList
});
spyOn(_ocParameters, 'Create');
spyOn(state, 'go');
}));
describe('filter', function(){
it('should reload state and call ocParameters.Create with any parameters', function(){
productSearchCtrl.parameters = {pageSize: 1};
productSearchCtrl.filter(true);
expect(state.go).toHaveBeenCalled();
expect(_ocParameters.Create).toHaveBeenCalledWith({pageSize:1}, true);
});
});
describe('updateSort', function(){
it('should reload page with value and sort order, if both are defined', function(){
productSearchCtrl.updateSort('!ID');
expect(state.go).toHaveBeenCalled();
expect(_ocParameters.Create).toHaveBeenCalledWith({searchTerm: null, page: null, pageSize: null, sortBy: '!ID'}, false);
});
it('should reload page with just value, if no order is defined', function(){
productSearchCtrl.updateSort('ID');
expect(state.go).toHaveBeenCalled();
expect(_ocParameters.Create).toHaveBeenCalledWith({searchTerm: null, page: null, pageSize: null, sortBy: 'ID'}, false);
});
});
describe('updatePageSize', function(){
it('should reload state with the new pageSize', function(){
productSearchCtrl.updatePageSize('25');
expect(state.go).toHaveBeenCalled();
expect(_ocParameters.Create).toHaveBeenCalledWith({searchTerm: null, page: null, pageSize: '25', sortBy: null}, true);
});
});
describe('pageChanged', function(){
it('should reload state with the new page', function(){
productSearchCtrl.pageChanged('newPage');
expect(state.go).toHaveBeenCalled();
expect(_ocParameters.Create).toHaveBeenCalledWith({searchTerm: null, page: 'newPage', pageSize: null, sortBy: null}, false);
});
});
describe('reverseSort', function(){
it('should reload state with a reverse sort call', function(){
productSearchCtrl.parameters.sortBy = 'ID';
productSearchCtrl.reverseSort();
expect(_ocParameters.Create).toHaveBeenCalledWith({searchTerm: null, page: null, pageSize: null, sortBy: '!ID'}, false);
});
});
});
describe('Component Directive: ordercloudProductSearch', function(){
var productSearchComponentCtrl,
timeout
;
beforeEach(inject(function($componentController, $timeout){
timeout = $timeout;
productSearchComponentCtrl = $componentController('ordercloudProductSearch', {
$state:state,
$timeout: timeout,
$scope: scope,
OrderCloud:oc
});
spyOn(state, 'go');
}));
describe('getSearchResults', function(){
beforeEach(function(){
var defer = q.defer();
defer.resolve();
spyOn(oc.Me, 'ListProducts').and.returnValue(defer.promise);
});
it('should call Me.ListProducts with given search term and max products', function(){
productSearchComponentCtrl.searchTerm = 'Product1';
productSearchComponentCtrl.maxProducts = 12;
productSearchComponentCtrl.getSearchResults();
expect(oc.Me.ListProducts).toHaveBeenCalledWith('Product1', 1, 12);
});
it('should default max products to five, if none is provided', function(){
productSearchComponentCtrl.searchTerm = 'Product1';
productSearchComponentCtrl.getSearchResults();
expect(oc.Me.ListProducts).toHaveBeenCalledWith('Product1', 1, 5);
});
});
describe('onSelect', function(){
it('should route user to productDetail state for the selected product id', function(){
productSearchComponentCtrl.onSelect(12);
expect(state.go).toHaveBeenCalledWith('productDetail', {productid:12});
});
});
describe('onHardEnter', function(){
it('should route user to search results page for the provided search term', function(){
productSearchComponentCtrl.onHardEnter('bikes');
expect(state.go).toHaveBeenCalledWith('productSearchResults', {searchTerm: 'bikes'});
});
});
});
}); | Four51SteveDavis/JohnsonBros | src/app/productSearch/tests/productSearch.spec.js | JavaScript | mit | 6,607 |
(function () {
'use strict';
angular.module('common')
.directive('svLumxUsersDropdown', function () {
return {
templateUrl: 'scripts/common/directives/sv-lumx-users-dropdown.html',
scope: {
btnTitle: '@',
actionCounter: '@',
userAvatar: '@',
userName: '@',
userFirstName: '@',
userLastName: '@',
iconType: '@',
iconName: '@'
},
link: function ($scope, el, attrs) {
}
};
});
})();
| SvitlanaShepitsena/cl-poster | app/scripts/common/directives/sv-lumx-users-dropdown.js | JavaScript | mit | 689 |
---
title: Perjalanan Ke Roma
date: 22/09/2018
---
### Untuk Pelajaran Pekan Ini Bacalah:
Kisah 27, 28; Roma 1:18–20.
> <p>Ayat Hafalan</p>
> “ ‘Jangan takut, Paulus! Engkau harus menghadap Kaisar...’ ” (Kisah 27:24).
Paulus sudah lama merindukan untuk mengunjungi Roma, tetapi penahanannya di Yerusalem mengubah semuanya. Dengan menyerah pada tekanan legalistik para pemimpin gereja Yerusalem, ia berakhir di penahanan Roma selama hampir lima tahun, termasuk waktu yang digunakan dalam perjalanan laut ke Italia. Perubahan ini merupakan suatu terpaan dahsyat pada rencana-rencana misionarisnya.
Walaupun dengan langkah mundur, Yesus sendiri menjanjikan bahwa rasul itu masih akan bersaksi tentang Dia di Roma (Kis. 23:11) Sekalipun kita gagal, Allah masih dapat memberikan kita kesempatan lain, wakau Ia tidak selalu meluputkan kita dari akibat tindakan-tindakan kita. Paulus bukan hanya dibawa ke Roma sebagai tawanan, tetapi tidak ada bukti-bukti Alkitab bahwa ia pernah pergi ke Spanyol, seperti yang telah ia harapkan (Rm. 15:24). Setelah dilepaskan dari apa yang dikenal sebagai pemenjaraan pertama di Roma, Paulus akan ditangkap lagi, kali ini untuk mati sebagai martir (2 Tim. 4:6-8) dibawah kekuasaan Nero pada tahun 67 M.
Benar, Paulus sampai ke Roma, dan sedang menanti di penjara-rumahnya untuk diadili di hadapan kaisar, ia berbicara walaupun dengan rantai-rantainya (Ef. 6:20; Flp. 1:13), tanpa halangan kepada siapa saja yang mengunjunginya (Kis. 28:30, 31), termasuk tokoh penting dari istana Kaisar (Flp. 4:22)
_*Pelajari pelajaran pekan ini untuk persiapan Sabat, 29 September._ | imasaru/sabbath-school-lessons | src/in/2018-03/13/01.md | Markdown | mit | 1,615 |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using FluentAssertions;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Csdl;
using Microsoft.OData.Edm.Library;
using Microsoft.OData.Edm.Library.Values;
using Microsoft.OData.Edm.Validation;
using Microsoft.OData.Edm.Values;
using Xunit;
using Vipr.Reader.OData.v4;
using Vipr.Core.CodeModel;
using Vipr.Core.CodeModel.Vocabularies.Capabilities;
namespace ODataReader.v4UnitTests
{
public class Given_An_ODataVocabularyParser
{
public Given_An_ODataVocabularyParser()
{
}
[Xunit.Fact]
public void Boolean_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> booleanConstantPredicate = o => new EdmBooleanConstant((bool) o);
ConstantValueShouldRoundtrip(true, booleanConstantPredicate);
ConstantValueShouldRoundtrip(false, booleanConstantPredicate);
}
[Fact]
public void String_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> stringPredicate = o => new EdmStringConstant((string) o);
ConstantValueShouldRoundtrip("♪♪ unicode test string ♪♪", stringPredicate);
}
[Fact]
public void Guid_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> guidConstantPredicate = o => new EdmGuidConstant((Guid) o);
ConstantValueShouldRoundtrip(Guid.NewGuid(), guidConstantPredicate);
}
[Fact]
public void Binary_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> binaryConstantPredicate = o => new EdmBinaryConstant((byte[]) o);
ConstantValueShouldRoundtrip(new byte[] {1, 3, 3, 7}, binaryConstantPredicate);
}
[Fact]
public void Date_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> dateConstantPredicate = o => new EdmDateConstant((Date) o);
ConstantValueShouldRoundtrip(Date.Now, dateConstantPredicate);
}
[Fact]
public void DateOffset_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> dateTimeOffsetConstantPredicate =
o => new EdmDateTimeOffsetConstant((DateTimeOffset) o);
ConstantValueShouldRoundtrip(DateTimeOffset.Now, dateTimeOffsetConstantPredicate);
ConstantValueShouldRoundtrip(DateTimeOffset.UtcNow, dateTimeOffsetConstantPredicate);
}
[Fact]
public void Decimal_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> decimalConstantValuePredicate = o => new EdmDecimalConstant((decimal) o);
ConstantValueShouldRoundtrip((decimal) 1.234, decimalConstantValuePredicate);
}
[Fact]
public void Floating_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> floatingConstantValuePredicate = o => new EdmFloatingConstant((double) o);
ConstantValueShouldRoundtrip(1.234d, floatingConstantValuePredicate);
}
[Fact]
public void Integer_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> integerConstantValuePredicate = o => new EdmIntegerConstant((long) o);
ConstantValueShouldRoundtrip(123400L, integerConstantValuePredicate);
}
[Fact]
public void Duration_constant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> durationConstantValuePredicate = o => new EdmDurationConstant((TimeSpan) o);
ConstantValueShouldRoundtrip(new TimeSpan(1, 2, 3, 4), durationConstantValuePredicate);
}
[Fact]
public void TimeOfDay_contant_values_map_to_their_clr_values()
{
Func<object, IEdmValue> timeOfDayConstantValuePredicate = o => new EdmTimeOfDayConstant((TimeOfDay) o);
ConstantValueShouldRoundtrip(TimeOfDay.Now, timeOfDayConstantValuePredicate);
}
private void ConstantValueShouldRoundtrip(object originalValue, Func<object, IEdmValue> valuePredicate)
{
// Map our original value to an IEdmValue with the supplied predicate
var iEdmValue = valuePredicate(originalValue);
var result = ODataVocabularyReader.MapToClr(iEdmValue);
result.Should()
.Be(originalValue, "because a given clr value should roundtrip through its appropriate edm value ");
}
[Fact]
public void Validly_annotated_Edm_will_correctly_parse_insert_restrictions()
{
var annotations = GetAnnotationsFromOneNoteSampleEntitySet("sections");
annotations.Should().HaveCount(4, "because sections have four annotations");
annotations.Should().Contain(x => x.Name == "InsertRestrictions");
var insertRestrictions = annotations.First(x => x.Name == "InsertRestrictions");
insertRestrictions.Namespace.Should().Be("Org.OData.Capabilities.V1");
insertRestrictions.Value.Should().BeOfType<InsertRestrictionsType>();
var insertValue = insertRestrictions.Value as InsertRestrictionsType;
insertValue.Insertable.Should().BeFalse();
insertValue.NonInsertableNavigationProperties.Should().HaveCount(2);
insertValue.NonInsertableNavigationProperties.Should().Contain("parentNotebook");
insertValue.NonInsertableNavigationProperties.Should().Contain("parentSectionGroup");
}
[Fact]
public void Validly_annotated_edm_will_correctly_parse_update_restrictions()
{
var annotations = GetAnnotationsFromOneNoteSampleEntitySet("sections");
annotations.Should().Contain(x => x.Name == "UpdateRestrictions");
var update = annotations.First(x => x.Name == "UpdateRestrictions");
update.Namespace.Should().Be("Org.OData.Capabilities.V1");
update.Value.Should().BeOfType<UpdateRestrictionsType>();
var updateValue = update.Value as UpdateRestrictionsType;
updateValue.Updatable.Should().BeFalse();
updateValue.NonUpdatableNavigationProperties.Should().HaveCount(3);
updateValue.NonUpdatableNavigationProperties.Should().Contain("pages");
updateValue.NonUpdatableNavigationProperties.Should().Contain("parentNotebook");
updateValue.NonUpdatableNavigationProperties.Should().Contain("parentSectionGroup");
}
[Fact]
public void Validly_annotated_edm_will_correctly_parse_delete_restrictions()
{
var annotations = GetAnnotationsFromOneNoteSampleEntitySet("sections");
annotations.Should().Contain(x => x.Name == "DeleteRestrictions");
var delete = annotations.First(x => x.Name == "DeleteRestrictions");
delete.Namespace.Should().Be("Org.OData.Capabilities.V1");
delete.Value.Should().BeOfType<DeleteRestrictionsType>();
var deleteValue = delete.Value as DeleteRestrictionsType;
deleteValue.Deletable.Should().BeFalse();
deleteValue.NonDeletableNavigationProperties.Should().HaveCount(3);
deleteValue.NonDeletableNavigationProperties.Should().Contain("pages");
deleteValue.NonDeletableNavigationProperties.Should().Contain("parentNotebook");
deleteValue.NonDeletableNavigationProperties.Should().Contain("parentSectionGroup");
}
[Fact]
public void Validly_annotated_edm_will_correctly_parse_annotations_with_primitive_values()
{
var annotations = GetAnnotationsFromOneNoteSampleEntityContainer();
annotations.Should().HaveCount(3);
annotations.Should().Contain(x => x.Name == "BatchSupported");
annotations.Should().Contain(x => x.Name == "AsynchronousRequestsSupported");
annotations.Should().Contain(x => x.Name == "BatchContinueOnErrorSupported");
// In this case, all of the value and namespaces for these annotaion are the same
// We'll loop over them for brevity.
foreach (var annotation in annotations)
{
annotation.Namespace.Should().Be("Org.OData.Capabilities.V1");
annotation.Value.Should().BeOfType<bool>();
((bool) annotation.Value).Should().BeFalse();
}
}
private List<OdcmVocabularyAnnotation> GetAnnotationsFromOneNoteSampleEntitySet(string entitySet)
{
IEdmModel model = SampleParsedEdmModel;
IEdmEntitySet sampleEntitySet = model.FindEntityContainer("OneNoteApi").FindEntitySet(entitySet);
return ODataVocabularyReader.GetOdcmAnnotations(model, sampleEntitySet).ToList();
}
private List<OdcmVocabularyAnnotation> GetAnnotationsFromOneNoteSampleEntityContainer()
{
IEdmModel model = SampleParsedEdmModel;
var sampleContainer = model.FindEntityContainer("OneNoteApi");
return ODataVocabularyReader.GetOdcmAnnotations(model, sampleContainer).ToList();
}
#region Helper methods
private static readonly IEdmModel SampleParsedEdmModel = GetSampleParsedEdmModel();
private static IEdmModel GetSampleParsedEdmModel()
{
IEdmModel edmModel;
IEnumerable<EdmError> errors;
if (!EdmxReader.TryParse(XmlReader.Create(new StringReader(ODataReader.v4UnitTests.Properties.Resources.OneNoteExampleEdmx)), out edmModel, out errors))
{
throw new InvalidOperationException("Failed to parse Edm model");
}
return edmModel;
}
}
#endregion
} | ysanghi/Vipr | test/ODataReader.v4UnitTests/Given_an_ODataVocabularyReader.cs | C# | mit | 10,044 |
/*================================================================================
code generated by: java2cpp
author: Zoran Angelov, mailto://baldzar@gmail.com
class: com.tencent.mm.sdk.openapi.SendAuth
================================================================================*/
#ifndef J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_COM_TENCENT_MM_SDK_OPENAPI_SENDAUTH_HPP_DECL
#define J2CPP_COM_TENCENT_MM_SDK_OPENAPI_SENDAUTH_HPP_DECL
namespace j2cpp { namespace android { namespace os { class Bundle; } } }
namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace com { namespace tencent { namespace mm { namespace sdk { namespace openapi { class BaseReq; } } } } } }
namespace j2cpp { namespace com { namespace tencent { namespace mm { namespace sdk { namespace openapi { class BaseResp; } } } } } }
#include <android/os/Bundle.hpp>
#include <com/tencent/mm/sdk/openapi/BaseReq.hpp>
#include <com/tencent/mm/sdk/openapi/BaseResp.hpp>
#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>
namespace j2cpp {
namespace com { namespace tencent { namespace mm { namespace sdk { namespace openapi {
class SendAuth;
namespace SendAuth_ {
class Req;
class Req
: public object<Req>
{
public:
J2CPP_DECLARE_CLASS
J2CPP_DECLARE_METHOD(0)
J2CPP_DECLARE_METHOD(1)
J2CPP_DECLARE_METHOD(2)
J2CPP_DECLARE_METHOD(3)
J2CPP_DECLARE_METHOD(4)
J2CPP_DECLARE_METHOD(5)
J2CPP_DECLARE_FIELD(0)
J2CPP_DECLARE_FIELD(1)
explicit Req(jobject jobj)
: object<Req>(jobj)
, scope(jobj)
, state(jobj)
{
}
operator local_ref<java::lang::Object>() const;
operator local_ref<com::tencent::mm::sdk::openapi::BaseReq>() const;
Req();
Req(local_ref< android::os::Bundle > const&);
jint getType();
void fromBundle(local_ref< android::os::Bundle > const&);
void toBundle(local_ref< android::os::Bundle > const&);
field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(0), J2CPP_FIELD_SIGNATURE(0), local_ref< java::lang::String > > scope;
field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(1), J2CPP_FIELD_SIGNATURE(1), local_ref< java::lang::String > > state;
}; //class Req
class Resp;
class Resp
: public object<Resp>
{
public:
J2CPP_DECLARE_CLASS
J2CPP_DECLARE_METHOD(0)
J2CPP_DECLARE_METHOD(1)
J2CPP_DECLARE_METHOD(2)
J2CPP_DECLARE_METHOD(3)
J2CPP_DECLARE_METHOD(4)
J2CPP_DECLARE_METHOD(5)
J2CPP_DECLARE_FIELD(0)
J2CPP_DECLARE_FIELD(1)
J2CPP_DECLARE_FIELD(2)
J2CPP_DECLARE_FIELD(3)
J2CPP_DECLARE_FIELD(4)
explicit Resp(jobject jobj)
: object<Resp>(jobj)
, userName(jobj)
, token(jobj)
, expireDate(jobj)
, state(jobj)
, resultUrl(jobj)
{
}
operator local_ref<java::lang::Object>() const;
operator local_ref<com::tencent::mm::sdk::openapi::BaseResp>() const;
Resp();
Resp(local_ref< android::os::Bundle > const&);
jint getType();
void fromBundle(local_ref< android::os::Bundle > const&);
void toBundle(local_ref< android::os::Bundle > const&);
field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(0), J2CPP_FIELD_SIGNATURE(0), local_ref< java::lang::String > > userName;
field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(1), J2CPP_FIELD_SIGNATURE(1), local_ref< java::lang::String > > token;
field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(2), J2CPP_FIELD_SIGNATURE(2), jint > expireDate;
field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(3), J2CPP_FIELD_SIGNATURE(3), local_ref< java::lang::String > > state;
field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(4), J2CPP_FIELD_SIGNATURE(4), local_ref< java::lang::String > > resultUrl;
}; //class Resp
} //namespace SendAuth_
class SendAuth
: public object<SendAuth>
{
public:
J2CPP_DECLARE_CLASS
J2CPP_DECLARE_METHOD(0)
typedef SendAuth_::Req Req;
typedef SendAuth_::Resp Resp;
explicit SendAuth(jobject jobj)
: object<SendAuth>(jobj)
{
}
operator local_ref<java::lang::Object>() const;
}; //class SendAuth
} //namespace openapi
} //namespace sdk
} //namespace mm
} //namespace tencent
} //namespace com
} //namespace j2cpp
#endif //J2CPP_COM_TENCENT_MM_SDK_OPENAPI_SENDAUTH_HPP_DECL
#else //J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_COM_TENCENT_MM_SDK_OPENAPI_SENDAUTH_HPP_IMPL
#define J2CPP_COM_TENCENT_MM_SDK_OPENAPI_SENDAUTH_HPP_IMPL
namespace j2cpp {
com::tencent::mm::sdk::openapi::SendAuth_::Req::operator local_ref<java::lang::Object>() const
{
return local_ref<java::lang::Object>(get_jobject());
}
com::tencent::mm::sdk::openapi::SendAuth_::Req::operator local_ref<com::tencent::mm::sdk::openapi::BaseReq>() const
{
return local_ref<com::tencent::mm::sdk::openapi::BaseReq>(get_jobject());
}
com::tencent::mm::sdk::openapi::SendAuth_::Req::Req()
: object<com::tencent::mm::sdk::openapi::SendAuth_::Req>(
call_new_object<
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_NAME(0),
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_SIGNATURE(0)
>()
)
, scope(get_jobject())
, state(get_jobject())
{
}
com::tencent::mm::sdk::openapi::SendAuth_::Req::Req(local_ref< android::os::Bundle > const &a0)
: object<com::tencent::mm::sdk::openapi::SendAuth_::Req>(
call_new_object<
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_NAME(1),
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_SIGNATURE(1)
>(a0)
)
, scope(get_jobject())
, state(get_jobject())
{
}
jint com::tencent::mm::sdk::openapi::SendAuth_::Req::getType()
{
return call_method<
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_NAME(2),
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_SIGNATURE(2),
jint
>(get_jobject());
}
void com::tencent::mm::sdk::openapi::SendAuth_::Req::fromBundle(local_ref< android::os::Bundle > const &a0)
{
return call_method<
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_NAME(3),
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_SIGNATURE(3),
void
>(get_jobject(), a0);
}
void com::tencent::mm::sdk::openapi::SendAuth_::Req::toBundle(local_ref< android::os::Bundle > const &a0)
{
return call_method<
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_NAME(4),
com::tencent::mm::sdk::openapi::SendAuth_::Req::J2CPP_METHOD_SIGNATURE(4),
void
>(get_jobject(), a0);
}
J2CPP_DEFINE_CLASS(com::tencent::mm::sdk::openapi::SendAuth_::Req,"com/tencent/mm/sdk/openapi/SendAuth$Req")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Req,0,"<init>","()V")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Req,1,"<init>","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Req,2,"getType","()I")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Req,3,"fromBundle","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Req,4,"toBundle","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Req,5,"checkArgs","()Z")
J2CPP_DEFINE_FIELD(com::tencent::mm::sdk::openapi::SendAuth_::Req,0,"scope","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(com::tencent::mm::sdk::openapi::SendAuth_::Req,1,"state","Ljava/lang/String;")
com::tencent::mm::sdk::openapi::SendAuth_::Resp::operator local_ref<java::lang::Object>() const
{
return local_ref<java::lang::Object>(get_jobject());
}
com::tencent::mm::sdk::openapi::SendAuth_::Resp::operator local_ref<com::tencent::mm::sdk::openapi::BaseResp>() const
{
return local_ref<com::tencent::mm::sdk::openapi::BaseResp>(get_jobject());
}
com::tencent::mm::sdk::openapi::SendAuth_::Resp::Resp()
: object<com::tencent::mm::sdk::openapi::SendAuth_::Resp>(
call_new_object<
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_NAME(0),
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_SIGNATURE(0)
>()
)
, userName(get_jobject())
, token(get_jobject())
, expireDate(get_jobject())
, state(get_jobject())
, resultUrl(get_jobject())
{
}
com::tencent::mm::sdk::openapi::SendAuth_::Resp::Resp(local_ref< android::os::Bundle > const &a0)
: object<com::tencent::mm::sdk::openapi::SendAuth_::Resp>(
call_new_object<
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_NAME(1),
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_SIGNATURE(1)
>(a0)
)
, userName(get_jobject())
, token(get_jobject())
, expireDate(get_jobject())
, state(get_jobject())
, resultUrl(get_jobject())
{
}
jint com::tencent::mm::sdk::openapi::SendAuth_::Resp::getType()
{
return call_method<
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_NAME(2),
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_SIGNATURE(2),
jint
>(get_jobject());
}
void com::tencent::mm::sdk::openapi::SendAuth_::Resp::fromBundle(local_ref< android::os::Bundle > const &a0)
{
return call_method<
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_NAME(3),
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_SIGNATURE(3),
void
>(get_jobject(), a0);
}
void com::tencent::mm::sdk::openapi::SendAuth_::Resp::toBundle(local_ref< android::os::Bundle > const &a0)
{
return call_method<
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_CLASS_NAME,
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_NAME(4),
com::tencent::mm::sdk::openapi::SendAuth_::Resp::J2CPP_METHOD_SIGNATURE(4),
void
>(get_jobject(), a0);
}
J2CPP_DEFINE_CLASS(com::tencent::mm::sdk::openapi::SendAuth_::Resp,"com/tencent/mm/sdk/openapi/SendAuth$Resp")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,0,"<init>","()V")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,1,"<init>","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,2,"getType","()I")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,3,"fromBundle","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,4,"toBundle","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,5,"checkArgs","()Z")
J2CPP_DEFINE_FIELD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,0,"userName","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,1,"token","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,2,"expireDate","I")
J2CPP_DEFINE_FIELD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,3,"state","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(com::tencent::mm::sdk::openapi::SendAuth_::Resp,4,"resultUrl","Ljava/lang/String;")
com::tencent::mm::sdk::openapi::SendAuth::operator local_ref<java::lang::Object>() const
{
return local_ref<java::lang::Object>(get_jobject());
}
J2CPP_DEFINE_CLASS(com::tencent::mm::sdk::openapi::SendAuth,"com/tencent/mm/sdk/openapi/SendAuth")
J2CPP_DEFINE_METHOD(com::tencent::mm::sdk::openapi::SendAuth,0,"<init>","()V")
} //namespace j2cpp
#endif //J2CPP_COM_TENCENT_MM_SDK_OPENAPI_SENDAUTH_HPP_IMPL
#endif //J2CPP_INCLUDE_IMPLEMENTATION
| hyEvans/ph-open | proj.android/jni/puzzleHero/com/tencent/mm/sdk/openapi/SendAuth.hpp | C++ | mit | 11,739 |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BrightstarDB.Polaris {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Strings {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Strings() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BrightstarDB.Polaris.Strings", typeof(Strings).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Polaris Management Tool for BrightstarDB.
/// </summary>
internal static string AboutHeading {
get {
return ResourceManager.GetString("AboutHeading", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Release: {0}, Build: {1}
///
///Copyright (c) 2013 Khalil Ahmed, Graham Moore.
///
///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:
/// [rest of string was truncated]";.
/// </summary>
internal static string AboutInfo {
get {
return ResourceManager.GetString("AboutInfo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This application makes use of the following open-source components:
///
///dotNetRDF (http://www.dotnetrdf.org/)
///------------------------------------------
///Copyright (c) 2011 Rob Vesse
///
///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 Softwa [rest of string was truncated]";.
/// </summary>
internal static string Acknowledgements {
get {
return ResourceManager.GetString("Acknowledgements", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Are you sure you want to delete the store '{0}' from the server ?
///This operation cannot be undone!.
/// </summary>
internal static string DeleteStoreDialogContent {
get {
return ResourceManager.GetString("DeleteStoreDialogContent", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete Store ?.
/// </summary>
internal static string DeleteStoreDialogTitle {
get {
return ResourceManager.GetString("DeleteStoreDialogTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select the root folder for the Brightstar service. This folder will contain a subfolder for each store created within the service..
/// </summary>
internal static string DirectorySelectorDescription {
get {
return ResourceManager.GetString("DirectorySelectorDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Are you sure you want to permanently remove the server connection '{0}' from the server list ?.
/// </summary>
internal static string DisconnectServerDialogContent {
get {
return ResourceManager.GetString("DisconnectServerDialogContent", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remove Server from Server List ?.
/// </summary>
internal static string DisconnectServerDialogTitle {
get {
return ResourceManager.GetString("DisconnectServerDialogTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The export of data from store '{0}' has completed successfully. The data can be found on the BrightstarDB server under the import directory..
/// </summary>
internal static string ExportCompletedDialogMsg {
get {
return ResourceManager.GetString("ExportCompletedDialogMsg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export Completed.
/// </summary>
internal static string ExportCompletedDialogTitle {
get {
return ResourceManager.GetString("ExportCompletedDialogTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The export of data from store '{0}' failed. Check the export tab for details..
/// </summary>
internal static string ExportFailedDialogMsg {
get {
return ResourceManager.GetString("ExportFailedDialogMsg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export Failed.
/// </summary>
internal static string ExportFailedDialogTitle {
get {
return ResourceManager.GetString("ExportFailedDialogTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} Export.
/// </summary>
internal static string ExportTabDefaultTitle {
get {
return ResourceManager.GetString("ExportTabDefaultTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to An unexpected error prevented the export job from running..
/// </summary>
internal static string ExportUnexpectedErrorMsg {
get {
return ResourceManager.GetString("ExportUnexpectedErrorMsg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to NTriples (*.nt)|*.nt;*.nt.gz|NQuads (*.nq)|*.nq;*.nq.gz|RDF/XML (*.rdf)|*.rdf;*.rdf.gz|RDF/JSON (*.rj;*.json)|*.rj;*.json;*.rj.gz;*.json.gz|Notation3 (*.n3)|*.n3;*.n3.gz|Turtle (*.ttl)|*.ttl;*.ttl.gz|All Files(*.*)|*.*.
/// </summary>
internal static string FileSelectorOptions {
get {
return ResourceManager.GetString("FileSelectorOptions", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} History.
/// </summary>
internal static string HistoryTabDefaultTitle {
get {
return ResourceManager.GetString("HistoryTabDefaultTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The import of data into store '{0}' has completed successfully..
/// </summary>
internal static string ImportCompletedDialogMsg {
get {
return ResourceManager.GetString("ImportCompletedDialogMsg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Import Completed.
/// </summary>
internal static string ImportCompletedDialogTitle {
get {
return ResourceManager.GetString("ImportCompletedDialogTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The import of data into store '{0}' failed. Check the import tab for details..
/// </summary>
internal static string ImportFailedDialogMsg {
get {
return ResourceManager.GetString("ImportFailedDialogMsg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Import Failed.
/// </summary>
internal static string ImportFailedDialogTitle {
get {
return ResourceManager.GetString("ImportFailedDialogTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cannot find import file '{0}'..
/// </summary>
internal static string ImportFileNotFound {
get {
return ResourceManager.GetString("ImportFileNotFound", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The file '{0}' is quite large (over 50MB).
///
///A local import may require a large amount of memory on this machine as well as a fast network connection to the server.
///If possible consider copying the file to the BrightstarDB server's import folder and using a Remote import job instead.
///
///Are you sure you want to attempt to import this file with a Local import job ?.
/// </summary>
internal static string ImportFileSizeWarningMsg {
get {
return ResourceManager.GetString("ImportFileSizeWarningMsg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File Size Warning.
/// </summary>
internal static string ImportFileSizeWarningTitle {
get {
return ResourceManager.GetString("ImportFileSizeWarningTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The import file is too large to be processed in memory on the client. Please copy this file to the server and use a Remote import instead..
/// </summary>
internal static string ImportFileTooLarge {
get {
return ResourceManager.GetString("ImportFileTooLarge", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to An older Polaris configuration file has been found. Do you want to import this existing configuration ? If you choose No, a new empty configuration will be created for you..
/// </summary>
internal static string ImportLegacyConfigurationMessage {
get {
return ResourceManager.GetString("ImportLegacyConfigurationMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Import Old Configuration.
/// </summary>
internal static string ImportLegacyConfigurationTitle {
get {
return ResourceManager.GetString("ImportLegacyConfigurationTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} Import.
/// </summary>
internal static string ImportTabDefaultTitle {
get {
return ResourceManager.GetString("ImportTabDefaultTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to An unexpected error prevented the import job from running..
/// </summary>
internal static string ImportUnexpectedErrorMsg {
get {
return ResourceManager.GetString("ImportUnexpectedErrorMsg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to A Connection specifies how Polaris should connect to a BrightstarDB store. This may be either a direct connection to the directory or (recommended) a connection to a BrightstarDB server.
///
///You currently have no connections defined. Would you like to create a new connection now ?.
/// </summary>
internal static string NoConnectionsMessage {
get {
return ResourceManager.GetString("NoConnectionsMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No Connections Defined.
/// </summary>
internal static string NoConnectionsTitle {
get {
return ResourceManager.GetString("NoConnectionsTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to An error occurred when parsing the content of the file {0}. Cause: {1}.
/// </summary>
internal static string ParseErrorDescription {
get {
return ResourceManager.GetString("ParseErrorDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error Parsing RDF File.
/// </summary>
internal static string ParseErrorTitle {
get {
return ResourceManager.GetString("ParseErrorTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to New Query.
/// </summary>
internal static string QueryTabDefaultTitle {
get {
return ResourceManager.GetString("QueryTabDefaultTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} Statistics.
/// </summary>
internal static string StatisticsTabDefaultTitle {
get {
return ResourceManager.GetString("StatisticsTabDefaultTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Failed to create new store. {0}.
/// </summary>
internal static string StoreCreateFailed {
get {
return ResourceManager.GetString("StoreCreateFailed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Store Creation Failed.
/// </summary>
internal static string StoreCreateFailedTitle {
get {
return ResourceManager.GetString("StoreCreateFailedTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Transaction failed..
/// </summary>
internal static string TransactionFailed {
get {
return ResourceManager.GetString("TransactionFailed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The transaction completed successfully..
/// </summary>
internal static string TransactionSuccess {
get {
return ResourceManager.GetString("TransactionSuccess", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to New Transaction.
/// </summary>
internal static string TransactionTabDefaultTitle {
get {
return ResourceManager.GetString("TransactionTabDefaultTitle", resourceCulture);
}
}
}
}
| kentcb/BrightstarDB | src/tools/Polaris/BrightstarDB.Polaris/Strings.Designer.cs | C# | mit | 18,340 |
# -*- coding: utf-8 -*-
"""
Various i18n functions.
Helper functions for both the internal translation system
and for TranslateWiki-based translations.
By default messages are assumed to reside in a package called
'scripts.i18n'. In pywikibot 2.0, that package is not packaged
with pywikibot, and pywikibot 2.0 does not have a hard dependency
on any i18n messages. However, there are three user input questions
in pagegenerators which will use i18 messages if they can be loaded.
The default message location may be changed by calling
L{set_message_package} with a package name. The package must contain
an __init__.py, and a message bundle called 'pywikibot' containing
messages. See L{twntranslate} for more information on the messages.
"""
#
# (C) Pywikibot team, 2004-2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id$'
#
import sys
import re
import locale
import json
import os
import pkgutil
from collections import defaultdict
from pywikibot import Error
from .plural import plural_rules
import pywikibot
from . import config2 as config
if sys.version_info[0] > 2:
basestring = (str, )
PLURAL_PATTERN = r'{{PLURAL:(?:%\()?([^\)]*?)(?:\)d)?\|(.*?)}}'
# Package name for the translation messages. The messages data must loaded
# relative to that package name. In the top of this package should be
# directories named after for each script/message bundle, and each directory
# should contain JSON files called <lang>.json
_messages_package_name = 'scripts.i18n'
# Flag to indicate whether translation messages are available
_messages_available = None
# Cache of translated messages
_cache = defaultdict(dict)
def set_messages_package(package_name):
"""Set the package name where i18n messages are located."""
global _messages_package_name
global _messages_available
_messages_package_name = package_name
_messages_available = None
def messages_available():
"""
Return False if there are no i18n messages available.
To determine if messages are available, it looks for the package name
set using L{set_messages_package} for a message bundle called 'pywikibot'
containing messages.
@rtype: bool
"""
global _messages_available
if _messages_available is not None:
return _messages_available
try:
__import__(_messages_package_name)
except ImportError:
_messages_available = False
return False
_messages_available = True
return True
def _altlang(code):
"""Define fallback languages for particular languages.
If no translation is available to a specified language, translate() will
try each of the specified fallback languages, in order, until it finds
one with a translation, with 'en' and '_default' as a last resort.
For example, if for language 'xx', you want the preference of languages
to be: xx > fr > ru > en, you let this method return ['fr', 'ru'].
This code is used by other translating methods below.
@param code: The language code
@type code: string
@return: language codes
@rtype: list of str
"""
# Akan
if code in ['ak', 'tw']:
return ['ak', 'tw']
# Amharic
if code in ['aa', 'ti']:
return ['am']
# Arab
if code in ['arc', 'arz', 'so']:
return ['ar']
if code == 'kab':
return ['ar', 'fr']
# Bulgarian
if code in ['cu', 'mk']:
return ['bg', 'sr', 'sh']
# Czech
if code in ['cs', 'sk']:
return ['cs', 'sk']
# German
if code in ['bar', 'frr', 'ksh', 'pdc', 'pfl']:
return ['de']
if code == 'lb':
return ['de', 'fr']
if code in ['als', 'gsw']:
return ['als', 'gsw', 'de']
if code == 'nds':
return ['nds-nl', 'de']
if code in ['dsb', 'hsb']:
return ['hsb', 'dsb', 'de']
if code == 'sli':
return ['de', 'pl']
if code == 'rm':
return ['de', 'it']
if code == 'stq':
return ['nds', 'de']
# Greek
if code in ['grc', 'pnt']:
return ['el']
# Esperanto
if code in ['io', 'nov']:
return ['eo']
# Spanish
if code in ['an', 'arn', 'ast', 'ay', 'ca', 'ext', 'lad', 'nah', 'nv', 'qu',
'yua']:
return ['es']
if code in ['gl', 'gn']:
return ['es', 'pt']
if code == 'eu':
return ['es', 'fr']
if code == 'cbk-zam':
return ['es', 'tl']
# Estonian
if code in ['fiu-vro', 'vro']:
return ['fiu-vro', 'vro', 'et']
if code == 'liv':
return ['et', 'lv']
# Persian (Farsi)
if code == 'ps':
return ['fa']
if code in ['glk', 'mzn']:
return ['glk', 'mzn', 'fa', 'ar']
# Finnish
if code == 'vep':
return ['fi', 'ru']
if code == 'fit':
return ['fi', 'sv']
# French
if code in ['bm', 'br', 'ht', 'kg', 'ln', 'mg', 'nrm', 'pcd',
'rw', 'sg', 'ty', 'wa']:
return ['fr']
if code == 'oc':
return ['fr', 'ca', 'es']
if code in ['co', 'frp']:
return ['fr', 'it']
# Hindi
if code in ['sa']:
return ['hi']
if code in ['ne', 'new']:
return ['ne', 'new', 'hi']
if code in ['bh', 'bho']:
return ['bh', 'bho']
# Indonesian and Malay
if code in ['ace', 'bug', 'bjn', 'id', 'jv', 'ms', 'su']:
return ['id', 'ms', 'jv']
if code == 'map-bms':
return ['jv', 'id', 'ms']
# Inuit languages
if code in ['ik', 'iu']:
return ['iu', 'kl']
if code == 'kl':
return ['da', 'iu', 'no', 'nb']
# Italian
if code in ['eml', 'fur', 'lij', 'lmo', 'nap', 'pms', 'roa-tara', 'sc',
'scn', 'vec']:
return ['it']
# Lithuanian
if code in ['bat-smg', 'sgs']:
return ['bat-smg', 'sgs', 'lt']
# Latvian
if code == 'ltg':
return ['lv']
# Dutch
if code in ['af', 'fy', 'li', 'pap', 'srn', 'vls', 'zea']:
return ['nl']
if code == ['nds-nl']:
return ['nds', 'nl']
# Polish
if code in ['csb', 'szl']:
return ['pl']
# Portuguese
if code in ['fab', 'mwl', 'tet']:
return ['pt']
# Romanian
if code in ['roa-rup', 'rup']:
return ['roa-rup', 'rup', 'ro']
if code == 'mo':
return ['ro']
# Russian and Belarusian
if code in ['ab', 'av', 'ba', 'bxr', 'ce', 'cv', 'inh', 'kk', 'koi', 'krc',
'kv', 'ky', 'lbe', 'lez', 'mdf', 'mhr', 'mn', 'mrj', 'myv',
'os', 'sah', 'tg', 'udm', 'uk', 'xal']:
return ['ru']
if code in ['kbd', 'ady']:
return ['kbd', 'ady', 'ru']
if code == 'tt':
return ['tt-cyrl', 'ru']
if code in ['be', 'be-x-old', 'be-tarask']:
return ['be', 'be-x-old', 'be-tarask', 'ru']
if code == 'kaa':
return ['uz', 'ru']
# Serbocroatian
if code in ['bs', 'hr', 'sh']:
return ['sh', 'hr', 'bs', 'sr', 'sr-el']
if code == 'sr':
return ['sr-el', 'sh', 'hr', 'bs']
# Tagalog
if code in ['bcl', 'ceb', 'ilo', 'pag', 'pam', 'war']:
return ['tl']
# Turkish and Kurdish
if code in ['diq', 'ku']:
return ['ku', 'ku-latn', 'tr']
if code == 'gag':
return ['tr']
if code == 'ckb':
return ['ku']
# Ukrainian
if code in ['crh', 'crh-latn']:
return ['crh', 'crh-latn', 'uk', 'ru']
if code in ['rue']:
return ['uk', 'ru']
# Chinese
if code in ['zh-classical', 'lzh', 'minnan', 'zh-min-nan', 'nan', 'zh-tw',
'zh', 'zh-hans']:
return ['zh', 'zh-hans', 'zh-tw', 'zh-cn', 'zh-classical', 'lzh']
if code in ['cdo', 'gan', 'hak', 'ii', 'wuu', 'za', 'zh-classical', 'lzh',
'zh-cn', 'zh-yue', 'yue']:
return ['zh', 'zh-hans' 'zh-cn', 'zh-tw', 'zh-classical', 'lzh']
# Scandinavian languages
if code in ['da', 'sv']:
return ['da', 'no', 'nb', 'sv', 'nn']
if code in ['fo', 'is']:
return ['da', 'no', 'nb', 'nn', 'sv']
if code == 'nn':
return ['no', 'nb', 'sv', 'da']
if code in ['no', 'nb']:
return ['no', 'nb', 'da', 'nn', 'sv']
if code == 'se':
return ['sv', 'no', 'nb', 'nn', 'fi']
# Other languages
if code in ['bi', 'tpi']:
return ['bi', 'tpi']
if code == 'yi':
return ['he', 'de']
if code in ['ia', 'ie']:
return ['ia', 'la', 'it', 'fr', 'es']
if code == 'xmf':
return ['ka']
if code in ['nso', 'st']:
return ['st', 'nso']
if code in ['kj', 'ng']:
return ['kj', 'ng']
if code in ['meu', 'hmo']:
return ['meu', 'hmo']
if code == ['as']:
return ['bn']
# Default value
return []
class TranslationError(Error, ImportError):
"""Raised when no correct translation could be found."""
# Inherits from ImportError, as this exception is now used
# where previously an ImportError would have been raised,
# and may have been caught by scripts as such.
pass
def _get_translation(lang, twtitle):
"""
Return message of certain twtitle if exists.
For internal use, don't use it directly.
"""
if twtitle in _cache[lang]:
return _cache[lang][twtitle]
message_bundle = twtitle.split('-')[0]
trans_text = None
filename = '%s/%s.json' % (message_bundle, lang)
try:
trans_text = pkgutil.get_data(
_messages_package_name, filename).decode('utf-8')
except (OSError, IOError): # file open can cause several exceptions
_cache[lang][twtitle] = None
return
transdict = json.loads(trans_text)
_cache[lang].update(transdict)
try:
return transdict[twtitle]
except KeyError:
return
def _extract_plural(code, message, parameters):
"""Check for the plural variants in message and replace them.
@param message: the message to be replaced
@type message: unicode string
@param parameters: plural parameters passed from other methods
@type parameters: int, basestring, tuple, list, dict
"""
plural_items = re.findall(PLURAL_PATTERN, message)
if plural_items: # we found PLURAL patterns, process it
if len(plural_items) > 1 and isinstance(parameters, (tuple, list)) and \
len(plural_items) != len(parameters):
raise ValueError("Length of parameter does not match PLURAL "
"occurrences.")
i = 0
for selector, variants in plural_items:
if isinstance(parameters, dict):
num = int(parameters[selector])
elif isinstance(parameters, basestring):
num = int(parameters)
elif isinstance(parameters, (tuple, list)):
num = int(parameters[i])
i += 1
else:
num = parameters
# TODO: check against plural_rules[code]['nplurals']
try:
index = plural_rules[code]['plural'](num)
except KeyError:
index = plural_rules['_default']['plural'](num)
except TypeError:
# we got an int, not a function
index = plural_rules[code]['plural']
repl = variants.split('|')[index]
message = re.sub(PLURAL_PATTERN, repl, message, count=1)
return message
DEFAULT_FALLBACK = ('_default', )
def translate(code, xdict, parameters=None, fallback=False):
"""Return the most appropriate translation from a translation dict.
Given a language code and a dictionary, returns the dictionary's value for
key 'code' if this key exists; otherwise tries to return a value for an
alternative language that is most applicable to use on the wiki in
language 'code' except fallback is False.
The language itself is always checked first, then languages that
have been defined to be alternatives, and finally English. If none of
the options gives result, we just take the one language from xdict which may
not be always the same. When fallback is iterable it'll return None if no
code applies (instead of returning one).
For PLURAL support have a look at the twntranslate method
@param code: The language code
@type code: string or Site object
@param xdict: dictionary with language codes as keys or extended dictionary
with family names as keys containing language dictionaries or
a single (unicode) string. May contain PLURAL tags as
described in twntranslate
@type xdict: dict, string, unicode
@param parameters: For passing (plural) parameters
@type parameters: dict, string, unicode, int
@param fallback: Try an alternate language code. If it's iterable it'll
also try those entries and choose the first match.
@type fallback: boolean or iterable
"""
family = pywikibot.config.family
# If a site is given instead of a code, use its language
if hasattr(code, 'code'):
family = code.family.name
code = code.code
# Check whether xdict has multiple projects
if isinstance(xdict, dict):
if family in xdict:
xdict = xdict[family]
elif 'wikipedia' in xdict:
xdict = xdict['wikipedia']
# Get the translated string
if not isinstance(xdict, dict):
trans = xdict
elif not xdict:
trans = None
else:
codes = [code]
if fallback is True:
codes += _altlang(code) + ['_default', 'en']
elif fallback is not False:
codes += list(fallback)
for code in codes:
if code in xdict:
trans = xdict[code]
break
else:
if fallback is not True:
# this shouldn't simply return "any one" code but when fallback
# was True before 65518573d2b0, it did just that. When False it
# did just return None. It's now also returning None in the new
# iterable mode.
return
code = list(xdict.keys())[0]
trans = xdict[code]
if trans is None:
return # return None if we have no translation found
if parameters is None:
return trans
# else we check for PLURAL variants
trans = _extract_plural(code, trans, parameters)
if parameters:
try:
return trans % parameters
except (KeyError, TypeError):
# parameter is for PLURAL variants only, don't change the string
pass
return trans
def twtranslate(code, twtitle, parameters=None, fallback=True):
"""
Translate a message.
The translations are retrieved from json files in messages_package_name.
fallback parameter must be True for i18n and False for L10N or testing
purposes.
@param code: The language code
@param twtitle: The TranslateWiki string title, in <package>-<key> format
@param parameters: For passing parameters.
@param fallback: Try an alternate language code
@type fallback: boolean
"""
if not messages_available():
raise TranslationError(
'Unable to load messages package %s for bundle %s'
'\nIt can happen due to lack of i18n submodule or files. '
'Read https://mediawiki.org/wiki/PWB/i18n'
% (_messages_package_name, twtitle))
code_needed = False
# If a site is given instead of a code, use its language
if hasattr(code, 'code'):
lang = code.code
# check whether we need the language code back
elif isinstance(code, list):
lang = code.pop()
code_needed = True
else:
lang = code
# There are two possible failure modes: the translation dict might not have
# the language altogether, or a specific key could be untranslated. Both
# modes are caught with the KeyError.
langs = [lang]
if fallback:
langs += _altlang(lang) + ['en']
for alt in langs:
trans = _get_translation(alt, twtitle)
if trans:
break
else:
raise TranslationError(
'No English translation has been defined for TranslateWiki key'
' %r\nIt can happen due to lack of i18n submodule or files. '
'Read https://mediawiki.org/wiki/PWB/i18n' % twtitle)
# send the language code back via the given list
if code_needed:
code.append(alt)
if parameters:
return trans % parameters
else:
return trans
# Maybe this function should be merged with twtranslate
def twntranslate(code, twtitle, parameters=None):
r"""Translate a message with plural support.
Support is implemented like in MediaWiki extension. If the TranslateWiki
message contains a plural tag inside which looks like::
{{PLURAL:<number>|<variant1>|<variant2>[|<variantn>]}}
it takes that variant calculated by the plural_rules depending on the number
value. Multiple plurals are allowed.
As an examples, if we had several json dictionaries in test folder like:
en.json:
{
"test-plural": "Bot: Changing %(num)s {{PLURAL:%(num)d|page|pages}}.",
}
fr.json:
{
"test-plural": "Robot: Changer %(descr)s {{PLURAL:num|une page|quelques pages}}.",
}
and so on.
>>> from pywikibot import i18n
>>> i18n.set_messages_package('tests.i18n')
>>> # use a number
>>> str(i18n.twntranslate('en', 'test-plural', 0) % {'num': 'no'})
'Bot: Changing no pages.'
>>> # use a string
>>> str(i18n.twntranslate('en', 'test-plural', '1') % {'num': 'one'})
'Bot: Changing one page.'
>>> # use a dictionary
>>> str(i18n.twntranslate('en', 'test-plural', {'num':2}))
'Bot: Changing 2 pages.'
>>> # use additional format strings
>>> str(i18n.twntranslate('fr', 'test-plural', {'num': 1, 'descr': 'seulement'}))
'Robot: Changer seulement une page.'
>>> # use format strings also outside
>>> str(i18n.twntranslate('fr', 'test-plural', 10) % {'descr': 'seulement'})
'Robot: Changer seulement quelques pages.'
The translations are retrieved from i18n.<package>, based on the callers
import table.
@param code: The language code
@param twtitle: The TranslateWiki string title, in <package>-<key> format
@param parameters: For passing (plural) parameters.
"""
# If a site is given instead of a code, use its language
if hasattr(code, 'code'):
code = code.code
# we send the code via list and get the alternate code back
code = [code]
trans = twtranslate(code, twtitle)
# get the alternate language code modified by twtranslate
lang = code.pop()
# check for PLURAL variants
trans = _extract_plural(lang, trans, parameters)
# we always have a dict for replacement of translatewiki messages
if parameters and isinstance(parameters, dict):
try:
return trans % parameters
except KeyError:
# parameter is for PLURAL variants only, don't change the string
pass
return trans
def twhas_key(code, twtitle):
"""
Check if a message has a translation in the specified language code.
The translations are retrieved from i18n.<package>, based on the callers
import table.
No code fallback is made.
@param code: The language code
@param twtitle: The TranslateWiki string title, in <package>-<key> format
"""
# If a site is given instead of a code, use its language
if hasattr(code, 'code'):
code = code.code
transdict = _get_translation(code, twtitle)
if transdict is None:
return False
return True
def twget_keys(twtitle):
"""
Return all language codes for a special message.
@param twtitle: The TranslateWiki string title, in <package>-<key> format
"""
# obtain the directory containing all the json files for this package
package = twtitle.split("-")[0]
mod = __import__(_messages_package_name, fromlist=[str('__file__')])
pathname = os.path.join(os.path.dirname(mod.__file__), package)
# build a list of languages in that directory
langs = [filename.partition('.')[0]
for filename in sorted(os.listdir(pathname))
if filename.endswith('.json')]
# exclude languages does not have this specific message in that package
# i.e. an incomplete set of translated messages.
return [lang for lang in langs
if lang != 'qqq' and
_get_translation(lang, twtitle)]
def input(twtitle, parameters=None, password=False, fallback_prompt=None):
"""
Ask the user a question, return the user's answer.
The prompt message is retrieved via L{twtranslate} and either uses the
config variable 'userinterface_lang' or the default locale as the language
code.
@param twtitle: The TranslateWiki string title, in <package>-<key> format
@param parameters: The values which will be applied to the translated text
@param password: Hides the user's input (for password entry)
@param fallback_prompt: The English prompt if i18n is not available.
@rtype: unicode string
"""
if not messages_available():
if not fallback_prompt:
raise TranslationError(
'Unable to load messages package %s for bundle %s'
% (_messages_package_name, twtitle))
else:
prompt = fallback_prompt
else:
code = config.userinterface_lang or \
locale.getdefaultlocale()[0].split('_')[0]
prompt = twtranslate(code, twtitle, parameters)
return pywikibot.input(prompt, password)
| emijrp/pywikibot-core | pywikibot/i18n.py | Python | mit | 21,745 |
/*
* Copyright (c) 2015 by Rafael Angel Aznar Aparici (rafaaznar at gmail dot com)
*
* sisane: The stunning micro-library that helps you to develop easily
* AJAX web applications by using Angular.js 1.x & sisane-server
* sisane is distributed under the MIT License (MIT)
* Sources at https://github.com/rafaelaznar/
*
* 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.
*
*/
'use strict';
moduloEpisodio.controller('EpisodioViewpopController', ['$scope', '$routeParams', 'serverService', 'episodioService', '$location', '$uibModalInstance', 'id',
function ($scope, $routeParams, serverService, episodioService, $location, $uibModalInstance, id) {
$scope.fields = episodioService.getFields();
$scope.obtitle = episodioService.getObTitle();
$scope.icon = episodioService.getIcon();
$scope.ob = episodioService.getTitle();
$scope.title = "Vista de " + $scope.obtitle;
$scope.id = id;
$scope.status = null;
$scope.debugging = serverService.debugging();
serverService.promise_getOne($scope.ob, $scope.id).then(function (response) {
if (response.status == 200) {
if (response.data.status == 200) {
$scope.status = null;
$scope.bean = response.data.message;
var filter = "and,id_medico,equa," + $scope.bean.obj_medico.id;
serverService.promise_getPage("usuario", 1, 1, filter).then(function (data) {
if (data.data.message.length > 0)
$scope.medico = data.data.message[0];
});
} else {
$scope.status = "Error en la recepción de datos del servidor";
}
} else {
$scope.status = "Error en la recepción de datos del servidor";
}
}).catch(function (data) {
$scope.status = "Error en la recepción de datos del servidor";
});
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
}
}]); | Ecoivan/sisane-client | public_html/js/episodio/viewpop.js | JavaScript | mit | 3,146 |
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_moj_peoplefinder_session'
| ministryofjustice/peoplefinder | config/initializers/session_store.rb | Ruby | mit | 148 |
'use strict';
var path = require('path');
var gulp = require('gulp');
var conf = require('./conf');
var browserSync = require('browser-sync');
function isOnlyChange(event) {
return event.type === 'changed';
}
gulp.task('watch', ['inject'], function () {
gulp.watch([path.join(conf.paths.src, '/*.html'), 'bower.json'], ['inject']);
gulp.watch([
path.join(conf.paths.src, '/assets/styles/css/**/*.css'),
path.join(conf.paths.src, '/assets/styles/less/**/*.less')
], function(event) {
if(isOnlyChange(event)) {
gulp.start('own-styles');
} else {
gulp.start('inject');
}
});
gulp.watch([
path.join(conf.paths.src, '/app/**/*.css'),
path.join(conf.paths.src, '/app/**/*.less')
], function(event) {
if(isOnlyChange(event)) {
gulp.start('styles');
} else {
gulp.start('inject');
}
});
gulp.watch(path.join(conf.paths.src, '/app/**/*.js'), function(event) {
if(isOnlyChange(event)) {
gulp.start('scripts');
} else {
gulp.start('inject');
}
});
gulp.watch(path.join(conf.paths.src, '/app/**/*.html'), function(event) {
browserSync.reload(event.path);
});
});
| devmark/laravel-angular-cms | backend/gulp/watch.js | JavaScript | mit | 1,176 |
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Header$ */
#include <ctype.h>
#include <stdlib.h>
/* We do not use strtol here for backwards compatibility in behaviour on
overflow.
*/
long
atol(register const char *nptr)
{
long total = 0;
int minus = 0;
while (isspace(*nptr)) nptr++;
if (*nptr == '+') nptr++;
else if (*nptr == '-') {
minus = 1;
nptr++;
}
while (isdigit(*nptr)) {
total *= 10;
total += (*nptr++ - '0');
}
return minus ? -total : total;
}
| ducis/operating-system-labs | src.clean/lib/libc/ansi/atol.c | C | mit | 629 |
.model-icon { min-width: 20px !important; display: inline-block !important; margin-left: 2px; }
.table a { display: block; }
/*------------------ Admin ------------------*/
.controller-admin .plugin-list { list-style: none; margin: 0; padding: 0; }
.controller-admin .plugin-list a { display: block; padding: 5px 15px; }
.controller-admin .plugin-list a.float-right { display: none; }
.controller-admin .plugin-list li:hover a.float-right { display: block; color: #fff; }
.controller-admin .plugin-list a:hover { background: #45c5eb; color: #fff; border-radius: .3rem; }
.controller-admin .plugin-list a:hover .model-icon { color: #fff; }
.controller-admin .plugin-list a:hover .text-muted { color: #dbf1fa; }
/*------------------ CRUD ------------------*/
.controller-crud .associations { margin: 2rem 0; }
.controller-crud .associations h3 { margin-bottom: 1rem; }
/*------------------ ACL ------------------*/
.controller-acl .table { width: auto; }
.controller-acl .table td { padding: 0; }
.controller-acl .table a { display: block; padding: 1rem; color: #000; }
.controller-acl .table a span { opacity: .2; }
.controller-acl .table a:hover { text-decoration: none; }
.controller-acl .table a:hover span { opacity: 1; }
.controller-acl .table .permission a { text-align: center; }
.controller-acl .table .permission .action.allow { background-color: #e7f2dd; }
.controller-acl .table .permission .action.inherit { background-color: #dbf1fa; }
.controller-acl .table .permission .action.deny { background-color: #fdc5c1; }
.controller-acl .matrix-head { background: #1d1f21 !important; border-color: #52555a !important; color: #fff; }
.controller-acl .matrix-head a { color: #E5E5E5; }
.controller-acl .matrix-head a:hover { color: #fff; }
.controller-acl .matrix-head.matrix-y { min-width: 150px; }
/*------------------ Logs ------------------*/
.controller-logs table tbody a { display: inline-block; }
/*------------------ Reports ------------------*/
.controller-reports .reported-item { margin: 2rem 0 1rem 0; }
.controller-reports .reported-item h3 { margin-bottom: 1rem; }
/*------------------ Upload ------------------*/
.controller-upload .field .col.span-2 { margin-right: 1.5rem; }
.controller-upload .field .field-col .checkbox label { margin-left: 5px; }
.controller-upload .field .field-help { vertical-align: middle; margin: 8px 0 0 10px; display: inline-block; }
.controller-upload .field textarea { min-height: 100px; }
.controller-upload .splash { padding: 100px; text-align: center; border: 1px solid #e5e5e5; background: #fbfbfb; border-radius: .3em; }
.controller-upload .splash h2 { margin-bottom: 25px; }
/*----------------- Form -----------------*/
.field-null { display: inline-block; margin-left: 10px; }
.field-null label { margin-left: 5px; font-weight: normal; }
.field-null input { top: 1px; position: relative; }
/*----------------- Table -----------------*/
.type-integer,
.type-boolean,
.type-enum,
.type-float { text-align: center !important; }
.type-datetime { text-align: right !important; }
.col-checkbox { width: 15px; }
.col-actions { width: 15px; padding: .5rem !important; }
.col-actions .button { display: inline-block; padding: 3px 4px; float: none; font-size: .8rem; } | milesj/admin | webroot/css/admin.css | CSS | mit | 3,235 |
<?php
/**
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace Icewind\SMB;
use Icewind\SMB\Exception\DependencyException;
use Icewind\SMB\Exception\Exception;
/**
* Use existing kerberos ticket to authenticate and reuse the apache ticket cache (mod_auth_kerb)
*/
class KerberosApacheAuth extends KerberosAuth implements IAuth {
/** @var string */
private $ticketPath = "";
/** @var bool */
private $init = false;
/** @var string|false */
private $ticketName;
public function __construct() {
$this->ticketName = getenv("KRB5CCNAME");
}
/**
* Copy the ticket to a temporary location and use that ticket for authentication
*
* @return void
*/
public function copyTicket(): void {
if (!$this->checkTicket()) {
return;
}
$krb5 = new \KRB5CCache();
$krb5->open($this->ticketName);
$tmpFilename = tempnam("/tmp", "krb5cc_php_");
$tmpCacheFile = "FILE:" . $tmpFilename;
$krb5->save($tmpCacheFile);
$this->ticketPath = $tmpFilename;
$this->ticketName = $tmpCacheFile;
}
/**
* Pass the ticket to smbclient by memory instead of path
*
* @return void
*/
public function passTicketFromMemory(): void {
if (!$this->checkTicket()) {
return;
}
$krb5 = new \KRB5CCache();
$krb5->open($this->ticketName);
$this->ticketName = (string)$krb5->getName();
}
/**
* Check if a valid kerberos ticket is present
*
* @return bool
* @psalm-assert-if-true string $this->ticketName
*/
public function checkTicket(): bool {
//read apache kerberos ticket cache
if (!$this->ticketName) {
return false;
}
$krb5 = new \KRB5CCache();
$krb5->open($this->ticketName);
/** @psalm-suppress MixedArgument */
return count($krb5->getEntries()) > 0;
}
private function init(): void {
if ($this->init) {
return;
}
$this->init = true;
// inspired by https://git.typo3.org/TYPO3CMS/Extensions/fal_cifs.git
if (!extension_loaded("krb5")) {
// https://pecl.php.net/package/krb5
throw new DependencyException('Ensure php-krb5 is installed.');
}
//read apache kerberos ticket cache
if (!$this->checkTicket()) {
throw new Exception('No kerberos ticket cache environment variable (KRB5CCNAME) found.');
}
// note that even if the ticketname is the value we got from `getenv("KRB5CCNAME")` we still need to set the env variable ourselves
// this is because `getenv` also reads the variables passed from the SAPI (apache-php) and we need to set the variable in the OS's env
putenv("KRB5CCNAME=" . $this->ticketName);
}
public function getExtraCommandLineArguments(): string {
$this->init();
return parent::getExtraCommandLineArguments();
}
public function setExtraSmbClientOptions($smbClientState): void {
$this->init();
try {
parent::setExtraSmbClientOptions($smbClientState);
} catch (Exception $e) {
// suppress
}
}
public function __destruct() {
if (!empty($this->ticketPath) && file_exists($this->ticketPath) && is_file($this->ticketPath)) {
unlink($this->ticketPath);
}
}
}
| icewind1991/SMB | src/KerberosApacheAuth.php | PHP | mit | 3,766 |
/* adddma.c
*/
#include <lib.h>
#define adddma _adddma
#include <unistd.h>
#include <stdarg.h>
int adddma(proc_e, start, size)
endpoint_t proc_e;
phys_bytes start;
phys_bytes size;
{
message m;
m.m2_i1= proc_e;
m.m2_l1= start;
m.m2_l2= size;
return _syscall(MM, ADDDMA, &m);
}
| ducis/operating-system-labs | src.clean/lib/libc/other/_adddma.c | C | mit | 314 |
module Trinidad
module Extensions
class BarOptionsExtension < OptionsExtension
def configure(parser, default_options)
default_options ||= {}
default_options[:bar] = true
end
end
end
end
| trinidad/trinidad | spec/fixtures/trinidad_bar_extension.rb | Ruby | mit | 226 |
require "heroku/command/base"
require "base64"
require "excon"
# manage organization accounts
#
class Heroku::Command::Orgs < Heroku::Command::Base
# orgs
#
# lists the orgs that you are a member of.
#
#
def index
response = org_api.get_orgs.body
orgs = []
response.fetch('organizations', []).each do |org|
orgs << org
org.fetch('child_orgs', []).each do |child|
orgs << child
end
end
default = response['user']['default_organization'] || ""
orgs.map! do |org|
name = org["organization_name"]
t = []
t << org["role"]
t << 'default' if name == default
[name, t.join(', ')]
end
if orgs.empty?
display("You are not a member of any organizations.")
else
styled_array(orgs)
end
end
# orgs:open --org ORG
#
# opens the org interface in a browser
#
#
def open
launchy("Opening web interface for #{org}", "https://dashboard.heroku.com/orgs/#{org}/apps")
end
# orgs:default [TARGET]
#
# sets the default org.
# TARGET can be an org you belong to or it can be "personal"
# for your personal account. If no argument or option is given,
# the default org is displayed
#
#
def default
options[:ignore_no_org] = true
if target = shift_argument
options[:org] = target
end
if org == "personal" || options[:personal]
action("Setting personal account as default") do
org_api.remove_default_org
end
elsif org && !options[:using_default_org]
action("Setting #{org} as the default organization") do
org_api.set_default_org(org)
end
elsif org
display("#{org} is the default organization.")
else
display("Personal account is default.")
end
end
end
| soilforlifeforms/forms | vendor/bundle/ruby/2.0.0/gems/heroku-3.3.0/lib/heroku/command/orgs.rb | Ruby | mit | 1,786 |
var assert = require('assert');
var _ = require('@sailshq/lodash');
var SchemaBuilder = require('../lib/waterline-schema');
describe('Has Many Through :: ', function() {
describe('Junction Tables', function() {
var schema;
before(function() {
var fixtures = [
{
identity: 'user',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
cars: {
collection: 'car',
through: 'drive',
via: 'user'
}
}
},
{
identity: 'drive',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
car: {
model: 'car'
},
user: {
model: 'user'
}
}
},
{
identity: 'car',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
drivers: {
collection: 'user',
through: 'drive',
via: 'car'
}
}
}
];
var collections = _.map(fixtures, function(obj) {
var collection = function() {};
collection.prototype = obj;
return collection;
});
// Build the schema
schema = SchemaBuilder(collections);
});
it('should flag the "through" table and not mark it as a junction table', function() {
assert(schema.drive);
assert(!schema.drive.junctionTable);
assert(schema.drive.throughTable);
});
});
describe('Reference Mapping', function() {
var schema;
before(function() {
var fixtures = [
{
identity: 'foo',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
bars: {
collection: 'bar',
through: 'foobar',
via: 'foo'
}
}
},
{
identity: 'foobar',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
type: {
type: 'string'
},
foo: {
model: 'foo',
columnName: 'foo_id'
},
bar: {
model: 'bar',
columnName: 'bar_id'
}
}
},
{
identity: 'bar',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
foo: {
collection: 'foo',
through: 'foobar',
via: 'bar'
}
}
}
];
var collections = _.map(fixtures, function(obj) {
var collection = function() {};
collection.prototype = obj;
return collection;
});
// Build the schema
schema = SchemaBuilder(collections);
});
it('should update the parent collection to point to the join table', function() {
assert.equal(schema.foo.schema.bars.references, 'foobar');
assert.equal(schema.foo.schema.bars.on, 'foo_id');
});
});
});
| jhelbig/postman-linux-app | app/resources/app/node_modules/waterline-schema/test/hasManyThrough.js | JavaScript | mit | 3,283 |
package sacloud
// IPv6Addr IPアドレス(IPv6)
type IPv6Addr struct {
HostName string `json:",omitempty"` // ホスト名
IPv6Addr string `json:",omitempty"` // IPv6アドレス
Interface *Interface `json:",omitempty"` // インターフェース
IPv6Net *IPv6Net `json:",omitempty"` // IPv6サブネット
}
// GetIPv6NetID IPv6アドレスが所属するIPv6NetのIDを取得
func (a *IPv6Addr) GetIPv6NetID() int64 {
if a.IPv6Net != nil {
return a.IPv6Net.ID
}
return 0
}
// GetInternetID IPv6アドレスを所有するルータ+スイッチ(Internet)のIDを取得
func (a *IPv6Addr) GetInternetID() int64 {
if a.IPv6Net != nil && a.IPv6Net.Switch != nil && a.IPv6Net.Switch.Internet != nil {
return a.IPv6Net.Switch.Internet.ID
}
return 0
}
// CreateNewIPv6Addr IPv6アドレス作成
func CreateNewIPv6Addr() *IPv6Addr {
return &IPv6Addr{
IPv6Net: &IPv6Net{
Resource: &Resource{},
},
}
}
| aantono/traefik | vendor/github.com/sacloud/libsacloud/sacloud/ipv6addr.go | GO | mit | 939 |
using System;
using System.Runtime.InteropServices;
using Duality;
using Duality.Drawing;
using Duality.Resources;
namespace DynamicLighting
{
[StructLayout(LayoutKind.Sequential)]
public struct VertexC1P3T2A4 : IVertexData
{
public static readonly VertexDeclaration Declaration = VertexDeclaration.Get<VertexC1P3T2A4>();
[VertexElement(VertexElementRole.Color)]
public ColorRgba Color;
[VertexElement(VertexElementRole.Position)]
public Vector3 Pos;
[VertexElement(VertexElementRole.TexCoord)]
public Vector2 TexCoord;
public Vector4 Attrib;
// Add Vector3 for lighting world position, see note in Light.cs
Vector3 IVertexData.Pos
{
get { return this.Pos; }
set { this.Pos = value; }
}
ColorRgba IVertexData.Color
{
get { return this.Color; }
set { this.Color = value; }
}
VertexDeclaration IVertexData.Declaration
{
get { return Declaration; }
}
}
}
| RockyTV/duality | Samples/DynamicLighting/Core/VertexC1P3T2A4.cs | C# | mit | 914 |
package engine.actions;
import engine.gameObject.GameObject;
import authoring.model.collections.GameObjectsCollection;
public class FixedCollisionTypeAction extends PhysicsTypeAction {
public FixedCollisionTypeAction (String type, String secondType, Double value) {
super(type, secondType, value);
// TODO Auto-generated constructor stub
}
@Override
public void applyPhysics (GameObjectsCollection myObjects) {
GameObject firstCollisionObject = null;
GameObject secondCollisionObject = null;
for (GameObject g : myObjects){
if (g.getIdentifier().getType().equals(myType) && g.isCollisionEnabled()){
firstCollisionObject = g;
}
if (g.getIdentifier().getType().equals(mySecondType) && g.isCollisionEnabled()){
secondCollisionObject = g;
}
}
myCollision.fixedCollision(firstCollisionObject, secondCollisionObject);
}
}
| goose2460/game_author_cs308 | src/engine/actions/FixedCollisionTypeAction.java | Java | mit | 989 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.